Эх сурвалжийг харах

add贴片机种类,调整界面

yhluo 5 сар өмнө
parent
commit
ba742669c5

+ 3 - 2
UAS_MES_BG/FunctionCode/Make/Make_ParseLog.Designer.cs

@@ -65,8 +65,9 @@
             "劲拓SPI设备",
             "思泰克SPI设备",
             "AOI设备",
-            "印刷机",
-            "贴片机"});
+            "GKG印刷机",
+            "贴片机",
+            "JUKI贴片机"});
             this.Device.Location = new System.Drawing.Point(193, 88);
             this.Device.Name = "Device";
             this.Device.Size = new System.Drawing.Size(328, 32);

+ 30 - 13
UAS_MES_BG/FunctionCode/Make/Make_ParseLog.cs

@@ -56,7 +56,8 @@ namespace UAS_MES_NEW.Make
             fileList.Add("D:\\EYSPI\\DataExport\\Res"); // 思泰克SPI
             fileList.Add("E:\\MES_TEXT_PATH");  // AOI 
             fileList.Add("C:\\GKGPrintTemp");   // GKG印刷机
-            fileList.Add("");
+            fileList.Add("");   // 贴片机
+            fileList.Add("D:\\JANETSSC\\SMT\\MachineMonitoring");   // JUKI贴片机
 
 
             //设置锁定工单
