rsmp 0.46.0 → 0.48.0

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 (433) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/copilot-setup-steps.yml +1 -1
  3. data/.github/workflows/rubocop.yaml +1 -1
  4. data/.github/workflows/sus.yaml +1 -1
  5. data/CHANGELOG.md +14 -0
  6. data/Gemfile.lock +5 -5
  7. data/README.md +3 -1
  8. data/documentation/cli.md +225 -0
  9. data/documentation/configuration.md +83 -0
  10. data/lib/rsmp/cli/configuration.rb +30 -0
  11. data/lib/rsmp/cli.rb +45 -45
  12. data/lib/rsmp/collect/command_matcher.rb +13 -4
  13. data/lib/rsmp/collect/status_matcher.rb +14 -4
  14. data/lib/rsmp/command_list.rb +1 -1
  15. data/lib/rsmp/config.rb +63 -0
  16. data/lib/rsmp/convert/export/json_schema/index.rb +64 -0
  17. data/lib/rsmp/convert/export/json_schema/items.rb +9 -1
  18. data/lib/rsmp/convert/export/json_schema/outputs.rb +65 -25
  19. data/lib/rsmp/convert/export/json_schema/values.rb +40 -11
  20. data/lib/rsmp/convert/export/json_schema.rb +3 -1
  21. data/lib/rsmp/message/sxl_codec.rb +194 -0
  22. data/lib/rsmp/message.rb +2 -0
  23. data/lib/rsmp/node/site/connections.rb +80 -0
  24. data/lib/rsmp/node/site/site.rb +21 -35
  25. data/lib/rsmp/node/supervisor/supervisor.rb +42 -0
  26. data/lib/rsmp/options/options.rb +21 -9
  27. data/lib/rsmp/options/schemas/config_common.json +129 -0
  28. data/lib/rsmp/options/schemas/log.json +71 -0
  29. data/lib/rsmp/options/schemas/site.json +12 -57
  30. data/lib/rsmp/options/schemas/supervisor.json +4 -29
  31. data/lib/rsmp/options/schemas/supervisor_site.json +19 -31
  32. data/lib/rsmp/options/schemas/traffic_controller_site.json +1 -2
  33. data/lib/rsmp/options/site_options.rb +31 -23
  34. data/lib/rsmp/options/supervisor_options.rb +1 -0
  35. data/lib/rsmp/proxy/modules/receive.rb +3 -1
  36. data/lib/rsmp/proxy/modules/send.rb +26 -14
  37. data/lib/rsmp/proxy/proxy.rb +17 -0
  38. data/lib/rsmp/proxy/site/connection.rb +79 -0
  39. data/lib/rsmp/proxy/site/modules/commands.rb +24 -1
  40. data/lib/rsmp/proxy/site/site_proxy.rb +6 -15
  41. data/lib/rsmp/proxy/supervisor/modules/commands.rb +55 -0
  42. data/lib/rsmp/proxy/supervisor/modules/message_buffer.rb +0 -5
  43. data/lib/rsmp/proxy/supervisor/modules/status.rb +13 -104
  44. data/lib/rsmp/proxy/supervisor/modules/status_updates.rb +148 -0
  45. data/lib/rsmp/proxy/supervisor/supervisor_proxy.rb +19 -0
  46. data/lib/rsmp/schema.rb +38 -1
  47. data/lib/rsmp/tlc/detector_logic.rb +2 -2
  48. data/lib/rsmp/tlc/modules/helpers.rb +0 -22
  49. data/lib/rsmp/tlc/modules/inputs.rb +4 -3
  50. data/lib/rsmp/tlc/modules/modes.rb +2 -2
  51. data/lib/rsmp/tlc/modules/plans.rb +7 -3
  52. data/lib/rsmp/tlc/modules/system.rb +1 -1
  53. data/lib/rsmp/tlc/proxy/control.rb +19 -19
  54. data/lib/rsmp/tlc/proxy/detectors.rb +3 -3
  55. data/lib/rsmp/tlc/proxy/io.rb +15 -12
  56. data/lib/rsmp/tlc/proxy/plans.rb +14 -14
  57. data/lib/rsmp/tlc/proxy/status.rb +9 -5
  58. data/lib/rsmp/tlc/proxy/system.rb +12 -6
  59. data/lib/rsmp/tlc/signal_group.rb +2 -2
  60. data/lib/rsmp/tlc/supervisor_interface.rb +42 -0
  61. data/lib/rsmp/tlc/traffic_controller_site.rb +1 -18
  62. data/lib/rsmp/version.rb +1 -1
  63. data/lib/rsmp.rb +5 -0
  64. data/schemas/core/3.1.4/command_response.json +11 -0
  65. data/schemas/core/3.1.5/command_response.json +11 -0
  66. data/schemas/core/3.2.0/command_response.json +11 -0
  67. data/schemas/core/3.2.1/command_response.json +11 -0
  68. data/schemas/core/3.2.2/command_response.json +11 -0
  69. data/schemas/core/3.3.0/command_response.json +11 -0
  70. data/schemas/tlc/1.0.10/alarms/A0008.json +21 -15
  71. data/schemas/tlc/1.0.10/alarms/A0201.json +26 -20
  72. data/schemas/tlc/1.0.10/alarms/A0202.json +26 -20
  73. data/schemas/tlc/1.0.10/alarms/A0301.json +69 -63
  74. data/schemas/tlc/1.0.10/alarms/A0302.json +87 -81
  75. data/schemas/tlc/1.0.10/commands/M0001.json +66 -60
  76. data/schemas/tlc/1.0.10/commands/M0002.json +48 -42
  77. data/schemas/tlc/1.0.10/commands/M0003.json +48 -42
  78. data/schemas/tlc/1.0.10/commands/M0004.json +35 -29
  79. data/schemas/tlc/1.0.10/commands/M0005.json +48 -42
  80. data/schemas/tlc/1.0.10/commands/M0006.json +48 -42
  81. data/schemas/tlc/1.0.10/commands/M0007.json +35 -29
  82. data/schemas/tlc/1.0.10/commands/M0008.json +48 -42
  83. data/schemas/tlc/1.0.10/commands/M0010.json +35 -29
  84. data/schemas/tlc/1.0.10/commands/M0011.json +35 -29
  85. data/schemas/tlc/1.0.10/commands/M0012.json +35 -29
  86. data/schemas/tlc/1.0.10/commands/M0013.json +35 -29
  87. data/schemas/tlc/1.0.10/commands/M0019.json +61 -55
  88. data/schemas/tlc/1.0.10/commands/M0103.json +51 -45
  89. data/schemas/tlc/1.0.10/commands/M0104.json +100 -94
  90. data/schemas/tlc/1.0.10/commands/command_requests.json +995 -1
  91. data/schemas/tlc/1.0.10/defs/guards.json +19 -0
  92. data/schemas/tlc/1.0.10/sxl.yaml +56 -56
  93. data/schemas/tlc/1.0.10/sxl_index.json +226 -244
  94. data/schemas/tlc/1.0.13/alarms/A0008.json +21 -15
  95. data/schemas/tlc/1.0.13/alarms/A0201.json +26 -20
  96. data/schemas/tlc/1.0.13/alarms/A0202.json +26 -20
  97. data/schemas/tlc/1.0.13/alarms/A0301.json +69 -63
  98. data/schemas/tlc/1.0.13/alarms/A0302.json +87 -81
  99. data/schemas/tlc/1.0.13/commands/M0001.json +66 -60
  100. data/schemas/tlc/1.0.13/commands/M0002.json +48 -42
  101. data/schemas/tlc/1.0.13/commands/M0003.json +48 -42
  102. data/schemas/tlc/1.0.13/commands/M0004.json +35 -29
  103. data/schemas/tlc/1.0.13/commands/M0005.json +48 -42
  104. data/schemas/tlc/1.0.13/commands/M0006.json +48 -42
  105. data/schemas/tlc/1.0.13/commands/M0007.json +35 -29
  106. data/schemas/tlc/1.0.13/commands/M0008.json +48 -42
  107. data/schemas/tlc/1.0.13/commands/M0010.json +35 -29
  108. data/schemas/tlc/1.0.13/commands/M0011.json +35 -29
  109. data/schemas/tlc/1.0.13/commands/M0012.json +35 -29
  110. data/schemas/tlc/1.0.13/commands/M0013.json +35 -29
  111. data/schemas/tlc/1.0.13/commands/M0014.json +48 -42
  112. data/schemas/tlc/1.0.13/commands/M0015.json +48 -42
  113. data/schemas/tlc/1.0.13/commands/M0016.json +35 -29
  114. data/schemas/tlc/1.0.13/commands/M0017.json +35 -29
  115. data/schemas/tlc/1.0.13/commands/M0018.json +48 -42
  116. data/schemas/tlc/1.0.13/commands/M0019.json +61 -55
  117. data/schemas/tlc/1.0.13/commands/M0103.json +51 -45
  118. data/schemas/tlc/1.0.13/commands/M0104.json +100 -94
  119. data/schemas/tlc/1.0.13/commands/command_requests.json +1293 -1
  120. data/schemas/tlc/1.0.13/defs/guards.json +19 -0
  121. data/schemas/tlc/1.0.13/sxl.yaml +63 -63
  122. data/schemas/tlc/1.0.13/sxl_index.json +280 -298
  123. data/schemas/tlc/1.0.14/alarms/A0008.json +21 -15
  124. data/schemas/tlc/1.0.14/alarms/A0201.json +26 -20
  125. data/schemas/tlc/1.0.14/alarms/A0202.json +26 -20
  126. data/schemas/tlc/1.0.14/alarms/A0301.json +69 -63
  127. data/schemas/tlc/1.0.14/alarms/A0302.json +87 -81
  128. data/schemas/tlc/1.0.14/commands/M0001.json +66 -60
  129. data/schemas/tlc/1.0.14/commands/M0002.json +48 -42
  130. data/schemas/tlc/1.0.14/commands/M0003.json +48 -42
  131. data/schemas/tlc/1.0.14/commands/M0004.json +35 -29
  132. data/schemas/tlc/1.0.14/commands/M0005.json +48 -42
  133. data/schemas/tlc/1.0.14/commands/M0006.json +48 -42
  134. data/schemas/tlc/1.0.14/commands/M0007.json +35 -29
  135. data/schemas/tlc/1.0.14/commands/M0008.json +48 -42
  136. data/schemas/tlc/1.0.14/commands/M0010.json +35 -29
  137. data/schemas/tlc/1.0.14/commands/M0011.json +35 -29
  138. data/schemas/tlc/1.0.14/commands/M0012.json +35 -29
  139. data/schemas/tlc/1.0.14/commands/M0013.json +35 -29
  140. data/schemas/tlc/1.0.14/commands/M0014.json +48 -42
  141. data/schemas/tlc/1.0.14/commands/M0015.json +48 -42
  142. data/schemas/tlc/1.0.14/commands/M0016.json +35 -29
  143. data/schemas/tlc/1.0.14/commands/M0017.json +35 -29
  144. data/schemas/tlc/1.0.14/commands/M0018.json +48 -42
  145. data/schemas/tlc/1.0.14/commands/M0019.json +61 -55
  146. data/schemas/tlc/1.0.14/commands/M0103.json +51 -45
  147. data/schemas/tlc/1.0.14/commands/M0104.json +100 -94
  148. data/schemas/tlc/1.0.14/commands/command_requests.json +1293 -1
  149. data/schemas/tlc/1.0.14/defs/guards.json +19 -0
  150. data/schemas/tlc/1.0.14/sxl.yaml +63 -63
  151. data/schemas/tlc/1.0.14/sxl_index.json +304 -322
  152. data/schemas/tlc/1.0.15/alarms/A0008.json +21 -15
  153. data/schemas/tlc/1.0.15/alarms/A0201.json +26 -20
  154. data/schemas/tlc/1.0.15/alarms/A0202.json +26 -20
  155. data/schemas/tlc/1.0.15/alarms/A0301.json +69 -63
  156. data/schemas/tlc/1.0.15/alarms/A0302.json +87 -81
  157. data/schemas/tlc/1.0.15/commands/M0001.json +66 -60
  158. data/schemas/tlc/1.0.15/commands/M0002.json +48 -42
  159. data/schemas/tlc/1.0.15/commands/M0003.json +48 -42
  160. data/schemas/tlc/1.0.15/commands/M0004.json +35 -29
  161. data/schemas/tlc/1.0.15/commands/M0005.json +48 -42
  162. data/schemas/tlc/1.0.15/commands/M0006.json +48 -42
  163. data/schemas/tlc/1.0.15/commands/M0007.json +35 -29
  164. data/schemas/tlc/1.0.15/commands/M0008.json +48 -42
  165. data/schemas/tlc/1.0.15/commands/M0010.json +35 -29
  166. data/schemas/tlc/1.0.15/commands/M0011.json +35 -29
  167. data/schemas/tlc/1.0.15/commands/M0012.json +35 -29
  168. data/schemas/tlc/1.0.15/commands/M0013.json +35 -29
  169. data/schemas/tlc/1.0.15/commands/M0014.json +48 -42
  170. data/schemas/tlc/1.0.15/commands/M0015.json +48 -42
  171. data/schemas/tlc/1.0.15/commands/M0016.json +35 -29
  172. data/schemas/tlc/1.0.15/commands/M0017.json +35 -29
  173. data/schemas/tlc/1.0.15/commands/M0018.json +48 -42
  174. data/schemas/tlc/1.0.15/commands/M0019.json +61 -55
  175. data/schemas/tlc/1.0.15/commands/M0020.json +61 -55
  176. data/schemas/tlc/1.0.15/commands/M0021.json +35 -29
  177. data/schemas/tlc/1.0.15/commands/M0103.json +51 -45
  178. data/schemas/tlc/1.0.15/commands/M0104.json +100 -94
  179. data/schemas/tlc/1.0.15/commands/command_requests.json +1425 -1
  180. data/schemas/tlc/1.0.15/defs/guards.json +19 -0
  181. data/schemas/tlc/1.0.15/sxl.yaml +66 -66
  182. data/schemas/tlc/1.0.15/sxl_index.json +330 -350
  183. data/schemas/tlc/1.0.7/alarms/A0008.json +21 -15
  184. data/schemas/tlc/1.0.7/alarms/A0201.json +26 -20
  185. data/schemas/tlc/1.0.7/alarms/A0202.json +26 -20
  186. data/schemas/tlc/1.0.7/alarms/A0301.json +69 -63
  187. data/schemas/tlc/1.0.7/alarms/A0302.json +87 -81
  188. data/schemas/tlc/1.0.7/commands/M0001.json +66 -60
  189. data/schemas/tlc/1.0.7/commands/M0002.json +48 -42
  190. data/schemas/tlc/1.0.7/commands/M0003.json +48 -42
  191. data/schemas/tlc/1.0.7/commands/M0004.json +35 -29
  192. data/schemas/tlc/1.0.7/commands/M0005.json +48 -42
  193. data/schemas/tlc/1.0.7/commands/M0006.json +48 -42
  194. data/schemas/tlc/1.0.7/commands/M0007.json +35 -29
  195. data/schemas/tlc/1.0.7/commands/M0008.json +48 -42
  196. data/schemas/tlc/1.0.7/commands/M0010.json +35 -29
  197. data/schemas/tlc/1.0.7/commands/M0011.json +35 -29
  198. data/schemas/tlc/1.0.7/commands/M0019.json +61 -55
  199. data/schemas/tlc/1.0.7/commands/M0103.json +51 -45
  200. data/schemas/tlc/1.0.7/commands/M0104.json +100 -94
  201. data/schemas/tlc/1.0.7/commands/command_requests.json +895 -1
  202. data/schemas/tlc/1.0.7/defs/guards.json +19 -0
  203. data/schemas/tlc/1.0.7/sxl.yaml +58 -58
  204. data/schemas/tlc/1.0.7/sxl_index.json +228 -246
  205. data/schemas/tlc/1.0.8/alarms/A0008.json +21 -15
  206. data/schemas/tlc/1.0.8/alarms/A0201.json +26 -20
  207. data/schemas/tlc/1.0.8/alarms/A0202.json +26 -20
  208. data/schemas/tlc/1.0.8/alarms/A0301.json +69 -63
  209. data/schemas/tlc/1.0.8/alarms/A0302.json +87 -81
  210. data/schemas/tlc/1.0.8/commands/M0001.json +66 -60
  211. data/schemas/tlc/1.0.8/commands/M0002.json +48 -42
  212. data/schemas/tlc/1.0.8/commands/M0003.json +48 -42
  213. data/schemas/tlc/1.0.8/commands/M0004.json +35 -29
  214. data/schemas/tlc/1.0.8/commands/M0005.json +48 -42
  215. data/schemas/tlc/1.0.8/commands/M0006.json +48 -42
  216. data/schemas/tlc/1.0.8/commands/M0007.json +35 -29
  217. data/schemas/tlc/1.0.8/commands/M0008.json +48 -42
  218. data/schemas/tlc/1.0.8/commands/M0010.json +35 -29
  219. data/schemas/tlc/1.0.8/commands/M0011.json +35 -29
  220. data/schemas/tlc/1.0.8/commands/M0012.json +35 -29
  221. data/schemas/tlc/1.0.8/commands/M0013.json +35 -29
  222. data/schemas/tlc/1.0.8/commands/M0019.json +61 -55
  223. data/schemas/tlc/1.0.8/commands/M0103.json +51 -45
  224. data/schemas/tlc/1.0.8/commands/M0104.json +100 -94
  225. data/schemas/tlc/1.0.8/commands/command_requests.json +995 -1
  226. data/schemas/tlc/1.0.8/defs/guards.json +19 -0
  227. data/schemas/tlc/1.0.8/sxl.yaml +56 -56
  228. data/schemas/tlc/1.0.8/sxl_index.json +226 -244
  229. data/schemas/tlc/1.0.9/alarms/A0008.json +21 -15
  230. data/schemas/tlc/1.0.9/alarms/A0201.json +26 -20
  231. data/schemas/tlc/1.0.9/alarms/A0202.json +26 -20
  232. data/schemas/tlc/1.0.9/alarms/A0301.json +69 -63
  233. data/schemas/tlc/1.0.9/alarms/A0302.json +87 -81
  234. data/schemas/tlc/1.0.9/commands/M0001.json +66 -60
  235. data/schemas/tlc/1.0.9/commands/M0002.json +48 -42
  236. data/schemas/tlc/1.0.9/commands/M0003.json +48 -42
  237. data/schemas/tlc/1.0.9/commands/M0004.json +35 -29
  238. data/schemas/tlc/1.0.9/commands/M0005.json +48 -42
  239. data/schemas/tlc/1.0.9/commands/M0006.json +48 -42
  240. data/schemas/tlc/1.0.9/commands/M0007.json +35 -29
  241. data/schemas/tlc/1.0.9/commands/M0008.json +48 -42
  242. data/schemas/tlc/1.0.9/commands/M0010.json +35 -29
  243. data/schemas/tlc/1.0.9/commands/M0011.json +35 -29
  244. data/schemas/tlc/1.0.9/commands/M0012.json +35 -29
  245. data/schemas/tlc/1.0.9/commands/M0013.json +35 -29
  246. data/schemas/tlc/1.0.9/commands/M0019.json +61 -55
  247. data/schemas/tlc/1.0.9/commands/M0103.json +51 -45
  248. data/schemas/tlc/1.0.9/commands/M0104.json +100 -94
  249. data/schemas/tlc/1.0.9/commands/command_requests.json +995 -1
  250. data/schemas/tlc/1.0.9/defs/guards.json +19 -0
  251. data/schemas/tlc/1.0.9/sxl.yaml +56 -56
  252. data/schemas/tlc/1.0.9/sxl_index.json +226 -244
  253. data/schemas/tlc/1.1.0/alarms/A0007.json +25 -19
  254. data/schemas/tlc/1.1.0/alarms/A0008.json +21 -15
  255. data/schemas/tlc/1.1.0/alarms/A0201.json +26 -20
  256. data/schemas/tlc/1.1.0/alarms/A0202.json +26 -20
  257. data/schemas/tlc/1.1.0/alarms/A0301.json +69 -63
  258. data/schemas/tlc/1.1.0/alarms/A0302.json +87 -81
  259. data/schemas/tlc/1.1.0/alarms/A0303.json +69 -63
  260. data/schemas/tlc/1.1.0/alarms/A0304.json +87 -81
  261. data/schemas/tlc/1.1.0/commands/M0001.json +66 -60
  262. data/schemas/tlc/1.1.0/commands/M0002.json +48 -42
  263. data/schemas/tlc/1.1.0/commands/M0003.json +48 -42
  264. data/schemas/tlc/1.1.0/commands/M0004.json +35 -29
  265. data/schemas/tlc/1.1.0/commands/M0005.json +48 -42
  266. data/schemas/tlc/1.1.0/commands/M0006.json +48 -42
  267. data/schemas/tlc/1.1.0/commands/M0007.json +35 -29
  268. data/schemas/tlc/1.1.0/commands/M0008.json +48 -42
  269. data/schemas/tlc/1.1.0/commands/M0010.json +35 -29
  270. data/schemas/tlc/1.1.0/commands/M0011.json +35 -29
  271. data/schemas/tlc/1.1.0/commands/M0012.json +35 -29
  272. data/schemas/tlc/1.1.0/commands/M0013.json +35 -29
  273. data/schemas/tlc/1.1.0/commands/M0014.json +48 -42
  274. data/schemas/tlc/1.1.0/commands/M0015.json +48 -42
  275. data/schemas/tlc/1.1.0/commands/M0016.json +35 -29
  276. data/schemas/tlc/1.1.0/commands/M0017.json +35 -29
  277. data/schemas/tlc/1.1.0/commands/M0018.json +48 -42
  278. data/schemas/tlc/1.1.0/commands/M0019.json +61 -55
  279. data/schemas/tlc/1.1.0/commands/M0020.json +61 -55
  280. data/schemas/tlc/1.1.0/commands/M0021.json +35 -29
  281. data/schemas/tlc/1.1.0/commands/M0022.json +194 -188
  282. data/schemas/tlc/1.1.0/commands/M0023.json +35 -29
  283. data/schemas/tlc/1.1.0/commands/M0103.json +51 -45
  284. data/schemas/tlc/1.1.0/commands/M0104.json +100 -94
  285. data/schemas/tlc/1.1.0/commands/command_requests.json +1525 -1
  286. data/schemas/tlc/1.1.0/defs/guards.json +19 -0
  287. data/schemas/tlc/1.1.0/statuses/S0033.json +2 -2
  288. data/schemas/tlc/1.1.0/sxl.yaml +75 -74
  289. data/schemas/tlc/1.1.0/sxl_index.json +391 -398
  290. data/schemas/tlc/1.2.0/alarms/A0007.json +25 -19
  291. data/schemas/tlc/1.2.0/alarms/A0008.json +21 -15
  292. data/schemas/tlc/1.2.0/alarms/A0201.json +26 -20
  293. data/schemas/tlc/1.2.0/alarms/A0202.json +26 -20
  294. data/schemas/tlc/1.2.0/alarms/A0301.json +69 -63
  295. data/schemas/tlc/1.2.0/alarms/A0302.json +87 -81
  296. data/schemas/tlc/1.2.0/alarms/A0303.json +69 -63
  297. data/schemas/tlc/1.2.0/alarms/A0304.json +87 -81
  298. data/schemas/tlc/1.2.0/commands/M0001.json +66 -60
  299. data/schemas/tlc/1.2.0/commands/M0002.json +48 -42
  300. data/schemas/tlc/1.2.0/commands/M0003.json +48 -42
  301. data/schemas/tlc/1.2.0/commands/M0004.json +35 -29
  302. data/schemas/tlc/1.2.0/commands/M0005.json +48 -42
  303. data/schemas/tlc/1.2.0/commands/M0006.json +48 -42
  304. data/schemas/tlc/1.2.0/commands/M0007.json +35 -29
  305. data/schemas/tlc/1.2.0/commands/M0008.json +48 -42
  306. data/schemas/tlc/1.2.0/commands/M0010.json +35 -29
  307. data/schemas/tlc/1.2.0/commands/M0011.json +35 -29
  308. data/schemas/tlc/1.2.0/commands/M0012.json +35 -29
  309. data/schemas/tlc/1.2.0/commands/M0013.json +35 -29
  310. data/schemas/tlc/1.2.0/commands/M0014.json +48 -42
  311. data/schemas/tlc/1.2.0/commands/M0015.json +48 -42
  312. data/schemas/tlc/1.2.0/commands/M0016.json +35 -29
  313. data/schemas/tlc/1.2.0/commands/M0017.json +35 -29
  314. data/schemas/tlc/1.2.0/commands/M0018.json +48 -42
  315. data/schemas/tlc/1.2.0/commands/M0019.json +61 -55
  316. data/schemas/tlc/1.2.0/commands/M0020.json +61 -55
  317. data/schemas/tlc/1.2.0/commands/M0021.json +35 -29
  318. data/schemas/tlc/1.2.0/commands/M0022.json +194 -188
  319. data/schemas/tlc/1.2.0/commands/M0023.json +35 -29
  320. data/schemas/tlc/1.2.0/commands/M0103.json +51 -45
  321. data/schemas/tlc/1.2.0/commands/M0104.json +100 -94
  322. data/schemas/tlc/1.2.0/commands/command_requests.json +1525 -1
  323. data/schemas/tlc/1.2.0/defs/guards.json +19 -0
  324. data/schemas/tlc/1.2.0/statuses/S0033.json +2 -2
  325. data/schemas/tlc/1.2.0/sxl.yaml +77 -76
  326. data/schemas/tlc/1.2.0/sxl_index.json +401 -397
  327. data/schemas/tlc/1.2.1/alarms/A0007.json +25 -19
  328. data/schemas/tlc/1.2.1/alarms/A0008.json +21 -15
  329. data/schemas/tlc/1.2.1/alarms/A0201.json +26 -20
  330. data/schemas/tlc/1.2.1/alarms/A0202.json +26 -20
  331. data/schemas/tlc/1.2.1/alarms/A0301.json +69 -63
  332. data/schemas/tlc/1.2.1/alarms/A0302.json +87 -81
  333. data/schemas/tlc/1.2.1/alarms/A0303.json +69 -63
  334. data/schemas/tlc/1.2.1/alarms/A0304.json +87 -81
  335. data/schemas/tlc/1.2.1/commands/M0001.json +66 -60
  336. data/schemas/tlc/1.2.1/commands/M0002.json +48 -42
  337. data/schemas/tlc/1.2.1/commands/M0003.json +48 -42
  338. data/schemas/tlc/1.2.1/commands/M0004.json +35 -29
  339. data/schemas/tlc/1.2.1/commands/M0005.json +48 -42
  340. data/schemas/tlc/1.2.1/commands/M0006.json +48 -42
  341. data/schemas/tlc/1.2.1/commands/M0007.json +35 -29
  342. data/schemas/tlc/1.2.1/commands/M0008.json +48 -42
  343. data/schemas/tlc/1.2.1/commands/M0010.json +35 -29
  344. data/schemas/tlc/1.2.1/commands/M0011.json +35 -29
  345. data/schemas/tlc/1.2.1/commands/M0012.json +35 -29
  346. data/schemas/tlc/1.2.1/commands/M0013.json +35 -29
  347. data/schemas/tlc/1.2.1/commands/M0014.json +48 -42
  348. data/schemas/tlc/1.2.1/commands/M0015.json +48 -42
  349. data/schemas/tlc/1.2.1/commands/M0016.json +35 -29
  350. data/schemas/tlc/1.2.1/commands/M0017.json +35 -29
  351. data/schemas/tlc/1.2.1/commands/M0018.json +48 -42
  352. data/schemas/tlc/1.2.1/commands/M0019.json +61 -55
  353. data/schemas/tlc/1.2.1/commands/M0020.json +61 -55
  354. data/schemas/tlc/1.2.1/commands/M0021.json +35 -29
  355. data/schemas/tlc/1.2.1/commands/M0022.json +194 -188
  356. data/schemas/tlc/1.2.1/commands/M0023.json +35 -29
  357. data/schemas/tlc/1.2.1/commands/M0103.json +51 -45
  358. data/schemas/tlc/1.2.1/commands/M0104.json +100 -94
  359. data/schemas/tlc/1.2.1/commands/command_requests.json +1525 -1
  360. data/schemas/tlc/1.2.1/defs/guards.json +19 -0
  361. data/schemas/tlc/1.2.1/statuses/S0033.json +2 -2
  362. data/schemas/tlc/1.2.1/sxl.yaml +77 -76
  363. data/schemas/tlc/1.2.1/sxl_index.json +401 -397
  364. data/schemas/tlc/1.3.0/alarms/A0007.json +25 -19
  365. data/schemas/tlc/1.3.0/alarms/A0008.json +21 -15
  366. data/schemas/tlc/1.3.0/alarms/A0201.json +26 -20
  367. data/schemas/tlc/1.3.0/alarms/A0202.json +26 -20
  368. data/schemas/tlc/1.3.0/alarms/A0301.json +69 -63
  369. data/schemas/tlc/1.3.0/alarms/A0302.json +87 -81
  370. data/schemas/tlc/1.3.0/alarms/A0303.json +70 -64
  371. data/schemas/tlc/1.3.0/alarms/A0304.json +88 -82
  372. data/schemas/tlc/1.3.0/commands/M0001.json +66 -60
  373. data/schemas/tlc/1.3.0/commands/M0002.json +48 -42
  374. data/schemas/tlc/1.3.0/commands/M0003.json +48 -42
  375. data/schemas/tlc/1.3.0/commands/M0004.json +35 -29
  376. data/schemas/tlc/1.3.0/commands/M0005.json +48 -42
  377. data/schemas/tlc/1.3.0/commands/M0006.json +48 -42
  378. data/schemas/tlc/1.3.0/commands/M0007.json +35 -29
  379. data/schemas/tlc/1.3.0/commands/M0008.json +61 -55
  380. data/schemas/tlc/1.3.0/commands/M0010.json +35 -29
  381. data/schemas/tlc/1.3.0/commands/M0011.json +35 -29
  382. data/schemas/tlc/1.3.0/commands/M0012.json +35 -29
  383. data/schemas/tlc/1.3.0/commands/M0013.json +36 -30
  384. data/schemas/tlc/1.3.0/commands/M0014.json +48 -42
  385. data/schemas/tlc/1.3.0/commands/M0015.json +48 -42
  386. data/schemas/tlc/1.3.0/commands/M0016.json +35 -29
  387. data/schemas/tlc/1.3.0/commands/M0017.json +35 -29
  388. data/schemas/tlc/1.3.0/commands/M0018.json +48 -42
  389. data/schemas/tlc/1.3.0/commands/M0019.json +61 -55
  390. data/schemas/tlc/1.3.0/commands/M0020.json +61 -55
  391. data/schemas/tlc/1.3.0/commands/M0021.json +35 -29
  392. data/schemas/tlc/1.3.0/commands/M0022.json +195 -189
  393. data/schemas/tlc/1.3.0/commands/M0023.json +35 -29
  394. data/schemas/tlc/1.3.0/commands/M0024.json +21 -15
  395. data/schemas/tlc/1.3.0/commands/M0103.json +51 -45
  396. data/schemas/tlc/1.3.0/commands/M0104.json +100 -94
  397. data/schemas/tlc/1.3.0/commands/command_requests.json +1559 -1
  398. data/schemas/tlc/1.3.0/defs/guards.json +19 -0
  399. data/schemas/tlc/1.3.0/statuses/S0001.json +4 -4
  400. data/schemas/tlc/1.3.0/statuses/S0005.json +3 -3
  401. data/schemas/tlc/1.3.0/statuses/S0006.json +2 -2
  402. data/schemas/tlc/1.3.0/statuses/S0007.json +1 -1
  403. data/schemas/tlc/1.3.0/statuses/S0008.json +1 -1
  404. data/schemas/tlc/1.3.0/statuses/S0009.json +1 -1
  405. data/schemas/tlc/1.3.0/statuses/S0010.json +1 -1
  406. data/schemas/tlc/1.3.0/statuses/S0011.json +1 -1
  407. data/schemas/tlc/1.3.0/statuses/S0012.json +1 -1
  408. data/schemas/tlc/1.3.0/statuses/S0013.json +1 -1
  409. data/schemas/tlc/1.3.0/statuses/S0014.json +1 -1
  410. data/schemas/tlc/1.3.0/statuses/S0015.json +1 -1
  411. data/schemas/tlc/1.3.0/statuses/S0016.json +1 -1
  412. data/schemas/tlc/1.3.0/statuses/S0017.json +1 -1
  413. data/schemas/tlc/1.3.0/statuses/S0019.json +1 -1
  414. data/schemas/tlc/1.3.0/statuses/S0020.json +1 -1
  415. data/schemas/tlc/1.3.0/statuses/S0025.json +2 -2
  416. data/schemas/tlc/1.3.0/statuses/S0027.json +1 -1
  417. data/schemas/tlc/1.3.0/statuses/S0032.json +2 -2
  418. data/schemas/tlc/1.3.0/statuses/S0033.json +5 -5
  419. data/schemas/tlc/1.3.0/statuses/S0034.json +1 -1
  420. data/schemas/tlc/1.3.0/statuses/S0035.json +1 -1
  421. data/schemas/tlc/1.3.0/statuses/S0091.json +1 -1
  422. data/schemas/tlc/1.3.0/statuses/S0092.json +1 -1
  423. data/schemas/tlc/1.3.0/statuses/S0096.json +6 -6
  424. data/schemas/tlc/1.3.0/statuses/S0201.json +1 -1
  425. data/schemas/tlc/1.3.0/statuses/S0202.json +1 -1
  426. data/schemas/tlc/1.3.0/statuses/S0203.json +1 -1
  427. data/schemas/tlc/1.3.0/statuses/S0204.json +9 -9
  428. data/schemas/tlc/1.3.0/statuses/S0205.json +1 -1
  429. data/schemas/tlc/1.3.0/statuses/S0206.json +1 -1
  430. data/schemas/tlc/1.3.0/statuses/S0207.json +1 -1
  431. data/schemas/tlc/1.3.0/statuses/S0208.json +9 -9
  432. data/schemas/tlc/1.3.0/sxl_index.json +408 -402
  433. metadata +11 -1
