public IndexModel(PoolControl poolControl, IViewLocalizer localizer) { this.State = poolControl.GetPoolControlInformation(); this.GeneralState = GeneralState.ConvertFromPoolState(poolControl.GetPoolControlInformation()); this.TemperatureRunTime = this.State.PoolSettings.TemperatureRunTime.ToArray(); this.PumpingCycles = this.State.PoolSettings.WorkingMode == PoolWorkingMode.Summer ? this.State.PoolSettings.SummerPumpingCycles : this.State.PoolSettings.WinterPumpingCycles; var chartOptions = new Highcharts { Title = new Title { Text = "" }, XAxis = new List <XAxis>() { new XAxis() { Title = new XAxisTitle() { Text = "°C" } } }, YAxis = new List <YAxis>() { new YAxis() { Title = new YAxisTitle() { Text = "h" } } }, Series = new List <Series>() { new AreaSeries { Name = "h", Data = this.State.PoolSettings.TemperatureRunTime .Select(d => new AreaSeriesData() { X = d.Temperature, Y = d.RunTimeHours }) .ToList(), } } }; chartOptions.ID = "chart"; this.ChartRenderer = new HighchartsRenderer(chartOptions); }
public VariablesModel(PoolControl poolControl, IHardwareManager hardwareManager) { var state = poolControl.GetPoolControlInformation().SystemState; this.Outputs = hardwareManager.GetOutputs().ToArray(); this.Variables = new List <VariableItem>(); this.Variables.Add(VariableItem.Create("Température extérieure", state.AirTemperature)); this.Variables.Add(VariableItem.Create("Température eau brute (sonde)", state.WaterTemperature)); this.Variables.Add(VariableItem.Create("Température min jour", state.PoolTemperatureMinOfTheDay)); this.Variables.Add(VariableItem.Create("Température max jour", state.PoolTemperatureMaxOfTheDay)); this.Variables.Add(VariableItem.Create("Température de consigne", state.PoolTemperatureDecision)); this.Variables.Add(VariableItem.Create("Température du bassin", state.PoolTemperature)); this.Variables.Add(VariableItem.Create("Durée de filtration/jour", state.PumpingDurationPerDayInHours)); this.Variables.Add(VariableItem.Create("Pompe", state.Pump)); }