openc3-cosmos-demo 5.10.1 → 5.11.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c79a082a0a7ba7369461e5c77a51e4b8f2f6784efe78230859325820cb9271ff
4
- data.tar.gz: 027beabcba3f4305e99f8eb41cda054e38ce8063970d560b343c1713da526219
3
+ metadata.gz: c1d450e10cbf029128cc8dadf2120924d37dab213c3de3019b4defa0a71a1b5a
4
+ data.tar.gz: ba971d7ef797552a50cf90e38fdcc5a61c96b9b43eb8e6f83974b61b3536237a
5
5
  SHA512:
6
- metadata.gz: 9efccbe10a089b5806a60a4f54560db6ee00ab9654736af32891f2e84b20a4e4652c2cc6cc65f6f95628ad8757b5562ccf3ceda188ecb262f39fb2106babc08e
7
- data.tar.gz: 4f9cddf20a0760bd34a07fce20a3036074a02461fc1112df46b2c5fbe3b181b4005cf85797726035e19a579caae5947e77e96744ffeb6a120a69686c7c5abea1
6
+ metadata.gz: 3e662edc8c4471caaf3546efa2d928145b05cfd2904cf11939dc096d1229a1fb31476bbebe402ab59d4f431cb06c5822c30115ebec4853a2ce039db211c6e1db
7
+ data.tar.gz: 4a9e9318956b95f2b9fe2a65a1eadedb679b45afd6d3982958df6a1132fe351dd8986aee3798407a7f90e18e67ae7198a238cbef1a4a397255ba1d603c8341e4
data/plugin.txt CHANGED
@@ -39,6 +39,8 @@ VARIABLE reduced_log_retain_time 2592000
39
39
  LOG_RETAIN_TIME <%= log_retain_time %>
40
40
  REDUCED_LOG_RETAIN_TIME <%= reduced_log_retain_time %>
41
41
  TLM_LOG_CYCLE_TIME 300
42
+ # Allow the reducer microservice to take 50% of the cpu (default 30%)
43
+ REDUCER_MAX_CPU_UTILIZATION 50
42
44
  <% end %>
43
45
 
44
46
  <% if include_inst2 %>
@@ -51,13 +53,19 @@ VARIABLE reduced_log_retain_time 2592000
51
53
  <% if include_example %>
52
54
  TARGET EXAMPLE <%= example_target_name %>
53
55
  LOG_RETAIN_TIME <%= log_retain_time %>
54
- REDUCED_LOG_RETAIN_TIME <%= reduced_log_retain_time %>
56
+ # Disable data reduction (min, hour, day) on this target data
57
+ # No 'ruby reducer_microservice.rb DEFAULT__REDUCER__EXAMPLE'
58
+ # will appear in the the process list
59
+ REDUCER_DISABLE
55
60
  <% end %>
56
61
 
57
62
  <% if include_templated %>
58
63
  TARGET TEMPLATED <%= templated_target_name %>
59
64
  LOG_RETAIN_TIME <%= log_retain_time %>
60
- REDUCED_LOG_RETAIN_TIME <%= reduced_log_retain_time %>
65
+ # Disable data reduction (min, hour, day) on this target data
66
+ # No 'ruby reducer_microservice.rb DEFAULT__REDUCER__TEMPLATED'
67
+ # will appear in the the process list
68
+ REDUCER_DISABLE
61
69
  <% end %>
62
70
 
63
71
  <% if include_system %>
@@ -1,9 +1,7 @@
1
1
  REQUIRE example_interface.rb
2
2
 
3
- # Ignored Parameters
4
- # IGNORE_PARAMETER parameter_name
3
+ # Ignored Parameters and Items
5
4
  IGNORE_PARAMETER PACKET_ID
6
-
7
5
  IGNORE_ITEM RECEIVED_COUNT
8
6
  IGNORE_ITEM RECEIVED_TIMESECONDS
9
7
  IGNORE_ITEM RECEIVED_TIMEFORMATTED
@@ -130,7 +130,7 @@ TELEMETRY <%= target_name %> IMAGE BIG_ENDIAN "Packet with image data"
130
130
  ITEM PACKET_TIME 0 0 DERIVED "Ruby time based on TIMESEC and TIMEUS"
131
131
  READ_CONVERSION unix_time_conversion.rb TIMESEC TIMEUS
132
132
 
133
- TELEMETRY <%= target_name %> MECH BIG_ENDIAN "Mechanism status"
133
+ TELEMETRY <%= target_name %> MECH BIG_ENDIAN "Mechanism status ©®"
134
134
  <%= render "_ccsds_tlm.txt", locals: {apid: 5} %>