@@ -0,0 +1,80 @@
1
+ module RSMP
2
+ # Connection handling for site instances.
3
+ module SiteConnections
4
+ def build_proxies
5
+ return if server_role?
6
+
7
+ @site_settings['supervisors'].each do |supervisor_settings|
8
+ @proxies << SupervisorProxy.new(supervisor_proxy_options(supervisor_settings))
9
+ end
10
+ end
11
+
12
+ def listen_for_supervisors
13
+ ip = @site_settings['ip'] || '0.0.0.0'
14
+ port = @site_settings['port']
15
+ log "Starting #{site_type_name} listener on #{ip}:#{port}", level: :info, timestamp: @clock.now
16
+ @endpoint = IO::Endpoint.tcp(ip, port)
17
+ @accept_task = Async::Task.current.async do |task|
18
+ task.annotate 'site accept loop'
19
+ accept_supervisor_connections
20
+ end
21
+
22
+ @ready_condition.signal
23
+ @accept_task.wait
24
+ end
25
+
26
+ def accept_supervisor_connections
27
+ @endpoint.accept do |socket|
28
+ accept_supervisor_connection socket
29
+ rescue StandardError => e
30
+ distribute_error e, level: :internal
31
+ end
32
+ rescue Async::Stop
33
+ # Expected during shutdown - no action needed
34
+ rescue StandardError => e
35
+ distribute_error e, level: :internal
36
+ end
37
+
38
+ def accept_supervisor_connection(socket)
39
+ remote_port = socket.remote_address.ip_port
40
+ remote_ip = socket.remote_address.ip_address
41
+ proxy = SupervisorProxy.new(accepted_supervisor_options(socket, remote_ip, remote_port))
42
+ @proxies << proxy
43
+ @proxies_condition.signal
44
+ proxy.start
45
+ proxy.wait
46
+ end
47
+
48
+ def connect_to_supervisor(_task, supervisor_settings)
49
+ proxy = build_proxy(supervisor_proxy_options(supervisor_settings))
50
+ @proxies << proxy
51
+ proxy.start
52
+ @proxies_condition.signal
53
+ end
54
+
55
+ private
56
+
57
+ def supervisor_proxy_options(supervisor_settings)
58
+ {
59
+ site: self,
60
+ task: @task,
61
+ settings: @site_settings,
62
+ ip: supervisor_settings['ip'],
63
+ port: supervisor_settings['port'],
64
+ logger: @logger,
65
+ archive: @archive,
66
+ collect: @collect
67
+ }
68
+ end
69
+
70
+ def accepted_supervisor_options(socket, remote_ip, remote_port)
71
+ stream = IO::Stream::Buffered.new(socket)
72
+ supervisor_proxy_options('ip' => remote_ip, 'port' => remote_port).merge(
73
+ socket: socket,
74
+ stream: stream,
75
+ protocol: RSMP::Protocol.new(stream),
76
+ info: { ip: remote_ip, port: remote_port, hostname: remote_ip, now: Clock.now }
77
+ )
78
+ end
79
+ end
80
+ end
@@ -2,8 +2,9 @@ module RSMP
2
2
  # RSMP site implementation that manages proxies and components.
