瀏覽代碼

日志文件解析

callm 11 月之前
父節點
當前提交
2762e0ff38

+ 1 - 1
FileWatcher/AutoAnalysisDevice.cs

@@ -125,7 +125,7 @@ namespace FileWatcher
 
         private void ConnectDB()
         {
-            DataHelper.DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID="+Master+";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=81.71.42.91)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+            DataHelper.DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID="+Master+";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=113.98.196.181)(PORT=1520)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
             dh = new DataHelper();
         }
 

+ 2 - 2
FileWatcher/AutoAnalysisXml.Designer.cs

@@ -285,11 +285,11 @@
             this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.MaximizeBox = false;
             this.Name = "AutoAnalysisXml";
-            this.Text = "UAS自动过站解析器 2024-06-04";
+            this.Text = "UAS自动过站解析器 2024-12-08";
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
             this.Load += new System.EventHandler(this.Form1_Load);
             ((System.ComponentModel.ISupportInitialize)(this.XmlWatcher)).EndInit();
-            this.ResumeLayout(true);
+            this.ResumeLayout(false);
             this.PerformLayout();
 
         }

+ 5 - 5
FileWatcher/AutoAnalysisXml.cs

@@ -104,7 +104,7 @@ namespace FileWatcher
             {
                 if (Master.Text == DB.Rows[i]["ma_user"].ToString())
                 {
-                    DataHelper.DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=YYCW;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=81.71.42.91)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+                    DataHelper.DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=DGW;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=113.98.196.181)(PORT=1520)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
                     dh = new DataHelper();
                 }
             }
@@ -142,7 +142,7 @@ namespace FileWatcher
             {
                 if (Master.Text == DB.Rows[i]["ma_user"].ToString())
                 {
-                    DataHelper.DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=YYCW;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=81.71.42.91)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+                    DataHelper.DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=DGW;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=113.98.196.181)(PORT=1520)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
                     dh = new DataHelper();
                     LogicHandler.dh = new DataHelper();
                 }
@@ -315,7 +315,7 @@ namespace FileWatcher
                                 istepcode = dt.Rows[0]["sc_stepcode"].ToString();
                                 ibadgroup = dt.Rows[0]["st_badgroupcode"].ToString();
                             }