135
135
  APPEND_ITEM EXTRA 32 FLOAT "Extra item to be deleted"
136
136
  APPEND_ITEM SLRPNL1 32 FLOAT "Solar panel 1 angle"
@@ -143,5 +143,7 @@ TELEMETRY <%= target_name %> MECH BIG_ENDIAN "Mechanism status"
143
143
  UNITS DEGREES DEG
144
144
  APPEND_ITEM SLRPNL5 32 FLOAT "Solar panel 5 angle"
145
145
  UNITS DEGREES DEG
146
+ APPEND_ITEM CURRENT 32 FLOAT "Device current"
147
+ UNITS micro-Ampères µA
146
148
  ITEM PACKET_TIME 0 0 DERIVED "Ruby time based on TIMESEC and TIMEUS"
147
149
  READ_CONVERSION unix_time_conversion.rb TIMESEC TIMEUS
@@ -132,7 +132,6 @@ module OpenC3
132
132
  @trackStars[8] = 583
133
133
  @trackStars[9] = 622
134
134
 
135
- @get_count = 0
136
135
  @bad_temp2 = false
137
136
  @last_temp2 = 0
138
137
  @quiet = false
@@ -272,11 +271,11 @@ module OpenC3
272
271
  packet.biasy = @att_packet.biasy
273
272
  packet.biasy = @att_packet.biasz
274
273
 
275
- packet.star1id = @trackStars[((@get_count / 100) + 0) % 10]
276
- packet.star2id = @trackStars[((@get_count / 100) + 1) % 10]
277
- packet.star3id = @trackStars[((@get_count / 100) + 2) % 10]
278
- packet.star4id = @trackStars[((@get_count / 100) + 3) % 10]
279
- packet.star5id = @trackStars[((@get_count / 100) + 4) % 10]
274
+ packet.star1id = @trackStars[((count_100hz / 100) + 0) % 10]
275
+ packet.star2id = @trackStars[((count_100hz / 100) + 1) % 10]
276
+ packet.star3id = @trackStars[((count_100hz / 100) + 2) % 10]
277
+ packet.star4id = @trackStars[((count_100hz / 100) + 3) % 10]
278
+ packet.star5id = @trackStars[((count_100hz / 100) + 4) % 10]
280
279
 
281
280
  packet.posprogress = (@position_file_bytes_read.to_f / @position_file_size.to_f) * 100.0
282
281
  packet.attprogress = (@attitude_file_bytes_read.to_f / @attitude_file_size.to_f) * 100.0
@@ -326,7 +325,7 @@ module OpenC3
326
325
  packet.ground1status = 'CONNECTED'
327
326
  packet.ground2status = 'CONNECTED'
328
327
  else
329
- if @get_count % 1000 == 0
328
+ if count_100hz % 1000 == 0
330
329
  if packet.ground1status == 'CONNECTED'
331
330
  packet.ground1status = 'UNAVAILABLE'
332
331
  else
@@ -334,7 +333,7 @@ module OpenC3
334
333
  end
335
334
  end
336
335
 
337
- if @get_count % 500 == 0
336
+ if count_100hz % 500 == 0
338
337
  if packet.ground2status == 'CONNECTED'
339
338
  packet.ground2status = 'UNAVAILABLE'
340
339
  else
@@ -367,16 +366,16 @@ module OpenC3
367
366
  packet.slrpnl3 = @solar_panel_positions[2]
368
367
  packet.slrpnl4 = @solar_panel_positions[3]
369
368
  packet.slrpnl5 = @solar_panel_positions[4]
369
+ packet.current = 0.5
370
370
  end
371
371
  end
372
372
 
373
373
  # Every 10s throw an unknown packet at the server just to demo that
374
374
  data = Array.new(10) { rand(0..255) }.pack("C*")
375
- if @get_count % 1000 == 900
375
+ if count_100hz % 1000 == 900
376
376
  pending_packets << Packet.new(nil, nil, :BIG_ENDIAN, nil, data)
377
377
  end
378
378
 
379
- @get_count += tick_increment
380
379
  pending_packets
381
380
  end
382
381
  end
@@ -1,5 +1,7 @@
1
- # Display the environment variables
1
+ # Display all environment variables
2
2
  puts ENV.inspect
3
+ # Print the TYPE env var which is set in the INST COMMANDING screen
4
+ puts "ENV['TYPE']:#{ENV['TYPE']}"
3
5
 
4
6
  collect_cnt = tlm("<%= target_name %> HEALTH_STATUS COLLECTS")
