cosmos 3.7.0 → 3.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9112201f45a7327cc5ce26c21e5bf83dc00ae783
4
- data.tar.gz: ea97aee7b5c6b97d17e5161d6cce2565bed64f1e
3
+ metadata.gz: c3f5a1496a25bb28da92ceaddead81d9e659321d
4
+ data.tar.gz: a8f420d4b7285c87a61ef5823b49a1188581bf33
5
5
  SHA512:
6
- metadata.gz: 080bfbf420c3c831b7dea10289633b289c2e116ed368bac38fcc70d89845709631f55ac39c439c335ef2f972ade3819d4b081ef04378b120b45145511f0d699a
7
- data.tar.gz: 55b8c3ff623c95b3411785234ac36aa925820635c891e023accfd6edca90d6a5fd1b80516744842c1efbcee54371a49db69829bc39ec7895e2d0e53a4ba76a13
6
+ metadata.gz: 1ada5c833b4b5b21aafa6ea8f1d8c480bf741572ae8975176e0c66b35e987edfdb7238ec63a974fc57452c706e7e866cc672c51fd94c626ebed9a8373efe2520
7
+ data.tar.gz: 29a5d34e0ff1e63d0578773ba4448d1c8085afce85fedcdd442f87dad39117a986b6fb0e862800631f1941d0c92d10a51b2ba85128fdb53376de340c470be11f
@@ -774,6 +774,7 @@ lib/cosmos/gui/choosers/float_chooser.rb
774
774
  lib/cosmos/gui/choosers/integer_chooser.rb
775
775
  lib/cosmos/gui/choosers/string_chooser.rb
776
776
  lib/cosmos/gui/choosers/telemetry_chooser.rb
777
+ lib/cosmos/gui/choosers/value_chooser.rb
777
778
  lib/cosmos/gui/dialogs/about_dialog.rb
778
779
  lib/cosmos/gui/dialogs/calendar_dialog.rb
779
780
  lib/cosmos/gui/dialogs/cmd_details_dialog.rb
@@ -1213,6 +1214,7 @@ spec/utilities/logger_spec.rb
1213
1214
  spec/utilities/message_log_spec.rb
1214
1215
  spec/utilities/quaternion_spec.rb
1215
1216
  spec/utilities/ruby_lex_utils_spec.rb
1217
+ tasks/gemfile_stats.rake
1216
1218
  tasks/manifest.rake
1217
1219
  tasks/spec.rake
1218
1220
  test/benchmarks/binary_accessor_benchmark.rb
data/Rakefile CHANGED
@@ -73,6 +73,7 @@ require 'yard'
73
73
  # Import the rake tasks
74
74
  import 'tasks/manifest.rake'
75
75
  import 'tasks/spec.rake'
76
+ import 'tasks/gemfile_stats.rake'
76
77
 
77
78
  # Update the built in task dependencies
78
79
  task :default => [:spec] # :test
@@ -6,10 +6,10 @@
6
6
  "lib/cosmos/win32/win32.rb" 0xEF748B06
7
7
  "lib/cosmos/win32/excel.rb" 0xB4D4195E
8
8
  "lib/cosmos/conversions/received_time_formatted_conversion.rb" 0xDC6ED414
9
- "lib/cosmos/conversions/unix_time_conversion.rb" 0xCDE826AB
9
+ "lib/cosmos/conversions/unix_time_conversion.rb" 0x8F44C709
10
10
  "lib/cosmos/conversions/received_time_seconds_conversion.rb" 0x414E5121
11
- "lib/cosmos/conversions/new_packet_log_conversion.rb" 0x1E9D20F4
12
- "lib/cosmos/conversions/segmented_polynomial_conversion.rb" 0x5B2D3E02
11
+ "lib/cosmos/conversions/new_packet_log_conversion.rb" 0x4F123D72
12
+ "lib/cosmos/conversions/segmented_polynomial_conversion.rb" 0x1ADFA966
13
13
  "lib/cosmos/conversions/processor_conversion.rb" 0x07562BEB
14
14
  "lib/cosmos/conversions/unix_time_seconds_conversion.rb" 0x64C40BC3
15
15
  "lib/cosmos/conversions/conversion.rb" 0x9179ED6E
@@ -83,12 +83,13 @@
83
83
  "lib/cosmos/gui/opengl/texture_mapped_sphere.rb" 0x12D03C0E
