Forráskód Böngészése

调整比对配置文件。

Klosszhu 2 éve
szülő
commit
f1ce1ac661

+ 88 - 0
Fine.OPCDaExcelImport/DataMode/NewIoModal.cs

@@ -0,0 +1,88 @@
+using Fine.OPCDaClient.Util;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Fine.OPCDaClient9000
+{
+    /// <summary>
+    /// 对PLC的写入点\校验点\间隔时间(来自配置)
+    /// </summary>
+    public class NewIoModal
+    {
+        /// <summary>
+        /// API调用名
+        /// </summary>
+        public string APIName { get; set; }   //API接口名
+        public bool IsCheck { get; set; } = true;  //是否进行标签读写校验,默认为:校验
+        public int DelayTime { get; set; }   //读写间隔延时
+        public List<Params> @Params { get; set; } = new List<Params>();
+        public string Method { get; set; } = "";
+        public EAPIparType PType { get; set; }
+    }
+
+    public class Params
+    {
+        public string Param { get; set; }
+        public List<WriteAndCheckKey> keys { get; set; } = new List<WriteAndCheckKey>();
+    }
+
+    public class WriteAndCheckKey
+    {
+        public string InputName { get; set; }
+        public string WriteTagName { get; set; }
+        public string CheckTagName { get; set; }
+        public string StrValue { get; set; }
+        public string CheckValue { get; set; }
+        public int DelayTime { get; set; }
+    }
+
+
+    /// <summary>
+    /// 工单信息
+    /// </summary>
+    public class GDinfo
+    {
+        /// <summary>
+        /// 当前设备/工序名称
+        /// </summary>
+        public string CurDev { get; set; }
+
+        /// <summary>
+        /// 工单号
+        /// </summary>
+        public string GDNum { get; set; }
+
+        /// <summary>
+        /// 批次号
+        /// </summary>
+        public string BatchNum { get; set; }
+
+        /// <summary>
+        /// 牌号
+        /// </summary>
+        public string BrandNum { get; set; }
+
+    }
+
+    public class TankInfo   //料筒信息---下发
+    {
+        /// <summary>
+        /// 批次号
+        /// </summary>
+        public string TankPCH { get; set; }
+
+        /// <summary>
+        /// 物料代码
+        /// </summary>
+        public string MaterielCode { get; set; }
+
+        /// <summary>
+        /// 物料重量
+        /// </summary>
+        public float MaterielWeight { get; set; }
+    }
+
+}

+ 1 - 0
Fine.OPCDaExcelImport/Fine.OPCDaExcelImport.csproj

@@ -66,6 +66,7 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="DataMode\IoModal.cs" />
+    <Compile Include="DataMode\NewIoModal.cs" />
     <Compile Include="Form1.cs">
       <SubType>Form</SubType>
     </Compile>

+ 19 - 6
Fine.OPCDaExcelImport/Form1.Designer.cs

@@ -38,6 +38,7 @@ namespace Fine.OPCDaExcelImport
             this.button2 = new System.Windows.Forms.Button();
             this.button3 = new System.Windows.Forms.Button();
             this.richTextBox1 = new System.Windows.Forms.RichTextBox();
+            this.button4 = new System.Windows.Forms.Button();
             this.SuspendLayout();
             // 
             // SelectBtn
@@ -88,7 +89,7 @@ namespace Fine.OPCDaExcelImport
             // 
             this.button1.Location = new System.Drawing.Point(99, 258);
             this.button1.Name = "button1";
-            this.button1.Size = new System.Drawing.Size(227, 63);
+            this.button1.Size = new System.Drawing.Size(89, 63);
             this.button1.TabIndex = 5;
             this.button1.Text = "生成测试文档";
             this.button1.UseVisualStyleBackColor = true;
@@ -96,19 +97,19 @@ namespace Fine.OPCDaExcelImport
             // 
             // button2
             // 
-            this.button2.Location = new System.Drawing.Point(332, 258);
+            this.button2.Location = new System.Drawing.Point(194, 258);
             this.button2.Name = "button2";
-            this.button2.Size = new System.Drawing.Size(215, 63);
+            this.button2.Size = new System.Drawing.Size(94, 63);
             this.button2.TabIndex = 6;
-            this.button2.Text = "测试";
+            this.button2.Text = "GET异常接口";
             this.button2.UseVisualStyleBackColor = true;
             this.button2.Click += new System.EventHandler(this.button2_Click);
             // 
             // button3
             // 
-            this.button3.Location = new System.Drawing.Point(554, 258);
+            this.button3.Location = new System.Drawing.Point(665, 258);
             this.button3.Name = "button3";
-            this.button3.Size = new System.Drawing.Size(182, 63);
+            this.button3.Size = new System.Drawing.Size(71, 63);
             this.button3.TabIndex = 7;
             this.button3.Text = "检查配置";
             this.button3.UseVisualStyleBackColor = true;
