openc3 5.5.1 → 5.5.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of openc3 might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a2b1524aa1d06a8149e80ffb2843b3a9304d73cf432ecd641396292bf5209439
4
- data.tar.gz: f35947a803088cb83705c3748fb860751cf40228a5c4720d151c867a001157ce
3
+ metadata.gz: 6ff99b8c3ca332659e787d054c96ed43f617a4e53ba3aea706c4ed799d024f9d
4
+ data.tar.gz: 72b7fe317faf9e6902a797de6ebfbd8069b51967c0adb54e9367f13ed74b4f15
5
5
  SHA512:
6
- metadata.gz: 245f9f7fe39f5ac4f82bab653de55f413432b3ad9f73b586f2d82f2a14e50bcd6d77a5bc11e1b4a9a2f95c4b11c2aef55dcc325ab330da076ecdb7f0245fb374
7
- data.tar.gz: 2f142eea4029f7b1efd3564578413e09d23acd6b9136799d123db48e733577d28a50c3e90640143e20e8f092874ec08c277df6ca721cf2a33bc4c1ffeabf42ba
6
+ metadata.gz: 73ca222afa29f68ad9c3dcdbe697a90eebb9d656db43e5f69dcc3e0fb7e5bb6f5dd0e774a80c4282a26a623a9d63ee0d8a8b8ad6f743e9bc6cad5cca876bc395
7
+ data.tar.gz: a33e0239e3c688968587154945b426a5f3f2f6f73d9ea0270868235b8ccef74c19f4a823ea2d9665c07f15a3441de577da79b46ac8c4fc0877959a0d4552ee02
@@ -1,5 +1,6 @@
1
1
  VALUE_EQ:
2
2
  summary: Map a value to a color
3
+ since: 5.5.1
3
4
  parameters:
4
5
  - name: Value
5
6
  required: true
@@ -5,7 +5,6 @@ COMMAND:
5
5
  modifiers:
6
6
  <%= MetaConfigParser.load('command_modifiers.yaml').to_meta_config_yaml(4) %>
7
7
  summary: Defines a new command packet
8
- example: COMMAND INST COLLECT BIG_ENDIAN "Start collect"
9
8
  parameters:
10
9
  - name: Target
11
10
  required: true
@@ -24,6 +23,7 @@ COMMAND:
24
23
  required: false
25
24
  description: Description of this command which must be enclosed with quotes
26
25
  values: '[''"].*[''"]'
26
+ example: COMMAND INST COLLECT BIG_ENDIAN "Start collect"
27
27
  SELECT_COMMAND:
28
28
  # prettier-ignore
29
29
  modifiers:
@@ -31,8 +31,8 @@ SELECT_COMMAND:
31
31
  summary: Selects an existing command packet for editing
32
32
  description:
33
33
  Typically used in a separate configuration file from where the original
34
- command is defined to override or add to the existing command definition
35
- example: SELECT_COMMAND INST COLLECT
34
+ command is defined to override or add to the existing command definition.
35
+ Must be used in conjunction with SELECT_PARAMETER to change an individual parameter.
36
36
  parameters:
37
37
  - name: Target Name
38
38
  required: true
@@ -42,3 +42,8 @@ SELECT_COMMAND:
42
42
  required: true
43
43
  description: Name of the command to select
44
44
  values: .*
45
+ example: |
46
+ SELECT_COMMAND INST COLLECT
47
+ SELECT_PARAMETER DURATION
48
+ # Add units
49
+ UNITS Seconds S
@@ -3,12 +3,6 @@ PARAMETER:
3
3
  modifiers:
4
4
  <%= MetaConfigParser.load('parameter_modifiers.yaml').to_meta_config_yaml(4) %>
5
5
  summary: Defines a command parameter in the current command packet
6
- example: |
7
- PARAMETER SYNC 0 32 UINT 0xDEADBEEF 0xDEADBEEF 0xDEADBEEF "Sync pattern"
8
- PARAMETER DATA 32 32 INT MIN MAX 0 "Data value"
9
- PARAMETER VALUE 64 32 FLOAT 0 10.5 2.5
10
- PARAMETER LABEL 96 96 STRING "OPENC3" "The label to apply"
11
- PARAMETER BLOCK 192 0 BLOCK 0x0 "Block of binary data"
12
6
  parameters:
13
7
  - name: Name
14
8
  required: true
@@ -21,20 +15,26 @@ PARAMETER:
21
15
  Always use a bit offset of 0 for derived parameters.
22
16
  values: '[-]?\d+'
23
17
  <%= MetaConfigParser.load('_params.yaml').to_meta_config_yaml(4) %>
18
+ example: |
19
+ PARAMETER SYNC 0 32 UINT 0xDEADBEEF 0xDEADBEEF 0xDEADBEEF "Sync pattern"
20
+ PARAMETER DATA 32 32 INT MIN MAX 0 "Data value"
21
+ PARAMETER VALUE 64 32 FLOAT 0 10.5 2.5
22
+ PARAMETER LABEL 96 96 STRING "OPENC3" "The label to apply"
23
+ PARAMETER BLOCK 192 0 BLOCK 0x0 "Block of binary data"
24
24
  APPEND_PARAMETER:
25
25
  modifiers:
26
26
  <%= MetaConfigParser.load('parameter_modifiers.yaml').to_meta_config_yaml(4) %>
27
27
  summary: Defines a command parameter in the current command packet
