cosmos 4.2.4-java → 4.3.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/.travis.yml +1 -1
- data/Gemfile +1 -1
- data/Manifest.txt +12 -0
- data/autohotkey/tools/cmd_sequence.ahk +21 -20
- data/autohotkey/tools/cmd_sequence2.ahk +1 -1
- data/autohotkey/tools/config_editor.ahk +1 -1
- data/autohotkey/tools/launcher.ahk +1 -0
- data/autohotkey/tools/packet_viewer.ahk +6 -5
- data/autohotkey/tools/test_runner.ahk +8 -8
- data/bin/cosmos +37 -0
- data/bin/dart_util +0 -0
- data/data/config/item_modifiers.yaml +9 -0
- data/data/crc.txt +91 -86
- data/demo/Rakefile +2 -0
- data/demo/config/dart/Gemfile +1 -1
- data/demo/config/data/crc.txt +8 -5
- data/demo/config/system/system.txt +28 -0
- data/demo/config/system/system2.txt +21 -3
- data/demo/config/system/system_alt_ports.txt +69 -0
- data/demo/config/targets/INST/cmd_tlm/inst_tlm.txt +1 -0
- data/demo/config/tools/cmd_tlm_server/cmd_tlm_server_chain.txt +18 -0
- data/demo/procedures/cosmos_api_test.rb +18 -14
- data/demo/procedures/local_screen_example.rb +51 -0
- data/ext/cosmos/ext/cosmos_io/cosmos_io.c +32 -4
- data/ext/cosmos/ext/packet/packet.c +6 -0
- data/ext/mkrf_conf.rb +2 -2
- data/install/config/dart/Gemfile +1 -1
- data/install/config/data/crc.txt +2 -2
- data/install/config/system/system.txt +23 -1
- data/lib/cosmos/conversions.rb +2 -0
- data/lib/cosmos/conversions/packet_time_formatted_conversion.rb +38 -0
- data/lib/cosmos/conversions/packet_time_seconds_conversion.rb +38 -0
- data/lib/cosmos/core_ext/cosmos_io.rb +2 -1
- data/lib/cosmos/dart/Gemfile +1 -1
- data/lib/cosmos/dart/examples/dart_stream_client.rb +6 -2
- data/lib/cosmos/dart/lib/dart_common.rb +1 -1
- data/lib/cosmos/dart/lib/dart_database_cleaner.rb +2 -2
- data/lib/cosmos/dart/lib/dart_decommutator.rb +4 -4
- data/lib/cosmos/dart/lib/dart_importer.rb +3 -3
- data/lib/cosmos/dart/lib/dart_packet_log_writer.rb +2 -2
- data/lib/cosmos/dart/processes/dart_ingester.rb +2 -0
- data/lib/cosmos/dart/processes/dart_util.rb +4 -4
- data/lib/cosmos/dart/spec/dart/dart_reducer_manager_spec.rb +3 -3
- data/lib/cosmos/gui/dialogs/cmd_tlm_raw_dialog.rb +9 -5
- data/lib/cosmos/gui/dialogs/details_dialog.rb +29 -29
- data/lib/cosmos/gui/dialogs/exception_list_dialog.rb +1 -1
- data/lib/cosmos/gui/dialogs/find_replace_dialog.rb +3 -3
- data/lib/cosmos/gui/dialogs/interface_raw_dialog.rb +2 -2
- data/lib/cosmos/gui/dialogs/set_tlm_dialog.rb +1 -1
- data/lib/cosmos/gui/dialogs/tlm_details_dialog.rb +10 -10
- data/lib/cosmos/gui/qt.rb +10 -1
- data/lib/cosmos/gui/qt_tool.rb +17 -10
- data/lib/cosmos/gui/text/ruby_editor.rb +47 -8
- data/lib/cosmos/gui/utilities/classification_banner.rb +60 -0
- data/lib/cosmos/gui/utilities/script_module_gui.rb +26 -0
- data/lib/cosmos/interfaces.rb +1 -0
- data/lib/cosmos/interfaces/interface.rb +4 -0
- data/lib/cosmos/interfaces/protocols/ignore_packet_protocol.rb +46 -0
- data/lib/cosmos/interfaces/protocols/preidentified_protocol.rb +68 -23
- data/lib/cosmos/packet_logs/packet_log_reader.rb +69 -26
- data/lib/cosmos/packet_logs/packet_log_writer.rb +13 -1
- data/lib/cosmos/packets/commands.rb +5 -1
- data/lib/cosmos/packets/packet.rb +36 -2
- data/lib/cosmos/packets/packet_config.rb +0 -1
- data/lib/cosmos/packets/parsers/format_string_parser.rb +0 -1
- data/lib/cosmos/packets/parsers/xtce_parser.rb +1 -1
- data/lib/cosmos/packets/telemetry.rb +4 -0
- data/lib/cosmos/script/api_shared.rb +2 -0
- data/lib/cosmos/script/limits.rb +4 -0
- data/lib/cosmos/script/script.rb +27 -11
- data/lib/cosmos/script/telemetry.rb +3 -1
- data/lib/cosmos/script/tools.rb +18 -8
- data/lib/cosmos/system/system.rb +21 -0
- data/lib/cosmos/tools/cmd_extractor/cmd_extractor.rb +26 -24
- data/lib/cosmos/tools/cmd_sender/cmd_sender.rb +29 -29
- data/lib/cosmos/tools/cmd_sequence/cmd_sequence.rb +65 -40
- data/lib/cosmos/tools/cmd_sequence/sequence_item.rb +6 -6
- data/lib/cosmos/tools/cmd_tlm_server/api.rb +13 -0
- data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb +12 -9
- data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_config.rb +7 -1
- data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_gui.rb +8 -8
- data/lib/cosmos/tools/cmd_tlm_server/commanding.rb +13 -2
- data/lib/cosmos/tools/cmd_tlm_server/gui/interfaces_tab.rb +2 -2
- data/lib/cosmos/tools/cmd_tlm_server/gui/logging_tab.rb +13 -13
- data/lib/cosmos/tools/cmd_tlm_server/gui/packets_tab.rb +4 -4
- data/lib/cosmos/tools/cmd_tlm_server/gui/status_tab.rb +8 -8
- data/lib/cosmos/tools/cmd_tlm_server/gui/targets_tab.rb +5 -5
- data/lib/cosmos/tools/cmd_tlm_server/interface_thread.rb +35 -20
- data/lib/cosmos/tools/cmd_tlm_server/replay_backend.rb +15 -11
- data/lib/cosmos/tools/config_editor/config_editor.rb +69 -69
- data/lib/cosmos/tools/data_viewer/data_viewer.rb +42 -38
- data/lib/cosmos/tools/data_viewer/data_viewer_component.rb +1 -0
- data/lib/cosmos/tools/data_viewer/dump_component.rb +1 -0
- data/lib/cosmos/tools/handbook_creator/handbook_creator.rb +4 -4
- data/lib/cosmos/tools/launcher/launcher.rb +1 -1
- data/lib/cosmos/tools/limits_monitor/limits_monitor.rb +28 -24
- data/lib/cosmos/tools/opengl_builder/opengl_builder.rb +42 -42
- data/lib/cosmos/tools/packet_viewer/packet_viewer.rb +56 -53
- data/lib/cosmos/tools/script_runner/script_runner.rb +112 -95
- data/lib/cosmos/tools/script_runner/script_runner_frame.rb +48 -30
- data/lib/cosmos/tools/table_manager/table_manager.rb +42 -42
- data/lib/cosmos/tools/test_runner/test_runner.rb +45 -27
- data/lib/cosmos/tools/test_runner/test_runner_chooser.rb +3 -3
- data/lib/cosmos/tools/tlm_extractor/tlm_extractor.rb +45 -45
- data/lib/cosmos/tools/tlm_extractor/tlm_extractor_config.rb +4 -4
- data/lib/cosmos/tools/tlm_grapher/data_object_adders/xy_data_object_adder.rb +3 -3
- data/lib/cosmos/tools/tlm_grapher/data_object_editors/housekeeping_data_object_editor.rb +7 -7
- data/lib/cosmos/tools/tlm_grapher/data_object_editors/xy_data_object_editor.rb +10 -10
- data/lib/cosmos/tools/tlm_grapher/data_objects/housekeeping_data_object.rb +10 -3
- data/lib/cosmos/tools/tlm_grapher/data_objects/xy_data_object.rb +6 -6
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots/overview_tabbed_plots.rb +14 -14
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_tool.rb +83 -83
- data/lib/cosmos/tools/tlm_viewer/screen.rb +73 -13
- data/lib/cosmos/tools/tlm_viewer/tlm_viewer.rb +15 -15
- data/lib/cosmos/tools/tlm_viewer/widgets.rb +1 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/canvasellipse_widget.rb +40 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/timegraph_widget.rb +1 -1
- data/lib/cosmos/tools/tlm_viewer/widgets/widget.rb +6 -1
- data/lib/cosmos/top_level.rb +14 -1
- data/lib/cosmos/version.rb +5 -5
- data/lib/cosmos/win32/excel.rb +63 -12
- data/make_gems.sh +10 -0
- data/spec/conversions/packet_time_formatted_conversion_spec.rb +58 -0
- data/spec/conversions/packet_time_seconds_conversion_spec.rb +60 -0
- data/spec/interfaces/protocols/ignore_packet_protocol_spec.rb +243 -0
- data/spec/interfaces/protocols/preidentified_protocol_spec.rb +227 -4
- data/spec/io/serial_driver_spec.rb +15 -13
- data/spec/packet_logs/packet_log_reader_spec.rb +72 -17
- data/spec/packets/packet_config_spec.rb +5 -16
- data/spec/packets/parsers/format_string_parser_spec.rb +0 -11
- data/spec/packets/parsers/macro_parser_spec.rb +36 -36
- data/spec/packets/parsers/state_parser_spec.rb +36 -0
- data/spec/packets/telemetry_spec.rb +11 -9
- data/spec/script/script_spec.rb +2 -3
- data/spec/script/scripting_spec.rb +2 -1
- data/spec/script/tools_spec.rb +0 -1
- data/spec/tools/cmd_tlm_server/api_spec.rb +28 -20
- data/spec/tools/cmd_tlm_server/cmd_tlm_server_config_spec.rb +33 -0
- data/spec/tools/cmd_tlm_server/commanding_spec.rb +25 -1
- data/spec/tools/cmd_tlm_server/interface_thread_spec.rb +15 -0
- data/tasks/gemfile_stats.rake +3 -2
- metadata +14 -2
data/ext/mkrf_conf.rb
CHANGED
|
@@ -26,9 +26,9 @@ end
|
|
|
26
26
|
inst = Gem::DependencyInstaller.new
|
|
27
27
|
begin
|
|
28
28
|
if RbConfig::CONFIG['target_os'] !~ /mswin|mingw|cygwin/i
|
|
29
|
-
unless gem_installed?("ruby-termios", "
|
|
29
|
+
unless gem_installed?("ruby-termios", ">= 0.9")
|
|
30
30
|
STDOUT.puts "Attempting to install ruby-termios... If this fails please manually \"gem install ruby-termios\" and try again."
|
|
31
|
-
inst.install "ruby-termios", "
|
|
31
|
+
inst.install "ruby-termios", ">= 0.9"
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
rescue
|
data/install/config/dart/Gemfile
CHANGED
data/install/config/data/crc.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"config/targets/SYSTEM/target.txt" 0x07E82776
|
|
3
3
|
"config/targets/SYSTEM/cmd_tlm/meta_tlm.txt" 0x07CDABCB
|
|
4
4
|
"config/data/README.txt" 0x93B2C07E
|
|
5
|
-
"config/system/system.txt"
|
|
5
|
+
"config/system/system.txt" 0x390C8677
|
|
6
6
|
"config/tools/launcher/launcher.txt" 0x6A3047DB
|
|
7
7
|
"config/tools/table_manager/README.txt" 0x93B2C07E
|
|
8
8
|
"config/tools/tlm_viewer/tlm_viewer.txt" 0xD9071527
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"config/tools/handbook_creator/default_toc.xsl" 0x4122A040
|
|
30
30
|
"config/tools/handbook_creator/handbook_creator.txt" 0x64E4B5CC
|
|
31
31
|
"config/tools/script_runner/script_runner.txt" 0x1EECD803
|
|
32
|
-
"config/dart/Gemfile"
|
|
32
|
+
"config/dart/Gemfile" 0xE089EDB7
|
|
33
33
|
"tools/TlmExtractor.bat" 0x2B98E027
|
|
34
34
|
"tools/Launcher" 0xFD4E356C
|
|
35
35
|
"tools/CmdSequence" 0x4A13C82C
|
|
@@ -9,18 +9,33 @@ LISTEN_HOST CTS_API 127.0.0.1
|
|
|
9
9
|
LISTEN_HOST TLMVIEWER_API 127.0.0.1
|
|
10
10
|
LISTEN_HOST CTS_PREIDENTIFIED 0.0.0.0 # 127.0.0.1 is more secure if you don't need external connections
|
|
11
11
|
LISTEN_HOST CTS_CMD_ROUTER 0.0.0.0 # 127.0.0.1 is more secure if you don't need external connections
|
|
12
|
+
LISTEN_HOST REPLAY_API 127.0.0.1
|
|
13
|
+
LISTEN_HOST REPLAY_PREIDENTIFIED 0.0.0.0 # 127.0.0.1 is more secure if you don't need external connections
|
|
14
|
+
LISTEN_HOST REPLAY_CMD_ROUTER 0.0.0.0 # 127.0.0.1 is more secure if you don't need external connections
|
|
15
|
+
LISTEN_HOST DART_STREAM 0.0.0.0 # 127.0.0.1 is more secure if you don't need external connections
|
|
16
|
+
LISTEN_HOST DART_DECOM 0.0.0.0 # 127.0.0.1 is more secure if you don't need external connections
|
|
12
17
|
|
|
13
18
|
# Connect Hosts - Ip addresses or hostnames to connect to when running the tools
|
|
14
19
|
CONNECT_HOST CTS_API 127.0.0.1
|
|
15
20
|
CONNECT_HOST TLMVIEWER_API 127.0.0.1
|
|
16
21
|
CONNECT_HOST CTS_PREIDENTIFIED 127.0.0.1
|
|
17
22
|
CONNECT_HOST CTS_CMD_ROUTER 127.0.0.1
|
|
23
|
+
CONNECT_HOST REPLAY_API 127.0.0.1
|
|
24
|
+
CONNECT_HOST REPLAY_PREIDENTIFIED 127.0.0.1
|
|
25
|
+
CONNECT_HOST REPLAY_CMD_ROUTER 127.0.0.1
|
|
26
|
+
CONNECT_HOST DART_STREAM 127.0.0.1
|
|
27
|
+
CONNECT_HOST DART_DECOM 127.0.0.1
|
|
18
28
|
|
|
19
29
|
# Ethernet Ports
|
|
20
30
|
PORT CTS_API 7777
|
|
21
31
|
PORT TLMVIEWER_API 7778
|
|
22
32
|
PORT CTS_PREIDENTIFIED 7779
|
|
23
33
|
PORT CTS_CMD_ROUTER 7780
|
|
34
|
+
PORT REPLAY_API 7877
|
|
35
|
+
PORT REPLAY_PREIDENTIFIED 7879
|
|
36
|
+
PORT REPLAY_CMD_ROUTER 7880
|
|
37
|
+
PORT DART_STREAM 8777
|
|
38
|
+
PORT DART_DECOM 8779
|
|
24
39
|
|
|
25
40
|
# Default Packet Log Writer and Reader
|
|
26
41
|
DEFAULT_PACKET_LOG_WRITER packet_log_writer.rb
|
|
@@ -33,10 +48,17 @@ PATH SAVED_CONFIG ./outputs/saved_config
|
|
|
33
48
|
PATH TABLES ./outputs/tables
|
|
34
49
|
PATH HANDBOOKS ./outputs/handbooks
|
|
35
50
|
PATH PROCEDURES ./procedures
|
|
51
|
+
PATH SEQUENCES ./outputs/sequences
|
|
52
|
+
PATH DART_DATA ./outputs/dart/data
|
|
53
|
+
PATH DART_LOGS ./outputs/dart/logs
|
|
36
54
|
|
|
55
|
+
ALLOW_ACCESS ALL
|
|
56
|
+
|
|
57
|
+
# ENABLE_SOUND
|
|
37
58
|
# DISABLE_DNS
|
|
59
|
+
# STALENESS_SECONDS 30
|
|
38
60
|
|
|
39
61
|
# Initialize the metadata dialog using values from the following file:
|
|
40
62
|
# META_INIT config/data/meta_init.txt
|
|
41
63
|
|
|
42
|
-
|
|
64
|
+
# ADD_MD5_FILE lib/user_version.rb
|
data/lib/cosmos/conversions.rb
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
require 'cosmos/conversions/conversion'
|
|
4
4
|
require 'cosmos/conversions/generic_conversion'
|
|
5
5
|
require 'cosmos/conversions/new_packet_log_conversion'
|
|
6
|
+
require 'cosmos/conversions/packet_time_formatted_conversion'
|
|
7
|
+
require 'cosmos/conversions/packet_time_seconds_conversion'
|
|
6
8
|
require 'cosmos/conversions/polynomial_conversion'
|
|
7
9
|
require 'cosmos/conversions/processor_conversion'
|
|
8
10
|
require 'cosmos/conversions/received_count_conversion'
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# encoding: ascii-8bit
|
|
2
|
+
|
|
3
|
+
# Copyright 2018 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 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
|
+
require 'cosmos/conversions/conversion'
|
|
12
|
+
|
|
13
|
+
module Cosmos
|
|
14
|
+
|
|
15
|
+
# Converts the packet received time object into a formatted string.
|
|
16
|
+
class PacketTimeFormattedConversion < Conversion
|
|
17
|
+
|
|
18
|
+
# Initializes converted_type to :STRING and converted_bit_size to 0
|
|
19
|
+
def initialize
|
|
20
|
+
super()
|
|
21
|
+
@converted_type = :STRING
|
|
22
|
+
@converted_bit_size = 0
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# @param (see Conversion#call)
|
|
26
|
+
# @return [String] Formatted packet time
|
|
27
|
+
def call(value, packet, buffer)
|
|
28
|
+
packet_time = packet.packet_time
|
|
29
|
+
if packet_time
|
|
30
|
+
return packet_time.formatted
|
|
31
|
+
else
|
|
32
|
+
return 'No Packet Time'
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
end # class PacketTimeFormattedConversion
|
|
37
|
+
|
|
38
|
+
end # module Cosmos
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# encoding: ascii-8bit
|
|
2
|
+
|
|
3
|
+
# Copyright 2018 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 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
|
+
require 'cosmos/conversions/conversion'
|
|
12
|
+
|
|
13
|
+
module Cosmos
|
|
14
|
+
|
|
15
|
+
# Converts the packet received time into floating point seconds.
|
|
16
|
+
class PacketTimeSecondsConversion < Conversion
|
|
17
|
+
|
|
18
|
+
# Initializes converted_type to :FLOAT and converted_bit_size to 64
|
|
19
|
+
def initialize
|
|
20
|
+
super()
|
|
21
|
+
@converted_type = :FLOAT
|
|
22
|
+
@converted_bit_size = 64
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# @param (see Conversion#call)
|
|
26
|
+
# @return [Float] Packet received time in seconds
|
|
27
|
+
def call(value, packet, buffer)
|
|
28
|
+
packet_time = packet.packet_time
|
|
29
|
+
if packet_time
|
|
30
|
+
return packet_time.to_f
|
|
31
|
+
else
|
|
32
|
+
return 0.0
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
end # class PacketTimeSecondsConversion
|
|
37
|
+
|
|
38
|
+
end # module Cosmos
|
|
@@ -27,7 +27,7 @@ module CosmosIO
|
|
|
27
27
|
#
|
|
28
28
|
# @param length_num_bytes [Integer] Number of bytes in the length field
|
|
29
29
|
# @return [String] A String of "length field" number of bytes
|
|
30
|
-
def read_length_bytes(length_num_bytes)
|
|
30
|
+
def read_length_bytes(length_num_bytes, max_read_size = nil)
|
|
31
31
|
return nil unless (length_num_bytes == 1) || (length_num_bytes == 2) or (length_num_bytes == 4)
|
|
32
32
|
|
|
33
33
|
# Read bytes for string length
|
|
@@ -36,6 +36,7 @@ module CosmosIO
|
|
|
36
36
|
string_length = Cosmos::BinaryAccessor.read(0, length_num_bytes * 8, :UINT, temp_string_length, :BIG_ENDIAN)
|
|
37
37
|
|
|
38
38
|
# Read String
|
|
39
|
+
return nil if max_read_size and string_length > max_read_size
|
|
39
40
|
string = self.read(string_length)
|
|
40
41
|
return nil if (string.nil?) || (string.length != string_length)
|
|
41
42
|
return string
|
data/lib/cosmos/dart/Gemfile
CHANGED
|
@@ -59,7 +59,7 @@ gem 'childprocess'
|
|
|
59
59
|
if RUBY_ENGINE == 'ruby'
|
|
60
60
|
gem 'pg', '~> 0.21'
|
|
61
61
|
else
|
|
62
|
-
gem 'activerecord-jdbcpostgresql-adapter',
|
|
62
|
+
gem 'activerecord-jdbcpostgresql-adapter', '~> 51.1'
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
if ENV['COSMOS_DEVEL']
|
|
@@ -30,8 +30,8 @@ request['meta_filters'] = ["OPERATOR_NAME == 'Unspecified'"]
|
|
|
30
30
|
request_packet.write('REQUEST', JSON.dump(request))
|
|
31
31
|
|
|
32
32
|
interface = Cosmos::TcpipClientInterface.new(
|
|
33
|
-
Cosmos::System.connect_hosts['DART_STREAM'],
|
|
34
|
-
Cosmos::System.ports['DART_STREAM'],
|
|
33
|
+
Cosmos::System.connect_hosts['DART_STREAM'],
|
|
34
|
+
Cosmos::System.ports['DART_STREAM'],
|
|
35
35
|
Cosmos::System.ports['DART_STREAM'],
|
|
36
36
|
10, 10, 'PREIDENTIFIED')
|
|
37
37
|
puts "Connecting to Dart Stream Server..."
|
|
@@ -70,10 +70,14 @@ while true
|
|
|
70
70
|
|
|
71
71
|
if identified_packet
|
|
72
72
|
identified_packet.received_time = packet.received_time
|
|
73
|
+
identified_packet.stored = packet.stored
|
|
74
|
+
identified_packet.extra = packet.extra
|
|
73
75
|
packet = identified_packet
|
|
74
76
|
else
|
|
75
77
|
unknown_packet = Cosmos::System.telemetry.update!('UNKNOWN', 'UNKNOWN', packet.buffer)
|
|
76
78
|
unknown_packet.received_time = packet.received_time
|
|
79
|
+
unknown_packet.stored = packet.stored
|
|
80
|
+
unknown_packet.extra = packet.extra
|
|
77
81
|
packet = unknown_packet
|
|
78
82
|
data_length = packet.length
|
|
79
83
|
string = "#{@interface.name} - Unknown #{data_length} byte packet starting: "
|
|
@@ -271,7 +271,7 @@ module DartCommon
|
|
|
271
271
|
# @return [ActiveRecord] PacketLogEntry ActiveRecord object
|
|
272
272
|
def find_packet_log_entry(packet, is_tlm)
|
|
273
273
|
target_id, packet_id = lookup_target_and_packet_id(packet.target_name, packet.packet_name, is_tlm)
|
|
274
|
-
return PacketLogEntry.where("target_id = ? and packet_id = ? and is_tlm = ? and time = ?", target_id, packet_id, is_tlm, packet.
|
|
274
|
+
return PacketLogEntry.where("target_id = ? and packet_id = ? and is_tlm = ? and time = ?", target_id, packet_id, is_tlm, packet.packet_time).first
|
|
275
275
|
end
|
|
276
276
|
|
|
277
277
|
# Read a Packet from the binary file by using the PacketLogEntry
|
|
@@ -48,8 +48,8 @@ class DartDatabaseCleaner
|
|
|
48
48
|
begin
|
|
49
49
|
first_packet = reader.first
|
|
50
50
|
last_packet = reader.last
|
|
51
|
-
start_time = first_packet.
|
|
52
|
-
end_time = last_packet.
|
|
51
|
+
start_time = first_packet.packet_time
|
|
52
|
+
end_time = last_packet.packet_time
|
|
53
53
|
rescue
|
|
54
54
|
if size == Cosmos::PacketLogReader::COSMOS2_HEADER_LENGTH or size == 0
|
|
55
55
|
Cosmos::Logger::error("File contains no packets: #{filename}")
|
|
@@ -239,12 +239,12 @@ class DartDecommutator
|
|
|
239
239
|
|
|
240
240
|
def decom_packet(ple, packet, packet_config)
|
|
241
241
|
# Update packet config times
|
|
242
|
-
if !packet_config.start_time or (packet.
|
|
243
|
-
packet_config.start_time = packet.
|
|
242
|
+
if !packet_config.start_time or (packet.packet_time < packet_config.start_time)
|
|
243
|
+
packet_config.start_time = packet.packet_time
|
|
244
244
|
packet_config.save!
|
|
245
245
|
end
|
|
246
|
-
if !packet_config.end_time or (packet.
|
|
247
|
-
packet_config.end_time = packet.
|
|
246
|
+
if !packet_config.end_time or (packet.packet_time > packet_config.end_time)
|
|
247
|
+
packet_config.end_time = packet.packet_time
|
|
248
248
|
packet_config.save!
|
|
249
249
|
end
|
|
250
250
|
|
|
@@ -80,7 +80,7 @@ class DartImporter
|
|
|
80
80
|
Cosmos::Logger.info("First and Last Packet in File not in database")
|
|
81
81
|
|
|
82
82
|
# Check if time range of packets is not present in database
|
|
83
|
-
ple = PacketLogEntry.where("time >= ? and time <= ?", first_packet.
|
|
83
|
+
ple = PacketLogEntry.where("time >= ? and time <= ?", first_packet.packet_time, last_packet.packet_time).first
|
|
84
84
|
if !ple # Can go fast if not present at all
|
|
85
85
|
Cosmos::Logger.info(" Fast Import Enabled...")
|
|
86
86
|
fast = true
|
|
@@ -134,7 +134,7 @@ class DartImporter
|
|
|
134
134
|
ple = PacketLogEntry.new
|
|
135
135
|
ple.target_id = target_id
|
|
136
136
|
ple.packet_id = packet_id
|
|
137
|
-
ple.time = packet.
|
|
137
|
+
ple.time = packet.packet_time
|
|
138
138
|
ple.packet_log_id = packet_log.id
|
|
139
139
|
ple.data_offset = data_offset
|
|
140
140
|
ple.meta_id = meta_id
|
|
@@ -149,7 +149,7 @@ class DartImporter
|
|
|
149
149
|
ple.save!(validate: false)
|
|
150
150
|
else
|
|
151
151
|
ple_data << "," if ple_data.length > 0
|
|
152
|
-
ple_data << "(#{target_id},#{packet_id},'#{packet.
|
|
152
|
+
ple_data << "(#{target_id},#{packet_id},'#{packet.packet_time.dup.utc.iso8601(6)}',#{packet_log.id},#{data_offset},#{meta_id},#{is_tlm},true)"
|
|
153
153
|
ple_data_count += 1
|
|
154
154
|
end
|
|
155
155
|
|
|
@@ -114,7 +114,7 @@ class DartPacketLogWriter < Cosmos::PacketLogWriter
|
|
|
114
114
|
ple = PacketLogEntry.new
|
|
115
115
|
ple.target_id = target_id
|
|
116
116
|
ple.packet_id = packet_id
|
|
117
|
-
ple.time = packet.
|
|
117
|
+
ple.time = packet.packet_time
|
|
118
118
|
ple.packet_log_id = @packet_log_id
|
|
119
119
|
ple.data_offset = @file_size
|
|
120
120
|
ple.meta_id = @meta_id
|
|
@@ -134,7 +134,7 @@ class DartPacketLogWriter < Cosmos::PacketLogWriter
|
|
|
134
134
|
@sync_count = 0
|
|
135
135
|
end
|
|
136
136
|
@ple_data << "," if @ple_data.length > 0
|
|
137
|
-
@ple_data << "(#{target_id},#{packet_id},'#{packet.
|
|
137
|
+
@ple_data << "(#{target_id},#{packet_id},'#{packet.packet_time.dup.utc.iso8601(6)}',#{@packet_log_id},#{@file_size},#{@meta_id},#{@is_tlm},true)"
|
|
138
138
|
end
|
|
139
139
|
end
|
|
140
140
|
|
|
@@ -25,6 +25,8 @@ class DartInterfaceThread < Cosmos::InterfaceThread
|
|
|
25
25
|
# Update Current Value Table Used By Packet Log Writer
|
|
26
26
|
cvt_packet = Cosmos::System.telemetry.update!(packet.target_name, packet.packet_name, packet.buffer)
|
|
27
27
|
cvt_packet.received_time = packet.received_time
|
|
28
|
+
cvt_packet.stored = packet.stored
|
|
29
|
+
cvt_packet.extra = packet.extra
|
|
28
30
|
@packet_log_writer.start
|
|
29
31
|
@packet_log_writer.write(cvt_packet)
|
|
30
32
|
else
|
|
@@ -91,8 +91,8 @@ Cosmos.catch_fatal_exception do
|
|
|
91
91
|
begin
|
|
92
92
|
first_packet = reader.first
|
|
93
93
|
last_packet = reader.last
|
|
94
|
-
start_time = first_packet.
|
|
95
|
-
end_time = last_packet.
|
|
94
|
+
start_time = first_packet.packet_time.formatted
|
|
95
|
+
end_time = last_packet.packet_time.formatted
|
|
96
96
|
rescue
|
|
97
97
|
if size == 128 or size == 0
|
|
98
98
|
start_time = "EMPTY "
|
|
@@ -124,8 +124,8 @@ Cosmos.catch_fatal_exception do
|
|
|
124
124
|
begin
|
|
125
125
|
first_packet = reader.first
|
|
126
126
|
last_packet = reader.last
|
|
127
|
-
start_time = first_packet.
|
|
128
|
-
end_time = last_packet.
|
|
127
|
+
start_time = first_packet.packet_time.formatted
|
|
128
|
+
end_time = last_packet.packet_time.formatted
|
|
129
129
|
rescue
|
|
130
130
|
if size == 128 or size == 0
|
|
131
131
|
start_time = "EMPTY "
|
|
@@ -29,9 +29,9 @@ describe DartReducerManager do
|
|
|
29
29
|
meta = Cosmos::System.telemetry.packet("SYSTEM", "META")
|
|
30
30
|
meta.received_time = time
|
|
31
31
|
hs_packet = Cosmos::System.telemetry.packet("INST", "HEALTH_STATUS")
|
|
32
|
-
# 128 byte file header, SYSTEM META has
|
|
33
|
-
# INST HEALTH_STATUS has
|
|
34
|
-
length = 128 +
|
|
32
|
+
# 128 byte file header, SYSTEM META has 15 byte header + length of SYSTEM & META
|
|
33
|
+
# INST HEALTH_STATUS has 15 byte header + length of INST & HEALTH_STATUS
|
|
34
|
+
length = 128 + 25 + meta.length + entries * (32 + hs_packet.length)
|
|
35
35
|
|
|
36
36
|
writer = DartPacketLogWriter.new(
|
|
37
37
|
:TLM, # Log telemetry
|
|
@@ -59,14 +59,16 @@ module Cosmos
|
|
|
59
59
|
top_layout = Qt::HBoxLayout.new
|
|
60
60
|
text_layout = Qt::VBoxLayout.new
|
|
61
61
|
|
|
62
|
-
title_label = Qt::Label.new(
|
|
62
|
+
title_label = Qt::Label.new(title)
|
|
63
63
|
text_layout.addWidget(title_label)
|
|
64
|
-
@packet_time = Qt::Label.new("Packet
|
|
64
|
+
@packet_time = Qt::Label.new("Packet Time: ")
|
|
65
65
|
text_layout.addWidget(@packet_time)
|
|
66
|
+
@received_time = Qt::Label.new("Received Time: ")
|
|
67
|
+
text_layout.addWidget(@received_time)
|
|
66
68
|
top_layout.addLayout(text_layout)
|
|
67
69
|
top_layout.addStretch(1)
|
|
68
70
|
|
|
69
|
-
button = Qt::PushButton.new(
|
|
71
|
+
button = Qt::PushButton.new("Pause")
|
|
70
72
|
top_layout.addWidget(button)
|
|
71
73
|
button.connect(SIGNAL('clicked()')) do
|
|
72
74
|
if button.text == "Pause"
|
|
@@ -113,8 +115,10 @@ module Cosmos
|
|
|
113
115
|
packet = System.telemetry.packet(@target_name, @packet_name)
|
|
114
116
|
end
|
|
115
117
|
packet_data = packet.buffer
|
|
116
|
-
packet_time = packet.
|
|
117
|
-
@packet_time.setText("
|
|
118
|
+
packet_time = packet.packet_time
|
|
119
|
+
@packet_time.setText("Packet Time: #{packet_time.formatted}") if packet_time
|
|
120
|
+
received_time = packet.received_time
|
|
121
|
+
@received_time.setText("Received Time: #{received_time.formatted}") if received_time
|
|
118
122
|
position_x = @packet_data.horizontalScrollBar.value
|
|
119
123
|
position_y = @packet_data.verticalScrollBar.value
|
|
120
124
|
@packet_data.setPlainText(HEADER + packet_data.formatted)
|
|
@@ -41,51 +41,51 @@ module Cosmos
|
|
|
41
41
|
# Creates and populates the layout for the dialog
|
|
42
42
|
def build_details_layout(item, cmd_tlm)
|
|
43
43
|
details_layout = Qt::FormLayout.new
|
|
44
|
-
details_layout.addRow("Bit Offset:", Qt::Label.new(
|
|
45
|
-
details_layout.addRow("Bit Size:", Qt::Label.new(
|
|
46
|
-
details_layout.addRow("Data Type:", Qt::Label.new(
|
|
47
|
-
details_layout.addRow("Array Size:", Qt::Label.new(
|
|
44
|
+
details_layout.addRow("Bit Offset:", Qt::Label.new("#{show_nil(item.bit_offset)}"))
|
|
45
|
+
details_layout.addRow("Bit Size:", Qt::Label.new("#{show_nil(item.bit_size)}"))
|
|
46
|
+
details_layout.addRow("Data Type:", Qt::Label.new("#{show_data_type(item.data_type)}"))
|
|
47
|
+
details_layout.addRow("Array Size:", Qt::Label.new("#{show_nil(item.array_size)}"))
|
|
48
48
|
if cmd_tlm == :CMD
|
|
49
49
|
if item.range
|
|
50
|
-
details_layout.addRow("Minimum:", Qt::Label.new(
|
|
51
|
-
details_layout.addRow("Maximum:", Qt::Label.new(
|
|
50
|
+
details_layout.addRow("Minimum:", Qt::Label.new(item.range.first.to_s))
|
|
51
|
+
details_layout.addRow("Maximum:", Qt::Label.new(item.range.last.to_s))
|
|
52
52
|
end
|
|
53
|
-
details_layout.addRow("Default:", Qt::Label.new(
|
|
53
|
+
details_layout.addRow("Default:", Qt::Label.new("#{show_nil(item.default)}")) if item.default
|
|
54
54
|
end
|
|
55
|
-
details_layout.addRow("Format String:", Qt::Label.new(
|
|
56
|
-
details_layout.addRow("Read_Conversion:", Qt::Label.new(
|
|
57
|
-
details_layout.addRow("Write_Conversion:", Qt::Label.new(
|
|
58
|
-
details_layout.addRow("Id Value:", Qt::Label.new(
|
|
59
|
-
details_layout.addRow("Description:", Qt::Label.new(
|
|
60
|
-
details_layout.addRow("Units Full:", Qt::Label.new(
|
|
61
|
-
details_layout.addRow("Units Abbreviation:", Qt::Label.new(
|
|
62
|
-
details_layout.addRow("Endianness:", Qt::Label.new(
|
|
55
|
+
details_layout.addRow("Format String:", Qt::Label.new("#{show_nil(item.format_string)}"))
|
|
56
|
+
details_layout.addRow("Read_Conversion:", Qt::Label.new("#{show_conversion(item.read_conversion)}"))
|
|
57
|
+
details_layout.addRow("Write_Conversion:", Qt::Label.new("#{show_conversion(item.write_conversion)}"))
|
|
58
|
+
details_layout.addRow("Id Value:", Qt::Label.new("#{show_nil(item.id_value)}"))
|
|
59
|
+
details_layout.addRow("Description:", Qt::Label.new("#{show_nil(item.description)}"))
|
|
60
|
+
details_layout.addRow("Units Full:", Qt::Label.new("#{show_nil(item.units_full)}"))
|
|
61
|
+
details_layout.addRow("Units Abbreviation:", Qt::Label.new("#{show_nil(item.units)}"))
|
|
62
|
+
details_layout.addRow("Endianness:", Qt::Label.new("#{show_endianness(item.endianness)}"))
|
|
63
63
|
if item.states
|
|
64
64
|
details_layout.addRow(build_states_details(item))
|
|
65
65
|
else
|
|
66
|
-
details_layout.addRow("States:", Qt::Label.new(
|
|
66
|
+
details_layout.addRow("States:", Qt::Label.new("None"))
|
|
67
67
|
end
|
|
68
68
|
if cmd_tlm == :CMD
|
|
69
|
-
details_layout.addRow("Required:", Qt::Label.new(
|
|
69
|
+
details_layout.addRow("Required:", Qt::Label.new(item.required.to_s))
|
|
70
70
|
else
|
|
71
71
|
limits = item.limits.values
|
|
72
72
|
if limits
|
|
73
73
|
details_layout.addRow(build_limits_details(limits))
|
|
74
74
|
else
|
|
75
|
-
details_layout.addRow(
|
|
75
|
+
details_layout.addRow("Limits:", Qt::Label.new("None"))
|
|
76
76
|
end
|
|
77
77
|
if limits || item.state_colors
|
|
78
|
-
details_layout.addRow(
|
|
78
|
+
details_layout.addRow("Limits Checking Enabled:", Qt::Label.new("#{show_nil(item.limits.enabled)}"))
|
|
79
79
|
end
|
|
80
80
|
if limits
|
|
81
|
-
details_layout.addRow(
|
|
82
|
-
details_layout.addRow(
|
|
81
|
+
details_layout.addRow("Limits Persistence Setting:", Qt::Label.new("#{show_nil(item.limits.persistence_setting)}"))
|
|
82
|
+
details_layout.addRow("Limits Persistence Count:", Qt::Label.new("#{show_nil(item.limits.persistence_count)}"))
|
|
83
83
|
end
|
|
84
84
|
if item.meta.empty?
|
|
85
|
-
details_layout.addRow(
|
|
85
|
+
details_layout.addRow("Meta:", Qt::Label.new("None"))
|
|
86
86
|
else
|
|
87
87
|
item.meta.each do |key, value|
|
|
88
|
-
details_layout.addRow(
|
|
88
|
+
details_layout.addRow("Meta[#{key}]:", Qt::Label.new(value.to_s))
|
|
89
89
|
end
|
|
90
90
|
end
|
|
91
91
|
end
|
|
@@ -94,7 +94,7 @@ module Cosmos
|
|
|
94
94
|
|
|
95
95
|
# Create the states details layout
|
|
96
96
|
def build_states_details(item)
|
|
97
|
-
states_details = Qt::GroupBox.new(
|
|
97
|
+
states_details = Qt::GroupBox.new("States")
|
|
98
98
|
scroll_layout = Qt::VBoxLayout.new
|
|
99
99
|
states_details.setLayout(scroll_layout)
|
|
100
100
|
scroll_area = Qt::ScrollArea.new
|
|
@@ -104,11 +104,11 @@ module Cosmos
|
|
|
104
104
|
scroll_area.setWidget(scroll_widget)
|
|
105
105
|
states_layout = Qt::FormLayout.new
|
|
106
106
|
scroll_widget.setLayout(states_layout)
|
|
107
|
-
item.states.sort {|a, b| a[1] <=> b[1]}.each do |state_name, state_value|
|
|
107
|
+
item.states.sort {|a, b| a[1].to_i <=> b[1].to_i }.each do |state_name, state_value|
|
|
108
108
|
if item.state_colors
|
|
109
|
-
states_layout.addRow(
|
|
109
|
+
states_layout.addRow("#{state_name}:", Qt::Label.new("#{state_value} #{item.state_colors[state_name]}"))
|
|
110
110
|
else
|
|
111
|
-
states_layout.addRow(
|
|
111
|
+
states_layout.addRow("#{state_name}:", Qt::Label.new("#{state_value}"))
|
|
112
112
|
end
|
|
113
113
|
end
|
|
114
114
|
# Figure out the how big the states layout wants to be and set the
|
|
@@ -124,7 +124,7 @@ module Cosmos
|
|
|
124
124
|
|
|
125
125
|
# Create the limits details layout
|
|
126
126
|
def build_limits_details(limits)
|
|
127
|
-
limits_details = Qt::GroupBox.new(
|
|
127
|
+
limits_details = Qt::GroupBox.new("Limits")
|
|
128
128
|
@limits_layout = Qt::FormLayout.new
|
|
129
129
|
limits.each do |limits_set_name, limits_settings|
|
|
130
130
|
if limits_settings[4] && limits_settings[5]
|
|
@@ -133,7 +133,7 @@ module Cosmos
|
|
|
133
133
|
label = Qt::Label.new("RL/#{limits_settings[0]} YL/#{limits_settings[1]} YH/#{limits_settings[2]} RH/#{limits_settings[3]}")
|
|
134
134
|
end
|
|
135
135
|
@limits_labels[limits_set_name] = label
|
|
136
|
-
@limits_layout.addRow(
|
|
136
|
+
@limits_layout.addRow("#{limits_set_name}:", label)
|
|
137
137
|
end
|
|
138
138
|
limits_details.setLayout(@limits_layout)
|
|
139
139
|
limits_details
|