Browse Source

添加选焊设备数据采集

callm 3 years ago
parent
commit
00fe9b92c1

+ 38 - 7
UAS_AutoPass/AutoAnalysisXml.Designer.cs

@@ -28,6 +28,7 @@
         /// </summary>
         private void InitializeComponent()
         {
+            this.components = new System.ComponentModel.Container();
             this.XmlWatcher = new System.IO.FileSystemWatcher();
             this.XmlFolder = new System.Windows.Forms.FolderBrowserDialog();
             this.StartWatch = new System.Windows.Forms.Button();
@@ -46,7 +47,9 @@
             this.AutoStart = new System.Windows.Forms.CheckBox();
             this.ma_code = new System.Windows.Forms.TextBox();
             this.BatchAnalysus = new System.Windows.Forms.Button();
-            this.Timer = new System.Windows.Forms.Timer();
+            this.Timer = new System.Windows.Forms.Timer(this.components);
+            this.Device = new System.Windows.Forms.ComboBox();
+            this.label3 = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.XmlWatcher)).BeginInit();
             this.SuspendLayout();
             // 
@@ -85,7 +88,7 @@
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(54, 278);
+            this.label1.Location = new System.Drawing.Point(54, 316);
             this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(162, 38);
@@ -95,7 +98,7 @@
             // FolderPath
             // 
             this.FolderPath.Enabled = false;
-            this.FolderPath.Location = new System.Drawing.Point(224, 278);
+            this.FolderPath.Location = new System.Drawing.Point(224, 316);
             this.FolderPath.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.FolderPath.Name = "FolderPath";
             this.FolderPath.Size = new System.Drawing.Size(436, 35);
@@ -104,7 +107,7 @@
             // ChooseFolder
             // 
             this.ChooseFolder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ChooseFolder.Location = new System.Drawing.Point(692, 278);
+            this.ChooseFolder.Location = new System.Drawing.Point(692, 316);
             this.ChooseFolder.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.ChooseFolder.Name = "ChooseFolder";
             this.ChooseFolder.Size = new System.Drawing.Size(156, 48);
@@ -170,7 +173,7 @@
             // 
             this.MakeCode_lable.AutoSize = true;
             this.MakeCode_lable.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MakeCode_lable.Location = new System.Drawing.Point(54, 160);
+            this.MakeCode_lable.Location = new System.Drawing.Point(54, 227);
             this.MakeCode_lable.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.MakeCode_lable.Name = "MakeCode_lable";
             this.MakeCode_lable.Size = new System.Drawing.Size(104, 38);
@@ -212,7 +215,7 @@
             // 
             // ma_code
             // 
-            this.ma_code.Location = new System.Drawing.Point(224, 160);
+            this.ma_code.Location = new System.Drawing.Point(224, 227);
             this.ma_code.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.ma_code.Name = "ma_code";
             this.ma_code.Size = new System.Drawing.Size(436, 35);
@@ -221,7 +224,7 @@
             // BatchAnalysus
             // 
             this.BatchAnalysus.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.BatchAnalysus.Location = new System.Drawing.Point(692, 157);
+            this.BatchAnalysus.Location = new System.Drawing.Point(692, 224);
             this.BatchAnalysus.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.BatchAnalysus.Name = "BatchAnalysus";
             this.BatchAnalysus.Size = new System.Drawing.Size(156, 48);
@@ -235,11 +238,37 @@
             this.Timer.Interval = 10000;
             this.Timer.Tick += new System.EventHandler(this.Timer_Tick);
             // 
+            // Device
+            // 
+            this.Device.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.Device.FormattingEnabled = true;
+            this.Device.Items.AddRange(new object[] {
+            "AOI设备",
+            "选焊设备"});
+            this.Device.Location = new System.Drawing.Point(224, 138);
+            this.Device.Margin = new System.Windows.Forms.Padding(6);
+            this.Device.Name = "Device";
+            this.Device.Size = new System.Drawing.Size(436, 32);
+            this.Device.TabIndex = 20;
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label3.Location = new System.Drawing.Point(54, 138);
+            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(133, 38);
+            this.label3.TabIndex = 19;
+            this.label3.Text = "设备选择";
+            // 
             // AutoAnalysisXml
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1654, 640);
+            this.Controls.Add(this.Device);
+            this.Controls.Add(this.label3);
             this.Controls.Add(this.BatchAnalysus);
             this.Controls.Add(this.ma_code);
             this.Controls.Add(this.AutoStart);
