|
|
|
@ -3978,10 +3978,21 @@ MmsMapping_stopEventWorkerThread(MmsMapping* self)
|
|
|
|
|
DataSet*
|
|
|
|
|
MmsMapping_createDataSetByNamedVariableList(MmsMapping* self, MmsNamedVariableList variableList)
|
|
|
|
|
{
|
|
|
|
|
DataSet* dataSet = (DataSet*) GLOBAL_MALLOC(sizeof(DataSet));
|
|
|
|
|
DataSet* dataSet = (DataSet*) GLOBAL_CALLOC(1, sizeof(DataSet));
|
|
|
|
|
|
|
|
|
|
if (variableList->domain != NULL)
|
|
|
|
|
dataSet->logicalDeviceName = MmsDomain_getName(variableList->domain) + strlen(self->model->name);
|
|
|
|
|
if (dataSet) {
|
|
|
|
|
|
|
|
|
|
if (variableList->domain != NULL) {
|
|
|
|
|
LogicalDevice* ld = IedModel_getDevice(self->model, MmsDomain_getName(variableList->domain));
|
|
|
|
|
|
|
|
|
|
if (ld) {
|
|
|
|
|
dataSet->logicalDeviceName = ld->name;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if (DEBUG_IED_SERVER)
|
|
|
|
|
printf("IED_SERVER: LD lookup error!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
dataSet->logicalDeviceName = NULL; /* name is not relevant for association specific data sets */
|
|
|
|
|
|
|
|
|
@ -3995,10 +4006,16 @@ MmsMapping_createDataSetByNamedVariableList(MmsMapping* self, MmsNamedVariableLi
|
|
|
|
|
while (element != NULL) {
|
|
|
|
|
MmsAccessSpecifier* listEntry = (MmsAccessSpecifier*) element->data;
|
|
|
|
|
|
|
|
|
|
LogicalDevice* entryLd = IedModel_getDevice(self->model, MmsDomain_getName(listEntry->domain));
|
|
|
|
|
|
|
|
|
|
if (entryLd) {
|
|
|
|
|
|
|
|
|
|
DataSetEntry* dataSetEntry = (DataSetEntry*) GLOBAL_MALLOC(sizeof(DataSetEntry));
|
|
|
|
|
|
|
|
|
|
if (dataSetEntry) {
|
|
|
|
|
|
|
|
|
|
/* use variable name part of domain name as logicalDeviceName */
|
|
|
|
|
dataSetEntry->logicalDeviceName = MmsDomain_getName(listEntry->domain) + strlen(self->model->name);
|
|
|
|
|
dataSetEntry->logicalDeviceName = entryLd->name;
|
|
|
|
|
dataSetEntry->variableName = listEntry->variableName;
|
|
|
|
|
dataSetEntry->index = listEntry->arrayIndex;
|
|
|
|
|
dataSetEntry->componentName = listEntry->componentName;
|
|
|
|
@ -4055,9 +4072,16 @@ MmsMapping_createDataSetByNamedVariableList(MmsMapping* self, MmsNamedVariableLi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastDataSetEntry = dataSetEntry;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if (DEBUG_IED_SERVER)
|
|
|
|
|
printf("IED_SERVER: LD lookup error!\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
element = LinkedList_getNext(element);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return dataSet;
|
|
|
|
|
}
|
|
|
|
|