public void SetCNCReportNum()//报工成功,报工数加1 { if (nowTaskNode == null) { } else { int repersum = 0, repersum1 = 0; int.TryParse(nowTaskNode[(int)NodeName.报工数量].ToString(), out repersum); repersum++; nowTaskNode[(int)NodeName.报工数量] = repersum.ToString(); if (int.TryParse(nowTaskNode[(int)NodeName.生产数量].ToString(), out repersum1)) { if (repersum >= repersum1 && nowTaskNode[(int)NodeName.操作标示].ToString() != "4")//非尾单自动切单 { AutoSendTask(); } } else { if (nowTaskNode[(int)NodeName.操作标示].ToString() != "4") { AutoSendTask(); } } AutoSaveData2Xml_Flag = true; SaveData2Xml_threaFucEvent.Set(); } }
public void AddMCTask(MES_DISPATCH node) { switch (node.FLAG) { case 1: //新增 case 4: //尾单 if (nowTaskNode == null && TaskDb.Rows.Count > 0 && TaskDb.Rows[TaskDb.Rows.Count - 1][(int)NodeName.工单状态].ToString() == "4") { NCTaskInser2DB(node, "3"); } else { NCTaskInser2DB(node, "0"); } AutoSaveData2Xml_Flag = true; SaveData2Xml_threaFucEvent.Set(); break; case 2: //修改 case 3: //删除 ModifNCtask(node); NCTaskInser2DB(node, "-1"); AutoSaveData2Xml_Flag = true; SaveData2Xml_threaFucEvent.Set(); break; default: break; } }
public void SendCNCTaskOKOrNot(bool Flag)//首次手动派工是否成功 { if (nowTaskNode != null) { if (Flag) //成功 { nowTaskNode[(int)NodeName.工单状态] = "3"; //状态转为正在加工 } else { nowTaskNode[(int)NodeName.工单状态] = "1";//状态转为派送失败 } AutoSaveData2Xml_Flag = true; SaveData2Xml_threaFucEvent.Set(); } }
public void ClearNCTask()//任务清洗线 { int maxfilenum = 50; String[] Pathstr = NCTaskXMLFileName.Split('\\'); Pathstr[0] = NCTaskXMLFileName.Replace(Pathstr[Pathstr.Length - 1], ""); String str, str1; int ii = 1; for (; ii <= maxfilenum; ii++) { str = Pathstr[0] + ii.ToString() + "_n" + Pathstr[Pathstr.Length - 1]; if (System.IO.File.Exists(str)) { if (ii == maxfilenum) { str1 = Pathstr[0] + "1_n" + Pathstr[Pathstr.Length - 1]; System.IO.File.Delete(str1); SCADA.RFIDDATAT.DBWriteToXml(TaskDb, str1); } else { str1 = Pathstr[0] + (ii + 1).ToString() + "_n" + Pathstr[Pathstr.Length - 1]; System.IO.File.Delete(str1); SCADA.RFIDDATAT.DBWriteToXml(TaskDb, str1); } str1 = Pathstr[0] + ii.ToString() + "_" + ii.ToString() + Pathstr[Pathstr.Length - 1]; System.IO.File.Delete(str1); System.IO.File.Move(str, str1); break; } } if (ii == (maxfilenum + 1))//找不到 { str = Pathstr[0] + "1_n" + Pathstr[Pathstr.Length - 1]; SCADA.RFIDDATAT.DBWriteToXml(TaskDb, str); } // TaskDb = new System.Data.DataTable(); MakeDefaulDB(ref TaskDb); AutoSaveData2Xml_Flag = true; SaveData2Xml_threaFucEvent.Set(); }
public void SetTaskDbName(String name) { TaskDb.TableName = name; AutoSaveData2Xml_Flag = true; SaveData2Xml_threaFucEvent.Set(); }