@@ -289,6 +318,8 @@
         private System.Windows.Forms.TextBox ma_code;
         private System.Windows.Forms.Button BatchAnalysus;
         private System.Windows.Forms.Timer Timer;
+        private System.Windows.Forms.ComboBox Device;
+        private System.Windows.Forms.Label label3;
     }
 }
 

+ 203 - 165
UAS_AutoPass/AutoAnalysisXml.cs

@@ -157,11 +157,16 @@ namespace UAS_AutoPass
                 }
             }
             //存在工单必须是已下放状态
-            if (!dh.CheckExist("make", "ma_statuscode='STARTED' and ma_code='" + ma_code.Text + "'") && ma_code.Text != "")
+            if (!dh.CheckExist("make", "ma_statuscode='STARTED' and ma_code='" + ma_code.Text + "'") && ma_code.Text != ""&&Device.Text=="AOI设备")
             {
                 OperateResult.AppendText("工单不存在或者未下放\n");
                 return;
             }
+            if (!dh.CheckExist("make", "ma_code='" + ma_code.Text + "'") && ma_code.Text != "" && Device.Text == "选焊设备")
+            {
+                OperateResult.AppendText("工单不存\n");
+                return;
+            }
             XmlWatcher.Path = FolderPath.Text;
             XmlWatcher.Filter = "*.txt";
             XmlWatcher.EnableRaisingEvents = true;
@@ -229,198 +234,231 @@ namespace UAS_AutoPass
             {
                 data1 = nextLine.Split(';');
             }
