From 6d04f48019cdc1643df5e9c1af4072c99fd95646 Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Thu, 17 Nov 2022 13:41:38 -0500 Subject: [PATCH] Add project files. --- 2022-03-5--05-25.txt | 36 + 8082_Waymo_PC.csproj | 146 +++ 8082_Waymo_PC.sln | 23 + App.config | 67 ++ BTD barcode.gif | Bin 0 -> 1437 bytes FlexFlowXML.cs | 84 ++ Form1.Designer.cs | 1536 ++++++++++++++++++++++++++ Form1.cs | 1725 ++++++++++++++++++++++++++++++ Form1.resx | 147 +++ GetUnitInfo.cs | 79 ++ I28FlexStatus.cs | 98 ++ Program.cs | 22 + Properties/AssemblyInfo.cs | 36 + Properties/Resources.Designer.cs | 73 ++ Properties/Resources.resx | 124 +++ Properties/Settings.Designer.cs | 203 ++++ Properties/Settings.settings | 51 + SaveResult.cs | 205 ++++ T_Func.cs | 184 ++++ XMLParser.cs | 59 + example_dumptruck_xml.xml | 25 + 21 files changed, 4923 insertions(+) create mode 100644 2022-03-5--05-25.txt create mode 100644 8082_Waymo_PC.csproj create mode 100644 8082_Waymo_PC.sln create mode 100644 App.config create mode 100644 BTD barcode.gif create mode 100644 FlexFlowXML.cs create mode 100644 Form1.Designer.cs create mode 100644 Form1.cs create mode 100644 Form1.resx create mode 100644 GetUnitInfo.cs create mode 100644 I28FlexStatus.cs create mode 100644 Program.cs create mode 100644 Properties/AssemblyInfo.cs create mode 100644 Properties/Resources.Designer.cs create mode 100644 Properties/Resources.resx create mode 100644 Properties/Settings.Designer.cs create mode 100644 Properties/Settings.settings create mode 100644 SaveResult.cs create mode 100644 T_Func.cs create mode 100644 XMLParser.cs create mode 100644 example_dumptruck_xml.xml diff --git a/2022-03-5--05-25.txt b/2022-03-5--05-25.txt new file mode 100644 index 0000000..dc3edae --- /dev/null +++ b/2022-03-5--05-25.txt @@ -0,0 +1,36 @@ +Calibrating DAC1 +Enter Voltage +Calibrating DAC1 +Enter Voltage += 0.38 +Enter Voltage += 1.29 +Enter Voltage += 3.06 +Enter Voltage += 6.62 +Enter Voltage += 10.21 +Enter Voltage += 12.07 + +SEE=7.96412 COD=0.99997196 +Coefs 278.901123 144.999618 +250. 0.384 252. +500. 1.290 505. +1000. 3.059 998. +2000. 6.620 1991. +3000. 10.213 2993. +3500. 12.066 3510. +VTable: +0.0 = 145. +0.5 = 284. +1.0 = 424. +1.5 = 563. +2.0 = 703. +2.5 = 842. +3.0 = 982. +3.5 = 1121. +4.0 = 1261. +4.5 = 1400. +Save this Calibration (y/n) ? diff --git a/8082_Waymo_PC.csproj b/8082_Waymo_PC.csproj new file mode 100644 index 0000000..32d0026 --- /dev/null +++ b/8082_Waymo_PC.csproj @@ -0,0 +1,146 @@ + + + + + Debug + AnyCPU + {1206B49C-9DCD-49A9-A135-42135532C2CB} + WinExe + Properties + _8082_Waymo_PC + DMD-III Sequence Manager + v4.8 + 512 + false + C:\Users\Tony\OneDrive\_Projects\_Active\8082_Waymo\Software Stuff\Publish\V1-T\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 30 + 1.0.0.%2a + false + true + true + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + 450CB89F602E75887DB2DAC9C38E2B0F225D3AAE + + + DMD-III Sequence Manager_TemporaryKey.pfx + + + true + + + false + + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + False + Microsoft .NET Framework 4.5 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + + + + + + \ No newline at end of file diff --git a/8082_Waymo_PC.sln b/8082_Waymo_PC.sln new file mode 100644 index 0000000..fef2ffb --- /dev/null +++ b/8082_Waymo_PC.sln @@ -0,0 +1,23 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "8082_Waymo_PC", "8082_Waymo_PC.csproj", "{1206B49C-9DCD-49A9-A135-42135532C2CB}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1206B49C-9DCD-49A9-A135-42135532C2CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1206B49C-9DCD-49A9-A135-42135532C2CB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1206B49C-9DCD-49A9-A135-42135532C2CB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1206B49C-9DCD-49A9-A135-42135532C2CB}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(Performance) = preSolution + HasPerformanceSessions = true + EndGlobalSection +EndGlobal diff --git a/App.config b/App.config new file mode 100644 index 0000000..f0b7b89 --- /dev/null +++ b/App.config @@ -0,0 +1,67 @@ + + + + +
+ + +
+ + + + + + + <_8082_Waymo_PC.Properties.Settings> + + COM7 + + + "c:\\BTD\\DMD-III Seq\\" + + + COM6 + + + COM8 + + + 1 + + + 2 + + + COM29 + + + 40 + + + 30 + + + http://10.0.0.1/Burgundy/fftester20.asmx + + + True + + + FLEX-M4-CR2-LEAK TEST + + + True + + + c:\\benchtoplogs + + + + + <_8082_Waymo_PC.Properties.Settings> + + V1-T + + + + diff --git a/BTD barcode.gif b/BTD barcode.gif new file mode 100644 index 0000000000000000000000000000000000000000..f77ab65da686ac7778186251ea34d655854aa21f GIT binary patch literal 1437 zcmXYwdyvmn7{*^^jM<6QFhVSA5r@K?wI#)$K@!)OGJq6M^wme4X*AHVK%}>*#cW+OKh2~uvK=z4%rbqW+&{FJ+Mdi#Gcs;d*uKekOOgG4#GiM zffZSam05)~q92)!0wll!5}6?e#Gn`w!(v2?iUqMKmc+7H5v$@r9Eu}xEKbC!co2`` zNj!@e@hSl%pahb@5=4TEf+&iTD2s}yJ_$nPMua5N6&0f>7*K<1NDZqIHL4cWqFPeR zYDKN819hm5)Ui5Ir|LmHswefVUev1w(103918WcsPntzRi`lu3<{;2mMBLU0AnG(uU-A!&8>T zcOF-J(ZsZOmNoCRHnCvGhLV+S-z#2GZ+WxhtCJ=boiF%ubdUL6Iwh=Wnc3{*`fkgs z)rbu!=$rTMq=ZkhGs}-`d4rQW3|j6}who&(=R&Km$DY|SqGZ!Im6I}#7WNyPIke>d z&D7l!HeXLWH*jp&+xOltAN*BkLXW+(Dw_XLKe=#Z@yyhhn>Q%EGxEsWC;J~CTWZpd z=9SgFdYlm{Re0Nc^L$$6wv4xR80b{O}sL?RZ7}`-hsOzxd&eX%&~oK+>5P`pl^}@bav> z&o9UyQgcj?)#-`Z>5V_W`gu;HtOGXX!i+t+oAZaY+mv%@afj(IPC#uDHDZ z^`Zp{`F$T}WbpFJmT4PvE+&`F9-S1swr=vCRZUl}9TY2Hx~y{A)kTHZrzdCRUpZcX zvAftyx`E; zg@cO*Wj-w2cJ6emTd@W;8{Eo^i_6)vt4;rs5!-*d-ZNuHL2S&pw7sX&U-6H!w%%G& bmNokJ_tjez-ahb5#~Zf~*6LWN7IgXt@Sw_P literal 0 HcmV?d00001 diff --git a/FlexFlowXML.cs b/FlexFlowXML.cs new file mode 100644 index 0000000..4100378 --- /dev/null +++ b/FlexFlowXML.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Text; +using System.IO; +using System.Threading.Tasks; +using System.Net.Http; + +namespace _8082_Waymo_PC +{ + class FlexFlow + { + public static string Send(string className, string body, string action) + { + string response; + response = Task.Run(async () => await EnvelopeAndSend(className, body, action)).Result; + + Directory.CreateDirectory("C:\\benchtoplogs"); + File.WriteAllText($"C:\\benchtoplogs\\response_{DateTime.Now:h_mm_ss}.txt", response); + return response; + } + + public static async Task EnvelopeAndSend(string className, string body, string action) + { + HttpResponseMessage response; + // should serialized properly, but the CData jank makes it hard. + var envelope = String.Join( + Environment.NewLine, + "", + "", + "", + $"<{className} xmlns=\"http://www.flextronics.com/FFTester20\">", + body, + $"", + "", + "" + ); + + // Debugging logs + Directory.CreateDirectory("C:\\benchtoplogs"); + File.WriteAllText($"C:\\benchtoplogs\\envelope_{DateTime.Now:h_mm_ss}.txt", envelope); + response = await PostXmlRequest(envelope, action); + var x = await response.Content.ReadAsStringAsync(); + LogText("got xml string"); + return x; + } + + public static async Task PostXmlRequest(string envelope, string action) + { + string FlexFlowURL = Properties.Settings.Default.FlexURL; //URL for Flex Flow Stuff + using (var httpClient = new HttpClient()) + { + httpClient.DefaultRequestHeaders.Add("Accept-Encoding", "gzip,deflate"); + httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/soap+xml;charset=UTF-8"); + + var httpContent = new StringContent(envelope, Encoding.UTF8, "text/xml"); + httpContent.Headers.Add("SOAPAction", action); + + var x = await httpClient.PostAsync(FlexFlowURL, httpContent); + LogText("Got Post data back."); + return x; + } + + } + public static void LogText(string message) + { + if (Properties.Settings.Default.DebugLogs) + { + if (!Directory.Exists(Properties.Settings.Default.LogDirectory)) + { + Directory.CreateDirectory(Properties.Settings.Default.LogDirectory); + } + using (StreamWriter w = File.AppendText($"{Properties.Settings.Default.LogDirectory}\\log_form1.txt")) + { + w.Write("\r\nLog Entry : "); + w.WriteLine($"{DateTime.Now.ToLongTimeString()} {DateTime.Now.ToLongDateString()}"); + w.WriteLine($" :{message}"); + w.WriteLine("-------------------------------"); + } + } + } + } +} diff --git a/Form1.Designer.cs b/Form1.Designer.cs new file mode 100644 index 0000000..e6af870 --- /dev/null +++ b/Form1.Designer.cs @@ -0,0 +1,1536 @@ +namespace _8082_Waymo_PC +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.serialPort1 = new System.IO.Ports.SerialPort(this.components); + this.label1 = new System.Windows.Forms.Label(); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.serialPortToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.communicationsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.readyManualOperationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.readyONToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.readyOFFToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.testScannerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.setComPortsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.programSettingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.fixture1ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.sNPartIdentifyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.flexFlowURLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.tsEnableFlexFlow = new System.Windows.Forms.ToolStripMenuItem(); + this.debugToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.stationNameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ChamberTest = new System.Windows.Forms.ToolStripMenuItem(); + this.hRToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.sVToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.versionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.lstRead = new System.Windows.Forms.ListBox(); + this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); + this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); + this.button1 = new System.Windows.Forms.Button(); + this.txtScan = new System.Windows.Forms.TextBox(); + this.button2 = new System.Windows.Forms.Button(); + this.button3 = new System.Windows.Forms.Button(); + this.button4 = new System.Windows.Forms.Button(); + this.tmrScanIn = new System.Windows.Forms.Timer(this.components); + this.button5 = new System.Windows.Forms.Button(); + this.tmrDelay = new System.Windows.Forms.Timer(this.components); + this.lstTest = new System.Windows.Forms.ListBox(); + this.button6 = new System.Windows.Forms.Button(); + this.serialPort2 = new System.IO.Ports.SerialPort(this.components); + this.grpFixture_1 = new System.Windows.Forms.GroupBox(); + this.label3 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.lblFix_1_Operator = new System.Windows.Forms.Label(); + this.lblFix_1_SN = new System.Windows.Forms.Label(); + this.lblFix_1_Status = new System.Windows.Forms.Label(); + this.grpFixture_2 = new System.Windows.Forms.GroupBox(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.lblFix_2_Operator = new System.Windows.Forms.Label(); + this.lblFix_2_SN = new System.Windows.Forms.Label(); + this.lblFix_2_Status = new System.Windows.Forms.Label(); + this.serialPort3 = new System.IO.Ports.SerialPort(this.components); + this.grpZebraTest = new System.Windows.Forms.GroupBox(); + this.lblTestScan = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.btnClose = new System.Windows.Forms.Button(); + this.label6 = new System.Windows.Forms.Label(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.grpOperator = new System.Windows.Forms.GroupBox(); + this.btnOperClose = new System.Windows.Forms.Button(); + this.txtOperator = new System.Windows.Forms.TextBox(); + this.label11 = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.button8 = new System.Windows.Forms.Button(); + this.grpFixture_Prog = new System.Windows.Forms.GroupBox(); + this.cmbFix_2_Prg = new System.Windows.Forms.ComboBox(); + this.cmbFix_1_Prg = new System.Windows.Forms.ComboBox(); + this.button9 = new System.Windows.Forms.Button(); + this.btnSavePrograms = new System.Windows.Forms.Button(); + this.label14 = new System.Windows.Forms.Label(); + this.label13 = new System.Windows.Forms.Label(); + this.serialPort4 = new System.IO.Ports.SerialPort(this.components); + this.lblMessage = new System.Windows.Forms.Label(); + this.grpSN_Verify = new System.Windows.Forms.GroupBox(); + this.label20 = new System.Windows.Forms.Label(); + this.txtSV_New = new System.Windows.Forms.TextBox(); + this.txtHR_New = new System.Windows.Forms.TextBox(); + this.lblSV_Current = new System.Windows.Forms.Label(); + this.lblHR_Current = new System.Windows.Forms.Label(); + this.label19 = new System.Windows.Forms.Label(); + this.label18 = new System.Windows.Forms.Label(); + this.label17 = new System.Windows.Forms.Label(); + this.btnSave_ID = new System.Windows.Forms.Button(); + this.btnClose_ID = new System.Windows.Forms.Button(); + this.label16 = new System.Windows.Forms.Label(); + this.grpFlexFlowUrl = new System.Windows.Forms.GroupBox(); + this.btnCloseFlexUrl = new System.Windows.Forms.Button(); + this.txtNew_FlexFlowUrl = new System.Windows.Forms.TextBox(); + this.label8 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.btnSaveFlexUrl = new System.Windows.Forms.Button(); + this.grpSetComPorts = new System.Windows.Forms.GroupBox(); + this.txtZebra = new System.Windows.Forms.TextBox(); + this.label21 = new System.Windows.Forms.Label(); + this.btnCloseComports = new System.Windows.Forms.Button(); + this.txtReadyCom = new System.Windows.Forms.TextBox(); + this.label10 = new System.Windows.Forms.Label(); + this.btnSaveCom = new System.Windows.Forms.Button(); + this.txtFlexError = new System.Windows.Forms.TextBox(); + this.grpChamberTest = new System.Windows.Forms.GroupBox(); + this.btnCloseChamber = new System.Windows.Forms.Button(); + this.lblChamberStatus = new System.Windows.Forms.Label(); + this.grpStation = new System.Windows.Forms.GroupBox(); + this.txtStationName = new System.Windows.Forms.TextBox(); + this.button7 = new System.Windows.Forms.Button(); + this.btnSaveStation = new System.Windows.Forms.Button(); + this.label22 = new System.Windows.Forms.Label(); + this.txtFlexMsg = new System.Windows.Forms.TextBox(); + this.menuStrip1.SuspendLayout(); + this.grpFixture_1.SuspendLayout(); + this.grpFixture_2.SuspendLayout(); + this.grpZebraTest.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.grpOperator.SuspendLayout(); + this.grpFixture_Prog.SuspendLayout(); + this.grpSN_Verify.SuspendLayout(); + this.grpFlexFlowUrl.SuspendLayout(); + this.grpSetComPorts.SuspendLayout(); + this.grpChamberTest.SuspendLayout(); + this.grpStation.SuspendLayout(); + this.SuspendLayout(); + // + // serialPort1 + // + this.serialPort1.BaudRate = 115200; + this.serialPort1.Handshake = System.IO.Ports.Handshake.XOnXOff; + this.serialPort1.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(this.serialPort1_DataReceived); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.Location = new System.Drawing.Point(1349, 9); + this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(100, 37); + this.label1.TabIndex = 0; + this.label1.Text = "label1"; + // + // menuStrip1 + // + this.menuStrip1.Dock = System.Windows.Forms.DockStyle.None; + this.menuStrip1.GripMargin = new System.Windows.Forms.Padding(2, 2, 0, 2); + this.menuStrip1.ImageScalingSize = new System.Drawing.Size(40, 40); + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem, + this.serialPortToolStripMenuItem, + this.communicationsToolStripMenuItem, + this.programSettingsToolStripMenuItem, + this.ChamberTest, + this.helpToolStripMenuItem}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Padding = new System.Windows.Forms.Padding(4, 2, 0, 2); + this.menuStrip1.Size = new System.Drawing.Size(973, 40); + this.menuStrip1.TabIndex = 1; + this.menuStrip1.Text = "menuStrip1"; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.exitToolStripMenuItem}); + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(72, 36); + this.fileToolStripMenuItem.Text = "File"; + // + // exitToolStripMenuItem + // + this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; + this.exitToolStripMenuItem.Size = new System.Drawing.Size(186, 44); + this.exitToolStripMenuItem.Text = "Exit"; + this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); + // + // serialPortToolStripMenuItem + // + this.serialPortToolStripMenuItem.Name = "serialPortToolStripMenuItem"; + this.serialPortToolStripMenuItem.Size = new System.Drawing.Size(196, 36); + this.serialPortToolStripMenuItem.Text = "Operator Login"; + this.serialPortToolStripMenuItem.Click += new System.EventHandler(this.serialPortToolStripMenuItem_Click); + // + // communicationsToolStripMenuItem + // + this.communicationsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.readyManualOperationToolStripMenuItem, + this.testScannerToolStripMenuItem, + this.setComPortsToolStripMenuItem}); + this.communicationsToolStripMenuItem.Name = "communicationsToolStripMenuItem"; + this.communicationsToolStripMenuItem.Size = new System.Drawing.Size(215, 36); + this.communicationsToolStripMenuItem.Text = "Communications"; + // + // readyManualOperationToolStripMenuItem + // + this.readyManualOperationToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.readyONToolStripMenuItem, + this.readyOFFToolStripMenuItem}); + this.readyManualOperationToolStripMenuItem.Name = "readyManualOperationToolStripMenuItem"; + this.readyManualOperationToolStripMenuItem.Size = new System.Drawing.Size(486, 44); + this.readyManualOperationToolStripMenuItem.Text = "Ready Signal Manual Operation"; + // + // readyONToolStripMenuItem + // + this.readyONToolStripMenuItem.Name = "readyONToolStripMenuItem"; + this.readyONToolStripMenuItem.Size = new System.Drawing.Size(262, 44); + this.readyONToolStripMenuItem.Text = "Ready ON"; + this.readyONToolStripMenuItem.Click += new System.EventHandler(this.readyONToolStripMenuItem_Click_1); + // + // readyOFFToolStripMenuItem + // + this.readyOFFToolStripMenuItem.Name = "readyOFFToolStripMenuItem"; + this.readyOFFToolStripMenuItem.Size = new System.Drawing.Size(262, 44); + this.readyOFFToolStripMenuItem.Text = "Ready OFF"; + this.readyOFFToolStripMenuItem.Click += new System.EventHandler(this.readyOFFToolStripMenuItem_Click_1); + // + // testScannerToolStripMenuItem + // + this.testScannerToolStripMenuItem.Name = "testScannerToolStripMenuItem"; + this.testScannerToolStripMenuItem.Size = new System.Drawing.Size(486, 44); + this.testScannerToolStripMenuItem.Text = "Test Scanner"; + this.testScannerToolStripMenuItem.Click += new System.EventHandler(this.testScannerToolStripMenuItem_Click); + // + // setComPortsToolStripMenuItem + // + this.setComPortsToolStripMenuItem.Name = "setComPortsToolStripMenuItem"; + this.setComPortsToolStripMenuItem.Size = new System.Drawing.Size(486, 44); + this.setComPortsToolStripMenuItem.Text = "Set ComPorts"; + this.setComPortsToolStripMenuItem.Click += new System.EventHandler(this.setComPortsToolStripMenuItem_Click); + // + // programSettingsToolStripMenuItem + // + this.programSettingsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fixture1ToolStripMenuItem, + this.sNPartIdentifyToolStripMenuItem, + this.flexFlowURLToolStripMenuItem, + this.tsEnableFlexFlow, + this.debugToolStripMenuItem, + this.stationNameToolStripMenuItem}); + this.programSettingsToolStripMenuItem.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.programSettingsToolStripMenuItem.Name = "programSettingsToolStripMenuItem"; + this.programSettingsToolStripMenuItem.Size = new System.Drawing.Size(218, 36); + this.programSettingsToolStripMenuItem.Text = "Program Settings"; + // + // fixture1ToolStripMenuItem + // + this.fixture1ToolStripMenuItem.Name = "fixture1ToolStripMenuItem"; + this.fixture1ToolStripMenuItem.Size = new System.Drawing.Size(332, 44); + this.fixture1ToolStripMenuItem.Text = "Fixture Programs"; + this.fixture1ToolStripMenuItem.Click += new System.EventHandler(this.fixture1ToolStripMenuItem_Click); + // + // sNPartIdentifyToolStripMenuItem + // + this.sNPartIdentifyToolStripMenuItem.Name = "sNPartIdentifyToolStripMenuItem"; + this.sNPartIdentifyToolStripMenuItem.Size = new System.Drawing.Size(332, 44); + this.sNPartIdentifyToolStripMenuItem.Text = "SN Part Identify"; + this.sNPartIdentifyToolStripMenuItem.Click += new System.EventHandler(this.sNPartIdentifyToolStripMenuItem_Click); + // + // flexFlowURLToolStripMenuItem + // + this.flexFlowURLToolStripMenuItem.Name = "flexFlowURLToolStripMenuItem"; + this.flexFlowURLToolStripMenuItem.Size = new System.Drawing.Size(332, 44); + this.flexFlowURLToolStripMenuItem.Text = "IP Settings"; + this.flexFlowURLToolStripMenuItem.Click += new System.EventHandler(this.flexFlowURLToolStripMenuItem_Click); + // + // tsEnableFlexFlow + // + this.tsEnableFlexFlow.Checked = true; + this.tsEnableFlexFlow.CheckOnClick = true; + this.tsEnableFlexFlow.CheckState = System.Windows.Forms.CheckState.Checked; + this.tsEnableFlexFlow.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.tsEnableFlexFlow.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.tsEnableFlexFlow.Name = "tsEnableFlexFlow"; + this.tsEnableFlexFlow.Size = new System.Drawing.Size(332, 44); + this.tsEnableFlexFlow.Text = "FlexFlow Enabled"; + // + // debugToolStripMenuItem + // + this.debugToolStripMenuItem.CheckOnClick = true; + this.debugToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.debugToolStripMenuItem.Name = "debugToolStripMenuItem"; + this.debugToolStripMenuItem.Size = new System.Drawing.Size(332, 44); + this.debugToolStripMenuItem.Text = "Debug"; + this.debugToolStripMenuItem.CheckStateChanged += new System.EventHandler(this.debugToolStripMenuItem_CheckStateChanged); + // + // stationNameToolStripMenuItem + // + this.stationNameToolStripMenuItem.Name = "stationNameToolStripMenuItem"; + this.stationNameToolStripMenuItem.Size = new System.Drawing.Size(332, 44); + this.stationNameToolStripMenuItem.Text = "Station Name"; + this.stationNameToolStripMenuItem.Click += new System.EventHandler(this.stationNameToolStripMenuItem_Click); + // + // ChamberTest + // + this.ChamberTest.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.hRToolStripMenuItem, + this.sVToolStripMenuItem}); + this.ChamberTest.Name = "ChamberTest"; + this.ChamberTest.Size = new System.Drawing.Size(181, 36); + this.ChamberTest.Text = "Chamber Test"; + // + // hRToolStripMenuItem + // + this.hRToolStripMenuItem.Name = "hRToolStripMenuItem"; + this.hRToolStripMenuItem.Size = new System.Drawing.Size(180, 44); + this.hRToolStripMenuItem.Text = "HR"; + this.hRToolStripMenuItem.Click += new System.EventHandler(this.hRToolStripMenuItem_Click); + // + // sVToolStripMenuItem + // + this.sVToolStripMenuItem.Name = "sVToolStripMenuItem"; + this.sVToolStripMenuItem.Size = new System.Drawing.Size(180, 44); + this.sVToolStripMenuItem.Text = "SV"; + this.sVToolStripMenuItem.Click += new System.EventHandler(this.sVToolStripMenuItem_Click); + // + // helpToolStripMenuItem + // + this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.versionToolStripMenuItem}); + this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; + this.helpToolStripMenuItem.Size = new System.Drawing.Size(85, 36); + this.helpToolStripMenuItem.Text = "Help"; + // + // versionToolStripMenuItem + // + this.versionToolStripMenuItem.Name = "versionToolStripMenuItem"; + this.versionToolStripMenuItem.Size = new System.Drawing.Size(227, 44); + this.versionToolStripMenuItem.Text = "Version"; + this.versionToolStripMenuItem.Click += new System.EventHandler(this.versionToolStripMenuItem_Click); + // + // lstRead + // + this.lstRead.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.900001F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lstRead.FormattingEnabled = true; + this.lstRead.HorizontalScrollbar = true; + this.lstRead.ItemHeight = 30; + this.lstRead.Location = new System.Drawing.Point(1655, 9); + this.lstRead.Margin = new System.Windows.Forms.Padding(2); + this.lstRead.Name = "lstRead"; + this.lstRead.Size = new System.Drawing.Size(147, 1024); + this.lstRead.TabIndex = 2; + this.lstRead.Visible = false; + // + // openFileDialog1 + // + this.openFileDialog1.FileName = "openFileDialog1"; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(71, 77); + this.button1.Margin = new System.Windows.Forms.Padding(2); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(136, 84); + this.button1.TabIndex = 3; + this.button1.Text = "disable P1"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Visible = false; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // txtScan + // + this.txtScan.Location = new System.Drawing.Point(79, 316); + this.txtScan.Margin = new System.Windows.Forms.Padding(2); + this.txtScan.Name = "txtScan"; + this.txtScan.Size = new System.Drawing.Size(293, 31); + this.txtScan.TabIndex = 4; + this.txtScan.Visible = false; + this.txtScan.TextChanged += new System.EventHandler(this.txtScan_TextChanged); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(225, 598); + this.button2.Margin = new System.Windows.Forms.Padding(2); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(147, 80); + this.button2.TabIndex = 5; + this.button2.Text = "enable 1"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Visible = false; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // button3 + // + this.button3.Location = new System.Drawing.Point(15, 598); + this.button3.Margin = new System.Windows.Forms.Padding(2); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(136, 84); + this.button3.TabIndex = 6; + this.button3.Text = "enable 2"; + this.button3.UseVisualStyleBackColor = true; + this.button3.Visible = false; + this.button3.Click += new System.EventHandler(this.button3_Click); + // + // button4 + // + this.button4.Location = new System.Drawing.Point(71, 203); + this.button4.Margin = new System.Windows.Forms.Padding(2); + this.button4.Name = "button4"; + this.button4.Size = new System.Drawing.Size(136, 84); + this.button4.TabIndex = 7; + this.button4.Text = "disable P2"; + this.button4.UseVisualStyleBackColor = true; + this.button4.Visible = false; + this.button4.Click += new System.EventHandler(this.button4_Click); + // + // tmrScanIn + // + this.tmrScanIn.Tick += new System.EventHandler(this.tmrScanIn_Tick); + // + // button5 + // + this.button5.Location = new System.Drawing.Point(71, 733); + this.button5.Margin = new System.Windows.Forms.Padding(2); + this.button5.Name = "button5"; + this.button5.Size = new System.Drawing.Size(136, 84); + this.button5.TabIndex = 8; + this.button5.Text = "Buffer"; + this.button5.UseVisualStyleBackColor = true; + this.button5.Visible = false; + this.button5.Click += new System.EventHandler(this.button5_Click); + // + // tmrDelay + // + this.tmrDelay.Interval = 500; + this.tmrDelay.Tick += new System.EventHandler(this.tmrDelay_Tick); + // + // lstTest + // + this.lstTest.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lstTest.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.900001F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lstTest.FormattingEnabled = true; + this.lstTest.HorizontalScrollbar = true; + this.lstTest.ItemHeight = 30; + this.lstTest.Location = new System.Drawing.Point(1933, 92); + this.lstTest.Margin = new System.Windows.Forms.Padding(2); + this.lstTest.Name = "lstTest"; + this.lstTest.Size = new System.Drawing.Size(486, 754); + this.lstTest.TabIndex = 9; + this.lstTest.Visible = false; + // + // button6 + // + this.button6.Location = new System.Drawing.Point(271, 733); + this.button6.Margin = new System.Windows.Forms.Padding(2); + this.button6.Name = "button6"; + this.button6.Size = new System.Drawing.Size(136, 84); + this.button6.TabIndex = 10; + this.button6.Text = "Show Params"; + this.button6.UseVisualStyleBackColor = true; + this.button6.Visible = false; + this.button6.Click += new System.EventHandler(this.button6_Click); + // + // grpFixture_1 + // + this.grpFixture_1.Controls.Add(this.label3); + this.grpFixture_1.Controls.Add(this.label2); + this.grpFixture_1.Controls.Add(this.lblFix_1_Operator); + this.grpFixture_1.Controls.Add(this.lblFix_1_SN); + this.grpFixture_1.Controls.Add(this.lblFix_1_Status); + this.grpFixture_1.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.grpFixture_1.Font = new System.Drawing.Font("Microsoft Sans Serif", 26.1F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.grpFixture_1.Location = new System.Drawing.Point(15, 77); + this.grpFixture_1.Margin = new System.Windows.Forms.Padding(2); + this.grpFixture_1.Name = "grpFixture_1"; + this.grpFixture_1.Padding = new System.Windows.Forms.Padding(2); + this.grpFixture_1.Size = new System.Drawing.Size(704, 500); + this.grpFixture_1.TabIndex = 12; + this.grpFixture_1.TabStop = false; + this.grpFixture_1.Text = "Fixture 1 HR"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.1F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label3.Location = new System.Drawing.Point(27, 349); + this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(97, 26); + this.label3.TabIndex = 4; + this.label3.Text = "Operator"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.1F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label2.Location = new System.Drawing.Point(19, 217); + this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(152, 26); + this.label2.TabIndex = 3; + this.label2.Text = "Serial Number"; + // + // lblFix_1_Operator + // + this.lblFix_1_Operator.AutoSize = true; + this.lblFix_1_Operator.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblFix_1_Operator.Location = new System.Drawing.Point(23, 387); + this.lblFix_1_Operator.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblFix_1_Operator.Name = "lblFix_1_Operator"; + this.lblFix_1_Operator.Size = new System.Drawing.Size(152, 55); + this.lblFix_1_Operator.TabIndex = 2; + this.lblFix_1_Operator.Text = "label2"; + // + // lblFix_1_SN + // + this.lblFix_1_SN.AutoSize = true; + this.lblFix_1_SN.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblFix_1_SN.Location = new System.Drawing.Point(23, 243); + this.lblFix_1_SN.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblFix_1_SN.Name = "lblFix_1_SN"; + this.lblFix_1_SN.Size = new System.Drawing.Size(152, 55); + this.lblFix_1_SN.TabIndex = 1; + this.lblFix_1_SN.Text = "label2"; + // + // lblFix_1_Status + // + this.lblFix_1_Status.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lblFix_1_Status.AutoSize = true; + this.lblFix_1_Status.BackColor = System.Drawing.Color.White; + this.lblFix_1_Status.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.lblFix_1_Status.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.lblFix_1_Status.Font = new System.Drawing.Font("Microsoft Sans Serif", 27.9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblFix_1_Status.Location = new System.Drawing.Point(23, 97); + this.lblFix_1_Status.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblFix_1_Status.Name = "lblFix_1_Status"; + this.lblFix_1_Status.Size = new System.Drawing.Size(241, 87); + this.lblFix_1_Status.TabIndex = 0; + this.lblFix_1_Status.Text = "label2"; + this.lblFix_1_Status.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // grpFixture_2 + // + this.grpFixture_2.Controls.Add(this.label4); + this.grpFixture_2.Controls.Add(this.label5); + this.grpFixture_2.Controls.Add(this.lblFix_2_Operator); + this.grpFixture_2.Controls.Add(this.lblFix_2_SN); + this.grpFixture_2.Controls.Add(this.lblFix_2_Status); + this.grpFixture_2.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.grpFixture_2.Font = new System.Drawing.Font("Microsoft Sans Serif", 26.1F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.grpFixture_2.Location = new System.Drawing.Point(772, 77); + this.grpFixture_2.Margin = new System.Windows.Forms.Padding(2); + this.grpFixture_2.Name = "grpFixture_2"; + this.grpFixture_2.Padding = new System.Windows.Forms.Padding(2); + this.grpFixture_2.Size = new System.Drawing.Size(704, 500); + this.grpFixture_2.TabIndex = 13; + this.grpFixture_2.TabStop = false; + this.grpFixture_2.Text = "Fixture 2 SV"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.1F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label4.Location = new System.Drawing.Point(27, 349); + this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(97, 26); + this.label4.TabIndex = 4; + this.label4.Text = "Operator"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.1F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label5.Location = new System.Drawing.Point(19, 217); + this.label5.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(152, 26); + this.label5.TabIndex = 3; + this.label5.Text = "Serial Number"; + // + // lblFix_2_Operator + // + this.lblFix_2_Operator.AutoSize = true; + this.lblFix_2_Operator.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblFix_2_Operator.Location = new System.Drawing.Point(23, 387); + this.lblFix_2_Operator.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblFix_2_Operator.Name = "lblFix_2_Operator"; + this.lblFix_2_Operator.Size = new System.Drawing.Size(152, 55); + this.lblFix_2_Operator.TabIndex = 2; + this.lblFix_2_Operator.Text = "label2"; + // + // lblFix_2_SN + // + this.lblFix_2_SN.AutoSize = true; + this.lblFix_2_SN.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblFix_2_SN.Location = new System.Drawing.Point(23, 243); + this.lblFix_2_SN.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblFix_2_SN.Name = "lblFix_2_SN"; + this.lblFix_2_SN.Size = new System.Drawing.Size(152, 55); + this.lblFix_2_SN.TabIndex = 1; + this.lblFix_2_SN.Text = "label2"; + // + // lblFix_2_Status + // + this.lblFix_2_Status.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lblFix_2_Status.AutoSize = true; + this.lblFix_2_Status.BackColor = System.Drawing.Color.White; + this.lblFix_2_Status.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.lblFix_2_Status.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.lblFix_2_Status.Font = new System.Drawing.Font("Microsoft Sans Serif", 27.9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblFix_2_Status.Location = new System.Drawing.Point(23, 97); + this.lblFix_2_Status.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblFix_2_Status.Name = "lblFix_2_Status"; + this.lblFix_2_Status.Size = new System.Drawing.Size(241, 87); + this.lblFix_2_Status.TabIndex = 0; + this.lblFix_2_Status.Text = "label2"; + this.lblFix_2_Status.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // serialPort3 + // + this.serialPort3.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(this.serialPort3_DataReceived); + // + // grpZebraTest + // + this.grpZebraTest.BackColor = System.Drawing.Color.White; + this.grpZebraTest.Controls.Add(this.lblTestScan); + this.grpZebraTest.Controls.Add(this.label7); + this.grpZebraTest.Controls.Add(this.btnClose); + this.grpZebraTest.Controls.Add(this.label6); + this.grpZebraTest.Controls.Add(this.pictureBox1); + this.grpZebraTest.Location = new System.Drawing.Point(751, 726); + this.grpZebraTest.Margin = new System.Windows.Forms.Padding(2); + this.grpZebraTest.Name = "grpZebraTest"; + this.grpZebraTest.Padding = new System.Windows.Forms.Padding(2); + this.grpZebraTest.Size = new System.Drawing.Size(453, 517); + this.grpZebraTest.TabIndex = 15; + this.grpZebraTest.TabStop = false; + this.grpZebraTest.Text = "Test Scan Box"; + this.grpZebraTest.Visible = false; + // + // lblTestScan + // + this.lblTestScan.BackColor = System.Drawing.Color.White; + this.lblTestScan.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.900001F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblTestScan.ForeColor = System.Drawing.Color.Black; + this.lblTestScan.Location = new System.Drawing.Point(20, 298); + this.lblTestScan.Margin = new System.Windows.Forms.Padding(1, 0, 1, 0); + this.lblTestScan.Name = "lblTestScan"; + this.lblTestScan.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0); + this.lblTestScan.Size = new System.Drawing.Size(412, 31); + this.lblTestScan.TabIndex = 9; + this.lblTestScan.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // label7 + // + this.label7.BackColor = System.Drawing.Color.White; + this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.900001F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label7.ForeColor = System.Drawing.Color.Black; + this.label7.Location = new System.Drawing.Point(20, 191); + this.label7.Margin = new System.Windows.Forms.Padding(1, 0, 1, 0); + this.label7.Name = "label7"; + this.label7.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0); + this.label7.Size = new System.Drawing.Size(412, 31); + this.label7.TabIndex = 4; + this.label7.Text = "BenchTop Devices, LLC"; + this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // btnClose + // + this.btnClose.BackColor = System.Drawing.Color.MistyRose; + this.btnClose.Location = new System.Drawing.Point(333, 457); + this.btnClose.Margin = new System.Windows.Forms.Padding(2); + this.btnClose.Name = "btnClose"; + this.btnClose.Size = new System.Drawing.Size(110, 51); + this.btnClose.TabIndex = 3; + this.btnClose.Text = "CLOSE"; + this.btnClose.UseVisualStyleBackColor = false; + this.btnClose.Click += new System.EventHandler(this.btnClose_Click); + // + // label6 + // + this.label6.BackColor = System.Drawing.Color.Black; + this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.900001F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label6.ForeColor = System.Drawing.Color.White; + this.label6.Location = new System.Drawing.Point(133, 237); + this.label6.Margin = new System.Windows.Forms.Padding(1, 0, 1, 0); + this.label6.Name = "label6"; + this.label6.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0); + this.label6.Size = new System.Drawing.Size(175, 31); + this.label6.TabIndex = 2; + this.label6.Text = "Scan Barcode"; + this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // pictureBox1 + // + this.pictureBox1.Image = global::_8082_Waymo_PC.Properties.Resources.BTD_barcode; + this.pictureBox1.Location = new System.Drawing.Point(153, 37); + this.pictureBox1.Margin = new System.Windows.Forms.Padding(2); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(134, 139); + this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox1.TabIndex = 0; + this.pictureBox1.TabStop = false; + // + // grpOperator + // + this.grpOperator.BackColor = System.Drawing.SystemColors.Highlight; + this.grpOperator.Controls.Add(this.btnOperClose); + this.grpOperator.Controls.Add(this.txtOperator); + this.grpOperator.Controls.Add(this.label11); + this.grpOperator.Controls.Add(this.label12); + this.grpOperator.Controls.Add(this.button8); + this.grpOperator.Location = new System.Drawing.Point(496, 659); + this.grpOperator.Margin = new System.Windows.Forms.Padding(2); + this.grpOperator.Name = "grpOperator"; + this.grpOperator.Padding = new System.Windows.Forms.Padding(2); + this.grpOperator.Size = new System.Drawing.Size(540, 517); + this.grpOperator.TabIndex = 16; + this.grpOperator.TabStop = false; + this.grpOperator.Text = "Operator Assign"; + this.grpOperator.Visible = false; + // + // btnOperClose + // + this.btnOperClose.BackColor = System.Drawing.Color.MistyRose; + this.btnOperClose.Location = new System.Drawing.Point(384, 455); + this.btnOperClose.Margin = new System.Windows.Forms.Padding(2); + this.btnOperClose.Name = "btnOperClose"; + this.btnOperClose.Size = new System.Drawing.Size(110, 51); + this.btnOperClose.TabIndex = 8; + this.btnOperClose.Text = "CLOSE"; + this.btnOperClose.UseVisualStyleBackColor = false; + this.btnOperClose.Click += new System.EventHandler(this.btnOperClose_Click); + // + // txtOperator + // + this.txtOperator.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtOperator.Location = new System.Drawing.Point(37, 85); + this.txtOperator.Margin = new System.Windows.Forms.Padding(2); + this.txtOperator.MaxLength = 20; + this.txtOperator.Name = "txtOperator"; + this.txtOperator.Size = new System.Drawing.Size(467, 44); + this.txtOperator.TabIndex = 7; + this.txtOperator.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.1F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label11.ForeColor = System.Drawing.Color.White; + this.label11.Location = new System.Drawing.Point(188, 34); + this.label11.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(139, 26); + this.label11.TabIndex = 6; + this.label11.Text = "Operator Info"; + // + // label12 + // + this.label12.BackColor = System.Drawing.Color.White; + this.label12.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label12.ForeColor = System.Drawing.Color.Black; + this.label12.Location = new System.Drawing.Point(75, 216); + this.label12.Margin = new System.Windows.Forms.Padding(1, 0, 1, 0); + this.label12.Name = "label12"; + this.label12.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0); + this.label12.Size = new System.Drawing.Size(407, 80); + this.label12.TabIndex = 5; + this.label12.Text = "Scan or Enter Operator"; + this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // button8 + // + this.button8.BackColor = System.Drawing.Color.SpringGreen; + this.button8.Location = new System.Drawing.Point(31, 454); + this.button8.Margin = new System.Windows.Forms.Padding(2); + this.button8.Name = "button8"; + this.button8.Size = new System.Drawing.Size(165, 54); + this.button8.TabIndex = 2; + this.button8.Text = "Save"; + this.button8.UseVisualStyleBackColor = false; + this.button8.Click += new System.EventHandler(this.button8_Click); + // + // grpFixture_Prog + // + this.grpFixture_Prog.BackColor = System.Drawing.SystemColors.Highlight; + this.grpFixture_Prog.Controls.Add(this.cmbFix_2_Prg); + this.grpFixture_Prog.Controls.Add(this.cmbFix_1_Prg); + this.grpFixture_Prog.Controls.Add(this.button9); + this.grpFixture_Prog.Controls.Add(this.btnSavePrograms); + this.grpFixture_Prog.Controls.Add(this.label14); + this.grpFixture_Prog.Controls.Add(this.label13); + this.grpFixture_Prog.Location = new System.Drawing.Point(15, 742); + this.grpFixture_Prog.Margin = new System.Windows.Forms.Padding(2); + this.grpFixture_Prog.Name = "grpFixture_Prog"; + this.grpFixture_Prog.Padding = new System.Windows.Forms.Padding(2); + this.grpFixture_Prog.Size = new System.Drawing.Size(361, 434); + this.grpFixture_Prog.TabIndex = 17; + this.grpFixture_Prog.TabStop = false; + this.grpFixture_Prog.Text = "Fixture Settings"; + this.grpFixture_Prog.Visible = false; + // + // cmbFix_2_Prg + // + this.cmbFix_2_Prg.FormattingEnabled = true; + this.cmbFix_2_Prg.Location = new System.Drawing.Point(55, 249); + this.cmbFix_2_Prg.Margin = new System.Windows.Forms.Padding(2); + this.cmbFix_2_Prg.Name = "cmbFix_2_Prg"; + this.cmbFix_2_Prg.Size = new System.Drawing.Size(233, 33); + this.cmbFix_2_Prg.TabIndex = 9; + // + // cmbFix_1_Prg + // + this.cmbFix_1_Prg.FormattingEnabled = true; + this.cmbFix_1_Prg.Location = new System.Drawing.Point(55, 97); + this.cmbFix_1_Prg.Margin = new System.Windows.Forms.Padding(2); + this.cmbFix_1_Prg.Name = "cmbFix_1_Prg"; + this.cmbFix_1_Prg.Size = new System.Drawing.Size(233, 33); + this.cmbFix_1_Prg.TabIndex = 8; + // + // button9 + // + this.button9.BackColor = System.Drawing.Color.MistyRose; + this.button9.Location = new System.Drawing.Point(229, 366); + this.button9.Margin = new System.Windows.Forms.Padding(2); + this.button9.Name = "button9"; + this.button9.Size = new System.Drawing.Size(110, 51); + this.button9.TabIndex = 7; + this.button9.Text = "CLOSE"; + this.button9.UseVisualStyleBackColor = false; + this.button9.Click += new System.EventHandler(this.button9_Click); + // + // btnSavePrograms + // + this.btnSavePrograms.BackColor = System.Drawing.Color.SpringGreen; + this.btnSavePrograms.Location = new System.Drawing.Point(4, 362); + this.btnSavePrograms.Margin = new System.Windows.Forms.Padding(2); + this.btnSavePrograms.Name = "btnSavePrograms"; + this.btnSavePrograms.Size = new System.Drawing.Size(165, 54); + this.btnSavePrograms.TabIndex = 6; + this.btnSavePrograms.Text = "Save/Exit"; + this.btnSavePrograms.UseVisualStyleBackColor = false; + this.btnSavePrograms.Click += new System.EventHandler(this.btnSavePrograms_Click); + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.1F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label14.Location = new System.Drawing.Point(50, 221); + this.label14.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(253, 26); + this.label14.TabIndex = 5; + this.label14.Text = "Select Fixture 2 Program"; + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.1F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label13.Location = new System.Drawing.Point(50, 66); + this.label13.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(253, 26); + this.label13.TabIndex = 4; + this.label13.Text = "Select Fixture 1 Program"; + // + // lblMessage + // + this.lblMessage.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lblMessage.AutoSize = true; + this.lblMessage.BackColor = System.Drawing.Color.White; + this.lblMessage.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.lblMessage.Font = new System.Drawing.Font("Microsoft Sans Serif", 27.9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblMessage.Location = new System.Drawing.Point(476, 580); + this.lblMessage.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblMessage.Name = "lblMessage"; + this.lblMessage.Size = new System.Drawing.Size(0, 85); + this.lblMessage.TabIndex = 19; + this.lblMessage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // grpSN_Verify + // + this.grpSN_Verify.BackColor = System.Drawing.SystemColors.Highlight; + this.grpSN_Verify.Controls.Add(this.label20); + this.grpSN_Verify.Controls.Add(this.txtSV_New); + this.grpSN_Verify.Controls.Add(this.txtHR_New); + this.grpSN_Verify.Controls.Add(this.lblSV_Current); + this.grpSN_Verify.Controls.Add(this.lblHR_Current); + this.grpSN_Verify.Controls.Add(this.label19); + this.grpSN_Verify.Controls.Add(this.label18); + this.grpSN_Verify.Controls.Add(this.label17); + this.grpSN_Verify.Controls.Add(this.btnSave_ID); + this.grpSN_Verify.Controls.Add(this.btnClose_ID); + this.grpSN_Verify.Controls.Add(this.label16); + this.grpSN_Verify.Location = new System.Drawing.Point(152, 713); + this.grpSN_Verify.Margin = new System.Windows.Forms.Padding(2); + this.grpSN_Verify.Name = "grpSN_Verify"; + this.grpSN_Verify.Padding = new System.Windows.Forms.Padding(2); + this.grpSN_Verify.Size = new System.Drawing.Size(540, 396); + this.grpSN_Verify.TabIndex = 20; + this.grpSN_Verify.TabStop = false; + this.grpSN_Verify.Text = "SN Part ID"; + this.grpSN_Verify.Visible = false; + // + // label20 + // + this.label20.AutoSize = true; + this.label20.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.1F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label20.ForeColor = System.Drawing.Color.White; + this.label20.Location = new System.Drawing.Point(293, 203); + this.label20.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label20.Name = "label20"; + this.label20.Size = new System.Drawing.Size(64, 26); + this.label20.TabIndex = 16; + this.label20.Text = "NEW"; + // + // txtSV_New + // + this.txtSV_New.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.1F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtSV_New.Location = new System.Drawing.Point(358, 189); + this.txtSV_New.Margin = new System.Windows.Forms.Padding(2); + this.txtSV_New.MaxLength = 2; + this.txtSV_New.Name = "txtSV_New"; + this.txtSV_New.Size = new System.Drawing.Size(76, 50); + this.txtSV_New.TabIndex = 15; + this.txtSV_New.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtSV_New.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtSV_New_KeyPress); + // + // txtHR_New + // + this.txtHR_New.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.1F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtHR_New.Location = new System.Drawing.Point(358, 106); + this.txtHR_New.Margin = new System.Windows.Forms.Padding(2); + this.txtHR_New.MaxLength = 2; + this.txtHR_New.Name = "txtHR_New"; + this.txtHR_New.Size = new System.Drawing.Size(76, 50); + this.txtHR_New.TabIndex = 14; + this.txtHR_New.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtHR_New.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtHR_New_KeyPress); + // + // lblSV_Current + // + this.lblSV_Current.AutoSize = true; + this.lblSV_Current.BackColor = System.Drawing.Color.PowderBlue; + this.lblSV_Current.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.1F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblSV_Current.ForeColor = System.Drawing.Color.Black; + this.lblSV_Current.Location = new System.Drawing.Point(155, 189); + this.lblSV_Current.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblSV_Current.Name = "lblSV_Current"; + this.lblSV_Current.Size = new System.Drawing.Size(74, 44); + this.lblSV_Current.TabIndex = 13; + this.lblSV_Current.Text = "HR"; + // + // lblHR_Current + // + this.lblHR_Current.AutoSize = true; + this.lblHR_Current.BackColor = System.Drawing.Color.PowderBlue; + this.lblHR_Current.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.1F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblHR_Current.ForeColor = System.Drawing.Color.Black; + this.lblHR_Current.Location = new System.Drawing.Point(155, 106); + this.lblHR_Current.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblHR_Current.Name = "lblHR_Current"; + this.lblHR_Current.Size = new System.Drawing.Size(74, 44); + this.lblHR_Current.TabIndex = 12; + this.lblHR_Current.Text = "HR"; + // + // label19 + // + this.label19.AutoSize = true; + this.label19.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.1F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label19.ForeColor = System.Drawing.Color.White; + this.label19.Location = new System.Drawing.Point(28, 189); + this.label19.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label19.Name = "label19"; + this.label19.Size = new System.Drawing.Size(70, 44); + this.label19.TabIndex = 11; + this.label19.Text = "SV"; + // + // label18 + // + this.label18.AutoSize = true; + this.label18.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.1F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label18.ForeColor = System.Drawing.Color.White; + this.label18.Location = new System.Drawing.Point(28, 106); + this.label18.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(74, 44); + this.label18.TabIndex = 10; + this.label18.Text = "HR"; + // + // label17 + // + this.label17.AutoSize = true; + this.label17.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.1F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label17.ForeColor = System.Drawing.Color.White; + this.label17.Location = new System.Drawing.Point(295, 123); + this.label17.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(64, 26); + this.label17.TabIndex = 9; + this.label17.Text = "NEW"; + // + // btnSave_ID + // + this.btnSave_ID.BackColor = System.Drawing.Color.SpringGreen; + this.btnSave_ID.Location = new System.Drawing.Point(38, 269); + this.btnSave_ID.Margin = new System.Windows.Forms.Padding(2); + this.btnSave_ID.Name = "btnSave_ID"; + this.btnSave_ID.Size = new System.Drawing.Size(165, 54); + this.btnSave_ID.TabIndex = 8; + this.btnSave_ID.Text = "Save"; + this.btnSave_ID.UseVisualStyleBackColor = false; + this.btnSave_ID.Click += new System.EventHandler(this.btnSave_ID_Click); + // + // btnClose_ID + // + this.btnClose_ID.BackColor = System.Drawing.Color.MistyRose; + this.btnClose_ID.Location = new System.Drawing.Point(397, 272); + this.btnClose_ID.Margin = new System.Windows.Forms.Padding(2); + this.btnClose_ID.Name = "btnClose_ID"; + this.btnClose_ID.Size = new System.Drawing.Size(110, 51); + this.btnClose_ID.TabIndex = 7; + this.btnClose_ID.Text = "CLOSE"; + this.btnClose_ID.UseVisualStyleBackColor = false; + this.btnClose_ID.Click += new System.EventHandler(this.btnClose_ID_Click); + // + // label16 + // + this.label16.AutoSize = true; + this.label16.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.1F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label16.ForeColor = System.Drawing.Color.White; + this.label16.Location = new System.Drawing.Point(134, 55); + this.label16.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(119, 26); + this.label16.TabIndex = 6; + this.label16.Text = "CURRENT"; + // + // grpFlexFlowUrl + // + this.grpFlexFlowUrl.BackColor = System.Drawing.SystemColors.Highlight; + this.grpFlexFlowUrl.Controls.Add(this.btnCloseFlexUrl); + this.grpFlexFlowUrl.Controls.Add(this.txtNew_FlexFlowUrl); + this.grpFlexFlowUrl.Controls.Add(this.label8); + this.grpFlexFlowUrl.Controls.Add(this.label9); + this.grpFlexFlowUrl.Controls.Add(this.btnSaveFlexUrl); + this.grpFlexFlowUrl.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.grpFlexFlowUrl.Location = new System.Drawing.Point(79, 600); + this.grpFlexFlowUrl.Margin = new System.Windows.Forms.Padding(2); + this.grpFlexFlowUrl.Name = "grpFlexFlowUrl"; + this.grpFlexFlowUrl.Padding = new System.Windows.Forms.Padding(2); + this.grpFlexFlowUrl.Size = new System.Drawing.Size(1173, 470); + this.grpFlexFlowUrl.TabIndex = 21; + this.grpFlexFlowUrl.TabStop = false; + this.grpFlexFlowUrl.Text = "Set FlexFlow URL"; + this.grpFlexFlowUrl.Visible = false; + // + // btnCloseFlexUrl + // + this.btnCloseFlexUrl.BackColor = System.Drawing.Color.MistyRose; + this.btnCloseFlexUrl.Location = new System.Drawing.Point(979, 397); + this.btnCloseFlexUrl.Margin = new System.Windows.Forms.Padding(2); + this.btnCloseFlexUrl.Name = "btnCloseFlexUrl"; + this.btnCloseFlexUrl.Size = new System.Drawing.Size(167, 51); + this.btnCloseFlexUrl.TabIndex = 9; + this.btnCloseFlexUrl.Text = "CLOSE"; + this.btnCloseFlexUrl.UseVisualStyleBackColor = false; + this.btnCloseFlexUrl.Click += new System.EventHandler(this.btnCloseFlexUrl_Click); + // + // txtNew_FlexFlowUrl + // + this.txtNew_FlexFlowUrl.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtNew_FlexFlowUrl.Location = new System.Drawing.Point(25, 198); + this.txtNew_FlexFlowUrl.Margin = new System.Windows.Forms.Padding(2); + this.txtNew_FlexFlowUrl.MaxLength = 200; + this.txtNew_FlexFlowUrl.Name = "txtNew_FlexFlowUrl"; + this.txtNew_FlexFlowUrl.Size = new System.Drawing.Size(1125, 44); + this.txtNew_FlexFlowUrl.TabIndex = 8; + this.txtNew_FlexFlowUrl.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.1F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label8.ForeColor = System.Drawing.Color.White; + this.label8.Location = new System.Drawing.Point(424, 40); + this.label8.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(242, 44); + this.label8.TabIndex = 6; + this.label8.Text = " Current URL"; + // + // label9 + // + this.label9.BackColor = System.Drawing.Color.White; + this.label9.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label9.ForeColor = System.Drawing.Color.Black; + this.label9.Location = new System.Drawing.Point(375, 249); + this.label9.Margin = new System.Windows.Forms.Padding(1, 0, 1, 0); + this.label9.Name = "label9"; + this.label9.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0); + this.label9.Size = new System.Drawing.Size(407, 80); + this.label9.TabIndex = 5; + this.label9.Text = "Enter New URL"; + this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // btnSaveFlexUrl + // + this.btnSaveFlexUrl.BackColor = System.Drawing.Color.SpringGreen; + this.btnSaveFlexUrl.Location = new System.Drawing.Point(31, 395); + this.btnSaveFlexUrl.Margin = new System.Windows.Forms.Padding(2); + this.btnSaveFlexUrl.Name = "btnSaveFlexUrl"; + this.btnSaveFlexUrl.Size = new System.Drawing.Size(165, 54); + this.btnSaveFlexUrl.TabIndex = 2; + this.btnSaveFlexUrl.Text = "Save"; + this.btnSaveFlexUrl.UseVisualStyleBackColor = false; + this.btnSaveFlexUrl.Click += new System.EventHandler(this.btnSaveFlexUrl_Click); + // + // grpSetComPorts + // + this.grpSetComPorts.BackColor = System.Drawing.SystemColors.Highlight; + this.grpSetComPorts.Controls.Add(this.txtZebra); + this.grpSetComPorts.Controls.Add(this.label21); + this.grpSetComPorts.Controls.Add(this.btnCloseComports); + this.grpSetComPorts.Controls.Add(this.txtReadyCom); + this.grpSetComPorts.Controls.Add(this.label10); + this.grpSetComPorts.Controls.Add(this.btnSaveCom); + this.grpSetComPorts.Location = new System.Drawing.Point(585, 387); + this.grpSetComPorts.Margin = new System.Windows.Forms.Padding(2); + this.grpSetComPorts.Name = "grpSetComPorts"; + this.grpSetComPorts.Padding = new System.Windows.Forms.Padding(2); + this.grpSetComPorts.Size = new System.Drawing.Size(946, 470); + this.grpSetComPorts.TabIndex = 22; + this.grpSetComPorts.TabStop = false; + this.grpSetComPorts.Text = "Set Comports"; + this.grpSetComPorts.Visible = false; + // + // txtZebra + // + this.txtZebra.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; + this.txtZebra.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtZebra.Location = new System.Drawing.Point(334, 239); + this.txtZebra.Margin = new System.Windows.Forms.Padding(2); + this.txtZebra.MaxLength = 200; + this.txtZebra.Name = "txtZebra"; + this.txtZebra.Size = new System.Drawing.Size(151, 44); + this.txtZebra.TabIndex = 11; + this.txtZebra.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // label21 + // + this.label21.AutoSize = true; + this.label21.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.1F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label21.ForeColor = System.Drawing.Color.White; + this.label21.Location = new System.Drawing.Point(16, 234); + this.label21.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label21.Name = "label21"; + this.label21.Size = new System.Drawing.Size(318, 44); + this.label21.TabIndex = 10; + this.label21.Text = "Scanner Comport"; + // + // btnCloseComports + // + this.btnCloseComports.BackColor = System.Drawing.Color.MistyRose; + this.btnCloseComports.Location = new System.Drawing.Point(817, 395); + this.btnCloseComports.Margin = new System.Windows.Forms.Padding(2); + this.btnCloseComports.Name = "btnCloseComports"; + this.btnCloseComports.Size = new System.Drawing.Size(110, 51); + this.btnCloseComports.TabIndex = 9; + this.btnCloseComports.Text = "CLOSE"; + this.btnCloseComports.UseVisualStyleBackColor = false; + this.btnCloseComports.Click += new System.EventHandler(this.btnCloseComports_Click); + // + // txtReadyCom + // + this.txtReadyCom.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; + this.txtReadyCom.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtReadyCom.Location = new System.Drawing.Point(297, 122); + this.txtReadyCom.Margin = new System.Windows.Forms.Padding(2); + this.txtReadyCom.MaxLength = 200; + this.txtReadyCom.Name = "txtReadyCom"; + this.txtReadyCom.Size = new System.Drawing.Size(151, 44); + this.txtReadyCom.TabIndex = 7; + this.txtReadyCom.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.1F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label10.ForeColor = System.Drawing.Color.White; + this.label10.Location = new System.Drawing.Point(16, 118); + this.label10.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(286, 44); + this.label10.TabIndex = 6; + this.label10.Text = "Ready Comport"; + // + // btnSaveCom + // + this.btnSaveCom.BackColor = System.Drawing.Color.SpringGreen; + this.btnSaveCom.Location = new System.Drawing.Point(31, 395); + this.btnSaveCom.Margin = new System.Windows.Forms.Padding(2); + this.btnSaveCom.Name = "btnSaveCom"; + this.btnSaveCom.Size = new System.Drawing.Size(165, 54); + this.btnSaveCom.TabIndex = 2; + this.btnSaveCom.Text = "Save"; + this.btnSaveCom.UseVisualStyleBackColor = false; + this.btnSaveCom.Click += new System.EventHandler(this.btnSaveCom_Click); + // + // txtFlexError + // + this.txtFlexError.BackColor = System.Drawing.Color.Red; + this.txtFlexError.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtFlexError.ForeColor = System.Drawing.Color.White; + this.txtFlexError.Location = new System.Drawing.Point(15, 695); + this.txtFlexError.Margin = new System.Windows.Forms.Padding(2); + this.txtFlexError.Multiline = true; + this.txtFlexError.Name = "txtFlexError"; + this.txtFlexError.ReadOnly = true; + this.txtFlexError.Size = new System.Drawing.Size(751, 324); + this.txtFlexError.TabIndex = 23; + this.txtFlexError.Visible = false; + // + // grpChamberTest + // + this.grpChamberTest.BackColor = System.Drawing.Color.Aqua; + this.grpChamberTest.Controls.Add(this.btnCloseChamber); + this.grpChamberTest.Controls.Add(this.lblChamberStatus); + this.grpChamberTest.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.1F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.grpChamberTest.Location = new System.Drawing.Point(1535, 91); + this.grpChamberTest.Margin = new System.Windows.Forms.Padding(2); + this.grpChamberTest.Name = "grpChamberTest"; + this.grpChamberTest.Padding = new System.Windows.Forms.Padding(2); + this.grpChamberTest.Size = new System.Drawing.Size(1045, 407); + this.grpChamberTest.TabIndex = 24; + this.grpChamberTest.TabStop = false; + this.grpChamberTest.Text = "Chamber Test"; + this.grpChamberTest.Visible = false; + // + // btnCloseChamber + // + this.btnCloseChamber.BackColor = System.Drawing.Color.MistyRose; + this.btnCloseChamber.Location = new System.Drawing.Point(188, 306); + this.btnCloseChamber.Margin = new System.Windows.Forms.Padding(2); + this.btnCloseChamber.Name = "btnCloseChamber"; + this.btnCloseChamber.Size = new System.Drawing.Size(167, 80); + this.btnCloseChamber.TabIndex = 10; + this.btnCloseChamber.Text = "CLOSE"; + this.btnCloseChamber.UseVisualStyleBackColor = false; + this.btnCloseChamber.Click += new System.EventHandler(this.btnCloseChamber_Click); + // + // lblChamberStatus + // + this.lblChamberStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lblChamberStatus.AutoSize = true; + this.lblChamberStatus.BackColor = System.Drawing.Color.White; + this.lblChamberStatus.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.lblChamberStatus.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.lblChamberStatus.Font = new System.Drawing.Font("Microsoft Sans Serif", 27.9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblChamberStatus.Location = new System.Drawing.Point(17, 83); + this.lblChamberStatus.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblChamberStatus.Name = "lblChamberStatus"; + this.lblChamberStatus.Size = new System.Drawing.Size(241, 87); + this.lblChamberStatus.TabIndex = 1; + this.lblChamberStatus.Text = "label2"; + this.lblChamberStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // grpStation + // + this.grpStation.BackColor = System.Drawing.SystemColors.Highlight; + this.grpStation.Controls.Add(this.txtStationName); + this.grpStation.Controls.Add(this.button7); + this.grpStation.Controls.Add(this.btnSaveStation); + this.grpStation.Controls.Add(this.label22); + this.grpStation.Location = new System.Drawing.Point(2076, 502); + this.grpStation.Margin = new System.Windows.Forms.Padding(2); + this.grpStation.Name = "grpStation"; + this.grpStation.Padding = new System.Windows.Forms.Padding(2); + this.grpStation.Size = new System.Drawing.Size(486, 434); + this.grpStation.TabIndex = 18; + this.grpStation.TabStop = false; + this.grpStation.Text = "Station Name"; + this.grpStation.Visible = false; + // + // txtStationName + // + this.txtStationName.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtStationName.Location = new System.Drawing.Point(24, 159); + this.txtStationName.Name = "txtStationName"; + this.txtStationName.Size = new System.Drawing.Size(431, 44); + this.txtStationName.TabIndex = 8; + // + // button7 + // + this.button7.BackColor = System.Drawing.Color.MistyRose; + this.button7.Location = new System.Drawing.Point(345, 362); + this.button7.Margin = new System.Windows.Forms.Padding(2); + this.button7.Name = "button7"; + this.button7.Size = new System.Drawing.Size(110, 51); + this.button7.TabIndex = 7; + this.button7.Text = "CLOSE"; + this.button7.UseVisualStyleBackColor = false; + this.button7.Click += new System.EventHandler(this.button7_Click); + // + // btnSaveStation + // + this.btnSaveStation.BackColor = System.Drawing.Color.SpringGreen; + this.btnSaveStation.Location = new System.Drawing.Point(4, 362); + this.btnSaveStation.Margin = new System.Windows.Forms.Padding(2); + this.btnSaveStation.Name = "btnSaveStation"; + this.btnSaveStation.Size = new System.Drawing.Size(165, 54); + this.btnSaveStation.TabIndex = 6; + this.btnSaveStation.Text = "Save/Exit"; + this.btnSaveStation.UseVisualStyleBackColor = false; + this.btnSaveStation.Click += new System.EventHandler(this.btnSaveStation_Click); + // + // label22 + // + this.label22.AutoSize = true; + this.label22.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.125F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label22.Location = new System.Drawing.Point(99, 98); + this.label22.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label22.Name = "label22"; + this.label22.Size = new System.Drawing.Size(250, 31); + this.label22.TabIndex = 4; + this.label22.Text = "Enter Station Name"; + // + // txtFlexMsg + // + this.txtFlexMsg.Location = new System.Drawing.Point(1267, 948); + this.txtFlexMsg.Multiline = true; + this.txtFlexMsg.Name = "txtFlexMsg"; + this.txtFlexMsg.ScrollBars = System.Windows.Forms.ScrollBars.Both; + this.txtFlexMsg.Size = new System.Drawing.Size(1214, 317); + this.txtFlexMsg.TabIndex = 25; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(2589, 1277); + this.Controls.Add(this.txtFlexMsg); + this.Controls.Add(this.grpStation); + this.Controls.Add(this.grpChamberTest); + this.Controls.Add(this.grpFlexFlowUrl); + this.Controls.Add(this.txtFlexError); + this.Controls.Add(this.grpSetComPorts); + this.Controls.Add(this.grpOperator); + this.Controls.Add(this.grpFixture_Prog); + this.Controls.Add(this.grpSN_Verify); + this.Controls.Add(this.lblMessage); + this.Controls.Add(this.lstTest); + this.Controls.Add(this.grpZebraTest); + this.Controls.Add(this.grpFixture_2); + this.Controls.Add(this.grpFixture_1); + this.Controls.Add(this.button6); + this.Controls.Add(this.button5); + this.Controls.Add(this.button4); + this.Controls.Add(this.button3); + this.Controls.Add(this.button2); + this.Controls.Add(this.txtScan); + this.Controls.Add(this.button1); + this.Controls.Add(this.lstRead); + this.Controls.Add(this.label1); + this.Controls.Add(this.menuStrip1); + this.MainMenuStrip = this.menuStrip1; + this.Margin = new System.Windows.Forms.Padding(2); + this.Name = "Form1"; + this.Text = "_8082_Waymo_PC"; + this.Load += new System.EventHandler(this.Form1_Load); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.grpFixture_1.ResumeLayout(false); + this.grpFixture_1.PerformLayout(); + this.grpFixture_2.ResumeLayout(false); + this.grpFixture_2.PerformLayout(); + this.grpZebraTest.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.grpOperator.ResumeLayout(false); + this.grpOperator.PerformLayout(); + this.grpFixture_Prog.ResumeLayout(false); + this.grpFixture_Prog.PerformLayout(); + this.grpSN_Verify.ResumeLayout(false); + this.grpSN_Verify.PerformLayout(); + this.grpFlexFlowUrl.ResumeLayout(false); + this.grpFlexFlowUrl.PerformLayout(); + this.grpSetComPorts.ResumeLayout(false); + this.grpSetComPorts.PerformLayout(); + this.grpChamberTest.ResumeLayout(false); + this.grpChamberTest.PerformLayout(); + this.grpStation.ResumeLayout(false); + this.grpStation.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.IO.Ports.SerialPort serialPort1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; + private System.Windows.Forms.ListBox lstRead; + private System.Windows.Forms.SaveFileDialog saveFileDialog1; + private System.Windows.Forms.OpenFileDialog openFileDialog1; + private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.TextBox txtScan; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Button button3; + private System.Windows.Forms.Button button4; + private System.Windows.Forms.Timer tmrScanIn; + private System.Windows.Forms.Button button5; + private System.Windows.Forms.Timer tmrDelay; + private System.Windows.Forms.ListBox lstTest; + private System.Windows.Forms.Button button6; + private System.Windows.Forms.ToolStripMenuItem serialPortToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem communicationsToolStripMenuItem; + private System.IO.Ports.SerialPort serialPort2; + private System.Windows.Forms.ToolStripMenuItem readyManualOperationToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem readyONToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem readyOFFToolStripMenuItem; + private System.Windows.Forms.GroupBox grpFixture_1; + private System.Windows.Forms.Label lblFix_1_Status; + private System.Windows.Forms.Label lblFix_1_Operator; + private System.Windows.Forms.Label lblFix_1_SN; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.GroupBox grpFixture_2; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label lblFix_2_Operator; + private System.Windows.Forms.Label lblFix_2_SN; + private System.Windows.Forms.Label lblFix_2_Status; + private System.IO.Ports.SerialPort serialPort3; + private System.Windows.Forms.GroupBox grpZebraTest; + private System.Windows.Forms.PictureBox pictureBox1; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Button btnClose; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.GroupBox grpOperator; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.Button button8; + private System.Windows.Forms.TextBox txtOperator; + private System.Windows.Forms.ToolStripMenuItem programSettingsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem fixture1ToolStripMenuItem; + private System.Windows.Forms.GroupBox grpFixture_Prog; + private System.Windows.Forms.Button button9; + private System.Windows.Forms.Button btnSavePrograms; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.ComboBox cmbFix_2_Prg; + private System.Windows.Forms.ComboBox cmbFix_1_Prg; + private System.IO.Ports.SerialPort serialPort4; + private System.Windows.Forms.ToolStripMenuItem sNPartIdentifyToolStripMenuItem; + private System.Windows.Forms.Label lblMessage; + private System.Windows.Forms.GroupBox grpSN_Verify; + private System.Windows.Forms.Label lblSV_Current; + private System.Windows.Forms.Label lblHR_Current; + private System.Windows.Forms.Label label19; + private System.Windows.Forms.Label label18; + private System.Windows.Forms.Label label17; + private System.Windows.Forms.Button btnSave_ID; + private System.Windows.Forms.Button btnClose_ID; + private System.Windows.Forms.Label label16; + private System.Windows.Forms.TextBox txtHR_New; + private System.Windows.Forms.Label label20; + private System.Windows.Forms.TextBox txtSV_New; + private System.Windows.Forms.ToolStripMenuItem testScannerToolStripMenuItem; + private System.Windows.Forms.Label lblTestScan; + private System.Windows.Forms.ToolStripMenuItem flexFlowURLToolStripMenuItem; + private System.Windows.Forms.Button btnOperClose; + private System.Windows.Forms.GroupBox grpFlexFlowUrl; + private System.Windows.Forms.TextBox txtNew_FlexFlowUrl; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Button btnSaveFlexUrl; + private System.Windows.Forms.Button btnCloseFlexUrl; + private System.Windows.Forms.ToolStripMenuItem setComPortsToolStripMenuItem; + private System.Windows.Forms.GroupBox grpSetComPorts; + private System.Windows.Forms.TextBox txtZebra; + private System.Windows.Forms.Label label21; + private System.Windows.Forms.Button btnCloseComports; + private System.Windows.Forms.TextBox txtReadyCom; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Button btnSaveCom; + private System.Windows.Forms.TextBox txtFlexError; + private System.Windows.Forms.ToolStripMenuItem ChamberTest; + private System.Windows.Forms.ToolStripMenuItem hRToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem sVToolStripMenuItem; + private System.Windows.Forms.GroupBox grpChamberTest; + private System.Windows.Forms.Button btnCloseChamber; + private System.Windows.Forms.Label lblChamberStatus; + private System.Windows.Forms.ToolStripMenuItem tsEnableFlexFlow; + private System.Windows.Forms.ToolStripMenuItem debugToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem versionToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem stationNameToolStripMenuItem; + private System.Windows.Forms.GroupBox grpStation; + private System.Windows.Forms.TextBox txtStationName; + private System.Windows.Forms.Button button7; + private System.Windows.Forms.Button btnSaveStation; + private System.Windows.Forms.Label label22; + private System.Windows.Forms.TextBox txtFlexMsg; + } +} + diff --git a/Form1.cs b/Form1.cs new file mode 100644 index 0000000..63882e0 --- /dev/null +++ b/Form1.cs @@ -0,0 +1,1725 @@ +using System; +using System.Collections.Generic; +using System.Collections; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.IO.Ports; +using System.Drawing.Printing; +using System.Diagnostics; +using System.IO; +using System.Text.RegularExpressions; +using TonyFunctions; +using System.Net; + +namespace _8082_Waymo_PC +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + } + + private void Form1_Load(object sender, EventArgs e) + { + + Properties.Settings.Default.Save(); + Connect_Prev_I28(); + //Find_Comports(); + //Connect_Ready_Port(); + //Connect_Zebra_Port(); + //Connect_DebBug(); + System.IO.Directory.CreateDirectory("c:\\BTD\\Waymo"); + this.WindowState = FormWindowState.Maximized; + txtScan.Focus(); + Settings_On_Startup(); + + tsEnableFlexFlow.Click += TsEnableFlexFlow_Click; + } + + + + #region Define Variables + bool blnConnectedToI28 = false; + bool blnReadyMatched = false;//indicates that previous com was in list + bool blnFix_1_Enabled = false;//used to confirm channel start is unassigned + bool blnFix_2_Enabled = false; + bool blnFix_1_Scanned = false;//used to toggle fixture scan + bool blnFix_2_Scanned = false;//used to toggle fixture scan + bool blnSerNumScanned = false;//used for first run thru + bool blnGather_Param = false;//trying to get consistant read + bool blnGather_Result = false; + bool blnTesting = false; //determines when to ignore file also when I28 is running + bool blnTesting_Fix_1 = false;//fixure one in use + bool blnTesting_Fix_2 = false;//fixure two in use + bool blnParamStart = false;//used to extract params + bool blnSendParam = false;//allows weeding + bool blnFixInfoComplete = false;//helps with first run thru + bool blnTestScan;//used to test scanner serial data recieved + bool blnHR = false;//used to determine correct serial # / Fixture + bool blnSV = false;//used to determine correct serial # / Fixture + bool blnChamberTest = false;//avoids data collection in serialport + bool blnChamActive = false;//used to know when to parse string. + // Properties.Settings.Default.EnableFlexFlow //used for when their network is down + string strScanned_Serial_Num;//scanned camera serial number + string strActiveSerial_Num;//Active Serial Under Test and Displayed on Status Box + string strTestString; + string strConnectInfo; + string strFolderPath = "c:\\BTD\\DMD-III Seq\\"; + string strFile_with_Path = Properties.Settings.Default.Default_File;//file to write data to + string strFileToRead; + string strReadyCom = Properties.Settings.Default.ReadyCom;//last used ready signal com port + string strI28_Com = Properties.Settings.Default.I28;//last used I28 Com + string strZebra_Com = Properties.Settings.Default.Zebra;//last used scanner com + string strDebugPort = Properties.Settings.Default.DebugPort;//used by me + string strFromScannerCom;//read into serial port + string strOperator = "Unknown";//operator name + string strFix_1_Prog = Properties.Settings.Default.Fix_1_Prog; + string strFix_2_Prog = Properties.Settings.Default.Fix_2_Prog; + string strHR_Check = Properties.Settings.Default.HR_ID;//used to determine correct serial # / Fixture + string strSV_Check = Properties.Settings.Default.SV_ID;//used to determine correct serial # / Fixture + + DateTime dtActiveTestStartTime; + DateTime dtActiveTestEndTime; + ArrayList CurrentConfig = new ArrayList(); + List Prog_Config = new List(); + #region Constants + //variables for common messages + string Ci = "IN TEST"; + string Cp = "TEST PASSED"; + string Cf = "TEST FAILED"; + string Cr = "FIXTURE READY"; + string Cn = "NOT READY"; + string Cs = "SCANNED"; + string Csb = "Stop Pushed";//error message sentinel + string Cpl = "Press Low";//error message sentinel + string Cph = "Press High";//error message sentinel + string Csl = "Severe Leak";//error message sentinel + #endregion + + + #endregion + + #region Methods + + public void Connect_Prev_I28() + { + serialPort1.Close(); + try + { + + serialPort1.BaudRate = 115200; + serialPort1.Handshake = Handshake.None; + serialPort1.PortName = strI28_Com; + serialPort1.NewLine = "\r\n"; + serialPort1.ReadTimeout = 1000; + serialPort1.Dispose(); + + serialPort1.Open(); + bool blnOpen = serialPort1.IsOpen; + serialPort1.DiscardOutBuffer(); + + serialPort1.WriteLine("Exit"); + serialPort1.WriteLine("I\\M\\Instrument Name"); + + + try + { + strTestString = serialPort1.ReadLine(); + } + catch (TimeoutException e) + { + LogText("exception:" + e.Message); + //MessageBox.Show("Communication Problem Connecting", "Error"); + + serialPort1.Close(); + + } + + + if (strTestString.Contains("I28")) + { + + blnConnectedToI28 = true; + serialPort1.NewLine = "\r\n"; + + //lstRead.Items.Add(strTemp); + + string[] strSPlit = TonyFunctions.T_Func.saSplit(strTestString, '='); + String strTrimmed = strSPlit[1].Substring(0, 8); + + + + strConnectInfo = ("Connected to: " + strTrimmed + " Using " + strI28_Com); + label1.Text = (strConnectInfo); + serialPort1.WriteLine("SERVICE\\B\\SET DEFAULT CUS. RES HDRS=YES"); + //String strTemp = serialPort1.ReadLine(); + + + serialPort1.ReadTimeout = 1000; + serialPort1.WriteLine("Exit"); + DisableProgram_1(); + DisableProgram_2(); + AutoSetComports(); + + + + } + else + { + Find_Comports(); + } + + + + } + catch (Exception e) + { + LogText("exception:" + e.Message); + Find_Comports(); + //MessageBox.Show("Verify Com Settings for Scanner and Ready Signal", "NO CONNECTION"); + } + + //AutoSetComports(); + + } + public void Find_Comports() + { + serialPort1.Close(); + //search for active comports + foreach (string s in SerialPort.GetPortNames()) + { + //toolStripComboBox_ComPorts.Items.Add(s); + //lstComList.Add(s); + + if (!blnConnectedToI28) + { + try + { + + serialPort1.BaudRate = 115200; + serialPort1.Handshake = Handshake.None; + serialPort1.PortName = s; + serialPort1.NewLine = "\r\n"; + serialPort1.ReadTimeout = 1000; + serialPort1.Dispose(); + + serialPort1.Open(); + bool blnOpen = serialPort1.IsOpen; + serialPort1.DiscardOutBuffer(); + + serialPort1.WriteLine("Exit"); + serialPort1.WriteLine("I\\M\\Instrument Name"); + + + try + { + strTestString = serialPort1.ReadLine(); + } + catch (TimeoutException e) + { + LogText("exception:" + e.Message); + //MessageBox.Show("Communication Problem Connecting", "Error"); + + serialPort1.Close(); + + } + + + if (strTestString!=null&& strTestString.Contains("I28")) + { + + blnConnectedToI28 = true; + serialPort1.NewLine = "\r\n"; + Properties.Settings.Default.I28 = strI28_Com; + Properties.Settings.Default.Save(); + + + //lstRead.Items.Add(strTemp); + + string[] strSPlit = TonyFunctions.T_Func.saSplit(strTestString, '='); + String strTrimmed = strSPlit[1].Substring(0, 8); + + + + strConnectInfo = ("Connected to: " + strTrimmed + " Using " + s); + label1.Text = (strConnectInfo); + serialPort1.WriteLine("SERVICE\\B\\SET DEFAULT CUS. RES HDRS=YES"); + //String strTemp = serialPort1.ReadLine(); + + + serialPort1.ReadTimeout = 1000; + serialPort1.WriteLine("Exit"); + AutoSetComports(); + DisableProgram_1(); + DisableProgram_2(); + + + + } + + + + } + catch (Exception e) + { + LogText("exception:" + e.Message); + //MessageBox.Show("Communication Problem Connecting", "Error"); + } + } + } + + if (!blnConnectedToI28) + { + DialogResult result = MessageBox.Show("Check Cables, Click Retry", "Warning", MessageBoxButtons.RetryCancel, MessageBoxIcon.Warning); + if (result == DialogResult.Retry) + { + Find_Comports(); + } + + else if (result == DialogResult.Cancel) + { + Close(); + } + + } + } + + + + + public void Connect_DebBug() + { + + foreach (string s in SerialPort.GetPortNames()) + { + + if (strDebugPort == s) + { + + + serialPort4.BaudRate = 115200; + serialPort4.Handshake = Handshake.None; + serialPort4.PortName = strDebugPort; + serialPort4.NewLine = "\r\n"; + serialPort4.ReadTimeout = 1000; + serialPort4.Dispose(); + + serialPort4.Open(); + bool blnOpen = serialPort4.IsOpen; + serialPort4.DiscardOutBuffer(); + sndbg("Debug Auto Connected"); + + } + } + + } + public void Settings_On_Startup() + { + grpFixture_1.BackColor = System.Drawing.Color.LightSteelBlue; + grpFixture_2.BackColor = System.Drawing.Color.LightSteelBlue; + + + lblFix_1_Operator.Text = ""; + lblFix_2_Operator.Text = ""; + lblFix_1_SN.Text = ""; + lblFix_2_SN.Text = ""; + lblFix_1_Status.Text = Cn; + lblFix_2_Status.Text = Cn; + DisableProgram_1(); + DisableProgram_2(); + tsEnableFlexFlow.Checked = Properties.Settings.Default.EnableFlexFlow; + } + public void sndbg(string strToSend) + { + if (serialPort4.IsOpen) + { + serialPort4.WriteLine(strToSend); + } + + } + + public void AutoSetComports() + { + + SetSer2(Properties.Settings.Default.ReadyCom); + SetSer3(Properties.Settings.Default.Zebra); + //SetSer4(Properties.Settings.Default.DebugPort); + } + public void SetSer2(string strComport)//ready signal + { + this.Invoke((MethodInvoker)(() => lstTest.Items.Add(strComport + " Ready"))); + try { + serialPort2.BaudRate = 9600; + serialPort2.Handshake = Handshake.None; + + serialPort2.NewLine = "\r\n"; + serialPort2.ReadTimeout = 1000; + serialPort2.Dispose(); + if (!serialPort2.IsOpen) + { + serialPort2.PortName = strComport; + serialPort2.Open(); + serialPort2.WriteLine("a"); + } + serialPort2.DiscardOutBuffer(); + blnReadyMatched = true; + if (serialPort2.IsOpen) + { + this.Invoke((MethodInvoker)(() => lstTest.Items.Add("Enable Port Open"))); + } + }catch(Exception e) + { + LogText("exception:" + e.Message); + MessageBox.Show("Comport Doesn't Exist for Ready", "NO CONNECTION"); + } + + } + public void SetSer3(string strComport)//Zebra + { + this.Invoke((MethodInvoker)(() => lstTest.Items.Add(strComport+" Scanner"))); + try + { + serialPort3.BaudRate = 9600; + serialPort3.Handshake = Handshake.None; + + serialPort3.NewLine = "\r\n"; + serialPort3.ReadTimeout = 1000; + serialPort3.Dispose(); + if (!serialPort3.IsOpen) + { + serialPort3.PortName = strComport; + serialPort3.Open(); + + } + serialPort3.DiscardOutBuffer(); + if (serialPort3.IsOpen) + { + + this.Invoke((MethodInvoker)(() => lstTest.Items.Add("Scanner Port Open"))); + + } + + } + catch (Exception e) + { + LogText("exception:" + e.Message); + MessageBox.Show("Comport Doesn't Exist for Scanner", "NO CONNECTION"); + } + + } + public void SetSer4(string strComport)//Debug + { + + serialPort4.BaudRate = 115200; + serialPort4.Handshake = Handshake.None; + serialPort4.PortName = strComport; + serialPort4.NewLine = "\r\n"; + serialPort4.ReadTimeout = 1000; + serialPort4.Dispose(); + + serialPort4.Open(); + bool blnOpen = serialPort4.IsOpen; + serialPort4.DiscardOutBuffer(); + sndbg("Debug Auto Connected"); + + } + + + public void DisableProgram_1() + { + blnTesting = false; + blnGather_Param = false; + blnGather_Result = false; + blnSendParam = false; + + serialPort1.WriteLine("Exit"); + + try + { + + + serialPort1.WriteLine("P1\\I\\1=Unassign all Prog"); + + blnFix_1_Enabled = false; + + if (blnReadyMatched) + { + serialPort2.WriteLine("a"); + } + + + + + } + catch (Exception e) + { + LogText("exception:" + e.Message); + + lstRead.Items.Add(e); + MessageBox.Show("Communication Error with I28", "Error"); + + } + + } + public void DisableProgram_2() + { + blnTesting = false; + blnGather_Param = false; + blnGather_Result = false; + blnSendParam = false; + + serialPort1.WriteLine("Exit"); + try + { + + + serialPort1.WriteLine("P2\\I\\7=Unassign all Prog"); + + blnFix_2_Enabled = false; + if (blnReadyMatched) + { + serialPort2.WriteLine("a"); + } + + } + catch (Exception e) + { + LogText("exception:" + e.Message); + lstRead.Items.Add(e); + MessageBox.Show("Communication Error with I28", "Error"); + + } + } + public void Enable_Fixture_1(string SerNum) + { + DisableProgram_2(); + + serialPort1.WriteLine("P"+ strFix_1_Prog+"\\I\\1=Start Channel"); + blnFix_1_Enabled = true; + string strFullPrg = "M\\S1TCAP=" + strFix_1_Prog; + serialPort1.WriteLine(strFullPrg); + //serialPort1.WriteLine("M\\S1TCAP=1"); + serialPort1.WriteLine("Barcode=" + SerNum); + Prog_Config.Clear();//clears list of parameters + blnGather_Param = true; + blnFix_1_Scanned = false; + //blnFix_2_Scanned = false; + strActiveSerial_Num = SerNum; + txtScan.Clear(); + strScanned_Serial_Num = ""; + serialPort2.WriteLine("A"); + this.Invoke((MethodInvoker)(() => lblFix_1_Status.Text = Cr)); + grpFixture_1.BackColor = System.Drawing.Color.LightSteelBlue; + + serialPort1.WriteLine("I\\S\\RS232 1 Report=Cur Prog Config"); + } + public void Enable_Fixture_2(string SerNum) + { + DisableProgram_1(); + + serialPort1.WriteLine("P" + strFix_2_Prog + "\\I\\7=Start Channel"); + blnFix_2_Enabled = true; + string strFullPrg = "M\\S1TCAP=" + strFix_2_Prog; + serialPort1.WriteLine(strFullPrg); + //serialPort1.WriteLine("M\\S1TCAP=2"); + serialPort1.WriteLine("Barcode=" + SerNum); + Prog_Config.Clear();//clears list of parameters + blnGather_Param = true; + //blnFix_1_Scanned = false; + blnFix_2_Scanned = false; + strActiveSerial_Num = SerNum; + txtScan.Clear(); + strScanned_Serial_Num = ""; + serialPort2.WriteLine("A"); + this.Invoke((MethodInvoker)(() => lblFix_2_Status.Text = Cr)); + grpFixture_2.BackColor = System.Drawing.Color.LightSteelBlue; + + serialPort1.WriteLine("I\\S\\RS232 1 Report=Cur Prog Config"); + } + + public void Enable_Fixture_Buffer() + { + if (CheckIfNetworkOrOffline()) + { + + if (strScanned_Serial_Num != "" && (blnFix_1_Scanned || blnFix_2_Scanned)) + { + + GetUnitInfo gi = new GetUnitInfo + { + strSerialNumber = strScanned_Serial_Num, + strStationName = Properties.Settings.Default.StationName, + strUserID = "admin", + }; + + + if (blnFix_1_Scanned) + { + this.Invoke((MethodInvoker)(() => lblMessage.Text = "getting response")); + LogText("getting Response"); + + var unitInfo = new GetUnitInfoResponse(gi); + if (unitInfo.IsOkay()) + { + LogText("unit1 is okay"); + this.Invoke((MethodInvoker)(() => lblMessage.Text = "0")); + txtFlexMsg.Text = ""; + //txtFlexMsg.Visible = false; + LogText(unitInfo.GetUnitInfoResult); + + // Check if Fixture on Waymo is available + Enable_Fixture_1(strScanned_Serial_Num); + //Enable_Fixture_1("strScanned_Serial_Num"); + LogText("enabling program 1"); + } + else + { + LogText("unit1 is not okay" + unitInfo.GetUnitInfoResult + unitInfo.Message); + + // ERROR: FlexFlow says part is not ready, Anthony reset Scans + this.Invoke((MethodInvoker)(() => lblFix_1_SN.Text = "")); + this.Invoke((MethodInvoker)(() => lblFix_1_Status.Text = Cn)); + DisableProgram_1(); + LogText("disabling program 1"); + this.Invoke((MethodInvoker)(() => lblMessage.Text = "Not Valid")); + // txtFlexMsg.Visible = true; + this.Invoke((MethodInvoker)(() => txtFlexMsg.Text = unitInfo.Message)); + + //txtFlexError.Visible = true; + //try { + // this.Invoke((MethodInvoker)(() => txtFlexError.Text = unitInfo.Message)); // same as below + //} + //catch (Exception e) { + // LogText("lblmsg:" + e.Message); + //} + + } + + } + if (blnFix_2_Scanned) + { + this.Invoke((MethodInvoker)(() => lblMessage.Text = "getting response")); + var unitInfo = new GetUnitInfoResponse(gi); + + if (unitInfo.IsOkay()) + { + LogText("unit2 is okay"); + + LogText(unitInfo.GetUnitInfoResult); + + this.Invoke((MethodInvoker)(() => lblMessage.Text = "0")); + txtFlexMsg.Text = ""; + //txtFlexMsg.Visible = false; + + + sndbg("Sending to Enable Fixture 2"); + Enable_Fixture_2(strScanned_Serial_Num); + LogText("enabling program 2"); + + } + else + { + LogText("unit2 is not okay" + unitInfo.GetUnitInfoResult + unitInfo.Message); + + // ERROR: FlexFlow says part is not ready, Anthony reset Scans + this.Invoke((MethodInvoker)(() => lblFix_2_SN.Text = "")); + this.Invoke((MethodInvoker)(() => lblFix_2_Status.Text = Cn)); + DisableProgram_2(); + LogText("disabling program 2"); + this.Invoke((MethodInvoker)(() => lblMessage.Text = "Not Valid")); + //txtFlexMsg.Visible = true; + this.Invoke((MethodInvoker)(() => txtFlexMsg.Text = unitInfo.Message)); + + + + //txtFlexError.Visible = true; + //try + //{ + // this.Invoke((MethodInvoker)(() => txtFlexError.Text = unitInfo.Message)); + //} + //catch (Exception e) + //{ + // LogText("lblmsg: " + e.Message); + //} + + } + } + } + } + else + { + var result = MessageBox.Show("No Internet Connection\r\n\r\nGo to [Program Settings], and disable FlexFlow if intentional. Otherwise if not connected due to error, check Connections and press Retry\r\n\r\nCancel to Exit Program","Communication Error",MessageBoxButtons.RetryCancel,MessageBoxIcon.Warning); + LogText("No Internet Connection"); + + if (result == DialogResult.Retry) + { + Enable_Fixture_Buffer(); + LogText("Enabled Fixture Buffer"); + } + else + { + + this.Invoke((MethodInvoker)delegate + { + // close the form on the forms thread + this.Close(); + }); + } + + + } + } + + public void Results_To_Send(string strTestResults) + { + if (blnFix_1_Enabled) + { + string[] I28Split = TonyFunctions.T_Func.saSplit(strTestResults, ' '); + + switch (I28Split[7]) + { + case "A"://accept + grpFixture_1.BackColor = System.Drawing.Color.LimeGreen; + this.Invoke((MethodInvoker)(() => lblFix_1_Status.Text = Cp)); + break; + case "R"://reject + grpFixture_1.BackColor = System.Drawing.Color.Red; + this.Invoke((MethodInvoker)(() => lblFix_1_Status.Text = Cf)); + break; + case "SI"://stop + grpFixture_1.BackColor = System.Drawing.Color.LightSteelBlue; + this.Invoke((MethodInvoker)(() => lblFix_1_Status.Text = Csb)); + break; + case "PL"://below pressure + grpFixture_1.BackColor = System.Drawing.Color.Red; + this.Invoke((MethodInvoker)(() => lblFix_1_Status.Text = Cpl)); + break; + case "PH"://above pressure + grpFixture_1.BackColor = System.Drawing.Color.Red; + this.Invoke((MethodInvoker)(() => lblFix_1_Status.Text = Cph)); + break; + case "SL"://severe leak + grpFixture_1.BackColor = System.Drawing.Color.Red; + this.Invoke((MethodInvoker)(() => lblFix_1_Status.Text = Csl)); + break; + + } + + SaveAndDump("HR", strTestResults, I28Split); //i28[33] should be barcode here, but is not. + + blnTesting = false; + blnTesting_Fix_1 = false; + DisableProgram_1(); + } + if (blnFix_2_Enabled) + { + string[] I28Split = TonyFunctions.T_Func.saSplit(strTestResults, ' '); + switch (I28Split[7]) + { + case "A"://accept + grpFixture_2.BackColor = System.Drawing.Color.LimeGreen; + this.Invoke((MethodInvoker)(() => lblFix_2_Status.Text = Cp)); + break; + case "R"://reject + grpFixture_2.BackColor = System.Drawing.Color.Red; + this.Invoke((MethodInvoker)(() => lblFix_2_Status.Text = Cf)); + break; + case "SI"://stop button + grpFixture_2.BackColor = System.Drawing.Color.LightSteelBlue; + this.Invoke((MethodInvoker)(() => lblFix_2_Status.Text = Csb)); + break; + case "PL"://below pressure + grpFixture_2.BackColor = System.Drawing.Color.Red; + this.Invoke((MethodInvoker)(() => lblFix_2_Status.Text = Cpl)); + break; + case "PH"://above pressure + grpFixture_2.BackColor = System.Drawing.Color.Red; + this.Invoke((MethodInvoker)(() => lblFix_2_Status.Text = Cph)); + break; + case "SL"://severe leak + grpFixture_2.BackColor = System.Drawing.Color.Red; + this.Invoke((MethodInvoker)(() => lblFix_2_Status.Text = Csl)); + break; + } + + + SaveAndDump("SV", strTestResults, I28Split); //i28[33] should be barcode here, but is not. + + + blnTesting = false; + blnTesting_Fix_2 = false; + DisableProgram_2(); + + + //lstTest.Items.Add(strTestResults); + + + } + sndbg("Results in, next is enable Fixture Buffer"); + Enable_Fixture_Buffer(); + blnGather_Result = false; + } + + private void SaveAndDump(string stationType, string strTestResults, string[] I28Split) + { + var serialNo = strActiveSerial_Num; //I28Split[33]; + SaveResult sr = new SaveResult + { + strStationType = stationType, + strSerialNumber = serialNo, + strTestResults = strTestResults, + strBenchtopRefNumber = I28Split[6], + strOperator = strOperator, + strStationName = Properties.Settings.Default.StationName, + dtStartBatchTimestamp = dtActiveTestStartTime.ToUniversalTime(), + dtEndBatchTimestamp = dtActiveTestEndTime.ToUniversalTime(), + strParameters = String.Join(Environment.NewLine, Prog_Config), + i28FlexStatus = new I28FlexStatus(I28Split[7]), + strDeltaValue = null, + strDeltaMinimum = Prog_Config[25].Split('=')[1].Split('\t')[0], + strDeltaMaximum = Prog_Config[26].Split('=')[1].Split('\t')[0], + strPTValue = null, + strPTMinimum = null, + strPTMaximum = null + }; + this.Invoke((MethodInvoker)(() => lblMessage.Text = "")); + + var savedResponse = new SaveResultResponse(sr); + if (!savedResponse.IsOkay()) + { + LogText("Save result okay"); + txtFlexError.Visible = true; + this.Invoke((MethodInvoker)(() => txtFlexError.Text = savedResponse.Message)); + } + + if (!sr.i28FlexStatus.error) + { + sr.strDeltaValue = I28Split[46]; + + sr.strPTValue = null; + int ptIndex = Array.IndexOf(I28Split, "FPR"); + if (ptIndex > 0) { + sr.strPTValue = I28Split[ptIndex +1]; + } + sr.strPTMinimum = Prog_Config[21].Split('=')[1].Split('\t')[0]; + sr.strPTMaximum = Prog_Config[23].Split('=')[1].Split('\t')[0]; + + LogText("flex status okay"); + LogText("i28split: " + String.Join(Environment.NewLine, I28Split)); + } else { + // Ensure Null + LogText("flex status error"); + } + + try { + sr.Dumpy(); + } + catch (Exception e) + { + LogText("exception:" + e.Message); + } + } + + public void Test_Gather(string strParameters) + { + Prog_Config.Add(strParameters); + } + + + public void Scan_Input(string strScan) + { + if (debugToolStripMenuItem.Checked) + { + this.Invoke((MethodInvoker)(() => lstTest.Items.Add("Something Scanned"))); + } + + txtFlexError.Visible = false; + //sndbg("something Scanned"); + if (strScan == "Fixture 1") + { + blnFix_1_Scanned = true; + blnFix_2_Scanned = false; + if (debugToolStripMenuItem.Checked) + { + this.Invoke((MethodInvoker)(() => lstTest.Items.Add("Fixture 1 Scanned"))); + } + } + + if (strScan == "Fixture 2") { + blnFix_2_Scanned = true; + blnFix_1_Scanned = false; + if (debugToolStripMenuItem.Checked) { + this.Invoke((MethodInvoker)(() => lstTest.Items.Add("Fixture 2 Scanned"))); + } + } + + if(!strScan.Contains("Fixture")) { + strScanned_Serial_Num = strScan; + blnSerNumScanned = true; + if (debugToolStripMenuItem.Checked) { + this.Invoke((MethodInvoker)(() => lstTest.Items.Add("Serial # Scanned"))); + } + } + + if (!blnTesting_Fix_1 && blnFix_1_Scanned && blnSerNumScanned) { + if(Check_HR(strScanned_Serial_Num)) { + this.Invoke((MethodInvoker)(() => lblFix_1_Status.Text = Cs)); + grpFixture_1.BackColor = System.Drawing.Color.LightSteelBlue; + this.Invoke((MethodInvoker)(() => lblFix_1_SN.Text = "")); + this.Invoke((MethodInvoker)(() => lblFix_1_Operator.Text = "")); + blnFixInfoComplete=true; + + if (!blnTesting_Fix_2) { + this.Invoke((MethodInvoker)(() => lblFix_2_Status.Text = Cn)); + grpFixture_2.BackColor = System.Drawing.Color.LightSteelBlue; + } + } + } + if (!blnTesting_Fix_2 && blnFix_2_Scanned && blnSerNumScanned) { + if (Check_SV(strScanned_Serial_Num)) { + this.Invoke((MethodInvoker)(() => lblFix_2_Status.Text = Cs)); + grpFixture_2.BackColor = System.Drawing.Color.LightSteelBlue; + this.Invoke((MethodInvoker)(() => lblFix_2_SN.Text = "")); + this.Invoke((MethodInvoker)(() => lblFix_2_Operator.Text = "")); + blnFixInfoComplete = true; + sndbg("Not in Test Fixture 2 Scan"); + if (!blnTesting_Fix_1) { + this.Invoke((MethodInvoker)(() => lblFix_1_Status.Text = Cn)); + grpFixture_1.BackColor = System.Drawing.Color.LightSteelBlue; + } + } + } + + if (!blnTesting&&blnFixInfoComplete) { + Enable_Fixture_Buffer(); + blnFixInfoComplete=false; + blnSerNumScanned = false; + } + + } + + public Boolean Check_HR(string strsernum) + { + string strToCheck = strsernum.Substring(3, 2); + if (strToCheck == strHR_Check) + { + this.Invoke((MethodInvoker)(() => lblMessage.Text = "")); + return true; + + } + else + { + blnFix_1_Scanned = false; + blnSerNumScanned = false; + strScanned_Serial_Num = ""; + this.Invoke((MethodInvoker)(() => lblMessage.Text = "Fixture/Part MisMatch")); + return false; + } + + } + public Boolean Check_SV(string strsernum) + { + string strToCheck = strsernum.Substring(3, 2); + if (strToCheck == strSV_Check) + { + this.Invoke((MethodInvoker)(() => lblMessage.Text = "")); + return true; + + } + else + { + blnFix_1_Scanned = false; + blnSerNumScanned = false; + strScanned_Serial_Num = ""; + this.Invoke((MethodInvoker)(() =>lblMessage.Text = "Fixture/Part MisMatch")); + return false; + } + + } + public void Fixture_Results(string strStatus) + { + if (blnFix_1_Enabled) + { + switch (strStatus) + { + case "In Test": + grpFixture_1.BackColor = System.Drawing.Color.Yellow; + this.Invoke((MethodInvoker)(() => lblFix_1_Status.Text = Ci)); + this.Invoke((MethodInvoker)(() => lblFix_1_SN.Text = strActiveSerial_Num)); + this.Invoke((MethodInvoker)(() => lblFix_1_Operator.Text = strOperator)); + blnTesting_Fix_1 = true; + serialPort2.WriteLine("a"); + + break; + + + } + + } + + if (blnFix_2_Enabled) + { + switch (strStatus) + { + case "In Test": + grpFixture_2.BackColor = System.Drawing.Color.Yellow; + this.Invoke((MethodInvoker)(() => lblFix_2_Status.Text = Ci)); + this.Invoke((MethodInvoker)(() => lblFix_2_SN.Text = strActiveSerial_Num)); + this.Invoke((MethodInvoker)(() => lblFix_2_Operator.Text = strOperator)); + blnTesting_Fix_2 = true; + + + serialPort2.WriteLine("a"); + + break; + + + } + + } + + } + public void ChamberTestResults(string strTestResults) + { + + string[] I28Split = TonyFunctions.T_Func.saSplit(strTestResults, ' '); + + switch (I28Split[7]) + { + case "A"://accept + grpChamberTest.BackColor = System.Drawing.Color.LimeGreen; + this.Invoke((MethodInvoker)(() => lblChamberStatus.Text = Cp)); + break; + case "R"://reject + grpChamberTest.BackColor = System.Drawing.Color.Red; + this.Invoke((MethodInvoker)(() => lblChamberStatus.Text = Cf)); + break; + case "SI"://stop + grpChamberTest.BackColor = System.Drawing.Color.LightSteelBlue; + this.Invoke((MethodInvoker)(() => lblFix_1_Status.Text = Csb)); + break; + case "PL"://below pressure + grpChamberTest.BackColor = System.Drawing.Color.Red; + this.Invoke((MethodInvoker)(() => lblChamberStatus.Text = Cpl)); + break; + case "PH"://above pressure + grpChamberTest.BackColor = System.Drawing.Color.Red; + this.Invoke((MethodInvoker)(() => lblChamberStatus.Text = Cph)); + break; + case "SL"://severe leak + grpChamberTest.BackColor = System.Drawing.Color.Red; + this.Invoke((MethodInvoker)(() => lblChamberStatus.Text = Csl)); + break; + + } + this.Invoke((MethodInvoker)(() => btnCloseChamber.Visible = true)); + blnChamActive = false; + + } + + + public void ReadFromDMD() + { + SaveFileDialog savefile = new SaveFileDialog(); + // set a default file name + savefile.FileName = "unknown.txt"; + // set filters - this can be done in properties as well + savefile.Filter = "Text files (*.txt)|*.txt"; + + savefile.InitialDirectory = strFolderPath; + + if (savefile.ShowDialog() == DialogResult.OK) + { + strFile_with_Path = savefile.FileName; + + } + if (blnConnectedToI28) + { + using (StreamWriter outputFile = new StreamWriter(strFile_with_Path)) + { + + outputFile.Close(); + + + } + serialPort1.DiscardInBuffer(); + lstRead.Items.Clear(); + try + { + serialPort1.WriteLine("[DumpDB"); + Thread.Sleep(300); + + while (serialPort1.BytesToRead != 0) + { + try + { + string strReadDmd = serialPort1.ReadLine(); + + if (!strReadDmd.Contains(";Waiting_")) + { + + this.Invoke((MethodInvoker)(() => lstRead.Items.Add(strReadDmd))); + using (StreamWriter outputFile = new StreamWriter(strFile_with_Path, true)) + { + + outputFile.WriteLine(strReadDmd); + + + } + } + + } + catch (TimeoutException e) + { + LogText("exception:" + e.Message); + serialPort1.Close(); + + } + + } + + } + catch (Exception e) + { + LogText("exception:" + e.Message); + MessageBox.Show("Communication Problem", "Error"); + + } + } + + + + } + + public void AddSeq() + { + openFileDialog1.InitialDirectory = strFolderPath; + if (openFileDialog1.ShowDialog() == DialogResult.OK) + { + strFileToRead = openFileDialog1.FileName; + } + lstRead.Items.Clear(); + + using (StreamReader sr = new StreamReader(strFileToRead)) + { + while (!sr.EndOfStream) + { + string strReadFile = sr.ReadLine(); + serialPort1.WriteLine(strReadFile); + this.Invoke((MethodInvoker)(() => lstRead.Items.Add(strReadFile))); + + } + } + + } + + +#endregion + + + + private void retrieveSequencesToolStripMenuItem_Click(object sender, EventArgs e) + { + ReadFromDMD(); + + } + + + + private void appendToolStripMenuItem_Click(object sender, EventArgs e) + { + AddSeq(); + } + + private void replaceToolStripMenuItem_Click(object sender, EventArgs e) + { + DialogResult dialogResult = MessageBox.Show("Are you sure you want to DELETE the Existing Sequences?", "Delete Existing Sequences", MessageBoxButtons.YesNo); + + if (dialogResult == DialogResult.Yes) + { + serialPort1.WriteLine("[clrdb"); + Thread.Sleep(2000); + AddSeq(); + } + else + { + this.Invoke((MethodInvoker)(() => lstRead.Items.Add("Delete and Send Aborted"))); + } + } + + private void exitToolStripMenuItem_Click(object sender, EventArgs e) + { + Close(); + } + + private void serialPort1_DataReceived(object sender, SerialDataReceivedEventArgs e) + { + if (!blnChamberTest) + { + int intBytesLeft = serialPort1.BytesToRead; + + while (intBytesLeft != 0) + { + string strFromI28 = serialPort1.ReadLine(); + this.Invoke((MethodInvoker)(() => lstRead.Items.Add(strFromI28))); + intBytesLeft = serialPort1.BytesToRead; + if (strFromI28.Contains("Start Streaming")) + { + dtActiveTestStartTime = DateTime.Now; + blnTesting = true; + //lstTest.Items.Add("In Test"); + Fixture_Results("In Test"); + this.Invoke((MethodInvoker)(() => lblMessage.Text = "")); + + } + if (strFromI28.Contains("Stop Streaming")) + { + dtActiveTestEndTime = DateTime.Now; + //lstTest.Items.Add("Stop Test"); + blnGather_Result = true; + // this.Invoke((MethodInvoker)(() => lblMessage.Text = "Compiling Data")); + + } + if (blnGather_Result) + { + LogText("serialResult: " + strFromI28); + string[] I28Split = TonyFunctions.T_Func.saSplit(strFromI28, '\t'); + if (I28Split[1] == "R") + { + Results_To_Send(strFromI28); + + } + } + + if (blnGather_Param) + { + if (strFromI28.Contains("Start, Current Program Config Report")) + { + LogText("serialResult: start"); + + blnSendParam = true; + + } + if (blnSendParam) + { + Test_Gather(strFromI28); + } + + if (strFromI28.Contains("Stop, Current Program Config Report")) + { + LogText("serialResult: stop"); + + blnSendParam = false; + blnGather_Param = false; + + } + + } + + + + + } + } + if (blnChamberTest) + { + int intBytesLeft = serialPort1.BytesToRead; + + while (intBytesLeft != 0) + { + string strFromI28 = serialPort1.ReadLine(); + //this.Invoke((MethodInvoker)(() => lstRead.Items.Add(strFromI28))); + intBytesLeft = serialPort1.BytesToRead; + if (strFromI28.Contains("Start Streaming")) + { + + this.Invoke((MethodInvoker)(() => btnCloseChamber.Visible = false)); + this.Invoke((MethodInvoker)(() => lblChamberStatus.Text = "In Test")); + this.Invoke((MethodInvoker)(() => lblMessage.Text = "")); + + } + if (strFromI28.Contains("Stop Streaming")) + { + blnChamActive = true; + // dtActiveTestEndTime = DateTime.Now; + //lstTest.Items.Add("Stop Test"); + // blnGather_Result = true; + // this.Invoke((MethodInvoker)(() => lblMessage.Text = "Compiling Data")); + + } + + if (blnChamActive) + { + string[] I28Split = TonyFunctions.T_Func.saSplit(strFromI28, '\t'); + LogText("serialResult: "); + + if (I28Split[1] == "R") + { + ChamberTestResults(strFromI28); + + } + + + } + + + } + } + + } + + private void button1_Click(object sender, EventArgs e) + { + + DisableProgram_1(); + } + + private void button2_Click(object sender, EventArgs e) + { + blnFix_1_Scanned = true; + Enable_Fixture_Buffer(); + } + + private void button3_Click(object sender, EventArgs e) + { + txtFlexError.Visible = true; + txtFlexError.Text= $"Error reading XML, please check your FlexFlow URL Setting ({Properties.Settings.Default.FlexURL}) is correct, or check the FlexFlow logs."; + } + + private void button4_Click(object sender, EventArgs e) + { + DisableProgram_2(); + } + + + private void button5_Click(object sender, EventArgs e) + { + int intBufferSize = serialPort1.BytesToRead; + lstRead.Items.Add(intBufferSize); + //serialPort1.DiscardInBuffer(); + + + } + + private void txtScan_TextChanged(object sender, EventArgs e) + { + tmrScanIn.Enabled = true; + + } + + private void tmrScanIn_Tick(object sender, EventArgs e) + { + Scan_Input(txtScan.Text); + tmrScanIn.Enabled = false; + } + + private void tmrDelay_Tick(object sender, EventArgs e) + { + tmrDelay.Enabled = false; + } + + private void button6_Click(object sender, EventArgs e) + { + foreach (string s in Prog_Config) + { + + //lstTest.Items.Add(s); + + } + } + + private void btnTestReady_Click(object sender, EventArgs e) + { + if (blnReadyMatched) + { + serialPort2.WriteLine("a"); + serialPort2.WriteLine("A"); + + } + + } + + private void btnSaveReadyCOM_Click(object sender, EventArgs e) + { + serialPort2.WriteLine("a"); + Properties.Settings.Default.ReadyCom = strReadyCom; + Properties.Settings.Default.Save(); + blnReadyMatched = true; + + } + + private void readyONToolStripMenuItem_Click_1(object sender, EventArgs e) + { + serialPort2.WriteLine("A"); + } + + private void readyOFFToolStripMenuItem_Click_1(object sender, EventArgs e) + { + serialPort2.WriteLine("a"); + } + + + + private void btnZebraReady_Click(object sender, EventArgs e) + { + grpZebraTest.Visible = true; + + } + + private void serialPort3_DataReceived(object sender, SerialDataReceivedEventArgs e) + { + try + { + strFromScannerCom = serialPort3.ReadLine(); + + if (grpZebraTest.Visible == false && grpOperator.Visible == false) + { + Scan_Input(strFromScannerCom); + } + + + + if (grpOperator.Visible == true) + { + this.Invoke((MethodInvoker)(() => txtOperator.Text = strFromScannerCom)); + + + } + + if (blnTestScan) + { + this.Invoke((MethodInvoker)(() => lblTestScan.Text = strFromScannerCom)); + + } + } + catch (Exception ex) + { + LogText("exception:" + ex.Message); + MessageBox.Show("Scan Error\r\n\r\nRetry Scan", "Error"); + } + + } + + + private void btnClose_Click(object sender, EventArgs e) + { + blnTestScan = false; + grpZebraTest.Visible = false; + } + + private void serialPortToolStripMenuItem_Click(object sender, EventArgs e) + { + + grpOperator.Visible = true; + } + + private void button8_Click(object sender, EventArgs e) + { + strOperator = txtOperator.Text; + grpOperator.Visible = false; + } + + private void fixture1ToolStripMenuItem_Click(object sender, EventArgs e) + { + int i = 0; + while (i != 98) + { + i++; + cmbFix_1_Prg.Items.Add(Convert.ToString(i)); + cmbFix_2_Prg.Items.Add(Convert.ToString(i)); + + } + + cmbFix_1_Prg.SelectedItem = Properties.Settings.Default.Fix_1_Prog; + cmbFix_2_Prg.SelectedItem = Properties.Settings.Default.Fix_2_Prog; + + grpFixture_Prog.Visible = true; + + } + + private void btnSavePrograms_Click(object sender, EventArgs e) + { + strFix_1_Prog = cmbFix_1_Prg.GetItemText(cmbFix_1_Prg.SelectedItem); + Properties.Settings.Default.Fix_1_Prog = strFix_1_Prog; + Properties.Settings.Default.Save(); + strFix_2_Prog = cmbFix_2_Prg.GetItemText(cmbFix_2_Prg.SelectedItem); + Properties.Settings.Default.Fix_2_Prog = strFix_2_Prog; + Properties.Settings.Default.Save(); + grpFixture_Prog.Visible = false; + } + + private void button9_Click(object sender, EventArgs e) + { + grpFixture_Prog.Visible = false; + } + + private void btnDebugClose_Click(object sender, EventArgs e) + { + Properties.Settings.Default.DebugPort = strDebugPort; + Properties.Settings.Default.Save(); + } + + private void sNPartIdentifyToolStripMenuItem_Click(object sender, EventArgs e) + { + this.Invoke((MethodInvoker)(() => lblHR_Current.Text = strHR_Check)); + this.Invoke((MethodInvoker)(() => lblSV_Current.Text = strSV_Check)); + grpSN_Verify.Visible = true; + } + + private void txtHR_New_KeyPress(object sender, KeyPressEventArgs e) + { + // allows only letters or numbers + + if (!char.IsLetterOrDigit(e.KeyChar) && e.KeyChar != (char)Keys.Back && e.KeyChar != (char)Keys.Delete) + { + + e.Handled = true; + + } + } + private void txtSV_New_KeyPress(object sender, KeyPressEventArgs e) + { + // allows only letters or numbers + + if (!char.IsLetterOrDigit(e.KeyChar) && e.KeyChar != (char)Keys.Back && e.KeyChar != (char)Keys.Delete) + { + + e.Handled = true; + + } + } + + private void btnSave_ID_Click(object sender, EventArgs e) + { + if (txtHR_New.Text != "") + { + strHR_Check = txtHR_New.Text; + Properties.Settings.Default.HR_ID = strHR_Check; + Properties.Settings.Default.Save(); + } + if (txtSV_New.Text != "") + { + strSV_Check = txtSV_New.Text; + Properties.Settings.Default.SV_ID = strSV_Check; + Properties.Settings.Default.Save(); + } + + grpSN_Verify.Visible = false; + txtHR_New.Text = ""; + txtSV_New.Text = ""; + + } + + private void btnClose_ID_Click(object sender, EventArgs e) + { + grpSN_Verify.Visible = false; + txtHR_New.Text = ""; + txtSV_New.Text = ""; + } + + private void testScannerToolStripMenuItem_Click(object sender, EventArgs e) + { + blnTestScan = true; + grpZebraTest.Visible = true; + } + + private void btnOperClose_Click(object sender, EventArgs e) + { + grpOperator.Visible = false; + } + + private void btnCloseFlexUrl_Click(object sender, EventArgs e) + { + grpFlexFlowUrl.Visible = false; + } + + private void flexFlowURLToolStripMenuItem_Click(object sender, EventArgs e) + { + grpFlexFlowUrl.Visible = true; + grpFlexFlowUrl.Text= Properties.Settings.Default.FlexURL;//URL for Flex Flow Stuff + //txtCur_FlexFlowUrl.Text = Properties.Settings.Default.FlexURL;//URL for Flex Flow Stuff + + } + + private void btnSaveFlexUrl_Click(object sender, EventArgs e) + { + if (txtNew_FlexFlowUrl.Text != "") + { + Properties.Settings.Default.FlexURL = txtNew_FlexFlowUrl.Text; + Properties.Settings.Default.Save(); + grpFlexFlowUrl.Visible = false; + } + } + + private void setComPortsToolStripMenuItem_Click(object sender, EventArgs e) + { + grpSetComPorts.Visible = true; + txtReadyCom.Text = Properties.Settings.Default.ReadyCom; + txtZebra.Text = Properties.Settings.Default.Zebra; + } + + private void btnSaveCom_Click(object sender, EventArgs e) + { + if (txtReadyCom.Text != "") + { + Properties.Settings.Default.ReadyCom = txtReadyCom.Text; + Properties.Settings.Default.Save(); + SetSer2(Properties.Settings.Default.ReadyCom); + } + + if (txtZebra.Text != "") + { + Properties.Settings.Default.Zebra = txtZebra.Text; + Properties.Settings.Default.Save(); + SetSer3(Properties.Settings.Default.Zebra); + } + grpSetComPorts.Visible = false; + } + + private void btnCloseComports_Click(object sender, EventArgs e) + { + grpSetComPorts.Visible = false; + } + + + + public static bool CheckIfNetworkOrOffline() + { + // TODO: @Anthony - I think you need to remove this to enable data being sent to their mgf-inspector + // when flexflow is disabled + if (!Properties.Settings.Default.EnableFlexFlow) + { + LogText("enable flexflow false"); + + return true; + } + try + { + using (var client = new WebClient()) + using (client.OpenRead("https://google.com/generate_204")) + LogText("got to google."); + + return true; + } + catch (Exception e) + { + LogText("exception:" + e.Message); + + return false; + } + } + + private void btnCloseChamber_Click(object sender, EventArgs e) + { + grpChamberTest.Visible = false; + blnChamberTest = false; + blnChamActive = false; + serialPort1.WriteLine("P10\\I\\1=Unassign all Prog"); + serialPort1.WriteLine("P11\\I\\1=Unassign all Prog"); + serialPort2.WriteLine("a"); + + + } + + private void hRToolStripMenuItem_Click(object sender, EventArgs e) + { + serialPort1.WriteLine("P10\\I\\1=Start Channel"); + blnFix_1_Enabled = true; + string strFullPrg = "M\\S1TCAP=10"; + serialPort1.WriteLine(strFullPrg); + blnChamberTest = true; + grpChamberTest.Visible = true; + serialPort2.WriteLine("A"); + grpChamberTest.Text = "HR Chamber Test"; + lblChamberStatus.Text = "Insert Empty HR Chamber"; + } + private void sVToolStripMenuItem_Click(object sender, EventArgs e) + { + serialPort1.WriteLine("P11\\I\\7=Start Channel"); + blnFix_1_Enabled = true; + string strFullPrg = "M\\S1TCAP=11"; + serialPort1.WriteLine(strFullPrg); + blnChamberTest = true; + grpChamberTest.Visible = true; + serialPort2.WriteLine("A"); + grpChamberTest.Text = "SV Chamber Test"; + lblChamberStatus.Text = "Insert Empty SV Chamber"; + + } + + private void TsEnableFlexFlow_Click(object sender, EventArgs e) + { + Properties.Settings.Default.EnableFlexFlow = tsEnableFlexFlow.Checked; + Properties.Settings.Default.Save(); + } + + private void debugToolStripMenuItem_CheckStateChanged(object sender, EventArgs e) + { + if (debugToolStripMenuItem.Checked) + { + lstTest.Visible = true; + } + else + { + lstTest.Visible = false; + } + } + + private void versionToolStripMenuItem_Click(object sender, EventArgs e) + { + MessageBox.Show("Version: " + Properties.Settings.Default.Version); + } + + private void stationNameToolStripMenuItem_Click(object sender, EventArgs e) + { + grpStation.Visible = true; + txtStationName.Text = Properties.Settings.Default.StationName; + } + + private void button7_Click(object sender, EventArgs e) + { + grpStation.Visible = false; + } + + private void btnSaveStation_Click(object sender, EventArgs e) + { + if (txtStationName.TextLength > 0) + { + Properties.Settings.Default.StationName = txtStationName.Text; + Properties.Settings.Default.Save(); + grpStation.Visible = false; + + } + else + { + MessageBox.Show("Enter a Value or Click Close"); + + } + } + + public static void LogText(string message) + { + if (Properties.Settings.Default.DebugLogs) + { + if (!Directory.Exists(Properties.Settings.Default.LogDirectory)) + { + Directory.CreateDirectory(Properties.Settings.Default.LogDirectory); + } + using (StreamWriter w = File.AppendText($"{Properties.Settings.Default.LogDirectory}\\log_form1.txt")) + { + w.Write("\r\nLog Entry : "); + w.WriteLine($"{DateTime.Now.ToLongTimeString()} {DateTime.Now.ToLongDateString()}"); + w.WriteLine($" :{message}"); + w.WriteLine("-------------------------------"); + } + } + } + } +} diff --git a/Form1.resx b/Form1.resx new file mode 100644 index 0000000..3c0d964 --- /dev/null +++ b/Form1.resx @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 218, 17 + + + 433, 17 + + + 702, 17 + + + 991, 15 + + + 1186, 15 + + + 1367, 15 + + + 1568, 15 + + + 1769, 15 + + \ No newline at end of file diff --git a/GetUnitInfo.cs b/GetUnitInfo.cs new file mode 100644 index 0000000..80e153f --- /dev/null +++ b/GetUnitInfo.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml; +using System.Xml.Linq; +using System.Xml.Serialization; + +namespace _8082_Waymo_PC +{ + public class GetUnitInfo + { + public string ACTION = "http://www.flextronics.com/FFTester20/GetUnitInfo"; + + public string strStationName { get; set; } + public string strSerialNumber { get; set; } + public string strUserID { get; set; } + + public string Body() + { + return String.Join( + Environment.NewLine, + $"{strSerialNumber}", + $"{strStationName}", + "", + $"{strUserID}" // See if needs to be set + ); + } + } + + public class GetUnitInfoResponse + { + [XmlElement] + public string GetUnitInfoResult { get; set; } + public string Message { get; set; } + + public GetUnitInfoResponse(GetUnitInfo gi) + { + // If Flex Flow is not enabled, don't make an API call, and set the messages appropriately. + if (!Properties.Settings.Default.EnableFlexFlow) + { + GetUnitInfoResult = "0"; + Message = "Skipping FlexFlow because Disabled"; + return; + } + + var response = FlexFlow.Send(gi.GetType().Name, gi.Body(), gi.ACTION); + // local variables because cant use class variable with TryGetResult + + var dict = XMLParser.ToDict(response); + if (dict == null) + { + GetUnitInfoResult = "-100"; + Message = $"Error reading XML, please check your FlexFlow URL Setting ({Properties.Settings.Default.FlexURL}) is correct, or check the FlexFlow logs."; + return; + } + + dict.TryGetValue("GetUnitInfoResult", out string lGUI); + GetUnitInfoResult = lGUI; + + Message = response; + + } + + public Boolean IsOkay() + { + /// If not okay, Message is error message NEED TO Display to screen. + if (GetUnitInfoResult == "0") + { + return true; + } + return false; + } + + } +} + + diff --git a/I28FlexStatus.cs b/I28FlexStatus.cs new file mode 100644 index 0000000..000d80f --- /dev/null +++ b/I28FlexStatus.cs @@ -0,0 +1,98 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace _8082_Waymo_PC +{ + public class I28FlexStatus + { + /// + /// The status to send to FlexFlow SaveResult + /// + public string flexStatus { get; set; } + /// + /// The status to send to Waymo as a single test parameter status + /// + public string parameterStatus { get; set; } + /// + /// The overall test status to send to Waymo + /// + public string outcome { get; set; } + /// + /// Whether there was an error, or the test finished to completion + /// + public bool error { get; set; } + /// + /// A human readable failure code to send as a Failure to Waymo + /// + public string failureCode { get; set; } + /// + /// A full details of the failure to send to Waymo, (explains failureCode in length) + /// + public string failureDetails { get; set; } + + public I28FlexStatus (string code) + { + switch (code.ToUpper()) + { + /* NON ERRORS */ + case "A": // Accept + flexStatus = "Passed"; + parameterStatus = "PASS"; + outcome = "TEST_PASS"; + error = false; + break; + case "R": // Reject + flexStatus = "Failed"; + parameterStatus = "FAIL"; + outcome = "TEST_FAIL"; + error = false; + break; + /* ERRORS */ + case "PL": // Below Pressure + flexStatus = "Failed"; + parameterStatus = "FAIL"; + outcome = "TEST_FAIL"; + error = true; + failureCode = "pressure_low"; + failureDetails = "Equipment reported error code PL, Pressure Low. Unable to run leak test."; + break; + case "SL": // Severe Leak + flexStatus = "Failed"; + parameterStatus = "FAIL"; + outcome = "TEST_FAIL"; + error = true; + failureCode = "severe_leak"; + failureDetails = "Equipment reported error code SL, Severe Leak. Unable to run leak test."; + break; + case "PH": // Above Pressure + flexStatus = "Failed"; + parameterStatus = "FAIL"; + outcome = "TEST_FAIL"; + error = true; + failureCode = "pressure_high"; + failureDetails = "Equipment reported error code PH, Pressure High. Unable to run leak test."; + break; + case "SI": // Stop Button + flexStatus = "Failed"; + parameterStatus = "FAIL"; + outcome = "TEST_FAIL"; + error = true; + failureCode = "test_stopped"; + failureDetails = "Operator pressed stop button, test aborted."; + break; + /* FALLBACK - Error */ + default: // No idea, just log it and fail. + flexStatus = "Failed"; + parameterStatus = "FAIL"; + outcome = "TEST_FAIL"; + error = true; + failureCode = "unknown_error"; + failureDetails = $"Encountered error code {code}, an unknown error has occurred."; + break; + } + } + } +} diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..1641966 --- /dev/null +++ b/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace _8082_Waymo_PC +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..264a922 --- /dev/null +++ b/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("_8082_Waymo_PC")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("_8082_Waymo_PC")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("695a8d3a-096e-42ea-aefb-632d6f9d9948")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs new file mode 100644 index 0000000..8cf18f8 --- /dev/null +++ b/Properties/Resources.Designer.cs @@ -0,0 +1,73 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace _8082_Waymo_PC.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("_8082_Waymo_PC.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap BTD_barcode { + get { + object obj = ResourceManager.GetObject("BTD barcode", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/Properties/Resources.resx b/Properties/Resources.resx new file mode 100644 index 0000000..4ff1085 --- /dev/null +++ b/Properties/Resources.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\BTD barcode.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs new file mode 100644 index 0000000..2233702 --- /dev/null +++ b/Properties/Settings.Designer.cs @@ -0,0 +1,203 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace _8082_Waymo_PC.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.3.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("COM7")] + public string ReadyCom { + get { + return ((string)(this["ReadyCom"])); + } + set { + this["ReadyCom"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("\"c:\\\\BTD\\\\DMD-III Seq\\\\\"")] + public string Default_File { + get { + return ((string)(this["Default_File"])); + } + set { + this["Default_File"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("COM6")] + public string I28 { + get { + return ((string)(this["I28"])); + } + set { + this["I28"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("COM8")] + public string Zebra { + get { + return ((string)(this["Zebra"])); + } + set { + this["Zebra"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("1")] + public string Fix_1_Prog { + get { + return ((string)(this["Fix_1_Prog"])); + } + set { + this["Fix_1_Prog"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("2")] + public string Fix_2_Prog { + get { + return ((string)(this["Fix_2_Prog"])); + } + set { + this["Fix_2_Prog"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("COM29")] + public string DebugPort { + get { + return ((string)(this["DebugPort"])); + } + set { + this["DebugPort"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("40")] + public string HR_ID { + get { + return ((string)(this["HR_ID"])); + } + set { + this["HR_ID"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("30")] + public string SV_ID { + get { + return ((string)(this["SV_ID"])); + } + set { + this["SV_ID"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("http://10.0.0.1/Burgundy/fftester20.asmx")] + public string FlexURL { + get { + return ((string)(this["FlexURL"])); + } + set { + this["FlexURL"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool EnableFlexFlow { + get { + return ((bool)(this["EnableFlexFlow"])); + } + set { + this["EnableFlexFlow"] = value; + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("V1-U")] + public string Version { + get { + return ((string)(this["Version"])); + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("FLEX-M4-CR2-LEAK TEST")] + public string StationName { + get { + return ((string)(this["StationName"])); + } + set { + this["StationName"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool DebugLogs { + get { + return ((bool)(this["DebugLogs"])); + } + set { + this["DebugLogs"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("c:\\\\benchtoplogs")] + public string LogDirectory { + get { + return ((string)(this["LogDirectory"])); + } + set { + this["LogDirectory"] = value; + } + } + } +} diff --git a/Properties/Settings.settings b/Properties/Settings.settings new file mode 100644 index 0000000..7f58067 --- /dev/null +++ b/Properties/Settings.settings @@ -0,0 +1,51 @@ + + + + + + COM7 + + + "c:\\BTD\\DMD-III Seq\\" + + + COM6 + + + COM8 + + + 1 + + + 2 + + + COM29 + + + 40 + + + 30 + + + http://10.0.0.1/Burgundy/fftester20.asmx + + + True + + + V1-U + + + FLEX-M4-CR2-LEAK TEST + + + True + + + c:\\benchtoplogs + + + \ No newline at end of file diff --git a/SaveResult.cs b/SaveResult.cs new file mode 100644 index 0000000..94b5de1 --- /dev/null +++ b/SaveResult.cs @@ -0,0 +1,205 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml; +using System.Xml.Serialization; + +namespace _8082_Waymo_PC +{ + public class SaveResult + { + public string ACTION = "http://www.flextronics.com/FFTester20/SaveResult"; + + public string strSerialNumber { get; set; } + public string strStationName { get; set; } + public string strStationType { get; set; } + + public DateTime dtStartBatchTimestamp { get; set; } + public DateTime dtEndBatchTimestamp { get; set; } + public string strOperator { get; set; } + public string strTestResults { get; set; } + public string strBenchtopRefNumber { get; set; } + public string strParameters { get; set; } // test parameters from serial + public I28FlexStatus i28FlexStatus { get; set; } + + public string strDeltaValue {get; set; } + public string strDeltaMinimum {get; set; } + public string strDeltaMaximum {get; set; } + public string strPTValue {get; set; } + public string strPTMinimum {get; set; } + public string strPTMaximum {get; set; } + + public string Body() + { + return String.Join( + Environment.NewLine, + "", + "", + $"", + " ", + $" ", + " ", + $" ", + $" ", + " ", + " ", + " ", + "", + "]]>", + "", + $"{strBenchtopRefNumber}" + ); + } + + public void Dumpy() + { + //Directory.CreateDirectory("C:\\dumpy"); // force make the dumpy directory + //Directory.CreateDirectory("C:\\dumpy\\inbox"); // force make the dumpy directory + LogText("to dumpy: " + strStationType + " " + strDeltaValue + " " + strDeltaMinimum + " " + strDeltaMaximum); + + var dump = String.Join( + Environment.NewLine, + "", + "", + $" {dtStartBatchTimestamp.ToUniversalTime().ToString("o")}", + $" {dtEndBatchTimestamp.ToUniversalTime().ToString("o")}", + $" {strSerialNumber}", + $" {Properties.Settings.Default.StationName}", + $" {strStationType.ToLower()}_leakdecay", // e.g.: sv_leakdecay + $" {i28FlexStatus.outcome}", + $" {strOperator}", + i28FlexStatus.error ? ErrorElement() : SuccessElement(), + "" + ); + var filename = $"C:\\dumpy\\inbox\\benchtop_8082_{dtStartBatchTimestamp.ToString("h_mm_ss")}.xml"; + File.WriteAllText(filename, dump); + } + + private string SuccessElement() + { + + return String.Join( + Environment.NewLine, + " ", + $" Delta Pa", + $" {i28FlexStatus.parameterStatus}", + $" {strDeltaValue}", + $" {strDeltaMinimum}", + $" {strDeltaMaximum}", + " ", + " ", + " Volumetric Pressure (mbar)", + $" {i28FlexStatus.parameterStatus}", + $" {strPTValue}", + $" {strPTMinimum}", + $" {strPTMaximum}", + " ", + " ", + " TEST_PARAMETERS.txt", + " TXT", + $" {base64(strParameters)}", + " "); + } + private string ErrorElement() + { + return String.Join( + Environment.NewLine, + "", + $"{i28FlexStatus.failureCode} ", + $"
{i28FlexStatus.failureDetails}
", + "
" + ); + } + + public string base64(string plainText) + { + var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText); + return System.Convert.ToBase64String(plainTextBytes); + } + public static void LogText(string message) + { + if (Properties.Settings.Default.DebugLogs) + { + if (!Directory.Exists(Properties.Settings.Default.LogDirectory)) + { + Directory.CreateDirectory(Properties.Settings.Default.LogDirectory); + } + using (StreamWriter w = File.AppendText($"{Properties.Settings.Default.LogDirectory}\\log_form1.txt")) + { + w.Write("\r\nLog Entry : "); + w.WriteLine($"{DateTime.Now.ToLongTimeString()} {DateTime.Now.ToLongDateString()}"); + w.WriteLine($" :{message}"); + w.WriteLine("-------------------------------"); + } + } + } + } + + + + public class SaveResultResponse + { + [XmlElement] + public string SaveResultResult { get; set; } + public string Message { get; set; } + public string strTestRefNo { get; set; } + + + public SaveResultResponse(SaveResult sr) + { + // If Flex Flow is not enabled, don't make an API call, and set the messages appropriately. + if (!Properties.Settings.Default.EnableFlexFlow) + { + SaveResultResult = "0"; + Message = "Skipping FlexFlow because Disabled"; + strTestRefNo = sr.strBenchtopRefNumber; + return; + } + + var response = FlexFlow.Send(sr.GetType().Name, sr.Body(), sr.ACTION); + var dict = XMLParser.ToDict(response); + if (dict == null) + { + SaveResultResult = "-100"; + Message = $"Error reading XML, please check your FlexFlow URL Setting ({Properties.Settings.Default.FlexURL}) is correct, or check the FlexFlow logs."; + return; + } + dict.TryGetValue("SaveResultResult", out string lSRR); + dict.TryGetValue("strTestRefNo", out string lTRN); + SaveResultResult = lSRR; + strTestRefNo = lTRN; + Message = response; // Just set message as response. + } + public Boolean IsOkay() + { + /// If not okay, Message is error message NEED TO Display to screen. + if (SaveResultResult == "0") + { + return true; + } + return false; + } + + public static void LogText(string message) + { + if (Properties.Settings.Default.DebugLogs) + { + if (!Directory.Exists(Properties.Settings.Default.LogDirectory)) + { + Directory.CreateDirectory(Properties.Settings.Default.LogDirectory); + } + using (StreamWriter w = File.AppendText($"{Properties.Settings.Default.LogDirectory}\\log_form1.txt")) + { + w.Write("\r\nLog Entry : "); + w.WriteLine($"{DateTime.Now.ToLongTimeString()} {DateTime.Now.ToLongDateString()}"); + w.WriteLine($" :{message}"); + w.WriteLine("-------------------------------"); + } + } + } + } +} diff --git a/T_Func.cs b/T_Func.cs new file mode 100644 index 0000000..4b2439f --- /dev/null +++ b/T_Func.cs @@ -0,0 +1,184 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; +using System.Text; + +namespace TonyFunctions +{ + + + public class T_Func + { + public static double caniseeit; + #region Conversions + /// + /// Converts to mm (inch) + /// + /// + /// + public static double in_to_mm(double toConvert) + { + double dblConverted = (toConvert / .03937007); + return dblConverted; + + } + /// + /// Converts to mm (inch) + /// + /// + /// + public static decimal in_to_mm(decimal toConvert) + { + decimal decConverted = (toConvert / (decimal).03937007); + return decConverted; + + + } + /// + /// Converts to Inches (mm) + /// + /// + /// + public static double mm_to_in(double toConvert) + { + double dblConverted = (toConvert * .03937007); + return dblConverted; + + + } + /// + /// Converts to Inches (mm) + /// + /// + /// + public static decimal mm_to_in(decimal toConvert) + { + decimal decConverted = (toConvert * (decimal).03937007); + return decConverted; + + + } + #endregion Conversions + + #region Area and Volume + + /// + /// Calculates Area of circle (Rad in inches) + /// + /// + /// + public static double Area_Circle_Rad_in(double dblRad) + { + double dblArea = (dblRad * 2) * Math.PI; + return dblArea; + + } + + /// + /// Calculates Area of circle (Rad in inches) + /// + /// + /// + public static decimal Area_Circle_Rad_in(decimal decRad) + { + decimal decArea = (decRad * 2) * (decimal)Math.PI; + return decArea; + + } + + /// + /// Calculates Volume of Cyl (Rad in inches,Height) + /// + /// + /// + public static double Vol_Cyl_Rad_in(double dblRad, double dblHgt) + { + double dblVolume = ((dblRad * 2) * Math.PI) * dblHgt; + return dblVolume; + + } + + /// + /// Calculates Volume of Cyl (Rad in inches,Height) + /// + /// + /// + public static decimal Vol_Cyl_Rad_in(decimal decRad, decimal decHgt) + { + decimal decVolume = ((decRad * 2) * (decimal)Math.PI) * decHgt; + return decVolume; + + } + + ///////// + /// + /// Calculates Area of circle (Dia in inches) + /// + /// + /// + public static double Area_Circle_Dia_in(double dblDia) + { + double dblArea = dblDia * Math.PI; + return dblArea; + + } + + /// + /// Calculates Area of circle (Dia in inches) + /// + /// + /// + public static decimal Area_Circle_Dia_in(decimal decDia) + { + decimal decArea = decDia * (decimal)Math.PI; + return decArea; + + } + + /// + /// Calculates Volume of Cyl (Dia in inches,Height) + /// + /// + /// + public static double Vol_Cyl_Dia_in(double dblDia, double dblHgt) + { + double dblVolume = (dblDia * Math.PI) * dblHgt; + return dblVolume; + + } + + /// + /// Calculates Volume of Cyl (Dia in inches,Height) + /// + /// + /// + public static decimal Vol_Cyl_Dia_in(decimal decDia, decimal decHgt) + { + decimal decVolume = (decDia * (decimal)Math.PI) * decHgt; + return decVolume; + + } + + + + #endregion Area and Volume + + #region String Stuff + + /// + /// Takes string and returns SPLIT string array (string to split, split char) + /// + /// + /// + /// + public static string[] saSplit (string strToSplit, char chrSplitter) + { + string[] saToReturn = strToSplit.Split(new Char[] { chrSplitter });//splits string + + return saToReturn; + } + + #endregion String Stuff + + } +} diff --git a/XMLParser.cs b/XMLParser.cs new file mode 100644 index 0000000..aa02a65 --- /dev/null +++ b/XMLParser.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Xml.Linq; +using System.Xml; +using System.Text; +using System.IO; +using System.Threading.Tasks; + +namespace _8082_Waymo_PC +{ + class XMLParser + { + public static Dictionary ToDict(string xmlToParse) + { + XDocument doc; + try + { + doc = XDocument.Parse(xmlToParse); + } catch ( XmlException e) + { + LogText("exception:" + e.Message); + return null; + } + Dictionary dataDictionary = new Dictionary(); + + foreach (XElement element in doc.Descendants().Where(p => p.HasElements == false)) + { + int keyInt = 0; + string keyName = element.Name.LocalName; + + while (dataDictionary.ContainsKey(keyName)) + { + keyName = element.Name.LocalName + "_" + keyInt++; + } + + dataDictionary.Add(keyName, element.Value); + } + return dataDictionary; + } + public static void LogText(string message) + { + if (Properties.Settings.Default.DebugLogs) + { + if (!Directory.Exists(Properties.Settings.Default.LogDirectory)) + { + Directory.CreateDirectory(Properties.Settings.Default.LogDirectory); + } + using (StreamWriter w = File.AppendText($"{Properties.Settings.Default.LogDirectory}\\log_xmlparser.txt")) + { + w.Write("\r\nLog Entry : "); + w.WriteLine($"{DateTime.Now.ToLongTimeString()} {DateTime.Now.ToLongDateString()}"); + w.WriteLine($" :{message}"); + w.WriteLine("-------------------------------"); + } + } + } + } +} diff --git a/example_dumptruck_xml.xml b/example_dumptruck_xml.xml new file mode 100644 index 0000000..64bb712 --- /dev/null +++ b/example_dumptruck_xml.xml @@ -0,0 +1,25 @@ + + + 2022-06-16T16:42:06.7007641Z + 2022-06-16T16:42:45.7435212Z + DYN072135100664 + {Waymo designated station name for the tester} + {Waymo designated test type name for the kind of test} + TEST_PASS + {Optional operator name input} + + Initial Pressure + PASS + 30.123 + 27.0 + 33.0 + + + Delta Pa + PASS + 4.340760 + -30.013 + 30.006 + + ... + \ No newline at end of file