Fix richiesta warmers SEMPRE senza cache
This commit is contained in:
@@ -1208,7 +1208,9 @@ public static class ThreadsFunctions
|
||||
if (libraryError.errorCode != 0)
|
||||
ManageLibraryError(libraryError);
|
||||
|
||||
int readCount = 0;
|
||||
#if false
|
||||
int readCount = 0;
|
||||
#endif
|
||||
bool useCache = false;
|
||||
while (true)
|
||||
{
|
||||
@@ -1217,17 +1219,21 @@ public static class ThreadsFunctions
|
||||
// Check if client is connected
|
||||
if (ncAdapter.numericalControl.NC_IsConnected())
|
||||
{
|
||||
#if false
|
||||
// every 10 reads all data...
|
||||
useCache = (readCount != 0);
|
||||
useCache = (readCount != 0);
|
||||
#endif
|
||||
// Get new data from PLC
|
||||
libraryError = ncAdapter.ReadWarmers(useCache, out Dictionary<int, DTOWarmers> currWarmers);
|
||||
if (libraryError.IsError())
|
||||
ManageLibraryError(libraryError);
|
||||
// pubblico
|
||||
MessageServices.Current.Publish(SEND_THERMO_WARMERS_DATA, null, currWarmers);
|
||||
#if false
|
||||
readCount++;
|
||||
// ciclo resettato ogni 20
|
||||
readCount = readCount % 20;
|
||||
readCount = readCount % 20;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
RestoreConnection();
|
||||
|
||||
@@ -367,7 +367,7 @@ namespace Thermo.Active.Controllers.WebApi
|
||||
}
|
||||
|
||||
// recupero valori attuali
|
||||
libraryError = ncAdapter.ReadWarmers(true, out Dictionary<int, DTOWarmers> currWarmers);
|
||||
libraryError = ncAdapter.ReadWarmers(false, out Dictionary<int, DTOWarmers> currWarmers);
|
||||
if (libraryError.IsError())
|
||||
{
|
||||
ThermoActiveLogger.LogError($"SimReqFlirImg | GetRecipeOverview error | {libraryError.exception}");
|
||||
|
||||
Reference in New Issue
Block a user