public WaterLevelBarPlotWidget(string group, int row, int column) : base("Water Level", group, row, column) { text = "No Water Level"; unitOfMeasurement = UnitsOfMeasurement.Inches; fullScale = 15f; label = new TouchLabel(); label.textColor = "compl"; label.text = "Disconnected"; label.textAlignment = TouchAlignment.Center; label.textRender.orientation = TouchOrientation.Vertical; Put(label, 60, 9); label.Show(); this.group = group; if (WaterLevel.CheckWaterLevelGroupKeyNoThrow(this.group)) { text = this.group; WidgetReleaseEvent += (o, args) => { AquaPicGui.AquaPicUserInterface.ChangeScreens("Water Level", Toplevel, AquaPicGui.AquaPicUserInterface.currentScene, this.group); }; fullScale = WaterLevel.GetWaterLevelGroupMaxLevel(this.group); } else { this.group = string.Empty; } }
public WaterLevelLinePlot(string group, int row, int column) : base("Water Level", group, row, column) { text = "No Water Level"; unitOfMeasurement = UnitsOfMeasurement.Inches; label = new TouchLabel(); label.SetSizeRequest(152, 16); label.textColor = "compl"; label.textAlignment = TouchAlignment.Right; label.textHorizontallyCentered = true; Put(label, 155, 63); this.group = group; if (WaterLevel.CheckWaterLevelGroupKeyNoThrow(this.group)) { var dataLogger = WaterLevel.GetWaterLevelGroupDataLogger(this.group); linePlot.LinkDataLogger(dataLogger); Destroyed += (obj, args) => { linePlot.UnLinkDataLogger(dataLogger); }; text = string.Format("{0} Water Level", this.group); WidgetReleaseEvent += (o, args) => { AquaPicGui.AquaPicUserInterface.ChangeScreens("Water Level", Toplevel, AquaPicGui.AquaPicUserInterface.currentScene, this.group); }; } else { this.group = string.Empty; } linePlot.rangeMargin = 1; linePlot.eventColors.Add("probe disconnected", new TouchColor("secb", 0.25)); linePlot.eventColors.Add("ato started", new TouchColor("seca", 0.5)); linePlot.eventColors.Add("ato stopped", new TouchColor("secc", 0.5)); linePlot.eventColors.Add("low alarm", new TouchColor("compl", 0.25)); linePlot.eventColors.Add("high alarm", new TouchColor("compl", 0.25)); linePlot.eventColors.Add("disconnected alarm", new TouchColor("compl", 0.25)); }