openc3-cosmos-demo 5.18.0 → 5.19.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/plugin.txt +0 -1
  3. data/targets/INST/cmd_tlm/_ccsds_cmd.txt +1 -1
  4. data/targets/INST/cmd_tlm/inst_cmds.txt +13 -0
  5. data/targets/INST/cmd_tlm/inst_tlm.txt +1 -0
  6. data/targets/INST/lib/example_limits_response.rb +3 -3
  7. data/targets/INST/lib/inst_cmd_validator.rb +47 -0
  8. data/targets/INST/lib/sim_inst.rb +39 -28
  9. data/targets/INST/procedures/calendar.rb +2 -2
  10. data/targets/INST/procedures/checks.rb +4 -0
  11. data/targets/INST/procedures/metadata.rb +1 -3
  12. data/targets/INST/screens/commanding.txt +1 -1
  13. data/targets/INST/screens/ground.txt +1 -1
  14. data/targets/INST/tables/config/TLMMonitoringTable_def.txt +3 -3
  15. data/targets/INST2/cmd_tlm/_ccsds_cmd.txt +1 -1
  16. data/targets/INST2/cmd_tlm/inst_cmds.txt +18 -0
  17. data/targets/INST2/cmd_tlm/inst_tlm.txt +13 -5
  18. data/targets/INST2/lib/example_limits_response.py +8 -5
  19. data/targets/INST2/lib/inst2_cmd_validator.py +44 -0
  20. data/targets/INST2/lib/sim_inst.py +24 -10
  21. data/targets/INST2/procedures/calendar.py +1 -1
  22. data/targets/INST2/procedures/checks.py +4 -0
  23. data/targets/INST2/procedures/metadata.py +2 -4
  24. data/targets/INST2/screens/commanding.txt +1 -1
  25. data/targets/INST2/screens/ground.txt +1 -1
  26. data/targets/INST2/tables/config/TLMMonitoringTable_def.txt +3 -3
  27. data/tools/widgets/BigWidget/BigWidget.umd.min.js +1 -1
  28. data/tools/widgets/BigWidget/BigWidget.umd.min.js.map +1 -1
  29. data/tools/widgets/DataviewerquaternionWidget/DataviewerquaternionWidget.umd.min.js +2 -2
  30. data/tools/widgets/DataviewerquaternionWidget/DataviewerquaternionWidget.umd.min.js.map +1 -1
  31. data/tools/widgets/HelloworldWidget/HelloworldWidget.umd.min.js +1 -1
  32. data/tools/widgets/HelloworldWidget/HelloworldWidget.umd.min.js.map +1 -1
  33. metadata +4 -3
  34. data/targets/EXAMPLE/lib/my_reject_protocol.rb +0 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87c9ee255c1daaa1baebe544379a8367a5063a4ee20204662999222e385e573c
4
- data.tar.gz: 2bd9074233c6cd5ccdb67da4f498d066f01d809575030518c1a693cb91e6a6b8
3
+ metadata.gz: b81293bb997165f1b8c35dbd8cc4ec5a4de4b5810a6c746047662a89149e3950
4
+ data.tar.gz: 70e36acc62a6be36a5c02dc6261a66da19069cc18cae3c1dfa9ff460587a8f4e
5
5
  SHA512:
6
- metadata.gz: 898776dbf48af38d2cab0bcc69950461f6be998148438b3332e50e87a18dd0438189d5ad60c64dc96f0d0b00ecf7bc6cf87ae592a5544b47d8e919a46c1457a6
7
- data.tar.gz: 0c7be454f5cc752c79b0eece33fa56511c25f3ce60bbe3603916ca79071dab02b6d8ea62b568febd298e334c5ae7b8a82a25afea7011ad408512485b858a93b6
6
+ metadata.gz: 611c47f8a6ca07d7b7cb6064681d3a1732b08016136dc37d8ae4dea36bae37c451974b1048d4c1fc29336bfd8e794f7f11c28d134822ff76e4153b59418e8bae
7
+ data.tar.gz: 9e078e3e96fb62130dcbcd4daf4fc0c53f903ed82fb8161be8279e361812a851e18d603bf60efa66be29bd336a9bc832386bddb053d7279d5e380f3c39cb66c9
data/plugin.txt CHANGED
@@ -91,7 +91,6 @@ VARIABLE reduced_log_retain_time 2592000
91
91
  # This expression builds the correct hostname for Open Source or Enterprise Edition in Kubernetes
92
92
  <% example_host = ENV['KUBERNETES_SERVICE_HOST'] ? "#{scope}-user-#{example_microservice_name.downcase.gsub('__', '-').gsub('_', '-')}-service" : "openc3-operator" %>
93
93
  INTERFACE <%= example_int_name %> example_interface.rb <%= example_host %> <%= example_port %>
94
- PROTOCOL WRITE MyRejectProtocol
95
94
  MAP_TARGET <%= example_target_name %>
96
95
  DONT_CONNECT
97
96
  # Override the default log time of 600
@@ -1,7 +1,7 @@
1
1
  PARAMETER CCSDSVER 0 3 UINT 0 0 0 "CCSDS primary header version number"
2
2
  PARAMETER CCSDSTYPE 3 1 UINT 1 1 1 "CCSDS primary header packet type"
3
3
  PARAMETER CCSDSSHF 4 1 UINT 0 0 0 "CCSDS primary header secondary header flag"
4
- ID_PARAMETER CCSDSAPID 5 11 UINT 0 2047 999 "CCSDS primary header application id"
4
+ ID_PARAMETER CCSDSAPID 5 11 UINT 0 2047 <%= id %> "CCSDS primary header application id"
5
5
  PARAMETER CCSDSSEQFLAGS 16 2 UINT 3 3 3 "CCSDS primary header sequence flags"
