diff --git a/Thermo.Active.Config/Config/axesConfig.xml b/Thermo.Active.Config/Config/axesConfig.xml
index 8105de47..812e8aa2 100644
--- a/Thermo.Active.Config/Config/axesConfig.xml
+++ b/Thermo.Active.Config/Config/axesConfig.xml
@@ -1,27 +1,35 @@
- X
- Y
- Z
- B
- C
- V
-
-
-
-
-
-
-
-
-
-
- SP
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Thermo.Active.Config/Config/axesConfigValidator.xsd b/Thermo.Active.Config/Config/axesConfigValidator.xsd
new file mode 100644
index 00000000..67b59ad2
--- /dev/null
+++ b/Thermo.Active.Config/Config/axesConfigValidator.xsd
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Thermo.Active.Config/ServerConfig.cs b/Thermo.Active.Config/ServerConfig.cs
index 6ead2f2e..3146aa0b 100644
--- a/Thermo.Active.Config/ServerConfig.cs
+++ b/Thermo.Active.Config/ServerConfig.cs
@@ -63,6 +63,7 @@ namespace Thermo.Active.Config
public static List RiskResistConfig;
public static List RiskChannelConfig;
public static List RiskBoardConfig;
+ public static List AxesConfig;
}
diff --git a/Thermo.Active.Config/ServerConfigController.cs b/Thermo.Active.Config/ServerConfigController.cs
index d16e497b..68b0ce0a 100644
--- a/Thermo.Active.Config/ServerConfigController.cs
+++ b/Thermo.Active.Config/ServerConfigController.cs
@@ -38,6 +38,7 @@ namespace Thermo.Active.Config
ReadRecipeConfig();
ReadModBlockConfig();
ReadRiskConfig();
+ ReadAxesConfig();
// ReadCMSConnectConfig();
ReadMacros();
ReadScadaFile();
@@ -867,6 +868,25 @@ namespace Thermo.Active.Config
}
}
+ ///
+ /// Axes config setup from file
+ ///
+ private static void ReadAxesConfig()
+ {
+ XDocument xmlConfigFile = GetXmlHandlerWithValidator(AXES_CONFIG_SCHEMA_PATH, AXES_CONFIG_PATH);
+
+ // Read head config from XML file
+ AxesConfig = xmlConfigFile
+ .Root
+ .Elements()
+ .Select(x => new AxesConfigModel()
+ {
+ Id = Convert.ToInt16(x.Attribute("id").Value),
+ Name = x.Attribute("name").Value,
+ Type = GetTActAxes_Type(x.Attribute("type").Value)
+ })
+ .ToList();
+ }
private static void ReadCMSConnectConfig()
{
String _tempUSR, _tempPSW;
diff --git a/Thermo.Active.Config/Thermo.Active.Config.csproj b/Thermo.Active.Config/Thermo.Active.Config.csproj
index 0ed9fc88..dd4d411a 100644
--- a/Thermo.Active.Config/Thermo.Active.Config.csproj
+++ b/Thermo.Active.Config/Thermo.Active.Config.csproj
@@ -207,6 +207,10 @@
Designer
Always
+
+ Designer
+ Always
+
Always
diff --git a/Thermo.Active.Core/ThreadsFunctions.cs b/Thermo.Active.Core/ThreadsFunctions.cs
index 0f39008b..abfe5fe6 100644
--- a/Thermo.Active.Core/ThreadsFunctions.cs
+++ b/Thermo.Active.Core/ThreadsFunctions.cs
@@ -15,6 +15,7 @@ using Thermo.Active.Database.Controllers;
using Thermo.Active.Model.DTOModels;
using Thermo.Active.Model.DTOModels.AlarmModels;
using Thermo.Active.Model.DTOModels.Scada;
+using Thermo.Active.Model.DTOModels.ThAxes;
using Thermo.Active.Model.DTOModels.ThModules;
using Thermo.Active.Model.DTOModels.ThProd;
using Thermo.Active.Model.DTOModels.ThRecipe;
@@ -507,7 +508,7 @@ public static class ThreadsFunctions
MessageServices.Current.Publish(SEND_AXIS_NAMES_DATA, null, axes);
}
else
- RestoreConnection();
+ RestoreConnection();
sw.Stop();
@@ -515,7 +516,7 @@ public static class ThreadsFunctions
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
// Wait
- Thread.Sleep(CalcSleepTime(800, (int)sw.ElapsedMilliseconds));
+ Thread.Sleep(CalcSleepTime(1000, (int)sw.ElapsedMilliseconds));
}
}
catch (ThreadAbortException)
@@ -542,15 +543,15 @@ public static class ThreadsFunctions
if (ncAdapter.numericalControl.NC_IsConnected())
{
// Get Data from NC
- libraryError = ncAdapter.GetAxesPositionsBySelectedProcess(out DTOAxesModel axesPositions);
+ libraryError = ncAdapter.GetAxesPositions(out DTOThermoAxesMovModel axesPositions);
if (libraryError.errorCode != 0)
ManageLibraryError(libraryError);
else
// Send through signalR
- MessageServices.Current.Publish(SEND_AXES, null, axesPositions);
+ MessageServices.Current.Publish(SEND_AXIS_POS, null, axesPositions);
}
else
- RestoreConnection();
+ RestoreConnection();
sw.Stop();
@@ -558,7 +559,52 @@ public static class ThreadsFunctions
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
// Wait
- Thread.Sleep(CalcSleepTime(100, (int)sw.ElapsedMilliseconds));
+ Thread.Sleep(CalcSleepTime(200, (int)sw.ElapsedMilliseconds));
+ }
+ }
+ catch (ThreadAbortException)
+ {
+ ncAdapter.Dispose();
+ }
+ }
+ public static void ReadAxesInfoData()
+ {
+ 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();
+
+#if false
+ if (ncAdapter.numericalControl.NC_IsConnected())
+ {
+ // Get Data from NC
+ libraryError = ncAdapter.GetAxesPositionsBySelectedProcess(out DTOAxesModel axesPositions);
+ if (libraryError.errorCode != 0)
+ ManageLibraryError(libraryError);
+ else
+ // Send through signalR
+ MessageServices.Current.Publish(SEND_AXIS_INFO, null, axesPositions);
+ }
+ else
+ RestoreConnection();
+#endif
+
+ sw.Stop();
+
+ //Update thread timer
+ UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
+
+ // Wait
+ Thread.Sleep(CalcSleepTime(500, (int)sw.ElapsedMilliseconds));
}
}
catch (ThreadAbortException)
diff --git a/Thermo.Active.Core/ThreadsHandler.cs b/Thermo.Active.Core/ThreadsHandler.cs
index 18c678b6..7d61e920 100644
--- a/Thermo.Active.Core/ThreadsHandler.cs
+++ b/Thermo.Active.Core/ThreadsHandler.cs
@@ -19,10 +19,8 @@ namespace Thermo.Active.Core
ThreadsFunctions.ReadProcessesPPStatus,
ThreadsFunctions.ReadEnabledFunctionality,
ThreadsFunctions.ReadExpiredMaintenances,
- //ThreadsFunctions.ReadAxesPositionsData,
ThreadsFunctions.ReadUserSoftKeysData,
//ThreadsFunctions.ReadHeadsData,
- //ThreadsFunctions.ReadAxesNamesData,
//ThreadsFunctions.ReadActiveProgramData,
//ThreadsFunctions.ReadPartProgramQueueData,
// ThreadsFunctions.ReadNcSoftKeysData,
@@ -36,6 +34,9 @@ namespace Thermo.Active.Core
ThreadsFunctions.ReadModulesData,
ThreadsFunctions.ReadScadaData,
ThreadsFunctions.ReadMComandsData,
+ ThreadsFunctions.ReadAxesNamesData,
+ ThreadsFunctions.ReadAxesPositionsData,
+ ThreadsFunctions.ReadAxesInfoData,
ThreadsFunctions.ReadM154Data // levare?
};
diff --git a/Thermo.Active.Model/ConfigModels/AxesConfigModel.cs b/Thermo.Active.Model/ConfigModels/AxesConfigModel.cs
new file mode 100644
index 00000000..6e25805d
--- /dev/null
+++ b/Thermo.Active.Model/ConfigModels/AxesConfigModel.cs
@@ -0,0 +1,13 @@
+using System.Collections.Generic;
+using static Thermo.Active.Model.Constants;
+
+namespace Thermo.Active.Model.ConfigModels
+{
+ public class AxesConfigModel
+ {
+ public int Id;
+ public string Name { get; set; }
+ public bool IsSelectable { get; set; } = true;
+ public TACT_AXES_TYPE Type { get; set; }
+ }
+}
diff --git a/Thermo.Active.Model/Constants.cs b/Thermo.Active.Model/Constants.cs
index e3644036..e5a8b156 100644
--- a/Thermo.Active.Model/Constants.cs
+++ b/Thermo.Active.Model/Constants.cs
@@ -102,6 +102,12 @@ namespace Thermo.Active.Model
COOLING,
EXTRACTION
}
+ public enum TACT_AXES_TYPE
+ {
+ NA = 0,
+ LINEAR,
+ ROTATIONAL
+ }
[JsonConverter(typeof(StringEnumConverter))]
public enum TACT_PROD_CATEGORY
@@ -272,6 +278,10 @@ namespace Thermo.Active.Model
public const string MACROS_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "macrosConfigValidator.xsd";
public const string MACROS_CONFIG_PATH = CONFIG_DIRECTORY + "macrosConfig.xml";
+
+ public const string AXES_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + @"axesConfigValidator.xsd";
+ public const string AXES_CONFIG_PATH = CONFIG_DIRECTORY + "axesConfig.xml";
+
public const string MAIN_PROGRAM_CONFIG_PATH = CONFIG_DIRECTORY + "customMainProgram.txt";
@@ -300,7 +310,6 @@ namespace Thermo.Active.Model
public const string SEND_POWER_ON_DATA = "SEND_POWER_ON_DATA";
public const string SEND_GENERIC_DATA = "SEND_GENERIC_DATA";
- public const string SEND_AXES = "SEND_AXES";
public const string SEND_PROCESSES_DATA = "SEND_PROCESSES_STATUS";
public const string SEND_FUNCTIONALITY_DATA = "SEND_FUNCTION_DATA";
public const string SEND_EXPIRED_MAINTENANCES_DATA = "SEND_EXPIRED_MAINTENANCES_DATA";
@@ -308,6 +317,8 @@ namespace Thermo.Active.Model
public const string SEND_NC_SOFTKEYS_DATA = "SEND_NC_SOFTKEYS_DATA";
public const string SEND_HEADS_DATA = "SEND_HEADS_DATA";
public const string SEND_AXIS_NAMES_DATA = "SEND_AXIS_NAMES_DATA";
+ public const string SEND_AXIS_POS = "SEND_AXIS_POS";
+ public const string SEND_AXIS_INFO = "SEND_AXIS_INFO";
public const string SEND_ACTIVE_PROGRAM_DATA = "SEND_ACTIVE_PROGRAM_DATA";
public const string SEND_QUEUE_DATA = "SEND_QUEUE_DATA";
public const string SEND_M155_DATA = "SEND_M155_DATA";
diff --git a/Thermo.Active.Model/DTOModels/ThAxes/DTOAxesInfoModel.cs b/Thermo.Active.Model/DTOModels/ThAxes/DTOAxesInfoModel.cs
new file mode 100644
index 00000000..c89476a9
--- /dev/null
+++ b/Thermo.Active.Model/DTOModels/ThAxes/DTOAxesInfoModel.cs
@@ -0,0 +1,76 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using static Thermo.Active.Model.Constants;
+
+namespace Thermo.Active.Model.DTOModels.ThAxes
+{
+ public class DTOAxesInfoModel
+ {
+ ///
+ /// Errori attuali su assi
+ ///
+ public Dictionary errorCode;
+ ///
+ /// Fase movimento attuale
+ ///
+ public Dictionary movPhase;
+ ///
+ /// Status Word attuale
+ ///
+ public Dictionary statusCode;
+
+ public DTOAxesInfoModel()
+ {
+ errorCode = new Dictionary();
+ movPhase = new Dictionary();
+ statusCode = new Dictionary();
+ }
+
+ public override bool Equals(object obj)
+ {
+ if (!(obj is DTOAxesInfoModel item))
+ return false;
+
+ if (!CheckDictInt(errorCode, item.errorCode))
+ return false;
+ if (!CheckDictInt(movPhase, item.movPhase))
+ return false;
+ if (!CheckDictInt(statusCode, item.statusCode))
+ return false;
+
+ return true;
+ }
+
+ public override int GetHashCode()
+ {
+ return base.GetHashCode();
+ }
+
+ private bool CheckDictInt(IDictionary x, IDictionary y)
+ {
+ // early-exit checks
+ if (y == null)
+ return x == null;
+ if (x == null)
+ return false;
+
+ if (x.Count != y.Count)
+ return false;
+
+ // Check keys are the same
+ foreach (string k in x.Keys)
+ if (!y.ContainsKey(k))
+ return false;
+
+ // Check values are different
+ foreach (string k in x.Keys)
+ {
+ if (y[k] != x[k])
+ return false;
+ }
+
+ return true;
+ }
+ }
+}
diff --git a/Thermo.Active.Model/DTOModels/ThAxes/DTOAxesMovModel.cs b/Thermo.Active.Model/DTOModels/ThAxes/DTOAxesMovModel.cs
new file mode 100644
index 00000000..19de96f0
--- /dev/null
+++ b/Thermo.Active.Model/DTOModels/ThAxes/DTOAxesMovModel.cs
@@ -0,0 +1,86 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using static Thermo.Active.Model.Constants;
+
+namespace Thermo.Active.Model.DTOModels.ThAxes
+{
+ public class DTOThermoAxesMovModel
+ {
+ ///
+ /// Actual position
+ ///
+ public Dictionary actPosition;
+ ///
+ /// Actual Speed
+ ///
+ public Dictionary actSpeed;
+ ///
+ /// Carico attuale assi
+ ///
+ public Dictionary actLoad;
+
+ public DTOThermoAxesMovModel()
+ {
+ actPosition = new Dictionary();
+ actSpeed = new Dictionary();
+ actLoad = new Dictionary();
+ }
+
+#if false
+ public struct AxisModel
+ {
+ public string name;
+ public double value;
+ }
+#endif
+
+ public override bool Equals(object obj)
+ {
+ if (!(obj is DTOThermoAxesMovModel item))
+ return false;
+
+ if (!CheckDictDouble(actPosition, item.actPosition))
+ return false;
+ if (!CheckDictDouble(actSpeed, item.actSpeed))
+ return false;
+ if (!CheckDictDouble(actLoad, item.actLoad))
+ return false;
+
+ return true;
+ }
+
+ public override int GetHashCode()
+ {
+ return base.GetHashCode();
+ }
+
+ private bool CheckDictDouble(IDictionary x, IDictionary y)
+ {
+ // early-exit checks
+ if (y == null)
+ return x == null;
+ if (x == null)
+ return false;
+
+ if (x.Count != y.Count)
+ return false;
+
+ // Check keys are the same
+ foreach (string k in x.Keys)
+ if (!y.ContainsKey(k))
+ return false;
+
+ // Check values are different
+ foreach (string k in x.Keys)
+ {
+ double a = Math.Abs(y[k] - x[k]);
+
+ if (Math.Round(a, 3) >= Constants.EPSILON)
+ return false;
+ }
+
+ return true;
+ }
+ }
+}
diff --git a/Thermo.Active.Model/Thermo.Active.Model.csproj b/Thermo.Active.Model/Thermo.Active.Model.csproj
index 344bb2ce..1de1e92c 100644
--- a/Thermo.Active.Model/Thermo.Active.Model.csproj
+++ b/Thermo.Active.Model/Thermo.Active.Model.csproj
@@ -64,6 +64,7 @@
+
@@ -108,6 +109,8 @@
+
+
diff --git a/Thermo.Active.NC/NcAdapter.cs b/Thermo.Active.NC/NcAdapter.cs
index 2d453007..7219d3fd 100644
--- a/Thermo.Active.NC/NcAdapter.cs
+++ b/Thermo.Active.NC/NcAdapter.cs
@@ -12,6 +12,7 @@ using Thermo.Active.Model.DTOModels;
using Thermo.Active.Model.DTOModels.AlarmModels;
using Thermo.Active.Model.DTOModels.MaintenanceModels;
using Thermo.Active.Model.DTOModels.Scada;
+using Thermo.Active.Model.DTOModels.ThAxes;
using Thermo.Active.Model.DTOModels.ThModules;
using Thermo.Active.Model.DTOModels.ThProd;
using Thermo.Active.Model.DTOModels.ThRecipe;
@@ -276,6 +277,7 @@ namespace Thermo.Active.NC
#region Axes
+#if false
public CmsError GetAxesPositions(out List axes)
{
axes = new List();
@@ -338,31 +340,40 @@ namespace Thermo.Active.NC
//numericalControl.AXES_RFollowingError(1, ref axes.followingErr);
return libraryError;
- }
+ }
+#endif
+ public CmsError GetAxesPositions(out DTOThermoAxesMovModel axes)
+ {
+ CmsError libraryError = NO_ERROR;
+ axes = new DTOThermoAxesMovModel();
+ // leggo dal PLC in lobocco i dati...
+#if fase
+ libraryError = numericalControl.AXES_RInterpPosition(processNum, ref axes.interpolated);
+ if (libraryError.errorCode != 0)
+ return libraryError;
+#endif
+
+ return libraryError;
+ }
+
+ ///
+ /// dati assi da CONF
+ ///
+ ///
+ ///
public CmsError ReadAxisData(out List axesNames)
{
+ CmsError libraryError = NO_ERROR;
axesNames = new List();
- List plcAxes = new List();
- // Read selected process
- ushort selectedProcess = 0;
- CmsError libraryError = numericalControl.PROC_RSelectedProcess(ref selectedProcess);
- if (libraryError.IsError())
- return libraryError;
- if (selectedProcess != 0)
+ axesNames = AxesConfig.Select(x => new DTOAxisNameModel()
{
- // Read axes names
- libraryError = numericalControl.AXES_RAxesNames(selectedProcess, ref plcAxes);
-
- axesNames = plcAxes.Select(x => new DTOAxisNameModel()
- {
- Id = x.Id,
- Name = x.Name,
- IsSelectable = x.IsSelectable,
- Type = x.Type.ToString()
- }).ToList();
- }
+ Id = x.Id,
+ Name = x.Name,
+ IsSelectable = x.IsSelectable,
+ Type = x.Type.ToString()
+ }).ToList();
return libraryError;
}
diff --git a/Thermo.Active.Utils/supportFunctions.cs b/Thermo.Active.Utils/supportFunctions.cs
index 5defccca..3cd93d2f 100644
--- a/Thermo.Active.Utils/supportFunctions.cs
+++ b/Thermo.Active.Utils/supportFunctions.cs
@@ -70,6 +70,21 @@ namespace Thermo.Active.Utils
return answ;
}
///
+ /// Conversion string --> TACT_AXIS_TYPE
+ ///
+ ///
+ ///
+ public static TACT_AXES_TYPE GetTActAxes_Type(string strValue)
+ {
+ TACT_AXES_TYPE answ = TACT_AXES_TYPE.NA;
+ try
+ {
+ answ = (TACT_AXES_TYPE)Enum.Parse(typeof(TACT_AXES_TYPE), strValue);
+ }
+ catch { }
+ return answ;
+ }
+ ///
/// Conversion string --> TACT_MBLOCK_TYPE
///
///
diff --git a/Thermo.Active/Listeners/ListenersHandler.cs b/Thermo.Active/Listeners/ListenersHandler.cs
index 98e6b5ac..f15b66d3 100644
--- a/Thermo.Active/Listeners/ListenersHandler.cs
+++ b/Thermo.Active/Listeners/ListenersHandler.cs
@@ -64,9 +64,13 @@ namespace Thermo.Active.Listeners
{
SignalRListener.SendAxesNamesData(a);
}));
- infos.Add(MessageServices.Current.Subscribe(SEND_AXES, (a, b) =>
+ infos.Add(MessageServices.Current.Subscribe(SEND_AXIS_POS, (a, b) =>
{
- SignalRListener.SendAxesToClient(a);
+ SignalRListener.SendThermoAxesPosition(a);
+ }));
+ infos.Add(MessageServices.Current.Subscribe(SEND_AXIS_INFO, (a, b) =>
+ {
+ SignalRListener.SendThermoAxesInfoData(a);
}));
infos.Add(MessageServices.Current.Subscribe(SEND_ACTIVE_PROGRAM_DATA, (a, b) =>
{
diff --git a/Thermo.Active/Listeners/SignalR/SignalRListener.cs b/Thermo.Active/Listeners/SignalR/SignalRListener.cs
index bc4f84f9..99708df3 100644
--- a/Thermo.Active/Listeners/SignalR/SignalRListener.cs
+++ b/Thermo.Active/Listeners/SignalR/SignalRListener.cs
@@ -9,6 +9,7 @@ using Thermo.Active.Controllers.SignalR;
using Thermo.Active.Model.DTOModels;
using Thermo.Active.Model.DTOModels.AlarmModels;
using Thermo.Active.Model.DTOModels.Scada;
+using Thermo.Active.Model.DTOModels.ThAxes;
using Thermo.Active.Model.DTOModels.ThModules;
using Thermo.Active.Model.DTOModels.ThProd;
using Thermo.Active.Model.DTOModels.ThRecipe;
@@ -34,16 +35,8 @@ namespace Thermo.Active.Listeners.SignalR
}
}
- public static void SendAxesToClient(object newAxesData)
- {
- if (!LastAxesPositions.Equals(newAxesData))
- {
- var context = GlobalHost.ConnectionManager.GetHubContext();
- LastAxesPositions = newAxesData as DTOAxesModel;
- context.Clients.Group("ncData").axesPositions(newAxesData);
- }
- }
+
public static void SendPowerOnDataToClient(object powerOnData)
{
@@ -170,19 +163,6 @@ namespace Thermo.Active.Listeners.SignalR
}
}
- public static void SendAxesNamesData(object axesNames)
- {
- var context = GlobalHost.ConnectionManager.GetHubContext();
- List newData = axesNames as List;
-
- // Check if collections are equals
- if (newData.Count != LastAxesNamesData.Count || !LastAxesNamesData.All(newData.Contains))
- {
- LastAxesNamesData = newData;
- // Send data to clients
- context.Clients.Group("ncData").axesNames(axesNames);
- }
- }
public static void SendActiveProgramData(object programData)
{
@@ -481,6 +461,41 @@ namespace Thermo.Active.Listeners.SignalR
}
+ public static void SendAxesNamesData(object axesNames)
+ {
+ var context = GlobalHost.ConnectionManager.GetHubContext();
+ List newData = axesNames as List;
+
+ // Check if collections are equals
+ if (newData.Count != LastAxesNamesData.Count || !LastAxesNamesData.All(newData.Contains))
+ {
+ LastAxesNamesData = newData;
+ // Send data to clients
+ context.Clients.Group("ncData").axesNames(axesNames);
+ }
+ }
+ public static void SendThermoAxesPosition(object newAxesData)
+ {
+ DTOThermoAxesMovModel currAxes = newAxesData as DTOThermoAxesMovModel;
+ if (!LastAxesPositions.Equals(currAxes))
+ {
+ LastAxesPositions = currAxes;
+
+ var context = GlobalHost.ConnectionManager.GetHubContext();
+ context.Clients.Group("ncData").axesPositions(currAxes);
+ }
+ }
+ public static void SendThermoAxesInfoData(object axesInfoData)
+ {
+ DTOAxesInfoModel currInfoAxes = axesInfoData as DTOAxesInfoModel;
+ if (!LastAxesInfoData.Equals(currInfoAxes))
+ {
+ LastAxesInfoData = currInfoAxes;
+
+ var context = GlobalHost.ConnectionManager.GetHubContext();
+ context.Clients.Group("ncData").axesInfo(currInfoAxes);
+ }
+ }
public static void SetGatewayRebootStatus(object status)
{
@@ -535,6 +550,8 @@ namespace Thermo.Active.Listeners.SignalR
group.axesNames(LastAxesNamesData);
// Send positions
group.axesPositions(LastAxesPositions);
+ // Send info
+ group.axesInfo(LastAxesInfoData);
// Send active program data
group.activeProgramData(LastProgramData);
// Send magazine is active data
diff --git a/Thermo.Active/Listeners/SignalRStaticObjects.cs b/Thermo.Active/Listeners/SignalRStaticObjects.cs
index 3a6eeeaa..23fe865c 100644
--- a/Thermo.Active/Listeners/SignalRStaticObjects.cs
+++ b/Thermo.Active/Listeners/SignalRStaticObjects.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using Thermo.Active.Model.DTOModels;
using Thermo.Active.Model.DTOModels.AlarmModels;
using Thermo.Active.Model.DTOModels.Scada;
+using Thermo.Active.Model.DTOModels.ThAxes;
using Thermo.Active.Model.DTOModels.ThModules;
using Thermo.Active.Model.DTOModels.ThProd;
using Thermo.Active.Model.DTOModels.ThRecipe;
@@ -22,8 +23,6 @@ namespace Thermo.Active.Listeners
public static List LastUserSoftKeysData = new List();
public static List LastNcSoftKeysData = new List();
public static List LastHeadsData = new List();
- public static DTOAxesModel LastAxesPositions = new DTOAxesModel();
- public static List LastAxesNamesData = new List();
public static DTOActiveProgramDataModel LastProgramData = new DTOActiveProgramDataModel();
public static Dictionary LastNcMagazineIsActive = new Dictionary();
public static List LastPartProgramQueue = new List();
@@ -33,7 +32,7 @@ namespace Thermo.Active.Listeners
public static List LastM156Data = new List();
public static List LastScadaData = new List();
- // FIXME TODO inserire oggetti corretti per THERMO
+ // Oggetti specifici per THERMO (1° definizione)
public static Dictionary LastRecipeFullData = new Dictionary();
public static Dictionary LastRecipeOverData = new Dictionary();
public static bool? recipeHasChanged = null;
@@ -44,6 +43,10 @@ namespace Thermo.Active.Listeners
public static ThermoModels.ProdCycleModel LastProdCycleData = new ThermoModels.ProdCycleModel();
public static DTOProdInfo LastProdInfoData = new DTOProdInfo();
public static DTOThermoPanelProd LastProdPanelData = new DTOThermoPanelProd();
+ // Oggetti per assi THERMO
+ public static List LastAxesNamesData = new List();
+ public static DTOAxesInfoModel LastAxesInfoData = new DTOAxesInfoModel();
+ public static DTOThermoAxesMovModel LastAxesPositions = new DTOThermoAxesMovModel();
public static bool LastIsNcConnected = false;
}
diff --git a/Thermo.Active/Properties/AssemblyInfo.cs b/Thermo.Active/Properties/AssemblyInfo.cs
index 521a4f22..38424c26 100644
--- a/Thermo.Active/Properties/AssemblyInfo.cs
+++ b/Thermo.Active/Properties/AssemblyInfo.cs
@@ -30,4 +30,4 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
-[assembly: AssemblyVersion("0.15.87")]
\ No newline at end of file
+[assembly: AssemblyVersion("0.15.88")]
\ No newline at end of file