84
84
  "lib/cosmos/gui/opengl/gl_viewport.rb" 0x49CAD811
85
85
  "lib/cosmos/gui/opengl/opengl.rb" 0xBE4A454D
86
- "lib/cosmos/gui/choosers/integer_chooser.rb" 0x0CCB26E3
86
+ "lib/cosmos/gui/choosers/integer_chooser.rb" 0xFEA2E26F
87
87
  "lib/cosmos/gui/choosers/string_chooser.rb" 0x0A60837D
88
88
  "lib/cosmos/gui/choosers/file_chooser.rb" 0x575A4333
89
+ "lib/cosmos/gui/choosers/value_chooser.rb" 0x4F652711
89
90
  "lib/cosmos/gui/choosers/telemetry_chooser.rb" 0x26375593
90
91
  "lib/cosmos/gui/choosers/combobox_chooser.rb" 0xAD5383D5
91
- "lib/cosmos/gui/choosers/float_chooser.rb" 0x23B2FA77
92
+ "lib/cosmos/gui/choosers/float_chooser.rb" 0x93957577
92
93
  "lib/cosmos/tools/script_runner/script_runner_config.rb" 0x1E46E8AA
93
94
  "lib/cosmos/tools/script_runner/script_runner_frame.rb" 0x6FEE12DB
94
95
  "lib/cosmos/tools/script_runner/script_runner.rb" 0x0CC0CBB4
@@ -158,7 +159,7 @@
158
159
  "lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_tab.rb" 0xD0AC7888
159
160
  "lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_config.rb" 0x08E6FA35
160
161
  "lib/cosmos/tools/tlm_grapher/tlm_grapher.rb" 0xBBFC2272
161
- "lib/cosmos/tools/tlm_grapher/tabbed_plots/overview_tabbed_plots.rb" 0xB0994B7A
162
+ "lib/cosmos/tools/tlm_grapher/tabbed_plots/overview_tabbed_plots.rb" 0x91434E6C
162
163
  "lib/cosmos/tools/tlm_grapher/plot_editors/plot_editor.rb" 0x0C92BBB8
163
164
  "lib/cosmos/tools/tlm_grapher/plot_editors/xy_plot_editor.rb" 0x724D9469
164
165
  "lib/cosmos/tools/tlm_grapher/plot_editors/singlexy_plot_editor.rb" 0xA9B7CD4C
@@ -243,7 +244,7 @@
243
244
  "lib/cosmos/tools/tlm_viewer/tlm_viewer.rb" 0x895983E9
244
245
  "lib/cosmos/system.rb" 0x735DFB42
245
246
  "lib/cosmos/conversions.rb" 0x43679D05
246
- "lib/cosmos/version.rb" 0x1B3425B3
247
+ "lib/cosmos/version.rb" 0x76ED4796
247
248
  "lib/cosmos/core_ext.rb" 0x1951B346
248
249
  "lib/cosmos/interfaces.rb" 0x7E3EA326
249
250
  "lib/cosmos/processors.rb" 0x5241327D
@@ -264,7 +265,7 @@
264
265
  "lib/cosmos/packets/limits.rb" 0x9758BB50
265
266
  "lib/cosmos/packets/limits_response.rb" 0x9C5E8444
266
267
  "lib/cosmos/packets/commands.rb" 0x1A33428E
267
- "lib/cosmos/packets/structure.rb" 0xC8524C43
268
+ "lib/cosmos/packets/structure.rb" 0x85F4F979
268
269
  "lib/cosmos/packets/telemetry.rb" 0x83D17863
269
270
  "lib/cosmos/packets/parsers/format_string_parser.rb" 0x8015C5E3
270
271
  "lib/cosmos/packets/parsers/packet_parser.rb" 0xEA0AF2C6
@@ -272,7 +273,7 @@
272
273
  "lib/cosmos/packets/parsers/processor_parser.rb" 0xEC75BA88
273
274
  "lib/cosmos/packets/parsers/limits_parser.rb" 0xFCFB27D0
274
275
  "lib/cosmos/packets/parsers/state_parser.rb" 0xCA3BFDFC
275
- "lib/cosmos/packets/parsers/macro_parser.rb" 0x4CC8096D
276
+ "lib/cosmos/packets/parsers/macro_parser.rb" 0xE58A53CB
276
277
  "lib/cosmos/packets/parsers/limits_response_parser.rb" 0x05979119
