openc3-cosmos-demo 5.1.1 → 5.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/microservices/EXAMPLE/example_target.rb +2 -2
- data/microservices/TEMPLATED/scpi_target.rb +2 -2
- data/plugin.txt +12 -16
- data/targets/INST/cmd_tlm/inst_cmds.txt +6 -1
- data/targets/INST/cmd_tlm/inst_tlm.txt +10 -26
- data/targets/INST/lib/sim_inst.rb +10 -7
- data/targets/INST/procedures/checks.rb +3 -0
- data/targets/INST/procedures/disconnect.rb +0 -8
- data/targets/INST/procedures/metadata.rb +22 -0
- data/targets/INST/procedures/stash.rb +22 -0
- data/targets/INST/screens/_footer.txt +1 -1
- data/targets/INST/screens/adcs.txt +1 -1
- data/targets/INST/screens/commanding.txt +19 -4
- data/targets/INST/screens/other.txt +1 -1
- data/targets/INST/screens/params.txt +1 -1
- data/targets/INST/screens/tabs.txt +2 -2
- data/targets/SYSTEM/procedures/openc3_api_test.rb +20 -77
- data/targets/SYSTEM/screens/status.txt +0 -1
- data/targets/SYSTEM/target.txt +0 -12
- data/tools/widgets/BigWidget/BigWidget.umd.min.js +2 -2
- data/tools/widgets/BigWidget/BigWidget.umd.min.js.map +1 -1
- data/tools/widgets/HelloworldWidget/HelloworldWidget.umd.min.js +1 -1
- data/tools/widgets/HelloworldWidget/HelloworldWidget.umd.min.js.map +1 -1
- metadata +4 -9
- data/targets/SYSTEM/cmd_tlm/meta_tlm.txt +0 -10
- data/targets/SYSTEM/cmd_tlm/system_cmds.txt +0 -41
- data/targets/SYSTEM/cmd_tlm/system_tlm.txt +0 -7
- data/targets/SYSTEM/lib/example_background_task.rb +0 -69
- data/targets/SYSTEM/lib/example_target.rb +0 -115
- data/targets/SYSTEM/lib/limits_groups.rb +0 -67
- data/targets/SYSTEM/lib/scpi_target.rb +0 -79
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fca474828cfbb94f5d172b53030194160be013907dc645a089aaaccdc18a07a8
|
4
|
+
data.tar.gz: 18a7eac99f026d6646a15250c2119329084a830d04ad0ba60da02f9c5e879bd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebe0fb07428eb7bfbc746eea27cdc1764b0b53b65f522b61afe5115826671d55752d4af3c09b09f915aa3a4bfd02424ee5d4a2967bd2ba196ecd403d4147c19a
|
7
|
+
data.tar.gz: 8321d59bbe30cad4a7a4188c43a83d5a371100debe3196b4123d286b0f60c63abc184e2dd022bfc59b379e61465707a3ca2c8559944460a32170eb8ffa8ccf46
|
@@ -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 'openc3'
|
@@ -115,7 +115,7 @@ module OpenC3
|
|
115
115
|
while true
|
116
116
|
sleep 1
|
117
117
|
end
|
118
|
-
rescue SystemExit,
|
118
|
+
rescue SystemExit, SignalException
|
119
119
|
target.stop
|
120
120
|
FileUtils.remove_entry(temp_dir) if File.exist?(temp_dir)
|
121
121
|
end
|
@@ -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 'openc3'
|
@@ -71,7 +71,7 @@ module OpenC3
|
|
71
71
|
begin
|
72
72
|
target.start
|
73
73
|
loop { sleep 1 }
|
74
|
-
rescue SystemExit,
|
74
|
+
rescue SystemExit, SignalException
|
75
75
|
target.stop
|
76
76
|
FileUtils.remove_entry(temp_dir) if File.exist?(temp_dir)
|
77
77
|
end
|
data/plugin.txt
CHANGED
@@ -23,18 +23,18 @@ VARIABLE inst_router_port 7779
|
|
23
23
|
VARIABLE log_retain_time 172800
|
24
24
|
VARIABLE reduced_log_retain_time 2592000
|
25
25
|
|
26
|
-
<% include_inst = (inst_target_name.strip.length > 0) %>
|
27
|
-
<% include_inst2 = (inst2_target_name.strip.length > 0) %>
|
28
|
-
<% include_example = (example_target_name.strip.length > 0) %>
|
29
|
-
<% include_templated = (templated_target_name.strip.length > 0) %>
|
30
|
-
<% include_system = (system_target_name.strip.length > 0) %>
|
31
|
-
<% include_inst_int = (inst_int_name.strip.length > 0) %>
|
32
|
-
<% include_inst_router = (inst_router_name.strip.length > 0) %>
|
33
|
-
<% include_inst2_int = (inst2_int_name.strip.length > 0) %>
|
34
|
-
<% include_example_int = (example_int_name.strip.length > 0) %>
|
35
|
-
<% include_templated_int = (templated_int_name.strip.length > 0) %>
|
36
|
-
<% include_example_microservice = (example_microservice_name.strip.length > 0) %>
|
37
|
-
<% include_templated_microservice = (templated_microservice_name.strip.length > 0) %>
|
26
|
+
<% include_inst = (inst_target_name.to_s.strip.length > 0) %>
|
27
|
+
<% include_inst2 = (inst2_target_name.to_s.strip.length > 0) %>
|
28
|
+
<% include_example = (example_target_name.to_s.strip.length > 0) %>
|
29
|
+
<% include_templated = (templated_target_name.to_s.strip.length > 0) %>
|
30
|
+
<% include_system = (system_target_name.to_s.strip.length > 0) %>
|
31
|
+
<% include_inst_int = (inst_int_name.to_s.strip.length > 0) %>
|
32
|
+
<% include_inst_router = (inst_router_name.to_s.strip.length > 0) %>
|
33
|
+
<% include_inst2_int = (inst2_int_name.to_s.strip.length > 0) %>
|
34
|
+
<% include_example_int = (example_int_name.to_s.strip.length > 0) %>
|
35
|
+
<% include_templated_int = (templated_int_name.to_s.strip.length > 0) %>
|
36
|
+
<% include_example_microservice = (example_microservice_name.to_s.strip.length > 0) %>
|
37
|
+
<% include_templated_microservice = (templated_microservice_name.to_s.strip.length > 0) %>
|
38
38
|
|
39
39
|
<% if include_inst %>
|
40
40
|
TARGET INST <%= inst_target_name %>
|
@@ -64,21 +64,17 @@ VARIABLE reduced_log_retain_time 2592000
|
|
64
64
|
|
65
65
|
<% if include_system %>
|
66
66
|
TARGET SYSTEM <%= system_target_name %>
|
67
|
-
LOG_RETAIN_TIME <%= log_retain_time %>
|
68
|
-
REDUCED_LOG_RETAIN_TIME <%= reduced_log_retain_time %>
|
69
67
|
<% end %>
|
70
68
|
|
71
69
|
<% if include_inst and include_inst_int %>
|
72
70
|
INTERFACE <%= inst_int_name %> simulated_target_interface.rb sim_inst.rb
|
73
71
|
MAP_TARGET <%= inst_target_name %>
|
74
|
-
PROTOCOL READ OverrideProtocol
|
75
72
|
<% end %>
|
76
73
|
|
77
74
|
<% if include_inst2 and include_inst2_int %>
|
78
75
|
INTERFACE <%= inst2_int_name %> simulated_target_interface.rb sim_inst.rb
|
79
76
|
MAP_TARGET <%= inst2_target_name %>
|
80
77
|
DONT_LOG
|
81
|
-
PROTOCOL READ_WRITE OverrideProtocol
|
82
78
|
<% end %>
|
83
79
|
|
84
80
|
<% if include_example and include_example_int %>
|
@@ -30,7 +30,7 @@ COMMAND <%= target_name %> SETPARAMS BIG_ENDIAN "Sets numbered parameters"
|
|
30
30
|
COMMAND <%= target_name %> ASCIICMD BIG_ENDIAN "Enumerated ASCII command"
|
31
31
|
<%= render "_ccsds_cmd.txt", locals: {id: 5} %>
|
32
32
|
APPEND_PARAMETER STRING 2048 STRING "NOOP" "Enumerated string parameter"
|
33
|
-
STATE "NOOP" "NOOP"
|
33
|
+
STATE "NOOP" "NOOP" DISABLE_MESSAGES
|
34
34
|
STATE "ARM LASER" "ARM LASER" HAZARDOUS "Arming the laser poses an eye safety hazard."
|
35
35
|
STATE "FIRE LASER" "FIRE LASER" HAZARDOUS "WARNING Laser will be fired!"
|
36
36
|
APPEND_PARAMETER BINARY 32 STRING 0xDEADBEEF "Binary string"
|
@@ -53,6 +53,7 @@ COMMAND <%= target_name %> SLRPNLRESET BIG_ENDIAN "Reset solar array panels"
|
|
53
53
|
<%= render "_ccsds_cmd.txt", locals: {id: 9} %>
|
54
54
|
|
55
55
|
COMMAND <%= target_name %> MEMLOAD BIG_ENDIAN "Load memory"
|
56
|
+
DISABLE_MESSAGES # Disable messages on a command that could be sent many many times
|
56
57
|
<%= render "_ccsds_cmd.txt", locals: {id: 10} %>
|
57
58
|
APPEND_PARAMETER DATA 80 BLOCK "" "Block of data"
|
58
59
|
|
@@ -61,3 +62,7 @@ COMMAND <%= target_name %> QUIET BIG_ENDIAN "Enable/disable no out of limits in
|
|
61
62
|
APPEND_PARAMETER STATE 8 UINT 0 1 0
|
62
63
|
STATE FALSE 0
|
63
64
|
STATE TRUE 1
|
65
|
+
|
66
|
+
COMMAND <%= target_name %> TIME_OFFSET BIG_ENDIAN "Subtract the packet time by the given seconds"
|
67
|
+
<%= render "_ccsds_cmd.txt", locals: {id: 12} %>
|
68
|
+
APPEND_PARAMETER SECONDS 32 UINT MIN MAX 0 "Seconds to subtract from packet time"
|
@@ -49,11 +49,8 @@ TELEMETRY <%= target_name %> HEALTH_STATUS BIG_ENDIAN "Health and status from th
|
|
49
49
|
STATE CONNECTED 1 GREEN
|
50
50
|
STATE UNAVAILABLE 0 YELLOW
|
51
51
|
APPEND_ITEM BLOCKTEST 80 BLOCK "Block data"
|
52
|
-
ITEM
|
53
|
-
READ_CONVERSION
|
54
|
-
FORMAT_STRING '%0.6f'
|
55
|
-
ITEM TIMEFORMATTED 0 0 DERIVED "Derived time since epoch as formatted string"
|
56
|
-
READ_CONVERSION unix_time_formatted_conversion.rb TIMESEC TIMEUS
|
52
|
+
ITEM PACKET_TIME 0 0 DERIVED "Ruby time based on TIMESEC and TIMEUS"
|
53
|
+
READ_CONVERSION unix_time_conversion.rb TIMESEC TIMEUS
|
57
54
|
ITEM TEMP1HIGH 0 0 DERIVED "High-water mark for TEMP1"
|
58
55
|
READ_CONVERSION processor_conversion.rb TEMP1WATER HIGH_WATER
|
59
56
|
ITEM TEMP1LOW 0 0 DERIVED "Low-water mark for TEMP1"
|
@@ -109,11 +106,8 @@ TELEMETRY <%= target_name %> ADCS BIG_ENDIAN "Position and attitude data"
|
|
109
106
|
FORMAT_STRING "%0.2f"
|
110
107
|
ITEM ATTPROGRESS 656 32 FLOAT "Attitude file progress"
|
111
108
|
FORMAT_STRING "%0.2f"
|
112
|
-
ITEM
|
113
|
-
READ_CONVERSION
|
114
|
-
FORMAT_STRING '%0.6f'
|
115
|
-
ITEM TIMEFORMATTED 0 0 DERIVED "Derived time since epoch as formatted string"
|
116
|
-
READ_CONVERSION unix_time_formatted_conversion.rb TIMESEC TIMEUS
|
109
|
+
ITEM PACKET_TIME 0 0 DERIVED "Ruby time based on TIMESEC and TIMEUS"
|
110
|
+
READ_CONVERSION unix_time_conversion.rb TIMESEC TIMEUS
|
117
111
|
|
118
112
|
TELEMETRY <%= target_name %> PARAMS BIG_ENDIAN "Params set by SETPARAMS command"
|
119
113
|
<%= render "_ccsds_tlm.txt", locals: {apid: 3} %>
|
@@ -123,12 +117,8 @@ TELEMETRY <%= target_name %> PARAMS BIG_ENDIAN "Params set by SETPARAMS command"
|
|
123
117
|
STATE GOOD 0 GREEN
|
124
118
|
STATE BAD 1 RED
|
125
119
|
<% end %>
|
126
|
-
|
127
|
-
|
128
|
-
READ_CONVERSION unix_time_seconds_conversion.rb TIMESEC TIMEUS
|
129
|
-
FORMAT_STRING '%0.6f'
|
130
|
-
ITEM TIMEFORMATTED 0 0 DERIVED "Derived time since epoch as formatted string"
|
131
|
-
READ_CONVERSION unix_time_formatted_conversion.rb TIMESEC TIMEUS
|
120
|
+
ITEM PACKET_TIME 0 0 DERIVED "Ruby time based on TIMESEC and TIMEUS"
|
121
|
+
READ_CONVERSION unix_time_conversion.rb TIMESEC TIMEUS
|
132
122
|
|
133
123
|
TELEMETRY <%= target_name %> IMAGE BIG_ENDIAN "Packet with image data"
|
134
124
|
<%= render "_ccsds_tlm.txt", locals: {apid: 4} %>
|
@@ -136,11 +126,8 @@ TELEMETRY <%= target_name %> IMAGE BIG_ENDIAN "Packet with image data"
|
|
136
126
|
FORMAT_STRING '0x%08x'
|
137
127
|
ITEM IMAGE 128 131072 BLOCK "10x10 Image Data"
|
138
128
|
OVERLAP # Notify OpenC3 that this is intentionally overlapping the BYTES field
|
139
|
-
ITEM
|
140
|
-
READ_CONVERSION
|
141
|
-
FORMAT_STRING '%0.6f'
|
142
|
-
ITEM TIMEFORMATTED 0 0 DERIVED "Derived time since epoch as formatted string"
|
143
|
-
READ_CONVERSION unix_time_formatted_conversion.rb TIMESEC TIMEUS
|
129
|
+
ITEM PACKET_TIME 0 0 DERIVED "Ruby time based on TIMESEC and TIMEUS"
|
130
|
+
READ_CONVERSION unix_time_conversion.rb TIMESEC TIMEUS
|
144
131
|
|
145
132
|
TELEMETRY <%= target_name %> MECH BIG_ENDIAN "Mechanism status"
|
146
133
|
<%= render "_ccsds_tlm.txt", locals: {apid: 5} %>
|
@@ -155,8 +142,5 @@ TELEMETRY <%= target_name %> MECH BIG_ENDIAN "Mechanism status"
|
|
155
142
|
UNITS DEGREES DEG
|
156
143
|
APPEND_ITEM SLRPNL5 32 FLOAT "Solar panel 5 angle"
|
157
144
|
UNITS DEGREES DEG
|
158
|
-
ITEM
|
159
|
-
READ_CONVERSION
|
160
|
-
FORMAT_STRING '%0.6f'
|
161
|
-
ITEM TIMEFORMATTED 0 0 DERIVED "Derived time since epoch as formatted string"
|
162
|
-
READ_CONVERSION unix_time_formatted_conversion.rb TIMESEC TIMEUS
|
145
|
+
ITEM PACKET_TIME 0 0 DERIVED "Ruby time based on TIMESEC and TIMEUS"
|
146
|
+
READ_CONVERSION unix_time_conversion.rb TIMESEC TIMEUS
|
@@ -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
|
# Provides a demonstration of a Simulated Target
|
@@ -132,6 +132,7 @@ module OpenC3
|
|
132
132
|
@bad_temp2 = false
|
133
133
|
@last_temp2 = 0
|
134
134
|
@quiet = false
|
135
|
+
@time_offset = 0
|
135
136
|
end
|
136
137
|
|
137
138
|
def set_rates
|
@@ -171,6 +172,8 @@ module OpenC3
|
|
171
172
|
else
|
172
173
|
@quiet = false
|
173
174
|
end
|
175
|
+
when 'TIME_OFFSET'
|
176
|
+
@time_offset = packet.read('seconds')
|
174
177
|
when 'SETPARAMS'
|
175
178
|
params_packet.value1 = packet.read('value1')
|
176
179
|
params_packet.value2 = packet.read('value2')
|
@@ -274,7 +277,7 @@ module OpenC3
|
|
274
277
|
packet.posprogress = (@position_file_bytes_read.to_f / @position_file_size.to_f) * 100.0
|
275
278
|
packet.attprogress = (@attitude_file_bytes_read.to_f / @attitude_file_size.to_f) * 100.0
|
276
279
|
|
277
|
-
packet.timesec = time.tv_sec
|
280
|
+
packet.timesec = time.tv_sec - @time_offset
|
278
281
|
packet.timeus = time.tv_usec
|
279
282
|
packet.ccsdsseqcnt += 1
|
280
283
|
|
@@ -291,7 +294,7 @@ module OpenC3
|
|
291
294
|
@bad_temp2 = false
|
292
295
|
end
|
293
296
|
@last_temp2 = cycle_tlm_item(packet, 'temp2', -50.0, 50.0, -1.0)
|
294
|
-
|
297
|
+
if (packet.temp2.abs - 30).abs < 2
|
295
298
|
packet.write('temp2', Float::NAN)
|
296
299
|
@bad_temp2 = true
|
297
300
|
elsif (packet.temp2.abs - 20).abs < 2
|
@@ -305,7 +308,7 @@ module OpenC3
|
|
305
308
|
end
|
306
309
|
cycle_tlm_item(packet, 'temp4', 0.0, 20.0, -0.1)
|
307
310
|
|
308
|
-
packet.timesec = time.tv_sec
|
311
|
+
packet.timesec = time.tv_sec - @time_offset
|
309
312
|
packet.timeus = time.tv_usec
|
310
313
|
packet.ccsdsseqcnt += 1
|
311
314
|
|
@@ -337,12 +340,12 @@ module OpenC3
|
|
337
340
|
end
|
338
341
|
|
339
342
|
when 'PARAMS'
|
340
|
-
packet.timesec = time.tv_sec
|
343
|
+
packet.timesec = time.tv_sec - @time_offset
|
341
344
|
packet.timeus = time.tv_usec
|
342
345
|
packet.ccsdsseqcnt += 1
|
343
346
|
|
344
347
|
when 'IMAGE'
|
345
|
-
packet.timesec = time.tv_sec
|
348
|
+
packet.timesec = time.tv_sec - @time_offset
|
346
349
|
packet.timeus = time.tv_usec
|
347
350
|
# Create an Array the size of the packet and then initialize
|
348
351
|
# using a sample of all possible hex values (0..15)
|
@@ -352,7 +355,7 @@ module OpenC3
|
|
352
355
|
packet.ccsdsseqcnt += 1
|
353
356
|
|
354
357
|
when 'MECH'
|
355
|
-
packet.timesec = time.tv_sec
|
358
|
+
packet.timesec = time.tv_sec - @time_offset
|
356
359
|
packet.timeus = time.tv_usec
|
357
360
|
packet.ccsdsseqcnt += 1
|
358
361
|
packet.slrpnl1 = @solar_panel_positions[0]
|
@@ -7,23 +7,15 @@ cmd_raw_no_range_check("<%= target_name %> COLLECT with TYPE 0, TEMP 100")
|
|
7
7
|
cmd_raw_no_hazardous_check("<%= target_name %> CLEAR")
|
8
8
|
cmd_raw_no_checks("<%= target_name %> COLLECT with TYPE 1, TEMP 100.0")
|
9
9
|
check("<%= target_name %> ADCS BIASX == 100")
|
10
|
-
check_formatted("<%= target_name %> ADCS BIASX == 100")
|
11
|
-
check_with_units("<%= target_name %> ADCS BIASX == 100")
|
12
|
-
check_raw("<%= target_name %> ADCS BIASX == 100")
|
13
10
|
check_tolerance("<%= target_name %> ADCS BIASX", 5, 0.5)
|
14
|
-
check_tolerance_raw("<%= target_name %> ADCS BIASX", 5, 0.5)
|
15
11
|
check_expression("true == false")
|
16
12
|
wait
|
17
13
|
wait 5
|
18
14
|
wait("<%= target_name %> ADCS BIASX > 100", 5)
|
19
|
-
wait_raw("<%= target_name %> ADCS BIASX > 100", 5)
|
20
15
|
wait_tolerance("<%= target_name %> ADCS BIASX", 5, 0.5, 5)
|
21
|
-
wait_tolerance_raw("<%= target_name %> ADCS BIASX", 5, 0.5, 5)
|
22
16
|
wait_expression("true == false", 5)
|
23
17
|
wait_packet("<%= target_name %>","ADCS", 2, 5)
|
24
18
|
wait_check("<%= target_name %> ADCS BIASX == 100", 5)
|
25
|
-
wait_check_raw("<%= target_name %> ADCS BIASX == 100", 5)
|
26
19
|
wait_check_tolerance("<%= target_name %> ADCS BIASX", 5, 0.5, 5)
|
27
|
-
wait_check_tolerance_raw("<%= target_name %> ADCS BIASX", 5, 0.5, 5)
|
28
20
|
wait_check_expression("true == false", 5)
|
29
21
|
wait_check_packet("<%= target_name %>","ADCS", 2, 5)
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Example of using metadata. Note each call to metadata_set creates a new entry.
|
2
|
+
# metadata_update without a start time will update the latest metadata entry.
|
3
|
+
puts metadata_get()
|
4
|
+
puts metadata_set({ 'setkey' => 1 })
|
5
|
+
check_expression("#{metadata_all().length} >= 1")
|
6
|
+
check_expression("#{metadata_get()['metadata']} == {\"setkey\"=>1}")
|
7
|
+
puts metadata_get()['metadata']
|
8
|
+
puts metadata_update({ 'setkey' => 2, 'updatekey' => 3 })
|
9
|
+
check_expression("#{metadata_get()['metadata']['setkey']} == 2")
|
10
|
+
check_expression("#{metadata_get()['metadata']['updatekey']} == 3")
|
11
|
+
puts metadata_update({ 'setkey' => 4 }) # Ensure updatekey stays
|
12
|
+
check_expression("#{metadata_get()['metadata']['setkey']} == 4")
|
13
|
+
check_expression("#{metadata_get()['metadata']['updatekey']} == 3")
|
14
|
+
check_expression("#{metadata_all().length} >= 1")
|
15
|
+
metadata_input() # Creates a new entry
|
16
|
+
check_expression("#{metadata_all().length} >= 2")
|
17
|
+
wait 2 # Allow time to advance or it's an error
|
18
|
+
metadata_set({ 'new' => 5 }) # Another new entry
|
19
|
+
check_expression("#{metadata_all().length} >= 3")
|
20
|
+
# The first entry is the newest one we created
|
21
|
+
puts metadata_all
|
22
|
+
check_expression("#{metadata_all()[0]['metadata']} == {\"new\"=>5}")
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Stash API is useful for storing simple key/value pairs
|
2
|
+
# to preserve state between script runs
|
3
|
+
stash_set('key1', 'val1')
|
4
|
+
stash_set('key2', 'val2')
|
5
|
+
check_expression("'#{stash_get('key1')}' == 'val1'")
|
6
|
+
check_expression("'#{stash_get('key2')}' == 'val2'")
|
7
|
+
check_expression("'#{stash_keys().to_s}' == '[\"key1\", \"key2\"]'")
|
8
|
+
stash_set('key1', 1)
|
9
|
+
stash_set('key2', 2)
|
10
|
+
check_expression("'#{stash_all().to_s}' == '{\"key1\"=>1, \"key2\"=>2}'")
|
11
|
+
stash_delete('key2')
|
12
|
+
check_expression("#{stash_get('key2').nil?} == true")
|
13
|
+
stash_delete('key1')
|
14
|
+
data = [1,2,[3,4]]
|
15
|
+
stash_set('ary', data)
|
16
|
+
check_expression("'#{stash_get('ary')}' == '#{data.to_s}'")
|
17
|
+
stash_delete('ary')
|
18
|
+
# Note: hashes with symbol keys works but get converted to string keys on stash_get
|
19
|
+
hash = { 'one' => 1, 'two' => 2, 'string' => 'string' }
|
20
|
+
stash_set('hash', hash)
|
21
|
+
check_expression("'#{stash_get('hash')}' == '#{hash.to_s}'")
|
22
|
+
stash_delete('hash')
|
@@ -11,7 +11,9 @@ VERTICAL
|
|
11
11
|
SECTIONHEADER "Send Collect Command:"
|
12
12
|
HORIZONTAL
|
13
13
|
LABEL "Type: "
|
14
|
-
|
14
|
+
# The ampersand '&' indicates a line continuation
|
15
|
+
NAMED_WIDGET COLLECT_TYPE &
|
16
|
+
COMBOBOX NORMAL SPECIAL
|
15
17
|
END
|
16
18
|
HORIZONTAL
|
17
19
|
LABEL " Duration: "
|
@@ -22,7 +24,12 @@ VERTICAL
|
|
22
24
|
# Note: you can also request and use telemetry in screens using Javascript Promises, e.g.
|
23
25
|
# api.tlm('INST PARAMS VALUE3', 'RAW').then(dur => api.cmd('INST COLLECT with TYPE '+type+', DURATION '+dur))"
|
24
26
|
# The tlm() function returns a Promise which is resolved with then() at which point we send the command with the parameter
|
25
|
-
|
27
|
+
# The plus '+' symbol indicates string concatenation with newlines.
|
28
|
+
# NOTE: Both lines must use the same quote character: ' or "
|
29
|
+
BUTTON 'Start Collect' "var type=screen.getNamedWidget('COLLECT_TYPE').text();" +
|
30
|
+
"var dur=screen.getNamedWidget('DURATION').text();" +
|
31
|
+
# You can have comments between string concatenations
|
32
|
+
"api.cmd('<%= target_name %> COLLECT with TYPE '+type+', DURATION '+dur)"
|
26
33
|
END
|
27
34
|
SETTING BACKCOLOR 163 185 163
|
28
35
|
|
@@ -33,7 +40,9 @@ VERTICAL
|
|
33
40
|
RADIOBUTTON 'Clear'
|
34
41
|
END
|
35
42
|
NAMED_WIDGET CHECK CHECKBUTTON 'Ignore Hazardous Checks' # No option is by default UNCHECKED
|
36
|
-
BUTTON 'Send' "screen.getNamedWidget('GROUP').selected() === 0 ?
|
43
|
+
BUTTON 'Send' "screen.getNamedWidget('GROUP').selected() === 0 ? " +
|
44
|
+
"api.cmd('<%= target_name %> ABORT') : (screen.getNamedWidget('CHECK').checked() ? " +
|
45
|
+
"api.cmd_no_hazardous_check('<%= target_name %> CLEAR') : api.cmd('<%= target_name %> CLEAR'))"
|
37
46
|
END
|
38
47
|
SETTING BACKCOLOR 163 185 163
|
39
48
|
|
@@ -41,7 +50,13 @@ VERTICAL
|
|
41
50
|
SECTIONHEADER "Run Script:"
|
42
51
|
NAMED_WIDGET SCRIPTNAME COMBOBOX collect.rb checks.rb
|
43
52
|
NAMED_WIDGET BG CHECKBUTTON 'Background'
|
44
|
-
|
53
|
+
# The backslash '\' character indicates string concatenation without newlines.
|
54
|
+
# NOTE: Both lines must use the same quote character: ' or "
|
55
|
+
BUTTON 'Run Script' "var script=screen.getNamedWidget('SCRIPTNAME').text();" \
|
56
|
+
"var ctype=screen.getNamedWidget('COLLECT_TYPE').text();" \
|
57
|
+
# Set some environment variables to be used by the script as ENV['TYPE']
|
58
|
+
"var env = {}; env['TYPE'] = ctype;" \
|
59
|
+
"runScript('INST/procedures/'+script, !screen.getNamedWidget('BG').checked(), env)"
|
45
60
|
END
|
46
61
|
SETTING BACKCOLOR 163 185 163
|
47
62
|
END
|
@@ -37,7 +37,7 @@ TABBOOK
|
|
37
37
|
END
|
38
38
|
|
39
39
|
VERTICALBOX
|
40
|
-
LABELVALUE <%= target_name %> ADCS
|
40
|
+
LABELVALUE <%= target_name %> ADCS PACKET_TIMEFORMATTED WITH_UNITS 30
|
41
41
|
END
|
42
42
|
END
|
43
43
|
|
@@ -60,7 +60,7 @@ TABBOOK
|
|
60
60
|
END
|
61
61
|
|
62
62
|
VERTICALBOX
|
63
|
-
LABELVALUE <%= target_name %> HEALTH_STATUS
|
63
|
+
LABELVALUE <%= target_name %> HEALTH_STATUS PACKET_TIMEFORMATTED WITH_UNITS 30
|
64
64
|
END
|
65
65
|
END
|
66
66
|
END
|
@@ -176,11 +176,19 @@ tlm("INST HEALTH_STATUS ARY")
|
|
176
176
|
tlm("INST HEALTH_STATUS ASCIICMD")
|
177
177
|
tlm("INST HEALTH_STATUS CCSDSAPID")
|
178
178
|
tlm("INST HEALTH_STATUS TEMP1")
|
179
|
+
tlm("INST HEALTH_STATUS TEMP1", type: :RAW)
|
180
|
+
tlm("INST HEALTH_STATUS TEMP1", type: :CONVERTED)
|
181
|
+
tlm("INST HEALTH_STATUS TEMP1", type: :FORMATTED)
|
182
|
+
tlm("INST HEALTH_STATUS TEMP1", type: :WITH_UNITS)
|
179
183
|
|
180
184
|
tlm("INST", "HEALTH_STATUS", "ARY")
|
181
185
|
tlm("INST", "HEALTH_STATUS", "ASCIICMD")
|
182
186
|
tlm("INST", "HEALTH_STATUS", "CCSDSAPID")
|
183
187
|
tlm("INST", "HEALTH_STATUS", "TEMP1")
|
188
|
+
tlm("INST", "HEALTH_STATUS", "TEMP1", type: :RAW)
|
189
|
+
tlm("INST", "HEALTH_STATUS", "TEMP1", type: :CONVERTED)
|
190
|
+
tlm("INST", "HEALTH_STATUS", "TEMP1", type: :FORMATTED)
|
191
|
+
tlm("INST", "HEALTH_STATUS", "TEMP1", type: :WITH_UNITS)
|
184
192
|
|
185
193
|
# tlm should fail
|
186
194
|
tlm()
|
@@ -195,92 +203,27 @@ tlm("INST", "HEALTH_STATUS")
|
|
195
203
|
tlm("INST", "HEALTH_STATUS", "BOB")
|
196
204
|
tlm("INST", "HEALTH_STATUS", "ARY", "BOB")
|
197
205
|
|
198
|
-
# tlm_raw
|
199
|
-
tlm_raw("INST HEALTH_STATUS ARY")
|
200
|
-
tlm_raw("INST HEALTH_STATUS ASCIICMD")
|
201
|
-
tlm_raw("INST HEALTH_STATUS CCSDSAPID")
|
202
|
-
tlm_raw("INST HEALTH_STATUS TEMP1")
|
203
|
-
|
204
|
-
tlm_raw("INST", "HEALTH_STATUS", "ARY")
|
205
|
-
tlm_raw("INST", "HEALTH_STATUS", "ASCIICMD")
|
206
|
-
tlm_raw("INST", "HEALTH_STATUS", "CCSDSAPID")
|
207
|
-
tlm_raw("INST", "HEALTH_STATUS", "TEMP1")
|
208
|
-
|
209
|
-
# tlm_raw should fail
|
210
|
-
tlm_raw()
|
211
|
-
tlm_raw("BOB")
|
212
|
-
tlm_raw("INST")
|
213
|
-
tlm_raw("INST BOB")
|
214
|
-
tlm_raw("INST HEALTH_STATUS")
|
215
|
-
tlm_raw("INST HEALTH_STATUS BOB")
|
216
|
-
tlm_raw("INST HEALTH_STATUS ARY BOB")
|
217
|
-
tlm_raw("INST", "BOB")
|
218
|
-
tlm_raw("INST", "HEALTH_STATUS")
|
219
|
-
tlm_raw("INST", "HEALTH_STATUS", "BOB")
|
220
|
-
tlm_raw("INST", "HEALTH_STATUS", "ARY", "BOB")
|
221
|
-
|
222
|
-
# tlm_formatted
|
223
|
-
tlm_formatted("INST HEALTH_STATUS ARY")
|
224
|
-
tlm_formatted("INST HEALTH_STATUS ASCIICMD")
|
225
|
-
tlm_formatted("INST HEALTH_STATUS CCSDSAPID")
|
226
|
-
tlm_formatted("INST HEALTH_STATUS TEMP1")
|
227
|
-
|
228
|
-
tlm_formatted("INST", "HEALTH_STATUS", "ARY")
|
229
|
-
tlm_formatted("INST", "HEALTH_STATUS", "ASCIICMD")
|
230
|
-
tlm_formatted("INST", "HEALTH_STATUS", "CCSDSAPID")
|
231
|
-
tlm_formatted("INST", "HEALTH_STATUS", "TEMP1")
|
232
|
-
|
233
|
-
# tlm_formatted should fail
|
234
|
-
tlm_formatted()
|
235
|
-
tlm_formatted("BOB")
|
236
|
-
tlm_formatted("INST")
|
237
|
-
tlm_formatted("INST BOB")
|
238
|
-
tlm_formatted("INST HEALTH_STATUS")
|
239
|
-
tlm_formatted("INST HEALTH_STATUS BOB")
|
240
|
-
tlm_formatted("INST HEALTH_STATUS ARY BOB")
|
241
|
-
tlm_formatted("INST", "BOB")
|
242
|
-
tlm_formatted("INST", "HEALTH_STATUS")
|
243
|
-
tlm_formatted("INST", "HEALTH_STATUS", "BOB")
|
244
|
-
tlm_formatted("INST", "HEALTH_STATUS", "ARY", "BOB")
|
245
|
-
|
246
|
-
# tlm_with_units
|
247
|
-
tlm_with_units("INST HEALTH_STATUS ARY")
|
248
|
-
tlm_with_units("INST HEALTH_STATUS ASCIICMD")
|
249
|
-
tlm_with_units("INST HEALTH_STATUS CCSDSAPID")
|
250
|
-
tlm_with_units("INST HEALTH_STATUS TEMP1")
|
251
|
-
|
252
|
-
tlm_with_units("INST", "HEALTH_STATUS", "ARY")
|
253
|
-
tlm_with_units("INST", "HEALTH_STATUS", "ASCIICMD")
|
254
|
-
tlm_with_units("INST", "HEALTH_STATUS", "CCSDSAPID")
|
255
|
-
tlm_with_units("INST", "HEALTH_STATUS", "TEMP1")
|
256
|
-
|
257
|
-
# tlm_with_units should fail
|
258
|
-
tlm_with_units()
|
259
|
-
tlm_with_units("BOB")
|
260
|
-
tlm_with_units("INST")
|
261
|
-
tlm_with_units("INST BOB")
|
262
|
-
tlm_with_units("INST HEALTH_STATUS")
|
263
|
-
tlm_with_units("INST HEALTH_STATUS BOB")
|
264
|
-
tlm_with_units("INST HEALTH_STATUS ARY BOB")
|
265
|
-
tlm_with_units("INST", "BOB")
|
266
|
-
tlm_with_units("INST", "HEALTH_STATUS")
|
267
|
-
tlm_with_units("INST", "HEALTH_STATUS", "BOB")
|
268
|
-
tlm_with_units("INST", "HEALTH_STATUS", "ARY", "BOB")
|
269
|
-
|
270
206
|
# override_tlm
|
271
207
|
override_tlm("INST HEALTH_STATUS ARY = [0,0,0,0,0,0,0,0,0,0]")
|
272
208
|
override_tlm("INST HEALTH_STATUS ASCIICMD = 'HI'")
|
273
209
|
override_tlm("INST HEALTH_STATUS CCSDSAPID = 1000")
|
274
210
|
override_tlm("INST HEALTH_STATUS TEMP1 = 15")
|
211
|
+
data = Array.new(131072 / 8) { rand(0..255) }.pack("C*")
|
212
|
+
override_tlm("INST", "IMAGE", "IMAGE", data)
|
275
213
|
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
override_tlm_raw("INST HEALTH_STATUS TEMP1 = 10000")
|
214
|
+
wait_check("INST HEALTH_STATUS ARY == [1,2,3]", 5)
|
215
|
+
wait_check("INST HEALTH_STATUS ASCIICMD == 'HI'", 5)
|
216
|
+
wait_check("INST HEALTH_STATUS CCSDSAPID == 1000", 5)
|
217
|
+
wait_check("INST HEALTH_STATUS TEMP1 == 15", 5)
|
281
218
|
|
282
219
|
# normalize_tlm
|
283
220
|
normalize_tlm("INST HEALTH_STATUS ARY")
|
284
221
|
normalize_tlm("INST HEALTH_STATUS ASCIICMD")
|
285
222
|
normalize_tlm("INST HEALTH_STATUS CCSDSAPID")
|
286
223
|
normalize_tlm("INST HEALTH_STATUS TEMP1")
|
224
|
+
normalize_tlm("INST IMAGE IMAGE")
|
225
|
+
|
226
|
+
wait_check("INST HEALTH_STATUS ARY != [1,2,3]", 5)
|
227
|
+
wait_check("INST HEALTH_STATUS ASCIICMD != 'HI'", 5)
|
228
|
+
wait_check("INST HEALTH_STATUS CCSDSAPID != 1000", 5)
|
229
|
+
wait_check("INST HEALTH_STATUS TEMP1 != 15", 5)
|
data/targets/SYSTEM/target.txt
CHANGED
@@ -1,12 +0,0 @@
|
|
1
|
-
# Ignored Parameters
|
2
|
-
IGNORE_PARAMETER PKTID
|
3
|
-
IGNORE_PARAMETER CONFIG
|
4
|
-
IGNORE_PARAMETER OPENC3_VERSION
|
5
|
-
IGNORE_PARAMETER USER_VERSION
|
6
|
-
IGNORE_PARAMETER RUBY_VERSION
|
7
|
-
|
8
|
-
# Ignored Items
|
9
|
-
IGNORE_ITEM PKTID
|
10
|
-
IGNORE_ITEM RECEIVED_COUNT
|
11
|
-
IGNORE_ITEM RECEIVED_TIMESECONDS
|
12
|
-
IGNORE_ITEM RECEIVED_TIMEFORMATTED
|