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 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); } }
private async void Run() { string MODE = "1"; int CardStatus = 1, cardret = 1; while (true) { await Task.Delay(500); #region 刷卡 await Task.Run(() => { try { byte[] buf = new byte[256]; //用来存储卡信息的buff byte[] snr = 读写器530SDK.CPublic.CharToByte("FF FF FF FF FF FF"); //应该是一种读码格式,照抄即可。 if (IntPtr.Zero == reader.GetHComm()) { string COM = Inifile.INIGetStringValue(iniParameterPath, "读卡器", "COM", "COM19").Replace("COM", ""); reader.OpenComm(int.Parse(COM), 9600); MODE = Inifile.INIGetStringValue(iniParameterPath, "读卡器", "MODE", "3"); } //刷卡;若刷到卡返回0,没刷到回1。 CardStatus = reader.MF_Read(0, byte.Parse(MODE), 0, 1, ref snr[0], ref buf[0]); //采用上升沿信号,防止卡放在读卡机上,重复执行查询动作。寄卡放一次,才查询一次,要再查询,需要重新刷卡。 if (cardret != CardStatus) { cardret = CardStatus; if (CardStatus == 0)//刷到卡了 { string strTmp = ""; //测试发现,卡返回的是16个HEX(十六进制)数,放在byte[]数组内,需要用一下方法转成字符串格式。 for (int i = 0; i < 16; i++) { strTmp += string.Format("{0:X2} ", buf[i]); } //删除转换后,字符串内的空格。这些HEX字符并不是员工编号字符的编码,需要用读到的字符串在数据库里查找, //在记录里再匹配员工信息和权限 string barcode = strTmp.Replace(" ", ""); AddMessage("刷卡 " + barcode); BARCODE = barcode; SXJLibrary.Oracle oraDB = new SXJLibrary.Oracle("qddb04.eavarytech.com", "mesdb04", "ictdata", "ictdata*168"); if (oraDB.isConnect()) { string stm = string.Format("SELECT * FROM CAP_TABLE WHERE BARCODE = '{0}'", barcode); DataSet ds = oraDB.executeQuery(stm); DataTable dt = ds.Tables[0]; if (dt.Rows.Count > 0)//查询到数据条目大于0,即查到了 { //取查到的第一行记录,一般只有1行。如果有多行,也只取第一行。 DataRow dr = dt.Rows[0]; //筛选一下数据,如果我们需要的“工号”、“姓名”和“权限”对应的栏位为空,则数据不合格。 if (dr["OPERATORID"] != DBNull.Value && dr["DATA0"] != DBNull.Value && dr["RESULT"] != DBNull.Value && dr["DATA1"] != DBNull.Value) { //打印出匹配到的结果,并返回给下位机。 AddMessage("工号 " + (string)dr["OPERATORID"] + " 姓名 " + (string)dr["DATA0"] + " 权限 " + (string)dr["RESULT"] + " 料号 " + (string)dr["DATA1"]); stm = string.Format("UPDATE CFT_DATA SET BARCODE = '{0}',TRESULT = '{1}',OPERTOR = '{2}',TESTDATE = '{3}',TESTTIME = '{4}', CFT01 = '{6}' WHERE MNO = '{5}'", barcode, (string)dr["RESULT"], (string)dr["OPERATORID"], DateTime.Now.ToString("yyyyMMdd"), DateTime.Now.ToString("HHmmss"), MNO, (string)dr["DATA1"]); int updaterst = oraDB.executeNonQuery(stm); if (updaterst > 0) { AddMessage("更新刷卡机台" + (string)dr["PARTNUM"] + " " + updaterst.ToString()); oraDB.executeNonQuery("COMMIT"); } else { stm = string.Format("INSERT INTO CFT_DATA (BARCODE,TRESULT,OPERTOR,TESTDATE,TESTTIME,CFT01,MNO) VALUES ('{0}','{1}','{2}','{3}','{4}','{5}','{6}')", barcode, (string)dr["RESULT"], (string)dr["OPERATORID"], DateTime.Now.ToString("yyyyMMdd"), DateTime.Now.ToString("HHmmss"), (string)dr["DATA1"], MNO); int insertrst = oraDB.executeNonQuery(stm); AddMessage("插入刷卡机台" + (string)dr["PARTNUM"] + " " + insertrst.ToString()); oraDB.executeNonQuery("COMMIT"); } } else { AddMessage("数据库记录信息不完整"); } } else { AddMessage("未查询到卡信息"); } } oraDB.disconnect(); } } } catch (Exception ex) { reader.CloseComm(); AddMessage(ex.Message); } }); #endregion } }
private async void EntryInformationCommandExecute() { if (DATA0 != "") { if (OPERATORID != "") { if (PARTNUMItems.Count > 0) { if (BARCODE != "") { string Rst = RESULT ? "PASS" : "FAIL"; string data1 = ""; foreach (var item in PARTNUMItems) { data1 += item + ","; } data1 = data1.Substring(0, data1.Length - 1); await Task.Run(() => { try { SXJLibrary.Oracle oraDB = new SXJLibrary.Oracle("qddb04.eavarytech.com", "mesdb04", "ictdata", "ictdata*168"); if (oraDB.isConnect()) { string stm = string.Format("UPDATE CAP_TABLE SET RESULT = '{1}',OPERATORID = '{2}',SDATE = '{3}',STIME = '{4}',DATA0 = '{5}',DATA1 = '{6}' WHERE BARCODE = '{0}'" , BARCODE, Rst, OPERATORID, DateTime.Now.ToString("yyyyMMdd"), DateTime.Now.ToString("HHmmss"), DATA0, data1); int updaterst = oraDB.executeNonQuery(stm); if (updaterst > 0) { AddMessage("更新卡信息成功" + updaterst.ToString()); oraDB.executeNonQuery("COMMIT"); DATA0 = ""; OPERATORID = ""; BARCODE = ""; RESULT = true; } else { stm = string.Format("INSERT INTO CAP_TABLE (BARCODE,RESULT,OPERATORID,SDATE,STIME,DATA0,DATA1) VALUES ('{0}','{1}','{2}','{3}','{4}','{5}','{6}')" , BARCODE, Rst, OPERATORID, DateTime.Now.ToString("yyyyMMdd"), DateTime.Now.ToString("HHmmss"), DATA0, data1); int insertrst = oraDB.executeNonQuery(stm); if (insertrst > 0) { AddMessage("录入卡信息成功" + insertrst.ToString()); oraDB.executeNonQuery("COMMIT"); DATA0 = ""; OPERATORID = ""; BARCODE = ""; RESULT = true; } else { AddMessage("录入卡信息失败" + insertrst.ToString()); } } } else { AddMessage("数据库连接失败"); } oraDB.isConnect(); } catch (Exception ex) { AddMessage(ex.Message); } }); } else { AddMessage("条码为空"); } } else { AddMessage("料号为空"); } } else { AddMessage("工号为空"); } } else { AddMessage("姓名为空"); } }
void Init() { PM.Text = _PM = Inifile.INIGetStringValue(iniParameterPath, "BigData", "PM", "X1621"); GROUP1.Text = _GROUP1 = Inifile.INIGetStringValue(iniParameterPath, "BigData", "GROUP1", "NA"); TRACK.Text = _TRACK = Inifile.INIGetStringValue(iniParameterPath, "BigData", "TRACK", "0102"); MACID.Text = _MACID = Inifile.INIGetStringValue(iniParameterPath, "BigData", "MACID", "007"); WORKSTATION.Text = _WORKSTATION = Inifile.INIGetStringValue(iniParameterPath, "BigData", "WORKSTATION", "X1621"); LIGHT_ID.Text = _LIGHT_ID = Inifile.INIGetStringValue(iniParameterPath, "BigData", "LIGHT_ID", "007"); LampGreenElapse = int.Parse(Inifile.INIGetStringValue(iniParameterPath, "BigData", "LampGreenElapse", "0")); LampGreenFlickerElapse = int.Parse(Inifile.INIGetStringValue(iniParameterPath, "BigData", "LampGreenFlickerElapse", "0")); LampYellowElapse = int.Parse(Inifile.INIGetStringValue(iniParameterPath, "BigData", "LampYellowElapse", "0")); LampYellowFlickerElapse = int.Parse(Inifile.INIGetStringValue(iniParameterPath, "BigData", "LampYellowFlickerElapse", "0")); LampRedElapse = int.Parse(Inifile.INIGetStringValue(iniParameterPath, "BigData", "LampRedElapse", "0")); LastBanci = Inifile.INIGetStringValue(iniParameterPath, "Summary", "LastBanci", "null"); #region 报警文档 try { ExcelPackage.LicenseContext = LicenseContext.NonCommercial; if (File.Exists(alarmExcelPath)) { FileInfo existingFile = new FileInfo(alarmExcelPath); using (ExcelPackage package = new ExcelPackage(existingFile)) { // get the first worksheet in the workbook ExcelWorksheet worksheet = package.Workbook.Worksheets[0]; for (int i = 1; i <= worksheet.Dimension.End.Row; i++) { AlarmData ad = new AlarmData(); ad.Code = worksheet.Cells["A" + i.ToString()].Value == null ? "Null" : worksheet.Cells["A" + i.ToString()].Value.ToString(); ad.Content = worksheet.Cells["B" + i.ToString()].Value == null ? "Null" : worksheet.Cells["B" + i.ToString()].Value.ToString(); ad.Type = worksheet.Cells["C" + i.ToString()].Value == null ? "Null" : worksheet.Cells["C" + i.ToString()].Value.ToString(); ad.Start = DateTime.Now; ad.End = DateTime.Now; ad.State = false; AlarmList.Add(ad); } AddMessage("读取到" + worksheet.Dimension.End.Row.ToString() + "条报警"); } } else { AddMessage("X1621串线下料机报警.xlsx 文件不存在"); } } catch (Exception ex) { AddMessage(ex.Message); } #endregion string ip = Inifile.INIGetStringValue(iniParameterPath, "FX5U", "Ip", "192.168.0.20"); int port = int.Parse(Inifile.INIGetStringValue(iniParameterPath, "FX5U", "Port", "504")); Fx5u = new Fx5u(ip, port); ip = Inifile.INIGetStringValue(iniParameterPath, "FX5U", "Ip2", "192.168.0.20"); port = int.Parse(Inifile.INIGetStringValue(iniParameterPath, "FX5U", "Port2", "504")); Fx5u_2 = new Fx5u(ip, port); ScanA = new Scan(); string COM = Inifile.INIGetStringValue(iniParameterPath, "Scan", "ScanA", "COM3"); ScanA.ini(COM); ScanB = new Scan(); COM = Inifile.INIGetStringValue(iniParameterPath, "Scan", "ScanB", "COM3"); ScanB.ini(COM); UpdateUI(); CardRun(); Task.Run(() => { Run(); }); BigDataRun(); #region 更新本地时间 try { SXJLibrary.Oracle oraDB = new SXJLibrary.Oracle("qddb04.eavarytech.com", "mesdb04", "ictdata", "ictdata*168"); if (oraDB.isConnect()) { string oracleTime = oraDB.OraclDateTime(); AddMessage("更新数据库时间到本地" + oracleTime); } oraDB.disconnect(); } catch (Exception ex) { AddMessage(ex.Message); } #endregion }
async void CheckSam() { try { int ngItemCount = int.Parse(Inifile.INIGetStringValue(iniParameterPath, "Sample", "NGItemCount", "3")); int nGItemLimit = int.Parse(Inifile.INIGetStringValue(iniParameterPath, "Sample", "NGItemLimit", "99")); string MNO = Inifile.INIGetStringValue(iniParameterPath, "BigData", "MACID", "X1621_1"); Oracle oraDB = new Oracle("qddb04.eavarytech.com", "mesdb04", "ictdata", "ictdata*168"); if (oraDB.isConnect()) { for (int i = 0; i < ngItemCount; i++) { for (int j = 0; j < 4; j++) { string flexid = Inifile.INIGetStringValue(iniFilepath, "A", "id" + (j + 1).ToString(), "99999"); string ngitem = Inifile.INIGetStringValue(iniParameterPath, "Sample", "NGItem" + i.ToString(), "Null"); string stm = String.Format("Select * from fluke_data WHERE FL04 = '{0}' AND FL01 = '{1}' AND ITSDATE = '{2}' ORDER BY ITSDATE DESC, ITSTIME DESC", flexid, ngitem, DateTime.Now.ToString("yyyyMMdd")); DataSet s = oraDB.executeQuery(stm); DataTable dt = s.Tables[0]; if (dt.Rows.Count > 0) { string datestr = (string)dt.Rows[0]["ITSDATE"]; string timestr = (string)dt.Rows[0]["ITSTIME"]; if (datestr.Length == 8 && (timestr.Length == 5 || timestr.Length == 6)) { if (timestr.Length == 5) { timestr = "0" + timestr; } string datetimestr = string.Empty; datetimestr = string.Format("{0}/{1}/{2} {3}:{4}:{5}", datestr.Substring(0, 4), datestr.Substring(4, 2), datestr.Substring(6, 2), timestr.Substring(0, 2), timestr.Substring(2, 2), timestr.Substring(4, 2)); DateTime updatetime = Convert.ToDateTime(datetimestr); TimeSpan sp = updatetime - SamStart; if (sp.TotalSeconds > 0) { stm = String.Format("Select * from barsaminfo WHERE BARCODE = '{0}' ORDER BY CDATE DESC,CTIME DESC", (string)dt.Rows[0]["BARCODE"]); DataSet s1 = oraDB.executeQuery(stm); DataTable dt1 = s1.Tables[0]; if (dt1.Rows.Count > 0) { try { datestr = (string)dt1.Rows[0]["CDATE"]; timestr = (string)dt1.Rows[0]["CTIME"]; if (datestr.Length == 8 && (timestr.Length == 5 || timestr.Length == 6)) { if (timestr.Length == 5) { timestr = "0" + timestr; } datetimestr = string.Empty; datetimestr = string.Format("{0}/{1}/{2} {3}:{4}:{5}", datestr.Substring(0, 4), datestr.Substring(4, 2), datestr.Substring(6, 2), timestr.Substring(0, 2), timestr.Substring(2, 2), timestr.Substring(4, 2)); updatetime = Convert.ToDateTime(datetimestr); if ((DateTime.Now - updatetime).TotalDays <= nGItemLimit) { //插入样本记录 string parnum = Inifile.INIGetStringValue(iniFilepath, "Other", "pn", "FHAPHS9"); string tres = ngitem.Length > 20 ? ngitem.Substring(0, 20) : ngitem; stm = String.Format("INSERT INTO BARSAMREC (PARTNUM,SITEM,BARCODE,NGITEM,TRES,MNO,CDATE,CTIME,SR01) VALUES ('{0}','FLUKE','{1}','{2}','{3}','{4}','{5}','{6}','{7}')", parnum, (string)dt.Rows[0]["BARCODE"], (string)dt1.Rows[0]["NGITEM"], tres, MNO, DateTime.Now.ToString("yyyyMMdd"), DateTime.Now.ToString("HHmmss"), flexid); await Task.Run(() => { oraDB.executeNonQuery(stm); }); string filepath = "D:\\样本记录\\样本记录" + GetBanci() + ".csv"; if (!Directory.Exists("D:\\样本记录")) { Directory.CreateDirectory("D:\\样本记录"); } if (!File.Exists(filepath)) { string[] heads = { "DateTime", "PARTNUM", "SITEM", "BARCODE", "NGITEM", "TRES", "MNO", "CDATE", "CTIME", "SR01" }; Csvfile.savetocsv(filepath, heads); } string[] conte = { System.DateTime.Now.ToString(), parnum, "FLUKE", (string)dt.Rows[0]["BARCODE"], (string)dt1.Rows[0]["NGITEM"], tres, MNO, DateTime.Now.ToString("yyyyMMdd"), DateTime.Now.ToString("HHmmss"), flexid }; Csvfile.savetocsv(filepath, conte); ModelPrint("插入样本记录 " + (string)dt.Rows[0]["BARCODE"] + " " + updatetime.ToString()); } else { ModelPrint((string)dt.Rows[0]["BARCODE"] + "样本时间" + updatetime.ToString() + " > " + nGItemLimit.ToString() + "天"); sampleContent[i][j] = "Limit"; } } } catch (Exception ex) { ModelPrint(ex.Message); } if (((string)dt1.Rows[0]["NGITEM"]).ToUpper() == ngitem.ToUpper()) { sampleContent[i][j] = "ok"; } else { sampleContent[i][j] = (string)dt1.Rows[0]["NGITEM"]; } } else { sampleContent[i][j] = "NoSam"; } } else { sampleContent[i][j] = "NotNew"; } } else { ModelPrint("时间格式错误"); sampleContent[i][j] = "Error"; } } else { sampleContent[i][j] = "NoRecord"; } } } //回复样本结果 bool resut = true; for (int i = 0; i < ngItemCount; i++) { for (int j = 0; j < 4; j++) { if (sampleContent[i][j] != "ok") { string resultString = "RestartSample;" + j.ToString() + ";" + i.ToString(); if (TestSendStatus) { ModelPrint(resultString); await TestSentNet.SendAsync(resultString); } resut = false; } } } if (resut) { ModelPrint("EndSample"); await TestSentNet.SendAsync("EndSample"); } } else { ModelPrint("样本查询Error:数据库连接失败"); } oraDB.disconnect(); } catch (Exception ex) { ModelPrint("样本查询Error:" + ex.Message); } }
private void run() { status = true; timed = 1000; int ngnum = 0; while (true) { if (start) { string newbar = Inifile.INIGetStringValue(iniFilepath, "A", "bar" + index.ToString(), "0"); try { Oracle oraDB = new Oracle("qddb04.eavarytech.com", "mesdb04", "ictdata", "ictdata*168"); if (oraDB.isConnect()) { string stm = String.Format("Select * from fluke_data WHERE BARCODE = '{0}'AND TRESULT = '{1}' ORDER BY ITSDATE DESC, ITSTIME DESC", newbar, result); DataSet s = oraDB.executeQuery(stm); DataTable dt = s.Tables[0]; if (dt.Rows.Count > 0) { string datestr = (string)dt.Rows[0]["ITSDATE"]; string timestr = (string)dt.Rows[0]["ITSTIME"]; if (datestr.Length == 8 && (timestr.Length == 5 || timestr.Length == 6)) { if (timestr.Length == 5) { timestr = "0" + timestr; } string datetimestr = string.Empty; datetimestr = string.Format("{0}/{1}/{2} {3}:{4}:{5}", datestr.Substring(0, 4), datestr.Substring(4, 2), datestr.Substring(6, 2), timestr.Substring(0, 2), timestr.Substring(2, 2), timestr.Substring(4, 2)); DateTime updatetime = Convert.ToDateTime(datetimestr); TimeSpan sp = System.DateTime.Now - updatetime; if (sp.TotalSeconds < 30) { ngnum = 0; status = true; timed = 2000; start = false; ModelPrint("测试机" + index.ToString() + ": " + newbar + " 数据上传成功 " + updatetime.ToString()); stm = String.Format("Select * from fluke_data WHERE BARCODE = '{0}' ORDER BY ITSDATE DESC, ITSTIME DESC", newbar, result); s = oraDB.executeQuery(stm); dt = s.Tables[0]; if (dt.Rows.Count > 3) { RecordPrint(index, newbar, result, testerCycle, false); } else { RecordPrint(index, newbar, result, testerCycle, true); } } else { timed = 1000; ModelPrint("测试机" + index.ToString() + ": " + newbar + " 数据上传逾时 " + updatetime.ToString()); } } else { timed = 1000; ModelPrint("测试机" + index.ToString() + ": " + newbar + " 时间格式错误 " + datestr + " " + timestr); } } else { timed = 1000; ModelPrint("测试机" + index.ToString() + ": " + newbar + " 未查询到数据"); } } else { timed = 1000; ModelPrint("测试机" + index.ToString() + ": " + newbar + " 数据库未连接"); } oraDB.disconnect(); } catch (Exception ex) { ModelPrint("测试机" + index.ToString() + ": " + newbar + " 查询数据库出错" + ex.Message); timed = 1000; } if (sw.Elapsed.TotalSeconds > 15 && start) { if (++ngnum > 1) { ngnum = 0; status = false; ModelPrint("测试机" + index.ToString() + ": " + newbar + " 检测超时,2次,退出"); } else { status = true; ModelPrint("测试机" + index.ToString() + ": " + newbar + " 检测超时,1次,退出"); } start = false; timed = 2000; RecordPrint(index, "****************************", result, testerCycle, true); } } else { timed = 2000; } System.Threading.Thread.Sleep(timed); } }
public MainWindowViewModel() { #region 方法绑定 this.FuncTestCommand = new DelegateCommand(new Action(this.FuncTestCommandExecute)); this.EditSaveCommand = new DelegateCommand(new Action(this.EditSaveCommandExecute)); this.ChoosePageCommand = new DelegateCommand <object>(new Action <object>(this.ChoosePageCommandExecute)); this.CheckCommand = new DelegateCommand(new Action(this.CheckCommandExecute)); #endregion #region 界面元素初始化 this.MessageStr = ""; this.WindowTitle = "淮安鹏鼎轨道扫码软体"; this.SaveButtonContent = "Edit"; this.TextParmReadOnly = true; LOCATIONID = Inifile.INIGetStringValue(iniParameterPath, "System", "LOCATIONID", "HA"); FACTORYID = Inifile.INIGetStringValue(iniParameterPath, "System", "FACTORYID", "A1-2F"); BPEMPID = Inifile.INIGetStringValue(iniParameterPath, "System", "BPEMPID", "F7052804"); BPWORKNO = Inifile.INIGetStringValue(iniParameterPath, "System", "BPWORKNO", "1000080146"); BPLINE = Inifile.INIGetStringValue(iniParameterPath, "System", "BPLINE", "S14-302"); BPIP = Inifile.INIGetStringValue(iniParameterPath, "System", "BPIP", "01"); BP01 = Inifile.INIGetStringValue(iniParameterPath, "System", "BP01", "F0AP0194A0Q"); BP04 = Inifile.INIGetStringValue(iniParameterPath, "System", "BP04", "FHAPGD6A7X1SBD180324121"); BP11 = Inifile.INIGetStringValue(iniParameterPath, "System", "BP11", "FHAPGD6A7X1SBDC180324314"); BPPNL = Inifile.INIGetStringValue(iniParameterPath, "System", "BPPNL", "A00110662A12210172"); CheckBarcode = Inifile.INIGetStringValue(iniParameterPath, "System", "CheckBarcode", "A00110662A12210172"); HomePageVisibility = "Visible"; CheckPageVisibility = "Collapsed"; #endregion #region 部件 string COM = Inifile.INIGetStringValue(iniParameterPath, "Scan", "COM", "COM0"); Scan1.ini(COM); #endregion #region 初始化IO卡 IoInput = new ObservableCollection <bool>(); for (int i = 0; i < 24; i++) { IoInput.Add(false); } IoOutput = new ObservableCollection <bool>(); for (int i = 0; i < 16; i++) { IoOutput.Add(false); } IOCardRun(); #endregion #region 更新本地时间 try { SXJLibrary.Oracle oraDB = new SXJLibrary.Oracle("qddb04.eavarytech.com", "mesdb04", "ictdata", "ictdata*168"); if (oraDB.isConnect()) { string oracleTime = oraDB.OraclDateTime(); AddMessage("更新数据库时间到本地" + oracleTime); } oraDB.disconnect(); } catch (Exception ex) { AddMessage(ex.Message); } #endregion }