openc3-cosmos-demo 6.0.2 → 6.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/plugin.txt +1 -0
  3. data/requirements.txt +1 -1
  4. data/targets/INST/cmd_tlm/inst_cmds.txt +3 -0
  5. data/targets/INST/cmd_tlm/inst_tlm.txt +15 -5
  6. data/targets/INST/lib/inst_cmd_validator.rb +1 -0
  7. data/targets/INST/lib/sim_inst.rb +11 -6
  8. data/targets/INST/procedures/calendar.rb +52 -27
  9. data/targets/INST/procedures/checks.rb +1 -1
  10. data/targets/INST/procedures/disconnect.rb +1 -1
  11. data/targets/INST/procedures/scripting.rb +88 -0
  12. data/targets/INST/screens/graphs.txt +28 -23
  13. data/targets/INST/screens/limits.txt +5 -2
  14. data/targets/INST2/cmd_tlm/inst_cmds.txt +6 -1
  15. data/targets/INST2/cmd_tlm/inst_tlm.txt +15 -6
  16. data/targets/INST2/lib/sim_inst.py +11 -6
  17. data/targets/INST2/procedures/calendar.py +53 -38
  18. data/targets/INST2/procedures/disconnect.py +1 -1
  19. data/targets/INST2/procedures/scripting.py +84 -0
  20. data/targets/INST2/screens/graphs.txt +28 -23
  21. data/targets/INST2/screens/limits.txt +5 -2
  22. data/tools/widgets/BigWidget/BigWidget.umd.min.js +99 -98
  23. data/tools/widgets/BigWidget/BigWidget.umd.min.js.map +1 -1
  24. data/tools/widgets/DataviewerquaternionWidget/DataviewerquaternionWidget.umd.min.js +115 -114
  25. data/tools/widgets/DataviewerquaternionWidget/DataviewerquaternionWidget.umd.min.js.map +1 -1
  26. data/tools/widgets/DataviewertimeWidget/DataviewertimeWidget.umd.min.js +99 -98
  27. data/tools/widgets/DataviewertimeWidget/DataviewertimeWidget.umd.min.js.map +1 -1
  28. data/tools/widgets/HelloworldWidget/HelloworldWidget.umd.min.js +99 -98
  29. data/tools/widgets/HelloworldWidget/HelloworldWidget.umd.min.js.map +1 -1
  30. metadata +4 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 231e6075158197e5c69a00c65a7104fb68adba7088dd0a9ae8c23f566a6d514f
4
- data.tar.gz: b1b38d14dbc759655936764f6a35adfbed12ae3875dedd05b5bc9b78174ec664
3
+ metadata.gz: 384b529d200e06227c9a1fd078fe040651d3b03e2b2bbea0086798eb090783df
4
+ data.tar.gz: e6c70be49ae42fe7e5eb5edf2aeab6c5b304365ab0a008b03eecc77e378004c9
5
5
  SHA512:
6
- metadata.gz: '081623a648d0e9c52127c31d8a57af6efb179d1831d7bb25635d4d88baf2cd8db4409be3395131a6e4fc81a557e23db1ce26a32962e87cec7d78dced7f155831'
7
- data.tar.gz: 32691c50f96230d8dddcd2f820ac47a05f7e00516e5f740679c19ad742ee505d69f7c4b0277b3dc7d9efe46a616a8884131a8e3bf2ff91451fa3928307431945
6
+ metadata.gz: 07d2ff5a84058ed3141698270d51d3f062d82bd4cc89a6a8fb4afa718e251e4b5fa395b115f412ab360d5e377ad0168251e4a7145578123ae6ebb060eaa9c012
7
+ data.tar.gz: 5f16bb9e101979c0d1516e4d52f69390849b38cc0db4fd641bd2903610d5a25728cf1ddc41e92447c31d10b0973280ab67d5989e337a388f5f5a09568e14c034
data/plugin.txt CHANGED
@@ -95,6 +95,7 @@ VARIABLE reduced_log_retain_time 2592000
95
95
  DONT_CONNECT
96
96
  # Override the default log time of 600
97
97
  LOG_STREAM 60
98
+ OPTION CONNECT_CMD LOG "<%= example_target_name %> START"
98
99
  <% end %>
99
100
 
100
101
  <% if include_templated and include_templated_int %>
data/requirements.txt CHANGED
@@ -1 +1 @@
1
- numpy==2.1.1
1
+ numpy==2.2.3
@@ -33,6 +33,7 @@ COMMAND <%= target_name %> SETPARAMS BIG_ENDIAN "Sets numbered parameters"
33
33
  APPEND_PARAMETER VALUE<%= i %> 16 UINT 0 5 1 "Value <%= i %> setting" LITTLE_ENDIAN
34
34
  RELATED_ITEM <%= target_name %> PARAMS VALUE<%= i %>
35
35
  <% end %>
