From 7ee7edffecec715b432181d9864dfc3d4ac09c7a Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Thu, 18 Apr 2024 23:28:27 +0200 Subject: [PATCH] aqhome-react: rename "name" to "typeName" in AQHREACT_Unit --- apps/aqhome-react/aqhome_react.c | 2 +- apps/aqhome-react/types/link.c | 2 +- apps/aqhome-react/types/unit.c | 26 ++++++++++---------- apps/aqhome-react/types/unit.h | 4 +-- apps/aqhome-react/types/unit_p.h | 2 +- apps/aqhome-react/units/u_highpass.c | 2 +- apps/aqhome-react/units/u_logical.c | 8 +++--- apps/aqhome-react/units/u_lowpass.c | 2 +- apps/aqhome-react/units/u_module.c | 16 ++++++------ apps/aqhome-react/units/u_passthrough.c | 2 +- apps/aqhome-react/units/u_stabilize.c | 2 +- apps/aqhome-react/units/u_timer.c | 2 +- apps/aqhome-react/units/u_valuefilter.c | 2 +- apps/aqhome-react/units/u_valueset.c | 2 +- apps/aqhome-react/units/u_varchanges.c | 2 +- apps/aqhome-react/units/u_zeroposnegstring.c | 2 +- 16 files changed, 39 insertions(+), 39 deletions(-) diff --git a/apps/aqhome-react/aqhome_react.c b/apps/aqhome-react/aqhome_react.c index cbc01e4..060a51e 100644 --- a/apps/aqhome-react/aqhome_react.c +++ b/apps/aqhome-react/aqhome_react.c @@ -180,7 +180,7 @@ AQHREACT_UNIT *AqHomeReact_CreateUnitByName(AQHOME_REACT *aqh, const char *unitT else { const char *s; - s=AQHREACT_Unit_GetName(unit); + s=AQHREACT_Unit_GetTypeName(unit); if (!(s && *s && strcasecmp(s, unitType)==0)) { DBG_ERROR(NULL, "ERROR: Network file for type \"%s\" contains type \"%s\" instead", unitType, s?s:""); AQHREACT_Unit_free(unit); diff --git a/apps/aqhome-react/types/link.c b/apps/aqhome-react/types/link.c index ab337c2..d9994cc 100644 --- a/apps/aqhome-react/types/link.c +++ b/apps/aqhome-react/types/link.c @@ -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) diff --git a/apps/aqhome-react/types/unit.c b/apps/aqhome-react/types/unit.c index 71b0426..43c58c4 100644 --- a/apps/aqhome-react/types/unit.c +++ b/apps/aqhome-react/types/unit.c @@ -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:"", paramName); + DBG_INFO(NULL, "Datatype for param \"%s/%s\" is not DOUBLE", (unit->typeName)?unit->typeName:"", 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:"", paramName); + DBG_INFO(NULL, "Datatype for param \"%s/%s\" is not DOUBLE", (unit->typeName)?unit->typeName:"", paramName); } } else { - DBG_INFO(NULL, "Param \"%s\" not found in unit %s", paramName, (unit->name)?unit->name:""); + DBG_INFO(NULL, "Param \"%s\" not found in unit %s", paramName, (unit->typeName)?unit->typeName:""); } } @@ -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:"", paramName); + DBG_INFO(NULL, "Datatype for param \"%s/%s\" is not STRING", (unit->typeName)?unit->typeName:"", paramName); } } else { - DBG_INFO(NULL, "Param \"%s\" not found in unit %s", paramName, (unit->name)?unit->name:""); + DBG_INFO(NULL, "Param \"%s\" not found in unit %s", paramName, (unit->typeName)?unit->typeName:""); } 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:""); + DBG_INFO(NULL, "Param \"%s\" not found in unit %s", paramName, (unit->typeName)?unit->typeName:""); } } @@ -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):""); + GWEN_Buffer_AppendArgs(buf, "type.......: %s\n", (unit->typeName)?(unit->typeName):""); if (indent) GWEN_Buffer_FillWithBytes(buf, ' ', indent); diff --git a/apps/aqhome-react/types/unit.h b/apps/aqhome-react/types/unit.h index 24b668c..32dca05 100644 --- a/apps/aqhome-react/types/unit.h +++ b/apps/aqhome-react/types/unit.h @@ -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); diff --git a/apps/aqhome-react/types/unit_p.h b/apps/aqhome-react/types/unit_p.h index be26176..daef767 100644 --- a/apps/aqhome-react/types/unit_p.h +++ b/apps/aqhome-react/types/unit_p.h @@ -18,7 +18,7 @@ struct AQHREACT_UNIT { GWEN_LIST_ELEMENT(AQHREACT_UNIT) AQHOME_REACT *aqHomeReact; - char *name; + char *typeName; char *description; char *id; diff --git a/apps/aqhome-react/units/u_highpass.c b/apps/aqhome-react/units/u_highpass.c index 7cfbdc2..2c42085 100644 --- a/apps/aqhome-react/units/u_highpass.c +++ b/apps/aqhome-react/units/u_highpass.c @@ -47,7 +47,7 @@ AQHREACT_UNIT *AqHomeReact_UnitHighPass_new(AQHOME_REACT *aqh) AQHREACT_PARAM *param; unit=AQHREACT_Unit_new(aqh); - AQHREACT_Unit_SetName(unit, "highpass"); + AQHREACT_Unit_SetTypeName(unit, "highpass"); AQHREACT_Unit_SetDescription(unit, "Highpass filter for data"); AQHREACT_Unit_SetInputDataFn(unit, _cbInputData); diff --git a/apps/aqhome-react/units/u_logical.c b/apps/aqhome-react/units/u_logical.c index caa6cdd..4a2dfe4 100644 --- a/apps/aqhome-react/units/u_logical.c +++ b/apps/aqhome-react/units/u_logical.c @@ -51,7 +51,7 @@ AQHREACT_UNIT *AqHomeReact_UnitOr_new(AQHOME_REACT *aqh) AQHREACT_UNIT *unit; unit=_unitLogical_new(aqh); - AQHREACT_Unit_SetName(unit, "or"); + AQHREACT_Unit_SetTypeName(unit, "or"); AQHREACT_Unit_SetDescription(unit, "Logical OR inputs"); AQHREACT_Unit_SetProcessFn(unit, _cbProcessOr); return unit; @@ -64,7 +64,7 @@ AQHREACT_UNIT *AqHomeReact_UnitAnd_new(AQHOME_REACT *aqh) AQHREACT_UNIT *unit; unit=_unitLogical_new(aqh); - AQHREACT_Unit_SetName(unit, "and"); + AQHREACT_Unit_SetTypeName(unit, "and"); AQHREACT_Unit_SetDescription(unit, "Logical AND inputs"); AQHREACT_Unit_SetProcessFn(unit, _cbProcessAnd); return unit; @@ -77,7 +77,7 @@ AQHREACT_UNIT *AqHomeReact_UnitXor_new(AQHOME_REACT *aqh) AQHREACT_UNIT *unit; unit=_unitLogical_new(aqh); - AQHREACT_Unit_SetName(unit, "xor"); + AQHREACT_Unit_SetTypeName(unit, "xor"); AQHREACT_Unit_SetDescription(unit, "Logical XOR inputs"); AQHREACT_Unit_SetProcessFn(unit, _cbProcessXor); return unit; @@ -92,7 +92,7 @@ AQHREACT_UNIT *_unitLogical_new(AQHOME_REACT *aqh) AQHREACT_PORT *port; unit=AQHREACT_Unit_new(aqh); - AQHREACT_Unit_SetName(unit, "or"); + AQHREACT_Unit_SetTypeName(unit, "or"); AQHREACT_Unit_SetDescription(unit, "Logical OR inputs"); AQHREACT_Unit_SetNextInputPortId(unit, AQHOMEREACT_UNIT_LOGICAL_INSLOT_AUTOINPUT); /* for auto-gen multi-slots */ diff --git a/apps/aqhome-react/units/u_lowpass.c b/apps/aqhome-react/units/u_lowpass.c index 0b5fd3d..0aa1a1e 100644 --- a/apps/aqhome-react/units/u_lowpass.c +++ b/apps/aqhome-react/units/u_lowpass.c @@ -47,7 +47,7 @@ AQHREACT_UNIT *AqHomeReact_UnitLowPass_new(AQHOME_REACT *aqh) AQHREACT_PARAM *param; unit=AQHREACT_Unit_new(aqh); - AQHREACT_Unit_SetName(unit, "lowpass"); + AQHREACT_Unit_SetTypeName(unit, "lowpass"); AQHREACT_Unit_SetDescription(unit, "Lowpass filter for data"); AQHREACT_Unit_SetInputDataFn(unit, _cbInputData); diff --git a/apps/aqhome-react/units/u_module.c b/apps/aqhome-react/units/u_module.c index 3a7bc5e..9a8249e 100644 --- a/apps/aqhome-react/units/u_module.c +++ b/apps/aqhome-react/units/u_module.c @@ -186,7 +186,7 @@ AQHREACT_UNIT *AqHomeReact_UnitModule_fromXml(AQHOME_REACT *aqh, GWEN_XMLNODE *x unit=AqHomeReact_UnitModule_new(aqh); xunit=(AQHREACT_UNIT_MODULE*)GWEN_INHERIT_GETDATA(AQHREACT_UNIT, AQHREACT_UNIT_MODULE, unit); - AQHREACT_Unit_SetName(unit, GWEN_XMLNode_GetProperty(xmlNode, "type", NULL)); + AQHREACT_Unit_SetTypeName(unit, GWEN_XMLNode_GetProperty(xmlNode, "type", NULL)); AQHREACT_Unit_SetId(unit, GWEN_XMLNode_GetProperty(xmlNode, "id", NULL)); _readProxyFromXml(xmlNode, xunit->paramProxyList, "paramdefs", "param", "name", "targetModule", "targetParam"); @@ -245,7 +245,7 @@ AQHREACT_PARAM *_cbGetParamByName(const AQHREACT_UNIT *unit, const char *paramNa { AQHREACT_UNIT_MODULE *xunit; - DBG_INFO(NULL, "Looking for param \"%s\" in proxy descr of module \"%s\"", paramName, AQHREACT_Unit_GetName(unit)); + DBG_INFO(NULL, "Looking for param \"%s\" in proxy descr of module \"%s\"", paramName, AQHREACT_Unit_GetTypeName(unit)); xunit=(AQHREACT_UNIT_MODULE*)GWEN_INHERIT_GETDATA(AQHREACT_UNIT, AQHREACT_UNIT_MODULE, unit); if (xunit) { const MODULE_PROXY_DESCR *pd; @@ -253,7 +253,7 @@ AQHREACT_PARAM *_cbGetParamByName(const AQHREACT_UNIT *unit, const char *paramNa pd=ModuleProxyDescr_List_FindByName(xunit->paramProxyList, paramName); if (pd) { DBG_INFO(NULL, "Found proxydescr for param (-> %s:%s)", - (pd->targetObjectPtr)?AQHREACT_Unit_GetName(pd->targetObjectPtr):"", + (pd->targetObjectPtr)?AQHREACT_Unit_GetTypeName(pd->targetObjectPtr):"", (pd->targetName)?(pd->targetName):""); return AQHREACT_Unit_GetParamByName(pd->targetObjectPtr, pd->targetName); } @@ -433,7 +433,7 @@ int _finishParams(AQHREACT_UNIT *unit) const char *unitName; xunit=(AQHREACT_UNIT_MODULE*)GWEN_INHERIT_GETDATA(AQHREACT_UNIT, AQHREACT_UNIT_MODULE, unit); - unitName=AQHREACT_Unit_GetName(unit); + unitName=AQHREACT_Unit_GetTypeName(unit); pd=ModuleProxyDescr_List_First(xunit->paramProxyList); while(pd) { AQHREACT_UNIT *subUnit; @@ -561,7 +561,7 @@ int _readParamFromXml(AQHREACT_UNIT *unit, GWEN_XMLNODE *paramNode) } /* if value */ } else { - DBG_ERROR(NULL, "No param name \"%s\" in unit \"%s\"", paramName, AQHREACT_Unit_GetName(unit)); + DBG_ERROR(NULL, "No param name \"%s\" in unit \"%s\"", paramName, AQHREACT_Unit_GetTypeName(unit)); return GWEN_ERROR_BAD_DATA; } } @@ -616,7 +616,7 @@ int _readLinksFromXml(AQHOME_REACT *aqh, AQHREACT_UNIT *unit, GWEN_XMLNODE *xmlN rv=_readLinkFromXml(aqh, unit, n); if (rv<0) { - DBG_ERROR(NULL, "Error reading link in net \"%s\" (%d)", AQHREACT_Unit_GetName(unit), rv); + DBG_ERROR(NULL, "Error reading link in net \"%s\" (%d)", AQHREACT_Unit_GetTypeName(unit), rv); return GWEN_ERROR_BAD_DATA; } n=GWEN_XMLNode_FindNextTag(n, "link", NULL, NULL); @@ -644,7 +644,7 @@ int _readLinkFromXml(AQHOME_REACT *aqh, AQHREACT_UNIT *unit, GWEN_XMLNODE *linkN receivingUnitName && *receivingUnitName && receivingPortName && *receivingPortName)) { DBG_ERROR(NULL, "Link in net \"%s\" needs properties sourceUnit, sourcePort, targetUnit and targetPort", - AQHREACT_Unit_GetName(unit)); + AQHREACT_Unit_GetTypeName(unit)); return GWEN_ERROR_BAD_DATA; } @@ -689,7 +689,7 @@ int _linkFromThisModulesInput(AQHOME_REACT *aqh, emittingPort=AQHREACT_Unit_GetInputPortByName(unit, emittingPortName); /* find in modules input port list! */ if (emittingPort==NULL) { - DBG_ERROR(NULL, "Target port \"%s\" not found for source unit \"%s\"", emittingPortName, AQHREACT_Unit_GetName(unit)); + DBG_ERROR(NULL, "Target port \"%s\" not found for source unit \"%s\"", emittingPortName, AQHREACT_Unit_GetTypeName(unit)); return GWEN_ERROR_NOT_FOUND; } diff --git a/apps/aqhome-react/units/u_passthrough.c b/apps/aqhome-react/units/u_passthrough.c index 048440b..853aa0c 100644 --- a/apps/aqhome-react/units/u_passthrough.c +++ b/apps/aqhome-react/units/u_passthrough.c @@ -43,7 +43,7 @@ AQHREACT_UNIT *AqHomeReact_UnitPassthrough_new(AQHOME_REACT *aqh) AQHREACT_PORT *port; unit=AQHREACT_Unit_new(aqh); - AQHREACT_Unit_SetName(unit, "passthrough"); + AQHREACT_Unit_SetTypeName(unit, "passthrough"); AQHREACT_Unit_SetDescription(unit, "Generic passthrough unit"); AQHREACT_Unit_SetInputDataFn(unit, _cbInputData); diff --git a/apps/aqhome-react/units/u_stabilize.c b/apps/aqhome-react/units/u_stabilize.c index ecd1e99..61bdbb3 100644 --- a/apps/aqhome-react/units/u_stabilize.c +++ b/apps/aqhome-react/units/u_stabilize.c @@ -73,7 +73,7 @@ AQHREACT_UNIT *AqHomeReact_UnitStabilize_new(AQHOME_REACT *aqh) GWEN_NEW_OBJECT(AQHREACT_UNIT_STABILIZE, xunit); GWEN_INHERIT_SETDATA(AQHREACT_UNIT, AQHREACT_UNIT_STABILIZE, unit, xunit, _freeData); - AQHREACT_Unit_SetName(unit, "stabilize"); + AQHREACT_Unit_SetTypeName(unit, "stabilize"); AQHREACT_Unit_SetDescription(unit, "Stabilize signal changes (only propagate changes stable for some time)"); AQHREACT_Unit_SetProcessFn(unit, _cbProcessFn); diff --git a/apps/aqhome-react/units/u_timer.c b/apps/aqhome-react/units/u_timer.c index 944126d..f4781a7 100644 --- a/apps/aqhome-react/units/u_timer.c +++ b/apps/aqhome-react/units/u_timer.c @@ -22,7 +22,7 @@ AQHREACT_UNIT *AqHomeReact_UnitTimer_new(AQHOME_REACT *aqh) AQHREACT_UNIT *unit; unit=AqHomeReact_UnitPassthrough_new(aqh); - AQHREACT_Unit_SetName(unit, "timer"); + AQHREACT_Unit_SetTypeName(unit, "timer"); AQHREACT_Unit_SetDescription(unit, "Periodically generate a timer signal"); return unit; diff --git a/apps/aqhome-react/units/u_valuefilter.c b/apps/aqhome-react/units/u_valuefilter.c index bcf7877..39c5cf2 100644 --- a/apps/aqhome-react/units/u_valuefilter.c +++ b/apps/aqhome-react/units/u_valuefilter.c @@ -48,7 +48,7 @@ AQHREACT_UNIT *AqHomeReact_UnitValueFilter_new(AQHOME_REACT *aqh) AQHREACT_PARAM *param; unit=AQHREACT_Unit_new(aqh); - AQHREACT_Unit_SetName(unit, "valuefilter"); + AQHREACT_Unit_SetTypeName(unit, "valuefilter"); AQHREACT_Unit_SetDescription(unit, "Filter values received from unit VarChanges by value path"); AQHREACT_Unit_SetInputDataFn(unit, _cbInputData); diff --git a/apps/aqhome-react/units/u_valueset.c b/apps/aqhome-react/units/u_valueset.c index c792da7..23d9939 100644 --- a/apps/aqhome-react/units/u_valueset.c +++ b/apps/aqhome-react/units/u_valueset.c @@ -54,7 +54,7 @@ AQHREACT_UNIT *AqHomeReact_UnitValueSet_new(AQHOME_REACT *aqh) AQHREACT_PARAM *param; unit=AQHREACT_Unit_new(aqh); - AQHREACT_Unit_SetName(unit, "valueset"); + AQHREACT_Unit_SetTypeName(unit, "valueset"); AQHREACT_Unit_SetDescription(unit, "Set value by value path"); AQHREACT_Unit_SetInputDataFn(unit, _cbInputData); diff --git a/apps/aqhome-react/units/u_varchanges.c b/apps/aqhome-react/units/u_varchanges.c index 3822c34..7f2e9c5 100644 --- a/apps/aqhome-react/units/u_varchanges.c +++ b/apps/aqhome-react/units/u_varchanges.c @@ -22,7 +22,7 @@ AQHREACT_UNIT *AqHomeReact_UnitVarChanges_new(AQHOME_REACT *aqh) AQHREACT_UNIT *unit; unit=AqHomeReact_UnitPassthrough_new(aqh); - AQHREACT_Unit_SetName(unit, "varchanges"); + AQHREACT_Unit_SetTypeName(unit, "varchanges"); AQHREACT_Unit_SetDescription(unit, "Propagates changes of values on the data server"); return unit; diff --git a/apps/aqhome-react/units/u_zeroposnegstring.c b/apps/aqhome-react/units/u_zeroposnegstring.c index 429e6a6..721f260 100644 --- a/apps/aqhome-react/units/u_zeroposnegstring.c +++ b/apps/aqhome-react/units/u_zeroposnegstring.c @@ -48,7 +48,7 @@ AQHREACT_UNIT *AqHomeReact_UnitZeroPosNegString_new(AQHOME_REACT *aqh) AQHREACT_PARAM *param; unit=AQHREACT_Unit_new(aqh); - AQHREACT_Unit_SetName(unit, "zeroPosNegString"); + AQHREACT_Unit_SetTypeName(unit, "zeroPosNegString"); AQHREACT_Unit_SetDescription(unit, "Translate double value into strings for zero, positive, negative values"); AQHREACT_Unit_SetInputDataFn(unit, _cbInputData);