@aryacode/dsh-engineering 0.4.7 → 0.4.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/CHANGELOG.md +202 -0
  2. package/README.md +40 -26
  3. package/cordis.patch.yml +7 -6
  4. package/entries/config.js +62 -0
  5. package/entries/ftview.js +5 -4
  6. package/entries/l5x.js +47 -15
  7. package/entries/mwi.js +26 -6
  8. package/entries/optix.js +105 -0
  9. package/lib/client.js +335 -6
  10. package/package.json +11 -10
  11. package/vendor/ftview/SKILL.md +17 -0
  12. package/vendor/l5x/SKILL.md +17 -0
  13. package/vendor/l5x/studio-bridge/NuGet.Config +1 -1
  14. package/vendor/mwi/README.md +41 -18
  15. package/vendor/mwi/SKILL.md +39 -20
  16. package/vendor/mwi/bridge/mw_bridge.ps1 +2768 -2763
  17. package/vendor/mwi/bridge/sdk-interop-importer.cs +30 -30
  18. package/vendor/mwi/bridge/sdk-variable-reader.cs +22 -22
  19. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/__init__.cpython-312.pyc +0 -0
  20. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/errors.cpython-312.pyc +0 -0
  21. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/staging.cpython-312.pyc +0 -0
  22. package/vendor/mwi/code/engine/motionworks_iec_mcp/build.py +339 -339
  23. package/vendor/mwi/code/engine/motionworks_iec_mcp/cfb.py +765 -765
  24. package/vendor/mwi/code/engine/motionworks_iec_mcp/declarations.py +399 -399
  25. package/vendor/mwi/code/engine/motionworks_iec_mcp/ide.py +313 -313
  26. package/vendor/mwi/code/engine/motionworks_iec_mcp/manuals.py +520 -520
  27. package/vendor/mwi/code/engine/motionworks_iec_mcp/mwt_bind.py +133 -133
  28. package/vendor/mwi/code/engine/motionworks_iec_mcp/reference_data/catalog.json +672 -672
  29. package/vendor/mwi/code/engine/motionworks_iec_mcp/reference_data/patterns.json +86 -86
  30. package/vendor/mwi/code/engine/motionworks_iec_mcp/restore.py +208 -208
  31. package/vendor/mwi/code/engine/motionworks_iec_mcp/staging.py +134 -130
  32. package/vendor/mwi/code/engine/motionworks_iec_mcp/stlint.py +673 -673
  33. package/vendor/mwi/code/engine/motionworks_iec_mcp/tree_writer.py +790 -790
  34. package/vendor/mwi/code/engine/motionworks_iec_mcp/writer.py +642 -642
  35. package/vendor/mwi/lib/core/code-engine.d.ts +13 -0
  36. package/vendor/mwi/lib/core/code-engine.js +18 -1
  37. package/vendor/mwi/lib/edit.d.ts +1 -1
  38. package/vendor/mwi/lib/edit.js +1 -1
  39. package/vendor/mwi/lib/read/service.js +8 -1
  40. package/vendor/mwi/lib/session/backup.d.ts +72 -0
  41. package/vendor/mwi/lib/session/backup.js +257 -0
  42. package/vendor/mwi/lib/session/project.d.ts +4 -1
  43. package/vendor/mwi/lib/session/project.js +13 -2
  44. package/vendor/mwi/lib/session/service.d.ts +13 -6
  45. package/vendor/mwi/lib/session/service.js +127 -36
  46. package/vendor/mwi/lib/session/workspace.d.ts +10 -0
  47. package/vendor/mwi/lib/session/workspace.js +53 -3
  48. package/vendor/mwi/lib/skill.d.ts +2 -2
  49. package/vendor/mwi/lib/skill.js +2 -2
  50. package/vendor/mwi/lib/tools/edit.d.ts +3 -3
  51. package/vendor/mwi/lib/tools/edit.js +14 -15
  52. package/vendor/mwi/lib/tools/read.js +1 -1
  53. package/vendor/mwi/lib/tools/session.js +13 -9
  54. package/vendor/optix/templates/arya-optix-ipc/project/AryaNewHMIProject_IPC.optix +81 -81
  55. package/vendor/optix/templates/arya-optix-ipc/project/AryaNewHMIProject_IPC.optix.design +38 -38
  56. package/vendor/optix/templates/arya-optix-ipc/project/Nodes/Alarms/Alarms.yaml +3 -3
  57. package/vendor/optix/templates/arya-optix-ipc/project/Nodes/AryaNewHMIProject_IPC.yaml +67 -67
  58. package/vendor/optix/templates/arya-optix-ipc/project/Nodes/CommDrivers/CommDrivers.yaml +2 -2
  59. package/vendor/optix/templates/arya-optix-ipc/project/Nodes/Converters/Converters.yaml +2 -2
  60. package/vendor/optix/templates/arya-optix-ipc/project/Nodes/DataStores/DataStores.yaml +2 -2
  61. package/vendor/optix/templates/arya-optix-ipc/project/Nodes/Loggers/Loggers.yaml +2 -2
  62. package/vendor/optix/templates/arya-optix-ipc/project/Nodes/MQTT/MQTT.yaml +2 -2
  63. package/vendor/optix/templates/arya-optix-ipc/project/Nodes/Model/Model.yaml +2 -2
  64. package/vendor/optix/templates/arya-optix-ipc/project/Nodes/NetLogic/NetLogic.yaml +26 -26
  65. package/vendor/optix/templates/arya-optix-ipc/project/Nodes/OPC-UA/OPC-UA.yaml +2 -2
  66. package/vendor/optix/templates/arya-optix-ipc/project/Nodes/Recipes/Recipes.yaml +2 -2
  67. package/vendor/optix/templates/arya-optix-ipc/project/Nodes/Reports/Reports.yaml +2 -2
  68. package/vendor/optix/templates/arya-optix-ipc/project/Nodes/Retentivity/Retentivity.yaml +57 -57
  69. package/vendor/optix/templates/arya-optix-ipc/project/Nodes/Security/Groups/Groups.yaml +3 -3
  70. package/vendor/optix/templates/arya-optix-ipc/project/Nodes/Security/Roles/Roles.yaml +3 -3
  71. package/vendor/optix/templates/arya-optix-ipc/project/Nodes/Security/Security.yaml +7 -7
  72. package/vendor/optix/templates/arya-optix-ipc/project/Nodes/Security/Users/Users.yaml +3 -3
  73. package/vendor/optix/templates/arya-optix-ipc/project/Nodes/System/System.yaml +2 -2
  74. package/vendor/optix/templates/arya-optix-ipc/project/Nodes/Translations/Translations.yaml +16 -16
  75. package/vendor/optix/templates/arya-optix-ipc/project/Nodes/UI/Keyboards/Keyboards.yaml +2 -2
  76. package/vendor/optix/templates/arya-optix-ipc/project/Nodes/UI/Screens/Screens.yaml +2 -2
  77. package/vendor/optix/templates/arya-optix-ipc/project/Nodes/UI/UI.yaml +250 -250
  78. package/vendor/optix/templates/arya-optix-ipc/project/ProjectFiles/NetSolution/.vscode/launch.json +18 -18
  79. package/vendor/optix/templates/arya-optix-ipc/project/ProjectFiles/NetSolution/AryaNewHMIProject_IPC.code-workspace +9 -9
  80. package/vendor/optix/templates/arya-optix-ipc/project/ProjectFiles/NetSolution/AryaNewHMIProject_IPC.csproj +19 -19
  81. package/vendor/optix/templates/arya-optix-ipc/project/ProjectFiles/NetSolution/AryaNewHMIProject_IPC.references +172 -172
  82. package/vendor/optix/templates/arya-optix-ipc/project/ProjectFiles/NetSolution/AryaNewHMIProject_IPC.sln +21 -21
  83. package/vendor/optix/templates/arya-optix-ipc/project/ProjectFiles/NetSolution/Private/TypeConstants.cs +20 -20
  84. package/vendor/optix/templates/arya-optix-ipc/project/ProjectFiles/NetSolution/Private/UITypeDefinitions.cs +11 -11
  85. package/vendor/optix/templates/arya-optix-ipc/project/ProjectFiles/NetSolution/StudioMCPBridge.cs +4340 -4340
  86. package/vendor/optix/templates/arya-optix-ipc/project/ProjectFiles/UserDefinedModule.xml +26 -26
  87. package/vendor/optix/templates/arya-optix-panel/project/AryaNewHMIProject_OptixPanel.optix +97 -97
  88. package/vendor/optix/templates/arya-optix-panel/project/AryaNewHMIProject_OptixPanel.optix.design +38 -38
  89. package/vendor/optix/templates/arya-optix-panel/project/Nodes/Alarms/Alarms.yaml +3 -3
  90. package/vendor/optix/templates/arya-optix-panel/project/Nodes/AryaNewHMIProject_OptixPanel.yaml +67 -67
  91. package/vendor/optix/templates/arya-optix-panel/project/Nodes/CommDrivers/CommDrivers.yaml +2 -2
  92. package/vendor/optix/templates/arya-optix-panel/project/Nodes/Converters/Converters.yaml +2 -2
  93. package/vendor/optix/templates/arya-optix-panel/project/Nodes/DataStores/DataStores.yaml +2 -2
  94. package/vendor/optix/templates/arya-optix-panel/project/Nodes/Loggers/Loggers.yaml +2 -2
  95. package/vendor/optix/templates/arya-optix-panel/project/Nodes/MQTT/MQTT.yaml +2 -2
  96. package/vendor/optix/templates/arya-optix-panel/project/Nodes/Model/Model.yaml +2 -2
  97. package/vendor/optix/templates/arya-optix-panel/project/Nodes/NetLogic/NetLogic.yaml +26 -26
  98. package/vendor/optix/templates/arya-optix-panel/project/Nodes/OPC-UA/OPC-UA.yaml +2 -2
  99. package/vendor/optix/templates/arya-optix-panel/project/Nodes/Recipes/Recipes.yaml +2 -2
  100. package/vendor/optix/templates/arya-optix-panel/project/Nodes/Reports/Reports.yaml +2 -2
  101. package/vendor/optix/templates/arya-optix-panel/project/Nodes/Retentivity/Retentivity.yaml +57 -57
  102. package/vendor/optix/templates/arya-optix-panel/project/Nodes/Security/Groups/Groups.yaml +3 -3
  103. package/vendor/optix/templates/arya-optix-panel/project/Nodes/Security/Roles/Roles.yaml +3 -3
  104. package/vendor/optix/templates/arya-optix-panel/project/Nodes/Security/Security.yaml +7 -7
  105. package/vendor/optix/templates/arya-optix-panel/project/Nodes/Security/Users/Users.yaml +3 -3
  106. package/vendor/optix/templates/arya-optix-panel/project/Nodes/System/System.yaml +444 -444
  107. package/vendor/optix/templates/arya-optix-panel/project/Nodes/Translations/Translations.yaml +81 -81
  108. package/vendor/optix/templates/arya-optix-panel/project/Nodes/UI/Keyboards/Keyboards.yaml +2 -2
  109. package/vendor/optix/templates/arya-optix-panel/project/Nodes/UI/Screens/Screens.yaml +2 -2
  110. package/vendor/optix/templates/arya-optix-panel/project/Nodes/UI/SettingsWidgets/DeviceSettingsWidget/DeviceSettingsWidget.yaml +163 -163
  111. package/vendor/optix/templates/arya-optix-panel/project/Nodes/UI/SettingsWidgets/DeviceSettingsWidget/DeviceSettingsWidgetComponents/DeviceSettingsWidgetComponents.yaml +1663 -1663
  112. package/vendor/optix/templates/arya-optix-panel/project/Nodes/UI/SettingsWidgets/FactoryTalkRemoteAccessWidget/FTRemoteAccessWidgetComponents/FTRemoteAccessWidgetComponents.yaml +2471 -2471
  113. package/vendor/optix/templates/arya-optix-panel/project/Nodes/UI/SettingsWidgets/FactoryTalkRemoteAccessWidget/FactoryTalkRemoteAccessWidget.yaml +218 -218
  114. package/vendor/optix/templates/arya-optix-panel/project/Nodes/UI/SettingsWidgets/NetworkSettingsWidget/NetworkSettingsWidget.yaml +524 -524
  115. package/vendor/optix/templates/arya-optix-panel/project/Nodes/UI/SettingsWidgets/NetworkSettingsWidget/NetworkSettingsWidgetComponents/NetworkSettingsWidgetComponents.yaml +690 -690
  116. package/vendor/optix/templates/arya-optix-panel/project/Nodes/UI/SettingsWidgets/SettingsWidgets.yaml +1265 -1265
  117. package/vendor/optix/templates/arya-optix-panel/project/Nodes/UI/UI.yaml +252 -252
  118. package/vendor/optix/templates/arya-optix-panel/project/ProjectFiles/NetSolution/.vscode/launch.json +18 -18
  119. package/vendor/optix/templates/arya-optix-panel/project/ProjectFiles/NetSolution/ApplicationNameLogic.cs +19 -19
  120. package/vendor/optix/templates/arya-optix-panel/project/ProjectFiles/NetSolution/AryaNewHMIProject_OptixPanel.code-workspace +9 -9
  121. package/vendor/optix/templates/arya-optix-panel/project/ProjectFiles/NetSolution/AryaNewHMIProject_OptixPanel.csproj +19 -19
  122. package/vendor/optix/templates/arya-optix-panel/project/ProjectFiles/NetSolution/AryaNewHMIProject_OptixPanel.references +172 -172
  123. package/vendor/optix/templates/arya-optix-panel/project/ProjectFiles/NetSolution/AryaNewHMIProject_OptixPanel.sln +21 -21
  124. package/vendor/optix/templates/arya-optix-panel/project/ProjectFiles/NetSolution/ConnectionSwitchLogic.cs +74 -74
  125. package/vendor/optix/templates/arya-optix-panel/project/ProjectFiles/NetSolution/DateAndTimeWidgetLogic.cs +420 -420
  126. package/vendor/optix/templates/arya-optix-panel/project/ProjectFiles/NetSolution/DeviceSettingsWidgetLogic.cs +34 -34
  127. package/vendor/optix/templates/arya-optix-panel/project/ProjectFiles/NetSolution/FTOptixStudioVersionLogic.cs +47 -47
  128. package/vendor/optix/templates/arya-optix-panel/project/ProjectFiles/NetSolution/FTRemoteAccessWidgetSetupLogic.cs +153 -153
  129. package/vendor/optix/templates/arya-optix-panel/project/ProjectFiles/NetSolution/IncomingConnectionApprovalLogic.cs +118 -118
  130. package/vendor/optix/templates/arya-optix-panel/project/ProjectFiles/NetSolution/IncomingConnectionReceiverLogic.cs +166 -166
  131. package/vendor/optix/templates/arya-optix-panel/project/ProjectFiles/NetSolution/NetworkConfiguratorEditModelsLogic.cs +56 -56
  132. package/vendor/optix/templates/arya-optix-panel/project/ProjectFiles/NetSolution/NetworkInterfaceLogic.cs +138 -138
  133. package/vendor/optix/templates/arya-optix-panel/project/ProjectFiles/NetSolution/NetworkInterfacesEditModelReaderLogic.cs +87 -87
  134. package/vendor/optix/templates/arya-optix-panel/project/ProjectFiles/NetSolution/NetworkInterfacesEditModelToSystemWriterLogic.cs +139 -139
  135. package/vendor/optix/templates/arya-optix-panel/project/ProjectFiles/NetSolution/NetworkSettingsLogic.cs +168 -168
  136. package/vendor/optix/templates/arya-optix-panel/project/ProjectFiles/NetSolution/Private/FTRemoteAccessWidgetDataObject.cs +106 -106
  137. package/vendor/optix/templates/arya-optix-panel/project/ProjectFiles/NetSolution/Private/TypeConstants.cs +37 -37
  138. package/vendor/optix/templates/arya-optix-panel/project/ProjectFiles/NetSolution/Private/UITypeDefinitions.cs +91 -91
  139. package/vendor/optix/templates/arya-optix-panel/project/ProjectFiles/NetSolution/RequestAssistanceSwitchLogic.cs +93 -93
  140. package/vendor/optix/templates/arya-optix-panel/project/ProjectFiles/NetSolution/StudioMCPBridge.cs +4340 -4340
  141. package/vendor/optix/templates/arya-optix-panel/project/ProjectFiles/NetSolution/SystemToNetworkInterfacesEditModelWriterLogic.cs +77 -77
  142. package/vendor/optix/templates/arya-optix-panel/project/ProjectFiles/UserDefinedModule.xml +111 -111
  143. package/vendor/optix/templates/arya-optix-panel/project/ProjectFiles/WarningIcon.svg +4 -4
  144. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/block_interfaces.cpython-312.pyc +0 -0
  145. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/cfb.cpython-312.pyc +0 -0
  146. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/datatypes.cpython-312.pyc +0 -0
  147. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/declarations.cpython-312.pyc +0 -0
  148. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/graphical_listing.cpython-312.pyc +0 -0
  149. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/grid.cpython-312.pyc +0 -0
  150. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/knowledge.cpython-312.pyc +0 -0
  151. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/mwt_bind.cpython-312.pyc +0 -0
  152. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/navigation.cpython-312.pyc +0 -0
  153. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/program_checks.cpython-312.pyc +0 -0
  154. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/project.cpython-312.pyc +0 -0
  155. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/structure.cpython-312.pyc +0 -0
  156. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/task_bindings.cpython-312.pyc +0 -0
  157. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/tasks.cpython-312.pyc +0 -0
  158. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/tree.cpython-312.pyc +0 -0
  159. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/validation.cpython-312.pyc +0 -0
  160. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/variable_edit.cpython-312.pyc +0 -0
  161. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/variables.cpython-312.pyc +0 -0
  162. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/workflow.cpython-312.pyc +0 -0