6
6
  PARAMETER CCSDSSEQCNT 18 14 UINT 0 16383 0 "CCSDS primary header sequence count"
7
7
  OVERFLOW TRUNCATE
@@ -1,4 +1,5 @@
1
1
  COMMAND <%= target_name %> COLLECT BIG_ENDIAN "Starts a collect on the <%= target_name %> target"
2
+ VALIDATOR inst_cmd_validator.rb
2
3
  <%= render "_ccsds_cmd.txt", locals: {id: 1} %>
3
4
  PARAMETER TYPE 64 16 UINT MIN MAX 0 "Collect type which can be normal or special. Note the special collects are hazarous and require user confirmation."
4
5
  REQUIRED
@@ -14,14 +15,17 @@ COMMAND <%= target_name %> COLLECT BIG_ENDIAN "Starts a collect on the <%= targe
14
15
  RELATED_ITEM <%= target_name %> HEALTH_STATUS COLLECT_TYPE
15
16
 
16
17
  COMMAND <%= target_name %> ABORT BIG_ENDIAN "Aborts a collect on the <%= target_name %> instrument"
18
+ VALIDATOR inst_cmd_validator.rb
17
19
  <%= render "_ccsds_cmd.txt", locals: {id: 2} %>
18
20
 
19
21
  COMMAND <%= target_name %> CLEAR BIG_ENDIAN "Clears counters on the <%= target_name %> instrument"
22
+ VALIDATOR inst_cmd_validator.rb
20
23
  HAZARDOUS "Clearing counters may lose valuable information."
21
24
  <%= render "_ccsds_cmd.txt", locals: {id: 3} %>
22
25
  RELATED_ITEM <%= target_name %> HEALTH_STATUS COLLECTS
23
26
 
24
27
  COMMAND <%= target_name %> SETPARAMS BIG_ENDIAN "Sets numbered parameters"
28
+ VALIDATOR inst_cmd_validator.rb
25
29
  <%= render "_ccsds_cmd.txt", locals: {id: 4} %>
26
30
  # ERB syntax:
27
31
  <% (1..5).each do |i| %>
@@ -35,6 +39,7 @@ COMMAND <%= target_name %> SETPARAMS BIG_ENDIAN "Sets numbered parameters"
35
39
  POLY_WRITE_CONVERSION 0 2
36
40
 
37
41
  COMMAND <%= target_name %> ASCIICMD BIG_ENDIAN "Enumerated ASCII command"
42
+ VALIDATOR inst_cmd_validator.rb
38
43
  <%= render "_ccsds_cmd.txt", locals: {id: 5} %>
39
44
  APPEND_PARAMETER STRING 2048 STRING "NOOP" "Enumerated string parameter"
40
45
  STATE "ARM LASER" "ARM LASER" HAZARDOUS "Arming the laser poses an eye safety hazard."
@@ -45,16 +50,19 @@ COMMAND <%= target_name %> ASCIICMD BIG_ENDIAN "Enumerated ASCII command"
45
50
  RELATED_ITEM <%= target_name %> HEALTH_STATUS ASCIICMD
46
51
 
47
52
  COMMAND <%= target_name %> FLTCMD BIG_ENDIAN "Command with float parameters"
53
+ VALIDATOR inst_cmd_validator.rb
48
54
  <%= render "_ccsds_cmd.txt", locals: {id: 6} %>
49
55
  PARAMETER FLOAT32 64 32 FLOAT MIN MAX 0.0 "Float32 parameter"
50
56
  PARAMETER FLOAT64 96 64 FLOAT MIN MAX 0.0 "Float64 parameter"
51
57
 
52
58
  COMMAND <%= target_name %> ARYCMD BIG_ENDIAN "Command with array parameter"
59
+ VALIDATOR inst_cmd_validator.rb
53
60
  <%= render "_ccsds_cmd.txt", locals: {id: 7} %>
54
61
  ARRAY_PARAMETER ARRAY 64 32 UINT -8 "Array parameter"
55
62
  PARAMETER CRC -8 8 UINT MIN MAX 0 "CRC"
56
63
 
57
64
  COMMAND <%= target_name %> SLRPNLDEPLOY BIG_ENDIAN "Deploy solar array panels"
65
+ VALIDATOR inst_cmd_validator.rb
58
66
  <%= render "_ccsds_cmd.txt", locals: {id: 8} %>
59
67
  RELATED_ITEM <%= target_name %> MECH SLRPNL1
60
68
  RELATED_ITEM <%= target_name %> MECH SLRPNL2
@@ -63,6 +71,7 @@ COMMAND <%= target_name %> SLRPNLDEPLOY BIG_ENDIAN "Deploy solar array panels"
63
71
  RELATED_ITEM <%= target_name %> MECH SLRPNL5
64
72
 
65
73
  COMMAND <%= target_name %> SLRPNLRESET BIG_ENDIAN "Reset solar array panels"
74
+ VALIDATOR inst_cmd_validator.rb
66
75
  <%= render "_ccsds_cmd.txt", locals: {id: 9} %>
67
76
  RELATED_ITEM <%= target_name %> MECH SLRPNL1
68
77
  RELATED_ITEM <%= target_name %> MECH SLRPNL2
@@ -71,22 +80,26 @@ COMMAND <%= target_name %> SLRPNLRESET BIG_ENDIAN "Reset solar array panels"
71
80
  RELATED_ITEM <%= target_name %> MECH SLRPNL5
72
81
 
