- .NET API: MmsValue - added functions to create empty visible string and set visible string value

- .NET API: DataAttribute - save data attribute type
pull/331/head
Michael Zillgith 4 years ago
parent 3532623319
commit 5ba428fa5b

@ -878,6 +878,8 @@ namespace IEC61850
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern void DataAttribute_setValue(IntPtr self, IntPtr mmsValue);
private DataAttributeType daType;
internal DataAttribute(IntPtr self, ModelNode parent) : base(self)
{
this.parent = parent;
@ -887,10 +889,22 @@ namespace IEC61850
int arrayElements, UInt32 sAddr)
{
this.parent = parent;
this.daType = type;
self = DataAttribute_create (name, parent.self, (int)type, (int)fc, (byte)trgOps, arrayElements, sAddr);
}
/// <summary>
/// Get IEC 61850 data attribute type of the data attribute
/// </summary>
public DataAttributeType Type
{
get
{
return daType;
}
}
/// <summary>
/// Set the value of the data attribute (can be used to set default values before server is created)
/// </summary>

@ -147,6 +147,12 @@ namespace IEC61850
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr MmsValue_newVisibleString(string value);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr MmsValue_newVisibleStringWithSize(int size);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern void MmsValue_setVisibleString(IntPtr self, string value);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr MmsValue_createArray(IntPtr elementType, int size);
@ -201,7 +207,7 @@ namespace IEC61850
internal IntPtr valueReference; /* reference to native MmsValue instance */
private bool responsableForDeletion; /* if .NET wrapper is responsable for the deletion of the native MmsValue instance */
private bool responsableForDeletion = false; /* if .NET wrapper is responsable for the deletion of the native MmsValue instance */
internal MmsValue (IntPtr value)
{
@ -415,13 +421,34 @@ namespace IEC61850
return new MmsValue (newValue, true);
}
/// <summary>
/// Gets the type of the value
/// <summary>
/// Create a new MmsValue instance of type MMS_VISIBLE_STRING - empty string with given maximum size
/// </summary>
/// <returns>
/// The type.
/// </returns>
public new MmsType GetType ()
/// <param name="size">The maximum size </param>
/// <returns></returns>
public static MmsValue NewVisibleString(int size, bool responsibleForDeletion = false)
{
IntPtr newValue = MmsValue_newVisibleStringWithSize(size);
return new MmsValue(newValue, responsibleForDeletion);
}
/// <summary>
/// Set the value of an MmsValue instance of type MMS_VISIBLE_STRING
/// </summary>
/// <param name="value">the new string value</param>
public void SetVisibleString(string value)
{
MmsValue_setVisibleString(valueReference, value);
}
/// <summary>
/// Gets the type of the value
/// </summary>
/// <returns>
/// The type.
/// </returns>
public new MmsType GetType ()
{
return (MmsType)MmsValue_getType (valueReference);
}

Loading…
Cancel
Save