3
3
  class Site < Node
4
4
  include Components
5
+ include SiteConnections
5
6
 
6
- attr_reader :core_version, :site_settings, :logger, :proxies
7
+ attr_reader :core_version, :site_settings, :logger, :proxies, :ready_condition
7
8
 
8
9
  def self.options_class
9
10
  RSMP::Site::Options
@@ -16,6 +17,7 @@ module RSMP
16
17
  @proxies = []
17
18
  @sleep_condition = Async::Notification.new
18
19
  @proxies_condition = Async::Notification.new
20
+ @ready_condition = Async::Notification.new
19
21
  build_proxies
20
22
  end
21
23
 
@@ -35,6 +37,14 @@ module RSMP
35
37
  @site_settings['site_id']
36
38
  end
37
39
 
40
+ def client_role?
41
+ @site_settings['connection_role'] != 'server'
42
+ end
43
+
44
+ def server_role?
45
+ @site_settings['connection_role'] == 'server'
46
+ end
47
+
38
48
  def handle_site_settings(options = {})
39
49
  options_class = self.class.options_class
40
50
  settings = options[:site_settings] || {}
@@ -97,22 +107,11 @@ module RSMP
97
107
  def run
98
108
  log_site_starting
99
109
  start_status_timer
100
- @proxies.each(&:start)
101
- @proxies.each(&:wait)
102
- end
103
-
104
- def build_proxies
105
- @site_settings['supervisors'].each do |supervisor_settings|
106
- @proxies << SupervisorProxy.new({
107
- site: self,
108
- task: @task,
109
- settings: @site_settings,
110
- ip: supervisor_settings['ip'],
111
- port: supervisor_settings['port'],
112
- logger: @logger,
113
- archive: @archive,
114
- collect: @collect
115
- })
110
+ if server_role?
111
+ listen_for_supervisors
112
+ else
113
+ @proxies.each(&:start)
114
+ @proxies.each(&:wait)
116
115
  end