73
82
  COMMAND <%= target_name %> MEMLOAD BIG_ENDIAN "Load memory"
83
+ VALIDATOR inst_cmd_validator.rb
74
84
  DISABLE_MESSAGES # Disable messages on a command that could be sent many many times
75
85
  <%= render "_ccsds_cmd.txt", locals: {id: 10} %>
76
86
  APPEND_PARAMETER DATA 80 BLOCK "" "Block of data"
77
87
  RELATED_ITEM <%= target_name %> HEALTH_STATUS BLOCKTEST
78
88
 
79
89
  COMMAND <%= target_name %> QUIET BIG_ENDIAN "Enable/disable no out of limits in the demo"
90
+ VALIDATOR inst_cmd_validator.rb
80
91
  <%= render "_ccsds_cmd.txt", locals: {id: 11} %>
81
92
  APPEND_PARAMETER STATE 8 UINT 0 1 1
82
93
  STATE FALSE 0
83
94
  STATE TRUE 1
84
95
 
85
96
  COMMAND <%= target_name %> TIME_OFFSET BIG_ENDIAN "Subtract the packet time by the given seconds"
97
+ VALIDATOR inst_cmd_validator.rb
86
98
  <%= render "_ccsds_cmd.txt", locals: {id: 12} %>
87
99
  APPEND_PARAMETER SECONDS 32 UINT MIN MAX 0 "Seconds to subtract from packet time"
88
100
 
89
101
  COMMAND <%= target_name %> HIDDEN BIG_ENDIAN "Hidden command to bump the hidden packet"
102
+ VALIDATOR inst_cmd_validator.rb
90
103
  HIDDEN
91
104
  <%= render "_ccsds_cmd.txt", locals: {id: 13} %>
92
105
  APPEND_PARAMETER COUNT 32 UINT MIN MAX 0 "Count to set"
@@ -1,5 +1,6 @@
1
1
  TELEMETRY <%= target_name %> HEALTH_STATUS BIG_ENDIAN "Health and status from the <%= target_name %> target"
2
2
  <%= render "_ccsds_tlm.txt", locals: {apid: 1} %>
3
+ APPEND_ITEM CMD_ACPT_CNT 32 UINT "Command accept count"
3
4
  APPEND_ITEM COLLECTS 16 UINT "Number of collects"
4
5
  APPEND_ITEM TEMP1 16 UINT "Temperature #1"
5
6
  POLY_READ_CONVERSION -100.0 0.00305
@@ -14,7 +14,7 @@
14
14
  # GNU Affero General Public License for more details.
15
15
 
16
16
  # Modified by OpenC3, Inc.
17
- # All changes Copyright 2023, OpenC3, Inc.
17
+ # All changes Copyright 2024, OpenC3, Inc.
18
18
  # All Rights Reserved
19
19
  #
20
20
  # This file may also be used under the terms of a commercial license
@@ -28,9 +28,9 @@ class ExampleLimitsResponse < OpenC3::LimitsResponse
28
28
  def call(packet, item, old_limits_state)
29
29
  case item.limits.state
30
30
  when :RED_HIGH
31
- cmd('<%= target_name %>', 'COLLECT', 'TYPE' => 'NORMAL', 'DURATION' => 7)
31
+ cmd('<%= target_name %> COLLECT with TYPE NORMAL, DURATION 7', validate: false)
32
32
  when :RED_LOW
33
- cmd_no_hazardous_check('<%= target_name %>', 'CLEAR')
33
+ cmd('<%= target_name %> ABORT', validate: false)
34
34
  end
35
35
  end
36
36
  end
@@ -0,0 +1,47 @@
1
+ # encoding: ascii-8bit
2
+
3
+ # Copyright 2024 OpenC3, Inc.
4
+ # All Rights Reserved.
5
+ #
6
+ # This program is free software; you can modify and/or redistribute it
7
+ # under the terms of the GNU Affero General Public License
8
+ # as published by the Free Software Foundation; version 3 with
9
+ # attribution addendums as found in the LICENSE.txt
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+
16
+ # This file may also be used under the terms of a commercial license
17
+ # if purchased from OpenC3, Inc.
18
+
19
+ require 'openc3/packets/command_validator'
20
+
21
+ class InstCmdValidator < OpenC3::CommandValidator
22
+ def pre_check(command)
23
+ # Record the current value of CMD_ACPT_CNT for comparison in post_check
24
+ @cmd_acpt_cnt = tlm("<%= target_name %> HEALTH_STATUS CMD_ACPT_CNT")
25
+ return [true, nil]
26
+ end
27
+
28
+ def post_check(command)
29
+ if command.packet_name == 'TIME_OFFSET'
30
+ # Return Failure with a message
31
+ return [false, 'TIME_OFFSET failure description']
32
+ end
33
+ if command.packet_name == 'MEMLOAD'
34
+ # Return Unknown with a message
35
+ return [nil, 'MEMLOAD validation unknown']
36
+ end
37
+ if command.packet_name == 'CLEAR'
38
+ wait_check("<%= target_name %> HEALTH_STATUS CMD_ACPT_CNT == 0", 10)
39
+ # Return Success with a message
40
+ return [true, "CMD_ACPT_CNT cleared"]
41
+ else
42
+ wait_check("<%= target_name %> HEALTH_STATUS CMD_ACPT_CNT > #{@cmd_acpt_cnt}", 10)
43
+ # Return Success without a message
44
+ return [true, nil]
45
+ end
46
+ end
47
+ end
@@ -14,7 +14,7 @@
14
14
  # GNU Affero General Public License for more details.
15
15
 
16
16
  # Modified by OpenC3, Inc.
