ADD signalr + filtro SIM troppo verboso
This commit is contained in:
@@ -670,6 +670,48 @@ public static class ThreadsFunctions
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
public static void ReadProdPanelData()
|
||||
{
|
||||
NcAdapter ncAdapter = new NcAdapter();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
|
||||
try
|
||||
{
|
||||
// Try connection
|
||||
CmsError libraryError = ncAdapter.Connect();
|
||||
if (libraryError.errorCode != 0)
|
||||
ManageLibraryError(libraryError);
|
||||
|
||||
while (true)
|
||||
{
|
||||
sw.Restart();
|
||||
|
||||
// Check if client is connected
|
||||
if (ncAdapter.numericalControl.NC_IsConnected())
|
||||
{
|
||||
// Get new data from PLC (and log if changed...)
|
||||
libraryError = ncAdapter.ReadProdPanel(out DTOThermoPanelProd currentProdPanel);
|
||||
if (libraryError.IsError())
|
||||
ManageLibraryError(libraryError);
|
||||
|
||||
MessageServices.Current.Publish(SEND_THERMO_PROD_PANEL_DATA, null, currentProdPanel);
|
||||
}
|
||||
else
|
||||
RestoreConnection();
|
||||
|
||||
sw.Stop();
|
||||
|
||||
//Update thread timer
|
||||
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
|
||||
// Wait 500 ms
|
||||
Thread.Sleep(CalcSleepTime(500, (int)sw.ElapsedMilliseconds));
|
||||
}
|
||||
}
|
||||
catch (ThreadAbortException)
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
public static void ReadProdInfoData()
|
||||
{
|
||||
NcAdapter ncAdapter = new NcAdapter();
|
||||
|
||||
Reference in New Issue
Block a user