117
116
  end
118
117
 
@@ -177,36 +176,23 @@ module RSMP
177
176
 
178
177
  def stop_subtasks
179
178
  stop_status_timer
179
+ @accept_task&.stop
180
+ @accept_task = nil
181
+ @endpoint = nil
180
182
  super
181
183
  end
182
184
 
183
- def connect_to_supervisor(_task, supervisor_settings)
184
- proxy = build_proxy({
185
- site: self,
186
- task: @task,
187
- settings: @site_settings,
188
- ip: supervisor_settings['ip'],
189
- port: supervisor_settings['port'],
190
- logger: @logger,
191
- archive: @archive,
192
- collect: @collect
193
- })
194
- @proxies << proxy
195
- proxy.start
196
- @proxies_condition.signal
197
- end
198
-
199
185
  # stop
200
186
  def stop
201
187
  log "Stopping site #{@site_settings['site_id']}", level: :info
202
188
  super
203
189
  end
204
190
 
205
- def wait_for_supervisor(ip, timeout)
191
+ def wait_for_supervisor(ip, timeout:)
206
192
  supervisor = find_supervisor ip
207
193
  return supervisor if supervisor
208
194
 
209
- wait_for_condition(@proxy_condition, timeout: timeout) { find_supervisor ip }
195
+ wait_for_condition(@proxies_condition, timeout: timeout) { find_supervisor ip }
210
196
  rescue Async::TimeoutError