17
- # All changes Copyright 2022, OpenC3, Inc.
17
+ # All changes Copyright 2024, OpenC3, Inc.
18
18
  # All Rights Reserved
19
19
  #
20
20
  # This file may also be used under the terms of a commercial license
@@ -131,17 +131,17 @@ module OpenC3
131
131
  @solar_panel_thread = nil
132
132
  @solar_panel_thread_cancel = false
133
133
 
134
- @trackStars = Array.new
135
- @trackStars[0] = 1237
136
- @trackStars[1] = 1329
137
- @trackStars[2] = 1333
138
- @trackStars[3] = 1139
139
- @trackStars[4] = 1161
140
- @trackStars[5] = 682
141
- @trackStars[6] = 717
142
- @trackStars[7] = 814
143
- @trackStars[8] = 583
144
- @trackStars[9] = 622
134
+ @track_stars = Array.new
135
+ @track_stars[0] = 1237
136
+ @track_stars[1] = 1329
137
+ @track_stars[2] = 1333
138
+ @track_stars[3] = 1139
139
+ @track_stars[4] = 1161
140
+ @track_stars[5] = 682
141
+ @track_stars[6] = 717
142
+ @track_stars[7] = 814
143
+ @track_stars[8] = 583
144
+ @track_stars[9] = 622
145
145
 
146
146
  @bad_temp2 = false
147
147
  @last_temp2 = 0
@@ -174,31 +174,27 @@ module OpenC3
174
174
 
175
175
  case name
176
176
  when 'COLLECT'
177
+ hs_packet.cmd_acpt_cnt += 1
177
178
  hs_packet.collects += 1
178
179
  hs_packet.duration = packet.read('duration')
179
180
  hs_packet.collect_type = packet.read("type")
181
+ when 'ABORT', 'FLTCMD', 'ARYCMD'
182
+ hs_packet.cmd_acpt_cnt += 1
180
183
  when 'CLEAR'
184
+ hs_packet.cmd_acpt_cnt = 0
181
185
  hs_packet.collects = 0
182
- when 'MEMLOAD'
183
- hs_packet.blocktest = packet.read('data')
184
- when 'QUIET'
185
- if packet.read('state') == 'TRUE'
186
- @quiet = true
187
- else
188
- @quiet = false
189
- end
190
- when 'TIME_OFFSET'
191
- @time_offset = packet.read('seconds')
192
186
  when 'SETPARAMS'
193
- # puts "SETPARAMS packet: #{packet.buffer.formatted}"
187
+ hs_packet.cmd_acpt_cnt += 1
194
188
  params_packet.value1 = packet.read('value1')
195
189
  params_packet.value2 = packet.read('value2')
196
190
  params_packet.value3 = packet.read('value3')
197
191
  params_packet.value4 = packet.read('value4')
198
192
  params_packet.value5 = packet.read('value5')
199
193
  when 'ASCIICMD'
194
+ hs_packet.cmd_acpt_cnt += 1
200
195
  hs_packet.asciicmd = packet.read('string')
201
196
  when 'SLRPNLDEPLOY'
197
+ hs_packet.cmd_acpt_cnt += 1
202
198
  return if @solar_panel_thread and @solar_panel_thread.alive?
203
199
  @solar_panel_thread = Thread.new do
204
200
  @solar_panel_thread_cancel = false
@@ -221,9 +217,24 @@ module OpenC3
221
217
  end
222
218
  end
223
219
  when 'SLRPNLRESET'
220
+ hs_packet.cmd_acpt_cnt += 1
224
221
  OpenC3.kill_thread(self, @solar_panel_thread)
225
222
  @solar_panel_positions = SOLAR_PANEL_DFLTS.dup
223
+ when 'MEMLOAD'
224
+ hs_packet.cmd_acpt_cnt += 1
225
+ hs_packet.blocktest = packet.read('data')
226
+ when 'QUIET'
227
+ hs_packet.cmd_acpt_cnt += 1
228
+ if packet.read('state') == 'TRUE'
229
+ @quiet = true
230
+ else
231
+ @quiet = false
232
+ end
233
+ when 'TIME_OFFSET'
234
+ hs_packet.cmd_acpt_cnt += 1
235
+ @time_offset = packet.read('seconds')
226
236
  when 'HIDDEN'
237
+ # Deliberately do not increment cmd_acpt_cnt
227
238
  @tlm_packets['HIDDEN'].count = packet.read('count')
228
239
  end
229
240
  end
@@ -286,11 +297,11 @@ module OpenC3
286
297
  packet.biasy = @att_packet.biasy
287
298
  packet.biasy = @att_packet.biasz
288
299
 
289
- packet.star1id = @trackStars[((count_100hz / 100) + 0) % 10]
290
- packet.star2id = @trackStars[((count_100hz / 100) + 1) % 10]
291
- packet.star3id = @trackStars[((count_100hz / 100) + 2) % 10]
292
- packet.star4id = @trackStars[((count_100hz / 100) + 3) % 10]
293
- packet.star5id = @trackStars[((count_100hz / 100) + 4) % 10]
300
+ packet.star1id = @track_stars[((count_100hz / 100) + 0) % 10]
301
+ packet.star2id = @track_stars[((count_100hz / 100) + 1) % 10]
302
+ packet.star3id = @track_stars[((count_100hz / 100) + 2) % 10]
303
+ packet.star4id = @track_stars[((count_100hz / 100) + 3) % 10]
304
+ packet.star5id = @track_stars[((count_100hz / 100) + 4) % 10]
294
305
 
295
306
  packet.posprogress = (@position_file_bytes_read.to_f / @position_file_size.to_f) * 100.0