28
- example: |
29
- APPEND_PARAMETER SYNC 32 UINT 0xDEADBEEF 0xDEADBEEF 0xDEADBEEF "Sync pattern"
30
- APPEND_PARAMETER VALUE 32 FLOAT 0 10.5 2.5
31
- APPEND_PARAMETER LABEL 0 STRING "OPENC3" "The label to apply"
32
28
  parameters:
33
29
  - name: Name
34
30
  required: true
35
31
  description: Name of the parameter. Must be unique within the command.
36
32
  values: .+
37
33
  <%= MetaConfigParser.load('_params.yaml').to_meta_config_yaml(4) %>
34
+ example: |
35
+ APPEND_PARAMETER SYNC 32 UINT 0xDEADBEEF 0xDEADBEEF 0xDEADBEEF "Sync pattern"
36
+ APPEND_PARAMETER VALUE 32 FLOAT 0 10.5 2.5
37
+ APPEND_PARAMETER LABEL 0 STRING "OPENC3" "The label to apply"
38
38
  ID_PARAMETER:
39
39
  modifiers:
40
40
  <%= MetaConfigParser.load('parameter_modifiers.yaml').to_meta_config_yaml(4) %>
@@ -42,7 +42,6 @@ ID_PARAMETER:
42
42
  description: ID parameters are used to identify the binary block of data as a
43
43
  particular command. A command packet may have one or more ID_PARAMETERs and all
44
44
  must match the binary data for the command to be identified.
45
- example: ID_PARAMETER OPCODE 32 32 UINT 2 2 2 "Opcode identifier"
46
45
  parameters:
47
46
  - name: Name
48
47
  required: true
@@ -55,6 +54,7 @@ ID_PARAMETER:
55
54
  Always use a bit offset of 0 for derived parameters.
56
55
  values: '[-]?\d+'
57
56
  <%= MetaConfigParser.load('_id_params.yaml').to_meta_config_yaml(4) %>
57
+ example: ID_PARAMETER OPCODE 32 32 UINT 2 2 2 "Opcode identifier"
58
58
  APPEND_ID_PARAMETER:
59
59
  modifiers:
60
60
  <%= MetaConfigParser.load('parameter_modifiers.yaml').to_meta_config_yaml(4) %>
@@ -62,18 +62,17 @@ APPEND_ID_PARAMETER:
62
62
  description: ID parameters are used to identify the binary block of data as a
63
63
  particular command. A command packet may have one or more ID_PARAMETERs and all
64
64
  must match the binary data for the command to be identified.
65
- example: APPEND_ID_PARAMETER OPCODE 32 UINT 2 2 2 "Opcode identifier"
66
65
  parameters:
67
66
  - name: Name
68
67
  required: true
69
68
  description: Name of the parameter. Must be unique within the command.
70
69
  values: .+
71
70
  <%= MetaConfigParser.load('_id_params.yaml').to_meta_config_yaml(4) %>
71
+ example: APPEND_ID_PARAMETER OPCODE 32 UINT 2 2 2 "Opcode identifier"
72
72
  ARRAY_PARAMETER:
73
73
  modifiers:
74
74
  <%= MetaConfigParser.load('parameter_modifiers.yaml').to_meta_config_yaml(4) %>
75
75
  summary: Defines a command parameter in the current command packet that is an array
76
- example: ARRAY_PARAMETER ARRAY 64 64 FLOAT 640 "Array of 10 64bit floats"
77
76
  parameters:
78
77
  - name: Name
79
78
  required: true
@@ -86,44 +85,50 @@ ARRAY_PARAMETER:
86
85
  Always use a bit offset of 0 for derived parameters.
87
86
  values: '[-]?\d+'
88
87
  <%= MetaConfigParser.load('_array_params.yaml').to_meta_config_yaml(4) %>
88
+ example: ARRAY_PARAMETER ARRAY 64 64 FLOAT 640 "Array of 10 64bit floats"
89
89
  APPEND_ARRAY_PARAMETER:
90
90
  modifiers:
91
91
  <%= MetaConfigParser.load('parameter_modifiers.yaml').to_meta_config_yaml(4) %>
92
92
  summary: Defines a command parameter in the current command packet that is an array
93
- example: APPEND_ARRAY_PARAMETER ARRAY 64 FLOAT 640 "Array of 10 64bit floats"
94
93
  parameters:
95
94
  - name: Name
96
95
  required: true
97
96
  description: Name of the parameter. Must be unique within the command.
98
97
  values: .*
99
98
  <%= MetaConfigParser.load('_array_params.yaml').to_meta_config_yaml(4) %>
99
+ example: APPEND_ARRAY_PARAMETER ARRAY 64 FLOAT 640 "Array of 10 64bit floats"
100
100
  SELECT_PARAMETER:
101
101
  modifiers:
102
102
  <%= MetaConfigParser.load('parameter_modifiers.yaml').to_meta_config_yaml(4) %>
103
103
  summary: Selects an existing command parameter for editing
104
- example: |
105
- SELECT_COMMAND INST COLLECT
106
- SELECT_PARAMETER DURATION
104
+ description: Must be used in conjunction with SELECT_COMMAND to first select
105
+ the packet. Typically used to override generated values or make specific changes
106
+ to commands that only affect a particular instance of a target used multiple times.
107
107
  parameters:
108
108
  - name: Parameter
109
109
  required: true
110
110
  description: Name of the parameter to select for modification
111
111
  values: .+
112
+ example: |
113
+ SELECT_COMMAND INST COLLECT
114
+ SELECT_PARAMETER DURATION
115
+ # Add units
116
+ UNITS Seconds S
112
117
  DELETE_PARAMETER:
