cosmos 4.3.0-java → 4.4.0-java
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.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/bug_report.md +30 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +19 -0
- data/.github/ISSUE_TEMPLATE/help---usage---general-question.md +12 -0
- data/.gitignore +1 -0
- data/.travis.yml +5 -5
- data/Manifest.txt +81 -44
- data/Rakefile +9 -0
- data/appveyor.yml +2 -1
- data/autohotkey/config/targets/INST/cmd_tlm/inst_cmds.txt +1 -1
- data/autohotkey/config/targets/INST/cmd_tlm/inst_tlm.txt +5 -5
- data/autohotkey/config/targets/INST/lib/sim_inst.rb +3 -1
- data/autohotkey/config/tools/handbook_creator/assets/css/bootstrap-theme.css +397 -0
- data/autohotkey/config/tools/handbook_creator/assets/css/bootstrap-theme.min.css +7 -0
- data/autohotkey/config/tools/handbook_creator/assets/css/bootstrap.css +7118 -0
- data/autohotkey/config/tools/handbook_creator/assets/css/bootstrap.min.css +7 -0
- data/autohotkey/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/autohotkey/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.svg +229 -0
- data/autohotkey/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/autohotkey/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/autohotkey/config/tools/handbook_creator/assets/js/bootstrap.js +2006 -0
- data/autohotkey/config/tools/handbook_creator/assets/js/bootstrap.min.js +7 -0
- data/autohotkey/config/tools/table_manager/ConfigTables_def.txt +2 -4
- data/autohotkey/config/tools/table_manager/SubTables/OneDimensionalSubTable_def.txt +31 -0
- data/autohotkey/config/tools/table_manager/SubTables/TwoDimensionalSubTable_def.txt +28 -0
- data/autohotkey/config/tools/test_runner/test_runner.txt +1 -1
- data/autohotkey/config/tools/test_runner/test_runner2.txt +1 -1
- data/autohotkey/config/tools/test_runner/test_runner3.txt +1 -1
- data/autohotkey/config/tools/test_runner/test_runner4.txt +1 -1
- data/autohotkey/tools/limits_monitor.ahk +1 -1
- data/autohotkey/tools/packet_viewer.ahk +1 -1
- data/autohotkey/tools/script_runner.ahk +16 -4
- data/bin/cosmos +1 -1
- data/bin/xtce_converter +1 -1
- data/cosmos.gemspec +5 -7
- data/data/config/_interfaces.yaml +4 -0
- data/data/config/cmd_sequence.yaml +14 -0
- data/data/config/housekeeping_params.yaml +14 -0
- data/data/config/interface_modifiers.yaml +11 -0
- data/data/config/item_modifiers.yaml +2 -1
- data/data/config/launcher.yaml +12 -2
- data/data/config/param_item_modifiers.yaml +2 -2
- data/data/config/parameter_modifiers.yaml +20 -0
- data/data/config/screen.yaml +2 -0
- data/data/config/script_runner.yaml +9 -0
- data/data/config/system.yaml +47 -10
- data/data/config/table_manager.yaml +7 -0
- data/data/config/target.yaml +12 -0
- data/data/config/telemetry_modifiers.yaml +3 -1
- data/data/config/test_runner.yaml +10 -9
- data/data/config/widgets.yaml +174 -11
- data/data/crc.txt +128 -125
- data/demo/Gemfile +1 -1
- data/demo/Launcher.bat +1 -9
- data/demo/Launcher2.bat +1 -0
- data/demo/LauncherMini.bat +1 -0
- data/demo/config/data/crc.txt +40 -20
- data/demo/config/system/system.txt +1 -1
- data/demo/config/system/system_alt_ports.txt +1 -1
- data/demo/config/targets/EXAMPLE/cmd_tlm_server.txt +1 -0
- data/demo/config/targets/INST/cmd_tlm/inst_cmds.txt +2 -1
- data/demo/config/targets/INST/cmd_tlm/inst_tlm.txt +7 -7
- data/demo/config/targets/INST/cmd_tlm_server.txt +2 -0
- data/demo/config/targets/INST/lib/sim_inst.rb +15 -3
- data/demo/config/targets/INST/screens/adcs.txt +2 -2
- data/demo/config/targets/INST/screens/block.txt +1 -1
- data/demo/config/targets/INST/screens/commanding.txt +1 -1
- data/demo/config/targets/INST/screens/ground.txt +27 -5
- data/demo/config/targets/INST/screens/ground_error.gif +0 -0
- data/demo/config/{data/groundoff.gif → targets/INST/screens/ground_off.gif} +0 -0
- data/demo/config/{data/groundon.gif → targets/INST/screens/ground_on.gif} +0 -0
- data/demo/config/targets/INST/screens/limits.txt +69 -31
- data/demo/config/targets/INST/screens/other.txt +13 -3
- data/demo/config/targets/INST/screens/params.txt +54 -0
- data/demo/config/targets/INST/screens/satellite.gif +0 -0
- data/demo/config/tools/data_viewer/data_viewer.txt +3 -0
- data/demo/config/tools/handbook_creator/assets/css/bootstrap-theme.css +397 -0
- data/demo/config/tools/handbook_creator/assets/css/bootstrap-theme.min.css +7 -0
- data/demo/config/tools/handbook_creator/assets/css/bootstrap.css +7118 -0
- data/demo/config/tools/handbook_creator/assets/css/bootstrap.min.css +7 -0
- data/demo/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/demo/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.svg +229 -0
- data/demo/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/demo/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/demo/config/tools/handbook_creator/assets/img/ball_logo.bmp +0 -0
- data/demo/config/tools/handbook_creator/assets/img/ball_logo.gif +0 -0
- data/demo/config/tools/handbook_creator/assets/img/ball_logo.jpg +0 -0
- data/demo/config/tools/handbook_creator/assets/js/bootstrap.js +2006 -0
- data/demo/config/tools/handbook_creator/assets/js/bootstrap.min.js +7 -0
- data/demo/config/tools/handbook_creator/assets/js/html5shiv.js +8 -0
- data/demo/config/tools/handbook_creator/assets/js/jquery-1.10.2.min.js +6 -0
- data/demo/config/tools/handbook_creator/assets/js/respond.min.js +6 -0
- data/demo/config/tools/script_runner/script_runner.txt +1 -2
- data/demo/config/tools/test_runner/test_runner.txt +3 -1
- data/demo/lib/example_background_task.rb +1 -0
- data/demo/procedures/cosmos_api_test.rb +1 -1
- data/demo/procedures/interactive.rb +22 -0
- data/ext/cosmos/ext/packet/packet.c +0 -77
- data/install/Gemfile +1 -1
- data/install/Launcher.bat +1 -9
- data/install/config/data/crc.txt +17 -1
- data/install/config/system/system.txt +1 -1
- data/install/config/tools/handbook_creator/assets/css/bootstrap-theme.css +397 -0
- data/install/config/tools/handbook_creator/assets/css/bootstrap-theme.min.css +7 -0
- data/install/config/tools/handbook_creator/assets/css/bootstrap.css +7118 -0
- data/install/config/tools/handbook_creator/assets/css/bootstrap.min.css +7 -0
- data/install/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/install/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.svg +229 -0
- data/install/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/install/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/install/config/tools/handbook_creator/assets/img/ball_logo.bmp +0 -0
- data/install/config/tools/handbook_creator/assets/img/ball_logo.gif +0 -0
- data/install/config/tools/handbook_creator/assets/img/ball_logo.jpg +0 -0
- data/install/config/tools/handbook_creator/assets/js/bootstrap.js +2006 -0
- data/install/config/tools/handbook_creator/assets/js/bootstrap.min.js +7 -0
- data/install/config/tools/handbook_creator/assets/js/html5shiv.js +8 -0
- data/install/config/tools/handbook_creator/assets/js/jquery-1.10.2.min.js +6 -0
- data/install/config/tools/handbook_creator/assets/js/respond.min.js +6 -0
- data/lib/cosmos/config/config_parser.rb +4 -5
- data/lib/cosmos/dart/lib/dart_common.rb +1 -1
- data/lib/cosmos/gui/dialogs/details_dialog.rb +16 -1
- data/lib/cosmos/gui/dialogs/tlm_details_dialog.rb +1 -0
- data/lib/cosmos/gui/dialogs/tlm_graph_dialog.rb +4 -2
- data/lib/cosmos/gui/opengl/earth_model.rb +1 -1
- data/lib/cosmos/gui/qt.rb +3 -1
- data/lib/cosmos/gui/qt_tool.rb +46 -23
- data/lib/cosmos/gui/text/ruby_editor.rb +44 -41
- data/lib/cosmos/gui/utilities/screenshot.rb +1 -1
- data/lib/cosmos/gui/utilities/script_module_gui.rb +92 -92
- data/lib/cosmos/interfaces.rb +1 -0
- data/lib/cosmos/interfaces/interface.rb +5 -1
- data/lib/cosmos/interfaces/protocols/fixed_protocol.rb +40 -18
- data/lib/cosmos/interfaces/protocols/template_protocol.rb +6 -1
- data/lib/cosmos/interfaces/simulated_target_interface.rb +14 -5
- data/lib/cosmos/io/json_drb.rb +11 -7
- data/lib/cosmos/packets/commands.rb +28 -11
- data/lib/cosmos/packets/packet.rb +69 -32
- data/lib/cosmos/packets/packet_config.rb +34 -1
- data/lib/cosmos/packets/parsers/state_parser.rb +0 -1
- data/lib/cosmos/packets/parsers/xtce_converter.rb +2 -0
- data/lib/cosmos/packets/parsers/xtce_parser.rb +4 -3
- data/lib/cosmos/packets/structure.rb +4 -2
- data/lib/cosmos/packets/telemetry.rb +19 -3
- data/lib/cosmos/script/api_shared.rb +12 -9
- data/lib/cosmos/script/scripting.rb +16 -14
- data/lib/cosmos/system/system.rb +39 -20
- data/lib/cosmos/system/target.rb +39 -9
- data/lib/cosmos/tools/cmd_extractor/cmd_extractor.rb +94 -35
- data/lib/cosmos/tools/cmd_sender/cmd_sender.rb +3 -0
- data/lib/cosmos/tools/cmd_sequence/sequence_item.rb +1 -1
- data/lib/cosmos/tools/cmd_tlm_server/background_tasks.rb +2 -0
- data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb +30 -4
- data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_config.rb +1 -0
- data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_gui.rb +9 -12
- data/lib/cosmos/tools/cmd_tlm_server/gui/packets_tab.rb +5 -2
- data/lib/cosmos/tools/cmd_tlm_server/routers.rb +2 -0
- data/lib/cosmos/tools/config_editor/config_editor.rb +80 -24
- data/lib/cosmos/tools/config_editor/config_editor_frame.rb +2 -0
- data/lib/cosmos/tools/data_viewer/data_viewer.rb +15 -9
- data/lib/cosmos/tools/data_viewer/dump_component.rb +2 -9
- data/lib/cosmos/tools/data_viewer/text_component.rb +77 -0
- data/lib/cosmos/tools/handbook_creator/handbook_creator.rb +64 -38
- data/lib/cosmos/tools/launcher/launcher.rb +1 -0
- data/lib/cosmos/tools/limits_monitor/limits_monitor.rb +31 -17
- data/lib/cosmos/tools/packet_viewer/packet_viewer.rb +8 -6
- data/lib/cosmos/tools/script_runner/script_runner.rb +87 -29
- data/lib/cosmos/tools/script_runner/script_runner_config.rb +14 -0
- data/lib/cosmos/tools/script_runner/script_runner_frame.rb +41 -7
- data/lib/cosmos/tools/table_manager/table_config.rb +5 -3
- data/lib/cosmos/tools/table_manager/table_manager.rb +6 -3
- data/lib/cosmos/tools/test_runner/test_runner.rb +14 -9
- data/lib/cosmos/tools/test_runner/test_runner_chooser.rb +21 -9
- data/lib/cosmos/tools/tlm_extractor/tlm_extractor.rb +3 -3
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_realtime_thread.rb +5 -8
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_tool.rb +11 -8
- data/lib/cosmos/tools/tlm_grapher/tlm_grapher.rb +9 -15
- data/lib/cosmos/tools/tlm_viewer/screen.rb +3 -1
- data/lib/cosmos/tools/tlm_viewer/tlm_viewer.rb +19 -13
- data/lib/cosmos/tools/tlm_viewer/widgets.rb +2 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/aging_widget.rb +4 -5
- data/lib/cosmos/tools/tlm_viewer/widgets/array_widget.rb +3 -4
- data/lib/cosmos/tools/tlm_viewer/widgets/block_widget.rb +4 -5
- data/lib/cosmos/tools/tlm_viewer/widgets/canvas_clickable.rb +16 -2
- data/lib/cosmos/tools/tlm_viewer/widgets/canvas_widget.rb +17 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/canvasdot_widget.rb +1 -2
- data/lib/cosmos/tools/tlm_viewer/widgets/canvasellipse_widget.rb +1 -1
- data/lib/cosmos/tools/tlm_viewer/widgets/canvasimage_widget.rb +12 -7
- data/lib/cosmos/tools/tlm_viewer/widgets/canvasimagevalue_widget.rb +79 -29
- data/lib/cosmos/tools/tlm_viewer/widgets/canvaslabel_widget.rb +1 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/canvaslabelvalue_widget.rb +2 -1
- data/lib/cosmos/tools/tlm_viewer/widgets/canvasline_widget.rb +2 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/canvaslinevalue_widget.rb +4 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/canvasvalue_widget.rb +33 -25
- data/lib/cosmos/tools/tlm_viewer/widgets/checkbutton_widget.rb +5 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/combobox_widget.rb +5 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb +1 -1
- data/lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb +4 -7
- data/lib/cosmos/tools/tlm_viewer/widgets/horizontal_widget.rb +5 -5
- data/lib/cosmos/tools/tlm_viewer/widgets/horizontalbox_widget.rb +6 -7
- data/lib/cosmos/tools/tlm_viewer/widgets/horizontalline_widget.rb +2 -4
- data/lib/cosmos/tools/tlm_viewer/widgets/label_widget.rb +10 -8
- data/lib/cosmos/tools/tlm_viewer/widgets/labelformatvalue_widget.rb +2 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/labelled_widget.rb +58 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/labelprogressbar_widget.rb +3 -4
- data/lib/cosmos/tools/tlm_viewer/widgets/labeltrendlimitsbar_widget.rb +2 -4
- data/lib/cosmos/tools/tlm_viewer/widgets/labelvalue_widget.rb +2 -1
- data/lib/cosmos/tools/tlm_viewer/widgets/labelvaluedesc_widget.rb +3 -5
- data/lib/cosmos/tools/tlm_viewer/widgets/labelvaluelimitsbar_widget.rb +2 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/labelvaluelimitscolumn_widget.rb +2 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/labelvaluerangebar_widget.rb +2 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/labelvaluerangecolumn_widget.rb +2 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/layout_widget.rb +3 -5
- data/lib/cosmos/tools/tlm_viewer/widgets/led_widget.rb +108 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/limits_widget.rb +60 -10
- data/lib/cosmos/tools/tlm_viewer/widgets/limitsbar_widget.rb +22 -8
- data/lib/cosmos/tools/tlm_viewer/widgets/limitscolor_widget.rb +19 -13
- data/lib/cosmos/tools/tlm_viewer/widgets/limitscolumn_widget.rb +22 -8
- data/lib/cosmos/tools/tlm_viewer/widgets/linegraph_widget.rb +2 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/matrixbycolumns_widget.rb +4 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/multi_widget.rb +1 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/progressbar_widget.rb +10 -5
- data/lib/cosmos/tools/tlm_viewer/widgets/radiobutton_widget.rb +7 -4
- data/lib/cosmos/tools/tlm_viewer/widgets/rangebar_widget.rb +4 -6
- data/lib/cosmos/tools/tlm_viewer/widgets/rangecolumn_widget.rb +3 -5
- data/lib/cosmos/tools/tlm_viewer/widgets/screenshotbutton_widget.rb +4 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/scrollwindow_widget.rb +2 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/sectionheader_widget.rb +2 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/spacer_widget.rb +4 -6
- data/lib/cosmos/tools/tlm_viewer/widgets/tabbook_widget.rb +2 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/tabitem_widget.rb +2 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/textbox_widget.rb +13 -4
- data/lib/cosmos/tools/tlm_viewer/widgets/textfield_widget.rb +3 -4
- data/lib/cosmos/tools/tlm_viewer/widgets/timegraph_widget.rb +2 -7
- data/lib/cosmos/tools/tlm_viewer/widgets/title_widget.rb +6 -12
- data/lib/cosmos/tools/tlm_viewer/widgets/trendbar_widget.rb +5 -10
- data/lib/cosmos/tools/tlm_viewer/widgets/trendlimitsbar_widget.rb +5 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/value_widget.rb +4 -4
- data/lib/cosmos/tools/tlm_viewer/widgets/valuelimitsbar_widget.rb +2 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/valuelimitscolumn_widget.rb +2 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/valuerangebar_widget.rb +3 -4
- data/lib/cosmos/tools/tlm_viewer/widgets/valuerangecolumn_widget.rb +2 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/vertical_widget.rb +8 -7
- data/lib/cosmos/tools/tlm_viewer/widgets/verticalbox_widget.rb +9 -7
- data/lib/cosmos/tools/tlm_viewer/widgets/widget.rb +54 -46
- data/lib/cosmos/top_level.rb +23 -12
- data/lib/cosmos/version.rb +4 -4
- data/spec/gui/utilities/script_module_gui_spec.rb +44 -63
- data/spec/install/config/targets/INST/cmd_tlm/inst_cmds.txt +1 -1
- data/spec/install/config/targets/INST/cmd_tlm/inst_tlm.txt +5 -5
- data/spec/install/yaml_docs_spec.rb +112 -0
- data/spec/interfaces/protocols/fixed_protocol_spec.rb +20 -9
- data/spec/interfaces/protocols/template_protocol_spec.rb +78 -25
- data/spec/packets/commands_spec.rb +22 -0
- data/spec/packets/packet_config_spec.rb +24 -0
- data/spec/packets/packet_item_spec.rb +2 -2
- data/spec/packets/packet_spec.rb +39 -6
- data/spec/packets/parsers/state_parser_spec.rb +33 -11
- data/spec/packets/structure_spec.rb +41 -0
- data/spec/packets/telemetry_spec.rb +23 -0
- data/spec/streams/tcpip_socket_stream_spec.rb +32 -27
- data/spec/system/system_spec.rb +77 -2
- data/spec/system/target_spec.rb +62 -1
- data/spec/tools/cmd_tlm_server/api_spec.rb +1 -1
- data/spec/tools/cmd_tlm_server/background_tasks_spec.rb +15 -7
- data/spec/top_level/top_level_spec.rb +29 -5
- data/tasks/gemfile_stats.rake +28 -14
- data/test/performance/config/system/system.txt +0 -0
- data/test/performance/config/targets/PACKET/cmd_tlm/packet_tlm.txt +5 -5
- data/test/performance/config/tools/handbook_creator/assets/css/bootstrap-theme.css +397 -0
- data/test/performance/config/tools/handbook_creator/assets/css/bootstrap-theme.min.css +7 -0
- data/test/performance/config/tools/handbook_creator/assets/css/bootstrap.css +7118 -0
- data/test/performance/config/tools/handbook_creator/assets/css/bootstrap.min.css +7 -0
- data/test/performance/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/test/performance/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.svg +229 -0
- data/test/performance/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/test/performance/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/test/performance/config/tools/handbook_creator/assets/img/ball_logo.bmp +0 -0
- data/test/performance/config/tools/handbook_creator/assets/img/ball_logo.gif +0 -0
- data/test/performance/config/tools/handbook_creator/assets/img/ball_logo.jpg +0 -0
- data/test/performance/config/tools/handbook_creator/assets/js/bootstrap.js +2006 -0
- data/test/performance/config/tools/handbook_creator/assets/js/bootstrap.min.js +7 -0
- data/test/performance/config/tools/handbook_creator/assets/js/html5shiv.js +8 -0
- data/test/performance/config/tools/handbook_creator/assets/js/jquery-1.10.2.min.js +6 -0
- data/test/performance/config/tools/handbook_creator/assets/js/respond.min.js +6 -0
- data/test/performance/config/tools/test_runner/test_runner.txt +1 -1
- data/test/performance/procedures/cosmos_api_test.rb +1 -1
- data/test/performance/tools/identify_performance.rb +82 -0
- metadata +92 -55
|
@@ -21,7 +21,6 @@ module Cosmos
|
|
|
21
21
|
# appended with any warnings found when parsing the limits
|
|
22
22
|
def self.parse(parser, packet, cmd_or_tlm, item, warnings)
|
|
23
23
|
raise parser.error("Items with LIMITS can't define STATE") if item.limits.values
|
|
24
|
-
raise parser.error("Items with FORMAT_STRING can't define STATE") if item.format_string
|
|
25
24
|
raise parser.error("Items with UNITS can't define STATE") if item.units
|
|
26
25
|
@parser = StateParser.new(parser)
|
|
27
26
|
@parser.verify_parameters(cmd_or_tlm)
|
|
@@ -295,6 +295,8 @@ module Cosmos
|
|
|
295
295
|
xml['xtce'].IntegerDataEncoding(:sizeInBits => item.bit_size, :encoding => encoding)
|
|
296
296
|
xml['xtce'].EnumerationList do
|
|
297
297
|
item.states.each do |state_name, state_value|
|
|
298
|
+
# Skip the special COSMOS 'ANY' enumerated state
|
|
299
|
+
next if state_value == 'ANY'
|
|
298
300
|
xml['xtce'].Enumeration(:value => state_value, :label => state_name)
|
|
299
301
|
end
|
|
300
302
|
end
|
|
@@ -25,8 +25,8 @@ module Cosmos
|
|
|
25
25
|
# @param warnings [Array<String>] Array of strings listing all the warnings
|
|
26
26
|
# that were created while parsing the configuration
|
|
27
27
|
# @param filename [String] The name of the configuration file
|
|
28
|
-
# @param target_name [String]
|
|
29
|
-
def self.process(commands, telemetry, warnings, filename, target_name)
|
|
28
|
+
# @param target_name [String] Override the target name found in the XTCE file
|
|
29
|
+
def self.process(commands, telemetry, warnings, filename, target_name = nil)
|
|
30
30
|
XtceParser.new(commands, telemetry, warnings, filename, target_name)
|
|
31
31
|
end
|
|
32
32
|
|
|
@@ -49,7 +49,7 @@ module Cosmos
|
|
|
49
49
|
|
|
50
50
|
private
|
|
51
51
|
|
|
52
|
-
def initialize(commands, telemetry, warnings, filename, target_name)
|
|
52
|
+
def initialize(commands, telemetry, warnings, filename, target_name = nil)
|
|
53
53
|
reset_processing_variables()
|
|
54
54
|
@commands = commands
|
|
55
55
|
@telemetry = telemetry
|
|
@@ -60,6 +60,7 @@ module Cosmos
|
|
|
60
60
|
|
|
61
61
|
def parse(filename, target_name)
|
|
62
62
|
doc = File.open(filename) { |f| Nokogiri::XML(f, nil, nil, Nokogiri::XML::ParseOptions::STRICT | Nokogiri::XML::ParseOptions::NOBLANKS) }
|
|
63
|
+
# Determine the @current_target_name
|
|
63
64
|
xtce_process_element(doc.root)
|
|
64
65
|
@current_target_name = target_name if target_name
|
|
65
66
|
doc.root.children.each do |child|
|
|
@@ -195,7 +195,7 @@ module Cosmos
|
|
|
195
195
|
last_item = @sorted_items[-1]
|
|
196
196
|
@sorted_items << item
|
|
197
197
|
# If the current item or last item have a negative offset then we have
|
|
198
|
-
# to re-sort. We also re-sort if the current item is less than the
|
|
198
|
+
# to re-sort. We also re-sort if the current item is less than the last
|
|
199
199
|
# item because we are inserting.
|
|
200
200
|
if last_item.bit_offset <= 0 or item.bit_offset <= 0 or item.bit_offset < last_item.bit_offset
|
|
201
201
|
@sorted_items = @sorted_items.sort
|
|
@@ -370,12 +370,14 @@ module Cosmos
|
|
|
370
370
|
# parameter to check whether to perform conversions on the item.
|
|
371
371
|
# @param indent [Integer] Amount to indent before printing the item name
|
|
372
372
|
# @param buffer [String] The binary buffer to write the value to
|
|
373
|
+
# @param ignored [Array<String>] List of items to ignore when building the string
|
|
373
374
|
# @return [String] String formatted with all the item names and values
|
|
374
|
-
def formatted(value_type = :RAW, indent = 0, buffer = @buffer)
|
|
375
|
+
def formatted(value_type = :RAW, indent = 0, buffer = @buffer, ignored = nil)
|
|
375
376
|
indent_string = ' ' * indent
|
|
376
377
|
string = ''
|
|
377
378
|
synchronize_allow_reads(true) do
|
|
378
379
|
@sorted_items.each do |item|
|
|
380
|
+
next if ignored && ignored.include?(item.name)
|
|
379
381
|
if (item.data_type != :BLOCK) ||
|
|
380
382
|
(item.data_type == :BLOCK and value_type != :RAW and
|
|
381
383
|
item.respond_to? :read_conversion and item.read_conversion)
|
|
@@ -266,17 +266,33 @@ module Cosmos
|
|
|
266
266
|
target_names = target_names() unless target_names
|
|
267
267
|
|
|
268
268
|
target_names.each do |target_name|
|
|
269
|
+
target_name = target_name.to_s.upcase
|
|
270
|
+
|
|
269
271
|
target_packets = nil
|
|
270
272
|
begin
|
|
271
273
|
target_packets = packets(target_name)
|
|
274
|
+
#puts target_packets.length
|
|
272
275
|
rescue RuntimeError
|
|
273
276
|
# No telemetry for this target
|
|
274
277
|
next
|
|
275
278
|
end
|
|
276
279
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
+
target = System.targets[target_name]
|
|
281
|
+
if target and target.tlm_unique_id_mode
|
|
282
|
+
# Iterate through the packets and see if any represent the buffer
|
|
283
|
+
target_packets.each do |packet_name, packet|
|
|
284
|
+
return packet if packet.identify?(packet_data)
|
|
285
|
+
end
|
|
286
|
+
else
|
|
287
|
+
# Do a hash lookup to quickly identify the packet
|
|
288
|
+
if target_packets.length > 0
|
|
289
|
+
packet = target_packets.first[1]
|
|
290
|
+
key = packet.read_id_values(packet_data)
|
|
291
|
+
hash = @config.tlm_id_value_hash[target_name]
|
|
292
|
+
identified_packet = hash[key]
|
|
293
|
+
identified_packet = hash['CATCHALL'.freeze] unless identified_packet
|
|
294
|
+
return identified_packet if identified_packet
|
|
295
|
+
end
|
|
280
296
|
end
|
|
281
297
|
end
|
|
282
298
|
|
|
@@ -477,7 +477,7 @@ module Cosmos
|
|
|
477
477
|
path
|
|
478
478
|
end
|
|
479
479
|
|
|
480
|
-
def check_file_cache_for_instrumented_script(path,
|
|
480
|
+
def check_file_cache_for_instrumented_script(path, hash_string)
|
|
481
481
|
file_text = nil
|
|
482
482
|
instrumented_script = nil
|
|
483
483
|
cached = true
|
|
@@ -498,8 +498,8 @@ module Cosmos
|
|
|
498
498
|
if use_file_cache
|
|
499
499
|
# Check file based instrumented cache
|
|
500
500
|
flat_path = path.tr("/", "_").gsub("\\", "_").tr(":", "_").tr(" ", "_")
|
|
501
|
-
|
|
502
|
-
cache_filename = File.join(cache_path,
|
|
501
|
+
flat_path_with_hash_string = flat_path + '_' + hash_string
|
|
502
|
+
cache_filename = File.join(cache_path, flat_path_with_hash_string)
|
|
503
503
|
end
|
|
504
504
|
|
|
505
505
|
begin
|
|
@@ -536,24 +536,27 @@ module Cosmos
|
|
|
536
536
|
path = _get_procedure_path(procedure_name)
|
|
537
537
|
|
|
538
538
|
if defined? ScriptRunnerFrame and ScriptRunnerFrame.instance
|
|
539
|
-
|
|
539
|
+
hashing_sum = nil
|
|
540
540
|
begin
|
|
541
|
-
|
|
541
|
+
hashing_result = Cosmos.hash_files([path], nil, System.hashing_algorithm)
|
|
542
|
+
hash_string = hashing_result.hexdigest
|
|
543
|
+
# Only use at most, 32 characters of the hex
|
|
544
|
+
hash_string = hash_string[-32..-1] if hash_string.length >= 32
|
|
542
545
|
rescue Exception => error
|
|
543
|
-
raise "Error calculating
|
|
546
|
+
raise "Error calculating hash string on procedure file : #{path}"
|
|
544
547
|
end
|
|
545
548
|
|
|
546
549
|
# Check RAM based instrumented cache
|
|
547
550
|
instrumented_cache = ScriptRunnerFrame.instrumented_cache[path]
|
|
548
551
|
instrumented_script = nil
|
|
549
|
-
if instrumented_cache and
|
|
552
|
+
if instrumented_cache and hash_string == instrumented_cache[1]
|
|
550
553
|
# Use cached instrumentation
|
|
551
554
|
instrumented_script = instrumented_cache[0]
|
|
552
555
|
else
|
|
553
|
-
file_text, instrumented_script, cached = check_file_cache_for_instrumented_script(path,
|
|
556
|
+
file_text, instrumented_script, cached = check_file_cache_for_instrumented_script(path, hash_string)
|
|
554
557
|
# Cache instrumentation into RAM
|
|
555
558
|
ScriptRunnerFrame.file_cache[path] = file_text
|
|
556
|
-
ScriptRunnerFrame.instrumented_cache[path] = [instrumented_script,
|
|
559
|
+
ScriptRunnerFrame.instrumented_cache[path] = [instrumented_script, hash_string]
|
|
557
560
|
end
|
|
558
561
|
|
|
559
562
|
Object.class_eval(instrumented_script, path, 1)
|
|
@@ -56,20 +56,20 @@ module Cosmos
|
|
|
56
56
|
return value
|
|
57
57
|
end
|
|
58
58
|
|
|
59
|
-
def prompt(string)
|
|
60
|
-
prompt_to_continue(string)
|
|
59
|
+
def prompt(string, **options)
|
|
60
|
+
prompt_to_continue(string, options)
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
-
def message_box(string, *buttons)
|
|
64
|
-
prompt_message_box(string, buttons)
|
|
63
|
+
def message_box(string, *buttons, **options)
|
|
64
|
+
prompt_message_box(string, buttons, options)
|
|
65
65
|
end
|
|
66
66
|
|
|
67
|
-
def vertical_message_box(string, *buttons)
|
|
68
|
-
prompt_vertical_message_box(string, buttons)
|
|
67
|
+
def vertical_message_box(string, *buttons, **options)
|
|
68
|
+
prompt_vertical_message_box(string, buttons, options)
|
|
69
69
|
end
|
|
70
70
|
|
|
71
|
-
def combo_box(string, *options)
|
|
72
|
-
prompt_combo_box(string, options)
|
|
71
|
+
def combo_box(string, *items, **options)
|
|
72
|
+
prompt_combo_box(string, items, options)
|
|
73
73
|
end
|
|
74
74
|
|
|
75
75
|
def _file_dialog(message, directory, filter, select_files = true)
|
|
@@ -123,22 +123,24 @@ module Cosmos
|
|
|
123
123
|
end
|
|
124
124
|
end
|
|
125
125
|
|
|
126
|
-
def prompt_to_continue(string)
|
|
126
|
+
def prompt_to_continue(string, text_color: nil, background_color: nil, font_size: nil, font_family: nil, details: nil)
|
|
127
127
|
print "#{string}: "
|
|
128
|
+
print "Details: #{details}\n" if details
|
|
128
129
|
gets.chomp
|
|
129
130
|
end
|
|
130
131
|
|
|
131
|
-
def prompt_message_box(string, buttons)
|
|
132
|
+
def prompt_message_box(string, buttons, text_color: nil, background_color: nil, font_size: nil, font_family: nil, details: nil)
|
|
132
133
|
print "#{string} (#{buttons.join(", ")}): "
|
|
134
|
+
print "Details: #{details}\n" if details
|
|
133
135
|
gets.chomp
|
|
134
136
|
end
|
|
135
137
|
|
|
136
|
-
def prompt_vertical_message_box(string, options)
|
|
137
|
-
prompt_message_box(string, options)
|
|
138
|
+
def prompt_vertical_message_box(string, buttons, options)
|
|
139
|
+
prompt_message_box(string, buttons, options)
|
|
138
140
|
end
|
|
139
141
|
|
|
140
|
-
def prompt_combo_box(string, options)
|
|
141
|
-
prompt_message_box(string, options)
|
|
142
|
+
def prompt_combo_box(string, items, options)
|
|
143
|
+
prompt_message_box(string, items, options)
|
|
142
144
|
end
|
|
143
145
|
end
|
|
144
146
|
end
|
data/lib/cosmos/system/system.rb
CHANGED
|
@@ -29,7 +29,7 @@ module Cosmos
|
|
|
29
29
|
# #targets variable provides access to all the targets defined by the system.
|
|
30
30
|
# Its primary responsibily is to load the system configuration file and
|
|
31
31
|
# create all the Target instances. It also saves and restores configurations
|
|
32
|
-
# using a
|
|
32
|
+
# using a hashing checksum over the entire configuration to detect changes.
|
|
33
33
|
class System
|
|
34
34
|
# @return [Hash<String,Fixnum>] Hash of all the known ports and their values
|
|
35
35
|
instance_attr_reader :ports
|
|
@@ -67,12 +67,14 @@ module Cosmos
|
|
|
67
67
|
instance_attr_reader :limits_set
|
|
68
68
|
# @return [Boolean] Whether to use UTC or local times
|
|
69
69
|
instance_attr_reader :use_utc
|
|
70
|
-
# @return [Array<String>] List of files that are to be included in the
|
|
70
|
+
# @return [Array<String>] List of files that are to be included in the hashing
|
|
71
71
|
# calculation in addition to the cmd/tlm definition files that are
|
|
72
72
|
# automatically included
|
|
73
|
-
instance_attr_reader :
|
|
73
|
+
instance_attr_reader :additional_hashing_files
|
|
74
74
|
# @return [Hash<String,String>] Hash of the text/color to use for the classificaiton banner
|
|
75
75
|
instance_attr_reader :classificiation_banner
|
|
76
|
+
# @return [String] Which hashing algorithm is in use
|
|
77
|
+
instance_attr_reader :hashing_algorithm
|
|
76
78
|
|
|
77
79
|
# Known COSMOS ports
|
|
78
80
|
KNOWN_PORTS = ['CTS_API', 'TLMVIEWER_API', 'CTS_PREIDENTIFIED', 'CTS_CMD_ROUTER', 'REPLAY_API', 'REPLAY_PREIDENTIFIED', 'REPLAY_CMD_ROUTER', 'DART_STREAM', 'DART_DECOM']
|
|
@@ -80,6 +82,8 @@ module Cosmos
|
|
|
80
82
|
KNOWN_HOSTS = ['CTS_API', 'TLMVIEWER_API', 'CTS_PREIDENTIFIED', 'CTS_CMD_ROUTER', 'REPLAY_API', 'REPLAY_PREIDENTIFIED', 'REPLAY_CMD_ROUTER', 'DART_STREAM', 'DART_DECOM']
|
|
81
83
|
# Known COSMOS paths
|
|
82
84
|
KNOWN_PATHS = ['LOGS', 'TMP', 'SAVED_CONFIG', 'TABLES', 'HANDBOOKS', 'PROCEDURES', 'SEQUENCES', 'DART_DATA', 'DART_LOGS']
|
|
85
|
+
# Supported hashing algorithms
|
|
86
|
+
SUPPORTED_HASHING_ALGORITHMS = ['MD5', 'RMD160', 'SHA1', 'SHA256', 'SHA384', 'SHA512']
|
|
83
87
|
|
|
84
88
|
@@instance = nil
|
|
85
89
|
@@instance_mutex = Mutex.new
|
|
@@ -195,7 +199,7 @@ module Cosmos
|
|
|
195
199
|
acl_list = []
|
|
196
200
|
all_allowed = false
|
|
197
201
|
first_procedures_path = true
|
|
198
|
-
@
|
|
202
|
+
@additional_hashing_files = []
|
|
199
203
|
|
|
200
204
|
Cosmos.set_working_dir do
|
|
201
205
|
parser = ConfigParser.new("http://cosmosrb.com/docs/system")
|
|
@@ -329,16 +333,25 @@ module Cosmos
|
|
|
329
333
|
parser.verify_num_parameters(0, 0, "#{keyword}")
|
|
330
334
|
@use_utc = true
|
|
331
335
|
|
|
332
|
-
when 'ADD_MD5_FILE'
|
|
336
|
+
when 'ADD_HASH_FILE', 'ADD_MD5_FILE' # MD5 is here for backwards compatibility
|
|
333
337
|
parser.verify_num_parameters(1, 1, "#{keyword} <Filename>")
|
|
334
338
|
if File.file?(parameters[0])
|
|
335
|
-
@
|
|
339
|
+
@additional_hashing_files << File.expand_path(parameters[0])
|
|
336
340
|
elsif File.file?(File.join(Cosmos::USERPATH, parameters[0]))
|
|
337
|
-
@
|
|
341
|
+
@additional_hashing_files << File.expand_path(File.join(Cosmos::USERPATH, parameters[0]))
|
|
338
342
|
else
|
|
339
343
|
raise "Missing expected file: #{parameters[0]}"
|
|
340
344
|
end
|
|
341
345
|
|
|
346
|
+
when 'HASHING_ALGORITHM'
|
|
347
|
+
parser.verify_num_parameters(1, 1, "#{keyword} <Hashing Algorithm>")
|
|
348
|
+
if SUPPORTED_HASHING_ALGORITHMS.include? parameters[0]
|
|
349
|
+
@hashing_algorithm = parameters[0]
|
|
350
|
+
else
|
|
351
|
+
Logger.error "Unrecognized hashing algorithm: #{parameters[0]}, using default algorithm MD5"
|
|
352
|
+
@hashing_algorithm = 'MD5'
|
|
353
|
+
end
|
|
354
|
+
|
|
342
355
|
when 'CLASSIFICATION'
|
|
343
356
|
parser.verify_num_parameters(2, 4, "#{keyword} <Display_Text> <Color Name|Red> <Green> <Blue>")
|
|
344
357
|
# Determine if the COSMOS color already exists, otherwise create a new one
|
|
@@ -413,13 +426,8 @@ module Cosmos
|
|
|
413
426
|
end
|
|
414
427
|
end
|
|
415
428
|
end
|
|
416
|
-
|
|
417
429
|
auto_detect_gem_based_targets()
|
|
418
430
|
|
|
419
|
-
# Make sure SYSTEM target is always present and added last
|
|
420
|
-
target = Target.new('SYSTEM')
|
|
421
|
-
@targets[target.name] = target
|
|
422
|
-
|
|
423
431
|
when 'DECLARE_TARGET'
|
|
424
432
|
usage = "#{keyword} <TARGET NAME> <SUBSTITUTE TARGET NAME (Optional)> <TARGET FILENAME (Optional - defaults to target.txt)>"
|
|
425
433
|
parser.verify_num_parameters(1, 3, usage)
|
|
@@ -452,13 +460,19 @@ module Cosmos
|
|
|
452
460
|
|
|
453
461
|
end # case keyword
|
|
454
462
|
end # parser.parse_file
|
|
463
|
+
|
|
464
|
+
# Make sure SYSTEM target is always present and added last
|
|
465
|
+
unless @targets.key?('SYSTEM')
|
|
466
|
+
target = Target.new('SYSTEM')
|
|
467
|
+
@targets[target.name] = target
|
|
468
|
+
end
|
|
455
469
|
end
|
|
456
470
|
|
|
457
471
|
# Load the specified configuration by iterating through the SAVED_CONFIG
|
|
458
|
-
# directory looking for a matching
|
|
472
|
+
# directory looking for a matching hashing sum. Updates the internal state so
|
|
459
473
|
# subsequent commands and telemetry methods return the new configuration.
|
|
460
474
|
#
|
|
461
|
-
# @param name [String]
|
|
475
|
+
# @param name [String] hash string which identifies the
|
|
462
476
|
# configuration. Pass nil to load the default configuration.
|
|
463
477
|
# @return [String, Exception/nil] The actual configuration loaded
|
|
464
478
|
def load_configuration(name = nil)
|
|
@@ -531,8 +545,9 @@ module Cosmos
|
|
|
531
545
|
@staleness_seconds = 30
|
|
532
546
|
@limits_set = :DEFAULT
|
|
533
547
|
@use_utc = false
|
|
534
|
-
@
|
|
548
|
+
@additional_hashing_files = []
|
|
535
549
|
@meta_init_filename = nil
|
|
550
|
+
@hashing_algorithm = 'MD5'
|
|
536
551
|
|
|
537
552
|
@ports = {}
|
|
538
553
|
@ports['CTS_API'] = 7777
|
|
@@ -750,11 +765,12 @@ module Cosmos
|
|
|
750
765
|
end
|
|
751
766
|
|
|
752
767
|
def load_packets(configuration_name = nil)
|
|
753
|
-
# Determine
|
|
768
|
+
# Determine hashing over all targets cmd_tlm files
|
|
754
769
|
cmd_tlm_files = []
|
|
755
770
|
additional_data = ''
|
|
756
771
|
@targets.each do |target_name, target|
|
|
757
772
|
cmd_tlm_files << target.filename if File.exist?(target.filename)
|
|
773
|
+
cmd_tlm_files.concat(target.requires)
|
|
758
774
|
cmd_tlm_files.concat(target.cmd_tlm_files)
|
|
759
775
|
if target.substitute
|
|
760
776
|
additional_data << target.original_name
|
|
@@ -764,11 +780,14 @@ module Cosmos
|
|
|
764
780
|
end
|
|
765
781
|
end
|
|
766
782
|
|
|
767
|
-
|
|
768
|
-
|
|
783
|
+
hashing_result = Cosmos.hash_files(cmd_tlm_files + @additional_hashing_files, additional_data, @hashing_algorithm)
|
|
784
|
+
hash_string = hashing_result.hexdigest
|
|
785
|
+
# Only use at most, 32 characters of the hex
|
|
786
|
+
hash_string = hash_string[-32..-1] if hash_string.length >= 32
|
|
787
|
+
|
|
769
788
|
|
|
770
789
|
# Build filename for marshal file
|
|
771
|
-
marshal_filename = File.join(@paths['TMP'], 'marshal_' <<
|
|
790
|
+
marshal_filename = File.join(@paths['TMP'], 'marshal_' << hash_string << '.bin')
|
|
772
791
|
|
|
773
792
|
# Attempt to load marshal file
|
|
774
793
|
config = Cosmos.marshal_load(marshal_filename)
|
|
@@ -801,7 +820,7 @@ module Cosmos
|
|
|
801
820
|
if configuration_name
|
|
802
821
|
@config.name = configuration_name
|
|
803
822
|
else
|
|
804
|
-
@config.name =
|
|
823
|
+
@config.name = hash_string
|
|
805
824
|
end
|
|
806
825
|
|
|
807
826
|
Cosmos.marshal_dump(marshal_filename, @config)
|
data/lib/cosmos/system/target.rb
CHANGED
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
# attribution addendums as found in the LICENSE.txt
|
|
10
10
|
|
|
11
11
|
require 'cosmos/config/config_parser'
|
|
12
|
+
require 'pathname'
|
|
12
13
|
|
|
13
14
|
module Cosmos
|
|
14
|
-
|
|
15
15
|
# Target encapsulates the information about a COSMOS target. Targets are
|
|
16
16
|
# accessed through interfaces and have command and telemetry definition files
|
|
17
17
|
# which define their access.
|
|
@@ -66,6 +66,12 @@ module Cosmos
|
|
|
66
66
|
# @return [Integer] The number of telemetry packets received from this target
|
|
67
67
|
attr_accessor :tlm_cnt
|
|
68
68
|
|
|
69
|
+
# @return [Boolean] Indicates if all command packets identify using different fields
|
|
70
|
+
attr_accessor :cmd_unique_id_mode
|
|
71
|
+
|
|
72
|
+
# @return [Boolean] Indicates if telemetry packets identify using different fields
|
|
73
|
+
attr_accessor :tlm_unique_id_mode
|
|
74
|
+
|
|
69
75
|
# Creates a new target by processing the target.txt file in the directory
|
|
70
76
|
# given by the path joined with the target_name. Records all the command
|
|
71
77
|
# and telemetry definition files found in the targets cmd_tlm directory.
|
|
@@ -90,6 +96,8 @@ module Cosmos
|
|
|
90
96
|
@routers = []
|
|
91
97
|
@cmd_cnt = 0
|
|
92
98
|
@tlm_cnt = 0
|
|
99
|
+
@cmd_unique_id_mode = false
|
|
100
|
+
@tlm_unique_id_mode = false
|
|
93
101
|
|
|
94
102
|
# Determine the target name using substitution if given
|
|
95
103
|
@original_name = target_name.clone.upcase.freeze
|
|
@@ -123,16 +131,18 @@ module Cosmos
|
|
|
123
131
|
when 'REQUIRE'
|
|
124
132
|
usage = "#{keyword} <FILENAME>"
|
|
125
133
|
parser.verify_num_parameters(1, 1, usage)
|
|
134
|
+
filename = File.join(@dir, 'lib', parameters[0])
|
|
126
135
|
begin
|
|
127
|
-
# Require absolute path to file in target lib folder.
|
|
136
|
+
# Require absolute path to file in target lib folder. Prevents name
|
|
128
137
|
# conflicts at the require step
|
|
129
138
|
Cosmos.disable_warnings do
|
|
130
|
-
Cosmos.require_file(
|
|
139
|
+
Cosmos.require_file(filename, false)
|
|
131
140
|
end
|
|
132
141
|
rescue LoadError
|
|
133
142
|
begin
|
|
134
143
|
# If we couldn't load at the target/lib level check everywhere
|
|
135
144
|
Cosmos.disable_warnings do
|
|
145
|
+
filename = parameters[0]
|
|
136
146
|
Cosmos.require_file(parameters[0])
|
|
137
147
|
end
|
|
138
148
|
rescue Exception => err
|
|
@@ -141,7 +151,19 @@ module Cosmos
|
|
|
141
151
|
rescue Exception => err
|
|
142
152
|
raise parser.error(err.message)
|
|
143
153
|
end
|
|
144
|
-
|
|
154
|
+
|
|
155
|
+
# This code resolves any relative paths to absolute before putting into the @requires array
|
|
156
|
+
unless Pathname.new(filename).absolute?
|
|
157
|
+
$:.each do |search_path|
|
|
158
|
+
test_filename = File.join(search_path, filename).gsub("\\", "/")
|
|
159
|
+
if File.exist?(test_filename)
|
|
160
|
+
filename = test_filename
|
|
161
|
+
break
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
@requires << filename
|
|
145
167
|
|
|
146
168
|
when 'IGNORE_PARAMETER', 'IGNORE_ITEM'
|
|
147
169
|
usage = "#{keyword} <#{keyword.split('_')[1]} NAME>"
|
|
@@ -161,6 +183,16 @@ module Cosmos
|
|
|
161
183
|
parser.verify_num_parameters(0, 0, usage)
|
|
162
184
|
@auto_screen_substitute = true
|
|
163
185
|
|
|
186
|
+
when 'CMD_UNIQUE_ID_MODE'
|
|
187
|
+
usage = "#{keyword}"
|
|
188
|
+
parser.verify_num_parameters(0, 0, usage)
|
|
189
|
+
@cmd_unique_id_mode = true
|
|
190
|
+
|
|
191
|
+
when 'TLM_UNIQUE_ID_MODE'
|
|
192
|
+
usage = "#{keyword}"
|
|
193
|
+
parser.verify_num_parameters(0, 0, usage)
|
|
194
|
+
@tlm_unique_id_mode = true
|
|
195
|
+
|
|
164
196
|
else
|
|
165
197
|
# blank lines will have a nil keyword and should not raise an exception
|
|
166
198
|
raise parser.error("Unknown keyword '#{keyword}'") if keyword
|
|
@@ -213,7 +245,7 @@ module Cosmos
|
|
|
213
245
|
cmd_tlm_files.sort!
|
|
214
246
|
end
|
|
215
247
|
|
|
216
|
-
# Make sure all partials are included in the cmd_tlm list for the
|
|
248
|
+
# Make sure all partials are included in the cmd_tlm list for the hashing sum calculation
|
|
217
249
|
def add_cmd_tlm_partials(dir)
|
|
218
250
|
partial_files = []
|
|
219
251
|
if Dir.exist?(File.join(dir, 'cmd_tlm'))
|
|
@@ -226,7 +258,5 @@ module Cosmos
|
|
|
226
258
|
@cmd_tlm_files.concat(partial_files)
|
|
227
259
|
@cmd_tlm_files.uniq!
|
|
228
260
|
end
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
end # module Cosmos
|
|
261
|
+
end
|
|
262
|
+
end
|