Skip to content

Commit

Permalink
Added isvertical/iscustom to GetMetaData
Browse files Browse the repository at this point in the history
  • Loading branch information
ernstdevreedeKNMI committed Sep 16, 2024
1 parent 90c3e5e commit 90d7b1b
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
19 changes: 18 additions & 1 deletion adagucserverEC/CServerConfig_CPPXSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -1226,6 +1226,8 @@ class CServerConfig : public CXMLSerializerInterface {
public:
CT::string name, interval, defaultV, units, quantizeperiod, quantizemethod, fixvalue;
bool hidden = false;
bool isvertical = false;
bool iscustom = false;
} attr;
void addAttribute(const char *attrname, const char *attrvalue) {
if (equals("name", attrname)) {
Expand Down Expand Up @@ -1253,11 +1255,26 @@ class CServerConfig : public CXMLSerializerInterface {
if (equals("true", attrvalue)) {
attr.hidden = true;
}

return;
} else if (equals("quantizemethod", attrname)) {
attr.quantizemethod.copy(attrvalue);
return;
} else if (equals("isvertical", attrname)) {
if (equals("false", attrvalue)) {
attr.isvertical = false;
}
if (equals("true", attrvalue)) {
attr.isvertical = true;
}
return;
} else if (equals("iscustom", attrname)) {
if (equals("false", attrvalue)) {
attr.iscustom = false;
}
if (equals("true", attrvalue)) {
attr.iscustom = true;
}
return;
}
}
};
Expand Down
2 changes: 2 additions & 0 deletions adagucserverEC/Types/LayerMetadataType.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ struct LayerMetadataDim {
CT::string defaultValue;
int hasMultipleValues;
bool hidden;
bool isvertical;
bool iscustom;
};

struct LayerMetadataProjection {
Expand Down
4 changes: 4 additions & 0 deletions adagucserverEC/utils/LayerMetadataStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ int getDimensionListAsJson(MetadataLayer *metadataLayer, json &dimListJson) {
item["defaultValue"] = dimension.defaultValue.c_str();
item["hasMultipleValues"] = dimension.hasMultipleValues;
item["hidden"] = dimension.hidden;
item["isvertical"] = dimension.isvertical;
item["iscustom"] = dimension.iscustom;
item["name"] = dimension.name.c_str();
item["units"] = dimension.units.c_str();
item["values"] = dimension.values.c_str();
Expand Down Expand Up @@ -371,6 +373,8 @@ int loadLayerDimensionListFromMetadataDb(MetadataLayer *metadataLayer) {
.defaultValue = dimensionProperties["defaultValue"].get<std::string>().c_str(),
.hasMultipleValues = dimensionProperties["hasMultipleValues"].get<int>(),
.hidden = dimensionProperties["hidden"].get<bool>(),
.isvertical = dimensionProperties["isvertical"].get<bool>(),
.iscustom = dimensionProperties["iscustom"].get<bool>(),
};
metadataLayer->layerMetadata.dimList.push_back(dimension);
}
Expand Down
15 changes: 15 additions & 0 deletions adagucserverEC/utils/XMLGenUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ int getDimsForLayer(MetadataLayer *metadataLayer) {
dim.defaultValue.copy(fileDate.c_str());
dim.hasMultipleValues = true;
dim.hidden = false;
dim.isvertical = false;
dim.iscustom = false;
metadataLayer->layerMetadata.dimList.push_back(dim);
break;
}
Expand All @@ -188,6 +190,8 @@ int getDimsForLayer(MetadataLayer *metadataLayer) {
// Create a new dim to store in the layer
LayerMetadataDim dim;
dim.hidden = false;
dim.isvertical = false;
dim.iscustom = false;
dim.name.copy(metadataLayer->dataSource->cfgLayer->Dimension[i]->value.c_str());

// Get the tablename
Expand Down Expand Up @@ -556,6 +560,17 @@ int getDimsForLayer(MetadataLayer *metadataLayer) {
if (metadataLayer->dataSource->cfgLayer->Dimension[i]->attr.hidden == true) {
dim.hidden = true;
}

// Check if dim is vertical dim
if (metadataLayer->dataSource->cfgLayer->Dimension[i]->attr.isvertical == true) {
dim.isvertical = true;
}

// Check if dim is custom dim
if (metadataLayer->dataSource->cfgLayer->Dimension[i]->attr.iscustom == true) {
dim.iscustom = true;
}

metadataLayer->layerMetadata.dimList.push_back(dim);
}
}
Expand Down

0 comments on commit 90d7b1b

Please sign in to comment.