296
307
  packet.attprogress = (@attitude_file_bytes_read.to_f / @attitude_file_size.to_f) * 100.0
@@ -11,7 +11,7 @@ set_timeline_color("Mine", "#4287f5")
11
11
  puts get_timeline("Mine") #=> {"name"=>"Mine", "color"=>"#4287f5", "scope"=>"DEFAULT", "updated_at"=>1698763720728596964}
12
12
 
13
13
  now = Time.now()
14
- start = Time.new(now.year, now.month, now.day, now.hour + 1, 30, 00)
14
+ start = now + 3600
15
15
  stop = start + 3600 # Stop plus 1hr
16
16
  act = create_timeline_activity("Mine", kind: "reserve", start: start, stop: stop)
17
17
  puts act #=>
@@ -31,7 +31,7 @@ stop = start + 300
31
31
  act = create_timeline_activity("Mine", kind: "reserve", start: start, stop: stop)
32
32
  tlas = get_timeline_activities("Mine")
33
33
  check_expression("#{tlas.length} == 2")
34
- delete_timeline_activity("Mine", act['start'])
34
+ delete_timeline_activity("Mine", act['start'], act['uuid'])
35
35
  tlas = get_timeline_activities("Mine")
36
36
  check_expression("#{tlas.length} == 1")
37
37
 
@@ -3,6 +3,10 @@ puts ENV.inspect
3
3
  # Print the TYPE env var which is set in the INST COMMANDING screen
4
4
  puts "ENV['TYPE']:#{ENV['TYPE']}"
5
5
 
6
+ # Test some of the various keyword arguments
7
+ cmd("<%= target_name %> ABORT", timeout: 30)
8
+ cmd("<%= target_name %> ABORT", log_message: false)
9
+ cmd("<%= target_name %> ABORT", validate: false)
6
10
  collect_cnt = tlm("<%= target_name %> HEALTH_STATUS COLLECTS")
7
11
  cmd("<%= target_name %> COLLECT with DURATION 11, TYPE NORMAL")
8
12
  cmd_no_range_check("<%= target_name %> COLLECT with DURATION 11, TYPE NORMAL")
@@ -17,6 +17,4 @@ check_expression("#{metadata_all().length} >= 2")
17
17
  wait 2 # Allow time to advance or it's an error
18
18
  metadata_set({ 'new' => 5 }) # Another new entry
19
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}")
20
+ puts metadata_all()
@@ -18,7 +18,7 @@ VERTICAL
18
18
  LABEL " Duration: "
19
19
  NAMED_WIDGET DURATION TEXTFIELD 12 "10.0"
20
20
  END
21
- # This is an example of using a varible named 'type'. You can operate on variables with Javascript code.
21
+ # This is an example of using a variable named 'type'. You can operate on variables with Javascript code.
22
22
  # All OpenC3 commands (api.cmd) must be separated by double semicolons ';;'. All code separated by semicolons is evaluated together.
23
23
  # Note: you can also request and use telemetry in screens using Javascript Promises, e.g.
24
24
  # api.tlm('INST PARAMS VALUE3', 'RAW').then(dur => api.cmd('INST COLLECT with TYPE '+type+', DURATION '+dur))"
@@ -20,7 +20,7 @@ VERTICAL
20
20
  CANVASIMAGE "satellite.png" 90 130 200 200
21
21
  # If the image is clicked the "<%= target_name %> ADCS" screen will popup
22
22
  SETTING SCREEN <%= target_name %> ADCS
23
- # We're using the converted value and specifing a default of "ground_error.png"
23
+ # We're using the converted value and specifying a default of "ground_error.png"
24
24
  # if none of the IMAGE settings match the value
25
25
  CANVASIMAGEVALUE <%= target_name %> HEALTH_STATUS GROUND1STATUS CONVERTED "ground_error.png" 400 100 180 180
26
26
  SETTING IMAGE CONNECTED "ground_on.png" 400 100
@@ -1,19 +1,19 @@
1
1
  TABLE "TLM_Monitoring" BIG_ENDIAN ROW_COLUMN 100 "Telemetry Monitoring Table"
2
- APPEND_PARAMETER "Threshold" 32 UINT MIN MAX 0 "Telemetry item threshold at which point persistance is incremented"
2
+ APPEND_PARAMETER "Threshold" 32 UINT MIN MAX 0 "Telemetry item threshold at which point persistence is incremented"
3
3
  APPEND_PARAMETER "Offset" 32 UINT MIN MAX 0 "Offset into the telemetry packet to monitor"
4
4
  APPEND_PARAMETER "Data_Size" 32 UINT 0 3 0 "Amount of data to monitor (bytes)"
5
5
  STATE BITS 0
6
6
  STATE BYTE 1
7
7
  STATE WORD 2
8
8
  STATE LONGWORD 3
9
- APPEND_PARAMETER "Bit_Mask" 32 UINT MIN MAX 0 "Bit Mask to apply to the Data Size before the value is compared ot the Threshold"
9
+ APPEND_PARAMETER "Bit_Mask" 32 UINT MIN MAX 0 "Bit Mask to apply to the Data Size before the value is compared to the Threshold"
10
10
  APPEND_PARAMETER "Persistence" 32 UINT MIN MAX 0 "Number of times the Threshold must be exceeded before Action is triggered"
11
11
  APPEND_PARAMETER "Type" 32 UINT 0 3 0 "How the Threshold is compared against"
12
12
  STATE LESS_THAN 0
13
13
  STATE GREATER_THAN 1
14
14
  STATE EQUAL_TO 2
15
15
  STATE NOT_EQUAL_TO 3
