private void DispatcherTimerTickUpdateUi(Object sender, EventArgs e) { string banci = GlobalVar.GetBanci(); if (banci != LastBanci) { LastBanci = banci; Inifile.INIWriteValue(iniParameterPath, "System", "Banci", LastBanci); //GlobalVar.AlarmRecordQueue.Clear(); GlobalVar.AlarmRecord.Clear(); GlobalVar.MESDataRecord.Clear(); GlobalVar.AddMessage("换班数据清空" + LastBanci); } if (GlobalVar.AlarmRecordQueue.Count > 0) { foreach (AlarmTableItem item in GlobalVar.AlarmRecordQueue) { GlobalVar.AlarmRecord.Add(item); } GlobalVar.AlarmRecordQueue.Clear(); } if (GlobalVar.MESDataRecordQueue.Count > 0) { foreach (MESDataItem item in GlobalVar.MESDataRecordQueue) { GlobalVar.MESDataRecord.Add(item); } GlobalVar.MESDataRecordQueue.Clear(); } }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { string iniSamplePath = System.Environment.CurrentDirectory + "\\Sample.ini"; Inifile.INIWriteValue(iniSamplePath, "Sample", "IsSample", IsSampleCheck.IsChecked.ToString()); Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItemCount", NGItemCount.Text); Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItem1", NGItem1.Text); Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItem2", NGItem2.Text); Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItem3", NGItem3.Text); Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItem4", NGItem4.Text); Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItem5", NGItem5.Text); Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItem6", NGItem6.Text); Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItem7", NGItem7.Text); Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItem8", NGItem8.Text); Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItem9", NGItem9.Text); Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItem10", NGItem10.Text); Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItemClassify1", NGItemClassify1.Text); Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItemClassify2", NGItemClassify2.Text); Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItemClassify3", NGItemClassify3.Text); Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItemClassify4", NGItemClassify4.Text); Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItemClassify5", NGItemClassify5.Text); Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItemClassify6", NGItemClassify6.Text); Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItemClassify7", NGItemClassify7.Text); Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItemClassify8", NGItemClassify8.Text); Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItemClassify9", NGItemClassify9.Text); Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItemClassify10", NGItemClassify10.Text); Inifile.INIWriteValue(iniSamplePath, "Sample", "SamMode", SamMode.Text); Inifile.INIWriteValue(iniSamplePath, "Sample", "ZPMID", ZPMID.Text); Inifile.INIWriteValue(iniSamplePath, "Sample", "FCTMID", FCTMID.Text); }
public async void Start(StartProcessedDelegate callback) { Stopwatch sw = new Stopwatch(); Func <Task> startTask = () => { return(Task.Run(() => { idleswflag = false; idlesw.Stop(); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "TestIdle", TestIdle.ToString()); TestCycle = TestSpan + TestIdle; Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "TestCycle", TestCycle.ToString()); sw.Start(); TestStatus = TestStatus.Testing; TestResult = TestResult.Unknow; while (TestStatus == TestStatus.Testing) { TestSpan = Math.Round(sw.Elapsed.TotalSeconds, 2); System.Threading.Thread.Sleep(100); } })); }; await startTask(); callback(Index); if (!IsInSampleMode && !IsInGRRMode) { UpdateNormal(); } idleswflag = true; idlesw.Restart(); }
public void GetPosition(object p) { switch (p.ToString()) { case "1": Position1 = (double)ActPos1.Value; Inifile.INIWriteValue(iniPosition, "Axis1", "Position1", Position1.ToString()); break; case "2": Position2 = (double)ActPos1.Value; Inifile.INIWriteValue(iniPosition, "Axis1", "Position2", Position2.ToString()); break; case "3": Position3 = (double)ActPos1.Value; Inifile.INIWriteValue(iniPosition, "Axis1", "Position3", Position3.ToString()); break; case "4": Position4 = (double)ActPos1.Value; Inifile.INIWriteValue(iniPosition, "Axis1", "Position4", Position4.ToString()); break; case "5": Position5 = (double)ActPos1.Value; Inifile.INIWriteValue(iniPosition, "Axis1", "Position5", Position5.ToString()); break; } }
private void IDSaveButton_Click(object sender, RoutedEventArgs e) { GlobalVar.MachineID = MachineID_Text.Text; GlobalVar.UserID = UserID_Text.Text; GlobalVar.ProductName = ProductName_Text.Text; GlobalVar.MachineName = MachineName_Text.Text; GlobalVar.FactoryArea = FactoryArea_Text.Text; GlobalVar.FactorySeparation = FactorySeparation_Text.Text; GlobalVar.ZhijuClass = ZhijuClass_Text.Text; GlobalVar.Barcodeproofing = Barcodeproofing_Text.Text; GlobalVar.scancodetype = scancodetype_Text.Text; GlobalVar.MAC = MAC_Text.Text; GlobalVar.CCD = CCD_Text.Text; GlobalVar.NNNN = NNNN_Text.Text; Inifile.INIWriteValue(iniParameterPath, "System", "MachineID", MachineID_Text.Text); Inifile.INIWriteValue(iniParameterPath, "System", "UserID", UserID_Text.Text); Inifile.INIWriteValue(iniParameterPath, "System", "ProductName", ProductName_Text.Text); Inifile.INIWriteValue(iniParameterPath, "System", "MachineName", MachineName_Text.Text); Inifile.INIWriteValue(iniParameterPath, "System", "FactoryArea", FactoryArea_Text.Text); Inifile.INIWriteValue(iniParameterPath, "System", "FactorySeparation", FactorySeparation_Text.Text); Inifile.INIWriteValue(iniParameterPath, "System", "ZhijuClass", ZhijuClass_Text.Text); Inifile.INIWriteValue(iniParameterPath, "System", "Barcodeproofing", Barcodeproofing_Text.Text); Inifile.INIWriteValue(iniParameterPath, "System", "scancodetype", scancodetype_Text.Text); Inifile.INIWriteValue(iniParameterPath, "System", "MAC", MAC_Text.Text); Inifile.INIWriteValue(iniParameterPath, "System", "CCD", CCD_Text.Text); Inifile.INIWriteValue(iniParameterPath, "System", "NNNN", NNNN_Text.Text); }
private void ParameterSaveCommandExecute() { Inifile.INIWriteValue(iniParameterPath, "System", "WorkPath", WorkPath); Inifile.INIWriteValue(iniParameterPath, "System", "ImageSavePath", ImageSavePath); Inifile.INIWriteValue(iniParameterPath, "Server", "IP", ServerIP); Inifile.INIWriteValue(iniParameterPath, "Server", "PORT", ServerPort.ToString()); AddMessage("保存参数"); }
private void ParameterSaveCommandExecute() { Inifile.INIWriteValue(iniParameterPath, "System", "RemotePath", RemotePath); Inifile.INIWriteValue(iniParameterPath, "System", "MachineID", MachineID); Inifile.INIWriteValue(iniParameterPath, "Remote", "IP", RemoteIP); Inifile.INIWriteValue(iniParameterPath, "Remote", "PORT", RemotePort.ToString()); Inifile.INIWriteValue(iniParameterPath, "Local", "IP", LocalIP); Inifile.INIWriteValue(iniParameterPath, "Local", "PORT", LocalPort.ToString()); AddMessage("保存参数"); }
private async void ReUpLoad() { DataTable dt = new DataTable(); DataTable dt1; dt.Columns.Add("BLDATE", typeof(string)); dt.Columns.Add("BLID", typeof(string)); dt.Columns.Add("BLNAME", typeof(string)); dt.Columns.Add("BLUID", typeof(string)); dt.Columns.Add("BLMID", typeof(string)); dt.Columns.Add("Bar", typeof(string)); string filename = @"D:\NotUpdate.csv"; UpdateCount = 0; if (File.Exists(filename)) { dt1 = Csvfile.GetFromCsv(filename, 1, dt); if (dt1.Rows.Count > 0) { File.Delete(filename); foreach (DataRow item in dt1.Rows) { DP6SQLROW dP6SQLROW = new DP6SQLROW(); dP6SQLROW.BLDATE = item[0].ToString(); dP6SQLROW.BLID = item[1].ToString(); dP6SQLROW.BLMID = item[4].ToString(); dP6SQLROW.BLNAME = item[2].ToString(); dP6SQLROW.BLUID = item[3].ToString(); dP6SQLROW.Bar = item[5].ToString(); bool r; using (var releaser = await m_lock.LockAsync()) { r = await Update_A_Row(dP6SQLROW); } if (r)//更具是否上传成功,写入不同的记录文档 { lock (DisEq) { _BarcodeRecord.Enqueue(dP6SQLROW); } WriteRecordtoExcel(dP6SQLROW, true); UpdateCount++; //上传成功 } else { WriteRecordtoExcel(dP6SQLROW, false); //上传失败 } } } } LastReUpdateStr = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); Inifile.INIWriteValue(iniParameterPath, "ReUpLoad", "LastReUpdateStr", LastReUpdateStr); }
private void TextBox4_LostFocus(object sender, RoutedEventArgs e) { this.TextBox4.IsReadOnly = true; try { Inifile.INIWriteValue(iniParameterPath, "SQLMSG", "BLNAME", TextBox4.Text); } catch { } }
private void Axis_TechCommandExecute(object obj) { if (System.Windows.Forms.MessageBox.Show($"是否示教点{int.Parse(obj.ToString()) + 1}?", "确认", MessageBoxButtons.OKCancel) == DialogResult.OK) { PrefilePos[int.Parse(obj.ToString())].X = CPos.X; PrefilePos[int.Parse(obj.ToString())].Y = CPos.Y; PrefilePos[int.Parse(obj.ToString())].Z = CPos.Z; Inifile.INIWriteValue(iniParameterPath, "Position", "X" + obj.ToString(), PrefilePos[int.Parse(obj.ToString())].X.ToString()); Inifile.INIWriteValue(iniParameterPath, "Position", "Y" + obj.ToString(), PrefilePos[int.Parse(obj.ToString())].Y.ToString()); Inifile.INIWriteValue(iniParameterPath, "Position", "Z" + obj.ToString(), PrefilePos[int.Parse(obj.ToString())].Z.ToString()); } }
private void WriteIni() { try { Inifile.INIWriteValue(iniParameterPath, "AS300", "AS300IP", AS300IP); MsgText = AddMessage("参数写入完成"); } catch (Exception ex) { MsgText = AddMessage("参数写入失败: " + ex.Message); } }
private void MNOButtonCommandExecute() { if (MNOIsReadOnly) { MNOIsReadOnly = false; MNOContent = "Save"; } else { MNOIsReadOnly = true; MNOContent = "Edit"; Inifile.INIWriteValue(iniParameterPath, "System", "MNO", MNO); } }
private void BigDataParamClicked(object sender, RoutedEventArgs e) { _PM = PM.Text; _GROUP1 = GROUP1.Text; _TRACK = TRACK.Text; _MACID = MACID.Text; _WORKSTATION = WORKSTATION.Text; _LIGHT_ID = LIGHT_ID.Text; Inifile.INIWriteValue(iniParameterPath, "BigData", "PM", PM.Text); Inifile.INIWriteValue(iniParameterPath, "BigData", "GROUP1", GROUP1.Text); Inifile.INIWriteValue(iniParameterPath, "BigData", "TRACK", TRACK.Text); Inifile.INIWriteValue(iniParameterPath, "BigData", "MACID", MACID.Text); Inifile.INIWriteValue(iniParameterPath, "BigData", "WORKSTATION", WORKSTATION.Text); Inifile.INIWriteValue(iniParameterPath, "BigData", "LIGHT_ID", LIGHT_ID.Text); AddMessage("参数保存完成"); }
/// <数据更新保存AAB> /// /// </summary> /// <param name="rst"></param> /// <param name="index_i"></param> public void UpdateTester1(int rst, int index_i) { /*result = 0 -> Ng * result = 1 -> Pass * result = 2 -> Timeout */ switch (rst) { case 0: FailCount[index_i]++; break; case 1: PassCount[index_i]++; break; default: break; } TestCount[index_i]++; if (PassCount[index_i] + FailCount[index_i] != 0) { Yield[index_i] = Math.Round((double)PassCount[index_i] / (PassCount[index_i] + FailCount[index_i]) * 100, 2); } else { Yield[index_i] = 0; } try { //Inifile.INIWriteValue(iniTesterResutPath, "Tester" + Index.ToString(), "TestSpan", TestSpan.ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index * 2 + index_i).ToString(), "PassCount", PassCount[index_i].ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index * 2 + index_i).ToString(), "FailCount", FailCount[index_i].ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index * 2 + index_i).ToString(), "TestCount", TestCount[index_i].ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index * 2 + index_i).ToString(), "Yield", Yield[index_i].ToString()); } catch { } }
private void UpdateTester(int rst) { /*result = 0 -> Ng * result = 1 -> Pass * result = 2 -> Timeout */ switch (rst) { case 0: testStatus = TestStatus.Tested; testResult = TestResult.Ng; FailCount_Nomal++; break; case 1: testStatus = TestStatus.Tested; testResult = TestResult.Pass; PassCount_Nomal++; break; case 2: testStatus = TestStatus.Tested; testResult = TestResult.TimeOut; break; default: testStatus = TestStatus.Err; testResult = TestResult.TimeOut; break; } TestCount_Nomal++; Yield_Nomal = Math.Round((double)PassCount_Nomal / (PassCount_Nomal + FailCount_Nomal) * 100, 2); try { Inifile.INIWriteValue(iniTesterResutPath, "Tester" + Index.ToString(), "TestSpan", TestSpan.ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + Index.ToString(), "PassCount_Nomal", PassCount_Nomal.ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + Index.ToString(), "FailCount_Nomal", FailCount_Nomal.ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + Index.ToString(), "TestCount_Nomal", TestCount_Nomal.ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + Index.ToString(), "Yield_Nomal", Yield_Nomal.ToString()); } catch { } }
public void UpdateTester1(int rst) { /*result = 0 -> Ng * result = 1 -> Pass * result = 2 -> Timeout */ switch (rst) { case 0: if (!IsInSampleMode) { FailCount++; } break; case 1: if (!IsInSampleMode) { PassCount++; } break; default: break; } if (!IsInSampleMode) { TestCount++; } Yield = Math.Round((double)PassCount / (PassCount + FailCount) * 100, 2); try { //Inifile.INIWriteValue(iniTesterResutPath, "Tester" + Index.ToString(), "TestSpan", TestSpan.ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + Index.ToString(), "PassCount", PassCount.ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + Index.ToString(), "FailCount", FailCount.ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + Index.ToString(), "TestCount", TestCount.ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + Index.ToString(), "Yield", Yield.ToString()); } catch { } }
public void Selectfile(object p) { switch (p.ToString()) { case "1": OpenFileDialog dlg = new OpenFileDialog(); dlg.Filter = "视觉文件(*.hdev)|*.hdev|所有文件(*.*)|*.*"; if (dlg.ShowDialog() == DialogResult.OK) { HScriptFileName = dlg.FileName; Inifile.INIWriteValue(iniParameterPath, "Camera", "HScriptFileName", HScriptFileName); } dlg.Dispose(); break; default: break; } }
private void BigDataPeramEditCommandExecute() { if (BigDataEditIsReadOnly) { BigDataEditIsReadOnly = false; BigDataPeramEdit = "Save"; } else { Inifile.INIWriteValue(iniParameterPath, "System", "TestStation", TestStation); Inifile.INIWriteValue(iniParameterPath, "System", "Supplier", Supplier); Inifile.INIWriteValue(iniParameterPath, "System", "MachineNumber", MachineNumber); Inifile.INIWriteValue(iniParameterPath, "System", "ProgramName", ProgramName); Inifile.INIWriteValue(iniParameterPath, "System", "WARNVER", WARNVER); BigDataEditIsReadOnly = true; BigDataPeramEdit = "Edit"; AddMessage("大数据参数保存"); } }
public void Clean() { TestCount = 0; PassCount = 0; FailCount = 0; Yield = 0; TestCount_Nomal = 0; PassCount_Nomal = 0; FailCount_Nomal = 0; Yield_Nomal = 0; Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "PassCount_Nomal", PassCount_Nomal.ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "FailCount_Nomal", FailCount_Nomal.ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "TestCount_Nomal", TestCount_Nomal.ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "Yield_Nomal", Yield_Nomal.ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "PassCount", PassCount.ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "FailCount", FailCount.ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "TestCount", TestCount.ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "Yield", Yield.ToString()); }
/// <summary> /// 程序加载完 /// </summary> public async void AppLoaded() { mydialog.changeaccent("Red"); MainWindowVisibility = "Collapsed"; string str = await mydialog.showinput("请输入作业员编号"); if (str == "") { System.Windows.Application.Current.Shutdown(); } else { BLUID = str; Inifile.INIWriteValue(iniParameterPath, "SQLMSG", "BLUID", str); mydialog.changeaccent("Lime"); MainWindowVisibility = "Visible"; LoadBarCsvFromFile(); dispatcherTimer.Start(); } }
void Scan1GetBarcodeCallback(string barcode) { AddMessage(barcode); if (barcode != "Error") { try { //载具码、盖片码、产品码 string[] barcodes = barcode.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); BP04 = barcodes[0]; Inifile.INIWriteValue(iniParameterPath, "System", "BP04", BP04); BP11 = barcodes[1]; Inifile.INIWriteValue(iniParameterPath, "System", "BP11", BP11); BPPNL = barcodes[2]; Inifile.INIWriteValue(iniParameterPath, "System", "BPPNL", BPPNL); if (!Directory.Exists(Path.Combine(System.Environment.CurrentDirectory, GetBanci()))) { Directory.CreateDirectory(Path.Combine(System.Environment.CurrentDirectory, GetBanci())); } string path = Path.Combine(System.Environment.CurrentDirectory, GetBanci(), "Barcode.csv"); Csvfile.savetocsv(path, new string[] { DateTime.Now.ToString(), BP04, BP11, BPPNL }); SXJLibrary.Oracle oracle = new SXJLibrary.Oracle("qddb07.eavarytech.com", "mesdb07", "sfcabar", "sfcabar*168"); if (oracle.isConnect()) { string stm = string.Format("INSERT INTO SFCDATA.BARAUTPNL (LOCATIONID,FACTORYID,BPDATE,BPTIME,BPEMPID,BPWORKNO,BPLINE,BPIP,BPPNL,BP01,BP04,BP11) VALUES ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}')" , LOCATIONID, FACTORYID, DateTime.Now.ToString("yyyyMMdd"), DateTime.Now.ToString("HHmmss"), BPEMPID, BPWORKNO, BPLINE, BPIP, BPPNL, BP01, BP04, BP11); int rst = oracle.executeNonQuery(stm); AddMessage("插入数据" + rst.ToString()); } oracle.disconnect(); } catch (Exception ex) { AddMessage(ex.Message); } } else { //扫码失败 } }
private void EditSaveCommandExecute() { if (TextParmReadOnly) { TextParmReadOnly = false; SaveButtonContent = "Save"; } else { TextParmReadOnly = true; SaveButtonContent = "Edit"; Inifile.INIWriteValue(iniParameterPath, "System", "LOCATIONID", LOCATIONID); Inifile.INIWriteValue(iniParameterPath, "System", "FACTORYID", FACTORYID); Inifile.INIWriteValue(iniParameterPath, "System", "BPEMPID", BPEMPID); Inifile.INIWriteValue(iniParameterPath, "System", "BPWORKNO", BPWORKNO); Inifile.INIWriteValue(iniParameterPath, "System", "BPLINE", BPLINE); Inifile.INIWriteValue(iniParameterPath, "System", "BPIP", BPIP); Inifile.INIWriteValue(iniParameterPath, "System", "BP01", BP01); AddMessage("参数保存完成"); } }
private async void R750InspectCallback_2(string barcode) { PickBracodeA_2 = barcode; Inifile.INIWriteValue(iniParameterPath, "Barcode", "PickBracodeA_2", PickBracodeA_2); if (barcode == "Error") { ModelPrint("扫码不良"); if (TestSendStatus) { await TestSentNet.SendAsync("ScanResult;Ng;A"); } } else { ModelPrint("扫码成功 " + barcode); if (TestSendStatus) { await TestSentNet.SendAsync("ScanResult;Pass;A"); } } }
private void CheckCommandExecute() { try { if (CheckBarcode != "") { SXJLibrary.Oracle oracle = new SXJLibrary.Oracle("qddb07.eavarytech.com", "mesdb07", "sfcabar", "sfcabar*168"); if (oracle.isConnect()) { string stm = string.Format("SELECT * FROM SFCDATA.BARAUTPNL WHERE BPPNL = '{0}' ORDER BY BPDATE DESC,BPTIME DESC", CheckBarcode); DataSet ds = oracle.executeQuery(stm); Inifile.INIWriteValue(iniParameterPath, "System", "CheckBarcode", CheckBarcode); CheckItemsSource = ds.Tables[0]; } oracle.disconnect(); } } catch (Exception ex) { AddMessage(ex.Message); } }
public void UpdateNormalWithTestTimes(String tr) { if (tr == "PASS") { PassCount_Nomal++; } else { FailCount_Nomal++; } if (PassCount_Nomal + FailCount_Nomal != 0) { Yield_Nomal = Math.Round((double)PassCount_Nomal / (PassCount_Nomal + FailCount_Nomal) * 100, 2); } else { Yield_Nomal = 0; } Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "PassCount_Nomal", PassCount_Nomal.ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "FailCount_Nomal", FailCount_Nomal.ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "Yield_Nomal", Yield_Nomal.ToString()); }
private void DispatcherTimerAction(Object sender, EventArgs e) { if (!File.Exists(@"D:\Maintain.csv")) { string[] heads = { "时间", "机台号", "触发次数", "扫码次数", "上传次数" }; Csvfile.AddNewLine(@"D:\Maintain.csv", heads); } if (LastCleanRecordFlag != GetBanciDate() + GetBanci()) { LastCleanRecordFlag = GetBanciDate() + GetBanci(); Inifile.INIWriteValue(ParameterIniPath, "Record", "LastCleanRecordFlag", LastCleanRecordFlag); if (!Directory.Exists("D:\\" + LastCleanRecordFlag)) { Directory.CreateDirectory("D:\\" + LastCleanRecordFlag); } string[] count = { DateTime.Now.ToString(), JiTaiHao, TrigerTimes.ToString(), ScanTimes.ToString(), UpdateTimes.ToString() }; Csvfile.AddNewLine(@"D:\Maintain.csv", count); TrigerTimes = 0; ScanTimes = 0; UpdateTimes = 0; Inifile.INIWriteValue(ParameterIniPath, "Times", "TrigerTimes", TrigerTimes.ToString()); Inifile.INIWriteValue(ParameterIniPath, "Times", "ScanTimes", ScanTimes.ToString()); Inifile.INIWriteValue(ParameterIniPath, "Times", "UpdateTimes", UpdateTimes.ToString()); MsgText = AddMessage("记录清空"); } if (recordItemList.Count > 0) { lock (LockObject) { foreach (RecordItem item in recordItemList) { RecordCollection.Add(item); } recordItemList.Clear(); } } }
public void Update(TestResult tr) { TestCount++; if (tr == TestResult.Pass) { PassCount++; } else { FailCount++; } if (PassCount + FailCount != 0) { Yield = Math.Round((double)PassCount / (PassCount + FailCount) * 100, 2); } else { Yield = 0; } Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "PassCount", PassCount.ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "FailCount", FailCount.ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "TestCount", TestCount.ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "Yield", Yield.ToString()); }
/// <扫描周期> /// 100ms /// </扫描周期> private void RunLoop() { //[1] //--填入条码开始测试,测试完成条码会被清空 //BARCODE= //--PASS;FAIL; //RESULT= //--0:需要复测;1:可以取出 //TAKE= while (true) { for (int i = 0; i < 4; i++) { if (TestActionSwitch[i]) { switch (StepFlag[i]) { case 0: //写条码 Inifile.INIWriteValue(iniTestCommandpath, (i + 1).ToString(), "BARCODE", TesterBracode[i]); Inifile.INIWriteValue(iniTestCommandpath, (i + 1).ToString(), "RESULT", ""); Inifile.INIWriteValue(iniTestCommandpath, (i + 1).ToString(), "TAKE", ""); StepFlag[i] = 1; break; case 1: //读是否测试完成 string rststr = Inifile.INIGetStringValue(iniTestCommandpath, (i + 1).ToString(), "RESULT", "Error"); if (rststr == "PASS" || rststr == "FAIL") { StepFlag[i] = 2; } break; case 2: //读Pass;读Ng string takestr = Inifile.INIGetStringValue(iniTestCommandpath, (i + 1).ToString(), "TAKE", "Error"); Inifile.INIWriteValue(iniTestCommandpath, (i + 1).ToString(), "TAKE", ""); if (takestr == "0") { System.Threading.Thread.Sleep(2000); StepFlag[i] = 0; } else { string resultstr = Inifile.INIGetStringValue(iniTestCommandpath, (i + 1).ToString(), "RESULT", "PASS"); Inifile.INIWriteValue(iniTestCommandpath, (i + 1).ToString(), "RESULT", ""); result_flag[i] = resultstr == "PASS"; StepFlag[i] = 3; } break; case 3: //完成 System.Threading.Thread.Sleep(100); break; default: break; } } else { StepFlag[i] = -1; } } System.Threading.Thread.Sleep(100); } }
private void UpdateTester(int rst, int index_i) { /*result = 0 -> Ng * result = 1 -> Pass * result = 2 -> Timeout */ switch (rst) { case 0: testStatus[index_i] = TestStatus.Tested; testResult[index_i] = TestResult.Ng; break; case 1: testStatus[index_i] = TestStatus.Tested; testResult[index_i] = TestResult.Pass; break; case 2: testStatus[index_i] = TestStatus.Tested; testResult[index_i] = TestResult.TimeOut; break; default: testStatus[index_i] = TestStatus.Err; testResult[index_i] = TestResult.TimeOut; break; } if (!IsInSampleMode) { switch (rst) { case 0: FailCount[index_i]++; break; case 1: PassCount[index_i]++; break; default: break; } TestCount[index_i]++; if (PassCount[index_i] + FailCount[index_i] != 0) { Yield[index_i] = Math.Round((double)PassCount[index_i] / (PassCount[index_i] + FailCount[index_i]) * 100, 2); } else { Yield[index_i] = 0; } try { Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index * 4 + index_i).ToString(), "TestSpan", TestSpan[index_i].ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index * 4 + index_i).ToString(), "PassCount", PassCount[index_i].ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index * 4 + index_i).ToString(), "FailCount", FailCount[index_i].ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index * 4 + index_i).ToString(), "TestCount", TestCount[index_i].ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index * 4 + index_i).ToString(), "Yield", Yield[index_i].ToString()); } catch { } } }
public void UpdateNormal() { TestCount_Nomal++; Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "TestSpan", TestSpan.ToString()); Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "TestCount_Nomal", TestCount_Nomal.ToString()); }