277
278
  "lib/cosmos/packets/packet_config.rb" 0x37D677AC
278
279
  "lib/cosmos/packets/binary_accessor.rb" 0x7D41D474
@@ -306,7 +307,7 @@
306
307
  "lib/cosmos/interfaces/simulated_target_interface.rb" 0x15DC496F
307
308
  "lib/cosmos/interfaces/serial_interface.rb" 0xC376DDA0
308
309
  "lib/cosmos/interfaces/tcpip_client_interface.rb" 0x5F0DB50D
309
- "lib/cosmos/interfaces/udp_interface.rb" 0x99C0D354
310
+ "lib/cosmos/interfaces/udp_interface.rb" 0x281409BD
310
311
  "lib/cosmos/interfaces/tcpip_server_interface.rb" 0xC8F6E908
311
312
  "lib/cosmos/script/limits.rb" 0x9CED41D8
312
313
  "lib/cosmos/script/commands.rb" 0x58ABA373
@@ -21,6 +21,7 @@ module Cosmos
21
21
  #
22
22
  # @param packet_log_writer_name [String] Name of the packet log writer to start new logs on
23
23
  def initialize(packet_log_writer_name = 'ALL')
24
+ super()
24
25
  @packet_log_writer_name = packet_log_writer_name
25
26
  end
26
27
 
@@ -65,6 +65,7 @@ module Cosmos
65
65
 
66
66
  # Initialize the converted_type to :FLOAT and converted_bit_size to 64.
67
67
  def initialize
68
+ super()
68
69
  @segments = []
69
70
  @converted_type = :FLOAT
70
71
  @converted_bit_size = 64
@@ -22,6 +22,7 @@ module Cosmos
22
22
  # @param microseconds_item_name [String] The telemetry item in the packet
23
23
  # which represents microseconds
24
24
  def initialize(seconds_item_name, microseconds_item_name = nil)
25
+ super()
25
26
  @seconds_item_name = seconds_item_name
26
27
  @microseconds_item_name = microseconds_item_name
27
28
  end
@@ -9,74 +9,57 @@
9
9
  # attribution addendums as found in the LICENSE.txt
10
10
 
11
11
  require 'cosmos'
12
+ require 'cosmos/gui/choosers/value_chooser'
12
13
 
13
14
  module Cosmos
14
15
 
15
- class FloatChooser < Qt::Widget
16
+ class FloatChooserDoubleValidator < Qt::DoubleValidator
17
+ def initialize(*args)
18
+ super(*args)
19
+ end
16
20
 
21
+ def fixup(input)
22
+ begin
23
+ value = input.to_f
24
+ if value < bottom()
25
+ # Handle less than bottom
26
+ parent().setText(bottom().to_s)
27
+ elsif value > top()
28
+ # Handle greater than top
29
+ parent().setText(top().to_s)
30
+ end
31
+ rescue Exception => err
32
+ # Oh well no fixup
33
+ end
34
+ end
35
+ end
36
+
37
+ class FloatChooser < ValueChooser
17
38
  # Callback for a new value entered into the text field
18
39
  attr_accessor :sel_command_callback
19
40
 
20
- def initialize(
21
- parent, label_text, initial_value,
22
- minimum_value = nil, maximum_value = nil, field_width = 20, fill = false
23
- )
24
- super(parent)
41
+ def initialize(parent, label_text, initial_value,
42
+ minimum_value = nil, maximum_value = nil,
43
+ field_width = 20, fill = false)
44
+ super(parent, label_text, initial_value, field_width, fill)
25
45
  @minimum_value = minimum_value
26
46
  @maximum_value = maximum_value