16
- APPEND_PARAMETER "Action" 32 UINT 0 4 0 "Action to take when Persistance is met"
16
+ APPEND_PARAMETER "Action" 32 UINT 0 4 0 "Action to take when Persistence is met"
17
17
  STATE NO_ACTION_REQUIRED 0
18
18
  STATE INITIATE_RESET 1
19
19
  STATE CHANGE_MODE_SAFE 2
@@ -1,7 +1,7 @@
1
1
  PARAMETER CCSDSVER 0 3 UINT 0 0 0 "CCSDS primary header version number"
2
2
  PARAMETER CCSDSTYPE 3 1 UINT 1 1 1 "CCSDS primary header packet type"
3
3
  PARAMETER CCSDSSHF 4 1 UINT 0 0 0 "CCSDS primary header secondary header flag"
4
- ID_PARAMETER CCSDSAPID 5 11 UINT 0 2047 999 "CCSDS primary header application id"
4
+ ID_PARAMETER CCSDSAPID 5 11 UINT 0 2047 <%= id %> "CCSDS primary header application id"
5
5
  PARAMETER CCSDSSEQFLAGS 16 2 UINT 3 3 3 "CCSDS primary header sequence flags"
6
6
  PARAMETER CCSDSSEQCNT 18 14 UINT 0 16383 0 "CCSDS primary header sequence count"
7
7
  OVERFLOW TRUNCATE
@@ -1,4 +1,5 @@
1
1
  COMMAND <%= target_name %> COLLECT BIG_ENDIAN "Starts a collect on the <%= target_name %> target"
2
+ VALIDATOR inst2_cmd_validator.py
2
3
  <%= render "_ccsds_cmd.txt", locals: {id: 1} %>
3
4
  PARAMETER TYPE 64 16 UINT MIN MAX 0 "Collect type which can be normal or special. Note the special collects are hazarous and require user confirmation."
4
5
  REQUIRED
@@ -14,14 +15,17 @@ COMMAND <%= target_name %> COLLECT BIG_ENDIAN "Starts a collect on the <%= targe
14
15
  RELATED_ITEM <%= target_name %> HEALTH_STATUS COLLECT_TYPE
15
16
 
16
17
  COMMAND <%= target_name %> ABORT BIG_ENDIAN "Aborts a collect on the <%= target_name %> instrument"
18
+ VALIDATOR inst2_cmd_validator.py
17
19
  <%= render "_ccsds_cmd.txt", locals: {id: 2} %>
18
20
 
19
21
  COMMAND <%= target_name %> CLEAR BIG_ENDIAN "Clears counters on the <%= target_name %> instrument"
22
+ VALIDATOR inst2_cmd_validator.py
20
23
  HAZARDOUS "Clearing counters may lose valuable information."
21
24
  <%= render "_ccsds_cmd.txt", locals: {id: 3} %>
22
25
  RELATED_ITEM <%= target_name %> HEALTH_STATUS COLLECTS
23
26
 
24
27
  COMMAND <%= target_name %> SETPARAMS BIG_ENDIAN "Sets numbered parameters"
28
+ VALIDATOR inst2_cmd_validator.py
25
29
  <%= render "_ccsds_cmd.txt", locals: {id: 4} %>
26
30
  # ERB syntax:
27
31
  <% (1..5).each do |i| %>
@@ -33,6 +37,7 @@ COMMAND <%= target_name %> SETPARAMS BIG_ENDIAN "Sets numbered parameters"
33
37
  POLY_WRITE_CONVERSION 0 2
34
38
 
35
39
  COMMAND <%= target_name %> ASCIICMD BIG_ENDIAN "Enumerated ASCII command"
40
+ VALIDATOR inst2_cmd_validator.py
36
41
  <%= render "_ccsds_cmd.txt", locals: {id: 5} %>
37
42
  APPEND_PARAMETER STRING 2048 STRING "NOOP" "Enumerated string parameter"
38
43
  STATE "ARM LASER" "ARM LASER" HAZARDOUS "Arming the laser poses an eye safety hazard."
@@ -43,16 +48,19 @@ COMMAND <%= target_name %> ASCIICMD BIG_ENDIAN "Enumerated ASCII command"
43
48
  RELATED_ITEM <%= target_name %> HEALTH_STATUS ASCIICMD
44
49
 
45
50
  COMMAND <%= target_name %> FLTCMD BIG_ENDIAN "Command with float parameters"
51
+ VALIDATOR inst2_cmd_validator.py
46
52
  <%= render "_ccsds_cmd.txt", locals: {id: 6} %>
47
53
  PARAMETER FLOAT32 64 32 FLOAT MIN MAX 0.0 "Float32 parameter"
48
54
  PARAMETER FLOAT64 96 64 FLOAT MIN MAX 0.0 "Float64 parameter"
49
55
 
50
56
  COMMAND <%= target_name %> ARYCMD BIG_ENDIAN "Command with array parameter"
57
+ VALIDATOR inst2_cmd_validator.py
51
58
  <%= render "_ccsds_cmd.txt", locals: {id: 7} %>
52
59
  ARRAY_PARAMETER ARRAY 64 32 UINT -8 "Array parameter"
53
60
  PARAMETER CRC -8 8 UINT MIN MAX 0 "CRC"
54
61
 
55
62
  COMMAND <%= target_name %> SLRPNLDEPLOY BIG_ENDIAN "Deploy solar array panels"
63
+ VALIDATOR inst2_cmd_validator.py
56
64
  <%= render "_ccsds_cmd.txt", locals: {id: 8} %>
57
65
  RELATED_ITEM <%= target_name %> MECH SLRPNL1
58
66
  RELATED_ITEM <%= target_name %> MECH SLRPNL2
