Exemplo n.º 1
0
        public override void UpdateContent()
        {
            fChart.Clear();
            if (fModel == null)
            {
                return;
            }

            var measures = fModel.QueryMeasures();

            fTrends = new Dictionary <string, Trend>();
            fTrends.Add("Temp", new Trend("Temp (°C)", Color.Red));
            fTrends.Add("NO3", new Trend("NO3 (mg/l)", Color.BlueViolet));
            fTrends.Add("NO2", new Trend("NO2 (mg/l)", Color.CornflowerBlue));
            fTrends.Add("GH", new Trend("GH (°d)", Color.DarkGray));
            fTrends.Add("KH", new Trend("KH (°d)", Color.Gray));
            fTrends.Add("pH", new Trend("pH", Color.Fuchsia));
            fTrends.Add("Cl2", new Trend("Cl2 (mg/l)", Color.GreenYellow));
            fTrends.Add("CO2", new Trend("CO2", Color.Maroon));
            fTrends.Add("NH", new Trend("NHtot", Color.Violet));
            fTrends.Add("NH3", new Trend("NH3", Color.PaleVioletRed));
            fTrends.Add("NH4", new Trend("NH4", Color.MediumVioletRed));
            fTrends.Add("PO4", new Trend("PO4", Color.BlueViolet));

            foreach (Measure rec in measures)
            {
                Aquarium aqm     = fModel.Cache.Get <Aquarium>(ItemType.Aquarium, rec.AquariumId);
                string   aqmName = (aqm == null) ? "" : aqm.Name;
                if (fSelectedAquarium != "*" && fSelectedAquarium != aqmName)
                {
                    continue;
                }

                AddTrendValue("Temp", rec.Timestamp, rec.Temperature);
                AddTrendValue("NO3", rec.Timestamp, rec.NO3);
                AddTrendValue("NO2", rec.Timestamp, rec.NO2);
                AddTrendValue("GH", rec.Timestamp, rec.GH);
                AddTrendValue("KH", rec.Timestamp, rec.KH);
                AddTrendValue("pH", rec.Timestamp, rec.pH);
                AddTrendValue("Cl2", rec.Timestamp, rec.Cl2);
                AddTrendValue("CO2", rec.Timestamp, rec.CO2);
                AddTrendValue("NH", rec.Timestamp, rec.NH);
                AddTrendValue("NH3", rec.Timestamp, rec.NH3);
                AddTrendValue("NH4", rec.Timestamp, rec.NH4);
                AddTrendValue("PO4", rec.Timestamp, rec.PO4);
            }

            foreach (var trendPair in fTrends)
            {
                var trend = trendPair.Value;
                fChart.ShowData("", "Time", "Value", new ChartSeries(trend.Name, ChartStyle.Point, trend.Points, trend.Color));
            }
        }
Exemplo n.º 2
0
        public override void UpdateContent()
        {
            fChart.Clear();
            if (fModel == null)
            {
                return;
            }

            TSDatabase tsdb = fModel.TSDB;
            var        pt   = tsdb.GetPoint(fPointId);

            var vals    = new List <ChartPoint>();
            var endTime = DateTime.Now;
            var begTime = endTime.AddHours(-12);

            var records = tsdb.QueryValues(fPointId, begTime, endTime);

            foreach (TSValue rec in records)
            {
                vals.Add(new ChartPoint(rec.Timestamp, rec.Value));
            }

            fChart.ShowData(pt.Name, "Time", "Value", new ChartSeries("Value", ChartStyle.Point, vals, Color.Green));
        }
Exemplo n.º 3
0
 public override void UpdateContent()
 {
     fChart.ShowData("", "Labels", "", fData);
 }