27
- @field_width = field_width
28
-
29
- layout = Qt::HBoxLayout.new(self)
30
- layout.setContentsMargins(0,0,0,0)
31
-
32
- @float_label = Qt::Label.new(label_text)
33
- @float_label.setSizePolicy(Qt::SizePolicy::Fixed, Qt::SizePolicy::Fixed) if fill
34
- layout.addWidget(@float_label)
35
- layout.addStretch unless fill
36
- @float_value = Qt::LineEdit.new(initial_value.to_s)
37
- @float_value.setMinimumWidth(field_width)
38
- if minimum_value or maximum_value
39
- validator = Qt::DoubleValidator.new(@float_value)
40
- validator.setBottom(minimum_value) if minimum_value
41
- validator.setTop(maximum_value) if maximum_value
42
- validator.setNotation(Qt::DoubleValidator::StandardNotation)
43
- @float_value.setValidator(validator)
44
- end
45
- @callback_in_progress = false
46
- @float_value.connect(SIGNAL('editingFinished()')) do
47
- unless @callback_in_progress # Prevent double fire on loss of focus
48
- begin
49
- @callback_in_progress = true
50
- @sel_command_callback.call(string(), value()) if @sel_command_callback
51
- ensure
52
- @callback_in_progress = false
53
- end
54
- end
55
- end
56
- layout.addWidget(@float_value)
57
- setLayout(layout)
58
47
 
59
- @sel_command_callback = nil
60
- end
61
-
62
- # Returns the value as a string
63
- def string
64
- @float_value.text
48
+ validator = FloatChooserDoubleValidator.new(@value)
49
+ validator.setBottom(minimum_value) if minimum_value
50
+ validator.setTop(maximum_value) if maximum_value
51
+ validator.setNotation(Qt::DoubleValidator::StandardNotation)
52
+ @value.setValidator(validator)
65
53
  end
66
54
 
67
55
  # Returns the value as a float
68
56
  def value
69
- float_value = @float_value.text.to_f
70
- float_value = @minimum_value if @minimum_value and float_value < @minimum_value
71
- float_value = @maximum_value if @maximum_value and float_value > @maximum_value
57
+ float_value = @value.text.to_f
58
+ float_value = @minimum_value if @minimum_value && float_value < @minimum_value
59
+ float_value = @maximum_value if @maximum_value && float_value > @maximum_value
72
60
  float_value
73
61
  end
74
62
 
75
- # Sets the value of the text field
76
- def value=(new_value)
77
- @float_value.setText(new_value.to_s)
78
- end
79
-
80
- end # class FloatChooser
63
+ end
64
+ end
81
65
 
82
- end # module Cosmos
@@ -9,72 +9,59 @@
9
9
  # attribution addendums as found in the LICENSE.txt
10
10
 
11
11
  require 'cosmos'
12
+ require 'cosmos/gui/choosers/value_chooser'
12
13
 
13
14
  module Cosmos
14
15
 
15
- class IntegerChooser < Qt::Widget
16
+ class IntegerChooserIntValidator < Qt::IntValidator
17
+ def initialize(*args)
18
+ super(*args)
19
+ end
16
20
 
21
+ def fixup(input)
22
+ begin
23
+ value = input.to_i
24
+ if value < bottom()
25
+ # Handle less than bottom
26
+ parent().setText(bottom().to_s)
27
+ elsif value > top()
28
+ # Handle greater than top
29
+ parent().setText(top().to_s)
30
+ elsif input != value.to_s
31
+ # Handle poorly formatted (only known case is float given as starting value)
32
+ parent().setText(value.to_s)
33
+ end
34
+ rescue Exception => err
35
+ # Oh well no fixup
36
+ end
37
+ end
38
+ end
39
+
40
+ class IntegerChooser < ValueChooser
17
41
  # Callback called when the value changes
18
42
  attr_accessor :sel_command_callback
19
43
 
20
- def initialize(
21
- parent, label_text, initial_value,
22
- minimum_value = nil, maximum_value = nil, field_width = 20, fill = false
23
- )
24
- super(parent)
44
+ def initialize(parent, label_text, initial_value,
45
+ minimum_value = nil, maximum_value = nil,
46
+ field_width = 20, fill = false)
47
+ super(parent, label_text, initial_value, field_width, fill)
25
48
  @minimum_value = minimum_value
26
49
  @maximum_value = maximum_value
27
50
 
