Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 43 additions & 5 deletions heclib/heclib_c/src/Public/ztypeName.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,52 @@ const char *ztypeName(int recordType, int boolAbbreviation)
if (boolAbbreviation) return DATA_TYPE_ABBR_310;
return DATA_TYPE_310;
}
else if (recordType == DATA_TYPE_UGT) {
if (boolAbbreviation) return DATA_TYPE_ABBR_400;
return DATA_TYPE_400;
}

@perrymanmd perrymanmd Nov 6, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not

return boolAbbreviation ? DATA_TYPE_ABBR_400 : DATA_TYPE_400;

I would also suggest using switch(recordType) { instead of chaining else if blocks.

Just stylistic, doesn't affect my approval the PR

else if (recordType == DATA_TYPE_UG) {
if (boolAbbreviation) return DATA_TYPE_ABBR_401;
return DATA_TYPE_401;
}
else if (recordType == DATA_TYPE_HGT) {
if (boolAbbreviation) return DATA_TYPE_ABBR_410;
return DATA_TYPE_410;
}
else if (recordType == DATA_TYPE_HG) {
if (boolAbbreviation) return DATA_TYPE_ABBR_411;
return DATA_TYPE_411;
}
else if (recordType == DATA_TYPE_AGT) {
if (boolAbbreviation) return DATA_TYPE_ABBR_420;
return DATA_TYPE_420;
}
else if (recordType == DATA_TYPE_AG) {
if (boolAbbreviation) return DATA_TYPE_ABBR_421;
return DATA_TYPE_421;
}
else if (recordType == DATA_TYPE_SGT) {
if (boolAbbreviation) return DATA_TYPE_ABBR_430;
return DATA_TYPE_430;
}
else if (recordType == DATA_TYPE_SG) {
if (boolAbbreviation) return DATA_TYPE_ABBR_431;
return DATA_TYPE_431;
}
else if (recordType == DATA_TYPE_SPATIAL_TIN) {
//if (boolAbbreviation) return DATA_TYPE_450;
if (boolAbbreviation) return DATA_TYPE_ABBR_450;
return DATA_TYPE_450;
}



if (boolAbbreviation) return "UDF";
else if (recordType == DATA_TYPE_FILE) {
if (boolAbbreviation) return DATA_TYPE_ABBR_600;
return DATA_TYPE_600;
}
else if (recordType == DATA_TYPE_IMAGE) {
if (boolAbbreviation) return DATA_TYPE_ABBR_610;
return DATA_TYPE_610;
}

if (boolAbbreviation) return DATA_TYPE_ABBR_UNDEFINED;
return DATA_TYPE_UNDEFINED;
}

12 changes: 12 additions & 0 deletions heclib/heclib_c/src/headers/zdataTypeDescriptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,31 @@
#define DATA_TYPE_SG 431

#define DATA_TYPE_400 "Gridded - Undefined grid with time"
#define DATA_TYPE_ABBR_400 "GUT"
#define DATA_TYPE_401 "Gridded - Undefined grid"
#define DATA_TYPE_ABBR_401 "GU"
#define DATA_TYPE_410 "Gridded - HRAP grid with time reference"
#define DATA_TYPE_ABBR_410 "GHT"
#define DATA_TYPE_411 "Gridded - HRAP grid"
#define DATA_TYPE_ABBR_411 "GH"
#define DATA_TYPE_420 "Gridded - Albers with time reference"
#define DATA_TYPE_ABBR_420 "GAT"
#define DATA_TYPE_421 "Gridded - Albers"
#define DATA_TYPE_ABBR_421 "GA"
#define DATA_TYPE_430 "Gridded - Specified Grid with time reference"
#define DATA_TYPE_ABBR_430 "GST"
#define DATA_TYPE_431 "Gridded - Specified Grid"
#define DATA_TYPE_ABBR_431 "GS"
#define DATA_TYPE_450 "Spatial - TIN"
#define DATA_TYPE_ABBR_450 "TIN"

#define DATA_TYPE_600 "Generic File"
#define DATA_TYPE_ABBR_600 "FILE"
#define DATA_TYPE_610 "Image"
#define DATA_TYPE_ABBR_610 "IMAGE"

#define DATA_TYPE_UNDEFINED "Undefined data type"
#define DATA_TYPE_ABBR_UNDEFINED "UDF"



Expand Down
Loading