36
+ APPEND_PARAMETER BIGINT 64 UINT MIN MAX 0 "UINT 64 parameter"
36
37
  SCREEN <%= target_name %> PARAMS
37
38
 
38
39
  SELECT_PARAMETER VALUE5
@@ -97,6 +98,8 @@ COMMAND <%= target_name %> TIME_OFFSET BIG_ENDIAN "Subtract the packet time by t
97
98
  VALIDATOR inst_cmd_validator.rb
98
99
  <%= render "_ccsds_cmd.txt", locals: {id: 12} %>
99
100
  APPEND_PARAMETER SECONDS 32 UINT MIN MAX 0 "Seconds to subtract from packet time"
101
+ APPEND_PARAMETER IP_ADDRESS 32 UINT MIN MAX "127.0.0.1" "IP address"
102
+ WRITE_CONVERSION ip_write_conversion.rb
100
103
 
101
104
  COMMAND <%= target_name %> HIDDEN BIG_ENDIAN "Hidden command to bump the hidden packet"
102
105
  VALIDATOR inst_cmd_validator.rb
@@ -73,6 +73,14 @@ TELEMETRY <%= target_name %> HEALTH_STATUS BIG_ENDIAN "Health and status from th
73
73
  GENERIC_READ_CONVERSION_START FLOAT 32
74
74
  packet.read('TEMP1') * 1_000_000
75
75
  GENERIC_READ_CONVERSION_END
76
+ # Enable to test the ARRAYPLOT widget with array of array data [[x1,x2,...],[y1,y2,...]]
77
+ # ITEM POINTS 0 0 DERIVED
78
+ # GENERIC_READ_CONVERSION_START UINT 800
79
+ # return [
80
+ # Array.new(800) { |i| i * 0.1 },
81
+ # (0...800).map { |i| Math.sin(2 * Math::PI * i / 800) }
82
+ # ]
83
+ # GENERIC_READ_CONVERSION_END
76
84
  PROCESSOR TEMP1STAT statistics_processor.rb TEMP1 100
77
85
  PROCESSOR TEMP1WATER watermark_processor.rb TEMP1
78
86
 
@@ -127,11 +135,12 @@ TELEMETRY <%= target_name %> PARAMS BIG_ENDIAN "Params set by SETPARAMS command"
127
135
  STATE GOOD 0 GREEN
128
136
  STATE BAD 1 RED
129
137
  <% end %>
130
- APPEND_ITEM P_2.2,2 32 UINT "Test weird characters"
131
- APPEND_ITEM P-3+3=3 32 UINT "Test weird characters"
132
- APPEND_ITEM P4!@#$%^&*? 32 UINT "Test weird characters"
133
- APPEND_ITEM P</5|\> 32 UINT "Test weird characters"
134
- APPEND_ITEM P(:6;) 32 UINT "Test weird characters"
138
+ APPEND_ITEM IP_ADDRESS 32 UINT "Encoded IP Address"
139
+ APPEND_ITEM P_2.2,2 64 INT "Test weird characters"
140
+ APPEND_ITEM P-3+3=3 64 INT "Test weird characters"
141
+ APPEND_ITEM P4!@#$%^&*? 64 UINT "Test weird characters"
142
+ APPEND_ITEM P</5|\> 64 UINT "Test weird characters"
143
+ APPEND_ITEM P(:6;) 64 UINT "Test weird characters"
135
144
  ITEM PACKET_TIME 0 0 DERIVED "Ruby time based on TIMESEC and TIMEUS"
136
145
  READ_CONVERSION unix_time_conversion.rb TIMESEC TIMEUS
137
146
 
@@ -160,6 +169,7 @@ TELEMETRY <%= target_name %> MECH BIG_ENDIAN "Mechanism status ©®"
160
169
  UNITS DEGREES DEG
161
170
  APPEND_ITEM CURRENT 32 FLOAT "Device current"
162
171
  UNITS micro-Ampères µA
172
+ APPEND_ITEM STRING 0 STRING "String"
163
173
  ITEM PACKET_TIME 0 0 DERIVED "Ruby time based on TIMESEC and TIMEUS"
164
174
  READ_CONVERSION unix_time_conversion.rb TIMESEC TIMEUS
165
175
 
@@ -22,6 +22,7 @@ class InstCmdValidator < OpenC3::CommandValidator
22
22
  def pre_check(command)
23
23
  # Record the current value of CMD_ACPT_CNT for comparison in post_check
24
24
  @cmd_acpt_cnt = tlm("<%= target_name %> HEALTH_STATUS CMD_ACPT_CNT")
25
+ @cmd_acpt_cnt ||= 0 # If the telemetry value is nil, set it to 0
25
26
  return [true, nil]
26
27
  end
27
28
 
@@ -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 2024, OpenC3, Inc.
17
+ # All changes Copyright 2025, OpenC3, Inc.
18
18
  # All Rights Reserved
