- added function IedModel_setIedNameForDynamicModel

This commit is contained in:
Michael Zillgith 2015-06-09 13:15:33 +02:00
parent c5e5165e7a
commit 97e8bd8f81
5 changed files with 26 additions and 1 deletions

View file

@ -55,6 +55,20 @@ extern "C" {
IedModel*
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
*

View file

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

View file

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

View file

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

View file

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