feat(commons): add DataType.List + ElementDataType companion for multi-value attributes
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums;
|
||||||
|
|
||||||
namespace ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances;
|
namespace ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances;
|
||||||
|
|
||||||
public class InstanceAttributeOverride
|
public class InstanceAttributeOverride
|
||||||
@@ -10,6 +12,13 @@ public class InstanceAttributeOverride
|
|||||||
public string AttributeName { get; set; }
|
public string AttributeName { get; set; }
|
||||||
/// <summary>Gets or sets the override value, or <c>null</c> to clear a previous override.</summary>
|
/// <summary>Gets or sets the override value, or <c>null</c> to clear a previous override.</summary>
|
||||||
public string? OverrideValue { get; set; }
|
public string? OverrideValue { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// For <see cref="DataType.List"/> attributes: the scalar type of each
|
||||||
|
/// element (String, Int32, Float, Double, Boolean, DateTime). Null for scalar
|
||||||
|
/// attributes. The element type is fixed by the base attribute and cannot be
|
||||||
|
/// changed on a derived template or instance override.
|
||||||
|
/// </summary>
|
||||||
|
public DataType? ElementDataType { get; set; }
|
||||||
|
|
||||||
/// <summary>Initializes a new <see cref="InstanceAttributeOverride"/> for the given attribute name.</summary>
|
/// <summary>Initializes a new <see cref="InstanceAttributeOverride"/> for the given attribute name.</summary>
|
||||||
/// <param name="attributeName">The name of the attribute to override.</param>
|
/// <param name="attributeName">The name of the attribute to override.</param>
|
||||||
|
|||||||
@@ -25,6 +25,13 @@ public class TemplateAttribute
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public DataType DataType { get; set; }
|
public DataType DataType { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// For <see cref="Enums.DataType.List"/> attributes: the scalar type of each
|
||||||
|
/// element (String, Int32, Float, Double, Boolean, DateTime). Null for scalar
|
||||||
|
/// attributes. The element type is fixed by the base attribute and cannot be
|
||||||
|
/// changed on a derived template or instance override.
|
||||||
|
/// </summary>
|
||||||
|
public DataType? ElementDataType { get; set; }
|
||||||
|
/// <summary>
|
||||||
/// Gets or sets a value indicating whether the attribute is locked from override.
|
/// Gets or sets a value indicating whether the attribute is locked from override.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsLocked { get; set; }
|
public bool IsLocked { get; set; }
|
||||||
|
|||||||
@@ -8,5 +8,6 @@ public enum DataType
|
|||||||
Double,
|
Double,
|
||||||
String,
|
String,
|
||||||
DateTime,
|
DateTime,
|
||||||
Binary
|
Binary,
|
||||||
|
List
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,6 +66,8 @@ public sealed record ResolvedAttribute
|
|||||||
public string? Value { get; init; }
|
public string? Value { get; init; }
|
||||||
/// <summary>Gets the data type name.</summary>
|
/// <summary>Gets the data type name.</summary>
|
||||||
public string DataType { get; init; } = string.Empty;
|
public string DataType { get; init; } = string.Empty;
|
||||||
|
/// <summary>For List attributes: the element scalar type name; null otherwise.</summary>
|
||||||
|
public string? ElementDataType { get; init; }
|
||||||
/// <summary>Gets whether the attribute is locked.</summary>
|
/// <summary>Gets whether the attribute is locked.</summary>
|
||||||
public bool IsLocked { get; init; }
|
public bool IsLocked { get; init; }
|
||||||
/// <summary>Gets the attribute description.</summary>
|
/// <summary>Gets the attribute description.</summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user