openc3 5.19.0 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +0 -7
  3. data/bin/openc3cli +12 -120
  4. data/bin/pipinstall +5 -3
  5. data/data/config/command_modifiers.yaml +17 -1
  6. data/data/config/interface_modifiers.yaml +21 -4
  7. data/data/config/item_modifiers.yaml +1 -1
  8. data/data/config/microservice.yaml +15 -2
  9. data/data/config/param_item_modifiers.yaml +1 -1
  10. data/data/config/parameter_modifiers.yaml +1 -1
  11. data/data/config/table_manager.yaml +2 -2
  12. data/data/config/target.yaml +11 -0
  13. data/data/config/telemetry_modifiers.yaml +17 -1
  14. data/data/config/tool.yaml +12 -0
  15. data/data/config/widgets.yaml +41 -17
  16. data/ext/openc3/ext/packet/packet.c +3 -0
  17. data/lib/openc3/accessors/form_accessor.rb +4 -3
  18. data/lib/openc3/accessors/html_accessor.rb +3 -3
  19. data/lib/openc3/accessors/http_accessor.rb +13 -13
  20. data/lib/openc3/accessors/xml_accessor.rb +16 -4
  21. data/lib/openc3/api/cmd_api.rb +4 -5
  22. data/lib/openc3/api/limits_api.rb +3 -3
  23. data/lib/openc3/api/target_api.rb +0 -30
  24. data/lib/openc3/api/tlm_api.rb +2 -1
  25. data/lib/openc3/bridge/bridge_config.rb +1 -2
  26. data/lib/openc3/ccsds/ccsds_parser.rb +12 -8
  27. data/lib/openc3/config/config_parser.rb +10 -3
  28. data/lib/openc3/conversions/bit_reverse_conversion.rb +1 -0
  29. data/lib/openc3/conversions/conversion.rb +5 -1
  30. data/lib/openc3/conversions/generic_conversion.rb +3 -8
  31. data/lib/openc3/conversions/object_read_conversion.rb +1 -8
  32. data/lib/openc3/conversions/polynomial_conversion.rb +3 -8
  33. data/lib/openc3/conversions/processor_conversion.rb +13 -11
  34. data/lib/openc3/conversions/segmented_polynomial_conversion.rb +3 -11
  35. data/lib/openc3/conversions/unix_time_conversion.rb +4 -7
  36. data/lib/openc3/conversions/unix_time_formatted_conversion.rb +4 -3
  37. data/lib/openc3/conversions/unix_time_seconds_conversion.rb +4 -3
  38. data/lib/openc3/core_ext/array.rb +0 -16
  39. data/lib/openc3/core_ext.rb +0 -1
  40. data/lib/openc3/interfaces/file_interface.rb +198 -0
  41. data/lib/openc3/interfaces/http_client_interface.rb +71 -39
  42. data/lib/openc3/interfaces/http_server_interface.rb +1 -9
  43. data/lib/openc3/interfaces/interface.rb +3 -2
  44. data/lib/openc3/interfaces/mqtt_interface.rb +32 -15
  45. data/lib/openc3/interfaces/mqtt_stream_interface.rb +19 -4
  46. data/lib/openc3/interfaces/protocols/crc_protocol.rb +7 -0
  47. data/lib/openc3/interfaces/serial_interface.rb +1 -0
  48. data/lib/openc3/interfaces/tcpip_server_interface.rb +1 -2
  49. data/lib/openc3/interfaces/udp_interface.rb +5 -3
  50. data/lib/openc3/interfaces.rb +2 -4
  51. data/lib/openc3/io/json_drb.rb +5 -0
  52. data/lib/openc3/io/json_rpc.rb +10 -9
  53. data/lib/openc3/io/udp_sockets.rb +7 -5
  54. data/lib/openc3/microservices/decom_microservice.rb +24 -7
  55. data/lib/openc3/microservices/interface_microservice.rb +65 -7
  56. data/lib/openc3/microservices/microservice.rb +1 -2
  57. data/lib/openc3/microservices/multi_microservice.rb +3 -3
  58. data/lib/openc3/migrations/20241208080000_no_critical_cmd.rb +31 -0
  59. data/lib/openc3/migrations/20241208080001_no_trigger_group.rb +46 -0
  60. data/lib/openc3/models/activity_model.rb +7 -3
  61. data/lib/openc3/models/cvt_model.rb +7 -1
  62. data/lib/openc3/models/interface_model.rb +9 -3
  63. data/lib/openc3/models/microservice_model.rb +8 -1
  64. data/lib/openc3/models/model.rb +1 -0
  65. data/lib/openc3/models/plugin_model.rb +11 -6
  66. data/lib/openc3/models/python_package_model.rb +10 -3
  67. data/lib/openc3/models/reaction_model.rb +14 -10
  68. data/lib/openc3/models/scope_model.rb +87 -25
  69. data/lib/openc3/models/target_model.rb +17 -1
  70. data/lib/openc3/models/timeline_model.rb +17 -5
  71. data/lib/openc3/models/tool_model.rb +15 -3
  72. data/lib/openc3/models/trigger_group_model.rb +6 -3
  73. data/lib/openc3/operators/microservice_operator.rb +10 -3
  74. data/lib/openc3/packets/commands.rb +17 -6
  75. data/lib/openc3/packets/limits.rb +0 -12
  76. data/lib/openc3/packets/packet.rb +10 -1
  77. data/lib/openc3/packets/packet_config.rb +34 -1
  78. data/lib/openc3/packets/packet_item.rb +30 -32
  79. data/lib/openc3/packets/structure_item.rb +2 -2
  80. data/lib/openc3/script/calendar.rb +1 -6
  81. data/lib/openc3/script/commands.rb +19 -13
  82. data/lib/openc3/script/critical_cmd.rb +91 -0
  83. data/lib/openc3/script/screen.rb +2 -2
  84. data/lib/openc3/script/script.rb +17 -10
  85. data/lib/openc3/script/web_socket_api.rb +5 -5
  86. data/lib/openc3/streams/mqtt_stream.rb +41 -33
  87. data/lib/openc3/streams/serial_stream.rb +27 -27
  88. data/lib/openc3/streams/stream.rb +17 -17
  89. data/lib/openc3/streams/tcpip_client_stream.rb +1 -1
  90. data/lib/openc3/streams/tcpip_socket_stream.rb +19 -19
  91. data/lib/openc3/system/system.rb +1 -1
  92. data/lib/openc3/system.rb +2 -3
  93. data/lib/openc3/tools/table_manager/table.rb +2 -2
  94. data/lib/openc3/tools/table_manager/table_parser.rb +1 -1
  95. data/lib/openc3/top_level.rb +9 -5
  96. data/lib/openc3/topics/command_decom_topic.rb +0 -7
  97. data/lib/openc3/topics/command_topic.rb +16 -0
  98. data/lib/openc3/topics/interface_topic.rb +2 -0
  99. data/lib/openc3/utilities/authentication.rb +7 -3
  100. data/lib/openc3/utilities/bucket_utilities.rb +1 -1
  101. data/lib/openc3/utilities/cli_generator.rb +0 -1
  102. data/lib/openc3/utilities/logger.rb +1 -0
  103. data/lib/openc3/utilities/store_queued.rb +1 -0
  104. data/lib/openc3/version.rb +6 -6
  105. data/templates/conversion/conversion.rb +2 -0
  106. data/templates/plugin/README.md +1 -1
  107. data/templates/target/targets/TARGET/lib/target.rb +1 -1
  108. data/templates/tool_angular/package.json +9 -9
  109. data/templates/tool_angular/src/app/app.component.html +4 -13
  110. data/templates/tool_angular/src/app/app.component.scss +5 -13
  111. data/templates/tool_angular/src/app/app.component.ts +5 -4
  112. data/templates/tool_angular/src/app/custom-overlay-container.ts +2 -2
  113. data/templates/tool_angular/src/app/openc3-api.d.ts +1 -1
  114. data/templates/tool_angular/src/main.single-spa.ts +1 -1
  115. data/templates/tool_react/package.json +1 -0
  116. data/templates/tool_react/src/root.component.js +1 -1
  117. data/templates/tool_svelte/build/smui.css +1 -1
  118. data/templates/tool_svelte/package.json +11 -9
  119. data/templates/tool_svelte/rollup.config.js +2 -0
  120. data/templates/tool_svelte/src/App.svelte +2 -2
  121. data/templates/tool_vue/eslint.config.mjs +68 -0
  122. data/templates/tool_vue/jsconfig.json +1 -1
  123. data/templates/tool_vue/package.json +26 -43
  124. data/templates/tool_vue/src/App.vue +3 -5
  125. data/templates/tool_vue/src/main.js +12 -23
  126. data/templates/tool_vue/src/router.js +19 -18
  127. data/templates/tool_vue/src/tools/tool_name/tool_name.vue +2 -2
  128. data/templates/tool_vue/vite.config.js +52 -0
  129. data/templates/widget/package.json +19 -26
  130. data/templates/widget/src/Widget.vue +13 -15
  131. data/templates/widget/vite.config.js +26 -0
  132. metadata +25 -39
  133. data/lib/openc3/core_ext/hash.rb +0 -40
  134. data/lib/openc3/core_ext/httpclient.rb +0 -11
  135. data/lib/openc3/interfaces/linc_interface.rb +0 -480
  136. data/lib/openc3/interfaces/protocols/override_protocol.rb +0 -4
  137. data/lib/openc3/microservices/reaction_microservice.rb +0 -607
  138. data/lib/openc3/microservices/timeline_microservice.rb +0 -400
  139. data/lib/openc3/microservices/trigger_group_microservice.rb +0 -698
  140. data/lib/openc3/migrations/20230615000000_autonomic.rb +0 -86
  141. data/lib/openc3/migrations/20240915000000_activity_uuid.rb +0 -28
  142. data/lib/openc3/system/system_config.rb +0 -413
  143. data/templates/tool_svelte/src/services/api.js +0 -92
  144. data/templates/tool_svelte/src/services/axios.js +0 -85
  145. data/templates/tool_svelte/src/services/cable.js +0 -65
  146. data/templates/tool_svelte/src/services/config-parser.js +0 -198
  147. data/templates/tool_svelte/src/services/openc3-api.js +0 -606
  148. data/templates/tool_vue/.eslintrc.js +0 -43
  149. data/templates/tool_vue/babel.config.json +0 -11
  150. data/templates/tool_vue/vue.config.js +0 -38
  151. data/templates/widget/.eslintrc.js +0 -43
  152. data/templates/widget/babel.config.json +0 -11
  153. data/templates/widget/vue.config.js +0 -28
  154. /data/templates/tool_vue/{.prettierrc.js → .prettierrc.cjs} +0 -0
  155. /data/templates/widget/{.prettierrc.js → .prettierrc.cjs} +0 -0
