public FrmEnviroUI(string strname, int devicetype, EnviroPanel colordlp) { InitializeComponent(); this.TmpEnviro = colordlp; this.DeviceType = devicetype; this.strName = strname; string strDevName = strname.Split('\\')[0].ToString(); SubnetID = Convert.ToByte(strDevName.Split('-')[0]); DeviceID = Convert.ToByte(strDevName.Split('-')[1]); }
void FirstAssignToPublicClassFromDifferentDeviceType() { if (myActivePanel == null) { return; } if (EnviroDLPPanelDeviceTypeList.HDLEnviroDLPPanelDeviceTypeList.Contains(DeviceType)) // 旧版彩屏面板 { ColorDLP oColorDLP = (ColorDLP)myActivePanel; if (oColorDLP.MyAC == null) { return; } if (oColorDLP.MyAC.Count <= cbAC.SelectedIndex) { return; } CurrentAc = oColorDLP.MyAC[cbAC.SelectedIndex]; TemperatureType = oColorDLP.TemperatureType; } else if (EnviroNewDeviceTypeList.EnviroNewPanelDeviceTypeList.Contains(DeviceType)) // 新版彩屏面板 { EnviroPanel Tmp = (EnviroPanel)myActivePanel; if (Tmp == null) { return; } if (Tmp.MyAC == null || Tmp.MyAC.Count == 0) { return; } CurrentAc = Tmp.MyAC[cbAC.SelectedIndex]; TemperatureType = Tmp.TemperatureType; } }