public void InitForms() { flowLayoutPanel.Controls.Clear(); for (int i = 0; i < GasMonitorManager.Chanels.Count; i++) { ChanelSeries chanelSeries = new ChanelSeries(); chanelSeries.SetChannel(GasMonitorManager.Chanels[i]); chanelSeries.SetStyle(GasMonitorManager.MainForm.Style); flowLayoutPanel.Controls.Add(chanelSeries); } }
public void SetReadSeries(ReceiveItem data, ReceiveItem alarm, ReceiveItem alarmtatus) { ///设置值 for (int i = 0; i < this.flowLayoutPanel.Controls.Count; i++) { if (this.flowLayoutPanel.Controls[i].GetType() == typeof(ChanelSeries)) { ChanelSeries channelReal = (ChanelSeries)this.flowLayoutPanel.Controls[i]; if (!string.IsNullOrEmpty(channelReal.Channel.BindingArress) && channelReal.Channel.BindingArress == data.Address) { channelReal.SetReadSeries(data, alarm, alarmtatus); } } } }