From a6ad17dbe19c60c505e70d8fa0969601b7262057 Mon Sep 17 00:00:00 2001 From: Szymon Porwolik Date: Sun, 24 Feb 2019 21:18:44 +0100 Subject: [PATCH] Fixed issue with "blinking" SRS status when no clients connected to server. --- 02_Windows_App/Perun_v1/form_Main.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/02_Windows_App/Perun_v1/form_Main.cs b/02_Windows_App/Perun_v1/form_Main.cs index eec6497..75a8bd5 100644 --- a/02_Windows_App/Perun_v1/form_Main.cs +++ b/02_Windows_App/Perun_v1/form_Main.cs @@ -23,7 +23,7 @@ namespace Perun_v1 public string[] SendBuffer=new string[10]; // Mysql send buffer public bool LetMeOut=false; // Helper to handle system tray public string MySql_connStr; // MySQL connection string - string publishVersion = "DEBUG"; // Helper for pulling version definition + public string publishVersion = "DEBUG"; // Helper for pulling version definition public static void LogHistoryAdd(ref string[] LogHistory, string Comment) { @@ -415,8 +415,15 @@ namespace Perun_v1 } } - strSRSJson = JsonConvert.SerializeObject(raw_lotatc); - strSRSJson = "{'type':'100','payload':'" + strSRSJson + "'}"; + if (raw_lotatc.Count > 0) + { + strSRSJson = JsonConvert.SerializeObject(raw_lotatc); + strSRSJson = "{'type':'100','payload':'" + strSRSJson + "'}"; + } + else + { + strSRSJson = "{'type':'100','payload':{'ignore':'false'}}"; + } SRSdefault = false; LogHistoryAdd(ref LogHistory, "SRS data loaded");