113
118
  summary: Deletes an existing command parameter from the packet definition
114
119
  description: Deleting a parameter from the command definition does not remove the
115
120
  defined space for that parameter. Thus unless you redefine a new parameter, there
116
121
  will be a "hole" in the packet where the data is not accessible. You can
117
122
  use SELECT_COMMAND and then PARAMETER to define a new parameter.
118
- example: |
119
- SELECT_COMMAND INST COLLECT
120
- DELETE_PARAMETER DURATION
121
123
  since: 4.4.1
122
124
  parameters:
123
125
  - name: Parameter
124
126
  required: true
125
127
  description: Name of the parameter to delete
126
128
  values: .+
129
+ example: |
130
+ SELECT_COMMAND INST COLLECT
131
+ DELETE_PARAMETER DURATION
127
132
  HIDDEN:
128
133
  summary: Hides this command from all OpenC3 tools such as Command Sender and Handbook Creator
129
134
  description: Hidden commands do not appear in the Script Runner popup helper when writing scripts.
@@ -139,7 +144,6 @@ META:
139
144
  description: Meta data is user specific data that can be used by custom tools
140
145
  for various purposes. One example is to store additional information needed
141
146
  to generate source code header files.
142
- example: META FSW_TYPE "struct command"
143
147
  parameters:
144
148
  - name: Meta Name
145
149
  required: true
@@ -149,6 +153,7 @@ META:
149
153
  required: false
150
154
  description: One or more values to be stored for this Meta Name
151
155
  values: .*
156
+ example: META FSW_TYPE "struct command"
152
157
  HAZARDOUS:
153
158
  summary: Designates the current command as hazardous
154
159
  description: Sending a hazardous command causes a dialog asking for confirmation
@@ -6,6 +6,7 @@ ITEM:
6
6
  <%= MetaConfigParser.load('_graph_params.yaml').to_meta_config_yaml(4) %>
7
7
  STARTTIME:
8
8
  summary: Start the graph history at the designated Time
9
+ since: 5.5.1
9
10
  parameters:
10
11
  - name: Start Time
11
12
  required: true
@@ -13,6 +14,7 @@ STARTTIME:
13
14
  values: .+
14
15
  HISTORY:
15
16
  summary: Display an initial history of data
17
+ since: 5.5.1
16
18
  parameters:
17
19
  - name: Value
18
20
  required: true
@@ -8,6 +8,7 @@ MAP_TARGET:
8
8
  values: .+
9
9
  MAP_CMD_TARGET:
10
10
  summary: Maps a target name to an interface for commands only
11
+ since: 5.2.0
11
12
  parameters:
12
13
  - name: Target Name
13
14
  required: true
@@ -15,6 +16,7 @@ MAP_CMD_TARGET:
15
16
  values: .+
16
17
  MAP_TLM_TARGET:
17
18
  summary: Maps a target name to an interface for telemetry only
19
+ since: 5.2.0
18
20
  parameters:
19
21
  - name: Target Name
20
22
  required: true
@@ -82,8 +84,7 @@ OPTION:
82
84
  interfaces. The SerialInterface defines FLOW_CONTROL which can be NONE (default) or RTSCTS
83
85
  and DATA_BITS which changes the data bits of the serial interface.
84
86
  The TcpipServerInterface defines LISTEN_ADDRESS which is the IP address to accept
85
- connections on (default 0.0.0.0) and AUTO_SYSTEM_META which will automatically send
86
- SYSTEM META when the interface connects (default false).
87
+ connections on (default 0.0.0.0).
87
88
  values: .*
88
89
  - name: Parameters
89
90
  required: false
@@ -92,6 +93,7 @@ OPTION:
92
93
  SECRET:
93
94
  summary: Define a secret needed by this interface
94
95
  description: Defines a secret for this interface and optionally assigns its value to an option
96
+ since: 5.3.0
95
97
  parameters:
96
98
  - name: Type
97
99
  required: true
@@ -224,10 +224,10 @@ LIMITS_RESPONSE:
224
224
  KEY:
225
225
  summary: Defines the key used to access this raw value in the packet.
226
226
  description: Keys are often JsonPath or XPath strings
227
- example: KEY $.book.title
227
+ since: 5.0.10
228
228
  parameters:
229
229
  - name: Key string
230
230
  required: true
231
231
  description: The key to access this item
232
232
  values: .+
233
- since: 5.0.10
233
+ example: KEY $.book.title
@@ -35,6 +35,7 @@ MICROSERVICE:
35
35
  PORT:
36
36
  summary: Open port for the microservice
37
37
  description: Kubernetes needs a Service to be applied to open a port so this is required for Kubernetes support
38
+ since: 5.0.10
38
39
  parameters:
39
40
  - name: Number
40
41
  required: true
@@ -91,6 +92,7 @@ MICROSERVICE:
91
92
  SECRET:
92
93
  summary: Define a secret needed by this microservice
93
94
  description: Defines a secret for this microservice
95
+ since: 5.3.0
94
96
  parameters:
95
97
  - name: Type
96
98
  required: true
@@ -113,6 +115,7 @@ MICROSERVICE:
113
115
  ROUTE_PREFIX:
114
116
  summary: Prefix of route
115
117
  description: Prefix of route to the microservice to expose externally with Traefik
118
+ since: 5.5.0
116
119
  parameters:
117
120
  - name: Route Prefix
118
121
  required: true
