diff --git a/02_Windows_App/Perun_v1/form_Main.Designer.cs b/02_Windows_App/Perun_v1/form_Main.Designer.cs index 7f1b65a..1de14e0 100644 --- a/02_Windows_App/Perun_v1/form_Main.Designer.cs +++ b/02_Windows_App/Perun_v1/form_Main.Designer.cs @@ -58,6 +58,7 @@ this.openFileDialog_SRS = new System.Windows.Forms.OpenFileDialog(); this.openFileDialog_LotATC = new System.Windows.Forms.OpenFileDialog(); this.tim_10000ms = new System.Windows.Forms.Timer(this.components); + this.tim_200ms = new System.Windows.Forms.Timer(this.components); this.con_GroupBox_1.SuspendLayout(); this.con_GroupBox_2.SuspendLayout(); this.con_GroupBox_3.SuspendLayout(); @@ -321,6 +322,10 @@ this.tim_10000ms.Interval = 30000; this.tim_10000ms.Tick += new System.EventHandler(this.tim_10000ms_Tick); // + // tim_200ms + // + this.tim_200ms.Tick += new System.EventHandler(this.tim_200ms_Tick); + // // form_Main // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -383,6 +388,7 @@ private System.Windows.Forms.Timer tim_10000ms; private System.Windows.Forms.Label label6; private System.Windows.Forms.TextBox con_txt_mysql_port; + private System.Windows.Forms.Timer tim_200ms; } } diff --git a/02_Windows_App/Perun_v1/form_Main.cs b/02_Windows_App/Perun_v1/form_Main.cs index 474b9e8..ccd5477 100644 --- a/02_Windows_App/Perun_v1/form_Main.cs +++ b/02_Windows_App/Perun_v1/form_Main.cs @@ -20,7 +20,7 @@ namespace Perun_v1 public Thread thread_UDPListener; // Seperate thread for UDP public class_UDPListener UDPListener; // Helper class for UDP comunication public string[] LogHistory = new string[10]; // Log history for GUI - public string[] SendBuffer = new string[10]; // Mysql send buffer + public string[] SendBuffer = new string[100]; // Mysql send buffer public bool LetMeOut = false; // Helper to handle system tray public string MySql_connStr; // MySQL connection string public string publishVersion = "DEBUG"; // Helper for pulling version definition @@ -182,9 +182,13 @@ namespace Perun_v1 // Add to mySQL send buffer and rotate for (int i = 0; i < SendBuffer.Length - 1; i++) { - SendBuffer[i] = SendBuffer[i + 1]; + if (SendBuffer[i]==null) + { + SendBuffer[i] = received_data; + break; + } + } - SendBuffer[9] = received_data; } } @@ -267,6 +271,7 @@ namespace Perun_v1 // Start timmers tim_1000ms.Enabled = true; tim_10000ms.Enabled = true; + tim_200ms.Enabled = true; } @@ -292,6 +297,7 @@ namespace Perun_v1 // Stop timmers tim_1000ms.Enabled = false; tim_10000ms.Enabled = false; + tim_200ms.Enabled = false; } private void timer1_Tick(object sender, EventArgs e) @@ -307,15 +313,6 @@ namespace Perun_v1 } } - // Send buffer to MySQL - for (int i = 0; i < SendBuffer.Length - 1; i++) - { - if (SendBuffer[i] != null) - { - SendToMySql(SendBuffer[i]); - SendBuffer[i] = null; - } - } } private void con_lab_github_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) @@ -510,5 +507,18 @@ namespace Perun_v1 SendToMySql(strLotATCJson); } + + private void tim_200ms_Tick(object sender, EventArgs e) + { + // Send buffer to MySQL + for (int i = 0; i < SendBuffer.Length - 1; i++) + { + if (SendBuffer[i] != null) + { + SendToMySql(SendBuffer[i]); + SendBuffer[i] = null; + } + } + } } } diff --git a/02_Windows_App/Perun_v1/form_Main.resx b/02_Windows_App/Perun_v1/form_Main.resx index 91ed32d..1ce1382 100644 --- a/02_Windows_App/Perun_v1/form_Main.resx +++ b/02_Windows_App/Perun_v1/form_Main.resx @@ -416,6 +416,9 @@ 563, 19 + + 687, 19 + AAABAAEAQD8AAAEAIAAgQQAAFgAAACgAAABAAAAAfgAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA