aqhome-react: rename "name" to "typeName" in AQHREACT_Unit

This commit is contained in:
Martin Preuss
2024-04-18 23:28:27 +02:00
parent e486a7e69d
commit 7ee7edffec
16 changed files with 39 additions and 39 deletions

View File

@@ -78,7 +78,7 @@ void AQHREACT_Link_Dump(const AQHREACT_LINK *lnk, GWEN_BUFFER *buf, int indent)
const char *unitId;
const char *portName;
unitName=(lnk->targetUnit)?AQHREACT_Unit_GetName(lnk->targetUnit):NULL;
unitName=(lnk->targetUnit)?AQHREACT_Unit_GetTypeName(lnk->targetUnit):NULL;
unitId=(lnk->targetUnit)?AQHREACT_Unit_GetId(lnk->targetUnit):NULL;
portName=(lnk->targetPort)?AQHREACT_Port_GetName(lnk->targetPort):NULL;
if (indent)

View File

@@ -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);

View File

@@ -44,8 +44,8 @@ void AQHREACT_Unit_free(AQHREACT_UNIT *unit);
AQHOME_REACT *AQHREACT_Unit_GetAqHomeReact(const AQHREACT_UNIT *unit);
const char *AQHREACT_Unit_GetName(const AQHREACT_UNIT *unit);
void AQHREACT_Unit_SetName(AQHREACT_UNIT *unit, const char *s);
const char *AQHREACT_Unit_GetTypeName(const AQHREACT_UNIT *unit);
void AQHREACT_Unit_SetTypeName(AQHREACT_UNIT *unit, const char *s);
const char *AQHREACT_Unit_GetDescription(const AQHREACT_UNIT *unit);
void AQHREACT_Unit_SetDescription(AQHREACT_UNIT *unit, const char *s);

View File

@@ -18,7 +18,7 @@ struct AQHREACT_UNIT {
GWEN_LIST_ELEMENT(AQHREACT_UNIT)
AQHOME_REACT *aqHomeReact;
char *name;
char *typeName;
char *description;
char *id;