示例#1
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="ln">Logical Name of the object.</param>
 /// <param name="sn">Short Name of the object.</param>
 public GXDLMSLimiter(string ln, ushort sn)
     : base(ObjectType.Limiter, ln, sn)
 {
     EmergencyProfile     = new GXDLMSEmergencyProfile();
     ActionOverThreshold  = new GXDLMSActionItem();
     ActionUnderThreshold = new GXDLMSActionItem();
 }
示例#2
0
 /// <summary> 
 /// Constructor.
 /// </summary> 
 /// <param name="ln">Logican Name of the object.</param>
 /// <param name="sn">Short Name of the object.</param>
 public GXDLMSLimiter(string ln, ushort sn)
     : base(ObjectType.Limiter, ln, 0)
 {
     EmergencyProfile = new GXDLMSEmergencyProfile();
     ActionOverThreshold = new GXDLMSActionItem();
     ActionUnderThreshold = new GXDLMSActionItem();
 }
示例#3
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public GXDLMSLimiter()
     : base(ObjectType.Limiter)
 {
     EmergencyProfile     = new GXDLMSEmergencyProfile();
     ActionOverThreshold  = new GXDLMSActionItem();
     ActionUnderThreshold = new GXDLMSActionItem();
 }
示例#4
0
 /// <summary> 
 /// Constructor.
 /// </summary> 
 public GXDLMSLimiter()
     : base(ObjectType.Limiter)
 {
     EmergencyProfile = new GXDLMSEmergencyProfile();
     ActionOverThreshold = new GXDLMSActionItem();
     ActionUnderThreshold = new GXDLMSActionItem();
 }
示例#5
0
        void IGXDLMSBase.Load(GXXmlReader reader)
        {
            List <GXDLMSActionItem> actions = new List <GXDLMSActionItem>();

            if (reader.IsStartElement("Actions", true))
            {
                while (reader.IsStartElement("Item", true))
                {
                    GXDLMSActionItem it = new GXDLMSActionItem();
                    it.LogicalName    = reader.ReadElementContentAsString("LN");
                    it.ScriptSelector = (byte)reader.ReadElementContentAsInt("ScriptSelector");
                    actions.Add(it);
                }
                reader.ReadEndElement("Actions");
            }
            Actions = actions.ToArray();

            List <string> permissions = new List <string>();

            if (reader.IsStartElement("PermissionTable", true))
            {
                while (reader.IsStartElement("Item", false))
                {
                    permissions.Add(reader.ReadElementContentAsString("Item"));
                }
                reader.ReadEndElement("PermissionTable");
            }
            PermissionsTable = permissions.ToArray();

            List <UInt16[]> weightings = new List <UInt16[]>();

            if (reader.IsStartElement("WeightingTable", true))
            {
                while (reader.IsStartElement("Weightings", true))
                {
                    List <UInt16> list = new List <UInt16>();
                    while (reader.IsStartElement("Item", false))
                    {
                        list.Add((UInt16)reader.ReadElementContentAsInt("Item"));
                    }
                    weightings.Add(list.ToArray());
                }
                reader.ReadEndElement("WeightingTable");
            }
            WeightingsTable = weightings.ToArray();

            List <string> mostRecentRequests = new List <string>();

            if (reader.IsStartElement("MostRecentRequestsTable", true))
            {
                while (reader.IsStartElement("Item", false))
                {
                    permissions.Add(reader.ReadElementContentAsString("Item"));
                }
                reader.ReadEndElement("MostRecentRequestsTable");
            }
            MostRecentRequestsTable = mostRecentRequests.ToArray();
            LastOutcome             = (byte)reader.ReadElementContentAsInt("LastOutcome");
        }
示例#6
0
        /// <summary>
        /// Create a new action.
        /// </summary>
        private GXDLMSActionItem CreateAction(GXDLMSSettings settings, List <object> it)
        {
            GXDLMSActionItem item = new GXDLMSActionItem();

            item.LogicalName    = GXCommon.ToLogicalName(it[0]);
            item.ScriptSelector = (UInt16)(it[1]);
            return(item);
        }
示例#7
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public GXDLMSActionSet()
 {
     ActionUp = new GXDLMSActionItem();
     ActionDown = new GXDLMSActionItem();
 }
示例#8
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public GXDLMSActionSet()
 {
     ActionUp   = new GXDLMSActionItem();
     ActionDown = new GXDLMSActionItem();
 }