예제 #1
0
        public void Join(Message message)
        {
            Errors.AddRange(message.Errors);
            Success.AddRange(message.Success);
            Warnings.AddRange(message.Warnings);
            Info.AddRange(message.Info);

            refreshType();
        }
예제 #2
0
 public Result Merge(Result result)
 {
     if (result != null)
     {
         Successes.AddRange(result.Successes);
         Warnings.AddRange(result.Warnings);
         Errors.AddRange(result.Errors);
     }
     return(this);
 }
예제 #3
0
        public Room(csharpmatic.Generic.Room dr)
        {
            Name  = dr.Name;
            ISEID = dr.ISEID;

            if (dr.SingleSwitchControlDevices != null)
            {
                //get heating actuators
                if (dr.SingleSwitchControlDevices.Where(w => w.Functions.Contains(Function.Heating) && w.State.Value).FirstOrDefault() != null)
                {
                    HeatingActive = true;
                }

                //get dehumidyfier actuators
                if (dr.SingleSwitchControlDevices.Where(w => w.Functions.Contains(Function.Humidity) && w.State.Value).FirstOrDefault() != null)
                {
                    DehumidifierActive = true;
                }
            }

            //get temps
            if (dr.TempControlDevices != null && dr.TempControlDevices.GroupLeader != null)
            {
                var pts = dr.TempControlDevices.Select(s => s.Actual_Temperature.Value);

                ActualTempAvg    = Math.Round(pts.Average(), 1);
                ActualTempMax    = Math.Round(pts.Max(), 1);
                ActualTempMin    = Math.Round(pts.Min(), 1);
                SetTemp          = dr.TempControlDevices.GroupLeader.Set_Point_Temperature.Value;
                WindowOpen       = dr.TempControlDevices.GroupLeader.Window_State.Value == ITempControl_Windows_State_Enum.OPEN;
                BoostActive      = dr.TempControlDevices.GroupLeader.Boost_Mode.Value;
                BoostSecondsLeft = dr.TempControlDevices.GroupLeader.Boost_Time.Value;
            }

            //get humidity
            if (dr.HumidityControlDevices != null && dr.HumidityControlDevices.GroupLeader != null)
            {
                var pts = dr.HumidityControlDevices.Select(s => Convert.ToDecimal(s.Humidity.Value));

                HumidityAvg = Math.Round(pts.Average());
                HumidityMin = Math.Round(pts.Min());
                HumidityMax = Math.Round(pts.Max());
            }

            //get valve opens
            if (dr.ValveControlDevices != null && dr.ValveControlDevices.GroupLeader != null)
            {
                var pts = dr.ValveControlDevices.Select(s => Convert.ToDecimal(s.Level.Value));
                ValveOpenAvg = Math.Round(pts.Average() * 100);
                ValveOpenMin = Math.Round(pts.Min() * 100);
                ValveOpenMax = Math.Round(pts.Max() * 100);
            }

            //get warnings
            Warnings.AddRange(
                dr.HmIPDevices.Where(w => w is ILowBatteryInfo).Cast <ILowBatteryInfo>().Where(w => (w.Low_Bat.Value))
                .Select(s => String.Format($"{s.Name}: low voltage"))
                .ToList()
                );

            Warnings.AddRange(
                dr.HmDevices.Where(w => w.PendingConfig)
                .Select(s => String.Format($"{s.Name}: pending configuration"))
                .ToList()
                );

            Warnings.AddRange(
                dr.HmDevices.Where(w => !w.Reachable)
                .Select(s => String.Format($"{s.Name}: unreachable"))
                .ToList()
                );

            //room device list
            Devices = dr.HmDevices.Select(s => s as Device).Where(w => w != null).ToList();
        }
 public CodePragmaWarningDirective(CodePragmaWarningSetting setting, IEnumerable <int> warnings)
 {
     Setting = setting;
     Warnings.AddRange(warnings);
 }
예제 #5
0
 public void Add(PaJaMaResults results)
 {
     Errors.AddRange(results.Errors);
     Warnings.AddRange(results.Warnings);
     SystemExceptions.AddRange(results.SystemExceptions);
 }
예제 #6
0
 // WARNINGS
 public Result AddWarnings(params string[] warnings)
 {
     Warnings.AddRange(warnings);
     return(this);
 }
예제 #7
0
 public void Concat(ValidationResult result)
 {
     Errors.AddRange(result.Errors);
     Warnings.AddRange(result.Warnings);
 }
예제 #8
0
 public void AddWarning(List <string> messages)
 {
     Warnings.AddRange(messages);
 }