@@ -18,6 +18,7 @@ NEEDS_DEPENDENCIES:
18
18
  description: If the plugin has a top level lib folder or lists runtime dependencies in the gemspec,
19
19
  NEEDS_DEPENDENCIES is effectively already set. Note that in Enterprise Edition, having
20
20
  NEEDS_DEPENDENCIES adds the NFS volume mount to the Kuberentes pod.
21
+ since: 5.5.0
21
22
  INTERFACE:
22
23
  modifiers:
23
24
  <%= MetaConfigParser.load('interface_modifiers.yaml').to_meta_config_yaml(4) %>
@@ -27,6 +27,7 @@ END:
27
27
  to indicate where the VERTICALBOX ends.
28
28
  STALE_TIME:
29
29
  summary: Values are marked stale if the packet time is more than Stale Time seconds in the past
30
+ since: 5.1.0
30
31
  parameters:
31
32
  - name: value
32
33
  required: true
@@ -16,6 +16,7 @@ TARGET:
16
16
  modifiers:
17
17
  CMD_BUFFER_DEPTH:
18
18
  summary: Number of commands to buffer to ensure logged in order
19
+ since: 5.2.0
19
20
  parameters:
20
21
  - name: Buffer Depth
21
22
  required: true
@@ -65,6 +66,7 @@ TARGET:
65
66
  values: \d+
66
67
  TLM_BUFFER_DEPTH:
67
68
  summary: Number of telemetry packets to buffer to ensure logged in order
69
+ since: 5.2.0
68
70
  parameters:
69
71
  - name: Buffer Depth
70
72
  required: true
@@ -160,6 +162,7 @@ TARGET:
160
162
  Can be used to give more resources to processing that is falling behind.
161
163
  If defined multiple times for the same type, will create multiple processes.
162
164
  Each process can be given specific packets to process with the PACKET keyword.
165
+ since: 5.2.0
163
166
  parameters:
164
167
  - name: Type
165
168
  required: true
@@ -168,6 +171,7 @@ TARGET:
168
171
  values: .*
169
172
  PACKET:
170
173
  summary: Packet Name to allocate to the current TARGET_MICROSERVICE.
174
+ since: 5.2.0
171
175
  parameters:
172
176
  - name: Packet Name
173
177
  required: true
@@ -5,7 +5,6 @@ TELEMETRY:
5
5
  modifiers:
6
6
  <%= MetaConfigParser.load('telemetry_modifiers.yaml').to_meta_config_yaml(4) %>
7
7
  summary: Defines a new telemetry packet
8
- example: TELEMETRY SYSTEM LIMITS_CHANGE BIG_ENDIAN "OpenC3 limits change"
9
8
  parameters:
10
9
  - name: Target
11
10
  required: true
@@ -25,6 +24,7 @@ TELEMETRY:
25
24
  required: false
26
25
  description: Description of this telemetry packet which must be enclosed with quotes
27
26
  values: '[''"].*[''"]'
27
+ example: TELEMETRY INST HEALTH_STATUS BIG_ENDIAN "Instrument health and status"
28
28
  SELECT_TELEMETRY:
29
29
  # prettier-ignore
30
30
  modifiers:
@@ -32,17 +32,22 @@ SELECT_TELEMETRY:
32
32
  summary: Selects an existing telemetry packet for editing
33
33
  description:
34
34
  Typically used in a separate configuration file from where the original
35
- telemetry is defined to override or add to the existing telemetry definition
36
- example: SELECT_TELEMETRY SYSTEM LIMITS_CHANGE
35
+ telemetry is defined to override or add to the existing telemetry definition.
36
+ Must be used in conjunction with SELECT_ITEM to change an individual item.
37
37
  parameters:
38
38
  - name: Target Name
39
39
  required: true
40
40
  description: Name of the target this telemetry packet is associated with
41
41
  values: .+
42
- - name: Command Name
42
+ - name: Packet Name
43
43
  required: true
44
44
  description: Name of the telemetry packet to select
45
45
  values: .+
46
+ example: |
47
+ SELECT_TELEMETRY INST HEALTH_STATUS
48
+ SELECT_ITEM TEMP1
49
+ # Define limits for this item, overrides or replaces any existing
50
+ LIMITS DEFAULT 3 ENABLED -90.0 -80.0 80.0 90.0 -20.0 20.0
46
51
  LIMITS_GROUP:
47
52
  summary: Defines a group of related limits Items
48
53
  description:
@@ -63,15 +68,7 @@ LIMITS_GROUP_ITEM:
63
68
  summary: Adds the specified telemetry item to the last defined LIMITS_GROUP
64
69
  description:
65
70
  Limits group information is typically kept in a separate configuration
66
- file in the config/TARGET/cmd_tlm folder named limits_groups.txt. If you want to
67
- configure multiple target items in a particular group you should put this information
68
- in the config/SYSTEM/cmd_tlm/limits_groups.txt file. The SYSTEM target is processed
69
- last and contains information that crosses target boundaries.
70
- example: |
71
- LIMITS_GROUP SUBSYSTEM
72
- LIMITS_GROUP_ITEM INST HEALTH_STATUS TEMP1
73
- LIMITS_GROUP_ITEM INST HEALTH_STATUS TEMP2
74
- LIMITS_GROUP_ITEM INST HEALTH_STATUS TEMP3
71
+ file in the config/TARGET/cmd_tlm folder named limits_groups.txt.
75
72
  parameters:
76
73
  - name: Target Name
77
74
  required: true