19
19
  #
20
20
  # This file may also be used under the terms of a commercial license
@@ -25,6 +25,7 @@
25
25
  require 'openc3'
26
26
  require 'stringio'
27
27
  require 'base64'
28
+ require 'openc3/accessors/binary_accessor'
28
29
 
29
30
  module OpenC3
30
31
  # Simulated instrument for the demo. Populates several packets and cycles
@@ -111,11 +112,11 @@ module OpenC3
111
112
  packet.value3 = 2
112
113
  packet.value4 = 1
113
114
  packet.value5 = 0
114
- packet.write('P_2.2,2', 2)
115
- packet.write('P-3+3=3', 3)
116
- packet.write('P4!@#$%^&*?', 4)
117
- packet.write('P</5|\>', 5)
118
- packet.write('P(:6;)', 6)
115
+ packet.write('P_2.2,2', BinaryAccessor::MIN_INT64)
116
+ packet.write('P-3+3=3', BinaryAccessor::MAX_INT64)
117
+ packet.write('P4!@#$%^&*?', 0)
118
+ packet.write('P</5|\>', 1740684371613049856)
119
+ packet.write('P(:6;)', BinaryAccessor::MAX_UINT64)
119
120
 
120
121
  packet = @tlm_packets['IMAGE']
121
122
  packet.enable_method_missing
@@ -152,6 +153,7 @@ module OpenC3
152
153
  @last_temp2 = 0
153
154
  @quiet = false
154
155
  @time_offset = 0
156
+ @ip_address = 0
155
157
  end
156
158
 
157
159
  def set_rates
@@ -195,6 +197,7 @@ module OpenC3
195
197
  params_packet.value3 = packet.read('value3')
196
198
  params_packet.value4 = packet.read('value4')
197
199
  params_packet.value5 = packet.read('value5')
200
+ params_packet.write('P4!@#$%^&*?', packet.read('bigint'))
198
201
  when 'ASCIICMD'
199
202
  hs_packet.cmd_acpt_cnt += 1
200
203
  hs_packet.asciicmd = packet.read('string')
@@ -238,6 +241,7 @@ module OpenC3
238
241
  when 'TIME_OFFSET'
239
242
  hs_packet.cmd_acpt_cnt += 1
240
243
  @time_offset = packet.read('seconds')
244
+ @ip_address = packet.read('ip_address')
241
245
  when 'HIDDEN'
242
246
  # Deliberately do not increment cmd_acpt_cnt
243
247
  @tlm_packets['HIDDEN'].count = packet.read('count')
@@ -378,6 +382,7 @@ module OpenC3
378
382
  packet.timesec = time.tv_sec - @time_offset
379
383
  packet.timeus = time.tv_usec
380
384
  packet.ccsdsseqcnt += 1
385
+ packet.ip_address = @ip_address
381
386
 
382
387
  when 'IMAGE'
383
388
  packet.timesec = time.tv_sec - @time_offset
@@ -1,43 +1,68 @@
1
- tl = create_timeline("Mine")
2
- puts tl #=> {"name"=>"Mine", "color"=>"#ae2d1b", "scope"=>"DEFAULT", "updated_at"=>1698763720728596964}
1
+ tl = create_timeline("RubyTL")
2
+ puts tl #=> {"name"=>"RubyTL", "color"=>"#cdce42", "execute"=>true, "shard"=>0, "scope"=>"DEFAULT", "updated_at"=>1737128664493258134}
3
3
  tls = list_timelines()
4
- check_expression("#{tls.length} == 1")
5
- puts tls[0] #=> {"name"=>"Mine", "color"=>"#ae2d1b", "scope"=>"DEFAULT", "updated_at"=>1698763720728596964}
6
- delete_timeline("Mine")
7
- check_expression("#{list_timelines().length} == 0")
4
+ names = tls.map { |tl| tl['name'] }
5
+ check_expression("#{names.include?('RubyTL')} == true")
6
+ puts tls[0] #=> {"name"=>"RubyTL", "color"=>"#cdce42", "execute"=>true, "shard"=>0, "scope"=>"DEFAULT", "updated_at"=>1737128664493258134}
8
7
 
9
- create_timeline("Mine")
10
- set_timeline_color("Mine", "#4287f5")
11
- puts get_timeline("Mine") #=> {"name"=>"Mine", "color"=>"#4287f5", "scope"=>"DEFAULT", "updated_at"=>1698763720728596964}
8
+ set_timeline_color("RubyTL", "#4287f5")
9
+ puts get_timeline("RubyTL") #=> {"name"=>"RubyTL", "color"=>"#4287f5", "execute"=>true, "shard"=>0, "scope"=>"DEFAULT", "updated_at"=>1737128689586673173}
12
10
 
13
11
  now = Time.now()
14
12
  start = now + 3600