211
197
  raise RSMP::TimeoutError, "Supervisor '#{ip}' did not connect within #{timeout}s"
212
198
  end
@@ -21,8 +21,18 @@ module RSMP
21
21
  @supervisor_settings['site_id']
22
22
  end
23
23
 
24
+ def client_role?
25
+ @supervisor_settings['connection_role'] == 'client'
26
+ end
27
+
28
+ def server_role?
29
+ !client_role?
30
+ end
31
+
24
32
  # listen for connections
25
33
  def run
34
+ return connect_to_sites if client_role?
35
+
26
36
  log "Starting supervisor on port #{@supervisor_settings['port']}",
27
37
  level: :info,
28
38
  timestamp: @clock.now
@@ -47,6 +57,38 @@ module RSMP
47
57
  distribute_error e, level: :internal
48
58
  end
49
59
 
60
+ def connect_to_sites
61
+ log 'Starting supervisor in client connection role',
62
+ level: :info,
63
+ timestamp: @clock.now
64
+ build_outbound_proxies
65
+ @ready_condition.signal
66
+ @proxies.each(&:start)
67
+ @proxies.each(&:wait)
68
+ end
69
+
70
+ def build_outbound_proxies
71
+ site_entries = (@supervisor_settings['sites'] || {}).except('default')
72
+ site_entries.each_pair do |site_id, site_settings|
73
+ endpoints = site_settings['supervisors'] || []
74
+ merged_settings = site_id_to_site_setting site_id
75
+ endpoints.each do |endpoint|
76
+ @proxies << SiteProxy.new({
77
+ supervisor: self,
78
+ task: @task,
79
+ settings: @supervisor_settings,
80
+ site_id: site_id,
81
+ site_settings: merged_settings,
82
+ ip: endpoint['ip'],
83
+ port: endpoint['port'],
84
+ logger: @logger,
85
+ archive: @archive,
86
+ collect: @collect
87
+ })
88
+ end
89
+ end
90
+ end
91
+
50
92
  # stop