28
- layout = Qt::HBoxLayout.new(self)
29
- layout.setContentsMargins(0,0,0,0)
30
-
31
- @integer_label = Qt::Label.new(label_text)
32
- @integer_label.setSizePolicy(Qt::SizePolicy::Fixed, Qt::SizePolicy::Fixed) if fill
33
- layout.addWidget(@integer_label)
34
- layout.addStretch() unless fill
35
- @integer_value = Qt::LineEdit.new(initial_value.to_s)
36
- @integer_value.setMinimumWidth(field_width)
37
- if minimum_value or maximum_value
38
- validator = Qt::IntValidator.new(@integer_value)
39
- validator.setBottom(minimum_value) if minimum_value
40
- validator.setTop(maximum_value) if maximum_value
41
- @integer_value.setValidator(validator)
42
- end
43
- @callback_in_progress = false
44
- @integer_value.connect(SIGNAL('editingFinished()')) do
45
- unless @callback_in_progress # Prevent double fire on loss of focus
46
- begin
47
- @callback_in_progress = true
48
- @sel_command_callback.call(string(), value()) if @sel_command_callback
49
- ensure
50
- @callback_in_progress = false
51
- end
52
- end
53
- end
54
- layout.addWidget(@integer_value)
55
- setLayout(layout)
56
-
57
- @sel_command_callback = nil
58
- end
59
-
60
- # Returns the value as a string
61
- def string
62
- @integer_value.text
51
+ validator = IntegerChooserIntValidator.new(@value)
52
+ validator.setBottom(minimum_value) if minimum_value
53
+ validator.setTop(maximum_value) if maximum_value
54
+ @value.setValidator(validator)
63
55
  end
64
56
 
65
57
  # Returns the value as an integer
66
58
  def value
67
- integer_value = @integer_value.text.to_i
68
- integer_value = @minimum_value if @minimum_value and integer_value < @minimum_value
69
- integer_value = @maximum_value if @maximum_value and integer_value > @maximum_value
59
+ integer_value = @value.text.to_i
60
+ integer_value = @minimum_value if @minimum_value && integer_value < @minimum_value
61
+ integer_value = @maximum_value if @maximum_value && integer_value > @maximum_value
70
62
  integer_value
71
63
  end
72
64
 
73
- # Sets the value
74
- def value=(new_value)
75
- @integer_value.setText(new_value.to_s)
76
- end
77
-
78
- end # class IntegerChooser
65
+ end
66
+ end
79
67
 
80
- end # module Cosmos
@@ -0,0 +1,67 @@
1
+ # encoding: ascii-8bit
2
+
3
+ # Copyright 2014 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'
12
+
13
+ module Cosmos
14
+
15
+ class ValueChooser < Qt::Widget
16
+
17
+ # Callback for a new value entered into the text field
18
+ attr_accessor :sel_command_callback
19
+
20
+ def initialize(parent, label_text, initial_value, field_width = 20, fill = false)
21
+ super(parent)
22
+ @field_width = field_width
23
+
24
+ layout = Qt::HBoxLayout.new(self)
25
+ layout.setContentsMargins(0,0,0,0)
26
+
27
+ @label = Qt::Label.new(label_text)
28
+ @label.setSizePolicy(Qt::SizePolicy::Fixed, Qt::SizePolicy::Fixed) if fill
29
+ layout.addWidget(@label)
30
+ layout.addStretch unless fill
31
+ @value = Qt::LineEdit.new(initial_value.to_s)
32
+ @value.setMinimumWidth(field_width)
33
+ @callback_in_progress = false
34
+ @value.connect(SIGNAL('editingFinished()')) do
35
+ unless @callback_in_progress # Prevent double fire on loss of focus
36
+ begin
37
+ @callback_in_progress = true
38
+ @sel_command_callback.call(string(), value()) if @sel_command_callback
39
+ ensure
40
+ @callback_in_progress = false
41
+ end
42
+ end
43
+ end
44
+ layout.addWidget(@value)
45
+ setLayout(layout)
46
+
47
+ @sel_command_callback = nil
48
+ end
49
+
50
+ # Returns the value as a string
51
+ def string
52
+ @value.text
53
+ end
54
+
55
+ # Returns the value as a string
56
+ def value
57
+ string()
58
+ end
59
+
60
+ # Sets the value of the text field
61
+ def value=(new_value)
62
+ @value.setText(new_value.to_s)
63
+ end
64
+
65
+ end
66
+ end
67
+
@@ -59,7 +59,7 @@ module Cosmos
59
59
  @write_timeout = @write_timeout.to_f if @write_timeout
60
60
  @read_timeout = ConfigParser.handle_nil(read_timeout)
61
61
  @read_timeout = @read_timeout.to_f if @read_timeout
62
- @bind_address = ConfigParser.handle_nil(interface_address)
62
+ @bind_address = ConfigParser.handle_nil(bind_address)
63
63
  @bind_address = '127.0.0.1' if @bind_address and @bind_address.upcase == 'LOCALHOST'