@@ -85,3 +82,8 @@ LIMITS_GROUP_ITEM:
85
82
  required: true
86
83
  description: Name of the telemetry item to add to the group
87
84
  values: .+
85
+ example: |
86
+ LIMITS_GROUP SUBSYSTEM
87
+ LIMITS_GROUP_ITEM INST HEALTH_STATUS TEMP1
88
+ LIMITS_GROUP_ITEM INST HEALTH_STATUS TEMP2
89
+ LIMITS_GROUP_ITEM INST HEALTH_STATUS TEMP3
@@ -91,9 +91,14 @@ SELECT_ITEM:
91
91
  modifiers:
92
92
  <%= MetaConfigParser.load('item_modifiers.yaml').to_meta_config_yaml(4) %>
93
93
  summary: Selects an existing telemetry item for editing
94
+ description: Must be used in conjunction with SELECT_TELEMETRY to first select
95
+ the packet. Typically used to override generated values or make specific changes
96
+ to telemetry that only affect a particular instance of a target used multiple times.
94
97
  example: |
95
- SELECT_TELEMETRY SYSTEM LIMITS_CHANGE
96
- SELECT_ITEM ITEM
98
+ SELECT_TELEMETRY INST HEALTH_STATUS
99
+ SELECT_ITEM TEMP1
100
+ # Define limits for this item, overrides or replaces any existing
101
+ LIMITS DEFAULT 3 ENABLED -90.0 -80.0 80.0 90.0 -20.0 20.0
97
102
  parameters:
98
103
  - name: Item
99
104
  required: true
@@ -106,8 +111,8 @@ DELETE_ITEM:
106
111
  will be a "hole" in the packet where the data is not accessible. You can
107
112
  use SELECT_TELEMETRY and then ITEM to define a new item.
108
113
  example: |
109
- SELECT_TELEMETRY SYSTEM LIMITS_CHANGE
110
- DELETE_ITEM ITEM
114
+ SELECT_TELEMETRY INST HEALTH_STATUS
115
+ DELETE_ITEM TEMP4
111
116
  since: 4.4.1
112
117
  parameters:
113
118
  - name: Item
@@ -64,6 +64,7 @@ TOOL:
64
64
  POSITION:
65
65
  summary: Position of the tool in the nav bar
66
66
  description: Position of the tool as an integer starting at 1. Tools without a position are appended to the end as they are installed.
67
+ since: 5.0.8
67
68
  parameters:
68
69
  - name: Position
69
70
  required: true
@@ -168,6 +168,7 @@ Decoration Widgets:
168
168
  LABEL "Note: This is only a warning"
169
169
  HORIZONTALLINE:
170
170
  summary: Displays a horizontal line on the screen that can be used as a separator
171
+ since: 5.5.1
171
172
  example: |
172
173
  LABEL Over
173
174
  HORIZONTALLINE
@@ -1315,11 +1316,9 @@ Interactive Widgets:
1315
1316
  The api.tlm() function returns a Promise which is resolved with then()
1316
1317
  at which point we send the command with the telemetry value we received.
1317
1318
 
1318
- Scripts can be launched from a BUTTON using the `runScript()` method.
1319
- # warning:
1320
- # If your button logic gets complex it's recommended to require a separate
1321
- # script and pass the screen to the script using self,
1322
- # e.g. require utility.rb; utility_method(self).
1319
+ Scripts can be launched from a BUTTON using the `runScript()` method. `runScript()` takes three parameters,
1320
+ the name of the script, whether to open the script in the foreground of Script Runner (default = true), and a hash of
1321
+ environment variables. For example: `runScript('INST/procedures/script.rb', false, {'VAR': 'VALUE'})`
1323
1322
  parameters:
1324
1323
  - name: Button Text
1325
1324
  required: true
@@ -1331,7 +1330,14 @@ Interactive Widgets:
1331
1330
  values: .+
1332
1331
  example: |
1333
1332
  BUTTON 'Start Collect' 'api.cmd("INST COLLECT with TYPE NORMAL, DURATION 5")'
1334
- BUTTON 'Run Script' 'runScript("INST/procedures/script.rb")'
1333
+ BUTTON 'Run Checks' 'runScript("INST/procedures/checks.rb")'
1334
+ # More complex example with background checkbox and env vars
1335
+ NAMED_WIDGET SCRIPTNAME COMBOBOX collect.rb checks.rb
1336
+ NAMED_WIDGET BG CHECKBUTTON 'Background'
1337
+ BUTTON 'Run Script' "var script=screen.getNamedWidget('SCRIPTNAME').text();" \
1338
+ # Set an environment variable to be used by the script as ENV['TYPE']
1339
+ "var env = {}; env['TYPE'] = 'TEST';" \
1340
+ "runScript('INST/procedures/'+script, !screen.getNamedWidget('BG').checked(), env)"
1335
1341
  CHECKBUTTON:
1336
1342
  summary: Displays a check box
1337
1343
  description:
@@ -20,7 +20,7 @@
20
20
  # This file may also be used under the terms of a commercial license
21
21
  # if purchased from OpenC3, Inc.
22
22
 
23
- require 'openc3/models/settings_model'
23
+ require 'openc3/models/setting_model'
24
24
 
25
25
  module OpenC3
26
26
  module Api
@@ -35,41 +35,35 @@ module OpenC3
35
35
 
36
36
  def list_settings(scope: $openc3_scope, token: $openc3_token)
37
37
  authorize(permission: 'system', scope: scope, token: token)