51
93
  def stop
52
94
  log "Stopping supervisor #{@supervisor_settings['site_id']}", level: :info
@@ -10,6 +10,8 @@ module RSMP
10
10
 
11
11
  def self.load_file(path, validate: true)
12
12
  raise RSMP::ConfigurationError, "Config #{path} not found" unless File.exist?(path)
13
+ raise RSMP::ConfigurationError, "Config #{path} is not a file" unless File.file?(path)
14
+ raise RSMP::ConfigurationError, "Config #{path} must be a YAML file (.yml or .yaml)" unless yaml_file?(path)
13
15
 
14
16
  raw = YAML.load_file(path)
15
17
  raise RSMP::ConfigurationError, "Config #{path} must be a hash" unless raw.is_a?(Hash) || raw.nil?
@@ -21,27 +23,37 @@ module RSMP
21
23
  raise RSMP::ConfigurationError, "Cannot read config file #{path}: #{e}"
22
24
  end
23
25
 
26
+ def self.yaml_file?(path)
27
+ %w[.yml .yaml].include?(File.extname(path).downcase)
28
+ end
29
+
24
30
  def initialize(options = nil, source: nil, log_settings: nil, validate: true, **extra)
25
31
  options = extra if options.nil? && extra.any?
26
32
  @source = source
