private void UpdateChart(DataObjectCategory dbo, DataObjectExt dObjExt, Color lineColor) { chartValues.Series.Clear(); if (DataObjectCapabilities.HasCapability(dbo, dObjExt.Protocol)) { double min = dObjExt.GetLogItemMinValue(dbo); double max = dObjExt.GetLogItemMaxValue(dbo); if ((max - min) < 10) { min -= 5; max += 5; } Console.WriteLine("Min " + min.ToString() + " - Max: " + max.ToString()); AddChartSerie(dObjExt.GetLogItems(dbo), dbo.Value.ToString(), lineColor, min, max); } if (chartValues.Series.Count > 0) { chartValues.DataBind(); chartValues.Update(); } }
private void SetLabelInformation(Label lblValue, Label lblMinValue, Label lblMaxValue, Label lblMinTime, Label lblMaxTime, DataObjectExt dObjExt, DataObjectCategory dobjcat) { if (dObjExt.ItemExists(dobjcat) && DataObjectCapabilities.HasCapability(dObjExt.Items[dobjcat.Value].DataObjCategory, dObjExt.Protocol)) { string unit = Common.getSensorValueUnit(dObjExt.Items[dobjcat.Value].SensorType); lblValue.Text = dObjExt.Items[dobjcat.Value].Value.ToString("#.#0") + unit; lblMinValue.Text = dObjExt.Items[dobjcat.Value].MinValue.ToString("#.#0") + unit; lblMaxValue.Text = dObjExt.Items[dobjcat.Value].MaxValue.ToString("#.#0") + unit; lblMinTime.Text = Common.getCurrentDateTimeFormattedNoSec(dObjExt.Items[dobjcat.Value].MinTimepoint); lblMaxTime.Text = Common.getCurrentDateTimeFormattedNoSec(dObjExt.Items[dobjcat.Value].MaxTimepoint); } else { lblValue.Text = " --- "; lblMinValue.Text = " --- "; lblMaxValue.Text = " --- "; lblMinTime.Text = " --- "; lblMaxTime.Text = " --- "; } }