15
- stop = start + 3600 # Stop plus 1hr
16
- act = create_timeline_activity("Mine", kind: "reserve", start: start, stop: stop)
13
+ stop = start + 3600
14
+ act1 = create_timeline_activity("RubyTL", kind: "RESERVE", start: start, stop: stop)
15
+ puts act1 #=>
16
+ # { "name"=>"RubyTL", "updated_at"=>1737128705034982375, "start"=>1737132303, "stop"=>1737135903,
17
+ # "kind"=>"reserve", "data"=>{"username"=>"operator"},
18
+ # "scope"=>"DEFAULT", "fulfillment"=>false, "uuid"=>"5f373846-eb6c-43cd-97bd-cca19a8ffb04",
19
+ # "events"=>[{"time"=>1737128705, "event"=>"created"}], "recurring"=>{}}
20
+ act2 = create_timeline_activity("RubyTL", kind: "COMMAND", start: start, stop: stop,
21
+ data: {command: "INST COLLECT with TYPE NORMAL, DURATION 5, TEMP 10"})
22
+ puts act2 #=>
23
+ # { "name"=>"RubyTL", "updated_at"=>1737128761316084471, "start"=>1737132303, "stop"=>1737135903,
24
+ # "kind"=>"command", "data"=>{"command"=>"INST COLLECT with TYPE NORMAL, DURATION 5, TEMP 10", "username"=>"operator"},
25
+ # "scope"=>"DEFAULT", "fulfillment"=>false, "uuid"=>"cdb661b4-a65b-44e7-95e2-5e1dba80c782",
26
+ # "events"=>[{"time"=>1737128761, "event"=>"created"}], "recurring"=>{}}
27
+ start = now + 7200
28
+ stop = start + 3600
29
+ act3 = create_timeline_activity("RubyTL", kind: "SCRIPT", start: start, stop: stop,
30
+ data: {environment: [{key: "USER", value: "JASON"}], script: "INST/procedures/checks.rb"})
31
+ puts act3 #=>
32
+ # { "name"=>"RubyTL", "updated_at"=>1737128791047885970, "start"=>1737135903, "stop"=>1737139503,
33
+ # "kind"=>"script", "data"=>{"environment"=>[{"key"=>"USER", "value"=>"JASON"}], "script"=>"INST/procedures/checks.rb", "username"=>"operator"},
34
+ # "scope"=>"DEFAULT", "fulfillment"=>false, "uuid"=>"70426e3d-6313-4897-b159-6e5cd94ace1d",
35
+ # "events"=>[{"time"=>1737128791, "event"=>"created"}], "recurring"=>{}}
36
+
37
+ act = get_timeline_activity("RubyTL", act2['start'], act2['uuid'])
17
38
  puts act #=>
18
- # { "name"=>"Mine", "updated_at"=>1698763721927799173, "fulfillment"=>false, "duration"=>3600,
19
- # "start"=>1698764400, "stop"=>1698768000, "kind"=>"reserve",
20
- # "events"=>[{"time"=>1698763721, "event"=>"created"}], "data"=>{"username"=>""} }
39
+ # { "name"=>"RubyTL", "updated_at"=>1737128761316084471, "start"=>1737132303, "stop"=>1737135903,
40
+ # "kind"=>"command", "data"=>{"command"=>"INST COLLECT with TYPE NORMAL, DURATION 5, TEMP 10", "username"=>"operator"},
41
+ # "scope"=>"DEFAULT", "fulfillment"=>false, "uuid"=>"cdb661b4-a65b-44e7-95e2-5e1dba80c782",
42
+ # "events"=>[{"time"=>1737128761, "event"=>"created"}], "recurring"=>{}}
43
+
21
44
  # Get activities in the past ... should be none
22
- tlas = get_timeline_activities("Mine", start: Time.now() - 3600, stop: Time.now())
45
+ tlas = get_timeline_activities("RubyTL", start: Time.now() - 3600, stop: Time.now())
23
46
  check_expression("#{tlas.length} == 0")
24
- # Get all activities
25
- tlas = get_timeline_activities("Mine")
26
- check_expression("#{tlas.length} == 1")
47
+ # Get all activities at plus and minus 1 week
48
+ tlas = get_timeline_activities("RubyTL")
49
+ check_expression("#{tlas.length} == 3")
27
50
 
28
51
  # Create and delete a new activity
29
52
  start = start + 7200
30
53
  stop = start + 300
31
- act = create_timeline_activity("Mine", kind: "reserve", start: start, stop: stop)
32
- tlas = get_timeline_activities("Mine")
33
- check_expression("#{tlas.length} == 2")
34
- delete_timeline_activity("Mine", act['start'], act['uuid'])
35
- tlas = get_timeline_activities("Mine")
36
- check_expression("#{tlas.length} == 1")
54
+ act = create_timeline_activity("RubyTL", kind: "reserve", start: start, stop: stop)
55
+ tlas = get_timeline_activities("RubyTL")
56
+ check_expression("#{tlas.length} == 4")
57
+ delete_timeline_activity("RubyTL", act['start'], act['uuid'])
58
+ tlas = get_timeline_activities("RubyTL")
59
+ check_expression("#{tlas.length} == 3")
37
60
 