27
33
  @log_settings = normalize(log_settings || {})
34
+ validate_log_settings! if validate
28
35
  config = normalize_config(options || {})
29
36
  validate!(config) if validate
30
37
  @data = normalize(apply_defaults(config))
31
38
  end
32
39
 
33
- def defaults
34
- {}
35
- end
40
+ def defaults = {}
36
41
 
37
- def schema_file
38
- nil
39
- end
42
+ def schema_file = nil
43
+
44
+ def schema_path = schema_file && File.join(SCHEMAS_PATH, schema_file)
40
45
 
41
- def schema_path
42
- return unless schema_file
46
+ def log_schema_path = File.join(SCHEMAS_PATH, 'log.json')
43
47
 
44
- File.join(SCHEMAS_PATH, schema_file)
48
+ def validate_log_settings!
49
+ return unless File.exist?(log_schema_path)
50
+
51
+ schemer = JSONSchemer.schema(Pathname.new(log_schema_path))
52
+ errors = schemer.validate(@log_settings).to_a
53
+ return if errors.empty?
54
+
55
+ message = errors.map { |error| format_error(error) }.join("\n")
56
+ raise RSMP::ConfigurationError, "Invalid log configuration#{source_suffix}:\n#{message}"
45
57
  end
46
58
 
47
59
  def validate!(data = @data)