64
64
  @write_socket = nil
65
65
  @read_socket = nil
@@ -85,18 +85,20 @@ module Cosmos
85
85
  end
86
86
 
87
87
  def create_new_packet_items(packet)
88
- # Shift off the first macro index because since the first item(s) already exist we just rename
89
- first_index = @macro.indices.shift
90
- @macro.list.each do |name|
91
- original_item_name = name
92
- new_name = format_item_name(name, first_index)
93
- item = packet.rename_item(name, new_name)
88
+ first_index = @macro.indices[0]
89
+ items = {}
94
90
 
95
- # The renaming indices create new items
96
- @macro.indices.each do |index|
97
- new_item = item.clone
98
- new_item.name = format_item_name(original_item_name, index)
99
- packet.append(new_item)
91
+ @macro.indices.each do |index|
92
+ @macro.list.each do |name|
93
+ # The first index we just rename the item(s)
94
+ if index == first_index
95
+ new_name = format_item_name(name, first_index)
96
+ items[name] = packet.rename_item(name, new_name)
97
+ else # Subsequent indexes we clone the first item(s) and append them
98
+ new_item = items[name].clone
99
+ new_item.name = format_item_name(name, index)
100
+ packet.append(new_item)
101
+ end
100
102
  end
101
103
  end
102
104
  end
@@ -312,7 +312,9 @@ module Cosmos
312
312
  string = ''
313
313
  synchronize_allow_reads(true) do
314
314
  @sorted_items.each do |item|
315
- if item.data_type != :BLOCK
315
+ if (item.data_type != :BLOCK) ||
316
+ (item.data_type == :BLOCK and value_type != :RAW and
317
+ item.respond_to? :read_conversion and item.read_conversion)
316
318
  string << "#{indent_string}#{item.name}: #{read_item(item, value_type, buffer)}\n"
317
319
  else
318
320
  value = read_item(item, value_type, buffer)
@@ -886,11 +886,9 @@ module Cosmos
886
886
 
887
887
  # Builds the left frame of the tool
888
888
  def build_left_frame
889
- # Frame around everything
890
889
  @tabbed_plots_left_frame = Qt::VBoxLayout.new
891
890
  @left_frame.addLayout(@tabbed_plots_left_frame)
892
891
 
