WIP Scada
Added subribe Added thread Fix & refactor
This commit is contained in:
@@ -11,6 +11,8 @@ using System.Threading;
|
||||
using TeamDev.SDK.MVVM;
|
||||
using static Step.Model.Constants;
|
||||
using static Step.Utils.ExceptionManager;
|
||||
using static Step.Config.ServerConfig;
|
||||
using System.Linq;
|
||||
|
||||
public static class ThreadsFunctions
|
||||
{
|
||||
@@ -734,12 +736,14 @@ public static class ThreadsFunctions
|
||||
// Check if client is connected
|
||||
if (ncHandler.numericalControl.NC_IsConnected())
|
||||
{
|
||||
List<ScadaSchemaModel> scadaToRead = ProductionScadaSchema.Concat(SubscribedScada).ToList();
|
||||
|
||||
// Get new data from PLC
|
||||
libraryError = ncHandler.ReadScadaData(out List<DTOScadaModel> scadas);
|
||||
libraryError = ncHandler.ReadScadasData(scadaToRead, out List<DTOScadaModel> scadas);
|
||||
if (libraryError.IsError())
|
||||
ManageLibraryError(libraryError);
|
||||
|
||||
// MessageServices.Current.Publish(NC_MAGAZINE_IS_ACTIVE, null, status);
|
||||
MessageServices.Current.Publish(SEND_SCADA_DATA, null, scadas);
|
||||
}
|
||||
else
|
||||
RestoreConnection();
|
||||
|
||||
Reference in New Issue
Block a user