@@ -0,0 +1,129 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "config_common.json",
4
+ "$defs": {
5
+ "endpoint": {
6
+ "type": "object",
7
+ "properties": {
8
+ "ip": { "type": "string" },
9
+ "port": { "type": ["integer", "string"] }
10
+ },
11
+ "required": ["ip", "port"],
12
+ "additionalProperties": false
13
+ },
14
+ "intervals": {
15
+ "type": "object",
16
+ "properties": {
17
+ "timer": { "type": "number" },
18
+ "watchdog": { "type": "number" },
19
+ "reconnect": { "type": "number" },
20
+ "after_connect": { "type": "number" }
21
+ },
22
+ "additionalProperties": false
23
+ },
24
+ "timeouts": {
25
+ "type": "object",
26
+ "properties": {
27
+ "connect": { "type": "number" },
28
+ "ready": { "type": "number" },
29
+ "watchdog": { "type": "number" },
30
+ "acknowledgement": { "type": "number" },
31
+ "command": { "type": "number" },
32
+ "command_timeout": { "type": "number" },
33
+ "status_response": { "type": "number" }
34
+ },
35
+ "additionalProperties": false
36
+ },
37
+ "component_settings": {
38
+ "type": ["object", "null"],
39
+ "properties": {
40
+ "name": { "type": "string" },
41
+ "ntsOId": { "type": "string" },
42
+ "xNId": { "type": "string" },
43
+ "type": { "type": "string" }
44
+ },
45
+ "additionalProperties": false
46
+ },
47
+ "components": {
48
+ "type": "object",
49
+ "additionalProperties": {
50
+ "type": ["object", "null"],
51
+ "additionalProperties": { "$ref": "#/$defs/component_settings" }
52
+ }
53
+ },
54
+ "security_codes": {
55
+ "type": "object",
56
+ "additionalProperties": { "type": "string" }
57
+ },
58
+ "signal_plans": {
59
+ "type": "object",
60
+ "additionalProperties": {
61
+ "type": "object",
62
+ "properties": {
63
+ "cycle_time": { "type": "number" },
64
+ "states": {
65
+ "type": "object",
66
+ "additionalProperties": { "type": "string" }
67
+ },
68
+ "dynamic_bands": {
69
+ "type": "object",
70
+ "additionalProperties": { "type": "integer" }
71
+ }
72
+ },
73
+ "additionalProperties": false
74
+ }
75
+ },
76
+ "input_programming_action": {
77
+ "type": ["object", "null"],
78
+ "properties": {
79
+ "raise_alarm": { "type": "string" },
80
+ "component": { "type": "string" }
81
+ },
82
+ "additionalProperties": false
83
+ },
84
+ "inputs": {
85
+ "type": "object",
86
+ "properties": {
87
+ "total": { "type": "integer", "minimum": 1 },
88
+ "programming": {
89
+ "oneOf": [
90
+ {
91
+ "type": "object",
92
+ "additionalProperties": { "$ref": "#/$defs/input_programming_action" }
93
+ },
94
+ {
95
+ "type": "array",
96
+ "items": { "$ref": "#/$defs/input_programming_action" }
97
+ }
98
+ ]
99
+ }
100
+ },
101
+ "additionalProperties": false
102
+ },
103
+ "message_buffer": {
104
+ "type": "object",
105
+ "properties": {
106
+ "max_messages": { "type": "integer", "minimum": 1 },
107
+ "statuses": {
108
+ "oneOf": [
109
+ { "type": "boolean" },
110
+ {
111
+ "type": "array",
112
+ "items": {
113
+ "type": "object",
114
+ "properties": {
115
+ "cId": { "type": "string" },
116
+ "sCI": { "type": "string" },
117
+ "n": { "type": "string" }
118
+ },
119
+ "required": ["sCI"],
120
+ "additionalProperties": false
121
+ }
122
+ }
123
+ ]
124
+ }
125
+ },
126
+ "additionalProperties": false
127
+ }
128
+ }
129
+ }
@@ -0,0 +1,71 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "log.json",
4
+ "$defs": {
5
+ "display_field": {
6
+ "oneOf": [
7
+ { "type": "boolean" },
8
+ { "type": "integer", "minimum": 0 },
9
+ { "type": "string" }
10
+ ]
11
+ },
12
+ "message_filter": { "type": "boolean" },
13
+ "style_item": {
14
+ "oneOf": [
15
+ { "type": "string" },
16
+ {
17
+ "type": "object",
18
+ "properties": {
19
+ "color": { "type": "string" },
20
+ "mode": { "type": "string" }
21
+ },
22
+ "additionalProperties": false
23
+ }
24
+ ]
25
+ },
26
+ "style": {
27
+ "oneOf": [
28
+ { "type": "boolean" },
29
+ { "type": "string" },
30
+ {
31
+ "type": "object",
32
+ "additionalProperties": { "$ref": "#/$defs/style_item" }
33
+ }
34
+ ]
35
+ }
36
+ },
37
+ "type": "object",
38
+ "properties": {
39
+ "active": { "type": "boolean" },
40
+ "path": { "type": ["string", "null"] },
41
+ "stream": {},
42
+ "style": { "$ref": "#/$defs/style" },
43
+ "debug": { "type": "boolean" },
44
+ "info": { "type": "boolean" },
45
+ "statistics": { "type": "boolean" },
46
+ "hide_ip_and_port": { "type": "boolean" },
47
+ "acknowledgements": { "type": "boolean" },
48
+ "watchdogs": { "$ref": "#/$defs/message_filter" },
49
+ "alarms": { "$ref": "#/$defs/message_filter" },
50
+ "versions": { "$ref": "#/$defs/message_filter" },
51
+ "statuses": { "$ref": "#/$defs/message_filter" },
52
+ "commands": { "$ref": "#/$defs/message_filter" },
53
+ "aggregated_status": { "$ref": "#/$defs/message_filter" },
54
+ "tabs": { "type": ["string", "boolean", "null"] },
55
+ "prefix": { "$ref": "#/$defs/display_field" },
56
+ "index": { "$ref": "#/$defs/display_field" },
57
+ "author": { "$ref": "#/$defs/display_field" },
58
+ "timestamp": { "$ref": "#/$defs/display_field" },
59
+ "ip": { "$ref": "#/$defs/display_field" },
60
+ "port": { "$ref": "#/$defs/display_field" },
61
+ "site_id": { "$ref": "#/$defs/display_field" },
62
+ "component": { "$ref": "#/$defs/display_field" },
63
+ "direction": { "$ref": "#/$defs/display_field" },
64
+ "level": { "$ref": "#/$defs/display_field" },
65
+ "id": { "$ref": "#/$defs/display_field" },
66
+ "text": { "$ref": "#/$defs/display_field" },
67
+ "json": { "$ref": "#/$defs/display_field" },
68
+ "exception": { "$ref": "#/$defs/display_field" }
69
+ },
70
+ "additionalProperties": false
71
+ }
@@ -5,17 +5,12 @@
5
5
  "properties": {
6
6
  "site_id": { "type": "string" },
7
7
  "type": { "type": "string" },
8
+ "connection_role": { "enum": ["client", "server"] },
9
+ "ip": { "type": "string" },
10
+ "port": { "type": ["integer", "string"] },
8
11
  "supervisors": {
9
12
  "type": "array",
10
- "items": {
11
- "type": "object",
12
- "properties": {
13
- "ip": { "type": "string" },
14
- "port": { "type": ["integer", "string"] }
15
- },
16
- "required": ["ip", "port"],
17
- "additionalProperties": true
18
- }
13
+ "items": { "$ref": "config_common.json#/$defs/endpoint" }
19
14
  },
20
15
  "sxls": {
21
16
  "type": "object",
@@ -23,56 +18,16 @@
23
18
  "additionalProperties": { "type": "string" }
24
19
  },
25
20
  "core_version": { "type": "string" },
26
- "intervals": {
27
- "type": "object",
28
- "properties": {
29
- "timer": { "type": "number" },
30
- "watchdog": { "type": "number" },
31
- "reconnect": { "type": "number" }
32
- },
33
- "additionalProperties": true
34
- },
35
- "timeouts": {
36
- "type": "object",
37
- "properties": {
38
- "watchdog": { "type": "number" },
39
- "acknowledgement": { "type": "number" }
40
- },
41
- "additionalProperties": true
42
- },
21
+ "intervals": { "$ref": "config_common.json#/$defs/intervals" },
22
+ "timeouts": { "$ref": "config_common.json#/$defs/timeouts" },
43
23
  "send_after_connect": { "type": "boolean" },
44
- "message_buffer": {
45
- "type": "object",
46
- "properties": {
47
- "enabled": { "type": "boolean" },
48
- "max_messages": { "type": "integer", "minimum": 1 },
49
- "statuses": {
50
- "oneOf": [
51
- { "type": "boolean" },
52
- {
53
- "type": "array",
54
- "items": {
55
- "type": "object",
56
- "properties": {
57
- "cId": { "type": "string" },
58
- "sCI": { "type": "string" },
59
- "n": { "type": "string" }
60
- },
61
- "required": ["sCI"],
62
- "additionalProperties": false
63
- }
64
- }
65
- ]
66
- }
67
- },
68
- "additionalProperties": false
69
- },
70
- "components": { "type": "object" },
71
- "security_codes": { "type": "object" },
24
+ "message_buffer": { "$ref": "config_common.json#/$defs/message_buffer" },
25
+ "components": { "$ref": "config_common.json#/$defs/components" },
26
+ "security_codes": { "$ref": "config_common.json#/$defs/security_codes" },
72
27
  "startup_sequence": { "type": "string" },
73
- "signal_plans": { "type": "object" },
74
- "inputs": { "type": "object" },
28
+ "signal_plans": { "$ref": "config_common.json#/$defs/signal_plans" },
29
+ "inputs": { "$ref": "config_common.json#/$defs/inputs" },
75
30
  "live_output": { "type": ["string", "null"] }
76
31
  },
77
- "additionalProperties": true
32
+ "additionalProperties": false
78
33
  }
@@ -4,6 +4,8 @@
4
4
  "properties": {
5
5
  "port": { "type": ["integer", "string"] },
6
6
  "ip": { "type": "string" },
7
+ "connection_role": { "enum": ["client", "server"] },
8
+ "proxy_type": { "type": "string" },
7
9
  "ips": {
8
10
  "oneOf": [
9
11
  { "type": "string" },
@@ -12,38 +14,11 @@
12
14
  },
13
15
  "site_id": { "type": "string" },
14
16
  "max_sites": { "type": "integer" },
15
- "default": {
16
- "type": "object",
17
- "properties": {
18
- "sxls": {
19
- "type": "object",
20
- "propertyNames": { "not": { "const": "core" } },
21
- "additionalProperties": { "type": "string" }
22
- },
23
- "core_version": { "type": "string" },
24
- "intervals": {
25
- "type": "object",
26
- "properties": {
27
- "timer": { "type": "number" },
28
- "watchdog": { "type": "number" }
29
- },
30
- "additionalProperties": true
31
- },
32
- "timeouts": {
33
- "type": "object",
34
- "properties": {
35
- "watchdog": { "type": "number" },
36
- "acknowledgement": { "type": "number" }
37
- },
38
- "additionalProperties": true
39
- }
40
- },
41
- "additionalProperties": true
42
- },
17
+ "default": { "$ref": "supervisor_site.json" },
43
18
  "sites": {
44
19
  "type": "object",
45
20
  "additionalProperties": { "$ref": "supervisor_site.json" }
46
21
  }
47
22
  },
48
- "additionalProperties": true
23
+ "additionalProperties": false
49
24
  }