Make_ParseLog.cs 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676
  1. using BarTender;
  2. using DevExpress.Xpo.Logger;
  3. using DevExpress.XtraPrinting;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.ComponentModel;
  7. using System.Data;
  8. using System.Drawing;
  9. using System.IO;
  10. using System.Linq;
  11. using System.Security;
  12. using System.Security.AccessControl;
  13. using System.Security.Principal;
  14. using System.Text;
  15. using System.Threading.Tasks;
  16. using System.Web.Services.Description;
  17. using System.Web.UI.WebControls;
  18. using System.Windows.Forms;
  19. using System.Xml;
  20. using UAS_MES_NEW.CustomControl.ButtonUtil;
  21. using UAS_MES_NEW.CustomControl.TextBoxWithIcon;
  22. using UAS_MES_NEW.DataOperate;
  23. using UAS_MES_NEW.Entity;
  24. using UAS_MES_NEW.PublicMethod;
  25. using static DevExpress.Xpo.DB.DataStoreLongrunnersWatch;
  26. namespace UAS_MES_NEW.Make
  27. {
  28. public partial class Make_ParseLog : Form
  29. {
  30. public Make_ParseLog()
  31. {
  32. InitializeComponent();
  33. }
  34. LogStringBuilder sql = new LogStringBuilder();
  35. DataTable Dbfind;
  36. DataTable dt;
  37. DataHelper dh;
  38. string currFileType = "";
  39. string SN, omakeCode, oMsid, oErrorMessage = "";
  40. string equiType = "";
  41. private void Make_ParseLog_Load(object sender, EventArgs e)
  42. {
  43. dh = SystemInf.dh;
  44. //设置锁定工单
  45. LockMakeCode.GetMakeCodeCtl(ma_code);
  46. ma_code.SetLockCheckBox(LockMakeCode);
  47. //工单号放大镜配置
  48. ma_code.TableName = "make left join product on ma_prodcode=pr_code";
  49. ma_code.SelectField = "ma_code # 工单号,pr_code # 产品编号,pr_detail # 产品名称";
  50. ma_code.FormName = Name;
  51. ma_code.SetValueField = new string[] { "ma_code", "pr_code", "pr_detail" };
  52. ma_code.Condition = "ma_statuscode='STARTED'";
  53. ma_code.DbChange += Ma_code_DbChange;
  54. }
  55. private void Ma_code_DbChange(object sender, EventArgs e)
  56. {
  57. Dbfind = ma_code.ReturnData;
  58. BaseUtil.SetFormValue(this.Controls, Dbfind);
  59. //获取工单的其他信息
  60. sql.Clear();
  61. sql.Append("select ma_code,nvl(mcd_okqty,0) mcd_okqty,ma_prodcode as pr_code ,pr_detail,");
  62. sql.Append("pr_spec,ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail on ");
  63. sql.Append("mcd_maid=ma_id left join product on pr_code=ma_prodcode where ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
  64. dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
  65. if (dt.Rows.Count > 0)
  66. {
  67. BaseUtil.SetFormValue(this.Controls, dt);
  68. }
  69. }
  70. private void Device_SelectedIndexChanged(object sender, EventArgs e)
  71. {
  72. if (string.IsNullOrEmpty(ma_code.Text))
  73. {
  74. Device.SelectedIndex = -1;
  75. MessageBox.Show(this.ParentForm, "请选择工单", "提示");
  76. return;
  77. }
  78. txtPath.Focus();
  79. txtPath.SelectAll();
  80. }
  81. private void allParse_Click(object sender, EventArgs e)
  82. {
  83. if (string.IsNullOrEmpty(ma_code.Text))
  84. {
  85. MessageBox.Show(this.ParentForm, "请选择工单", "提示");
  86. return;
  87. }
  88. if (Device.SelectedIndex == -1)
  89. {
  90. Device.Focus();
  91. Device.SelectAll();
  92. MessageBox.Show(this.ParentForm, "请选择设备", "提示");
  93. return;
  94. }
  95. if (String.IsNullOrEmpty(txtPath.Text))
  96. {
  97. txtPath.Focus();
  98. txtPath.SelectAll();
  99. return;
  100. }
  101. RefreshFileList();
  102. }
  103. private void Choose_Click(object sender, EventArgs e)
  104. {
  105. if (string.IsNullOrEmpty(ma_code.Text))
  106. {
  107. MessageBox.Show(this.ParentForm, "请选择工单", "提示");
  108. return;
  109. }
  110. if (Device.SelectedIndex == -1)
  111. {
  112. Device.Focus();
  113. Device.SelectAll();
  114. MessageBox.Show(this.ParentForm, "请选择设备", "提示");
  115. return;
  116. }
  117. if (!String.IsNullOrEmpty(txtPath.Text))
  118. {
  119. txtPath.Focus();
  120. txtPath.SelectAll();
  121. }
  122. try
  123. {
  124. FolderBrowserDialog dialog = new FolderBrowserDialog();
  125. switch (Device.SelectedIndex)
  126. {
  127. case 0:
  128. dialog.Description = "请选择读取SPI设备文件夹";
  129. currFileType = "txt";
  130. equiType = "1";
  131. break;
  132. case 1:
  133. dialog.Description = "请选择读取AOI设备文本文件";
  134. currFileType = "txt";
  135. equiType = "2";
  136. break;
  137. case 2:
  138. dialog.Description = "请选择读取印刷机设备的文本文件夹";
  139. currFileType = "xml";
  140. equiType = "3";
  141. break;
  142. case 3:
  143. dialog.Description = "请选择读取贴片机的文本文件夹";
  144. currFileType = "xml";
  145. equiType = "4";
  146. break;
  147. }
  148. if (dialog.ShowDialog() == DialogResult.OK)
  149. {
  150. txtPath.Text = dialog.SelectedPath;
  151. txtPath.Enabled = false;
  152. Device.Enabled = false;
  153. var watcher = new FileSystemWatcher(txtPath.Text);
  154. watcher.Filter = $"*.{currFileType}";
  155. watcher.NotifyFilter = NotifyFilters.FileName | NotifyFilters.LastWrite;
  156. watcher.Created += OnFileCreated;
  157. /*watcher.Changed += OnFileChanged;
  158. watcher.Deleted += OnFileChanged;
  159. watcher.Renamed += OnFileChanged;*/
  160. watcher.EnableRaisingEvents = true;
  161. }
  162. #region
  163. /*OpenFileDialog dialog = new OpenFileDialog();
  164. dialog.Multiselect = true;//该值确定是否可以选择多个文件
  165. dialog.Filter = "文本文件 (*.txt)|*.txt|All files (*.*)|*.*";
  166. switch (Device.SelectedIndex)
  167. {
  168. case 0:
  169. dialog.Title = "请选择读取SPI设备文件夹";
  170. dialog.Filter = "All files (*.*)|*.*";
  171. break;
  172. case 1:
  173. dialog.Title = "请选择读取AOI设备文本文件";
  174. dialog.Filter = "All files (*.*)|*.*";
  175. break;
  176. case 2:
  177. dialog.Title = "请选择读取印刷机设备的文本文件夹";
  178. dialog.Filter = "文本文件 (*.xml)|*.xml|All files (*.*)|*.*";
  179. break;
  180. }
  181. if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  182. {
  183. txtPath.Text = dialog.FileName;
  184. dialog.Dispose();
  185. ListViewItem item = new ListViewItem();
  186. int count = logList.Items.Count;
  187. item.Text = (++count).ToString();
  188. item.SubItems.Add(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
  189. item.SubItems.Add(txtPath.Text);
  190. logList.Items.Add(item);
  191. }
  192. if (Device.SelectedIndex == 0) // SPI
  193. {
  194. ParseLogInsert(txtPath.Text);
  195. Console.WriteLine();
  196. }
  197. else if (Device.SelectedIndex == 1) // AOI
  198. {
  199. }
  200. else if (Device.SelectedIndex == 2) // 印刷机
  201. {
  202. PrinterData xmlData = ReadWithXmlReader(txtPath.Text);
  203. Console.WriteLine();
  204. }*/
  205. #endregion
  206. }
  207. catch (Exception ex)
  208. {
  209. MessageBox.Show(this.ParentForm, ex.Message, "警告");
  210. }
  211. }
  212. private void OnFileCreated(object sender, FileSystemEventArgs e)
  213. {
  214. RefreshFileList();
  215. }
  216. private void OnFileChanged(object sender, FileSystemEventArgs e)
  217. {
  218. if (e.ChangeType == WatcherChangeTypes.Changed)
  219. {
  220. RefreshFileList();
  221. }
  222. }
  223. private void RefreshFileList()
  224. {
  225. // 在UI线程上执行更新
  226. if (lstFiles.InvokeRequired)
  227. {
  228. lstFiles.Invoke(new Action(RefreshFileList));
  229. return;
  230. }
  231. try
  232. {
  233. if (!Directory.Exists(txtPath.Text))
  234. {
  235. LogMessage($"目录不存在: {txtPath.Text}");
  236. return;
  237. }
  238. string[] txtFiles = Directory.GetFiles(txtPath.Text, $"*.{currFileType}");
  239. if (txtFiles.Length == 0)
  240. {
  241. LogMessage($"当前没有{currFileType.ToUpper()}文件");
  242. return;
  243. }
  244. else
  245. {
  246. foreach (string file in txtFiles)
  247. {
  248. LogMessage(file);
  249. if (Device.SelectedIndex == 0) // SPI
  250. {
  251. ParseLogInsert(file);
  252. Console.WriteLine();
  253. }
  254. else if (Device.SelectedIndex == 1) // AOI
  255. {
  256. }
  257. else if (Device.SelectedIndex == 2) // 印刷机
  258. {
  259. PrinterData xmlData = ReadWithXmlReader(file);
  260. Console.WriteLine();
  261. }
  262. else if (Device.SelectedIndex == 3) // 贴片机
  263. {
  264. if (!File.Exists(file))
  265. {
  266. LogMessage($"文件不存在: {file}");
  267. }
  268. string xmlContent = File.ReadAllText(file);
  269. var xmlList = ParseXml(xmlContent);
  270. if (ConsoleLog(xmlContent, file))
  271. {
  272. File.Delete(file);
  273. }
  274. List<string> param = new List<string>() { };
  275. string PS_CODE = "";
  276. LogicHandler.GetSerialNumByCaller("Make!ParseLog", out PS_CODE);
  277. List<string> MachineName = new List<string>();
  278. List<string> Part = new List<string>();
  279. List<string> Station = new List<string>();
  280. List<string> ReelNo = new List<string>();
  281. string Part_ = "";
  282. foreach (var item in xmlList)
  283. {
  284. MachineName.Add(item.MachineName);
  285. Part_ = item.Part;
  286. Station.Add(item.Station);
  287. ReelNo.Add(item.ReelNo);
  288. }
  289. string ps_id = "";
  290. if (!dh.CheckExist("productsmt", "ps_prodcode='" + Part_ + "'"))
  291. {
  292. ps_id = dh.GetSEQ("productsmt_seq");
  293. dh.ExecuteSql("insert into productsmt(ps_id,ps_prodcode,ps_linecode,ps_status,ps_statuscode)" +
  294. "values('" + ps_id + "','" + Part_ + "','','在录入','ENTERING')", "insert");
  295. }
  296. else
  297. {
  298. ps_id = dh.getFieldDataByCondition("productsmt", "ps_id", "ps_prodcode='"+Part_+"'").ToString();
  299. }
  300. sql.Clear();
  301. sql.Append("insert into productsmtlocation(PSL_ID, PSL_PSID, PSL_DETNO, PSL_PRODCODE, PSL_REPCODE, PSL_LOCATION, PSL_BASEQTY, PSL_TABLE)" +
  302. "select productsmtlocation_seq.nextval," + ps_id + ",rownum,:ReelNo,:ReelNo,:Station,BD_BASEQTY,'' from bom@ERP " +
  303. "left join bomdetail@ERP on bo_id=bd_bomid where bo_mothercode='" + Part_ + "' and BD_SONCODE=:ReelNo");
  304. dh.BatchInsert(sql.GetString(), new string[] { "ReelNo", "ReelNo", "Station", "Part", "ReelNo" },
  305. ReelNo.ToArray(), ReelNo.ToArray(), Station.ToArray(), Part.ToArray(), ReelNo.ToArray());
  306. Console.WriteLine();
  307. }
  308. }
  309. LogMessage($"共找到{txtFiles.Length}个{currFileType.ToUpper()}文件");
  310. }
  311. }
  312. catch (Exception ex)
  313. {
  314. LogMessage($"刷新文件列表时出错: {ex.Message}");
  315. }
  316. }
  317. private void ParseLogInsert(string PathName)
  318. {
  319. try
  320. {
  321. StreamReader SR = File.OpenText(PathName);
  322. string restOfStream = SR.ReadToEnd();
  323. SR.Close();
  324. SR.Dispose();
  325. List<Log> logArr = new List<Log>() { };
  326. string[] lines = restOfStream.Split(new string[] { "\r\n" }, StringSplitOptions.None);
  327. LogMessage($"文件夹{PathName},共{lines.Length}条记录");
  328. foreach (var item in lines)
  329. {
  330. if (string.IsNullOrEmpty(item)) continue;
  331. string[] currItem = item.Split(',');
  332. string res = "";
  333. /*List<NgData> data = new List<NgData>();*/
  334. if (currItem[1] != "PASS")
  335. {
  336. res = "NG";
  337. #region
  338. /*string[] NgArr = currItem[1].Split(';');
  339. foreach (var ngItem in NgArr)
  340. {
  341. string[] ngItemArr = ngItem.Split('*');
  342. List<string> ngItemLocal = ngItemArr[1].Split('&').ToList();
  343. NgData ngData = new NgData {
  344. Code = ngItemArr[0],
  345. Local = ngItemLocal
  346. };
  347. data.Add(ngData);
  348. }*/
  349. #endregion
  350. }
  351. else
  352. {
  353. res = "PASS";
  354. }
  355. Log itemLog = new Log()
  356. {
  357. SN = currItem[0],
  358. Result = res,
  359. Details = currItem[1]
  360. };
  361. logArr.Add(itemLog);
  362. LogMessage($"已解析: {currItem[0]}");
  363. }
  364. InsertDb(logArr, PathName);
  365. File.WriteAllText(PathName, string.Empty);
  366. if (ConsoleLog(restOfStream, PathName))
  367. {
  368. File.Delete(PathName);
  369. }
  370. }
  371. catch (Exception ex)
  372. {
  373. MessageBox.Show(this.ParentForm, ex.Message, "警告");
  374. }
  375. }
  376. private void InsertDb(List<Log> logs, string PathName)
  377. {
  378. try
  379. {
  380. int type = Device.SelectedIndex;
  381. StringBuilder sql = new StringBuilder();
  382. List<string> param = new List<string>() { };
  383. foreach (var item in logs)
  384. {
  385. param.Add(item.SN);
  386. param.Add(ma_code.Text);
  387. if (item.Result == "PASS")
  388. {
  389. param.Add(item.Result);
  390. }
  391. else
  392. {
  393. param.Add(item.Result);
  394. }
  395. param.Add(equiType);
  396. param.Add(item.Details);
  397. param.Add(User.UserCode);
  398. param.Add(User.UserSourceCode);
  399. param.Add(User.UserLineCode);
  400. string res = "";
  401. param.Add(res);
  402. string[] paramList = param.ToArray();
  403. dh.CallProcedure("cs_insert_testrejects", ref paramList);
  404. param.Clear();
  405. if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, item.SN, User.UserCode, out omakeCode, out oMsid, out oErrorMessage))
  406. {
  407. if (LogicHandler.SetStepResult(omakeCode, User.UserSourceCode, item.SN, "日志解析", "OK", User.UserCode, out oErrorMessage))
  408. {
  409. if (oErrorMessage.Contains("AFTERSUCCESS")) LogMessage(">>" + oErrorMessage + "\n");
  410. sql.Clear();
  411. sql.Append("select ma_code,nvl(mcd_okqty,0) mcd_okqty,ma_prodcode,pr_detail,");
  412. sql.Append("ma_qty - nvl(mcd_okqty, 0) remain_qty from make left join makecraftdetail on ");
  413. sql.Append("mcd_maid=ma_id left join product on pr_code=ma_prodcode where ma_code='" + omakeCode + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
  414. dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
  415. BaseUtil.SetFormValue(Controls, dt);
  416. //记录日志
  417. LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "日志解析", "日志解析成功", item.SN, "");
  418. LogMessage("<<解析成功\n");
  419. }
  420. else
  421. {
  422. LogMessage(">>" + oErrorMessage + "\n");
  423. }
  424. }
  425. else
  426. {
  427. LogMessage(">>" + oErrorMessage + "\n");
  428. }
  429. }
  430. }
  431. catch (Exception ex)
  432. {
  433. MessageBox.Show(this.ParentForm, ex.Message, "警告");
  434. }
  435. }
  436. private bool ConsoleLog(string Content, string PathName)
  437. {
  438. try
  439. {
  440. string sourceDir = Path.GetDirectoryName(PathName);
  441. string newFolderName = "Logs";
  442. string newFolderPath = Path.Combine(sourceDir, newFolderName);
  443. if (!Directory.Exists(newFolderPath))
  444. {
  445. Directory.CreateDirectory(newFolderPath);
  446. }
  447. string newFileName = "Log_" + Path.GetFileName(PathName);
  448. string newFilePath = Path.Combine(newFolderPath, newFileName);
  449. File.AppendAllText(newFilePath, Content + Environment.NewLine);
  450. return true;
  451. }
  452. catch (Exception ex)
  453. {
  454. MessageBox.Show(this.ParentForm, ex.Message, "警告");
  455. return false;
  456. }
  457. }
  458. private void LogMessage(string message)
  459. {
  460. if (lstFiles.InvokeRequired)
  461. {
  462. lstFiles.Invoke(new Action<string>(LogMessage), message);
  463. return;
  464. }
  465. lstFiles.Items.Add($"[{DateTime.Now:yyyy-MM-dd HH:mm:ss}] {message}");
  466. lstFiles.TopIndex = lstFiles.Items.Count - 1;
  467. }
  468. private PrinterData ReadWithXmlReader(string filePath)
  469. {
  470. PrinterData data = new PrinterData();
  471. using (XmlReader reader = XmlReader.Create(filePath))
  472. {
  473. while (reader.Read())
  474. {
  475. if (reader.NodeType == XmlNodeType.Element)
  476. {
  477. switch (reader.Name)
  478. {
  479. case "SN":
  480. data.SN = reader.ReadElementContentAsString();
  481. break;
  482. case "Barcode":
  483. data.Barcode = reader.ReadElementContentAsString();
  484. break;
  485. case "Direction":
  486. data.Direction = reader.ReadElementContentAsString();
  487. break;
  488. case "PrintTime":
  489. data.PrintTime = reader.ReadElementContentAsString();
  490. break;
  491. case "PANEL":
  492. ReadPanelData(reader, data.Panel);
  493. break;
  494. case "PROCESS":
  495. ReadProcessData(reader, data.Process);
  496. break;
  497. }
  498. }
  499. }
  500. }
  501. return data;
  502. }
  503. private void ReadPanelData(XmlReader reader, Panel panel)
  504. {
  505. while (reader.Read())
  506. {
  507. if (reader.NodeType == XmlNodeType.Element)
  508. {
  509. switch (reader.Name)
  510. {
  511. case "PanelID":
  512. panel.PanelID = reader.ReadElementContentAsString();
  513. break;
  514. case "PanelName":
  515. panel.PanelName = reader.ReadElementContentAsString();
  516. break;
  517. case "PanelFirm":
  518. panel.PanelFirm = reader.ReadElementContentAsString();
  519. break;
  520. case "PanelLength":
  521. panel.PanelLength = reader.ReadElementContentAsDouble();
  522. break;
  523. case "PanelWide":
  524. panel.PanelWide = reader.ReadElementContentAsDouble();
  525. break;
  526. case "PanelThickness":
  527. panel.PanelThickness = reader.ReadElementContentAsDouble();
  528. break;
  529. }
  530. }
  531. else if (reader.NodeType == XmlNodeType.EndElement && reader.Name == "PANEL")
  532. {
  533. break;
  534. }
  535. }
  536. }
  537. private void ReadProcessData(XmlReader reader, Process process)
  538. {
  539. while (reader.Read())
  540. {
  541. if (reader.NodeType == XmlNodeType.Element)
  542. {
  543. switch (reader.Name)
  544. {
  545. case "ProcessName":
  546. process.ProcessName = reader.ReadElementContentAsString();
  547. break;
  548. case "LineNumber":
  549. process.LineNumber = reader.ReadElementContentAsString();
  550. break;
  551. case "StencilNum":
  552. process.StencilNum = reader.ReadElementContentAsString();
  553. break;
  554. }
  555. }
  556. else if (reader.NodeType == XmlNodeType.EndElement && reader.Name == "PROCESS")
  557. {
  558. break;
  559. }
  560. }
  561. }
  562. public List<MachineList> ParseXml(string xmlContent)
  563. {
  564. List<MachineList> result = new List<MachineList>();
  565. try
  566. {
  567. XmlDocument xmlDoc = new XmlDocument();
  568. xmlDoc.LoadXml(xmlContent);
  569. XmlNode machineNode = xmlDoc.SelectSingleNode("//TotalProductionInfo");
  570. string machineName = machineNode?.Attributes["MachineName"]?.Value ?? "Unknown";
  571. string part = machineNode?.Attributes["ProductionProgramName"]?.Value ?? "Unknown";
  572. XmlNodeList feederNodes = xmlDoc.SelectNodes("//FeederProductionManageInfo");
  573. foreach (XmlNode feederNode in feederNodes)
  574. {
  575. MachineList machineList = new MachineList();
  576. string feederBankPosition = feederNode.Attributes["FeederBankPosition"]?.Value ?? "Unknown";
  577. string holeNo = feederNode.Attributes["HoleNo"]?.Value ?? "Unknown";
  578. string componentName = feederNode.Attributes["ComponentName"]?.Value ?? "Unknown";
  579. machineList.MachineName = machineName;
  580. machineList.Part = part;
  581. machineList.ReelNo = componentName;
  582. machineList.Station = $"{machineName}-{feederBankPosition[0]}-{holeNo}";
  583. result.Add(machineList);
  584. }
  585. }
  586. catch (Exception ex)
  587. {
  588. LogMessage($"Error parsing XML: {ex.Message}");
  589. }
  590. return result;
  591. }
  592. private class Log
  593. {
  594. public string SN { set; get; }
  595. public string Result { set; get; }
  596. /*public List<NgData> Details { set; get; }*/
  597. public string Details { set; get; }
  598. }
  599. public class MachineList
  600. {
  601. public string MachineName { set; get; }
  602. public string Part { set; get; }
  603. public string Station { set; get; }
  604. public string ReelNo { set; get; }
  605. }
  606. private class NgData
  607. {
  608. public string Code { set; get; }
  609. public List<string> Local { set; get; }
  610. }
  611. private class PrinterData
  612. {
  613. public string SN { get; set; }
  614. public string Barcode { get; set; }
  615. public string Direction { get; set; }
  616. public string PrintTime { get; set; }
  617. public Panel Panel { get; set; } = new Panel();
  618. public Process Process { get; set; } = new Process();
  619. }
  620. private class Panel
  621. {
  622. public string PanelID { get; set; }
  623. public string PanelName { get; set; }
  624. public string PanelFirm { get; set; }
  625. public double PanelLength { get; set; }
  626. public double PanelWide { get; set; }
  627. public double PanelThickness { get; set; }
  628. }
  629. private class Process
  630. {
  631. public string ProcessName { get; set; }
  632. public string LineNumber { get; set; }
  633. public string StencilNum { get; set; }
  634. }
  635. private void claerBtn_Click(object sender, EventArgs e)
  636. {
  637. lstFiles.Items.Clear();
  638. }
  639. }
  640. }