yhluo пре 4 дана
родитељ
комит
2b4b40959a

+ 116 - 0
UAS_MES_HYSX/FunctionCode/Make/Make_ListenSocket.Designer.cs

@@ -0,0 +1,116 @@
+namespace UAS_MES_NEW.Make
+{
+    partial class Make_ListenSocket
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.OperatResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
+            this.Start = new System.Windows.Forms.Button();
+            this.statusLab = new System.Windows.Forms.Label();
+            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+            this.tableLayoutPanel1.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // OperatResult
+            // 
+            this.OperatResult.Dock = System.Windows.Forms.DockStyle.Top;
+            this.OperatResult.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.OperatResult.Location = new System.Drawing.Point(0, 0);
+            this.OperatResult.Margin = new System.Windows.Forms.Padding(4);
+            this.OperatResult.Name = "OperatResult";
+            this.OperatResult.Size = new System.Drawing.Size(1600, 735);
+            this.OperatResult.TabIndex = 91;
+            this.OperatResult.Text = "";
+            // 
+            // Start
+            // 
+            this.Start.Anchor = System.Windows.Forms.AnchorStyles.None;
+            this.Start.Cursor = System.Windows.Forms.Cursors.Hand;
+            this.Start.Location = new System.Drawing.Point(671, 75);
+            this.Start.Name = "Start";
+            this.Start.Size = new System.Drawing.Size(258, 57);
+            this.Start.TabIndex = 92;
+            this.Start.Text = "开启监听";
+            this.Start.UseVisualStyleBackColor = true;
+            this.Start.Click += new System.EventHandler(this.Start_Click);
+            // 
+            // statusLab
+            // 
+            this.statusLab.Anchor = System.Windows.Forms.AnchorStyles.None;
+            this.statusLab.AutoSize = true;
+            this.statusLab.BackColor = System.Drawing.Color.LawnGreen;
+            this.statusLab.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.statusLab.ForeColor = System.Drawing.SystemColors.WindowText;
+            this.statusLab.Location = new System.Drawing.Point(736, 3);
+            this.statusLab.Name = "statusLab";
+            this.statusLab.Size = new System.Drawing.Size(127, 36);
+            this.statusLab.TabIndex = 93;
+            this.statusLab.Text = "运行正常";
+            this.statusLab.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // tableLayoutPanel1
+            // 
+            this.tableLayoutPanel1.ColumnCount = 1;
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+            this.tableLayoutPanel1.Controls.Add(this.Start, 0, 1);
+            this.tableLayoutPanel1.Controls.Add(this.statusLab, 0, 0);
+            this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 735);
+            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+            this.tableLayoutPanel1.RowCount = 2;
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25.45455F));
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 74.54546F));
+            this.tableLayoutPanel1.Size = new System.Drawing.Size(1600, 165);
+            this.tableLayoutPanel1.TabIndex = 94;
+            // 
+            // Make_ListenSocket
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1600, 900);
+            this.Controls.Add(this.tableLayoutPanel1);
+            this.Controls.Add(this.OperatResult);
+            this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(4);
+            this.Name = "Make_ListenSocket";
+            this.Text = "Make_ListenSocket";
+            this.tableLayoutPanel1.ResumeLayout(false);
+            this.tableLayoutPanel1.PerformLayout();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private CustomControl.RichText.RichTextAutoBottom OperatResult;
+        private System.Windows.Forms.Button Start;
+        private System.Windows.Forms.Label statusLab;
+        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
+    }
+}

+ 42 - 0
UAS_MES_HYSX/FunctionCode/Make/Make_ListenSocket.cs

@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace UAS_MES_NEW.Make
+{
+    public partial class Make_ListenSocket : Form
+    {
+        public Make_ListenSocket()
+        {
+            InitializeComponent();
+        }
+
+        private void ShowMsg(int type, string msg)
+        {
+            msg = msg.Replace("\r", "").Replace("\n", "");
+            string msgTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+            string showMsg = $"{msgTime}: {msg}\n";
+            if (type == 0)
+            {
+                OperatResult.AppendText(showMsg, Color.Red);
+                statusLab.Text = "状况异常";
+            }
+            else if (type == 1)
+            {
+                OperatResult.AppendText(showMsg, Color.Green);
+                statusLab.Text = "运行正常";
+            }
+        }
+
+        private void Start_Click(object sender, EventArgs e)
+        {
+
+        }
+    }
+}