38
61
  # delete fails since the timeline has activities
39
- delete_timeline("Mine") #=> RuntimeError : Failed to delete timeline due to timeline contains activities, must force remove
62
+ delete_timeline("RubyTL") #=> RuntimeError : Failed to delete timeline due to timeline contains activities, must force remove
40
63
  # Force delete since the timeline has activities
41
- delete_timeline("Mine", force: true)
64
+ delete_timeline("RubyTL", force: true)
65
+ # Verify the timeline no longer exists
42
66
  tls = list_timelines()
43
- check_expression("#{tls.length} == 0")
67
+ names = tls.map { |tl| tl['name'] }
68
+ check_expression("#{names.include?('RubyTL')} == false")
@@ -1,4 +1,4 @@
1
- # Display all environment variables
1
+ # Display the environment variables
2
2
  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']}"
@@ -17,5 +17,5 @@ wait_expression("true == false", 5)
17
17
  wait_packet("<%= target_name %>","ADCS", 2, 5)
18
18
  wait_check("<%= target_name %> ADCS BIASX == 100", 5)
19
19
  wait_check_tolerance("<%= target_name %> ADCS BIASX", 5, 0.5, 5)
20
- wait_check_expression("true == false", 5)
20
+ wait_check_expression("tlm('<%= target_name %> HEALTH_STATUS TEMP1') < 101", 5, 0.25)
21
21
  wait_check_packet("<%= target_name %>","ADCS", 2, 5)
@@ -0,0 +1,88 @@
1
+ # Helper method to check for a script to change state
2
+ def wait_for_action(id, state)
3
+ i = 0
4
+ while i < 100
5
+ script = running_script_get(id)
6
+ if script['state'] == state
7
+ check_expression("'#{script['state']}' == '#{state}'")
8
+ break
9
+ end
10
+ wait 0.1
11
+ end
12
+ check_expression("'#{script['state']}' == '#{state}'")
13
+ end
14
+
15
+ SCRIPT_NAME = "INST/procedures/new_script.rb"
16
+
17
+ # Ensure it's not already there
18
+ step_mode()
19
+ script_delete(SCRIPT_NAME)
20
+ scripts = script_list()
21
+ check_expression("#{scripts.length} > 100")
22
+ run_mode()
23
+
24
+ contents = "puts('bad"
25
+ script_create(SCRIPT_NAME, contents)
26
+ body = script_body(SCRIPT_NAME)
27
+ result = script_syntax_check(body)
28
+ check_expression("#{result['success']} == false")
29
+
30
+ # Create a valid script that doesn't complete
31
+ contents = "set_line_delay(1)\nputs 'Hello from Ruby'\nputs('.')\nputs('.')\nwhile true\nputs Time.now\nwait 0.5\nwait 0.5\nend"
32
+ script_create(SCRIPT_NAME, contents)
33
+ scripts = script_list()
34
+ check_expression("#{scripts.include?(SCRIPT_NAME)} == true")
35
+
36
+ script = script_instrumented(contents)
37
+ check_expression("#{script.include?('RunningScript')} == true")
38
+
39
+ id = script_run(SCRIPT_NAME)
40
+ check_expression("#{id.to_i} > 0")
41
+ wait_for_action(id, 'running')
42
+
43
+ list = running_script_list()
44
+ started = list.select {|script| script["id"] == id}[0]
45
+ check_expression("'#{started['name']}' == SCRIPT_NAME")
46
+ script = running_script_get(id)
47
+ check_expression("'#{script['name']}' == SCRIPT_NAME")
48
+
49
+ running_script_pause(id)
50
+ wait_for_action(id, 'paused')
51
+ running_script_step(id)
52
+ wait_for_action(id, 'paused')
53
+ running_script_retry(id)
54
+ wait_for_action(id, 'paused')
55
+ running_script_go(id)
56
+ wait_for_action(id, 'running')
57
+ running_script_stop(id)
58
+ wait 1
59
+
60
+ list = running_script_list()
61
+ script = list.select {|script| script["id"] == id}[0]
62
+ # Script is stopped so it should NOT be in the running list
63
+ check_expression("#{script.nil?} == true")
64
+
65
+ list = completed_script_list()
66
+ script = list.select {|script| script["id"] == id}[0]
67
+ # Script is completed so it should be in the completed list
68
+ check_expression("#{script.nil?} == false")
69
+
70
+ id = script_run(SCRIPT_NAME)
71
+ wait_for_action(id, 'running')
72
+ running_script_delete(id) # Stop and completely remove the script
73
+ wait 1
74
+
75
+ list = running_script_list()
76
+ script = list.select {|script| script["id"] == id}[0]
77
+ # Script is deleted, so it should NOT be in the running list
78
+ check_expression("#{script.nil?} == true")
79
+ list = completed_script_list()
80
+ # Script is deleted so it should be in the completed list
81
+ script = list.select {|script| script["id"] == id}[0]
82
+ check_expression("#{script.nil?} == false")
83
+
84
+ script_lock(SCRIPT_NAME)
85
+ script_unlock(SCRIPT_NAME)
86
+ script_delete(SCRIPT_NAME)
87
+ scripts = script_list()
88
+ check_expression("#{scripts.include?(SCRIPT_NAME)} == false")
@@ -1,27 +1,32 @@
1
1
  SCREEN AUTO AUTO 1.0