38
- SettingsModel.names(scope: scope)
38
+ SettingModel.names(scope: scope)
39
39
  end
40
40
 
41
41
  def get_all_settings(scope: $openc3_scope, token: $openc3_token)
42
42
  authorize(permission: 'system', scope: scope, token: token)
43
- SettingsModel.all(scope: scope)
43
+ SettingModel.all(scope: scope)
44
44
  end
45
45
 
46
46
  def get_setting(name, scope: $openc3_scope, token: $openc3_token)
47
47
  authorize(permission: 'system', scope: scope, token: token)
48
- setting = SettingsModel.get(name: name, scope: scope)
48
+ setting = SettingModel.get(name: name, scope: scope)
49
49
  if setting
50
- return setting["data"]
50
+ setting['data']
51
51
  else
52
- return nil
52
+ nil
53
53
  end
54
54
  end
55
55
 
56
- def get_settings(*args, scope: $openc3_scope, token: $openc3_token)
56
+ def get_settings(*settings, scope: $openc3_scope, token: $openc3_token)
57
57
  authorize(permission: 'system', scope: scope, token: token)
58
- ret = []
59
- args.each do |name|
60
- setting = SettingsModel.get(name: name, scope: scope)
61
- if setting
62
- ret << setting["data"]
63
- else
64
- ret << nil
65
- end
66
- end
67
- return ret
58
+ result = []
59
+ settings.each { |name| result << get_setting(name, scope: scope, token: token) }
60
+ result
68
61
  end
69
62
 
70
63
  def save_setting(name, data, scope: $openc3_scope, token: $openc3_token)
71
64
  authorize(permission: 'admin', scope: scope, token: token)
72
- SettingsModel.set({ name: name, data: data }, scope: scope)
65
+ SettingModel.set({ name: name, data: data }, scope: scope)
66
+ LocalMode.save_setting(scope, name, data)
73
67
  end
74
68
  end
75
69
  end
@@ -0,0 +1,11 @@
1
+ require 'httpclient'
2
+
3
+ class HTTPClient
4
+ alias original_initialize initialize
5
+
6
+ def initialize(*args, &block)
7
+ original_initialize(*args, &block)
8
+ # Force use of the default system CA certs (instead of the 6 year old bundled ones)
9
+ @session_manager&.ssl_config&.set_default_paths
10
+ end
11
+ end
@@ -17,12 +17,13 @@
17
17
  # All changes Copyright 2022, OpenC3, Inc.
18
18
  # All Rights Reserved
19
19
  #
20
- # This file may also be used under the terms of a commercial license
20
+ # This file may also be used under the terms of a commercial license
21
21
  # if purchased from OpenC3, Inc.
22
22
 
23
23
  require 'openc3/core_ext/array'
24
24
  require 'openc3/core_ext/binding'
25
25
  require 'openc3/core_ext/class'
26
+ require 'openc3/core_ext/httpclient'
26
27
  require 'openc3/core_ext/openc3_io'
27
28
  require 'openc3/core_ext/exception'
28
29
  require 'openc3/core_ext/file'
@@ -17,7 +17,7 @@
17
17
  # All changes Copyright 2022, OpenC3, Inc.
18
18
  # All Rights Reserved
19
19
  #
20
- # This file may also be used under the terms of a commercial license
20
+ # This file may also be used under the terms of a commercial license
21
21
  # if purchased from OpenC3, Inc.
22
22
 
23
23
  require 'thread'
@@ -24,7 +24,7 @@ require 'openc3/version'
24
24
  require 'openc3/models/model'
25
25
  require 'openc3/models/plugin_model'
26
26
  require 'openc3/models/microservice_model'
27
- require 'openc3/models/settings_model'
27
+ require 'openc3/models/setting_model'
28
28
 
29
29
  module OpenC3
30
30
  class ScopeModel < Model
@@ -261,8 +261,10 @@ module OpenC3
261
261
  end
262
262
 
263
263
  def seed_database
264
- setting = SettingsModel.get(name: 'source_url')
265
- SettingsModel.set({ name: 'source_url', data: 'https://github.com/OpenC3/cosmos' }, scope: @scope) unless setting
264
+ setting = SettingModel.get(name: 'source_url')
265
+ SettingModel.set({ name: 'source_url', data: 'https://github.com/OpenC3/cosmos' }, scope: @scope) unless setting
266
+ setting = SettingModel.get(name: 'rubygems_url')
267
+ SettingModel.set({ name: 'rubygems_url', data: 'https://rubygems.org' }, scope: @scope) unless setting
266
268
  end
267
269
  end
268
270
  end
@@ -23,7 +23,7 @@
23
23
  require 'openc3/models/model'
24
24
 
25
25
  module OpenC3
26
- class SettingsModel < Model
26
+ class SettingModel < Model
27
27
  PRIMARY_KEY = 'openc3__settings'
28
28
 
29
29
  # NOTE: The following three class methods are used by the ModelController
@@ -17,9 +17,11 @@
17
17
  # All changes Copyright 2022, OpenC3, Inc.
18
18
  # All Rights Reserved
19
19
  #
20
- # This file may also be used under the terms of a commercial license
20
+ # This file may also be used under the terms of a commercial license
21
21
  # if purchased from OpenC3, Inc.
22
22
 
23
+ require 'openc3/utilities/local_mode'
24
+
23
25
  module OpenC3
24
26
  class ToolConfigModel
25
27
  def self.list_configs(tool, scope: $openc3_scope)