+ 120 - 0
UAS_MES_HYSX/FunctionCode/Make/Make_ListenSocket.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 13 - 9
UAS_MES_HYSX/FunctionCode/Make/Make_ParseLog.cs

@@ -313,13 +313,12 @@ namespace UAS_MES_NEW.Make
                             LogMessage(0, $"文件不存在: {file}");
                         }
 
-                        outFileMsg = CheckFileAccess(file);
-
-                        if (outFileMsg != "OK")
-                        {
-                            //LogMessage(0, outFileMsg);
-                            continue;
-                        }
+                        //outFileMsg = CheckFileAccess(file);
+                        //if (outFileMsg != "OK")
+                        //{
+                        //    //LogMessage(0, outFileMsg);
+                        //    continue;
+                        //}
 
                         if (File.ReadAllText(file).Length == 0)
                         {
@@ -329,7 +328,8 @@ namespace UAS_MES_NEW.Make
 
                     if (equiType == "AOI")
                     {
-                        using (StreamReader SR = new StreamReader(file, Encoding.GetEncoding("GBK")))
+                        using (FileStream fileStream = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
+                        using (StreamReader SR = new StreamReader(fileStream, Encoding.GetEncoding("GBK")))
                         {
                             string Content = SR.ReadToEnd();
                             SR.Close();
@@ -370,7 +370,11 @@ namespace UAS_MES_NEW.Make
                                 if (ConsoleLog(Content, file, logArr[0].SN))
                                 {
                                     File.WriteAllText(file, string.Empty);
-                                    File.Delete(file);
+                                    outFileMsg = CheckFileAccess(file);
+                                    if (outFileMsg == "OK")
+                                    {
+                                        File.Delete(file);
+                                    }
                                 }
                             }
                         }

+ 2 - 1
UAS_MES_HYSX/FunctionCode/Make/Make_WirelessThroughput.cs

@@ -87,7 +87,8 @@ namespace UAS_MES_NEW.Make
 
 
             SQL.Clear();
-            SQL.Append($"SELECT pr_test_account,pr_test_password FROM makeserial,product WHERE ms_sncode = '{sn}' AND ms_prodcode = pr_code");
+            //SQL.Append($"SELECT pr_test_account,pr_test_password FROM makeserial,product WHERE ms_sncode = '{sn}' AND ms_prodcode = pr_code");
+            SQL.Append($"SELECT * FROM (SELECT pr_test_account,pr_test_password FROM makeserial,product WHERE ms_sncode = '{sn}' AND ms_prodcode = pr_code ORDER BY ms_indate DESC) WHERE ROWNUM = 1");
             dt = (DataTable)dh.ExecuteSql(SQL.ToString(), "select");
             if (dt.Rows.Count == 0)
             {

+ 9 - 0
UAS_MES_HYSX/UAS_MES_HYSX.csproj

@@ -641,6 +641,12 @@
     <Compile Include="FunctionCode\Make\Make_ImeiCheck_ThreeLabel.Designer.cs">
       <DependentUpon>Make_ImeiCheck_ThreeLabel.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Make\Make_ListenSocket.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Make\Make_ListenSocket.Designer.cs">
+      <DependentUpon>Make_ListenSocket.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Make\Make_OutBoxSnCheck.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1690,6 +1696,9 @@
     <EmbeddedResource Include="FunctionCode\Make\Make_ImeiCheck_ThreeLabel.resx">
       <DependentUpon>Make_ImeiCheck_ThreeLabel.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Make\Make_ListenSocket.resx">
+      <DependentUpon>Make_ListenSocket.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_OutBoxSnCheck.resx">
       <DependentUpon>Make_OutBoxSnCheck.cs</DependentUpon>
       <SubType>Designer</SubType>