Esempio n. 1
0
 public void AddPutBit(XStateType stateType, XBinaryBase binaryBase, DatabaseType databaseType)
 {
     Add(FormulaOperationType.PUTBIT,
         (byte)stateType,
         binaryBase.GetDatabaseNo(databaseType),
         "Запись состояния " + stateType.ToDescription() + " " + XBinaryBaseToString(binaryBase));
 }
Esempio n. 2
0
 public static void AddAvailableStates(XDriver driver, XStateType stateType)
 {
     if (driver.AvailableStates.Count == 0)
     {
         driver.AvailableStates.Add(XStateType.Norm);
         driver.AvailableStates.Add(XStateType.Failure);
         driver.AvailableStates.Add(XStateType.Ignore);
     }
     driver.AvailableStates.Add(stateType);
 }
Esempio n. 3
0
 public void AddGetBitOff(XStateType stateType, XBinaryBase binaryBase, DatabaseType databaseType)
 {
     Add(FormulaOperationType.GETBIT,
         (byte)stateType,
         binaryBase.GetDatabaseNo(databaseType),
         "Проверка состояния " + stateType.ToDescription() + " " + XBinaryBaseToString(binaryBase));
     Add(FormulaOperationType.GETBIT,
         (byte)XStateType.Ignore,
         binaryBase.GetDatabaseNo(databaseType));
     Add(FormulaOperationType.COM);
     Add(FormulaOperationType.AND);
 }
Esempio n. 4
0
        public static int XStateTypeToPriority(XStateType stateType)
        {
            switch (stateType)
            {
                case XStateType.Fire1:
                case XStateType.Fire2:
                    return 0;

                case XStateType.Attention:
                    return 1;

                case XStateType.Failure:
                    return 2;

                case XStateType.Ignore:
                    return 4;

                case XStateType.Test:
                    return 6;

                case XStateType.Off:
                case XStateType.TurningOn:
                case XStateType.TurningOff:
                case XStateType.TurnOn:
                case XStateType.CancelDelay:
                case XStateType.TurnOff:
                case XStateType.Stop:
                case XStateType.ForbidStart:
                case XStateType.TurnOnNow:
                case XStateType.TurnOffNow:
                case XStateType.Reserve1:
                case XStateType.Reserve2:
                    return 6;

                case XStateType.Norm:
                case XStateType.On:
                    return 7;
            }
            return 7;
        }