-                            if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, isource, ms_sncode, iusercode, out makecode, out oMSID, out oErrMessage))
+                            if (LogicHandler.CheckStepSNAndMacode("", isource, ms_sncode, iusercode, out makecode, out oMSID, out oErrMessage))
                             {
                                 ma_code.Text = makecode;
                                 if (LogicHandler.SetStepResult(makecode, isource, ms_sncode, "自动过站采集", "OK", iusercode, out oErrMessage))
@@ -324,7 +324,7 @@ namespace FileWatcher
                                     {
                                         string ftppath = "/" + DateTime.Now.ToString("yyyy-MM-dd") + "/";
                                         ftp.UpLoadFile(folderpath, SN + ".txt", ftppath, "");
-                                        int num = int.Parse(dh.ExecuteSql("insert into STEPTESTDETAIL (std_id,std_sn,std_makecode,std_indate,std_class)select STEPTESTDETAIL_seq.nextval,ms_sncode,ms_makecode,sysdate,'http://81.71.42.91:8099/ftp" + ftppath + SN + ".txt" + "' from makeserial where substr(ms_sncode,0,12)='" + SN + "'", "insert").ToString());
+                                        int num = int.Parse(dh.ExecuteSql("insert into STEPTESTDETAIL (std_id,std_sn,std_makecode,std_indate,std_class)select STEPTESTDETAIL_seq.nextval,ms_sncode,ms_makecode,sysdate,'http://113.98.196.181:8099/ftp" + ftppath + SN + ".txt" + "' from makeserial where substr(ms_sncode,0,12)='" + SN + "'", "insert").ToString());
                                         if (num > 0)
                                         {
                                             OperateResult.AppendText("序列号:" + SN + "上传成功\n");
@@ -381,7 +381,7 @@ namespace FileWatcher
                                     {
                                         string ftppath = "/" + DateTime.Now.ToString("yyyy-MM-dd") + "/";
                                         ftp.UpLoadFile(folderpath, SN + ".txt", ftppath, "");
-                                        int num = int.Parse(dh.ExecuteSql("insert into STEPTESTDETAIL (std_id,std_sn,std_makecode,std_indate,std_class)select STEPTESTDETAIL_seq.nextval,ms_sncode,ms_makecode,sysdate,'http://81.71.42.91:8099/ftp" + ftppath + SN + ".txt" + "' from makeserial where ms_sncode='" + SN + "'", "insert").ToString());
+                                        int num = int.Parse(dh.ExecuteSql("insert into STEPTESTDETAIL (std_id,std_sn,std_makecode,std_indate,std_class)select STEPTESTDETAIL_seq.nextval,ms_sncode,ms_makecode,sysdate,'http://113.98.196.181:8099/ftp" + ftppath + SN + ".txt" + "' from makeserial where ms_sncode='" + SN + "'", "insert").ToString());
                                         if (num > 0)
                                         {
                                             OperateResult.AppendText("序列号:" + SN + "上传成功\n");

+ 1 - 1
FileWatcher/AutoMakeQTYRZ.Designer.cs

@@ -120,7 +120,7 @@
             // 
             // Timer
             // 
-            this.Timer.Interval = 1000;
+            this.Timer.Interval = 2000;
             this.Timer.Tick += new System.EventHandler(this.Timer_Tick);
             // 
             // ATEFile

+ 10 - 4
FileWatcher/AutoMakeQTYRZ.cs

@@ -169,6 +169,7 @@ namespace FileWatcher
 
         double lastqty = 0;
         string data = "";
+        bool realwritedata = false;
         private void SerialPort1_DataReceived(object sender, SerialDataReceivedEventArgs e)
         {
             try
@@ -196,13 +197,18 @@ namespace FileWatcher
                     {
                         if (电流数据 != 0)
                         {
-                            OperateResult.AppendText("数据上传成功\n");
-                            dh.ExecuteSql("insert into currenttest(CT_ID, CT_MAKECODE, CT_VOLTAGE, CT_CURRENT, CT_POWER, CT_FREQUENCY, CT_POWER1)" +
-                             "VALUES(currenttest_SEQ.NEXTVAL,'" + ma_code.Text + "','" + 电压数据 + "','" + 电流数据 + "','" + 功率数据 + "','" + 频率数据 + "','" + 功率因素 + "')", "insert");
+                            realwritedata=true;
                             writedata = false;
-                            NowQTY.Text = dh.getRowCount("currenttest","ct_makecode='"+ma_code.Text+"'").ToString();
                         }
                     }
+                    if (realwritedata)
+                    {
+                        OperateResult.AppendText("数据上传成功\n");
+                        dh.ExecuteSql("insert into currenttest(CT_ID, CT_MAKECODE, CT_VOLTAGE, CT_CURRENT, CT_POWER, CT_FREQUENCY, CT_POWER1)" +
+                         "VALUES(currenttest_SEQ.NEXTVAL,'" + ma_code.Text + "','" + 电压数据 + "','" + 电流数据 + "','" + 功率数据 + "','" + 频率数据 + "','" + 功率因素 + "')", "insert");
+                        NowQTY.Text = dh.getRowCount("currenttest", "ct_makecode='" + ma_code.Text + "'").ToString();
+                        realwritedata = false;
+                    }
                 }
             }
             catch (Exception ex)

+ 2 - 2
FileWatcher/FileWatcher.csproj

@@ -90,9 +90,9 @@
     <Reference Include="System.Drawing" />
     <Reference Include="System.Windows.Forms" />
     <Reference Include="System.Xml" />
-    <Reference Include="UMESDLLService, Version=1.0.0.3, Culture=neutral, processorArchitecture=MSIL">
+    <Reference Include="UMESDLLService, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86">
       <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\UAS_MesInterface(LGDZ)\bin\Debug\UMESDLLService.dll</HintPath>
+      <HintPath>bin\Debug\UMESDLLService.dll</HintPath>
     </Reference>
   </ItemGroup>
   <ItemGroup>

+ 3 - 2
FileWatcher/Form5.cs

@@ -3,6 +3,7 @@ using System.Windows.Forms;
 using Aspose.Cells.Rendering;
 using Aspose.Cells;
 using System.Drawing.Imaging;
+using UMESDLLService;
 
 namespace FileWatcher
 {
@@ -53,10 +54,10 @@ namespace FileWatcher
 
         private void Form4_Load(object sender, EventArgs e)
         {
-            UMESDLLService.MESHelper mes=new UMESDLLService.MESHelper();
+            MESHelper mes=new MESHelper();
             string str = "";
             string str1 = "";
-            mes.GetMobileAllInfo("BPX0810001PA", out str, out str1);
+            mes.GetMobileAllInfo("58875734C2000134", out str, out str1);
             Console.WriteLine(  str);
         }
 

+ 2 - 2
FileWatcher/ftpOperater.cs

@@ -21,9 +21,9 @@ namespace FileWatcher
 
         public ftpOperater()
         {
-            string[] FTPInf = "ftp://81.71.42.91|vsftpd|uas321vsftpd2021".Split('|');
+            string[] FTPInf = "ftp://113.98.196.181:8097|vsftpd|Az789***".Split('|');
             //睿德FTP
-            //string[] FTPInf = "ftp://81.71.42.91|ftpuser2|Az789***".Split('|');
+            //string[] FTPInf = "ftp://113.98.196.181|ftpuser2|Az789***".Split('|');
             this.ftpServerIP = FTPInf[0];
             this.ftpUser = FTPInf[1];
             this.ftpPwd = FTPInf[2];

二進制
FileWatcher/tool/UMESDLLService.dll


+ 1 - 1
FileWatcher/测试记录解析DCW.cs

@@ -87,7 +87,7 @@ namespace FileWatcher
                             {
                                 string ftppath = "/" + DateTime.Now.ToString("yyyy-MM-dd") + "/";
                                 ftp.UpLoadFile(folderpath, f.Name, ftppath, "");
-                                int dt = int.Parse(dh.ExecuteSql("insert into STEPTESTDETAIL (std_id,std_sn,std_makecode,std_indate,std_class)values( STEPTESTDETAIL_seq.nextval,'" + SN + "','" + ma_code.Text + "',sysdate,'http://81.71.42.91:8099/ftp" + ftppath + f.Name + "')", "insert").ToString());
+                                int dt = int.Parse(dh.ExecuteSql("insert into STEPTESTDETAIL (std_id,std_sn,std_makecode,std_indate,std_class)values( STEPTESTDETAIL_seq.nextval,'" + SN + "','" + ma_code.Text + "',sysdate,'http://113.98.196.181:8099/ftp" + ftppath + f.Name + "')", "insert").ToString());
                                 if (dt > 0)
                                 {
                                     OperateResult.AppendText("序列号:" + SN + "上传成功\n");

+ 2 - 2
FileWatcher/首件仪上传.cs

@@ -87,7 +87,7 @@ namespace FileWatcher
                             {
                                 string ftppath = "/" + DateTime.Now.ToString("yyyy-MM-dd") + "/";
                                 ftp.UpLoadFile(folderpath, f.Name, ftppath, "");
-                                int dt = int.Parse(dh.ExecuteSql("insert into STEPTESTDETAIL (std_id,std_sn,std_makecode,std_indate,std_class)values( STEPTESTDETAIL_seq.nextval,'" + SN + "','" + ma_code.Text + "',sysdate,'http://81.71.42.91:8099/ftp" + ftppath + f.Name + "')", "insert").ToString());
+                                int dt = int.Parse(dh.ExecuteSql("insert into STEPTESTDETAIL (std_id,std_sn,std_makecode,std_indate,std_class)values( STEPTESTDETAIL_seq.nextval,'" + SN + "','" + ma_code.Text + "',sysdate,'http://113.98.196.181:8099/ftp" + ftppath + f.Name + "')", "insert").ToString());
                                 if (dt > 0)
                                 {
                                     OperateResult.AppendText("序列号:" + SN + "上传成功\n");
@@ -209,7 +209,7 @@ namespace FileWatcher
                 if (!dh.CheckExist("SMTCHECKFIRST", "scf_filepath='" + text + "'"))
                 {
                     dh.ExecuteSql("insert into SMTCHECKFIRST(scf_id,scf_indate,scf_filepath,scd_makecode)values(" +
-                    "SMTCHECKFIRST_seq.nextval,sysdate,'http://81.71.42.91:8099/ftp/" + DateTime.Now.ToString("yyyy-MM-dd") + "/" + text + "','" + ma_code.Text + "')", "insert");
+                    "SMTCHECKFIRST_seq.nextval,sysdate,'http://113.98.196.181:8099/ftp/" + DateTime.Now.ToString("yyyy-MM-dd") + "/" + text + "','" + ma_code.Text + "')", "insert");
                     string uploadFolder = "/CheckFirst/" + DateTime.Now.ToString("yyyy-MM-dd") + "/";
                     ftp.UpLoadFile(text2, text, uploadFolder, "");
                     OperateResult.AppendText("文件【" + text + "】上传成功\n");