@@ -1,85 +0,0 @@
1
- /*
2
- # Copyright 2022 Ball Aerospace & Technologies Corp.
3
- # All Rights Reserved.
4
- #
5
- # This program is free software; you can modify and/or redistribute it
6
- # under the terms of the GNU Affero General Public License
7
- # as published by the Free Software Foundation; version 3 with
8
- # attribution addendums as found in the LICENSE.txt
9
- #
10
- # This program is distributed in the hope that it will be useful,
11
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- # GNU Affero General Public License for more details.
14
-
15
- # Modified by OpenC3, Inc.
16
- # All changes Copyright 2022, OpenC3, Inc.
17
- # All Rights Reserved
18
- #
19
- # This file may also be used under the terms of a commercial license
20
- # if purchased from OpenC3, Inc.
21
- */
22
-
23
- import axios from 'axios'
24
-
25
- const axiosInstance = axios.create({
26
- baseURL: location.origin,
27
- timeout: 60000,
28
- params: {},
29
- })
30
-
31
- axiosInstance.interceptors.response.use(
32
- (response) => response,
33
- (error) => {
34
- if (error.response) {
35
- if (error.response.status === 401) {
36
- OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity, true).then(
37
- function (refreshed) {
38
- if (refreshed) {
39
- OpenC3Auth.setTokens()
40
- }
41
- }
42
- )
43
- }
44
- // Individual tools can set 'Ignore-Errors' to an error code
45
- // they potentially expect, e.g. '500', in which case we ignore it
46
- // For example in CommandSender.vue:
47
- // obs = this.api.cmd(targetName, commandName, paramList, {
48
- // 'Ignore-Errors': '500',
49
- // })
50
- if (
51
- error.response.headers['ignore-errors'] &&
52
- error.response.headers['ignore-errors'].includes(
53
- error.response.status.toString()
54
- )
55
- ) {
56
- return Promise.reject(error)
57
- }
58
- let body = `HTTP ${error.response.status} - `
59
- if (error.response?.statusText) {
60
- body += `${error.response.statusText} `
61
- }
62
- if (error.response?.config?.data) {
63
- body += `${error.response.config.data} `
64
- }
65
- if (error.response?.data?.message) {
66
- body += `${error.response.data.message}`
67
- } else if (error.response?.data?.exception) {
68
- body += `${error.response.data.exception}`
69
- } else if (error.response?.data?.error?.message) {
70
- if (error.response.data.error.class) {
71
- body += `${error.response.data.error.class} `
72
- }
73
- body += `${error.response.data.error.message}`
74
- } else {
75
- body += `${error.response?.data}`
76
- }
77
- alert(`Network error: ${body}`)
78
- throw error
79
- } else {
80
- throw error
81
- }
82
- }
83
- )
84
-
85
- export default axiosInstance
@@ -1,65 +0,0 @@
1
- /*
2
- # Copyright 2022 Ball Aerospace & Technologies Corp.
3
- # All Rights Reserved.
4
- #
5
- # This program is free software; you can modify and/or redistribute it
6
- # under the terms of the GNU Affero General Public License
7
- # as published by the Free Software Foundation; version 3 with
8
- # attribution addendums as found in the LICENSE.txt
9
- #
10
- # This program is distributed in the hope that it will be useful,
11
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- # GNU Affero General Public License for more details.
14
-
15
- # Modified by OpenC3, Inc.
16
- # All changes Copyright 2022, OpenC3, Inc.
17
- # All Rights Reserved
18
- #
19
- # This file may also be used under the terms of a commercial license
20
- # if purchased from OpenC3, Inc.
21
- */
22
-
23
- import * as ActionCable from '@rails/actioncable'
24
- //ActionCable.logger.enabled = true
25
- ActionCable.ConnectionMonitor.staleThreshold = 10
26
-
27
- export default class Cable {
28
- constructor(url = '/openc3-api/cable') {
29
- this._cable = null
30
- this._url = url
31
- }
32
- disconnect() {
33
- if (this._cable) {
34
- this._cable.disconnect()
35
- }
36
- }
37
- createSubscription(channel, scope, callbacks = {}, additionalOptions = {}) {
38
- return OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(
39
- (refreshed) => {
40
- if (refreshed) {
41
- OpenC3Auth.setTokens()
42
- }
43
- if (this._cable == null) {
44
- let final_url =
45
- this._url +
46
- '?scope=' +
47
- window.openc3Scope +
48
- '&authorization=' +
49
- localStorage.openc3Token
50
- this._cable = ActionCable.createConsumer(encodeURI(final_url))
51
- }
52
- return this._cable.subscriptions.create(
53
- {
54
- channel,
55
- ...additionalOptions,
56
- },
57
- callbacks
58
- )
59
- }
60
- )
61
- }
62
- recordPing() {
63
- this._cable.connection.monitor.recordPing()
64
- }
65
- }
@@ -1,198 +0,0 @@
1
- /*
2
- # Copyright 2022 Ball Aerospace & Technologies Corp.
3
- # All Rights Reserved.
4
- #
5
- # This program is free software; you can modify and/or redistribute it
6
- # under the terms of the GNU Affero General Public License
7
- # as published by the Free Software Foundation; version 3 with
8
- # attribution addendums as found in the LICENSE.txt
9
- #
10
- # This program is distributed in the hope that it will be useful,
11
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- # GNU Affero General Public License for more details.
14
-
15
- # Modified by OpenC3, Inc.
16
- # All changes Copyright 2024, OpenC3, Inc.
17
- # All Rights Reserved
18
- #
19
- # This file may also be used under the terms of a commercial license
20
- # if purchased from OpenC3, Inc.
21
- */
22
-
23
- export class ConfigParserError {
24
- constructor(config_parser, message, usage = '', url = '') {
25
- this.keyword = config_parser.keyword
26
- this.parameters = config_parser.parameters
27
- this.filename = config_parser.filename
28
- this.line = config_parser.line
29
- this.lineNumber = config_parser.lineNumber
30
- this.message = message
31
- this.usage = usage
32
- this.url = url
33
- }
34
- }
35
-
36
- export class ConfigParserService {
37
- keyword = null
38
- parameters = []
39
- filename = ''
40
- line = ''
41
- lineNumber = 0
42
- url = 'https://docs.openc3.com/docs'
43
- constructor() {}
44
-
45
- verify_num_parameters(min_num_params, max_num_params, usage = '') {
46
- // This syntax works with 0 because each doesn't return any values
47
- // for a backwards range
48
- for (let index = 1; index <= min_num_params; index++) {
49
- // If the parameter is nil (0 based) then we have a problem
50
- if (this.parameters[index - 1] === undefined) {
51
- throw new ConfigParserError(
52
- this,
53
- `Not enough parameters for ${this.keyword}.`,
54
- usage,
55
- this.url,
56
- )
57
- }
58
- }
59
- // If they pass null for max_params we don't check for a maximum number
60
- if (max_num_params && this.parameters[max_num_params] !== undefined) {
61
- throw new ConfigParserError(
62
- this,
63
- `Too many parameters for ${this.keyword}.`,
64
- usage,
65
- this.url,
66
- )
67
- }
68
- }
69
-
70
- remove_quotes(string) {
71
- if (string.length < 2) {
72
- return string
73
- }
74
- let first_char = string.charAt(0)
75
- if (first_char !== '"' && first_char !== "'") {
76
- return string
77
- }
78
- let last_char = string.charAt(string.length - 1)
79
- if (first_char !== last_char) {
80
- return string
81
- }
82
- return string.substring(1, string.length - 1)
83
- }
84
-
85
- scan_string(string, rx) {
86
- if (!rx.global) throw "rx must have 'global' flag set"
87
- let r = []
88
- string.replace(rx, function (match) {
89
- r.push(match)
90
- return match
91
- })
92
- return r
93
- }
94
-
95
- parse_string(
96
- input_string,
97
- original_filename,
98
- yield_non_keyword_lines,
99
- remove_quotes,
100
- handler,
101
- ) {
102
- let string_concat = false
103
- this.line = ''
104
- this.keyword = null
105
- this.parameters = []
106
- this.filename = original_filename
107
-
108
- // Break string into lines
109
- let lines = input_string.split('\n')
110
- let numLines = lines.length
111
-
112
- for (let i = 0; i < numLines; i++) {
113
- this.lineNumber = i + 1
114
- let line = lines[i].trim()
115
- // Ensure the line length is not 0
116
- if (line.length === 0) {
117
- continue
118
- }
119
-
120
- if (string_concat === true) {
121
- // Skip comment lines after a string concatenation
122
- if (line[0] === '#') {
123
- continue
124
- }
125
- // Remove the opening quote if we're continuing the line
126
- line = line.substring(1, line.length)
127
- }
128
-
129
- // Check for string continuation
130
- let last_char = line.charAt(line.length - 1)
131
- let newline = false
132
- switch (last_char) {
133
- case '+': // String concatenation with newlines
134
- newline = true
135
- // Deliberate fall through
136
- case '\\': // String concatenation
137
- // Trim off the concat character plus any spaces, e.g. "line" \
138
- let trim = line.substring(0, line.length - 1).trim()
139
- // Now trim off the last quote so it will flow into the next line
140
- this.line += trim.substring(0, trim.length - 1)
141
- if (newline) {
142
- this.line += '\n'
143
- }
144
- string_concat = true
145
- continue
146
- case '&': // Line continuation
147
- this.line += line.substring(0, line.length - 1)
148
- continue
149
- default:
150
- this.line += line
151
- }
152
- string_concat = false
153
-
154
- let rx = /("([^\\"]|\\.)*")|('([^\\']|\\.)*')|\S+/g
155
- let data = this.scan_string(this.line, rx)
156
- let first_item = ''
157
- if (data.length > 0) {
158
- first_item = first_item + data[0]
159
- }
160
-
161
- if (first_item.length === 0 || first_item.charAt(0) === '#') {
162
- this.keyword = null
163
- } else {
164
- this.keyword = first_item.toUpperCase()
165
- }
166
- this.parameters = []
167
-
168
- // Ignore lines without keywords: comments and blank lines
169
- if (this.keyword === null) {
170
- if (yield_non_keyword_lines) {
171
- handler(this.keyword, this.parameters, this.line, this.lineNumber)
172
- }
173
- this.line = ''
174
- continue
175
- }
176
-
177
- let length = data.length
178
- if (length > 1) {
179
- for (let index = 1; index < length; index++) {
180
- let string = data[index]
181
-
182
- // Don't process trailing comments such as:
183
- // KEYWORD PARAM #This is a comment
184
- if (string.length > 0 && string.charAt(0) === '#') {
185
- break
186
- }
187
- if (remove_quotes) {
188
- this.parameters.push(this.remove_quotes(string))
189
- } else {
190
- this.parameters.push(string)
191
- }
192
- }
193
- }
194
- handler(this.keyword, this.parameters, this.line, this.lineNumber)
195
- this.line = ''
196
- } // for all the lines
197
- } // parse_string
198
- } // class ConfigParserService