@@ -122,11 +123,22 @@ namespace Fine.OPCDaExcelImport
             this.richTextBox1.TabIndex = 8;
             this.richTextBox1.Text = "";
             // 
+            // button4
+            // 
+            this.button4.Location = new System.Drawing.Point(294, 258);
+            this.button4.Name = "button4";
+            this.button4.Size = new System.Drawing.Size(94, 63);
+            this.button4.TabIndex = 9;
+            this.button4.Text = "GET生成新配置";
+            this.button4.UseVisualStyleBackColor = true;
+            this.button4.Click += new System.EventHandler(this.button4_Click);
+            // 
             // Form1
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(835, 652);
+            this.Controls.Add(this.button4);
             this.Controls.Add(this.richTextBox1);
             this.Controls.Add(this.button3);
             this.Controls.Add(this.button2);
@@ -154,6 +166,7 @@ namespace Fine.OPCDaExcelImport
         private System.Windows.Forms.Button button2;
         private System.Windows.Forms.Button button3;
         private System.Windows.Forms.RichTextBox richTextBox1;
+        private System.Windows.Forms.Button button4;
     }
 }
 

+ 19 - 2
Fine.OPCDaExcelImport/Form1.cs

@@ -415,7 +415,7 @@ namespace Fine.OPCDaExcelImport
             }
                // "L3KYPJL2_ZHPump_Stop"
             var reslut = jsondata.Except(Are);
-            MessageBox.Show(reslut.Count().ToString());
+            MessageBox.Show($"共计Get接口{jsondata.Count()},其中{reslut.Count()}个接口未配置" );
         }
 
         private string JsonPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "NewJson");
@@ -432,6 +432,23 @@ namespace Fine.OPCDaExcelImport
             }
         }
 
-
+        private void button4_Click(object sender, EventArgs e)
+        {
+            Init.InitAll();
+            var jsondata = JsonData.GETAPI().ToList();
+            var apidata = Init.ioConfig;
+            List<IoModal> Dealmoda = new List<IoModal>();
+            foreach (var item in apidata)
+            {
+                foreach (var cfg in item.Value)
+                {
+                    if (jsondata.Exists(a=>a==cfg.APIName))
+                    {
+                        Dealmoda.Add(cfg);
+                    }
+                }
+            }
+            MessageBox.Show(Dealmoda.Count.ToString());
+        }
     }
 }

+ 2 - 1
Fine.OPCDaExcelImport/Init.cs

@@ -1,5 +1,6 @@
-using Fine.OPCDaClient;
+
 using Fine.OPCDaClient.Util;
+using Fine.OPCDaExcelImport;
 using Fine.Util;
 using System;
 using System.Collections.Generic;

+ 19 - 1
Fine.OPCDaExcelImport/bin/Debug/config/L3K_YP/L3KJL_2.json

@@ -513,6 +513,24 @@
       }
     ]
   },
+  {
+    "APIName": "L3KYPJL2_ZHPump_Stop",
+    "VerityCheck": true,
+    "DelayTime": 3000,
+    "Params": [
+      {
+        "Param": "",
+        "keys": [
+          {
+            "WriteTagName": "THISNODE.JK_ZKASKA1_Stop_FK.F_CV",
+            "CheckTagName": "THISNODE.JK_ZKASKA1_Stop_FK_OK.F_CV",
+            "StrValue": "1",
+            "DelayTime": 0
+          }
+        ]
+      }
+    ]
+  },
   {
     "APIName": "L3KYPJL2_ZHStopRec_Pipe_InTank",
     "VerityCheck": true,
@@ -693,7 +711,7 @@
       }
     ]
   },
-   {
+  {
     "APIName": "L3KYPJL2_ZHSTOP_TASK_END",
     "VerityCheck": true,
     "DelayTime": 2000,

+ 19 - 1
Fine.OPCDaExcelImport/config/L3K_YP/L3KJL_2.json

@@ -513,6 +513,24 @@
       }
     ]
   },
+  {
+    "APIName": "L3KYPJL2_ZHPump_Stop",
+    "VerityCheck": true,
+    "DelayTime": 3000,
+    "Params": [
+      {
+        "Param": "",
+        "keys": [
+          {
+            "WriteTagName": "THISNODE.JK_ZKASKA1_Stop_FK.F_CV",
+            "CheckTagName": "THISNODE.JK_ZKASKA1_Stop_FK_OK.F_CV",
+            "StrValue": "1",
+            "DelayTime": 0
+          }
+        ]
+      }
+    ]
+  },
   {
     "APIName": "L3KYPJL2_ZHStopRec_Pipe_InTank",
     "VerityCheck": true,
@@ -693,7 +711,7 @@
       }
     ]
   },
-   {
+  {
     "APIName": "L3KYPJL2_ZHSTOP_TASK_END",
     "VerityCheck": true,
     "DelayTime": 2000,