2
2
 
3
- VERTICAL
4
- TITLE "<%= target_name %> Instrument Graphs"
3
+ TITLE "<%= target_name %> Instrument Graphs"
5
4
 
6
- MATRIXBYCOLUMNS 2
7
- SPARKLINE <%= target_name %> HEALTH_STATUS TEMP1
8
- SETTING SIZE 400 50
9
- SETTING HISTORY 30s
10
- SPARKLINE <%= target_name %> HEALTH_STATUS TEMP2
11
- SETTING SIZE 400 50
12
- SETTING HISTORY 30s
13
- LABELSPARKLINE <%= target_name %> HEALTH_STATUS TEMP3
14
- LABELSPARKLINE <%= target_name %> HEALTH_STATUS TEMP4
15
- LINEGRAPH <%= target_name %> HEALTH_STATUS TEMP1
16
- SETTING ITEM <%= target_name %> ADCS Q1
17
- LINEGRAPH <%= target_name %> HEALTH_STATUS TEMP2 RAW
18
- SETTING SECONDSGRAPHED 60
19
- SETTING POINTSSAVED 600
20
- SETTING POINTSGRAPHED 60
21
- LINEGRAPH <%= target_name %> HEALTH_STATUS TEMP3 CONVERTED REDUCED_MINUTE MIN
22
- SETTING SIZE 600 500 # width height
23
- SETTING HISTORY 1h
24
- LINEGRAPH <%= target_name %> HEALTH_STATUS TEMP4
25
- SETTING HISTORY 30m
26
- END
5
+ MATRIXBYCOLUMNS 2
6
+ SPARKLINE <%= target_name %> HEALTH_STATUS TEMP1
7
+ SETTING SIZE 400 50
8
+ SETTING HISTORY 30s
9
+ SPARKLINE <%= target_name %> HEALTH_STATUS TEMP2
10
+ SETTING SIZE 400 50
11
+ SETTING HISTORY 30s
12
+ LABELSPARKLINE <%= target_name %> HEALTH_STATUS TEMP3
13
+ LABELSPARKLINE <%= target_name %> HEALTH_STATUS TEMP4
14
+ LINEGRAPH <%= target_name %> HEALTH_STATUS TEMP1
15
+ SETTING ITEM <%= target_name %> ADCS Q1
16
+ LINEGRAPH <%= target_name %> HEALTH_STATUS TEMP2 RAW
17
+ SETTING SECONDSGRAPHED 60
18
+ SETTING POINTSSAVED 600
19
+ SETTING POINTSGRAPHED 60
20
+ LINEGRAPH <%= target_name %> HEALTH_STATUS TEMP3 CONVERTED REDUCED_MINUTE MIN
21
+ SETTING SIZE 600 500 # width height
22
+ SETTING HISTORY 1h
23
+ LINEGRAPH <%= target_name %> HEALTH_STATUS TEMP4
24
+ SETTING HISTORY 30m
27
25
  END
26
+
27
+ ARRAYPLOT
28
+ SETTING TITLE "Array Data"
29
+ SETTING ITEM INST HEALTH_STATUS ARY
30
+ SETTING ITEM INST HEALTH_STATUS ARY2
31
+ SETTING SIZE 600 400
32
+ SETTING X_AXIS 10 10
@@ -41,9 +41,12 @@ HORIZONTAL
41
41
  LABELVALUERANGEBAR <%= target_name %> HEALTH_STATUS TEMP2 0 100
42
42
  END
43
43
  VERTICALBOX "Limits Colors"
44
- LIMITSCOLOR <%= target_name %> HEALTH_STATUS TEMP1 CONVERTED 10 NIL # No label
44
+ HORIZONTAL
45
+ LIMITSCOLOR <%= target_name %> HEALTH_STATUS TEMP1 CONVERTED 10 NIL # No label
46
+ LABEL '1st Temp'
47
+ END
45
48
  LIMITSCOLOR <%= target_name %> HEALTH_STATUS TEMP2 # Default is label with just item name
