revisione gest sample periods configurabili da XML
This commit is contained in:
@@ -92,7 +92,7 @@ public static class ThreadsFunctions
|
||||
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
|
||||
|
||||
// Wait
|
||||
Thread.Sleep(CalcSleepTime(500, (int)sw.ElapsedMilliseconds));
|
||||
Thread.Sleep(CalcSleepTime(samplMsec("watchdog"), (int)sw.ElapsedMilliseconds));
|
||||
}
|
||||
}
|
||||
catch (ThreadAbortException ex)
|
||||
@@ -100,7 +100,6 @@ public static class ThreadsFunctions
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Manage status/command words for actions
|
||||
/// </summary>
|
||||
@@ -133,7 +132,7 @@ public static class ThreadsFunctions
|
||||
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
|
||||
|
||||
// Wait
|
||||
Thread.Sleep(CalcSleepTime(250, (int)sw.ElapsedMilliseconds));
|
||||
Thread.Sleep(CalcSleepTime(samplMsec("statusCommand"), (int)sw.ElapsedMilliseconds));
|
||||
}
|
||||
}
|
||||
catch (ThreadAbortException ex)
|
||||
@@ -141,7 +140,6 @@ public static class ThreadsFunctions
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Manage action for conf request
|
||||
/// </summary>
|
||||
@@ -176,49 +174,7 @@ public static class ThreadsFunctions
|
||||
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
|
||||
|
||||
// Wait
|
||||
Thread.Sleep(CalcSleepTime(2000, (int)sw.ElapsedMilliseconds));
|
||||
}
|
||||
}
|
||||
catch (ThreadAbortException ex)
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Manage action for conf request
|
||||
/// </summary>
|
||||
public static void ManageProdUpdate()
|
||||
{
|
||||
NcAdapter ncAdapter = new NcAdapter();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
try
|
||||
{
|
||||
CmsError libraryError = ncAdapter.Connect();
|
||||
if (libraryError.errorCode != 0)
|
||||
ManageLibraryError(libraryError);
|
||||
|
||||
while (true)
|
||||
{
|
||||
sw.Restart();
|
||||
|
||||
// Check if client is connected
|
||||
if (ncAdapter.numericalControl.NC_IsConnected())
|
||||
{
|
||||
//// Manage status command
|
||||
//libraryError = ncAdapter.ManageProdUpdate();
|
||||
//if (libraryError.errorCode != 0)
|
||||
// ManageLibraryError(libraryError);
|
||||
}
|
||||
else
|
||||
RestoreConnection();
|
||||
|
||||
sw.Stop();
|
||||
|
||||
//Update thread timer
|
||||
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
|
||||
|
||||
// Wait
|
||||
Thread.Sleep(CalcSleepTime(1000, (int)sw.ElapsedMilliseconds));
|
||||
Thread.Sleep(CalcSleepTime(samplMsec("confReq"), (int)sw.ElapsedMilliseconds));
|
||||
}
|
||||
}
|
||||
catch (ThreadAbortException ex)
|
||||
@@ -261,7 +217,7 @@ public static class ThreadsFunctions
|
||||
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
|
||||
|
||||
// Wait
|
||||
Thread.Sleep(CalcSleepTime(200, (int)sw.ElapsedMilliseconds));
|
||||
Thread.Sleep(CalcSleepTime(samplMsec("alarms"), (int)sw.ElapsedMilliseconds));
|
||||
}
|
||||
}
|
||||
catch (ThreadAbortException)
|
||||
@@ -302,7 +258,7 @@ public static class ThreadsFunctions
|
||||
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
|
||||
|
||||
// Wait
|
||||
Thread.Sleep(CalcSleepTime(400, (int)sw.ElapsedMilliseconds));
|
||||
Thread.Sleep(CalcSleepTime(samplMsec("powerOn"), (int)sw.ElapsedMilliseconds));
|
||||
}
|
||||
}
|
||||
catch (ThreadAbortException)
|
||||
@@ -390,7 +346,7 @@ public static class ThreadsFunctions
|
||||
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
|
||||
|
||||
// Wait
|
||||
Thread.Sleep(CalcSleepTime(200, (int)sw.ElapsedMilliseconds));
|
||||
Thread.Sleep(CalcSleepTime(samplMsec("functionEnab"), (int)sw.ElapsedMilliseconds));
|
||||
}
|
||||
}
|
||||
catch (ThreadAbortException)
|
||||
@@ -441,7 +397,7 @@ public static class ThreadsFunctions
|
||||
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
|
||||
|
||||
// Wait
|
||||
Thread.Sleep(30000);
|
||||
Thread.Sleep(CalcSleepTime(samplMsec("expMan"), (int)sw.ElapsedMilliseconds));
|
||||
}
|
||||
}
|
||||
catch (ThreadAbortException)
|
||||
@@ -488,7 +444,7 @@ public static class ThreadsFunctions
|
||||
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
|
||||
|
||||
// Wait
|
||||
Thread.Sleep(CalcSleepTime(200, (int)sw.ElapsedMilliseconds));
|
||||
Thread.Sleep(CalcSleepTime(samplMsec("userSK"), (int)sw.ElapsedMilliseconds));
|
||||
}
|
||||
}
|
||||
catch (ThreadAbortException)
|
||||
@@ -584,7 +540,7 @@ public static class ThreadsFunctions
|
||||
//Update thread timer
|
||||
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
|
||||
// Wait
|
||||
Thread.Sleep(CalcSleepTime(500, (int)sw.ElapsedMilliseconds));
|
||||
Thread.Sleep(CalcSleepTime(samplMsec("scada"), (int)sw.ElapsedMilliseconds));
|
||||
}
|
||||
}
|
||||
catch (ThreadAbortException)
|
||||
@@ -669,7 +625,7 @@ public static class ThreadsFunctions
|
||||
//Update thread timer
|
||||
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
|
||||
// Wait 500 ms
|
||||
Thread.Sleep(CalcSleepTime(1000, (int)sw.ElapsedMilliseconds));
|
||||
Thread.Sleep(CalcSleepTime(samplMsec("prodPanel"), (int)sw.ElapsedMilliseconds));
|
||||
}
|
||||
}
|
||||
catch (ThreadAbortException)
|
||||
@@ -816,7 +772,7 @@ public static class ThreadsFunctions
|
||||
// Update thread timer
|
||||
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
|
||||
// Wait
|
||||
Thread.Sleep(CalcSleepTime(500, (int)sw.ElapsedMilliseconds));
|
||||
Thread.Sleep(CalcSleepTime(samplMsec("recipe"), (int)sw.ElapsedMilliseconds));
|
||||
}
|
||||
}
|
||||
catch (ThreadAbortException)
|
||||
@@ -857,7 +813,7 @@ public static class ThreadsFunctions
|
||||
// Update thread timer
|
||||
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
|
||||
// Wait
|
||||
Thread.Sleep(CalcSleepTime(1800, (int)sw.ElapsedMilliseconds));
|
||||
Thread.Sleep(CalcSleepTime(samplMsec("warmers"), (int)sw.ElapsedMilliseconds));
|
||||
}
|
||||
}
|
||||
catch (ThreadAbortException)
|
||||
@@ -898,7 +854,7 @@ public static class ThreadsFunctions
|
||||
// Update thread timer
|
||||
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
|
||||
// Wait
|
||||
Thread.Sleep(CalcSleepTime(500, (int)sw.ElapsedMilliseconds));
|
||||
Thread.Sleep(CalcSleepTime(samplMsec("area"), (int)sw.ElapsedMilliseconds));
|
||||
}
|
||||
}
|
||||
catch (ThreadAbortException)
|
||||
@@ -985,7 +941,7 @@ public static class ThreadsFunctions
|
||||
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
|
||||
|
||||
// Wait
|
||||
Thread.Sleep(CalcSleepTime(200, (int)sw.ElapsedMilliseconds));
|
||||
Thread.Sleep(CalcSleepTime(samplMsec("mCommands"), (int)sw.ElapsedMilliseconds));
|
||||
}
|
||||
}
|
||||
catch (ThreadAbortException)
|
||||
@@ -1159,7 +1115,7 @@ public static class ThreadsFunctions
|
||||
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
|
||||
|
||||
// Wait
|
||||
Thread.Sleep(CalcSleepTime(500, (int)sw.ElapsedMilliseconds));
|
||||
Thread.Sleep(CalcSleepTime(samplMsec("m154"), (int)sw.ElapsedMilliseconds));
|
||||
}
|
||||
}
|
||||
catch (ThreadAbortException)
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Thermo.Active.Core
|
||||
ThreadsFunctions.ReadAlarms,
|
||||
ThreadsFunctions.ReadPowerOnData,
|
||||
ThreadsFunctions.StatThread,
|
||||
ThreadsFunctions.ReadProcessesPPStatus,
|
||||
//ThreadsFunctions.ReadProcessesPPStatus,
|
||||
ThreadsFunctions.ReadEnabledFunctionality,
|
||||
ThreadsFunctions.ReadExpiredMaintenances,
|
||||
ThreadsFunctions.ReadUserSoftKeysData,
|
||||
|
||||
@@ -161,7 +161,6 @@ namespace Thermo.Active.Listeners.SignalR
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void SendActiveProgramData(object programData)
|
||||
{
|
||||
var context = GlobalHost.ConnectionManager.GetHubContext<NcHub>();
|
||||
|
||||
Reference in New Issue
Block a user