5
7
  cmd("<%= target_name %> COLLECT with DURATION 11, TYPE NORMAL")
@@ -1,7 +1,9 @@
1
1
  # Stash API is useful for storing simple key/value pairs
2
2
  # to preserve state between script runs
3
3
  stash_set('key1', 'val1')
4
+ puts "key1: #{stash_get('key1')}"
4
5
  stash_set('key2', 'val2')
6
+ puts "key2: #{stash_get('key2')}"
5
7
  check_expression("'#{stash_get('key1')}' == 'val1'")
6
8
  check_expression("'#{stash_get('key2')}' == 'val2'")
7
9
  check_expression("'#{stash_keys().to_s}' == '[\"key1\", \"key2\"]'")
@@ -1,26 +1,29 @@
1
1
  from openc3.script import *
2
+ from openc3.utilities.string import formatted
3
+ import tempfile
2
4
 
3
5
  put_target_file("INST/test.txt", "this is a string test")
4
6
  download_file("INST/test.txt") # download via path
5
7
  file = get_target_file("INST/test.txt")
6
- print(file.read)
7
- file.rewind # rewind so download_file can read
8
+ print(file.read())
9
+ file.seek(0) # rewind so download_file can read
8
10
  download_file(file) # download using file
9
- file.delete
11
+ file.close() # closing deletes tempfile
10
12
  delete_target_file("INST/test.txt")
11
13
 
12
- save_file = Tempfile.new("test")
14
+ save_file = tempfile.NamedTemporaryFile(mode="w+t")
13
15
  save_file.write("this is a Io test")
14
- save_file.rewind
16
+ save_file.seek(0)
15
17
  put_target_file("INST/test.txt", save_file)
16
- save_file.delete
18
+ save_file.close() # Delete the tempfile
17
19
  file = get_target_file("INST/test.txt")
18
- print(file.read)
19
- file.delete
20
+ print(file.read())
21
+ file.close()
20
22
  delete_target_file("INST/test.txt")
21
23
 
22
- put_target_file("INST/test.bin", "\x00\x01\x02\x03\xFF\xEE\xDD\xCC")
23
- file = get_target_file("INST/test.bin")
24
- print(file.read.formatted)
25
- file.delete
26
- delete_target_file("INST/test.bin")
24
+ # TODO: Binary not yet supported
25
+ # put_target_file("INST/test.bin", b"\x00\x01\x02\x03\xFF\xEE\xDD\xCC")
26
+ # file = get_target_file("INST/test.bin")
27
+ # print(formatted(file.read()))
28
+ # file.close()
29
+ # delete_target_file("INST/test.bin")
@@ -50,6 +50,7 @@ VERTICAL
50
50
  BUTTON 'Run Script' "var script=screen.getNamedWidget('SCRIPTNAME').text();" \
51
51
  "var ctype=screen.getNamedWidget('COLLECT_TYPE').text();" \
52
52
  # Set some environment variables to be used by the script as ENV['TYPE']
53
+ # See INST/procedures/checks.rb for an example of usage
53
54
  "var env = {}; env['TYPE'] = ctype;" \
54
55
  "runScript('INST/procedures/'+script, !screen.getNamedWidget('BG').checked(), env)"
55
56
  END
@@ -6,7 +6,7 @@ SCROLLWINDOW 200
6
6
  TITLE "<%= target_name %> Other Widget Examples" courier 10 normal true
7
7
 
8
8
  HORIZONTAL
9
- LABEL "TestText"
9
+ LABEL "TestText œ © ®" # Throw in some UTF-8 chars
10
10
  LABEL "TestText" nil 20 # Only change the font size
11
11
  LABEL "TestText" nil nil BOLD # Only change make it bold
12
12
  LABEL "TestText" nil nil nil true # Only make it italic
@@ -3,7 +3,6 @@ REQUIRE example_limits_response.rb
3
3
  REQUIRE sim_inst.rb
4
4
 
5
5
  # Ignored Parameters
6
- # IGNORE_PARAMETER parameter_name
7
6
  IGNORE_PARAMETER CCSDSVER
8
7
  IGNORE_PARAMETER CCSDSTYPE
9
8
  IGNORE_PARAMETER CCSDSSHF
@@ -14,7 +13,6 @@ IGNORE_PARAMETER CCSDSLENGTH
14
13
  IGNORE_PARAMETER PKTID
15
14
 
16
15
  # Ignored Items
17
- # IGNORE_ITEM item_name
18
16
  IGNORE_ITEM CCSDSVER
19
17
  IGNORE_ITEM CCSDSTYPE
20
18
  IGNORE_ITEM CCSDSSHF