cosmosc2-demo 5.0.2.pre.beta2

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 (77) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +693 -0
  3. data/README.md +31 -0
  4. data/Rakefile +35 -0
  5. data/microservices/EXAMPLE/example_target.rb +123 -0
  6. data/microservices/TEMPLATED/scpi_target.rb +79 -0
  7. data/plugin.txt +100 -0
  8. data/targets/EXAMPLE/cmd_tlm/example_cmds.txt +2 -0
  9. data/targets/EXAMPLE/cmd_tlm/example_tlm.txt +5 -0
  10. data/targets/EXAMPLE/lib/example_interface.rb +27 -0
  11. data/targets/EXAMPLE/target.txt +9 -0
  12. data/targets/INST/cmd_tlm/_ccsds_cmd.txt +9 -0
  13. data/targets/INST/cmd_tlm/_ccsds_tlm.txt +19 -0
  14. data/targets/INST/cmd_tlm/inst_cmds.txt +53 -0
  15. data/targets/INST/cmd_tlm/inst_tlm.txt +162 -0
  16. data/targets/INST/cmd_tlm/inst_tlm_override.txt +12 -0
  17. data/targets/INST/data/attitude.bin +0 -0
  18. data/targets/INST/data/position.bin +0 -0
  19. data/targets/INST/lib/example_limits_response.rb +39 -0
  20. data/targets/INST/lib/sim_inst.rb +343 -0
  21. data/targets/INST/procedures/checks.rb +11 -0
  22. data/targets/INST/procedures/collect.rb +18 -0
  23. data/targets/INST/procedures/disconnect.rb +29 -0
  24. data/targets/INST/procedures/my_script_suite.rb +46 -0
  25. data/targets/INST/procedures/my_test_suite.rb +45 -0
  26. data/targets/INST/procedures/target_file.rb +21 -0
  27. data/targets/INST/procedures/utilities/clear.rb +7 -0
  28. data/targets/INST/procedures/utilities/collect.rb +14 -0
  29. data/targets/INST/public/ground_error.png +0 -0
  30. data/targets/INST/public/ground_off.png +0 -0
  31. data/targets/INST/public/ground_on.png +0 -0
  32. data/targets/INST/public/satellite.png +0 -0
  33. data/targets/INST/screens/_footer.txt +3 -0
  34. data/targets/INST/screens/adcs.txt +71 -0
  35. data/targets/INST/screens/array.txt +15 -0
  36. data/targets/INST/screens/block.txt +6 -0
  37. data/targets/INST/screens/commanding.txt +34 -0
  38. data/targets/INST/screens/graphs.txt +17 -0
  39. data/targets/INST/screens/ground.txt +46 -0
  40. data/targets/INST/screens/hs.txt +42 -0
  41. data/targets/INST/screens/latest.txt +21 -0
  42. data/targets/INST/screens/limits.txt +82 -0
  43. data/targets/INST/screens/other.txt +37 -0
  44. data/targets/INST/screens/params.txt +54 -0
  45. data/targets/INST/screens/simple.txt +6 -0
  46. data/targets/INST/screens/tabs.txt +66 -0
  47. data/targets/INST/screens/web.txt +5 -0
  48. data/targets/INST/tables/bin/ConfigTables.bin +0 -0
  49. data/targets/INST/tables/config/ConfigTables_def.txt +8 -0
  50. data/targets/INST/tables/config/MCConfigurationTable_def.txt +36 -0
  51. data/targets/INST/tables/config/PPSSelectionTable_def.txt +7 -0
  52. data/targets/INST/tables/config/TLMMonitoringTable_def.txt +31 -0
  53. data/targets/INST/target.txt +31 -0
  54. data/targets/SYSTEM/cmd_tlm/limits_groups.txt +6 -0
  55. data/targets/SYSTEM/cmd_tlm/meta_tlm.txt +10 -0
  56. data/targets/SYSTEM/cmd_tlm/system_cmds.txt +41 -0
  57. data/targets/SYSTEM/cmd_tlm/system_tlm.txt +7 -0
  58. data/targets/SYSTEM/lib/example_background_task.rb +66 -0
  59. data/targets/SYSTEM/lib/example_target.rb +112 -0
  60. data/targets/SYSTEM/lib/limits_groups.rb +64 -0
  61. data/targets/SYSTEM/lib/scpi_target.rb +76 -0
  62. data/targets/SYSTEM/procedures/cosmos_api_test.rb +286 -0
  63. data/targets/SYSTEM/procedures/example_test.rb +191 -0
  64. data/targets/SYSTEM/procedures/interactive.rb +38 -0
  65. data/targets/SYSTEM/procedures/run_example_test.rb +3 -0
  66. data/targets/SYSTEM/procedures/test.rb +49 -0
  67. data/targets/SYSTEM/screens/status.txt +12 -0
  68. data/targets/SYSTEM/target.txt +12 -0
  69. data/targets/TEMPLATED/cmd_tlm/templated_cmds.txt +13 -0
  70. data/targets/TEMPLATED/cmd_tlm/templated_tlm.txt +3 -0
  71. data/targets/TEMPLATED/lib/templated_interface.rb +69 -0
  72. data/targets/TEMPLATED/target.txt +8 -0
  73. data/tools/widgets/BigWidget/BigWidget.umd.min.js +2 -0
  74. data/tools/widgets/BigWidget/BigWidget.umd.min.js.map +1 -0
  75. data/tools/widgets/HelloworldWidget/HelloworldWidget.umd.min.js +2 -0
  76. data/tools/widgets/HelloworldWidget/HelloworldWidget.umd.min.js.map +1 -0
  77. metadata +123 -0
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ ## COSMOS Demo Plugin
2
+
3
+ [Documentation](http://cosmosc2.com)
4
+
5
+ This plugin provides a simple demo configuration for COSMOS that shows off a lot of the features of COSMOS and provides a test environment.
6
+
7
+ ## Getting Started
8
+
9
+ 1. At the COSMOS Admin - Plugins, upload the cosmosc2-demo.gem file
10
+
11
+ 2. To build widgets run: yard && yard install
12
+
13
+ ## Contributing
14
+
15
+ We encourage you to contribute to COSMOS!
16
+
17
+ Contributing is easy.
18
+
19
+ 1. Fork the project
20
+ 2. Create a feature branch
21
+ 3. Make your changes
22
+ 4. Submit a pull request
23
+
24
+ Before any contributions can be incorporated we do require all contributors to sign a Contributor License Agreement here:
25
+ [Contributor License Agreement](https://docs.google.com/forms/d/1ppnHUSXtY1GRTNPIyUaB1OYHbW5Ca67GFMgMRPBG8u0/viewform)
26
+
27
+ This protects both you and us and you retain full rights to any code you write.
28
+
29
+ ## License
30
+
31
+ This Ball Aerospace plugin is released under the AGPLv3.0 with a few addendums. See [LICENSE.txt](LICENSE.txt)
data/Rakefile ADDED
@@ -0,0 +1,35 @@
1
+ # encoding: ascii-8bit
2
+
3
+ # Copyright 2022 Ball Aerospace & Technologies Corp.
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 program may also be used under the terms of a commercial or
17
+ # enterprise edition license of COSMOS if purchased from the
18
+ # copyright holder
19
+
20
+ PLUGIN_NAME = Dir['*.gemspec'][0].split('.')[0..-2].join('.')
21
+
22
+ task :require_version do
23
+ unless ENV['VERSION']
24
+ puts "VERSION is required: rake <task> VERSION=X.X.X"
25
+ exit 1
26
+ end
27
+ end
28
+
29
+ task :build => [:require_version] do
30
+ _, platform, *_ = RUBY_PLATFORM.split("-")
31
+ if platform == 'mswin32' or platform == 'mingw32'
32
+ puts "Warning: Building gem on Windows will lose file permissions"
33
+ end
34
+ system("gem build #{PLUGIN_NAME}")
35
+ end
@@ -0,0 +1,123 @@
1
+ # encoding: ascii-8bit
2
+
3
+ # Copyright 2022 Ball Aerospace & Technologies Corp.
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 program may also be used under the terms of a commercial or
17
+ # enterprise edition license of COSMOS if purchased from the
18
+ # copyright holder
19
+
20
+ require 'cosmos'
21
+ require 'cosmos/interfaces'
22
+ require 'cosmos/tools/cmd_tlm_server/interface_thread'
23
+
24
+ module Cosmos
25
+ class ExampleTarget
26
+ class ExampleServerInterface < TcpipServerInterface
27
+ def initialize(port)
28
+ super(port.to_i, port.to_i, 5.0, nil, 'LENGTH', 0, 32, 4, 1, 'BIG_ENDIAN', 4, nil, nil, true)
29
+ end
30
+ end
31
+
32
+ class ExampleInterfaceThread < InterfaceThread
33
+ attr_accessor :target_name
34
+
35
+ protected
36
+ def handle_packet(packet)
37
+ identified_packet = System.commands.identify(packet.buffer, [@target_name])
38
+ if identified_packet
39
+ Logger.info "Received command: #{identified_packet.target_name} #{identified_packet.packet_name}"
40
+ else
41
+ Logger.info "Received UNKNOWN command"
42
+ end
43
+ end
44
+ end
45
+
46
+ class ExampleTelemetryThread
47
+ attr_reader :thread
48
+
49
+ def initialize(interface, target_name)
50
+ @interface = interface
51
+ @target_name = target_name
52
+ @sleeper = Sleeper.new
53
+ end
54
+
55
+ def start
56
+ packet = System.telemetry.packet(@target_name, 'STATUS')
57
+ @thread = Thread.new do
58
+ @stop_thread = false
59
+ @sleeper.sleep(5)
60
+ begin
61
+ loop do
62
+ packet.write('PACKET_ID', 1)
63
+ packet.write('STRING', "The time is now: #{Time.now.sys.formatted}")
64
+ @interface.write(packet)
65
+ break if @sleeper.sleep(1)
66
+ end
67
+ rescue Exception => err
68
+ Logger.error "ExampleTelemetryThread unexpectedly died\n#{err.formatted}"
69
+ raise err
70
+ end
71
+ end
72
+ end
73
+
74
+ def stop
75
+ Cosmos.kill_thread(self, @thread)
76
+ end
77
+
78
+ def graceful_kill
79
+ @sleeper.cancel
80
+ end
81
+ end
82
+
83
+ def initialize(target_name, port)
84
+ # Create interface to receive commands and send telemetry
85
+ @target_name = target_name
86
+ @interface = ExampleServerInterface.new(port)
87
+ @interface_thread = nil
88
+ @telemetry_thread = nil
89
+ end
90
+
91
+ def start
92
+ @interface_thread = ExampleInterfaceThread.new(@interface)
93
+ @interface_thread.target_name = @target_name
94
+ @interface_thread.start
95
+ @telemetry_thread = ExampleTelemetryThread.new(@interface, @target_name)
96
+ @telemetry_thread.start
97
+ end
98
+
99
+ def stop
100
+ @telemetry_thread.stop if @telemetry_thread
101
+ @interface_thread.stop if @interface_thread
102
+ end
103
+
104
+ def self.run(target_name, port)
105
+ Logger.level = Logger::INFO
106
+ Thread.abort_on_exception = true
107
+ temp_dir = Dir.mktmpdir
108
+ System.setup_targets([target_name], temp_dir, scope: ENV['COSMOS_SCOPE'])
109
+ target = self.new(target_name, port)
110
+ begin
111
+ target.start
112
+ while true
113
+ sleep 1
114
+ end
115
+ rescue SystemExit, Interrupt
116
+ target.stop
117
+ FileUtils.remove_entry(temp_dir) if File.exist?(temp_dir)
118
+ end
119
+ end
120
+ end
121
+ end
122
+
123
+ Cosmos::ExampleTarget.run(ARGV[0], ARGV[1]) if __FILE__ == $0
@@ -0,0 +1,79 @@
1
+ # encoding: ascii-8bit
2
+
3
+ # Copyright 2022 Ball Aerospace & Technologies Corp.
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 program may also be used under the terms of a commercial or
17
+ # enterprise edition license of COSMOS if purchased from the
18
+ # copyright holder
19
+
20
+ require 'cosmos'
21
+ require 'cosmos/interfaces'
22
+ require 'cosmos/tools/cmd_tlm_server/interface_thread'
23
+
24
+ module Cosmos
25
+ class ScpiTarget
26
+ class ScpiServerInterface < TcpipServerInterface
27
+ def initialize(port)
28
+ super(port.to_i, port.to_i, 5.0, nil, 'TERMINATED', '0xA', '0xA')
29
+ end
30
+ end
31
+
32
+ class ScpiInterfaceThread < InterfaceThread
33
+ def initialize(interface)
34
+ super(interface)
35
+ @index = 0
36
+ end
37
+
38
+ protected
39
+ def handle_packet(packet)
40
+ Logger.info "Received command: #{packet.buffer}"
41
+ if packet.buffer.include?('?')
42
+ @interface.write_raw(@index.to_s + "\x0A")
43
+ end
44
+ @index += 1
45
+ end
46
+ end
47
+
48
+ def initialize(port)
49
+ # Create interface to receive commands and send telemetry
50
+ @target_interface = ScpiServerInterface.new(port)
51
+ @interface_thread = nil
52
+ end
53
+
54
+ def start
55
+ @interface_thread = ScpiInterfaceThread.new(@target_interface)
56
+ @interface_thread.start
57
+ end
58
+
59
+ def stop
60
+ @interface_thread.stop if @interface_thread
61
+ end
62
+
63
+ def self.run(target_name, port)
64
+ Logger.level = Logger::INFO
65
+ temp_dir = Dir.mktmpdir
66
+ System.setup_targets([target_name], temp_dir, scope: ENV['COSMOS_SCOPE'])
67
+ target = self.new(port)
68
+ begin
69
+ target.start
70
+ loop { sleep 1 }
71
+ rescue SystemExit, Interrupt
72
+ target.stop
73
+ FileUtils.remove_entry(temp_dir) if File.exist?(temp_dir)
74
+ end
75
+ end
76
+ end
77
+ end
78
+
79
+ Cosmos::ScpiTarget.run(ARGV[0], ARGV[1]) if __FILE__ == $0
data/plugin.txt ADDED
@@ -0,0 +1,100 @@
1
+ # Note: This plugin includes 4 targets in one plugin to make it easy to install
2
+ # the COSMOS demo with one plugin. Generally it is better to only have one
3
+ # target per plugin
4
+
5
+ VARIABLE inst_target_name INST
6
+ VARIABLE inst2_target_name INST2
7
+ VARIABLE example_target_name EXAMPLE
8
+ VARIABLE templated_target_name TEMPLATED
9
+ VARIABLE system_target_name SYSTEM
10
+ VARIABLE inst_int_name INST_INT
11
+ VARIABLE inst_router_name INST_ROUTER
12
+ VARIABLE inst2_int_name INST2_INT
13
+ VARIABLE example_int_name EXAMPLE_INT
14
+ VARIABLE templated_int_name TEMPLATED_INT
15
+ VARIABLE demo_tool_name Demo
16
+ VARIABLE example_microservice_name cosmos-example
17
+ VARIABLE templated_microservice_name cosmos-templated
18
+ VARIABLE example_port 9999
19
+ VARIABLE templated_port 5025
20
+
21
+ <% include_inst = (inst_target_name.strip.length > 0) %>
22
+ <% include_inst2 = (inst2_target_name.strip.length > 0) %>
23
+ <% include_example = (example_target_name.strip.length > 0) %>
24
+ <% include_templated = (templated_target_name.strip.length > 0) %>
25
+ <% include_system = (system_target_name.strip.length > 0) %>
26
+ <% include_inst_int = (inst_int_name.strip.length > 0) %>
27
+ <% include_inst_router = (inst_router_name.strip.length > 0) %>
28
+ <% include_inst2_int = (inst2_int_name.strip.length > 0) %>
29
+ <% include_example_int = (example_int_name.strip.length > 0) %>
30
+ <% include_templated_int = (templated_int_name.strip.length > 0) %>
31
+ <% include_example_microservice = (example_microservice_name.strip.length > 0) %>
32
+ <% include_templated_microservice = (templated_microservice_name.strip.length > 0) %>
33
+
34
+ <% if include_inst %>
35
+ TARGET INST <%= inst_target_name %>
36
+ TLM_LOG_CYCLE_TIME 300
37
+ <% end %>
38
+
39
+ <% if include_inst2 %>
40
+ TARGET INST <%= inst2_target_name %>
41
+ TLM_LOG_CYCLE_TIME 600
42
+ <% end %>
43
+
44
+ <% if include_example %>
45
+ TARGET EXAMPLE <%= example_target_name %>
46
+ <% end %>
47
+
48
+ <% if include_templated %>
49
+ TARGET TEMPLATED <%= templated_target_name %>
50
+ <% end %>
51
+
52
+ <% if include_system %>
53
+ TARGET SYSTEM <%= system_target_name %>
54
+ <% end %>
55
+
56
+ <% if include_inst and include_inst_int %>
57
+ INTERFACE <%= inst_int_name %> simulated_target_interface.rb sim_inst.rb
58
+ MAP_TARGET <%= inst_target_name %>
59
+ PROTOCOL READ OverrideProtocol
60
+ <% end %>
61
+
62
+ <% if include_inst2 and include_inst2_int %>
63
+ INTERFACE <%= inst2_int_name %> simulated_target_interface.rb sim_inst.rb
64
+ MAP_TARGET <%= inst2_target_name %>
65
+ DONT_LOG
66
+ PROTOCOL READ_WRITE OverrideProtocol
67
+ <% end %>
68
+
69
+ <% if include_example and include_example_int %>
70
+ INTERFACE <%= example_int_name %> example_interface.rb cosmos-operator <%= example_port %>
71
+ MAP_TARGET <%= example_target_name %>
72
+ DONT_CONNECT
73
+ LOG_RAW
74
+ <% end %>
75
+
76
+ <% if include_templated and include_templated_int %>
77
+ INTERFACE <%= templated_int_name %> templated_interface.rb cosmos-operator <%= templated_port %> <%= templated_port %> 5.0 nil TEMPLATE 0xA 0xA
78
+ MAP_TARGET <%= templated_target_name %>
79
+ DONT_CONNECT
80
+ <% end %>
81
+
82
+ <% if include_inst and include_inst_router %>
83
+ ROUTER <%= inst_router_name %> tcpip_server_interface.rb 7779 7779 nil 10.0 PREIDENTIFIED
84
+ MAP_TARGET <%= inst_target_name %>
85
+ <% end %>
86
+
87
+ <% if include_example_microservice %>
88
+ MICROSERVICE EXAMPLE <%= example_microservice_name %>
89
+ WORK_DIR .
90
+ CMD ruby example_target.rb <%= example_target_name %> <%= example_port %>
91
+ <% end %>
92
+
93
+ <% if include_templated_microservice %>
94
+ MICROSERVICE TEMPLATED <%= templated_microservice_name %>
95
+ WORK_DIR .
96
+ CMD ruby scpi_target.rb <%= templated_target_name %> <%= templated_port %>
97
+ <% end %>
98
+
99
+ WIDGET BIG
100
+ WIDGET HELLOWORLD
@@ -0,0 +1,2 @@
1
+ COMMAND <%= target_name %> START BIG_ENDIAN "Starts something on the example target"
2
+ APPEND_ID_PARAMETER PACKET_ID 8 UINT 1 1 1 "Packet id"
@@ -0,0 +1,5 @@
1
+ TELEMETRY <%= target_name %> STATUS BIG_ENDIAN "Health and status from the instrument"
2
+ APPEND_ID_ITEM PACKET_ID 8 UINT 1 "Packet id"
3
+ APPEND_ITEM VALUE 32 UINT "Limits value"
4
+ LIMITS DEFAULT 1 ENABLED 0 1 10 11
5
+ APPEND_ITEM STRING 0 STRING "Time string"
@@ -0,0 +1,27 @@
1
+ # encoding: ascii-8bit
2
+
3
+ # Copyright 2022 Ball Aerospace & Technologies Corp.
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 program may also be used under the terms of a commercial or
17
+ # enterprise edition license of COSMOS if purchased from the
18
+ # copyright holder
19
+
20
+ require 'cosmos'
21
+ require 'cosmos/interfaces/tcpip_client_interface'
22
+
23
+ class ExampleInterface < Cosmos::TcpipClientInterface
24
+ def initialize (hostname, port, write_timeout = 10.0, read_timeout = nil)
25
+ super(hostname, port, port, write_timeout, read_timeout, 'LENGTH', 0, 32, 4, 1, 'BIG_ENDIAN', 4, nil, nil, true)
26
+ end
27
+ end
@@ -0,0 +1,9 @@
1
+ REQUIRE example_interface.rb
2
+
3
+ # Ignored Parameters
4
+ # IGNORE_PARAMETER parameter_name
5
+ IGNORE_PARAMETER PACKET_ID
6
+
7
+ IGNORE_ITEM RECEIVED_COUNT
8
+ IGNORE_ITEM RECEIVED_TIMESECONDS
9
+ IGNORE_ITEM RECEIVED_TIMEFORMATTED
@@ -0,0 +1,9 @@
1
+ PARAMETER CCSDSVER 0 3 UINT 0 0 0 "CCSDS primary header version number"
2
+ PARAMETER CCSDSTYPE 3 1 UINT 1 1 1 "CCSDS primary header packet type"
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"
5
+ PARAMETER CCSDSSEQFLAGS 16 2 UINT 3 3 3 "CCSDS primary header sequence flags"
6
+ PARAMETER CCSDSSEQCNT 18 14 UINT 0 16383 0 "CCSDS primary header sequence count"
7
+ OVERFLOW TRUNCATE
8
+ PARAMETER CCSDSLENGTH 32 16 UINT MIN MAX 12 "CCSDS primary header packet length"
9
+ ID_PARAMETER PKTID 48 16 UINT MIN MAX <%= id %> "Packet id"
@@ -0,0 +1,19 @@
1
+ APPEND_ITEM CCSDSVER 3 UINT "CCSDS packet version number (See CCSDS 133.0-B-1)"
2
+ APPEND_ITEM CCSDSTYPE 1 UINT "CCSDS packet type (command or telemetry)"
3
+ STATE TLM 0
4
+ STATE CMD 1
5
+ APPEND_ITEM CCSDSSHF 1 UINT "CCSDS secondary header flag"
6
+ STATE FALSE 0
7
+ STATE TRUE 1
8
+ APPEND_ID_ITEM CCSDSAPID 11 UINT <%= apid %> "CCSDS application process id"
9
+ APPEND_ITEM CCSDSSEQFLAGS 2 UINT "CCSDS sequence flags"
10
+ STATE FIRST 1
11
+ STATE CONT 0
12
+ STATE LAST 2
13
+ STATE NOGROUP 3
14
+ APPEND_ITEM CCSDSSEQCNT 14 UINT "CCSDS packet sequence count"
15
+ OVERFLOW TRUNCATE
16
+ APPEND_ITEM CCSDSLENGTH 16 UINT "CCSDS packet data length"
17
+ APPEND_ITEM TIMESEC 32 UINT "Seconds since epoch (January 1st, 1970, midnight)"
18
+ APPEND_ITEM TIMEUS 32 UINT "Microseconds of second"
19
+ APPEND_ID_ITEM PKTID 16 UINT 1 "Packet id (The combination of CCSDS_APID and PACKET_ID identify the packet)"
@@ -0,0 +1,53 @@
1
+ COMMAND <%= target_name %> COLLECT BIG_ENDIAN "Starts a collect on the <%= target_name %> target"
2
+ <%= render "_ccsds_cmd.txt", locals: {id: 1} %>
3
+ PARAMETER TYPE 64 16 UINT MIN MAX 0 "Collect type"
4
+ REQUIRED
5
+ STATE NORMAL 0
6
+ STATE SPECIAL 1 HAZARDOUS
7
+ PARAMETER DURATION 80 32 FLOAT 0.0 10.0 1.0 "Collect duration"
8
+ PARAMETER OPCODE 112 8 UINT 0x0 0xFF 0xAB "Collect opcode"
9
+ FORMAT_STRING "0x%0X"
10
+ PARAMETER TEMP 120 32 FLOAT 0.0 25.0 0.0 "Collect temperature"
11
+ UNITS Celsius C
12
+
13
+ COMMAND <%= target_name %> ABORT BIG_ENDIAN "Aborts a collect on the <%= target_name %> instrument"
14
+ <%= render "_ccsds_cmd.txt", locals: {id: 2} %>
15
+
16
+ COMMAND <%= target_name %> CLEAR BIG_ENDIAN "Clears counters on the <%= target_name %> instrument"
17
+ HAZARDOUS "Clearing counters may lose valuable information."
18
+ <%= render "_ccsds_cmd.txt", locals: {id: 3} %>
19
+
20
+ COMMAND <%= target_name %> SETPARAMS BIG_ENDIAN "Sets numbered parameters"
21
+ <%= render "_ccsds_cmd.txt", locals: {id: 4} %>
22
+ # ERB syntax:
23
+ <% (1..5).each do |i| %>
24
+ APPEND_PARAMETER VALUE<%= i %> 16 UINT 0 5 1 "Value <%= i %> setting"
25
+ <% end %>
26
+
27
+ SELECT_PARAMETER VALUE5
28
+ POLY_WRITE_CONVERSION 0 2
29
+
30
+ COMMAND <%= target_name %> ASCIICMD BIG_ENDIAN "Enumerated ASCII command"
31
+ <%= render "_ccsds_cmd.txt", locals: {id: 5} %>
32
+ APPEND_PARAMETER STRING 2048 STRING "NOOP" "Enumerated string parameter"
33
+ STATE "NOOP" "NOOP"
34
+ STATE "ARM LASER" "ARM LASER" HAZARDOUS "Arming the laser poses an eye safety hazard."
35
+ STATE "FIRE LASER" "FIRE LASER" HAZARDOUS "WARNING Laser will be fired!"
36
+ APPEND_PARAMETER BINARY 32 STRING 0xDEADBEEF "Binary string"
37
+ APPEND_PARAMETER ASCII 80 STRING "0xDEADBEEF" "ASCII string"
38
+
39
+ COMMAND <%= target_name %> FLTCMD BIG_ENDIAN "Command with float parameters"
40
+ <%= render "_ccsds_cmd.txt", locals: {id: 6} %>
41
+ PARAMETER FLOAT32 64 32 FLOAT MIN MAX 0.0 "Float32 parameter"
42
+ PARAMETER FLOAT64 96 64 FLOAT MIN MAX 0.0 "Float64 parameter"
43
+
44
+ COMMAND <%= target_name %> ARYCMD BIG_ENDIAN "Command with array parameter"
45
+ <%= render "_ccsds_cmd.txt", locals: {id: 7} %>
46
+ ARRAY_PARAMETER ARRAY 64 32 UINT -8 "Array parameter"
47
+ PARAMETER CRC -8 8 UINT MIN MAX 0 "CRC"
48
+
49
+ COMMAND <%= target_name %> SLRPNLDEPLOY BIG_ENDIAN "Deploy solar array panels"
50
+ <%= render "_ccsds_cmd.txt", locals: {id: 8} %>
51
+
52
+ COMMAND <%= target_name %> SLRPNLRESET BIG_ENDIAN "Reset solar array panels"
53
+ <%= render "_ccsds_cmd.txt", locals: {id: 9} %>
@@ -0,0 +1,162 @@
1
+ TELEMETRY <%= target_name %> HEALTH_STATUS BIG_ENDIAN "Health and status from the <%= target_name %> target"
2
+ <%= render "_ccsds_tlm.txt", locals: {apid: 1} %>
3
+ APPEND_ITEM COLLECTS 16 UINT "Number of collects"
4
+ APPEND_ITEM TEMP1 16 UINT "Temperature #1"
5
+ POLY_READ_CONVERSION -100.0 0.00305
6
+ POLY_WRITE_CONVERSION 32768.885246 327.86885
7
+ UNITS CELSIUS C
8
+ FORMAT_STRING "%0.3f"
9
+ LIMITS DEFAULT 1 ENABLED -80.0 -70.0 60.0 80.0 -20.0 20.0
10
+ LIMITS TVAC 1 ENABLED -80.0 -30.0 30.0 80.0
11
+ LIMITS_RESPONSE example_limits_response.rb
12
+ APPEND_ITEM TEMP2 32 FLOAT "Temperature #2"
13
+ POLY_READ_CONVERSION -100.0 0.00305
14
+ POLY_WRITE_CONVERSION 32768.885246 327.86885
15
+ UNITS CELSIUS C
16
+ FORMAT_STRING "%0.3f"
17
+ LIMITS DEFAULT 1 ENABLED -60.0 -55.0 30.0 35.0
18
+ LIMITS TVAC 1 ENABLED -60.0 20.0 30.0 35.0
19
+ APPEND_ITEM TEMP3 16 UINT "Temperature #3"
20
+ POLY_READ_CONVERSION -100.0 0.00305
21
+ POLY_WRITE_CONVERSION 32768.885246 327.86885
22
+ UNITS CELSIUS C
23
+ FORMAT_STRING "%0.3f"
24
+ LIMITS DEFAULT 1 ENABLED -25.0 -10.0 50.0 55.0
25
+ LIMITS TVAC 1 ENABLED -15.0 -10.0 20.0 30.0
26
+ APPEND_ITEM TEMP4 16 UINT "Temperature #4"
27
+ POLY_READ_CONVERSION -100.0 0.00305
28
+ POLY_WRITE_CONVERSION 32768.885246 327.86885
29
+ UNITS CELSIUS C
30
+ FORMAT_STRING "%0.3f"
31
+ LIMITS DEFAULT 1 ENABLED -80.0 -70.0 60.0 80.0
32
+ APPEND_ARRAY_ITEM ARY 8 UINT 80 "Array data"
33
+ UNITS VOLTS V
34
+ APPEND_ITEM DURATION 32 FLOAT "Most recent collect duration"
35
+ APPEND_ITEM COLLECT_TYPE 16 UINT "Most recent collect type"
36
+ STATE NORMAL 0
37
+ STATE SPECIAL 1
38
+ STATE ERROR ANY
39
+ APPEND_ARRAY_ITEM ARY2 64 FLOAT 640 "Double array"
40
+ UNITS CELSIUS C
41
+ APPEND_ITEM ASCIICMD 2048 STRING "Most recent ASCIICMD string"
42
+ STATE "NOOP" "NOOP"
43
+ STATE "FIRE LASER" "FIRE LASER"
44
+ STATE "ARM LASER" "ARM LASER"
45
+ APPEND_ITEM GROUND1STATUS 8 UINT "Ground station #1 status"
46
+ STATE CONNECTED 1 GREEN
47
+ STATE UNAVAILABLE 0 YELLOW
48
+ APPEND_ITEM GROUND2STATUS 8 UINT "Ground station #2 status"
49
+ STATE CONNECTED 1 GREEN
50
+ STATE UNAVAILABLE 0 YELLOW
51
+ APPEND_ITEM BLOCKTEST 80 BLOCK "Block data"
52
+ ITEM TIMESECONDS 0 0 DERIVED "Derived floating-point time since epoch in seconds"
53
+ READ_CONVERSION unix_time_seconds_conversion.rb TIMESEC TIMEUS
54
+ FORMAT_STRING '%0.6f'
55
+ ITEM TIMEFORMATTED 0 0 DERIVED "Derived time since epoch as formatted string"
56
+ READ_CONVERSION unix_time_formatted_conversion.rb TIMESEC TIMEUS
57
+ ITEM TEMP1HIGH 0 0 DERIVED "High-water mark for TEMP1"
58
+ READ_CONVERSION processor_conversion.rb TEMP1WATER HIGH_WATER
59
+ ITEM TEMP1LOW 0 0 DERIVED "Low-water mark for TEMP1"
60
+ READ_CONVERSION processor_conversion.rb TEMP1WATER LOW_WATER
61
+ ITEM TEMP1MAX 0 0 DERIVED "Maximum of most recent 100 samples for TEMP1"
62
+ READ_CONVERSION processor_conversion.rb TEMP1STAT MAX
63
+ ITEM TEMP1MIN 0 0 DERIVED "Minimum of most recent 100 samples for TEMP1"
64
+ READ_CONVERSION processor_conversion.rb TEMP1STAT MIN
65
+ ITEM TEMP1MEAN 0 0 DERIVED "Mean of most recent 100 samples for TEMP1"
66
+ READ_CONVERSION processor_conversion.rb TEMP1STAT MEAN
67
+ ITEM TEMP1STDDEV 0 0 DERIVED "Stddev of most recent 100 samples for TEMP1"
68
+ READ_CONVERSION processor_conversion.rb TEMP1STAT STDDEV
69
+ PROCESSOR TEMP1STAT statistics_processor.rb TEMP1 100
70
+ PROCESSOR TEMP1WATER watermark_processor.rb TEMP1
71
+
72
+ TELEMETRY <%= target_name %> ADCS BIG_ENDIAN "Position and attitude data"
73
+ META TYPE 'struct adcs'
74
+ <%= render "_ccsds_tlm.txt", locals: {apid: 2} %>
75
+ ITEM POSX 128 32 FLOAT "Position X"
76
+ UNITS METERS M
77
+ ITEM POSY 160 32 FLOAT "Position Y"
78
+ UNITS METERS M
79
+ ITEM POSZ 192 32 FLOAT "Position Z"
80
+ UNITS METERS M
81
+ ITEM VELX 224 32 FLOAT "Velocity X"
82
+ UNITS METERS_PER_SECOND MPS
83
+ ITEM VELY 256 32 FLOAT "Velocity Y"
84
+ UNITS METERS_PER_SECOND MPS
85
+ ITEM VELZ 288 32 FLOAT "Velocity Z"
86
+ UNITS METERS_PER_SECOND MPS
87
+ ITEM Q1 320 32 FLOAT "Quaternion param 1"
88
+ FORMAT_STRING "%0.6f"
89
+ META TYPE 'float32'
90
+ ITEM Q2 352 32 FLOAT "Quaternion param 2"
91
+ FORMAT_STRING "%0.6f"
92
+ META TYPE 'float32'
93
+ ITEM Q3 384 32 FLOAT "Quaternion param 3"
94
+ FORMAT_STRING "%0.6f"
95
+ META TYPE 'float32'
96
+ ITEM Q4 416 32 FLOAT "Quaternion param 4"
97
+ FORMAT_STRING "%0.6f"
98
+ META TYPE 'float32'
99
+ ITEM BIASX 448 32 FLOAT "Body X rate bias"
100
+ FORMAT_STRING "%0.6f"
101
+ ITEM BIASY 480 32 FLOAT "Body Y rate bias"
102
+ FORMAT_STRING "%0.6f"
103
+ ITEM BIASZ 512 32 FLOAT "Body Z rate bias"
104
+ FORMAT_STRING "%0.6f"
105
+ <% (1..5).each do |i| %>
106
+ APPEND_ITEM STAR<%= i %>ID 16 UINT "Star <%= i %> id"
107
+ <% end %>
108
+ ITEM POSPROGRESS 624 32 FLOAT "Position file progress"
109
+ FORMAT_STRING "%0.2f"
110
+ ITEM ATTPROGRESS 656 32 FLOAT "Attitude file progress"
111
+ FORMAT_STRING "%0.2f"
112
+ ITEM TIMESECONDS 0 0 DERIVED "Derived floating-point time since epoch in seconds"
113
+ READ_CONVERSION unix_time_seconds_conversion.rb TIMESEC TIMEUS
114
+ FORMAT_STRING '%0.6f'
115
+ ITEM TIMEFORMATTED 0 0 DERIVED "Derived time since epoch as formatted string"
116
+ READ_CONVERSION unix_time_formatted_conversion.rb TIMESEC TIMEUS
117
+
118
+ TELEMETRY <%= target_name %> PARAMS BIG_ENDIAN "Params set by SETPARAMS command"
119
+ <%= render "_ccsds_tlm.txt", locals: {apid: 3} %>
120
+ # ERB syntax:
121
+ <% (1..5).each do |i| %>
122
+ APPEND_ITEM VALUE<%= i %> 16 UINT "Value <%= i %> setting"
123
+ STATE GOOD 0 GREEN
124
+ STATE BAD 1 RED
125
+ <% end %>
126
+
127
+ ITEM TIMESECONDS 0 0 DERIVED "Derived floating-point time since epoch in seconds"
128
+ READ_CONVERSION unix_time_seconds_conversion.rb TIMESEC TIMEUS
129
+ FORMAT_STRING '%0.6f'
130
+ ITEM TIMEFORMATTED 0 0 DERIVED "Derived time since epoch as formatted string"
131
+ READ_CONVERSION unix_time_formatted_conversion.rb TIMESEC TIMEUS
132
+
133
+ TELEMETRY <%= target_name %> IMAGE BIG_ENDIAN "Packet with image data"
134
+ <%= render "_ccsds_tlm.txt", locals: {apid: 4} %>
135
+ ITEM BYTES 128 32 UINT "First bytes"
136
+ FORMAT_STRING '0x%08x'
137
+ ITEM IMAGE 128 131072 BLOCK "10x10 Image Data"
138
+ OVERLAP # Notify COSMOS that this is intentionally overlapping the BYTES field
139
+ ITEM TIMESECONDS 0 0 DERIVED "Derived floating-point time since epoch in seconds"
140
+ READ_CONVERSION unix_time_seconds_conversion.rb TIMESEC TIMEUS
141
+ FORMAT_STRING '%0.6f'
142
+ ITEM TIMEFORMATTED 0 0 DERIVED "Derived time since epoch as formatted string"
143
+ READ_CONVERSION unix_time_formatted_conversion.rb TIMESEC TIMEUS
144
+
145
+ TELEMETRY <%= target_name %> MECH BIG_ENDIAN "Mechanism status"
146
+ <%= render "_ccsds_tlm.txt", locals: {apid: 5} %>
147
+ APPEND_ITEM EXTRA 32 FLOAT "Extra item to be deleted"
148
+ APPEND_ITEM SLRPNL1 32 FLOAT "Solar panel 1 angle"
149
+ UNITS DEGREES DEG
150
+ APPEND_ITEM SLRPNL2 32 FLOAT "Solar panel 2 angle"
151
+ UNITS DEGREES DEG
152
+ APPEND_ITEM SLRPNL3 32 FLOAT "Solar panel 3 angle"
153
+ UNITS DEGREES DEG
154
+ APPEND_ITEM SLRPNL4 32 FLOAT "Solar panel 4 angle"
155
+ UNITS DEGREES DEG
156
+ APPEND_ITEM SLRPNL5 32 FLOAT "Solar panel 5 angle"
157
+ UNITS DEGREES DEG
158
+ ITEM TIMESECONDS 0 0 DERIVED "Derived floating-point time since epoch in seconds"
159
+ READ_CONVERSION unix_time_seconds_conversion.rb TIMESEC TIMEUS
160
+ FORMAT_STRING '%0.6f'
161
+ ITEM TIMEFORMATTED 0 0 DERIVED "Derived time since epoch as formatted string"
162
+ READ_CONVERSION unix_time_formatted_conversion.rb TIMESEC TIMEUS
@@ -0,0 +1,12 @@
1
+ # NOTE: Telemetry definitions are processed in alphabetical order by default.
2
+ # However, this can be overridden by explicitly calling them out in target.txt.
3
+ # Thus it's recommended to create a file like this with an extension
4
+ # such as inst_tlm_override.txt which will be processed AFTER inst_tlm.txt.
5
+
6
+ # Existing telemetry packets can be selected and items modified
7
+ SELECT_TELEMETRY <%= target_name %> MECH
8
+ # Existing items can be selected and modified by adding conversions, limits, etc
9
+ SELECT_ITEM SLRPNL1
10
+ LIMITS DEFAULT 1 ENABLED -180.0 -170.0 170.0 180.0
11
+ # Delete an item so it doesn't appear in the packet
12
+ DELETE_ITEM EXTRA