예제 #1
0
 public static TmAlarmZonal CreateTmAlarmZonalFromDto(TmAlarmDto dto, TmAnalog tmAnalog)
 {
     return(new TmAlarmZonal(TmAlarmType.Zonal,
                             dto.AlarmId,
                             dto.AlarmName,
                             dto.Importance,
                             dto.InUse,
                             dto.Active,
                             tmAnalog,
                             dto.Expr));
 }
예제 #2
0
 public TmAlarmZonal(TmAlarmType type,
                     short id,
                     string name,
                     short importance,
                     short isInUse,
                     bool isActive,
                     TmAnalog tmAnalog,
                     string expression)
     : base(type, id, name, importance, isInUse, isActive, tmAnalog)
 {
     ThresholdName = expression;
 }
예제 #3
0
 public static TmAlarmAnalog CreateTmAlarmAnalogFromDto(TmAlarmDto dto, TmAnalog tmAnalog)
 {
     return(new TmAlarmAnalog(TmAlarmType.Analog,
                              dto.AlarmId,
                              dto.AlarmName,
                              dto.Importance,
                              dto.InUse,
                              dto.Active,
                              tmAnalog,
                              dto.Expr,
                              dto.CmpSign));
 }
예제 #4
0
 public static TmAlarmValue CreateTmAlarmValueFromDto(TmAlarmDto dto, TmAnalog tmAnalog)
 {
     return(new TmAlarmValue(TmAlarmType.Value,
                             dto.AlarmId,
                             dto.AlarmName,
                             dto.Importance,
                             dto.InUse,
                             dto.Active,
                             tmAnalog,
                             dto.CmpVal,
                             dto.CmpSign));
 }
예제 #5
0
 public TmAlarmExpression(TmAlarmType type,
                          short id,
                          string name,
                          short importance,
                          short isInUse,
                          bool isActive,
                          TmAnalog tmAnalog,
                          string expression,
                          short compareSign)
     : base(type, id, name, importance, isInUse, isActive, tmAnalog)
 {
     Expression            = expression;
     _isCompareGreaterThan = (compareSign == 0);
 }
예제 #6
0
 public TmAlarmValue(TmAlarmType type,
                     short id,
                     string name,
                     short importance,
                     short isInUse,
                     bool isActive,
                     TmAnalog tmAnalog,
                     float compareValue,
                     short compareSign)
     : base(type, id, name, importance, isInUse, isActive, tmAnalog)
 {
     CompareValue          = compareValue;
     _isCompareGreaterThan = (compareSign == 0);
 }
예제 #7
0
 public TmAlarm(TmAlarmType type,
                short id,
                string name,
                short importance,
                short isInUse,
                bool isActive,
                TmAnalog tmAnalog)
 {
     Type       = type;
     Id         = id;
     Name       = name;
     Importance = importance;
     IsInUse    = (isInUse > 0);
     IsActive   = isActive;
     TmAnalog   = tmAnalog;
 }
예제 #8
0
        public static TmAlarm CreateFromDto(TmAlarmDto dto, TmAnalog tmAnalog)
        {
            switch ((TmAlarmType)dto.Typ)
            {
            case TmAlarmType.Value:
                return(TmAlarmValue.CreateTmAlarmValueFromDto(dto, tmAnalog));

            case TmAlarmType.Expression:
                return(TmAlarmExpression.CreateTmAlarmExpressionFromDto(dto, tmAnalog));

            case TmAlarmType.Analog:
                return(TmAlarmAnalog.CreateTmAlarmAnalogFromDto(dto, tmAnalog));

            case TmAlarmType.Zonal:
                return(TmAlarmZonal.CreateTmAlarmZonalFromDto(dto, tmAnalog));

            default:
                return(null);
            }
        }