cosmos 4.3.0-java → 4.4.0-java
Sign up to get free protection for your applications and to get access to all the features.
- 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
data/lib/cosmos/top_level.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
# This file contains top level functions in the Cosmos namespace
|
12
12
|
|
13
13
|
require 'thread'
|
14
|
-
require 'digest
|
14
|
+
require 'digest'
|
15
15
|
require 'open3'
|
16
16
|
require 'cosmos/core_ext'
|
17
17
|
require 'cosmos/version'
|
@@ -170,8 +170,12 @@ module Cosmos
|
|
170
170
|
return filename if File.exist? filename
|
171
171
|
|
172
172
|
# Check relative to executing file
|
173
|
-
|
174
|
-
|
173
|
+
begin # path raises so begin rescue it
|
174
|
+
filename = Cosmos.path($0, ['config', 'data', name])
|
175
|
+
return filename if File.exist? filename
|
176
|
+
rescue
|
177
|
+
# Couldn't find the file so return nil below
|
178
|
+
end
|
175
179
|
nil
|
176
180
|
end
|
177
181
|
|
@@ -240,6 +244,11 @@ module Cosmos
|
|
240
244
|
rescue Exception
|
241
245
|
# Oh well - we tried
|
242
246
|
end
|
247
|
+
if exception.class == TypeError and exception.message =~ /Thread::Mutex/
|
248
|
+
original_backtrace = exception.backtrace
|
249
|
+
exception = exception.exception("Mutex exists in a packet. Note: Packets must not be read during class initializers for Conversions, Limits Responses, etc.: #{exception}")
|
250
|
+
exception.set_backtrace(original_backtrace)
|
251
|
+
end
|
243
252
|
self.handle_fatal_exception(exception)
|
244
253
|
end
|
245
254
|
end
|
@@ -373,24 +382,26 @@ module Cosmos
|
|
373
382
|
end
|
374
383
|
end
|
375
384
|
|
376
|
-
# Runs
|
385
|
+
# Runs a hash algorithm over one or more files and returns the Digest object.
|
377
386
|
# Handles windows/unix new line differences but changes in whitespace will
|
378
|
-
# change the
|
387
|
+
# change the hash sum.
|
379
388
|
#
|
380
389
|
# Usage:
|
381
|
-
# digest = Cosmos.
|
390
|
+
# digest = Cosmos.hash_files(files, additional_data, hashing_algorithm)
|
382
391
|
# digest.digest # => the 16 bytes of digest
|
383
392
|
# digest.hexdigest # => the formatted string in hex
|
384
393
|
#
|
385
|
-
# @param filenames [Array<String>] List of files to read and calculate a
|
394
|
+
# @param filenames [Array<String>] List of files to read and calculate a hashing
|
386
395
|
# sum on
|
387
|
-
# @param additional_data [String] Additional data to add to the
|
388
|
-
# @
|
389
|
-
|
390
|
-
|
396
|
+
# @param additional_data [String] Additional data to add to the hashing sum
|
397
|
+
# @param hashing_algorithm [String] Hashing algorithm to use
|
398
|
+
# @return [Digest::<algorithm>] The hashing sum object
|
399
|
+
def self.hash_files(filenames, additional_data = nil, hashing_algorithm = 'MD5')
|
400
|
+
digest = Digest.const_get(hashing_algorithm).send('new')
|
401
|
+
|
391
402
|
Cosmos.set_working_dir do
|
392
403
|
filenames.each do |filename|
|
393
|
-
# Read the file's data and add to the running
|
404
|
+
# Read the file's data and add to the running hashing sum
|
394
405
|
digest << File.read(filename).gsub(/\r/,'')
|
395
406
|
end
|
396
407
|
end
|
data/lib/cosmos/version.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# encoding: ascii-8bit
|
2
2
|
|
3
|
-
COSMOS_VERSION = '4.
|
3
|
+
COSMOS_VERSION = '4.4.0'
|
4
4
|
module Cosmos
|
5
5
|
module Version
|
6
6
|
MAJOR = '4'
|
7
|
-
MINOR = '
|
7
|
+
MINOR = '4'
|
8
8
|
PATCH = '0'
|
9
|
-
BUILD = '
|
9
|
+
BUILD = '30bd354efce074e6684f2fb4f4df8dc12d2f3df5'
|
10
10
|
end
|
11
|
-
VERSION = '4.
|
11
|
+
VERSION = '4.4.0'
|
12
12
|
end
|
@@ -12,89 +12,70 @@ if RUBY_ENGINE == 'ruby'
|
|
12
12
|
require 'spec_helper'
|
13
13
|
require 'cosmos/gui/qt'
|
14
14
|
require 'cosmos/script'
|
15
|
-
require 'cosmos/
|
15
|
+
require 'cosmos/script/scripting'
|
16
16
|
|
17
17
|
module Cosmos
|
18
18
|
describe Script do
|
19
|
-
after(:all) do
|
20
|
-
# Load the original scripting file over the script_module_gui
|
21
|
-
load 'cosmos/script/scripting.rb'
|
22
|
-
end
|
23
|
-
|
24
|
-
def stub_null_object(constant)
|
25
|
-
class_double(constant).tap do |double|
|
26
|
-
stub_const(constant, double)
|
27
|
-
allow(double).to receive(:new).and_return(double(constant).as_null_object)
|
28
|
-
yield double if block_given?
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
let!(:qt_module) do
|
33
|
-
class_double('Qt').as_stubbed_const(:transfer_nested_constants => true).tap do |double|
|
34
|
-
stub_const('Qt', double)
|
35
|
-
stub_const('Qt::WindowTitleHint', double)
|
36
|
-
stub_const('Qt::WindowSystemMenuHint', double)
|
37
|
-
allow(double).to receive(:execute_in_main_thread).and_yield
|
38
|
-
allow(double).to receive(:debug_level)
|
39
|
-
end
|
40
|
-
stub_null_object('Qt::Widget')
|
41
|
-
stub_null_object('Qt::Dialog') do |double|
|
42
|
-
instance = double("Qt::Dialog").as_null_object
|
43
|
-
allow(instance).to receive(:exec).and_return 1 # break the loop by returning 1
|
44
|
-
allow(double).to receive(:new).and_return(instance)
|
45
|
-
end
|
46
|
-
# Stub Accepted to be 1 to match the instance exec returning 1
|
47
|
-
stub_const('Qt::Dialog::Accepted', 1)
|
48
|
-
stub_null_object('Qt::VBoxLayout')
|
49
|
-
stub_null_object('Qt::HBoxLayout')
|
50
|
-
stub_null_object('Qt::Label')
|
51
|
-
stub_null_object('Qt::PushButton')
|
52
|
-
end
|
53
|
-
|
54
19
|
describe "combo_box" do
|
55
|
-
it "should not modify the inputs" do
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
allow(double).to receive(:new).and_return(chooser)
|
20
|
+
it "should not modify the button inputs" do
|
21
|
+
expect(self).to receive(:gets) { ' ' }
|
22
|
+
capture_io do |stdout|
|
23
|
+
buttons = %w(THIS IS A TEST)
|
24
|
+
combo_box("Combo box test", *buttons)
|
25
|
+
expect(buttons).to eq %w(THIS IS A TEST)
|
26
|
+
expect(stdout.string).to match(/Combo box test/)
|
63
27
|
end
|
28
|
+
end
|
64
29
|
|
65
|
-
|
66
|
-
|
67
|
-
|
30
|
+
it "should display details" do
|
31
|
+
expect(self).to receive(:gets) { ' ' }
|
32
|
+
capture_io do |stdout|
|
33
|
+
buttons = %w(THIS IS A TEST)
|
34
|
+
combo_box("HI", *buttons, details: 'These are the details')
|
35
|
+
expect(stdout.string).to match(/These are the details/)
|
36
|
+
end
|
68
37
|
end
|
69
38
|
end
|
70
39
|
|
71
40
|
describe "message_box" do
|
72
41
|
it "should not modify the inputs" do
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
42
|
+
expect(self).to receive(:gets) { ' ' }
|
43
|
+
capture_io do |stdout|
|
44
|
+
buttons = %w(THIS IS A TEST)
|
45
|
+
message_box("Message box test", *buttons)
|
46
|
+
expect(buttons).to eq %w(THIS IS A TEST)
|
47
|
+
expect(stdout.string).to match(/Message box test/)
|
79
48
|
end
|
49
|
+
end
|
80
50
|
|
81
|
-
|
82
|
-
|
83
|
-
|
51
|
+
it "should display details" do
|
52
|
+
expect(self).to receive(:gets) { ' ' }
|
53
|
+
capture_io do |stdout|
|
54
|
+
buttons = %w(THIS IS A TEST)
|
55
|
+
message_box("HI", *buttons, details: 'These are the details')
|
56
|
+
expect(stdout.string).to match(/These are the details/)
|
57
|
+
end
|
84
58
|
end
|
85
59
|
end
|
86
60
|
|
87
61
|
describe "vertical_message_box" do
|
88
62
|
it "should not modify the inputs" do
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
63
|
+
expect(self).to receive(:gets) { ' ' }
|
64
|
+
capture_io do |stdout|
|
65
|
+
buttons = %w(THIS IS A TEST)
|
66
|
+
vertical_message_box("Vertical message box test", *buttons)
|
67
|
+
expect(buttons).to eq %w(THIS IS A TEST)
|
68
|
+
expect(stdout.string).to match(/Vertical message box test/)
|
93
69
|
end
|
70
|
+
end
|
94
71
|
|
95
|
-
|
96
|
-
|
97
|
-
|
72
|
+
it "should display details" do
|
73
|
+
expect(self).to receive(:gets) { ' ' }
|
74
|
+
capture_io do |stdout|
|
75
|
+
buttons = %w(THIS IS A TEST)
|
76
|
+
vertical_message_box("HI", *buttons, details: 'These are the details')
|
77
|
+
expect(stdout.string).to match(/These are the details/)
|
78
|
+
end
|
98
79
|
end
|
99
80
|
end
|
100
81
|
end
|
@@ -15,7 +15,7 @@ COMMAND INST COLLECT BIG_ENDIAN "Starts a collect on the instrument"
|
|
15
15
|
PARAMETER OPCODE 112 8 UINT 0x0 0xFF 0xAB "Collect opcode"
|
16
16
|
FORMAT_STRING "0x%0X"
|
17
17
|
PARAMETER TEMP 120 32 FLOAT 0.0 25.0 0.0 "Collect temperature"
|
18
|
-
UNITS
|
18
|
+
UNITS Celsius C
|
19
19
|
|
20
20
|
COMMAND INST ABORT BIG_ENDIAN "Aborts a collect on the instrument"
|
21
21
|
PARAMETER CCSDSVER 0 3 UINT 0 0 0 "CCSDS primary header version number"
|
@@ -21,28 +21,28 @@ TELEMETRY INST HEALTH_STATUS BIG_ENDIAN "Health and status from the instrument"
|
|
21
21
|
ITEM TEMP1 144 16 UINT "Temperature #1"
|
22
22
|
POLY_READ_CONVERSION -100.0 0.00305
|
23
23
|
POLY_WRITE_CONVERSION 32768.885246 327.86885
|
24
|
-
UNITS
|
24
|
+
UNITS CELSIUS C
|
25
25
|
FORMAT_STRING "%0.3f"
|
26
26
|
LIMITS DEFAULT 1 ENABLED -80.0 -70.0 60.0 80.0 -20.0 20.0
|
27
27
|
LIMITS TVAC 1 ENABLED -80.0 -30.0 30.0 80.0
|
28
28
|
ITEM TEMP2 160 16 UINT "Temperature #2"
|
29
29
|
POLY_READ_CONVERSION -100.0 0.00305
|
30
30
|
POLY_WRITE_CONVERSION 32768.885246 327.86885
|
31
|
-
UNITS
|
31
|
+
UNITS CELSIUS C
|
32
32
|
FORMAT_STRING "%0.3f"
|
33
33
|
LIMITS DEFAULT 1 ENABLED -60.0 -55.0 30.0 35.0
|
34
34
|
LIMITS TVAC 1 ENABLED -60.0 20.0 30.0 35.0
|
35
35
|
ITEM TEMP3 176 16 UINT "Temperature #3"
|
36
36
|
POLY_READ_CONVERSION -100.0 0.00305
|
37
37
|
POLY_WRITE_CONVERSION 32768.885246 327.86885
|
38
|
-
UNITS
|
38
|
+
UNITS CELSIUS C
|
39
39
|
FORMAT_STRING "%0.3f"
|
40
40
|
LIMITS DEFAULT 1 ENABLED -25.0 -10.0 50.0 55.0
|
41
41
|
LIMITS TVAC 1 ENABLED -15.0 -10.0 20.0 30.0
|
42
42
|
ITEM TEMP4 192 16 UINT "Temperature #4"
|
43
43
|
POLY_READ_CONVERSION -100.0 0.00305
|
44
44
|
POLY_WRITE_CONVERSION 32768.885246 327.86885
|
45
|
-
UNITS
|
45
|
+
UNITS CELSIUS C
|
46
46
|
FORMAT_STRING "%0.3f"
|
47
47
|
LIMITS DEFAULT 1 ENABLED -80.0 -70.0 60.0 80.0
|
48
48
|
ARRAY_ITEM ARY 208 8 UINT 80 "Array data"
|
@@ -52,7 +52,7 @@ TELEMETRY INST HEALTH_STATUS BIG_ENDIAN "Health and status from the instrument"
|
|
52
52
|
STATE NORMAL 0
|
53
53
|
STATE SPECIAL 1
|
54
54
|
APPEND_ARRAY_ITEM ARY2 64 FLOAT 640 "Double array"
|
55
|
-
UNITS
|
55
|
+
UNITS CELSIUS C
|
56
56
|
APPEND_ITEM ASCIICMD 2048 STRING "Most recent ASCIICMD string"
|
57
57
|
STATE "NOOP" "NOOP"
|
58
58
|
STATE "FIRE LASER" "FIRE LASER"
|
@@ -0,0 +1,112 @@
|
|
1
|
+
|
2
|
+
require 'spec_helper'
|
3
|
+
require 'find'
|
4
|
+
require 'cosmos/system'
|
5
|
+
require 'cosmos/config/meta_config_parser'
|
6
|
+
|
7
|
+
module Cosmos
|
8
|
+
describe Cosmos do
|
9
|
+
# These are not expected to be documented as they are deprecated
|
10
|
+
DEPRECATED = %w(MACRO_APPEND_START MACRO_APPEND_END ROUTER_LOG_RAW IGNORE REQUIRE_UTILITY)
|
11
|
+
# These source keywords are ignored in the YAML
|
12
|
+
EXCEPTIONS = %w(LAUNCH LAUNCH_TERMINAL LAUNCH_GEM CONVERTED RAW FORMATTED WITH_UNITS NONE)
|
13
|
+
EXCEPTIONS.concat(%w(MINUTE HOUR DAY AVG MIN MAX STDDEV AGING CRC OVERRIDE))
|
14
|
+
# These are not documented because OpenGL is not officially a tool
|
15
|
+
OPENGL = %w(STL_FILE TEXTURE_MAPPED_SPHERE TIP_TEXT POSITION ROTATION_X ROTATION_Y ROTATION_Z)
|
16
|
+
OPENGL.concat(%w(ZOOM ORIENTATION CENTER BOUNDS))
|
17
|
+
|
18
|
+
def get_src_keywords
|
19
|
+
@src_keywords = []
|
20
|
+
path = File.expand_path(File.join(File.dirname(__FILE__), "../../lib/**/*.rb"))
|
21
|
+
Dir[path].each do |filename|
|
22
|
+
data = File.read(filename)
|
23
|
+
part = nil
|
24
|
+
if data.include?('parser.parse_file')
|
25
|
+
part = data.split('parser.parse_file')[1..-1].join
|
26
|
+
elsif data.include?('handle_keyword(parser, keyword, parameters)')
|
27
|
+
part = data.split('handle_keyword(parser, keyword, parameters)')[1..-1].join
|
28
|
+
end
|
29
|
+
if part
|
30
|
+
part.split("\n").each do |line|
|
31
|
+
if match = line.match(/when (.*)/)
|
32
|
+
line = match.captures[0]
|
33
|
+
line.split(',').each do |item|
|
34
|
+
item.strip!
|
35
|
+
if (item[0] == "'" || item[0] == '"') && (item[-1] == "'" || item[-1] == '"')
|
36
|
+
@src_keywords << item[1..-2]
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# All the widgets are referenced in screen definitions
|
45
|
+
path = File.expand_path(File.join(File.dirname(__FILE__), "../../lib/cosmos/tools/tlm_viewer/widgets/*_widget.rb"))
|
46
|
+
Dir[path].each do |filename|
|
47
|
+
@src_keywords << filename.split('/')[-1].split('_widget.rb')[0].upcase
|
48
|
+
end
|
49
|
+
# Remove the base classes
|
50
|
+
@src_keywords -= %w(CANVASVALUE LAYOUT MULTI)
|
51
|
+
# Add specific keyword(s) that we want to document
|
52
|
+
@src_keywords.concat(%w(NAMED_WIDGET))
|
53
|
+
|
54
|
+
# All the protocols are referenced as keywords in INTERFACES
|
55
|
+
path = File.expand_path(File.join(File.dirname(__FILE__), "../../lib/cosmos/interfaces/protocols/*_protocol.rb"))
|
56
|
+
Dir[path].each do |filename|
|
57
|
+
@src_keywords << filename.split('/')[-1].split('_protocol.rb')[0].upcase
|
58
|
+
end
|
59
|
+
|
60
|
+
# Remove things we don't document
|
61
|
+
@src_keywords.uniq!
|
62
|
+
@src_keywords -= (DEPRECATED + EXCEPTIONS + OPENGL)
|
63
|
+
|
64
|
+
#puts "Total source keywords: #{@src_keywords.length}"
|
65
|
+
expect(@src_keywords.length > 100) # Sanity check
|
66
|
+
end
|
67
|
+
|
68
|
+
def process_meta(yaml_keywords, meta)
|
69
|
+
meta.each do |keyword, data|
|
70
|
+
next unless keyword.is_a?(String) && keyword.upcase == keyword
|
71
|
+
next if keyword == 'UNKNOWN' # Ignore the UNKNOWN placeholder
|
72
|
+
|
73
|
+
if data['modifiers']
|
74
|
+
process_meta(yaml_keywords, data['modifiers'])
|
75
|
+
end
|
76
|
+
yaml_keywords << keyword
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
def get_yaml_keywords
|
81
|
+
@yaml_keywords = []
|
82
|
+
path = File.expand_path(File.join(File.dirname(__FILE__), "../../data/config/*.yaml"))
|
83
|
+
Dir[path].each do |filename|
|
84
|
+
meta = Cosmos::MetaConfigParser.load(filename)
|
85
|
+
process_meta(@yaml_keywords, meta)
|
86
|
+
end
|
87
|
+
#puts "Total yaml keywords: #{@yaml_keywords.length}"
|
88
|
+
expect(@yaml_keywords.length > 100) # Sanity check
|
89
|
+
end
|
90
|
+
|
91
|
+
before(:all) do
|
92
|
+
get_src_keywords()
|
93
|
+
get_yaml_keywords()
|
94
|
+
end
|
95
|
+
|
96
|
+
it "should document all source keywords" do
|
97
|
+
undocumented = []
|
98
|
+
@src_keywords.each do |keyword|
|
99
|
+
undocumented << keyword unless @yaml_keywords.include?(keyword)
|
100
|
+
end
|
101
|
+
expect(undocumented).to be_empty, "Following source keywords not in YAML: #{undocumented}"
|
102
|
+
end
|
103
|
+
|
104
|
+
it "should not have extra keywords" do
|
105
|
+
extra = []
|
106
|
+
@yaml_keywords.each do |keyword|
|
107
|
+
extra << keyword unless @src_keywords.include?(keyword)
|
108
|
+
end
|
109
|
+
expect(extra).to be_empty, "Following YAML keywords not in source: #{extra}"
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
@@ -90,6 +90,7 @@ module Cosmos
|
|
90
90
|
end
|
91
91
|
|
92
92
|
it "reads telemetry data from the stream" do
|
93
|
+
target = System.targets['SYSTEM']
|
93
94
|
@interface.add_protocol(FixedProtocol, [1], :READ_WRITE)
|
94
95
|
@interface.instance_variable_set(:@stream, FixedStream.new)
|
95
96
|
@interface.target_names = ['SYSTEM']
|
@@ -103,6 +104,7 @@ module Cosmos
|
|
103
104
|
expect(packet.received_time.to_f).to be_within(0.1).of(Time.now.to_f)
|
104
105
|
expect(packet.target_name).to eql 'SYSTEM'
|
105
106
|
expect(packet.packet_name).to eql 'LIMITS_CHANGE'
|
107
|
+
target.tlm_unique_id_mode = true
|
106
108
|
$index = 1
|
107
109
|
packet = @interface.read
|
108
110
|
expect(packet.received_time.to_f).to be_within(0.1).of(Time.now.to_f)
|
@@ -113,30 +115,39 @@ module Cosmos
|
|
113
115
|
expect(packet.received_time.to_f).to be_within(0.1).of(Time.now.to_f)
|
114
116
|
expect(packet.target_name).to eql 'SYSTEM'
|
115
117
|
expect(packet.packet_name).to eql 'LIMITS_CHANGE'
|
118
|
+
target.tlm_unique_id_mode = false
|
116
119
|
end
|
117
120
|
|
118
121
|
it "reads command data from the stream" do
|
119
|
-
|
122
|
+
target = System.targets['SYSTEM']
|
123
|
+
packet = System.commands.packet("SYSTEM", "STARTLOGGING")
|
124
|
+
packet.restore_defaults
|
125
|
+
$buffer = packet.buffer.clone
|
120
126
|
class FixedStream2 < Stream
|
121
127
|
def connect; end
|
122
128
|
def connected?; true; end
|
123
129
|
def read
|
124
|
-
|
125
|
-
|
126
|
-
$index += 1
|
127
|
-
"\x1A\xCF\xFC\x1D\x00\x00\x00\x02"
|
128
|
-
else
|
129
|
-
"\x00\x00\x00\x00\x00\x00\x00\x00"
|
130
|
-
end
|
130
|
+
# Prepend a matching sync pattern to test the discard
|
131
|
+
"\x1A\xCF\xFC\x1D\x55\x55" << $buffer
|
131
132
|
end
|
132
133
|
end
|
133
|
-
|
134
|
+
# Require 8 bytes, discard 6 leading bytes, use 0x1ACFFC1D sync, telemetry = false (command)
|
135
|
+
@interface.add_protocol(FixedProtocol, [8, 6, '0x1ACFFC1D', false], :READ_WRITE)
|
134
136
|
@interface.instance_variable_set(:@stream, FixedStream2.new)
|
135
137
|
@interface.target_names = ['SYSTEM']
|
138
|
+
target.cmd_unique_id_mode = false
|
136
139
|
packet = @interface.read
|
137
140
|
expect(packet.received_time.to_f).to be_within(0.01).of(Time.now.to_f)
|
138
141
|
expect(packet.target_name).to eql 'SYSTEM'
|
139
142
|
expect(packet.packet_name).to eql 'STARTLOGGING'
|
143
|
+
expect(packet.buffer).to eql $buffer
|
144
|
+
target.cmd_unique_id_mode = true
|
145
|
+
packet = @interface.read
|
146
|
+
expect(packet.received_time.to_f).to be_within(0.01).of(Time.now.to_f)
|
147
|
+
expect(packet.target_name).to eql 'SYSTEM'
|
148
|
+
expect(packet.packet_name).to eql 'STARTLOGGING'
|
149
|
+
expect(packet.buffer).to eql $buffer
|
150
|
+
target.cmd_unique_id_mode = false
|
140
151
|
end
|
141
152
|
end
|
142
153
|
end
|