-            string SoftVersion = data1[0];
-            List<string[]> dic = new List<string[]>();
-            List<string> sndata = new List<string>();
-            for (int i = 0; i < data1.Length; i++)
+            if (Device.Text == "AOI设备")
             {
-                //如果软件版本相同的时候,则表示一个新的SN
-                if ((SoftVersion == data1[i] && i != 0) || i == data1.Length - 1)
+                string SoftVersion = data1[0];
+                List<string[]> dic = new List<string[]>();
+                List<string> sndata = new List<string>();
+                for (int i = 0; i < data1.Length; i++)
                 {
-                    dic.Add(sndata.ToArray());
-                    sndata.Clear();
-                }
-                sndata.Add(data1[i]);
-            }
-            foreach (string[] content in dic)
-            {
-                string SN = "";
-                string Machine = "";
-                string EmName = "";
-                string Day = "";
-                string Time = "";
-                string Result = "";
-                string TotalPart = "";
-                string NGPart = "";
-                int MissTest = 0;
-                string[] data = content;
-                for (int i = 0; i < data.Length; i++)
-                {
-                    switch (i.ToString())
+                    //如果软件版本相同的时候,则表示一个新的SN
+                    if ((SoftVersion == data1[i] && i != 0) || i == data1.Length - 1)
                     {
-                        case "0":
-                            SoftVersion = data[i];
-                            break;
-                        case "1":
-                            SN = data[i];
-                            break;
-                        case "2":
-                            Machine = data[i];
-                            break;
-                        case "4":
-                            EmName = data[i];
-                            break;
-                        case "6":
-                            Day = data[i];
-                            break;
-                        case "7":
-                            Time = data[i];
-                            break;
-                        case "8":
-                            Result += data[i];
-                            break;
-                        case "9":
-                            Result += data[i];
-                            break;
-                        case "10":
-                            Result += data[i];
-                            break;
-                        case "11":
-                            Result += data[i];
-                            break;
-                        case "13":
-                            TotalPart = data[i];
-                            break;
-                        case "14":
-                            NGPart = data[i];
-                            break;
-                        default:
-                            break;
+                        dic.Add(sndata.ToArray());
+                        sndata.Clear();
                     }
+                    sndata.Add(data1[i]);
                 }
-                if (SN == "")
-                {
-                    tipform.startthread("序列号不能为空", "NG");
-                    continue;
-                }
-                if (data.Length > 15)
+                foreach (string[] content in dic)
                 {
-                    for (int i = 15; i < data.Length; i++)
+                    string SN = "";
+                    string Machine = "";
+                    string EmName = "";
+                    string Day = "";
+                    string Time = "";
+                    string Result = "";
+                    string TotalPart = "";
+                    string NGPart = "";
+                    int MissTest = 0;
+                    string[] data = content;
+                    for (int i = 0; i < data.Length; i++)
                     {
-                        switch ((i - 15) % 6)
+                        switch (i.ToString())
                         {
-                            case 0:
-                                badlocation.Add(data[i]);
+                            case "0":
+                                SoftVersion = data[i];
+                                break;
+                            case "1":
+                                SN = data[i];
+                                break;
+                            case "2":
+                                Machine = data[i];
+                                break;
+                            case "4":
+                                EmName = data[i];
+                                break;
+                            case "6":
+                                Day = data[i];
+                                break;
+                            case "7":
+                                Time = data[i];
                                 break;
-                            case 1:
-                                badprod.Add(data[i]);
+                            case "8":
+                                Result += data[i];
                                 break;
-                            case 2:
-                                badcode.Add(data[i].ToUpper());
+                            case "9":
+                                Result += data[i];
+                                break;
+                            case "10":
+                                Result += data[i];
+                                break;
+                            case "11":
+                                Result += data[i];
+                                break;
+                            case "13":
+                                TotalPart = data[i];
+                                break;
+                            case "14":
+                                NGPart = data[i];
                                 break;
                             default:
                                 break;
                         }
                     }
-                }
-                sR.Close();
-                //如果没有不良位号等数据则是15个数据
-                if (Result == "0001")
-                {
-                    if (data.Length > 16)
+                    if (SN == "")
                     {
-                        MissTest = -1;
-                        Result = "NG";
+                        tipform.startthread("序列号不能为空", "NG");
+                        continue;
                     }
-                    else
+                    if (data.Length > 15)
                     {
-                        Result = "OK";
+                        for (int i = 15; i < data.Length; i++)
+                        {
+                            switch ((i - 15) % 6)
+                            {
+                                case 0:
+                                    if (badlocation.Count >= 1)
+                                    {
+                                        continue;
+                                    }
+                                    badlocation.Add(data[i]);
+                                    break;
+                                case 1:
+                                    if (badprod.Count >= 1)
+                                    {
+                                        continue;
+                                    }
+                                    badprod.Add(data[i]);
+                                    break;
+                                case 2:
+                                    if (badcode.Count >= 1)
+                                    {
+                                        continue;
+                                    }
+                                    badcode.Add(data[i].ToUpper());
+                                    break;
+                                default:
+                                    break;
+                            }
+                        }
                     }
-                }
-                else
-                {
-                    Result = "OK";
-                }
-                string makecode = "";
-                string stepcode = "";
-                string oErrMessage = "";
-                string oMSID = "";
-                if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, isource, SN, iusercode, out makecode, out oMSID, out oErrMessage))
-                {
-                    //获取序列号ID最大的工单
-                    dt = (DataTable)dh.ExecuteSql("select ms_makecode,ms_id,ms_stepcode from makeserial where ms_sncode='" + SN + "' order by ms_id desc", "select");
-                    if (dt.Rows.Count > 0)
+                    sR.Close();
+                    //如果没有不良位号等数据则是15个数据
+                    if (Result == "0001")
                     {
-                        ma_code.Text = dt.Rows[0]["ms_makecode"].ToString();
-                        makecode = dt.Rows[0]["ms_makecode"].ToString();
-                        stepcode = dt.Rows[0]["ms_stepcode"].ToString();
-                        if (stepcode == istepcode)
+                        if (data.Length > 16)
                         {
-                            tipform.startthread("序列号 " + SN + "已执行过" + istepcode, "NG");
-                            OperateResult.AppendText("序列号 " + SN + "已执行过" + istepcode + "\n");
-                            continue;
+                            MissTest = -1;
+                            Result = "NG";
                         }
-                        switch (Result)
+                        else
                         {
-                            case "OK":
-                                if (!LogicHandler.SetStepResult(makecode, isource, SN, "自动过站采集", Result, iusercode, out oErrMessage))
-                                {
-                                    OperateResult.AppendText(oErrMessage + "\n");
-                                    tipform.startthread(oErrMessage, Result);
-                                    continue;
-                                }
-                                tipform.startthread("序列号 " + SN + "通过检测", Result);
-                                break;
-                            case "NG":
-                                RecordBadInfo(SN, makecode, FileName, "", badcode.ToArray(), badlocation.ToArray(), badprod.ToArray());
-                                //所有的序列号均采集为良品
-                                if (!LogicHandler.SetTestNGDetail(SN, makecode, iusercode, isource, Result, out oErrMessage))
-                                {
-                                    OperateResult.AppendText(oErrMessage + "\n");
-                                    tipform.startthread(oErrMessage, Result);
-                                    continue;
-                                }
-                                tipform.startthread("序列号 " + SN + "未通过检测", Result);
-                                break;
-                            default:
-                                break;
+                            Result = "OK";
                         }
-                        LogicHandler.AutoPassLog(SN, isource, makecode, Day + Time, istepcode, ilinecode, SoftVersion, Result == "NG" ? "-1" : "0", "0", MissTest, TotalPart, NGPart);
-                        FileName = FileName.Substring(FileName.LastIndexOf(@"\") + 1);
-                        FileInfo file = new FileInfo(FolderPath.Text + @"\" + FileName);
-                        //if (file.Exists)
-                        //{
-                        //    try
-                        //    {
-                        //        for (int i = 1; i <= 20; i++)
-                        //        {
-                        //            if (!File.Exists(BackUpFolderPath.Text + @"\" + FileName))
-                        //            {
-                        //                file.MoveTo(BackUpFolderPath.Text + @"\" + FileName);
-                        //                OperateResult.AppendText("成功解析文件" + DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss") + " " + FileName + "\n");
-                        //                break;
-                        //            }
-                        //            else if (!File.Exists(BackUpFolderPath.Text + @"\" + FileName.Split('.')[0] + "(" + i + ")" + "." + FileName.Split('.')[1]))
-                        //            {
-                        //                file.MoveTo(BackUpFolderPath.Text + @"\" + FileName.Split('.')[0] + "(" + i + ")" + "." + FileName.Split('.')[1]);
-                        //                OperateResult.AppendText("成功解析文件" + DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss") + " " + FileName + "\n");
-                        //                break;
-                        //            }
-                        //        }
-                        //    }
-                        //    catch (Exception ex)
-                        //    {
-                        //        OperateResult.AppendText(FileName + ex.Message + "\n");
-                        //    }
-                        //}
+                    }
+                    else
+                    {
+                        Result = "OK";
+                    }
+                    string makecode = "";
+                    string stepcode = "";
+                    string oErrMessage = "";
+                    string oMSID = "";
+                    if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, isource, SN, iusercode, out makecode, out oMSID, out oErrMessage))
+                    {
+                        //获取序列号ID最大的工单
+                        dt = (DataTable)dh.ExecuteSql("select ms_makecode,ms_id,ms_stepcode from makeserial where ms_sncode='" + SN + "' order by ms_id desc", "select");
+                        if (dt.Rows.Count > 0)
+                        {
+                            ma_code.Text = dt.Rows[0]["ms_makecode"].ToString();
+                            makecode = dt.Rows[0]["ms_makecode"].ToString();
+                            stepcode = dt.Rows[0]["ms_stepcode"].ToString();
+                            if (stepcode == istepcode)
+                            {
+                                tipform.startthread("序列号 " + SN + "已执行过" + istepcode, "NG");
+                                OperateResult.AppendText("序列号 " + SN + "已执行过" + istepcode + "\n");
+                                continue;
+                            }
+                            switch (Result)
+                            {
+                                case "OK":
+                                    if (!LogicHandler.SetStepResult(makecode, isource, SN, "自动过站采集", Result, iusercode, out oErrMessage))
+                                    {
+                                        OperateResult.AppendText(oErrMessage + "\n");
+                                        tipform.startthread(oErrMessage, Result);
+                                        continue;
+                                    }
+                                    tipform.startthread("序列号 " + SN + "通过检测", Result);
+                                    break;
+                                case "NG":
+                                    RecordBadInfo(SN, makecode, FileName, "", badcode.ToArray(), badlocation.ToArray(), badprod.ToArray());
+                                    //所有的序列号均采集为良品
+                                    if (!LogicHandler.SetTestNGDetail(SN, makecode, iusercode, isource, Result, out oErrMessage))
+                                    {
+                                        OperateResult.AppendText(oErrMessage + "\n");
+                                        tipform.startthread(oErrMessage, Result);
+                                        continue;
+                                    }
+                                    tipform.startthread("序列号 " + SN + "未通过检测", Result);
+                                    break;
+                                default:
+                                    break;
+                            }
+                            LogicHandler.AutoPassLog(SN, isource, makecode, Day + Time, istepcode, ilinecode, SoftVersion, Result == "NG" ? "-1" : "0", "0", MissTest, TotalPart, NGPart);
+                            FileName = FileName.Substring(FileName.LastIndexOf(@"\") + 1);
+                            FileInfo file = new FileInfo(FolderPath.Text + @"\" + FileName);
+                            //if (file.Exists)
+                            //{
+                            //    try
+                            //    {
+                            //        for (int i = 1; i <= 20; i++)
+                            //        {
+                            //            if (!File.Exists(BackUpFolderPath.Text + @"\" + FileName))
+                            //            {
+                            //                file.MoveTo(BackUpFolderPath.Text + @"\" + FileName);
+                            //                OperateResult.AppendText("成功解析文件" + DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss") + " " + FileName + "\n");
+                            //                break;
+                            //            }
+                            //            else if (!File.Exists(BackUpFolderPath.Text + @"\" + FileName.Split('.')[0] + "(" + i + ")" + "." + FileName.Split('.')[1]))
+                            //            {
+                            //                file.MoveTo(BackUpFolderPath.Text + @"\" + FileName.Split('.')[0] + "(" + i + ")" + "." + FileName.Split('.')[1]);
+                            //                OperateResult.AppendText("成功解析文件" + DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss") + " " + FileName + "\n");
+                            //                break;
+                            //            }
+                            //        }
+                            //    }
+                            //    catch (Exception ex)
+                            //    {
+                            //        OperateResult.AppendText(FileName + ex.Message + "\n");
+                            //    }
+                            //}
+                        }
+                    }
+                    else
+                    {
+                        OperateResult.AppendText(oErrMessage + "\n");
+                        tipform.startthread(oErrMessage, Result);
+                        continue;
                     }
                 }
-                else
+            }
+            else if (Device.Text == "选焊设备")
+            {
+                Dictionary<string, string> dic = new Dictionary<string, string>();
+                BaseUtil.GetWriteInfo(FileName, out dic);
+                string sql = "insert into AOITESTDETAIL(atd_id,atd_makecode,atd_indate,";
+                string sql1 = " values(AOITESTDETAIL_seq.nextval,'" + ma_code.Text + "',sysdate,";
+                foreach (var item in dic)
                 {
-                    OperateResult.AppendText(oErrMessage + "\n");
-                    tipform.startthread(oErrMessage, Result);
-                    continue;
+                    sql += item.Key + ",";
+                    if (item.Key.Contains("starttime") || item.Key.Contains("endtime"))
+                        sql1 += "to_date('" + item.Value + "','yyyy/mm/dd hh24:mi:ss'),";
+                    else
+                        sql1 += "'" + item.Value + "',";
                 }
+
+                sql = sql.Substring(0, sql.Length - 1) + ")" + sql1.Substring(0, sql1.Length - 1) + ")";
+                dh.ExecuteSql(sql, "insert");
             }
         }
         /// <summary>

+ 86 - 0
UAS_AutoPass/ToolClass/BaseUtil.cs

@@ -1,5 +1,7 @@
 using System;
+using System.Collections.Generic;
 using System.IO;
+using System.Text.RegularExpressions;
 using System.Xml;
 
 namespace UAS_AutoPass.ToolClass
@@ -125,5 +127,89 @@ namespace UAS_AutoPass.ToolClass
                 Console.WriteLine(ex.Message + ex.StackTrace);
             }
         }
