private void BindData() { DS_PotDAL potDAL = new DS_PotDAL(); combPot.DataSource = potDAL.GetPotListByType(2); combPot.ValueMember = "PotCode"; combPot.DisplayMember = "PotName"; combPot.SelectedIndex = 0; DS_DSMaterialDAL dsMaterialDAL = new DS_DSMaterialDAL(); combMaterial.DataSource = dsMaterialDAL.GetMaterialByDistributionType(2); combMaterial.ValueMember = "Code"; combMaterial.DisplayMember = "Name"; combMaterial.SelectedIndex = 0; }
public Golbal() { _intervalwater = Convert.ToDecimal(System.Configuration.ConfigurationManager.AppSettings["IntervalWater"].ToString()); //间隔水量 _cleanwater = decimal.Parse(System.Configuration.ConfigurationManager.AppSettings["CleanWater"].ToString()); //清洗水量 _endwater = decimal.Parse(System.Configuration.ConfigurationManager.AppSettings["EndWater"].ToString()); //末端水量 _serverIP = System.Configuration.ConfigurationManager.AppSettings["ServerIP"].ToString(); //服务器IP _localIP = System.Configuration.ConfigurationManager.AppSettings["LocalIP"].ToString(); //本地IP _perSum = decimal.Parse(System.Configuration.ConfigurationManager.AppSettings["PerSum"].ToString()); //末端水量 ParamClass = ParamClass.Instance; CurrentAction = "等待机台请求"; WashingCurrentAction = "等待机台请求"; DS_PotDAL potDAL = new DS_PotDAL(); potList = potDAL.GetPotList();//获取所有缸信息 DS_DSMaterialDAL DAL = new DS_DSMaterialDAL(); WaterModel = DAL.GetMaterialByCode("99"); }
/// <summary> /// 加载机台缸 /// </summary> private void LoadDevicePot() { DS_PotDAL potDAL = new DS_PotDAL(); List <View_DeviceInfoModel> potList = potDAL.GetPotListByType(3);//获取所有缸信息 int groupBoxWidth = panelAlarm.Width / potList.Count; foreach (View_DeviceInfoModel potModel in potList) { CabinetListen cabinetListen = new CabinetListen(potModel.PotCode, potModel.Id.ToString()); GroupBox gb = cabinetListen.GetCabientInfo(panelAlarm.Width, DockStyle.Left, potModel.PotCode, potModel.PotName); gb.Width = groupBoxWidth + 1; gb.Text = Environment.NewLine + potModel.PotName; gb.ForeColor = Color.White; gb.Font = new System.Drawing.Font("宋体", 12, FontStyle.Regular); gb.Padding = new System.Windows.Forms.Padding(5, 20, 5, 5); gb.Tag = potModel.PotCode; panelAlarm.Controls.Add(gb); gb.BringToFront(); } }
public event EventHandler WashingFormulaEnd; //完成事件 #endregion public void Excute() { DS_PotDAL potDAL = new DS_PotDAL(); potList = potDAL.GetPotListByType(3);//获取所有缸信息 DS_DeviceDAL deviceDAL = new DS_DeviceDAL(); deviceList = deviceDAL.GetList(3); tcpclass = new TCPClass(); tcpclass.Receive_Event += Receive_Event; tcpclass.Error_Event += Error_Event; Task.Factory.StartNew(() => //线程执行任务 { while (true) { if (Golbal.CurrentFormulaModel != null) { tcpclass.SendString(IPAddress.Parse(Golbal.CurrentFormulaModel.ClientIP), GetActionInfo()); } Thread.Sleep(1000); } }); Task.Factory.StartNew(() => //线程执行任务 { while (true) { foreach (DS_DeviceModel devicemodel in deviceList) { string washstr = WashingGetActionInfo(devicemodel.Id); tcpclass.SendString(IPAddress.Parse(devicemodel.IP), washstr); Thread.Sleep(1000); } } }); }