46
- LIMITSCOLOR <%= target_name %> HEALTH_STATUS GROUND1STATUS CONVERTED 20 TRUE # Full TGT/PKT/ITEM label
49
+ LIMITSCOLOR <%= target_name %> HEALTH_STATUS TEMP3 CONVERTED 20 TRUE # Full TGT/PKT/ITEM label
47
50
  END
48
51
  END
49
52
  END
@@ -29,9 +29,12 @@ COMMAND <%= target_name %> SETPARAMS BIG_ENDIAN "Sets numbered parameters"
29
29
  <%= render "_ccsds_cmd.txt", locals: {id: 4} %>
30
30
  # ERB syntax:
31
31
  <% (1..5).each do |i| %>
32
- APPEND_PARAMETER VALUE<%= i %> 16 UINT 0 5 1 "Value <%= i %> setting"
32
+ # The packet is BIG_ENDIAN (CCSDS) but these fields are LITTLE_ENDIAN
33
+ APPEND_PARAMETER VALUE<%= i %> 16 UINT 0 5 1 "Value <%= i %> setting" LITTLE_ENDIAN
33
34
  RELATED_ITEM <%= target_name %> PARAMS VALUE<%= i %>
34
35
  <% end %>
36
+ APPEND_PARAMETER BIGINT 64 UINT MIN MAX 0 "UINT 64 parameter"
37
+ SCREEN <%= target_name %> PARAMS
35
38
 
36
39
  SELECT_PARAMETER VALUE5
37
40
  POLY_WRITE_CONVERSION 0 2
@@ -95,6 +98,8 @@ COMMAND <%= target_name %> TIME_OFFSET BIG_ENDIAN "Subtract the packet time by t
95
98
  VALIDATOR inst2_cmd_validator.py
96
99
  <%= render "_ccsds_cmd.txt", locals: {id: 12} %>
97
100
  APPEND_PARAMETER SECONDS 32 UINT MIN MAX 0 "Seconds to subtract from packet time"
101
+ APPEND_PARAMETER IP_ADDRESS 32 UINT MIN MAX "127.0.0.1" "IP address"
102
+ WRITE_CONVERSION openc3/conversions/ip_write_conversion.py
98
103
 
99
104
  COMMAND <%= target_name %> HIDDEN BIG_ENDIAN "Hidden command to bump the hidden packet"
100
105
  VALIDATOR inst2_cmd_validator.py
@@ -65,6 +65,14 @@ TELEMETRY <%= target_name %> HEALTH_STATUS BIG_ENDIAN "Health and status from th
65
65
  READ_CONVERSION openc3/conversions/processor_conversion.py TEMP1STAT MEAN
66
66
  ITEM TEMP1STDDEV 0 0 DERIVED "Stddev of most recent 100 samples for TEMP1"
67
67
  READ_CONVERSION openc3/conversions/processor_conversion.py TEMP1STAT STDDEV
68
+ ITEM TEMP1_MICRO 0 0 DERIVED
69
+ GENERIC_READ_CONVERSION_START FLOAT 32
70
+ packet.read('TEMP1') / 1_000_000
71
+ GENERIC_READ_CONVERSION_END
72
+ ITEM TEMP1_MEGA 0 0 DERIVED
73
+ GENERIC_READ_CONVERSION_START FLOAT 32
74
+ packet.read('TEMP1') * 1_000_000
75
+ GENERIC_READ_CONVERSION_END
68
76
  PROCESSOR TEMP1STAT openc3/processors/statistics_processor.py TEMP1 100
69
77
  PROCESSOR TEMP1WATER openc3/processors/watermark_processor.py TEMP1
70
78
 
@@ -119,11 +127,12 @@ TELEMETRY <%= target_name %> PARAMS BIG_ENDIAN "Params set by SETPARAMS command"
119
127
  STATE GOOD 0 GREEN
120
128
  STATE BAD 1 RED
121
129
  <% end %>
122
- APPEND_ITEM P_2.2,2 32 UINT "Test weird characters"
123
- APPEND_ITEM P-3+3=3 32 UINT "Test weird characters"
124
- APPEND_ITEM P4!@#$%^&*? 32 UINT "Test weird characters"
125
- APPEND_ITEM P</5|\> 32 UINT "Test weird characters"
126
- APPEND_ITEM P(:6;) 32 UINT "Test weird characters"
130
+ APPEND_ITEM IP_ADDRESS 32 UINT "Encoded IP Address"
131
+ APPEND_ITEM P_2.2,2 64 INT "Test weird characters"
132
+ APPEND_ITEM P-3+3=3 64 INT "Test weird characters"
133
+ APPEND_ITEM P4!@#$%^&*? 64 UINT "Test weird characters"
134
+ APPEND_ITEM P</5|\> 64 UINT "Test weird characters"
135
+ APPEND_ITEM P(:6;) 64 UINT "Test weird characters"
127
136
  ITEM PACKET_TIME 0 0 DERIVED "Python time based on TIMESEC and TIMEUS"