@@ -61,6 +69,7 @@ COMMAND <%= target_name %> SLRPNLDEPLOY BIG_ENDIAN "Deploy solar array panels"
61
69
  RELATED_ITEM <%= target_name %> MECH SLRPNL5
62
70
 
63
71
  COMMAND <%= target_name %> SLRPNLRESET BIG_ENDIAN "Reset solar array panels"
72
+ VALIDATOR inst2_cmd_validator.py
64
73
  <%= render "_ccsds_cmd.txt", locals: {id: 9} %>
65
74
  RELATED_ITEM <%= target_name %> MECH SLRPNL1
66
75
  RELATED_ITEM <%= target_name %> MECH SLRPNL2
@@ -69,17 +78,26 @@ COMMAND <%= target_name %> SLRPNLRESET BIG_ENDIAN "Reset solar array panels"
69
78
  RELATED_ITEM <%= target_name %> MECH SLRPNL5
70
79
 
71
80
  COMMAND <%= target_name %> MEMLOAD BIG_ENDIAN "Load memory"
81
+ VALIDATOR inst2_cmd_validator.py
72
82
  DISABLE_MESSAGES # Disable messages on a command that could be sent many many times
73
83
  <%= render "_ccsds_cmd.txt", locals: {id: 10} %>
74
84
  APPEND_PARAMETER DATA 80 BLOCK "" "Block of data"
75
85
  RELATED_ITEM <%= target_name %> HEALTH_STATUS BLOCKTEST
76
86
 
77
87
  COMMAND <%= target_name %> QUIET BIG_ENDIAN "Enable/disable no out of limits in the demo"
88
+ VALIDATOR inst2_cmd_validator.py
78
89
  <%= render "_ccsds_cmd.txt", locals: {id: 11} %>
79
90
  APPEND_PARAMETER STATE 8 UINT 0 1 1
80
91
  STATE FALSE 0
81
92
  STATE TRUE 1
82
93
 
83
94
  COMMAND <%= target_name %> TIME_OFFSET BIG_ENDIAN "Subtract the packet time by the given seconds"
95
+ VALIDATOR inst2_cmd_validator.py
84
96
  <%= render "_ccsds_cmd.txt", locals: {id: 12} %>
85
97
  APPEND_PARAMETER SECONDS 32 UINT MIN MAX 0 "Seconds to subtract from packet time"
98
+
99
+ COMMAND <%= target_name %> HIDDEN BIG_ENDIAN "Hidden command to bump the hidden packet"
100
+ VALIDATOR inst2_cmd_validator.py
101
+ HIDDEN
102
+ <%= render "_ccsds_cmd.txt", locals: {id: 13} %>
103
+ APPEND_PARAMETER COUNT 32 UINT MIN MAX 0 "Count to set"
@@ -1,5 +1,6 @@
1
1
  TELEMETRY <%= target_name %> HEALTH_STATUS BIG_ENDIAN "Health and status from the <%= target_name %> target"
2
2
  <%= render "_ccsds_tlm.txt", locals: {apid: 1} %>
3
+ APPEND_ITEM CMD_ACPT_CNT 32 UINT "Command accept count"
3
4
  APPEND_ITEM COLLECTS 16 UINT "Number of collects"
4
5
  APPEND_ITEM TEMP1 16 UINT "Temperature #1"
5
6
  POLY_READ_CONVERSION -100.0 0.00305
@@ -50,7 +51,7 @@ TELEMETRY <%= target_name %> HEALTH_STATUS BIG_ENDIAN "Health and status from th
50
51
  STATE UNAVAILABLE 0 YELLOW
51
52
  APPEND_ITEM BLOCKTEST 80 BLOCK "Block data"
52
53
  APPEND_ITEM BRACKET[0] 8 UINT "Regular item with brackets in the name"
53
- ITEM PACKET_TIME 0 0 DERIVED "Ruby time based on TIMESEC and TIMEUS"
54
+ ITEM PACKET_TIME 0 0 DERIVED "Python time based on TIMESEC and TIMEUS"
54
55
  READ_CONVERSION openc3/conversions/unix_time_conversion.py TIMESEC TIMEUS
55
56
  ITEM TEMP1HIGH 0 0 DERIVED "High-water mark for TEMP1"
56
57
  READ_CONVERSION openc3/conversions/processor_conversion.py TEMP1WATER HIGH_WATER
@@ -107,7 +108,7 @@ TELEMETRY <%= target_name %> ADCS BIG_ENDIAN "Position and attitude data"
107
108
  FORMAT_STRING "%0.2f"
108
109
  ITEM ATTPROGRESS 656 32 FLOAT "Attitude file progress"
109
110
  FORMAT_STRING "%0.2f"
110
- ITEM PACKET_TIME 0 0 DERIVED "Ruby time based on TIMESEC and TIMEUS"
111
+ ITEM PACKET_TIME 0 0 DERIVED "Python time based on TIMESEC and TIMEUS"
111
112
  READ_CONVERSION openc3/conversions/unix_time_conversion.py TIMESEC TIMEUS
112
113
 
113
114
  TELEMETRY <%= target_name %> PARAMS BIG_ENDIAN "Params set by SETPARAMS command"
@@ -118,7 +119,7 @@ TELEMETRY <%= target_name %> PARAMS BIG_ENDIAN "Params set by SETPARAMS command"
118
119
  STATE GOOD 0 GREEN
119
120
  STATE BAD 1 RED
120
121
  <% end %>
121
- ITEM PACKET_TIME 0 0 DERIVED "Ruby time based on TIMESEC and TIMEUS"
122
+ ITEM PACKET_TIME 0 0 DERIVED "Python time based on TIMESEC and TIMEUS"
122
123
  READ_CONVERSION openc3/conversions/unix_time_conversion.py TIMESEC TIMEUS
123
124
 
124
125
  TELEMETRY <%= target_name %> IMAGE BIG_ENDIAN "Packet with image data"
@@ -128,7 +129,7 @@ TELEMETRY <%= target_name %> IMAGE BIG_ENDIAN "Packet with image data"
128
129
  ITEM BYTES 128 32 UINT "First bytes"
129
130
  FORMAT_STRING '0x%08x'
130
131
  OVERLAP # Notify OpenC3 that this is intentionally overlapping the BLOCK field
131
- ITEM PACKET_TIME 0 0 DERIVED "Ruby time based on TIMESEC and TIMEUS"
132
+ ITEM PACKET_TIME 0 0 DERIVED "Python time based on TIMESEC and TIMEUS"
132
133
  READ_CONVERSION openc3/conversions/unix_time_conversion.py TIMESEC TIMEUS
133
134
 
134
135
  TELEMETRY <%= target_name %> MECH BIG_ENDIAN "Mechanism status"
@@ -147,5 +148,12 @@ TELEMETRY <%= target_name %> MECH BIG_ENDIAN "Mechanism status"
147
148
  APPEND_ITEM CURRENT 32 FLOAT "Device current"
148
149
  UNITS micro-Ampères µA
149
150
  APPEND_ITEM STRING 0 STRING "String"
150
- ITEM PACKET_TIME 0 0 DERIVED "Ruby time based on TIMESEC and TIMEUS"
151
+ ITEM PACKET_TIME 0 0 DERIVED "Python time based on TIMESEC and TIMEUS"
152
+ READ_CONVERSION openc3/conversions/unix_time_conversion.py TIMESEC TIMEUS
153
+
154
+ TELEMETRY <%= target_name %> HIDDEN BIG_ENDIAN "Hidden packet"
155
+ HIDDEN
156
+ <%= render "_ccsds_tlm.txt", locals: {apid: 6} %>
157
+ APPEND_ITEM COUNT 32 UINT "Count for hidden command"
158
+ ITEM PACKET_TIME 0 0 DERIVED "Python time based on TIMESEC and TIMEUS"
151
159
  READ_CONVERSION openc3/conversions/unix_time_conversion.py TIMESEC TIMEUS
@@ -1,4 +1,4 @@
1
- # Copyright 2023 OpenC3, Inc.
1
+ # Copyright 2024 OpenC3, Inc.
2
2
  # All Rights Reserved.
3
3
  #
4
4
  # This program is free software; you can modify and/or redistribute it
@@ -15,13 +15,16 @@
15
15
  # if purchased from OpenC3, Inc.
16
16
 
17
17
  from openc3.packets.limits_response import LimitsResponse
18
- from openc3.api.cmd_api import cmd, cmd_no_hazardous_check
18
+ from openc3.api.cmd_api import cmd
19
19
 
20
20
 
21
21
  class ExampleLimitsResponse(LimitsResponse):
22
- def call(self, packet, item, old_limits_state):
22
+ def call(self, _packet, item, _old_limits_state):
23
23
  match item.limits.state:
24
24
  case "RED_HIGH":
25
- cmd("<%= target_name %>", "COLLECT", {"TYPE": "NORMAL", "DURATION": 7})
25
+ cmd(
26
+ "<%= target_name %> COLLECT with TYPE NORMAL, DURATION 8",
27
+ validate=False,
28
+ )
26
29
  case "RED_LOW":
27
- cmd_no_hazardous_check("<%= target_name %>", "CLEAR")
30
+ cmd("<%= target_name %> ABORT", validate=False)
@@ -0,0 +1,44 @@
1
+ # Copyright 2024 OpenC3, Inc.
2
+ # All Rights Reserved.
3
+ #
4
+ # This program is free software; you can modify and/or redistribute it
5
+ # under the terms of the GNU Affero General Public License
6
+ # as published by the Free Software Foundation; version 3 with
7
+ # attribution addendums as found in the LICENSE.txt
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU Affero General Public License for more details.
13
+
14
+ # This file may also be used under the terms of a commercial license
15
+ # if purchased from OpenC3, Inc.
16
+
17
+ from openc3.packets.command_validator import CommandValidator
18
+ from openc3.api import *
19
+
20
+
21
+ class Inst2CmdValidator(CommandValidator):
22
+ def pre_check(self, command):
23
+ # Record the current value of CMD_ACPT_CNT for comparison in post_check
24
+ self.cmd_acpt_cnt = tlm("<%= target_name %> HEALTH_STATUS CMD_ACPT_CNT")
25
+ return [True, None]
26
+
27
+ def post_check(self, command):
28
+ if command.packet_name == "TIME_OFFSET":
29
+ # Return Failure with a message
30
+ return [False, "TIME_OFFSET failure description"]
31
+ if command.packet_name == "MEMLOAD":
32
+ # Return Unknown with a message
33
+ return [None, "MEMLOAD validation unknown"]
34
+ if command.packet_name == "CLEAR":
35
+ wait_check("<%= target_name %> HEALTH_STATUS CMD_ACPT_CNT == 0", 10)
36
+ # Return Success with a message
37
+ return [True, "CMD_ACPT_CNT cleared"]
38
+ else:
39
+ wait_check(
40
+ f"<%= target_name %> HEALTH_STATUS CMD_ACPT_CNT > {self.cmd_acpt_cnt}",
41
+ 10,
42
+ )
43
+ # Return Success without a message
44
+ return [True, None]