@@ -89,7 +90,7 @@ namespace UAS_MES_NEW.Make
 
         private void Device_SelectedIndexChanged(object sender, EventArgs e)
         {
-            if (Device.SelectedIndex == 4 || Device.SelectedIndex == 2)
+            if (Device.SelectedIndex == 4 || Device.SelectedIndex == 2 || Device.SelectedIndex == 5)
             {
                 ma_code.Enabled = false;
                 txtPath.Focus();
@@ -140,6 +141,11 @@ namespace UAS_MES_NEW.Make
                     currFileType = "xml";
                     equiType = "贴片机";
                     break;
+                case 5:
+                    dialog.Description = "请选择读取JUKI贴片机的文本文件夹";
+                    currFileType = "xml";
+                    equiType = "贴片机";
+                    break;
             }
             if (dialog.ShowDialog() == DialogResult.OK)
             {
@@ -155,10 +161,13 @@ namespace UAS_MES_NEW.Make
         }
         private void allParse_Click(object sender, EventArgs e)
         {
-            if (string.IsNullOrEmpty(ma_code.Text))
+            if (Device.SelectedIndex == 0 || Device.SelectedIndex == 1 || Device.SelectedIndex == 3)
             {
-                MessageBox.Show(this.ParentForm, "请选择工单", "提示");
-                return;
+                if (string.IsNullOrEmpty(ma_code.Text))
+                {
+                    MessageBox.Show(this.ParentForm, "请选择工单", "提示");
+                    return;
+                }
             }
             if (Device.SelectedIndex == -1)
             {
@@ -184,10 +193,13 @@ namespace UAS_MES_NEW.Make
 
         private void onWatch_Click(object sender, EventArgs e)
         {
-            if (string.IsNullOrEmpty(ma_code.Text))
+            if (Device.SelectedIndex == 0 || Device.SelectedIndex == 1 || Device.SelectedIndex == 3)
             {
-                MessageBox.Show(this.ParentForm, "请选择工单", "提示");
-                return;
+                if (string.IsNullOrEmpty(ma_code.Text))
+                {
+                    MessageBox.Show(this.ParentForm, "请选择工单", "提示");
+                    return;
+                }
             }
             if (Device.SelectedIndex == -1)
             {
@@ -285,6 +297,7 @@ namespace UAS_MES_NEW.Make
                         }
                         else if (Device.SelectedIndex == 1) // 思泰克SPI
                         {
+                            return; // 20250630 M 暂不对接 
                             List<SpiData> csvData;
                             //csvData = ParseCsvFile(file);
                             csvData = ParseCsvFile<SpiData>(file, MapToSpiData);
@@ -450,7 +463,7 @@ namespace UAS_MES_NEW.Make
                                             std_value15,std_value16,
                                             STD_TESTRESULT,std_value18,std_value19,std_value20,std_value21,
                                             std_rescode)
-                                            (select steptestdetail_seq.nextval,:BarCode,'{ma_code.Text}',to_date(:TimeStamp,'yyyy-mm-dd hh24:mi:ss'),:FileName,:ProgramRunning,
+                                            (select steptestdetail_seq.nextval,:BarCode,'{ma_code.Text}',to_date(:TimeStamp,'yyyy-mm-dd hh24:mi:ss'),'印刷机',:ProgramRunning,
                                             :CycleTime,:DSPIResult2,:PrintSpeed,:FrontSQGPress,:RearSQGPress,:PrintMode,
                                             :SnapOffDistance,:SnapOffSpeed,:SnapOffDelay,:SQGUpSpeed,:SQGDownSpeed,
                                             :SQGUpFirst,:SQGHeightAtSnapOff,:CleaningAfterLastBoard,:CleaningFrequency,:CleaningSpeed,
@@ -459,13 +472,13 @@ namespace UAS_MES_NEW.Make
                                             '{User.UserSourceCode}' from dual)");
 
                             dh.BatchInsert(sql.GetString(),
-                                new string[] { "BarCode", "TimeStamp", "FileName","ProgramRunning",
+                                new string[] { "BarCode", "TimeStamp","ProgramRunning",
                                     "CycleTime","DSPIResult_2","PrintSpeed","FrontSQGPress","RearSQGPress","PrintMode",
                                     "SnapOffDistance","SnapOffSpeed","SnapOffDelay","SQGUpSpeed","SQGDownSpeed",
                                     "SQGUpFirst","SQGHeightAtSnapOff","CleaningAfterLastBoard","CleaningFrequency","CleaningSpeed",
                                     "CleaningType","AddSPMode",
                                     "PrintDirection","PCBSize","TableUpX","TableUpY1","TableUpY2"},
-                                BarCode.ToArray(), TimeStamp.ToArray(), FileName.ToArray(), ProgramRunning.ToArray(),
+                                BarCode.ToArray(), TimeStamp.ToArray(), ProgramRunning.ToArray(),
                                 CycleTime.ToArray(), DSPIResult_2.ToArray(), PrintSpeed.ToArray(), FrontSQGPress.ToArray(), RearSQGPress.ToArray(), PrintMode.ToArray(),
                                 SnapOffDistance.ToArray(), SnapOffSpeed.ToArray(), SnapOffDelay.ToArray(), SQGUpSpeed.ToArray(), SQGDownSpeed.ToArray(),
                                 SQGUpFirst.ToArray(), SQGHeightAtSnapOff.ToArray(), CleaningAfterLastBoard.ToArray(), CleaningFrequency.ToArray(), CleaningSpeed.ToArray(),
@@ -479,8 +492,12 @@ namespace UAS_MES_NEW.Make
                                 File.Delete(file);
                             }
                         }
-                        else if (Device.SelectedIndex == 4) // 贴片机
+                        else if (Device.SelectedIndex == 4 || Device.SelectedIndex == 5) // 贴片机
                         {
+                            if (Device.SelectedIndex == 5 && !file.Contains("TotalProduction"))
+                            {
+                                continue;
+                            }
                             if (!File.Exists(file))
                             {
                                 LogMessage($"文件不存在: {file}");
@@ -532,7 +549,7 @@ namespace UAS_MES_NEW.Make
                             }
                             sql.Clear();
                             sql.Append("insert into productsmtlocation(PSL_ID, PSL_PSID, PSL_DETNO, PSL_PRODCODE, PSL_REPCODE, PSL_LOCATION, PSL_BASEQTY, PSL_TABLE)" +
-                                "select productsmtlocation_seq.nextval," + ps_id + ",:letArr, :ReelNo,:ReelNo,:Station,BD_BASEQTY,'' from bom@ERP " +
+                                "select productsmtlocation_seq.nextval," + ps_id + ",:letArr, :ReelNo,:ReelNo,:Station,BD_BASEQTY,'A' from bom@ERP " +
                                 "left join bomdetail@ERP on bo_id=bd_bomid where bo_mothercode='" + Part_ + "' and BD_SONCODE=:ReelNo");
                             dh.BatchInsert(sql.GetString(), new string[] { "letArr", "ReelNo", "ReelNo", "Station", "ReelNo" },
                                 letNo.ToArray(), ReelNo.ToArray(), ReelNo.ToArray(), Station.ToArray(), ReelNo.ToArray());