- added function IedModel_setIedNameForDynamicModel

pull/6/head
Michael Zillgith 10 years ago
parent c5e5165e7a
commit 97e8bd8f81

@ -55,6 +55,20 @@ extern "C" {
IedModel* IedModel*
IedModel_create(const char* name/*, MemoryAllocator allocator*/); IedModel_create(const char* name/*, MemoryAllocator allocator*/);
/**
* \brief Set the name of the IED (use only for dynamic model!)
*
* This will change the default name (usualy "TEMPLATE") to a user configured values.
* NOTE: This function has to be called before IedServer_create !
* NOTE: For dynamic model (and configuration file date model) this function has to be
* used instead of IedModel_setIedName.
*
* \param model the IedModel instance
* \param the name of the configured IED
*/
void
IedModel_setIedNameForDynamicModel(IedModel* self, const char* name);
/** /**
* \brief destroy a dynamically created data model * \brief destroy a dynamically created data model
* *

@ -31,6 +31,15 @@ iedModel_emptyVariableInitializer(void)
return; return;
} }
void
IedModel_setIedNameForDynamicModel(IedModel* self, const char* name)
{
if (self->name != NULL)
GLOBAL_FREEMEM(self->name);
self->name = copyString(name);
}
IedModel* IedModel*
IedModel_create(const char* name/*, MemoryAllocator allocator*/) IedModel_create(const char* name/*, MemoryAllocator allocator*/)
{ {

@ -46,7 +46,7 @@ void
IedModel_setIedName(IedModel* self, const char* name) IedModel_setIedName(IedModel* self, const char* name)
{ {
self->name = (char*) name; self->name = (char*) name;
}; }
void void
IedModel_setAttributeValuesToNull(IedModel* iedModel) IedModel_setAttributeValuesToNull(IedModel* iedModel)

@ -489,3 +489,4 @@ EXPORTS
MmsServerIdentity_destroy MmsServerIdentity_destroy
ClientReport_getBufOvfl ClientReport_getBufOvfl
MmsValue_getUtcTimeInMsWithUs MmsValue_getUtcTimeInMsWithUs
IedModel_setIedNameForDynamicModel

@ -513,3 +513,4 @@ EXPORTS
MmsServerIdentity_destroy MmsServerIdentity_destroy
ClientReport_getBufOvfl ClientReport_getBufOvfl
MmsValue_getUtcTimeInMsWithUs MmsValue_getUtcTimeInMsWithUs
IedModel_setIedNameForDynamicModel

Loading…
Cancel
Save