128
137
  READ_CONVERSION openc3/conversions/unix_time_conversion.py TIMESEC TIMEUS
129
138
 
@@ -137,7 +146,7 @@ TELEMETRY <%= target_name %> IMAGE BIG_ENDIAN "Packet with image data"
137
146
  ITEM PACKET_TIME 0 0 DERIVED "Python time based on TIMESEC and TIMEUS"
138
147
  READ_CONVERSION openc3/conversions/unix_time_conversion.py TIMESEC TIMEUS
139
148
 
140
- TELEMETRY <%= target_name %> MECH BIG_ENDIAN "Mechanism status"
149
+ TELEMETRY <%= target_name %> MECH BIG_ENDIAN "Mechanism status ©®"
141
150
  <%= render "_ccsds_tlm.txt", locals: {apid: 5} %>
142
151
  APPEND_ITEM EXTRA 32 FLOAT "Extra item to be deleted"
143
152
  APPEND_ITEM SLRPNL1 32 FLOAT "Solar panel 1 angle"
@@ -1,4 +1,4 @@
1
- # Copyright 2024 OpenC3, Inc.
1
+ # Copyright 2025 OpenC3, Inc.
2
2
  # All Rights Reserved.
3
3
  #
4
4
  # This program is free software; you can modify and/or redistribute it
@@ -25,6 +25,7 @@ from openc3.packets.structure import Structure
25
25
  from openc3.packets.packet import Packet
26
26
  from openc3.system.system import System
27
27
  from openc3.top_level import kill_thread
28
+ from openc3.accessors.binary_accessor import BinaryAccessor
28
29
 
29
30
 
30
31
  # Simulated instrument for the demo. Populates several packets and cycles
@@ -114,11 +115,11 @@ class SimInst(SimulatedTarget):
114
115
  packet.write("value3", 2)
115
116
  packet.write("value4", 1)
116
117
  packet.write("value5", 0)
117
- packet.write('P_2.2,2', 2)
118
- packet.write('P-3+3=3', 3)
119
- packet.write('P4!@#$%^&*?', 4)
120
- packet.write('P</5|\>', 5)
121
- packet.write('P(:6;)', 6)
118
+ packet.write('P_2.2,2', BinaryAccessor.MIN_INT64)
119
+ packet.write('P-3+3=3', BinaryAccessor.MAX_INT64)
120
+ packet.write('P4!@#$%^&*?', 0)
121
+ packet.write('P</5|\>', 1740684371613049856)
122
+ packet.write('P(:6;)', BinaryAccessor.MAX_UINT64)
122
123
 
123
124
  packet = self.tlm_packets["IMAGE"]
124
125
  packet.write("CcsdsSeqFlags", "NOGROUP")
@@ -148,6 +149,7 @@ class SimInst(SimulatedTarget):
148
149
  self.last_temp2 = 0
149
150
  self.quiet = False
150
151
  self.time_offset = 0
152
+ self.ip_address = 0
151
153
 
152
154
  def set_rates(self):
153
155
  self.set_rate("ADCS", 10)
@@ -186,6 +188,7 @@ class SimInst(SimulatedTarget):
186
188
  params_packet.write("value3", packet.read("value3"))
187
189
  params_packet.write("value4", packet.read("value4"))
188
190
  params_packet.write("value5", packet.read("value5"))
191
+ params_packet.write('P4!@#$%^&*?', packet.read('bigint'))
189
192
  case "ASCIICMD":
190
193
  hs_packet.write("cmd_acpt_cnt", hs_packet.read("cmd_acpt_cnt") + 1)
191
194
  hs_packet.write("asciicmd", packet.read("string"))
@@ -213,6 +216,7 @@ class SimInst(SimulatedTarget):
213
216
  case "TIME_OFFSET":
214
217
  hs_packet.write("cmd_acpt_cnt", hs_packet.read("cmd_acpt_cnt") + 1)
215
218
  self.time_offset = packet.read("seconds")
219
+ self.ip_address = packet.read("ip_address")
216
220
  case "HIDDEN":
217
221
  # Deliberately do not increment cmd_acpt_cnt
218
222
  self.tlm_packets["HIDDEN"].count = packet.read("count")
@@ -382,6 +386,7 @@ class SimInst(SimulatedTarget):
382
386
  packet.write("timesec", int(time - self.time_offset))
383
387
  packet.write("timeus", int((time % 1) * 1000000))
384
388
  packet.write("ccsdsseqcnt", packet.read("ccsdsseqcnt") + 1)
389
+ packet.write("ip_address", self.ip_address)
385
390
 
386
391
  case "IMAGE":
387
392
  packet.write("timesec", int(time - self.time_offset))