@@ -30,12 +32,14 @@ module OpenC3
30
32
  Store.hget("#{scope}__config__#{tool}", name)
31
33
  end
32
34
 
33
- def self.save_config(tool, name, data, scope: $openc3_scope)
35
+ def self.save_config(tool, name, data, scope: $openc3_scope, local_mode: true)
34
36
  Store.hset("#{scope}__config__#{tool}", name, data)
37
+ LocalMode.save_tool_config(scope, tool, name, data) if local_mode
35
38
  end
36
39
 
37
40
  def self.delete_config(tool, name, scope: $openc3_scope)
38
41
  Store.hdel("#{scope}__config__#{tool}", name)
42
+ LocalMode.delete_tool_config(scope, tool, name)
39
43
  end
40
44
  end
41
45
  end
@@ -501,6 +501,10 @@ module OpenC3
501
501
  return start(procedure_name)
502
502
  end
503
503
  def require_utility(procedure_name)
504
+ # Ensure require_utility works like require where you don't need the .rb extension
505
+ if File.extname(procedure_name) != '.rb'
506
+ procedure_name += '.rb'
507
+ end
504
508
  @require_utility_cache ||= {}
505
509
  if @require_utility_cache[procedure_name]
506
510
  return false
@@ -144,7 +144,8 @@ module OpenC3
144
144
 
145
145
  # Make the post request to keycloak
146
146
  def _make_request(headers, data)
147
- uri = URI("#{@url}/auth/realms/openc3/protocol/openid-connect/token")
147
+ realm = ENV['OPENC3_KEYCLOAK_REALM'] || 'openc3'
148
+ uri = URI("#{@url}/realms/#{realm}/protocol/openid-connect/token")
148
149
  @log[0] = "request uri: #{uri.to_s} header: #{headers.to_s} body: #{data.to_s}"
149
150
  STDOUT.puts @log[0] if JsonDRb.debug?
150
151
  saved_verbose = $VERBOSE; $VERBOSE = nil
@@ -129,7 +129,7 @@ module OpenC3
129
129
  end
130
130
 
131
131
  # Lists the files under a specified path
132
- def list_files(bucket:, path:, only_directories: false, include_head: false)
132
+ def list_files(bucket:, path:, only_directories: false, metadata: false)
133
133
  # Trailing slash is important in AWS S3 when listing files
134
134
  # See https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/S3/Types/ListObjectsV2Output.html#common_prefixes-instance_method
135
135
  if path[-1] != '/'
@@ -163,8 +163,8 @@ module OpenC3
163
163
  item['name'] = aws_item.key.split('/')[-1]
164
164
  item['modified'] = aws_item.last_modified
165
165
  item['size'] = aws_item.size
166
- if include_head
167
- item['head'] = head_object(bucket: bucket, key: aws_item.key)
166
+ if metadata
167
+ item['metadata'] = head_object(bucket: bucket, key: aws_item.key)
168
168
  end
169
169
  files << item
170
170
  end
@@ -180,12 +180,12 @@ module OpenC3
180
180
 
181
181
  # get metadata for a specific object
182
182
  def head_object(bucket:, key:)