+
+        public static void GetWriteInfo(string FilePath, out Dictionary<string, string> Dic)
+        {
+            Dic = new Dictionary<string, string>();
+            string txt = "";
+            StreamReader sr = new StreamReader(FilePath);
+            while (!sr.EndOfStream)
+            {
+                string str = sr.ReadLine();
+                txt += str + "\n";
+            }
+            Dic.Add("atd_sncode", FilePath.Substring(FilePath.LastIndexOf("\\") + 1).Replace(".txt", ""));
+            Dic.Add("atd_software", Regex.Match(txt, "Program Name,\\S+").Value.Replace("Program Name,", ""));
+            Dic.Add("atd_pot", Regex.Match(txt, "Board Segment,\\S+").Value.Replace("Board Segment,", ""));
+            Dic.Add("atd_size", Regex.Match(txt, "Baord Size \\(L x W\\) \\[mm\\],\\S+").Value.Replace("Baord Size (L x W) [mm],", ""));
+            Dic.Add("atd_pot1set", Regex.Match(txt, "Pot-1 Set Temp. \\[deg],\\S+").Value.Replace("Pot-1 Set Temp. [deg],", ""));
+            Dic.Add("atd_pot2set", Regex.Match(txt, "Pot-2 Set Temp. \\[deg],\\S+").Value.Replace("Pot-2 Set Temp. [deg],", ""));
+            Dic.Add("atd_pot1avgtemp", Regex.Match(txt, "Pot-1 Avg. Temp. \\[deg],\\S+").Value.Replace("Pot-1 Avg. Temp. [deg],", ""));
+            Dic.Add("atd_pot2avgtemp", Regex.Match(txt, "Pot-2 Avg. Temp. \\[deg],\\S+").Value.Replace("Pot-2 Avg. Temp. [deg],", ""));
+            Dic.Add("atd_boardtime", Regex.Match(txt, "Machine Duration \\[s],\\S+").Value.Replace("Machine Duration [s],", ""));
+
+            //开始时间
+            MatchCollection starttime = Regex.Matches(txt, "Start TimeStamp,\\S+ \\S+");
+            for (int i = 0; i < starttime.Count; i++)
+            {
+                switch (i)
+                {
+                    case 0:
+                        Dic.Add("atd_boardstarttime", starttime[i].Value.Replace("Start TimeStamp,", ""));
+                        break;
+                    case 1:
+                        Dic.Add("atd_flstarttime", starttime[i].Value.Replace("Start TimeStamp,", ""));
+                        break;
+                    case 2:
+                        Dic.Add("atd_phstarttime", starttime[i].Value.Replace("Start TimeStamp,", ""));
+                        break;
+                    case 3:
+                        Dic.Add("atd_sostarttime", starttime[i].Value.Replace("Start TimeStamp,", ""));
+                        break;
+                    default:
+                        break;
+                }
+            }
+            MatchCollection endtime = Regex.Matches(txt, "End TimeStamp,\\S+ \\S+");
+            for (int i = 0; i < starttime.Count; i++)
+            {
+                switch (i)
+                {
+                    case 0:
+                        Dic.Add("atd_boardendtime", endtime[i].Value.Replace("End TimeStamp,", ""));
+                        break;
+                    case 1:
+                        Dic.Add("atd_flendtime", endtime[i].Value.Replace("End TimeStamp,", ""));
+                        break;
+                    case 2:
+                        Dic.Add("atd_phendtime", endtime[i].Value.Replace("End TimeStamp,", ""));
+                        break;
+                    case 3:
+                        Dic.Add("atd_soendtime", endtime[i].Value.Replace("End TimeStamp,", ""));
+                        break;
+                    default:
+                        break;
+                }
+            }
+
+            MatchCollection duration = Regex.Matches(txt, "Total Zone Duration \\[s],\\S+");
+            for (int i = 0; i < starttime.Count; i++)
+            {
+                switch (i)
+                {
+                    case 0:
+                        Dic.Add("atd_fltime", duration[i].Value.Replace("Total Zone Duration [s],", ""));
+                        break;
+                    case 1:
+                        Dic.Add("atd_phtime", duration[i].Value.Replace("Total Zone Duration [s],", ""));
+                        break;
+                    case 2:
+                        Dic.Add("atd_sotime", duration[i].Value.Replace("Total Zone Duration [s],", ""));
+                        break;
+                    default:
+                        break;
+                }
+            }
+        }
     }
 }