@@ -1,34 +1,34 @@
1
- #region Using directives
2
- using UAManagedCore;
3
- using FTOptix.HMIProject;
4
- using FTOptix.NetLogic;
5
- #endregion
6
-
7
- public class DeviceSettingsWidgetLogic : BaseNetLogic
8
- {
9
- private const string LOGGING_CATEGORY = nameof(DeviceSettingsWidgetLogic);
10
-
11
- public override void Start()
12
- {
13
- IUAVariable systemNodePointer = Owner.GetVariable("SystemNode");
14
- if (systemNodePointer == null)
15
- {
16
- Log.Error(LOGGING_CATEGORY, "SystemNode NodePointer not found.");
17
- return;
18
- }
19
-
20
- NodeId systemNodeId = (NodeId)systemNodePointer.Value;
21
- if (systemNodeId == null || systemNodeId == NodeId.Empty)
22
- {
23
- Log.Error(LOGGING_CATEGORY, "SystemNode is not defined.");
24
- return;
25
- }
26
-
27
- if (InformationModel.Get(systemNodeId) is not FTOptix.System.System)
28
- Log.Error(LOGGING_CATEGORY, "SystemNode not found.");
29
- }
30
-
31
- public override void Stop()
32
- {
33
- }
34
- }
1
+ #region Using directives
2
+ using UAManagedCore;
3
+ using FTOptix.HMIProject;
4
+ using FTOptix.NetLogic;
5
+ #endregion
6
+
7
+ public class DeviceSettingsWidgetLogic : BaseNetLogic
8
+ {
9
+ private const string LOGGING_CATEGORY = nameof(DeviceSettingsWidgetLogic);
10
+
11
+ public override void Start()
12
+ {
13
+ IUAVariable systemNodePointer = Owner.GetVariable("SystemNode");
14
+ if (systemNodePointer == null)
15
+ {
16
+ Log.Error(LOGGING_CATEGORY, "SystemNode NodePointer not found.");
17
+ return;
18
+ }
19
+
20
+ NodeId systemNodeId = (NodeId)systemNodePointer.Value;
21
+ if (systemNodeId == null || systemNodeId == NodeId.Empty)
22
+ {
23
+ Log.Error(LOGGING_CATEGORY, "SystemNode is not defined.");
24
+ return;
25
+ }
26
+
27
+ if (InformationModel.Get(systemNodeId) is not FTOptix.System.System)
28
+ Log.Error(LOGGING_CATEGORY, "SystemNode not found.");
29
+ }
30
+
31
+ public override void Stop()
32
+ {
33
+ }
34
+ }
@@ -1,47 +1,47 @@
1
- #region Using directives
2
- using System.IO;
3
- using FTOptix.NetLogic;
4
- using FTOptix.UI;
5
- using FTOptix.SerialPort;
6
- #endregion
7
-
8
- public class FTOptixStudioVersionLogic : BaseNetLogic
9
- {
10
- public override void Start()
11
- {
12
- string strExeFilePath = System.Reflection.Assembly.GetExecutingAssembly().Location;
13
- string strWorkPath = Path.GetDirectoryName(strExeFilePath);
14
- string versionFile = strWorkPath + Path.DirectorySeparatorChar
15
- + ".." + Path.DirectorySeparatorChar
16
- + ".." + Path.DirectorySeparatorChar
17
- + ".." + Path.DirectorySeparatorChar
18
- + "IDEVersion.txt";
19
-
20
- var fileStream = new FileStream(versionFile, FileMode.Open, FileAccess.Read);
21
- // Read the source file into a byte array.
22
- byte[] bytes = new byte[fileStream.Length];
23
- int numBytesToRead = (int)fileStream.Length;
24
- int numBytesRead = 0;
25
- while (numBytesToRead > 0)
26
- {
27
- // Read may return anything from 0 to numBytesToRead.
28
- var n = fileStream.Read(bytes, numBytesRead, numBytesToRead);
29
-
30
- // Break when the end of the file is reached.
31
- if (n == 0)
32
- break;
33
-
34
- numBytesRead += n;
35
- numBytesToRead -= n;
36
- }
37
-
38
- var versionString = System.Text.Encoding.UTF8.GetString(bytes, 0, bytes.Length);
39
-
40
- Label label = Owner as Label;
41
- label.Text = versionString;
42
- }
43
-
44
- public override void Stop()
45
- {
46
- }
47
- }
1
+ #region Using directives
2
+ using System.IO;
3
+ using FTOptix.NetLogic;
4
+ using FTOptix.UI;
5
+ using FTOptix.SerialPort;
6
+ #endregion
7
+
8
+ public class FTOptixStudioVersionLogic : BaseNetLogic
9
+ {
10
+ public override void Start()
11
+ {
12
+ string strExeFilePath = System.Reflection.Assembly.GetExecutingAssembly().Location;
13
+ string strWorkPath = Path.GetDirectoryName(strExeFilePath);
14
+ string versionFile = strWorkPath + Path.DirectorySeparatorChar
15
+ + ".." + Path.DirectorySeparatorChar
16
+ + ".." + Path.DirectorySeparatorChar
17
+ + ".." + Path.DirectorySeparatorChar
18
+ + "IDEVersion.txt";
19
+
20
+ var fileStream = new FileStream(versionFile, FileMode.Open, FileAccess.Read);
21
+ // Read the source file into a byte array.
22
+ byte[] bytes = new byte[fileStream.Length];
23
+ int numBytesToRead = (int)fileStream.Length;
24
+ int numBytesRead = 0;
25
+ while (numBytesToRead > 0)
26
+ {
27
+ // Read may return anything from 0 to numBytesToRead.
28
+ var n = fileStream.Read(bytes, numBytesRead, numBytesToRead);
29
+
30
+ // Break when the end of the file is reached.
31
+ if (n == 0)
32
+ break;
33
+
34
+ numBytesRead += n;
35
+ numBytesToRead -= n;
36
+ }
37
+
38
+ var versionString = System.Text.Encoding.UTF8.GetString(bytes, 0, bytes.Length);
39
+
40
+ Label label = Owner as Label;
41
+ label.Text = versionString;
42
+ }
43
+
44
+ public override void Stop()
45
+ {
46
+ }
47
+ }
@@ -1,153 +1,153 @@
1
- #region Using directives
2
- using UAManagedCore;
3
- using OpcUa = UAManagedCore.OpcUa;
4
- using FTOptix.HMIProject;
5
- using FTOptix.System;
6
- using FTOptix.NetLogic;
7
- using FTOptix.Core;
8
- using FTOptix.CoreBase;
9
- #endregion
10
-
11
- public class FTRemoteAccessWidgetSetupLogic : BaseNetLogic
12
- {
13
- private const string LOG_CATEGORY = nameof(FTRemoteAccessWidgetSetupLogic);
14
-
15
- [ExportMethod]
16
- public void SetupFTRemoteAccessNode()
17
- {
18
- var ftRemoteAccessNodePointer = Owner.Get<NodePointer>("FTRemoteAccessNode");
19
- if (ftRemoteAccessNodePointer == null)
20
- {
21
- Log.Error(LOG_CATEGORY, "FTRemoteAccessNode property not defined.");
22
- return;
23
- }
24
-
25
- if (Owner.Context.GetNode(ftRemoteAccessNodePointer.Value) is not FTRemoteAccess ftRemoteAccessNode)
26
- {
27
- Log.Error(LOG_CATEGORY, "FTRemoteAccessNode is not defined.");
28
- return;
29
- }
30
-
31
- var eventArguments = InformationModel.MakeObject("EventArguments", FTOptix.System.ObjectTypes.RemoteConnectionRequestEvent);
32
-
33
- if (ftRemoteAccessNode.Get("RemoteConnectionRequestEventHandler") is not EventHandler eventHandlerNode)
34
- {
35
- eventHandlerNode = InformationModel.MakeObject<EventHandler>("RemoteConnectionRequestEventHandler");
36
- ftRemoteAccessNode.Add(eventHandlerNode);
37
- eventHandlerNode.ListenEventType = FTOptix.System.ObjectTypes.RemoteConnectionRequestEvent;
38
- eventHandlerNode.Add(eventArguments);
39
- }
40
-
41
- CreateVariables(ftRemoteAccessNode, eventHandlerNode, eventArguments);
42
- }
43
-
44
- private static void CreateVariables(FTRemoteAccess ftRemoteAccessNode,
45
- EventHandler eventHandlerNode,
46
- IUAObject eventArguments)
47
- {
48
- const string usernameVariableName = "FTRemoteAccessWidgetUsername";
49
- const string ipAddressVariableName = "FTRemoteAccessWidgetIPAddress";
50
- const string supervisorIdVariableName = "FTRemoteAccessWidgetSupervisorId";
51
- const string connectionPendingVariableName = "FTRemoteAccessWidgetConnectionPending";
52
- const string getErrorMessage = "Unable to get event argument: ";
53
-
54
- Log.Info(LOG_CATEGORY, "Creating FTRemoteAccess widget variables and Remote Connection Request event commands.");
55
-
56
- IUAVariable usernameVariable = ftRemoteAccessNode.GetVariable(usernameVariableName);
57
- if (usernameVariable == null)
58
- {
59
- usernameVariable = InformationModel.MakeVariable(usernameVariableName, OpcUa.DataTypes.String);
60
- ftRemoteAccessNode.Add(usernameVariable);
61
- }
62
-
63
- IUAVariable eventArgumentUsernameVariable = eventArguments.GetVariable("Username");
64
- if (eventArgumentUsernameVariable == null)
65
- {
66
- Log.Error(LOG_CATEGORY, getErrorMessage + "Username");
67
- return;
68
- }
69
-
70
- SetupEventHandler(eventHandlerNode, usernameVariable, OpcUa.DataTypes.String, eventArgumentUsernameVariable);
71
-
72
- IUAVariable ipAddressVariable = ftRemoteAccessNode.GetVariable(ipAddressVariableName);
73
- if (ipAddressVariable == null)
74
- {
75
- ipAddressVariable = InformationModel.MakeVariable(ipAddressVariableName, OpcUa.DataTypes.String);
76
- ftRemoteAccessNode.Add(ipAddressVariable);
77
- }
78
-
79
- IUAVariable eventArgumentIpAddressVariable = eventArguments.GetVariable("IpAddress");
80
- if (eventArgumentIpAddressVariable == null)
81
- {
82
- Log.Error(LOG_CATEGORY, getErrorMessage + "IpAddress");
83
- return;
84
- }
85
-
86
- SetupEventHandler(eventHandlerNode, ipAddressVariable, OpcUa.DataTypes.String, eventArgumentIpAddressVariable);
87
-
88
- IUAVariable supervisorIdVariable = ftRemoteAccessNode.GetVariable(supervisorIdVariableName);
89
- if (supervisorIdVariable == null)
90
- {
91
- supervisorIdVariable = InformationModel.MakeVariable(supervisorIdVariableName, OpcUa.DataTypes.ByteString);
92
- ftRemoteAccessNode.Add(supervisorIdVariable);
93
- }
94
-
95
- IUAVariable eventArgumentSupervisorIdVariable = eventArguments.GetVariable("SupervisorId");
96
- if (eventArgumentSupervisorIdVariable == null)
97
- {
98
- Log.Error(LOG_CATEGORY, getErrorMessage + "SupervisorId");
99
- return;
100
- }
101
-
102
- SetupEventHandler(eventHandlerNode, supervisorIdVariable, OpcUa.DataTypes.ByteString, eventArgumentSupervisorIdVariable);
103
-
104
- IUAVariable connectionPendingVariable = ftRemoteAccessNode.GetVariable(connectionPendingVariableName);
105
- if (connectionPendingVariable == null)
106
- {
107
- connectionPendingVariable = InformationModel.MakeVariable(connectionPendingVariableName, OpcUa.DataTypes.Boolean);
108
- ftRemoteAccessNode.Add(connectionPendingVariable);
109
- }
110
-
111
- SetupEventHandler(eventHandlerNode, connectionPendingVariable, OpcUa.DataTypes.Boolean, null);
112
- }
113
-
114
- private static void SetupEventHandler(EventHandler eventHandlerNode,
115
- IUAVariable variableNode,
116
- NodeId valueType,
117
- IUAVariable eventArgumentVariable)
118
- {
119
- string methodContainerName = "MethodContainer" + variableNode.BrowseName;
120
- IUANode methodContainerNode = eventHandlerNode.Find(methodContainerName);
121
- if (methodContainerNode != null)
122
- return;
123
-
124
- var methodContainer = InformationModel.MakeObject(methodContainerName);
125
- eventHandlerNode.MethodsToCall.Add(methodContainer);
126
-
127
- var objectPointerVariable = InformationModel.MakeVariable<NodePointer>("ObjectPointer", OpcUa.DataTypes.NodeId);
128
- objectPointerVariable.Value = InformationModel.GetObject(FTOptix.CoreBase.Objects.VariableCommands).NodeId;
129
- methodContainer.Add(objectPointerVariable);
130
-
131
- var methodNameVariable = InformationModel.MakeVariable("Method", OpcUa.DataTypes.String);
132
- methodNameVariable.Value = "Set";
133
- methodContainer.Add(methodNameVariable);
134
-
135
- var inputArguments = InformationModel.MakeObject("InputArguments");
136
- methodContainer.Add(inputArguments);
137
-
138
- var variableToModify = InformationModel.MakeVariable("VariableToModify", FTOptix.Core.DataTypes.VariablePointer);
139
- variableToModify.Value = variableNode.NodeId;
140
- inputArguments.Add(variableToModify);
141
-
142
- var valueVariable = InformationModel.MakeVariable("Value", valueType);
143
- if (eventArgumentVariable != null)
144
- valueVariable.SetDynamicLink(eventArgumentVariable, DynamicLinkMode.ReadWrite);
145
- if (valueType == OpcUa.DataTypes.Boolean)
146
- valueVariable.Value = true;
147
- inputArguments.Add(valueVariable);
148
-
149
- var arrayIndexVariable = InformationModel.MakeVariable("ArrayIndex", OpcUa.DataTypes.UInt32);
150
- arrayIndexVariable.ValueRank = ValueRank.ScalarOrOneDimension;
151
- inputArguments.Add(arrayIndexVariable);
152
- }
153
- }
1
+ #region Using directives
2
+ using UAManagedCore;
3
+ using OpcUa = UAManagedCore.OpcUa;
4
+ using FTOptix.HMIProject;
5
+ using FTOptix.System;
6
+ using FTOptix.NetLogic;
7
+ using FTOptix.Core;
8
+ using FTOptix.CoreBase;
9
+ #endregion
10
+
11
+ public class FTRemoteAccessWidgetSetupLogic : BaseNetLogic
12
+ {
13
+ private const string LOG_CATEGORY = nameof(FTRemoteAccessWidgetSetupLogic);
14
+
15
+ [ExportMethod]
16
+ public void SetupFTRemoteAccessNode()
17
+ {
18
+ var ftRemoteAccessNodePointer = Owner.Get<NodePointer>("FTRemoteAccessNode");
19
+ if (ftRemoteAccessNodePointer == null)
20
+ {
21
+ Log.Error(LOG_CATEGORY, "FTRemoteAccessNode property not defined.");
22
+ return;
23
+ }
24
+
25
+ if (Owner.Context.GetNode(ftRemoteAccessNodePointer.Value) is not FTRemoteAccess ftRemoteAccessNode)
26
+ {
27
+ Log.Error(LOG_CATEGORY, "FTRemoteAccessNode is not defined.");
28
+ return;
29
+ }
30
+
31
+ var eventArguments = InformationModel.MakeObject("EventArguments", FTOptix.System.ObjectTypes.RemoteConnectionRequestEvent);
32
+
33
+ if (ftRemoteAccessNode.Get("RemoteConnectionRequestEventHandler") is not EventHandler eventHandlerNode)
34
+ {
35
+ eventHandlerNode = InformationModel.MakeObject<EventHandler>("RemoteConnectionRequestEventHandler");
36
+ ftRemoteAccessNode.Add(eventHandlerNode);
37
+ eventHandlerNode.ListenEventType = FTOptix.System.ObjectTypes.RemoteConnectionRequestEvent;
38
+ eventHandlerNode.Add(eventArguments);
39
+ }
40
+
41
+ CreateVariables(ftRemoteAccessNode, eventHandlerNode, eventArguments);
42
+ }
43
+
44
+ private static void CreateVariables(FTRemoteAccess ftRemoteAccessNode,
45
+ EventHandler eventHandlerNode,
46
+ IUAObject eventArguments)
47
+ {
48
+ const string usernameVariableName = "FTRemoteAccessWidgetUsername";
49
+ const string ipAddressVariableName = "FTRemoteAccessWidgetIPAddress";
50
+ const string supervisorIdVariableName = "FTRemoteAccessWidgetSupervisorId";
51
+ const string connectionPendingVariableName = "FTRemoteAccessWidgetConnectionPending";
52
+ const string getErrorMessage = "Unable to get event argument: ";
53
+
54
+ Log.Info(LOG_CATEGORY, "Creating FTRemoteAccess widget variables and Remote Connection Request event commands.");
55
+
56
+ IUAVariable usernameVariable = ftRemoteAccessNode.GetVariable(usernameVariableName);
57
+ if (usernameVariable == null)
58
+ {
59
+ usernameVariable = InformationModel.MakeVariable(usernameVariableName, OpcUa.DataTypes.String);
60
+ ftRemoteAccessNode.Add(usernameVariable);
61
+ }
62
+
63
+ IUAVariable eventArgumentUsernameVariable = eventArguments.GetVariable("Username");
64
+ if (eventArgumentUsernameVariable == null)
65
+ {
66
+ Log.Error(LOG_CATEGORY, getErrorMessage + "Username");
67
+ return;
68
+ }
69
+
70
+ SetupEventHandler(eventHandlerNode, usernameVariable, OpcUa.DataTypes.String, eventArgumentUsernameVariable);
71
+
72
+ IUAVariable ipAddressVariable = ftRemoteAccessNode.GetVariable(ipAddressVariableName);
73
+ if (ipAddressVariable == null)
74
+ {
75
+ ipAddressVariable = InformationModel.MakeVariable(ipAddressVariableName, OpcUa.DataTypes.String);
76
+ ftRemoteAccessNode.Add(ipAddressVariable);
77
+ }
78
+
79
+ IUAVariable eventArgumentIpAddressVariable = eventArguments.GetVariable("IpAddress");
80
+ if (eventArgumentIpAddressVariable == null)
81
+ {
82
+ Log.Error(LOG_CATEGORY, getErrorMessage + "IpAddress");
83
+ return;
84
+ }
85
+
86
+ SetupEventHandler(eventHandlerNode, ipAddressVariable, OpcUa.DataTypes.String, eventArgumentIpAddressVariable);
87
+
88
+ IUAVariable supervisorIdVariable = ftRemoteAccessNode.GetVariable(supervisorIdVariableName);
89
+ if (supervisorIdVariable == null)
90
+ {
91
+ supervisorIdVariable = InformationModel.MakeVariable(supervisorIdVariableName, OpcUa.DataTypes.ByteString);
92
+ ftRemoteAccessNode.Add(supervisorIdVariable);
93
+ }
94
+
95
+ IUAVariable eventArgumentSupervisorIdVariable = eventArguments.GetVariable("SupervisorId");
96
+ if (eventArgumentSupervisorIdVariable == null)
97
+ {
98
+ Log.Error(LOG_CATEGORY, getErrorMessage + "SupervisorId");
99
+ return;
100
+ }
101
+
102
+ SetupEventHandler(eventHandlerNode, supervisorIdVariable, OpcUa.DataTypes.ByteString, eventArgumentSupervisorIdVariable);
103
+
104
+ IUAVariable connectionPendingVariable = ftRemoteAccessNode.GetVariable(connectionPendingVariableName);
105
+ if (connectionPendingVariable == null)
106
+ {
107
+ connectionPendingVariable = InformationModel.MakeVariable(connectionPendingVariableName, OpcUa.DataTypes.Boolean);
108
+ ftRemoteAccessNode.Add(connectionPendingVariable);
109
+ }
110
+
111
+ SetupEventHandler(eventHandlerNode, connectionPendingVariable, OpcUa.DataTypes.Boolean, null);
112
+ }
113
+
114
+ private static void SetupEventHandler(EventHandler eventHandlerNode,
115
+ IUAVariable variableNode,
116
+ NodeId valueType,
117
+ IUAVariable eventArgumentVariable)
118
+ {
119
+ string methodContainerName = "MethodContainer" + variableNode.BrowseName;
120
+ IUANode methodContainerNode = eventHandlerNode.Find(methodContainerName);
121
+ if (methodContainerNode != null)
122
+ return;
123
+
124
+ var methodContainer = InformationModel.MakeObject(methodContainerName);
125
+ eventHandlerNode.MethodsToCall.Add(methodContainer);
126
+
127
+ var objectPointerVariable = InformationModel.MakeVariable<NodePointer>("ObjectPointer", OpcUa.DataTypes.NodeId);
128
+ objectPointerVariable.Value = InformationModel.GetObject(FTOptix.CoreBase.Objects.VariableCommands).NodeId;
129
+ methodContainer.Add(objectPointerVariable);
130
+
131
+ var methodNameVariable = InformationModel.MakeVariable("Method", OpcUa.DataTypes.String);
132
+ methodNameVariable.Value = "Set";
133
+ methodContainer.Add(methodNameVariable);
134
+
135
+ var inputArguments = InformationModel.MakeObject("InputArguments");
136
+ methodContainer.Add(inputArguments);
137
+
138
+ var variableToModify = InformationModel.MakeVariable("VariableToModify", FTOptix.Core.DataTypes.VariablePointer);
139
+ variableToModify.Value = variableNode.NodeId;
140
+ inputArguments.Add(variableToModify);
141
+
142
+ var valueVariable = InformationModel.MakeVariable("Value", valueType);
143
+ if (eventArgumentVariable != null)
144
+ valueVariable.SetDynamicLink(eventArgumentVariable, DynamicLinkMode.ReadWrite);
145
+ if (valueType == OpcUa.DataTypes.Boolean)
146
+ valueVariable.Value = true;
147
+ inputArguments.Add(valueVariable);
148
+
149
+ var arrayIndexVariable = InformationModel.MakeVariable("ArrayIndex", OpcUa.DataTypes.UInt32);
150
+ arrayIndexVariable.ValueRank = ValueRank.ScalarOrOneDimension;
151
+ inputArguments.Add(arrayIndexVariable);
152
+ }
153
+ }