COmpletata bozza gestione setpointHmi invalidato
This commit is contained in:
@@ -763,6 +763,18 @@ public static class ThreadsFunctions
|
||||
};
|
||||
|
||||
MessageServices.Current.Publish(SEND_THERMO_RECIPE_CHANGED, null, message);
|
||||
|
||||
// verifico se dal PLC è segnalato che i setpointHMI sono invalidati, nel qual caso INVIO
|
||||
bool setpointHmiInvalidated = false;
|
||||
libraryError = ncAdapter.checkSetpointInvalidated(out setpointHmiInvalidated);
|
||||
if (setpointHmiInvalidated)
|
||||
{
|
||||
// pubblico booleana dei setpointHMI invalidati
|
||||
MessageServices.Current.Publish(SEND_THERMO_RECIPE_SETPOINTHMI_CHANGED, null, setpointHmiInvalidated);
|
||||
// ora gestisco l'ack della richiesta
|
||||
libraryError = ncAdapter.doAckSetpointInvalidated();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
RestoreConnection();
|
||||
|
||||
@@ -327,6 +327,7 @@ namespace Thermo.Active.Model
|
||||
public const string SEND_THERMO_RECIPE_FULL = "SEND_THERMO_RECIPE_FULL";
|
||||
public const string SEND_THERMO_RECIPE_OVERWIEW = "SEND_THERMO_RECIPE_OVERWIEW";
|
||||
public const string SEND_THERMO_RECIPE_CHANGED = "SEND_THERMO_RECIPE_CHANGED";
|
||||
public const string SEND_THERMO_RECIPE_SETPOINTHMI_CHANGED = "SEND_THERMO_RECIPE_SETPOINTHMI_CHANGED";
|
||||
public const string SEND_THERMO_MODULE_DATA = "SEND_THERMO_MODULE_DATA";
|
||||
public const string SEND_THERMO_WARMERS_DATA = "SEND_THERMO_WARMERS_DATA";
|
||||
public const string SEND_THERMO_AREA_DATA = "SEND_THERMO_AREA_DATA";
|
||||
|
||||
@@ -272,7 +272,7 @@ namespace Thermo.Active.NC
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
private static bool ThermoParamHmiInvalidated
|
||||
private static bool ThermoSetpointHmiInvalidated
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -1358,7 +1358,19 @@ namespace Thermo.Active.NC
|
||||
}
|
||||
|
||||
|
||||
public CmsError WriteM154Ack(int processId)
|
||||
public CmsError checkSetpointInvalidated(out bool setpointHmiInvalidated)
|
||||
{
|
||||
setpointHmiInvalidated = ThermoSetpointHmiInvalidated;
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
public CmsError doAckSetpointInvalidated()
|
||||
{
|
||||
numericalControl.PLC_WAckSetpointInvalidated();
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
public CmsError WriteM154Ack(int processId)
|
||||
{
|
||||
return numericalControl.PLC_W154ManageAck(processId);
|
||||
}
|
||||
|
||||
@@ -100,6 +100,10 @@ namespace Thermo.Active.Listeners
|
||||
{
|
||||
SignalRListener.SendThermoRecipeChangedData(a);
|
||||
}));
|
||||
infos.Add(MessageServices.Current.Subscribe(SEND_THERMO_RECIPE_SETPOINTHMI_CHANGED, (a, b) =>
|
||||
{
|
||||
SignalRListener.SendThermoSetpointHmiInvalidated(a);
|
||||
}));
|
||||
infos.Add(MessageServices.Current.Subscribe(SEND_THERMO_MODULE_DATA, (a, b) =>
|
||||
{
|
||||
SignalRListener.SendThermoModulesData(a);
|
||||
|
||||
@@ -299,6 +299,21 @@ namespace Thermo.Active.Listeners.SignalR
|
||||
context.Clients.Group("ncData").recipeChangedData(currMessage);
|
||||
}
|
||||
}
|
||||
|
||||
public static void SendThermoSetpointHmiInvalidated(object message)
|
||||
{
|
||||
bool currMessage = false;
|
||||
bool.TryParse(message.ToString(), out currMessage);
|
||||
if (lastSetpointHmiInvalid == null || currMessage != lastSetpointHmiInvalid)
|
||||
{
|
||||
// salvo update
|
||||
lastSetpointHmiInvalid = currMessage;
|
||||
var context = GlobalHost.ConnectionManager.GetHubContext<NcHub>();
|
||||
context.Clients.Group("ncData").setpointHmiInvalid(currMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void SendThermoModulesData(object modules)
|
||||
{
|
||||
Dictionary<int, DTOModulesBlock> currModules = modules as Dictionary<int, DTOModulesBlock>;
|
||||
@@ -477,7 +492,7 @@ namespace Thermo.Active.Listeners.SignalR
|
||||
if (diffAxisData.Count > 0)
|
||||
{
|
||||
// salvo update CLONANDO
|
||||
LastAxisInfoData= currInfoAxes.Keys.ToDictionary(_ => _, _ => currInfoAxes[_].Clone());
|
||||
LastAxisInfoData = currInfoAxes.Keys.ToDictionary(_ => _, _ => currInfoAxes[_].Clone());
|
||||
var context = GlobalHost.ConnectionManager.GetHubContext<NcHub>();
|
||||
context.Clients.Group("ncData").axisInfo(diffAxisData);
|
||||
}
|
||||
@@ -549,6 +564,7 @@ namespace Thermo.Active.Listeners.SignalR
|
||||
// Send THERMO Recipe data
|
||||
group.recipeFullData(LastRecipeFullData);
|
||||
group.recipeOverData(LastRecipeOverData);
|
||||
group.setpointHmiInvalid();
|
||||
// Send THERMO Modules data
|
||||
group.modulesData(LastModulesData);
|
||||
// Send THERMO Warmers data
|
||||
|
||||
@@ -35,6 +35,7 @@ namespace Thermo.Active.Listeners
|
||||
// Oggetti specifici per THERMO (1° definizione)
|
||||
public static Dictionary<string, DTORecipeParam> LastRecipeFullData = new Dictionary<string, DTORecipeParam>();
|
||||
public static Dictionary<RecipeSection, RecipeCatStatus> LastRecipeOverData = new Dictionary<RecipeSection, RecipeCatStatus>();
|
||||
public static bool? lastSetpointHmiInvalid = null;
|
||||
public static bool? recipeHasChanged = null;
|
||||
public static Dictionary<int, DTOModulesBlock> LastModulesData = new Dictionary<int, DTOModulesBlock>();
|
||||
public static Dictionary<int, DTOWarmers> LastWarmersData = new Dictionary<int, DTOWarmers>();
|
||||
|
||||
Reference in New Issue
Block a user