/// <summary> /// 条码改变时切换订单,影像专用 /// </summary> //public event GetOrderFromChangeBarHandle GetOrderFromChangeBar; public cCarLocal() { ModeIDChangeOne = false; ModeIDChangeTwo = false; AllStatueStation = new StatueStation[3]; for (int i = 0; i < AllStatueStation.Length; i++) { AllStatueStation[i] = new StatueStation(frmMain.mMain.AllDataXml.LocalSettings.TestNo * 3 - 3 + i); } switch (frmMain.mMain.AllDataXml.LocalSettings.TestNo) { case 11: ModeZheWangSet = new HeiFeiMideaDll.ModeZheWangSet(); break; default: ModeSet = new HeiFeiMideaDll.ModeSet[3]; for (int i = 0; i < ModeSet.Length; i++) { ModeSet[i] = new HeiFeiMideaDll.ModeSet(); } break; } NiuJu = new HeiFeiMideaDll.cNiuJu[3]; for (int i = 0; i < NiuJu.Length; i++) { NiuJu[i] = new HeiFeiMideaDll.cNiuJu(); } FengJiNowID = new int[3]; for (int i = 0; i < FengJiNowID.Length; i++) { FengJiNowID[i] = 0; } }
private HeiFeiMideaDll.ModeZheWangSet FrmToClass() { HeiFeiMideaDll.ModeZheWangSet result = new HeiFeiMideaDll.ModeZheWangSet(); result.ID = txtID.Text.Trim(); result.Mode = txtMode.Text.Trim(); result.Info = txtInfo.Text; dataGridView1.EndEdit(); DataTable dt = (DataTable)dataGridView1.DataSource; for (int i = 0; i < dt.Rows.Count && i < 1; i++) { result.PlayFile = All.Class.Num.ToString(dt.Rows[i]["PlayFile"]); result.Start = All.Class.Num.ToInt(dt.Rows[i]["Start"]); result.End = All.Class.Num.ToInt(dt.Rows[i]["End"]); } return(result); }
/// <summary> /// 将机型设置显示到界面 /// </summary> /// <param name="ms"></param> private void ClassToFrm(HeiFeiMideaDll.ModeZheWangSet ms) { if (ms != null) { txtID.Text = ms.ID; txtMode.Text = ms.Mode; txtInfo.Text = ms.Info; DataTable dt = (DataTable)dataGridView1.DataSource; for (int i = 0; i < dt.Rows.Count && i < 1; i++) { dt.Rows[i]["Start"] = ms.Start; dt.Rows[i]["End"] = ms.End; dt.Rows[i]["PlayFile"] = ms.PlayFile; } dataGridView1.DataSource = dt; } }
//private void AddErrorSpace(string space) //{ // frmMain.mMain.AddAllMeterInfo(string.Format("{0:HH:mm:ss} {1}扭矩枪 打螺丝故障", DateTime.Now, space)); //} private void AllCars_BarCodeChange(int ID, int LineWorkStation, string BarCode, string Order, HeiFeiMideaDll.ModeSet ModeSet, HeiFeiMideaDll.ModeZheWangSet ModeZheWangSet) { if (ModeSet == null || BarCode == "") { return; } switch (LineWorkStation) { case 6: yaSuoJiNiuJu.ModeSet = ModeSet; frmMain.mMain.AllDataBase.WriteData.Write(string.Format("update StatueNiuJu set LuoSi=0 where Space=0")); yaSuoJiNiuJu.Run(); break; case 26: fengJiNiuJu.ModeSet[0] = ModeSet; frmMain.mMain.AllDataBase.WriteData.Write(string.Format("update StatueNiuJu set LuoSi=0 where Space=1")); break; case 27: fengJiNiuJu.ModeSet[1] = ModeSet; frmMain.mMain.AllDataBase.WriteData.Write(string.Format("update StatueNiuJu set LuoSi=0 where Space=2")); break; } }
void cCarLocal_BarCodeChange(int ID, int LineWorkStation, string BarCode, string Order, HeiFeiMideaDll.ModeSet ModeSet, HeiFeiMideaDll.ModeZheWangSet ModeZheWangSet) { if (BarCodeChange != null) { BarCodeChange(ID, LineWorkStation, BarCode, Order, ModeSet, ModeZheWangSet); } }
/// <summary> /// 将MCGS工位状态刷新过来 /// </summary> public void FlushStatue(bool Init) { this.WorkStation = (int)(Math.Floor(this.ID / 3.0f)) + 1; switch (this.ID % 3) { case 0: this.LineWorkStation = frmMain.mMain.AllCars.AllInfoStation[this.WorkStation].TestOne; break; case 1: this.LineWorkStation = frmMain.mMain.AllCars.AllInfoStation[this.WorkStation].TestTwo; break; case 2: this.LineWorkStation = frmMain.mMain.AllCars.AllInfoStation[this.WorkStation].TestThree; break; } if (this.LineWorkStation == 0) { return; } string tmpBarCode = ""; switch (this.WorkStation) { default: tmpBarCode = frmMain.mMain.AllCars.AllStatueLineStation[this.LineWorkStation - 1].BarCode; break; case 11: Dictionary <string, string> tmpLenNingCode = All.Class.SSFile.Text2Dictionary(frmMain.mMain.AllMeterData.AllReadValue.StringValue.Value[30 + this.ID]); if (tmpLenNingCode.ContainsKey("BarCode")) { tmpBarCode = tmpLenNingCode["BarCode"]; } break; } switch (this.WorkStation) { default: this.TestResult = frmMain.mMain.AllCars.AllStatueLineStation[this.LineWorkStation - 1].OK; this.TestTime = frmMain.mMain.AllPCs.AllStatueTestTime.AllStatueTestTime[this.LineWorkStation - 1].TestTime; break; case 11: this.TestResult = true; this.TestTime = 0; break; } if (this.BarCode == tmpBarCode) { return; } if (tmpBarCode == "") { this.BarCode = ""; this.OrderMode = ""; this.OrderName = ""; this.ModeID = ""; //this.ModeSet = new HeiFeiMideaDll.ModeSet(); if (BarCodeChange != null) { BarCodeChange(this.ID, this.WorkStation, this.BarCode, this.OrderName, null, null); } //CheckRootID();//清机器人ID return; } this.BarCode = tmpBarCode; if (this.WorkStation == 11)//冷凝器上线处没有订单 { this.OrderName = ""; } else { HeiFeiMideaDll.OrderSet tmpOrder = HeiFeiMideaDll.OrderSet.GetOrder(frmMain.mMain.AllOrder, this.BarCode, this.WorkStation); if (tmpOrder == null) { tmpOrder = HeiFeiMideaDll.OrderSet.GetOrder(this.BarCode, this.WorkStation, frmMain.mMain.AllDataXml.LocalSet.FormatBarStr, frmMain.mMain.AllDataBase.ReadData); } if (tmpOrder == null) { this.OrderName = "当前条码无订单"; } else { this.OrderName = tmpOrder.OrderName; } } switch (this.WorkStation) { default: ModeSet = HeiFeiMideaDll.ModeSet.GetMode( HeiFeiMideaDll.ModeSet.GetModeIDFromBar(this.BarCode, frmMain.mMain.AllDataXml.LocalSet.FormatBarStr), frmMain.mMain.AllDataBase.ReadData); if (ModeSet == null) { this.OrderMode = ""; this.ModeID = ""; } else { this.OrderMode = ModeSet.Mode; this.ModeID = ModeSet.ID; } if (!Init) { CheckRootID(); } break; case 11: string tmpModeID = ""; if (this.BarCode.Length > 12) //折弯条码组成为【型号】+8位日期+4位流水 { tmpModeID = this.BarCode.Substring(0, this.BarCode.Length - 12); } ModeZheWangSet = HeiFeiMideaDll.ModeZheWangSet.GetMode(tmpModeID, frmMain.mMain.AllDataBase.ReadData); if (ModeZheWangSet == null) { this.OrderMode = ""; this.ModeID = ""; } else { this.OrderMode = ModeZheWangSet.Mode; this.ModeID = ModeZheWangSet.ID; } break; } if (BarCodeChange != null) { BarCodeChange(this.ID, this.LineWorkStation, this.BarCode, this.OrderName, ModeSet, ModeZheWangSet); } }