Commit 15a5ce9c authored by Gabriel Wlazłowski's avatar Gabriel Wlazłowski
Browse files

Added wdata_setconst_unit

No related merge requests found
Showing with 25 additions and 0 deletions
+25 -0
......@@ -868,6 +868,26 @@ void wdata_setconst(wdata_metadata *md, const char *constname, double constvalue
return;
}
void wdata_setconst_unit(wdata_metadata *md, const char *constname, double constvalue, const char *unit)
{
int i;
for (i = 0; i < md->nconsts; i++)
if (strcmp(md->consts[i].name, constname) == 0)
{
md->consts[i].value = constvalue;
return;
}
wdata_const _const;
strcpy(_const.name, constname);
strcpy(_const.unit, unit);
_const.value = constvalue;
md->consts[md->nconsts] = _const;
md->nconsts++;
return;
}
int wdata_file_exists(wdata_metadata *md, const char *varname)
{
wdata_goto_wrkdir(md);
......
......@@ -244,6 +244,11 @@ extern "C"
* Functions sets value of constant. If constant was not added before it adds it and sets its value.
* */
void wdata_setconst(wdata_metadata *md, const char *constname, double constvalue);
/**
* Functions sets value of constant and corresponding unit. If constant was not added before it adds it and sets its value.
* */
void wdata_setconst_unit(wdata_metadata *md, const char *constname, double constvalue, const char *unit);
/**
* Function checks if binary file exists for variable.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment