openc3-cosmos-demo 5.18.0 → 5.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/plugin.txt +0 -1
  3. data/requirements.txt +1 -0
  4. data/targets/INST/cmd_tlm/_ccsds_cmd.txt +1 -1
  5. data/targets/INST/cmd_tlm/inst_cmds.txt +13 -0
  6. data/targets/INST/cmd_tlm/inst_tlm.txt +1 -0
  7. data/targets/INST/lib/example_limits_response.rb +3 -3
  8. data/targets/INST/lib/inst_cmd_validator.rb +47 -0
  9. data/targets/INST/lib/sim_inst.rb +39 -28
  10. data/targets/INST/procedures/calendar.rb +2 -2
  11. data/targets/INST/procedures/checks.rb +4 -0
  12. data/targets/INST/procedures/metadata.rb +1 -3
  13. data/targets/INST/procedures/my_test_suite.rb +2 -2
  14. data/targets/INST/screens/commanding.txt +24 -10
  15. data/targets/INST/screens/ground.txt +1 -1
  16. data/targets/INST/screens/hs.txt +1 -0
  17. data/targets/INST/screens/rollup.txt +1 -1
  18. data/targets/INST/tables/config/TLMMonitoringTable_def.txt +3 -3
  19. data/targets/INST2/cmd_tlm/_ccsds_cmd.txt +1 -1
  20. data/targets/INST2/cmd_tlm/inst_cmds.txt +18 -0
  21. data/targets/INST2/cmd_tlm/inst_tlm.txt +13 -5
  22. data/targets/INST2/lib/example_limits_response.py +8 -5
  23. data/targets/INST2/lib/inst2_cmd_validator.py +44 -0
  24. data/targets/INST2/lib/sim_inst.py +24 -10
  25. data/targets/INST2/procedures/calendar.py +1 -1
  26. data/targets/INST2/procedures/checks.py +4 -0
  27. data/targets/INST2/procedures/metadata.py +2 -4
  28. data/targets/INST2/procedures/my_test_suite.py +2 -2
  29. data/targets/INST2/procedures/numpy.py +11 -0
  30. data/targets/INST2/screens/commanding.txt +25 -11
  31. data/targets/INST2/screens/ground.txt +1 -1
  32. data/targets/INST2/screens/hs.txt +1 -0
  33. data/targets/INST2/screens/rollup.txt +1 -1
  34. data/targets/INST2/tables/config/TLMMonitoringTable_def.txt +3 -3
  35. data/targets/SYSTEM/procedures/test.rb +0 -6
  36. data/tools/widgets/BigWidget/BigWidget.umd.min.js +1 -1
  37. data/tools/widgets/BigWidget/BigWidget.umd.min.js.map +1 -1
  38. data/tools/widgets/DataviewerquaternionWidget/DataviewerquaternionWidget.umd.min.js +2 -2
  39. data/tools/widgets/DataviewerquaternionWidget/DataviewerquaternionWidget.umd.min.js.map +1 -1
  40. data/tools/widgets/HelloworldWidget/HelloworldWidget.umd.min.js +1 -1
  41. data/tools/widgets/HelloworldWidget/HelloworldWidget.umd.min.js.map +1 -1
  42. metadata +6 -3
  43. 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: fd81132780179ea8ece04e981e278f7fbd40613d15cbb08ca8854d9a995a1033
4
+ data.tar.gz: 78be70c4ea0c4c07d4be6a7b820319d4e4d0a67d0bc172799d05f85ce6656eb9
5
5
  SHA512:
6
- metadata.gz: 898776dbf48af38d2cab0bcc69950461f6be998148438b3332e50e87a18dd0438189d5ad60c64dc96f0d0b00ecf7bc6cf87ae592a5544b47d8e919a46c1457a6
7
- data.tar.gz: 0c7be454f5cc752c79b0eece33fa56511c25f3ce60bbe3603916ca79071dab02b6d8ea62b568febd298e334c5ae7b8a82a25afea7011ad408512485b858a93b6
6
+ metadata.gz: 77961d9be04287a2b42aa3c969a22ff50e5d6842ad18f771bd77553bca9cb62e3463e2f08f15eeca751654b24bd911abbaef6759cecf8dad3ea812788ba97b75
7
+ data.tar.gz: 3d659f81e25cf57046819e0007732dfec5e7c01b2588e7f4513214d078d1a9553855215c68566b840c517696cac6fc711f5b2c1c38bc96f41934f14edea47fee
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
data/requirements.txt ADDED
@@ -0,0 +1 @@
1
+ numpy==2.1.1
@@ -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()
@@ -12,14 +12,14 @@ class ExampleTest < OpenC3::Test
12
12
  puts "continue past raise"
13
13
  end
14
14
 
15
- def test_2
15
+ def test_req2
16
16
  puts "Running #{OpenC3::Test.current_test_suite}:#{OpenC3::Test.current_test}:#{OpenC3::Test.current_test_case}"
17
17
  OpenC3::Test.puts "This test verifies requirement 2"
18
18
  helper()
19
19
  wait(2)
20
20
  end
21
21
 
22
- def test_3
22
+ def test_req3
23
23
  puts "Running #{OpenC3::Test.current_test_suite}:#{OpenC3::Test.current_test}:#{OpenC3::Test.current_test_case}"
24
24
  raise SkipTestCase
25
25
  end
@@ -1,12 +1,12 @@
1
1
  SCREEN AUTO AUTO 0.5
2
2
 
3
- VERTICAL
4
- TITLE "<%= target_name %> Commanding Examples"
3
+ TITLE "<%= target_name %> Commanding Examples"
5
4
 
6
- LABELVALUE <%= target_name %> HEALTH_STATUS COLLECTS
7
- LABELVALUE <%= target_name %> HEALTH_STATUS COLLECT_TYPE
8
- LABELVALUE <%= target_name %> HEALTH_STATUS DURATION
5
+ LABELVALUE <%= target_name %> HEALTH_STATUS COLLECTS
6
+ LABELVALUE <%= target_name %> HEALTH_STATUS COLLECT_TYPE
7
+ LABELVALUE <%= target_name %> HEALTH_STATUS DURATION
9
8
 
9
+ MATRIXBYCOLUMNS 2
10
10
  VERTICALBOX "Send Collect Command:"
11
11
  HORIZONTAL
12
12
  LABEL "Type: "
@@ -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))"
@@ -32,11 +32,13 @@ VERTICAL
32
32
  END
33
33
 
34
34
  VERTICALBOX "Parameter-less Commands:"
35
- NAMED_WIDGET GROUP RADIOGROUP 1 # Select 'Clear' initially, 0-based index
36
- RADIOBUTTON 'Abort'
37
- RADIOBUTTON 'Clear'
35
+ HORIZONTAL
36
+ NAMED_WIDGET GROUP RADIOGROUP 1 # Select 'Clear' initially, 0-based index
37
+ RADIOBUTTON 'Abort'
38
+ RADIOBUTTON 'Clear'
39
+ END
40
+ NAMED_WIDGET CHECK CHECKBUTTON 'Ignore Hazardous Checks' # No option is by default UNCHECKED
38
41
  END
39
- NAMED_WIDGET CHECK CHECKBUTTON 'Ignore Hazardous Checks' # No option is by default UNCHECKED
40
42
  BUTTON 'Send' "screen.getNamedWidget('GROUP').selected() === 0 ? " +
41
43
  "api.cmd('<%= target_name %> ABORT') : (screen.getNamedWidget('CHECK').checked() ? " +
42
44
  "api.cmd_no_hazardous_check('<%= target_name %> CLEAR') : api.cmd('<%= target_name %> CLEAR'))"
@@ -54,4 +56,16 @@ VERTICAL
54
56
  "var env = {}; env['TYPE'] = ctype;" \
55
57
  "runScript('<%= target_name %>/procedures/'+script, !screen.getNamedWidget('BG').checked(), env)"
56
58
  END
59
+
60
+ VERTICALBOX "Date / Time Chooser"
61
+ HORIZONTAL 5
62
+ NAMED_WIDGET DATE Date "Input Date"
63
+ NAMED_WIDGET TIME Time
64
+ END
65
+
66
+ BUTTON 'Alert' "var date=screen.getNamedWidget('DATE').text();" +
67
+ "var time=screen.getNamedWidget('TIME').text();" +
68
+ # You can have comments between string concatenations
69
+ "alert('DATE:'+date+' TIME:'+time)"
70
+ END
57
71
  END
@@ -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
@@ -16,6 +16,7 @@ VERTICAL
16
16
  VERTICALBOX "Temperatures"
17
17
  LABELVALUELIMITSBAR <%= target_name %> HEALTH_STATUS TEMP1 WITH_UNITS
18
18
  LABELVALUELIMITSBAR <%= target_name %> HEALTH_STATUS TEMP2 CONVERTED 25
19
+ SUBSETTING 2 WIDTH 160
19
20
  # LABELVALUELIMITSBAR <%= target_name %> HEALTH_STATUS TEMP2 RAW 20 # RAW is not allowed for LIMITSBAR widgets
20
21
  LABELVALUELIMITSBAR <%= target_name %> HEALTH_STATUS TEMP2 FORMATTED
21
22
  LABELVALUELIMITSBAR <%= target_name %> HEALTH_STATUS TEMP2 WITH_UNITS
@@ -11,7 +11,7 @@ HORIZONTAL
11
11
  SETTING SCREEN <%= target_name %> LIMITS
12
12
  SETTING TLM <%= target_name %> HEALTH_STATUS TEMP1
13
13
  ROLLUP equipment "Processor" "CPU"
14
- SETTING SCREEN <%= target_name %> ADCS
14
+ # No SCREEN should display without pointer cursor
15
15
  SETTING TLM <%= target_name %> HEALTH_STATUS TEMP4
16
16
  ROLLUP satellite-transmit "Satellite" "all temps"
17
17
  SETTING SCREEN <%= target_name %> HS
@@ -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