diff --git a/Thermo.Active.Core/Thermo.Active.Core.csproj b/Thermo.Active.Core/Thermo.Active.Core.csproj index 04c4829d..cefca42b 100644 --- a/Thermo.Active.Core/Thermo.Active.Core.csproj +++ b/Thermo.Active.Core/Thermo.Active.Core.csproj @@ -33,6 +33,7 @@ + diff --git a/Thermo.Active.Core/ThreadsFunctions.cs b/Thermo.Active.Core/ThreadsFunctions.cs index 26c4fb77..211a283c 100644 --- a/Thermo.Active.Core/ThreadsFunctions.cs +++ b/Thermo.Active.Core/ThreadsFunctions.cs @@ -29,6 +29,7 @@ using static Thermo.Active.Model.Constants; using static Thermo.Active.Utils.ExceptionManager; using System.Windows; using System.Drawing; +using System.Configuration; public static class ThreadsFunctions { @@ -1196,6 +1197,19 @@ public static class ThreadsFunctions ncAdapter.Dispose(); } } + /// + /// Swap x/y requesto from FLIR camera + /// + internal static bool cacheWarmers + { + get + { + bool answ = false; + bool.TryParse(ConfigurationManager.AppSettings["cacheWarmers"], out answ); + return answ; + } + } + public static void ReadWarmersData() { @@ -1217,17 +1231,20 @@ public static class ThreadsFunctions // Check if client is connected if (ncAdapter.numericalControl.NC_IsConnected()) { - // every 10 reads all data... - useCache = (readCount != 0); + if (cacheWarmers) + { + // every 10 reads all data... + useCache = (readCount != 0); + readCount++; + // ciclo resettato ogni 20 + readCount = readCount % 20; + } // Get new data from PLC libraryError = ncAdapter.ReadWarmers(useCache, out Dictionary currWarmers); if (libraryError.IsError()) ManageLibraryError(libraryError); // pubblico MessageServices.Current.Publish(SEND_THERMO_WARMERS_DATA, null, currWarmers); - readCount++; - // ciclo resettato ogni 20 - readCount = readCount % 20; } else RestoreConnection(); diff --git a/Thermo.Active/App.config b/Thermo.Active/App.config index ecf5c46a..9f914b44 100644 --- a/Thermo.Active/App.config +++ b/Thermo.Active/App.config @@ -18,6 +18,7 @@ + diff --git a/Thermo.Active/Controllers/WebApi/WarmersController.cs b/Thermo.Active/Controllers/WebApi/WarmersController.cs index 1d03c5aa..e64c37bc 100644 --- a/Thermo.Active/Controllers/WebApi/WarmersController.cs +++ b/Thermo.Active/Controllers/WebApi/WarmersController.cs @@ -367,7 +367,7 @@ namespace Thermo.Active.Controllers.WebApi } // recupero valori attuali - libraryError = ncAdapter.ReadWarmers(true, out Dictionary currWarmers); + libraryError = ncAdapter.ReadWarmers(false, out Dictionary currWarmers); if (libraryError.IsError()) { ThermoActiveLogger.LogError($"SimReqFlirImg | GetRecipeOverview error | {libraryError.exception}");