893
- # Seconds Plotted
894
892
  @seconds_plotted = FloatChooser.new(self,
895
893
  'Seconds Plotted:',
896
894
  @tabbed_plots_config.seconds_plotted,
@@ -900,12 +898,15 @@ module Cosmos
900
898
  @seconds_plotted.sel_command_callback = method(:handle_seconds_plotted_change)
901
899
  @tabbed_plots_left_frame.addWidget(@seconds_plotted)
902
900
 
903
- # Points Saved
904
- @points_saved = IntegerChooser.new(self, 'Points Saved:', @tabbed_plots_config.points_saved, 1, nil, 15)
901
+ @points_saved = IntegerChooser.new(self,
902
+ 'Points Saved:',
903
+ @tabbed_plots_config.points_saved,
904
+ 1,
905
+ nil,
906
+ 15)
905
907
  @points_saved.sel_command_callback = method(:handle_points_saved_change)
906
908
  @tabbed_plots_left_frame.addWidget(@points_saved)
907
909
 
908
- # Points Plotted
909
910
  @points_plotted = IntegerChooser.new(self,
910
911
  'Points Plotted:',
911
912
  @tabbed_plots_config.points_plotted,
@@ -915,7 +916,6 @@ module Cosmos
915
916
  @points_plotted.sel_command_callback = method(:handle_points_plotted_change)
916
917
  @tabbed_plots_left_frame.addWidget(@points_plotted)
917
918
 
918
- # Refresh Rate Hz
919
919
  @refresh_rate_hz = FloatChooser.new(self,
920
920
  'Refresh Rate Hz:',
921
921
  @tabbed_plots_config.refresh_rate_hz,
@@ -1,12 +1,12 @@
1
1
  # encoding: ascii-8bit
2
2
 
3
- COSMOS_VERSION = '3.7.0'
3
+ COSMOS_VERSION = '3.7.1'
4
4
  module Cosmos
5
5
  module Version
6
6
  MAJOR = '3'
7
7
  MINOR = '7'
8
- PATCH = '0'
9
- BUILD = '1f6609f99bf4bd222f5e90ba10462a28c6594166'
8
+ PATCH = '1'
9
+ BUILD = 'efe6e6f49c53a6f9ac1d2069eeee50df2eb9cb4d'
10
10
  end
11
- VERSION = '3.7.0'
11
+ VERSION = '3.7.1'
12
12
  end
@@ -16,7 +16,7 @@ module Cosmos
16
16
  describe UdpInterface do
17
17
  describe "initialize" do
18
18
  it "initializes the instance variables" do
19
- i = UdpInterface.new('localhost','8888','8889','8890','127.0.0.1','64','5','5')
19
+ i = UdpInterface.new('localhost','8888','8889','8890','127.0.0.1','64','5','5','127.0.0.1')
20
20
  end
21
21
 
22
22
  it "is not writeable if no write port given" do
@@ -612,9 +612,14 @@ module Cosmos
612
612
  i = p.get_item("TEST3")
613
613
  i.read_conversion = GenericConversion.new("value / 2")
614
614
  p.write("test3", 0x0406080A)
615
+ p.append_item("test4", 32, :BLOCK)
616
+ i = p.get_item("TEST4")
617
+ i.read_conversion = GenericConversion.new("value.to_s")
618
+ p.write("test4", "Test")
615
619
  expect(p.formatted).to include("TEST1: [1, 2]")
616
620
  expect(p.formatted).to include("TEST2: TRUE")
617
621
  expect(p.formatted).to include("TEST3: #{0x02030405}")
622
+ expect(p.formatted).to include("TEST4: Test")
618
623
  end
619
624
  end
620
625
 
@@ -110,23 +110,31 @@ module Cosmos
110
110
  it "adds multiple items to the packet" do
111
111
  tf = Tempfile.new('unittest')
112
112
  tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Description"'
113
- tf.puts 'MACRO_APPEND_START 1 2'
113
+ tf.puts 'MACRO_APPEND_START 1 4'
114
114
  tf.puts 'APPEND_ITEM WORD 16 UINT'
115
- tf.puts 'APPEND_ITEM DOUBLE_WORD 32 UINT'
115
+ tf.puts 'APPEND_ITEM DWORD 32 UINT'
116
116
  tf.puts 'MACRO_APPEND_END'
117
117
  tf.close
118
118
  @pc.process_file(tf.path, "TGT1")
119
119
  pkt = @pc.telemetry["TGT1"]["PKT1"]
120
- expect(pkt.items.length).to eql 7 # 4 plus the RECEIVED_XXX items
121
- expect(pkt.items.keys).to include('WORD1','WORD2','DOUBLE_WORD1','DOUBLE_WORD2')
120
+ expect(pkt.items.length).to eql 11 # 8 plus the RECEIVED_XXX items
121
+ expect(pkt.items.keys).to include('WORD1','WORD2','WORD3','WORD4','DWORD1','DWORD2','DWORD3','DWORD4')
122
122
  expect(pkt.sorted_items[3].name).to eql 'WORD1'
123
123
  expect(pkt.sorted_items[3].bit_offset).to eql 0
124
- expect(pkt.sorted_items[4].name).to eql 'DOUBLE_WORD1'
124
+ expect(pkt.sorted_items[4].name).to eql 'DWORD1'
125
125
  expect(pkt.sorted_items[4].bit_offset).to eql 16
126
126
  expect(pkt.sorted_items[5].name).to eql 'WORD2'
127
127
  expect(pkt.sorted_items[5].bit_offset).to eql 48
128
- expect(pkt.sorted_items[6].name).to eql 'DOUBLE_WORD2'
128
+ expect(pkt.sorted_items[6].name).to eql 'DWORD2'
129
129
  expect(pkt.sorted_items[6].bit_offset).to eql 64
130
+ expect(pkt.sorted_items[7].name).to eql 'WORD3'
131
+ expect(pkt.sorted_items[7].bit_offset).to eql 96
132
+ expect(pkt.sorted_items[8].name).to eql 'DWORD3'
133
+ expect(pkt.sorted_items[8].bit_offset).to eql 112
134
+ expect(pkt.sorted_items[9].name).to eql 'WORD4'
135
+ expect(pkt.sorted_items[9].bit_offset).to eql 144
136
+ expect(pkt.sorted_items[10].name).to eql 'DWORD4'
137
+ expect(pkt.sorted_items[10].bit_offset).to eql 160
130
138
  tf.unlink
131
139
  end
132
140
 
@@ -0,0 +1,81 @@
1
+ # encoding: ascii-8bit
2
+
3
+ # Copyright 2014 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
+ desc 'Create a picture of gemfile downloads'
12
+ task :gemfile_stats do
13
+ require 'gems'
14
+ require 'gruff'
15
+
16
+ def get_latest_gem_data
17
+ gem_data = []
18
+ versions = Gems.versions 'cosmos'
19
+ versions.each do |version|
20
+ version_no = version['number']
21
+ month = version['built_at'].split('-')[0..1].join('-')
22
+ gem_data << [month, version_no, Gems.total_downloads("cosmos",version_no)[:version_downloads]] if version_no.split('.')[0] >= '3' # anything before 3 is another gem
23
+ end
24
+ gem_data
25
+ end
26
+
27
+ # This is useful for testing to prevent server round trips
28
+ #File.open("gemdata.marshall", 'w') {|file| file.write(Marshal.dump(get_latest_gem_data)) }
29
+ #gem_data = Marshal.load(File.read("gemdata.marshall"))
30
+
31
+ gem_data = get_latest_gem_data()
32
+ # Convert all the date text into Ruby Dates
33
+ gem_data.map! {|x| [Date.strptime(x[0], "%Y-%m"), x[1], x[2]]}
34
+ # Sort first by date and then version number
35
+ gem_data.sort_by! {|x| [x[0], x[1]] }
36
+ # Collect all the minor version numbers counts
37
+ new_data = []
38
+ gem_data.each do |date, version, count|
39
+ if version.split('.')[2] == '0'
40
+ new_version = version[0..-2] + 'x'
41
+ new_data << [date, new_version, count]
42
+ else
43
+ new_data[-1][2] += count
44
+ end
45
+ end
46
+ gem_data = new_data
47
+
48
+ g = Gruff::StackedArea.new
49
+ g.title = 'COSMOS Downloads'
50
+ labels = {}
51
+ index = 0
52
+
53
+ start_date = gem_data[0][0]
54
+ end_date = gem_data[-1][0]
55
+ while (start_date <= end_date)
56
+ labels[index] = start_date.strftime("%Y-%m")
57
+ index += 1
58
+ start_date = start_date >> 1
59
+ end
60
+
61
+ dataset = []
62
+ index = 0
63
+ gem_data.each do |date, version, count|
64
+ data = []
65
+ labels.each do |label|
66
+ if date <= Date.strptime(label[1], "%Y-%m")
67
+ data << count
68
+ else
69
+ data << 0
70
+ end
71
+ end
72
+ dataset << [version, data]
73
+ end
74
+ g.labels = labels
75
+ g.marker_font_size = 12
76
+ dataset.each do |data|
77
+ g.data(data[0], data[1])
78
+ end
79
+ g.write('cosmos_downloads.png')
80
+ end
81
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cosmos
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.0
4
+ version: 3.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Melton
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-11-25 00:00:00.000000000 Z
12
+ date: 2015-12-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -1209,6 +1209,7 @@ files:
1209
1209
  - lib/cosmos/gui/choosers/integer_chooser.rb
1210
1210
  - lib/cosmos/gui/choosers/string_chooser.rb
1211
1211
  - lib/cosmos/gui/choosers/telemetry_chooser.rb
1212
+ - lib/cosmos/gui/choosers/value_chooser.rb
1212
1213
  - lib/cosmos/gui/dialogs/about_dialog.rb
1213
1214
  - lib/cosmos/gui/dialogs/calendar_dialog.rb
1214
1215
  - lib/cosmos/gui/dialogs/cmd_details_dialog.rb
@@ -1648,6 +1649,7 @@ files:
1648
1649
  - spec/utilities/message_log_spec.rb
1649
1650
  - spec/utilities/quaternion_spec.rb
1650
1651
  - spec/utilities/ruby_lex_utils_spec.rb
1652
+ - tasks/gemfile_stats.rake
1651
1653
  - tasks/manifest.rake
1652
1654
  - tasks/spec.rake
1653
1655
  - test/benchmarks/binary_accessor_benchmark.rb