183
- head = @client.head_object({
183
+ @client.head_object({
184
184
  bucket: bucket,
185
185
  key: key
186
186
  })
187
- rescue Aws::S3::Errors::NotFound => error
188
- raise NotFound, "Object: #{bucket}/#{key}"
187
+ rescue Aws::S3::Errors::NotFound
188
+ raise NotFound, "Object '#{bucket}/#{key}' does not exist."
189
189
  end
190
190
 
191
191
  # put_object fires off the request to store but does not confirm
@@ -61,7 +61,7 @@ module OpenC3
61
61
  raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'"
62
62
  end
63
63
 
64
- def list_files(bucket:, path:, only_directories: false)
64
+ def list_files(bucket:, path:, only_directories: false, metadata: false)
65
65
  raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'"
66
66
  end
67
67
 
@@ -58,7 +58,10 @@ module OpenC3
58
58
  puts "Local init found scope: #{scope_dir}"
59
59
  Dir.each_child("#{OPENC3_LOCAL_MODE_PATH}/#{scope_dir}") do |plugin_dir|
60
60
  full_folder_path = "#{OPENC3_LOCAL_MODE_PATH}/#{scope_dir}/#{plugin_dir}"
61
- next if plugin_dir == "targets_modified" or not File.directory?(full_folder_path)
61
+ if plugin_dir == "targets_modified" || plugin_dir == "tool_config" ||
62
+ plugin_dir == "settings" || !File.directory?(full_folder_path)
63
+ next
64
+ end
62
65
  puts "Local init found plugin_dir: #{full_folder_path}"
63
66
  gems, plugin_instance = scan_plugin_dir(full_folder_path)
64
67
 
@@ -79,6 +82,8 @@ module OpenC3
79
82
  end
80
83
  end
81
84
  sync_targets_modified()
85
+ sync_tool_config()
86
+ sync_settings()
82
87
  puts "Local init complete"
83
88
  else
84
89
  puts "Local init canceled: Local mode not enabled or #{OPENC3_LOCAL_MODE_PATH} does not exist"
@@ -322,12 +327,10 @@ module OpenC3
322
327
  end
323
328
 
324
329
  def self.sync_targets_modified
325
- if ENV['OPENC3_LOCAL_MODE'] and Dir.exist?(OPENC3_LOCAL_MODE_PATH)
326
- bucket = Bucket.getClient()
327
- scopes = ScopeModel.names()
328
- scopes.each do |scope|
329
- sync_with_bucket(bucket, scope: scope)
330
- end
330
+ bucket = Bucket.getClient()
331
+ scopes = ScopeModel.names()
332
+ scopes.each do |scope|
333
+ sync_with_bucket(bucket, scope: scope)
331
334
  end
332
335
  end
333
336
 
@@ -417,6 +420,58 @@ module OpenC3
417
420
  return files.sort
418
421
  end
419
422
 
423
+ def self.sync_tool_config()
424
+ scopes = ScopeModel.names()
425
+ scopes.each do |scope|
426
+ Dir["#{OPENC3_LOCAL_MODE_PATH}/#{scope}/tool_config/**/*.json"].each do |config|
427
+ parts = config.split('/')
428
+ puts "Syncing tool_config #{parts[-2]} #{File.basename(config)}"
429
+ data = File.read(config)
430
+ begin
431
+ # Parse just to ensure we have valid JSON
432
+ JSON.parse(data, :allow_nan => true, :create_additions => true)
433
+ # Only save if the parse was successful
434
+ ToolConfigModel.save_config(parts[-2], File.basename(config), data, scope: scope, local_mode: false)
435
+ rescue JSON::ParserError => error
436
+ puts "Unable to initialize tool config due to #{error.message}"
437
+ end
438
+ end
439
+ end
440
+ end
441
+
442
+ def self.save_tool_config(scope, tool, name, data)
443
+ json = JSON.parse(data, :allow_nan => true, :create_additions => true)
444
+ config_path = "#{OPENC3_LOCAL_MODE_PATH}/#{scope}/tool_config/#{tool}/#{name}.json"
445
+ FileUtils.mkdir_p(File.dirname(config_path))
446
+ File.open(config_path, 'w') do |file|
447
+ file.write(JSON.pretty_generate(json, :allow_nan => true))
448
+ end
449
+ end
450
+
451
+ def self.delete_tool_config(scope, tool, name)
452
+ FileUtils.rm_f("#{OPENC3_LOCAL_MODE_PATH}/#{scope}/tool_config/#{tool}/#{name}.json")
453
+ end
454
+
455
+ def self.sync_settings()
456
+ scopes = ScopeModel.names()
457
+ scopes.each do |scope|
458
+ Dir["#{OPENC3_LOCAL_MODE_PATH}/#{scope}/settings/*.json"].each do |config|
459
+ name = File.basename(config, ".json")
460
+ puts "Syncing setting #{name}"
461
+ # Anything can be stored in settings so read and set directly
462
+ data = File.read(config)
463
+ SettingModel.set({ name: name, data: data }, scope: scope)
464
+ end
465
+ end
466
+ end
467
+
468
+ def self.save_setting(scope, name, data)
469
+ config_path = "#{OPENC3_LOCAL_MODE_PATH}/#{scope}/settings/#{name}.json"
470
+ FileUtils.mkdir_p(File.dirname(config_path))
471
+ # Anything can be stored as a setting so write it out directly
472
+ File.write(config_path, data)
473
+ end
474
+
420
475
  # Helper methods
421
476
 
422
477
  def self.sync_remote_to_local(bucket, key)
@@ -1,14 +1,14 @@
1
1
  # encoding: ascii-8bit
2
2
 
3
- OPENC3_VERSION = '5.5.1'
3
+ OPENC3_VERSION = '5.5.2'
4
4
  module OpenC3
5
5
  module Version
6
6
  MAJOR = '5'
7
7
  MINOR = '5'
8
- PATCH = '1'
8
+ PATCH = '2'
9
9
  OTHER = ''
10
- BUILD = 'a1e84e1850e06f2c01726e03372e2872137b3852'
10
+ BUILD = '9c73d9c7c86512a01e0373b12b3058d3ae6b5adf'
11
11
  end
12
- VERSION = '5.5.1'
13
- GEM_VERSION = '5.5.1'
12
+ VERSION = '5.5.2'
13
+ GEM_VERSION = '5.5.2'
14
14
  end
@@ -1,5 +1,5 @@
1
1
  # This class can be used in your scripts like so:
2
- # require '<%= target_lib_filename %>'
2
+ # require_utility '<%= target_class.upcase %>/lib/<%= target_lib_filename %>'
3
3
  # <%= target_object %> = <%= target_class %>.new
4
4
  # <%= target_object %>.utility
5
5
  # For more information see the OpenC3 scripting guide
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openc3
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.5.1
4
+ version: 5.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Melton
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-02-26 00:00:00.000000000 Z
12
+ date: 2023-03-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -798,6 +798,7 @@ files:
798
798
  - lib/openc3/core_ext/exception.rb
799
799
  - lib/openc3/core_ext/file.rb
800
800
  - lib/openc3/core_ext/hash.rb
801
+ - lib/openc3/core_ext/httpclient.rb
801
802
  - lib/openc3/core_ext/io.rb
802
803
  - lib/openc3/core_ext/kernel.rb
803
804
  - lib/openc3/core_ext/math.rb
@@ -896,7 +897,7 @@ files:
896
897
  - lib/openc3/models/router_status_model.rb
897
898
  - lib/openc3/models/scope_model.rb
898
899
  - lib/openc3/models/secret_model.rb
899
- - lib/openc3/models/settings_model.rb
900
+ - lib/openc3/models/setting_model.rb
900
901
  - lib/openc3/models/sorted_model.rb
901
902
  - lib/openc3/models/stash_model.rb
902
903
  - lib/openc3/models/target_model.rb