|
|
|
|
@@ -44,7 +44,7 @@ void AQHREACT_Unit_free(AQHREACT_UNIT *unit)
|
|
|
|
|
if (unit) {
|
|
|
|
|
GWEN_LIST_FINI(AQHREACT_UNIT, unit);
|
|
|
|
|
GWEN_INHERIT_FINI(AQHREACT_UNIT, unit);
|
|
|
|
|
free(unit->name);
|
|
|
|
|
free(unit->typeName);
|
|
|
|
|
free(unit->description);
|
|
|
|
|
AQHREACT_Port_List_free(unit->outputPortList);
|
|
|
|
|
AQHREACT_Port_List_free(unit->inputPortList);
|
|
|
|
|
@@ -62,18 +62,18 @@ AQHOME_REACT *AQHREACT_Unit_GetAqHomeReact(const AQHREACT_UNIT *unit)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const char *AQHREACT_Unit_GetName(const AQHREACT_UNIT *unit)
|
|
|
|
|
const char *AQHREACT_Unit_GetTypeName(const AQHREACT_UNIT *unit)
|
|
|
|
|
{
|
|
|
|
|
return unit?unit->name:NULL;
|
|
|
|
|
return unit?unit->typeName:NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void AQHREACT_Unit_SetName(AQHREACT_UNIT *unit, const char *s)
|
|
|
|
|
void AQHREACT_Unit_SetTypeName(AQHREACT_UNIT *unit, const char *s)
|
|
|
|
|
{
|
|
|
|
|
if (unit) {
|
|
|
|
|
free(unit->name);
|
|
|
|
|
unit->name=s?strdup(s):NULL;
|
|
|
|
|
free(unit->typeName);
|
|
|
|
|
unit->typeName=s?strdup(s):NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -314,7 +314,7 @@ double AQHREACT_Unit_GetParamValueDouble(const AQHREACT_UNIT *unit, const char *
|
|
|
|
|
return AQHREACT_Param_GetDoubleValue(param);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
DBG_INFO(NULL, "Datatype for param \"%s/%s\" is not DOUBLE", (unit->name)?unit->name:"<unnamed>", paramName);
|
|
|
|
|
DBG_INFO(NULL, "Datatype for param \"%s/%s\" is not DOUBLE", (unit->typeName)?unit->typeName:"<unnamed>", paramName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -333,11 +333,11 @@ void AQHREACT_Unit_SetParamValueDouble(AQHREACT_UNIT *unit, const char *paramNam
|
|
|
|
|
AQHREACT_Param_SetDoubleValue(param, val);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
DBG_INFO(NULL, "Datatype for param \"%s/%s\" is not DOUBLE", (unit->name)?unit->name:"<unnamed>", paramName);
|
|
|
|
|
DBG_INFO(NULL, "Datatype for param \"%s/%s\" is not DOUBLE", (unit->typeName)?unit->typeName:"<unnamed>", paramName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
DBG_INFO(NULL, "Param \"%s\" not found in unit %s", paramName, (unit->name)?unit->name:"<unnamed>");
|
|
|
|
|
DBG_INFO(NULL, "Param \"%s\" not found in unit %s", paramName, (unit->typeName)?unit->typeName:"<unnamed>");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -353,11 +353,11 @@ const char *AQHREACT_Unit_GetParamValueString(const AQHREACT_UNIT *unit, const c
|
|
|
|
|
return AQHREACT_Param_GetStringValue(param);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
DBG_INFO(NULL, "Datatype for param \"%s/%s\" is not STRING", (unit->name)?unit->name:"<unnamed>", paramName);
|
|
|
|
|
DBG_INFO(NULL, "Datatype for param \"%s/%s\" is not STRING", (unit->typeName)?unit->typeName:"<unnamed>", paramName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
DBG_INFO(NULL, "Param \"%s\" not found in unit %s", paramName, (unit->name)?unit->name:"<unnamed>");
|
|
|
|
|
DBG_INFO(NULL, "Param \"%s\" not found in unit %s", paramName, (unit->typeName)?unit->typeName:"<unnamed>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return defVal;
|
|
|
|
|
@@ -379,7 +379,7 @@ void AQHREACT_Unit_SetParamValueString(AQHREACT_UNIT *unit, const char *paramNam
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
DBG_INFO(NULL, "Param \"%s\" not found in unit %s", paramName, (unit->name)?unit->name:"<unnamed>");
|
|
|
|
|
DBG_INFO(NULL, "Param \"%s\" not found in unit %s", paramName, (unit->typeName)?unit->typeName:"<unnamed>");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -603,7 +603,7 @@ void AQHREACT_Unit_Dump(const AQHREACT_UNIT *unit, GWEN_BUFFER *buf, int indent)
|
|
|
|
|
|
|
|
|
|
if (indent)
|
|
|
|
|
GWEN_Buffer_FillWithBytes(buf, ' ', indent);
|
|
|
|
|
GWEN_Buffer_AppendArgs(buf, "type.......: %s\n", (unit->name)?(unit->name):"<empty>");
|
|
|
|
|
GWEN_Buffer_AppendArgs(buf, "type.......: %s\n", (unit->typeName)?(unit->typeName):"<empty>");
|
|
|
|
|
|
|
|
|
|
if (indent)
|
|
|
|
|
GWEN_Buffer_FillWithBytes(buf, ' ', indent);
|
|
|
|
|
|