cosmos 4.0.1-universal-java-1.8 → 4.0.2-universal-java-1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/data/config/_id_items.yaml +1 -1
  3. data/data/config/_id_params.yaml +1 -1
  4. data/data/config/_items.yaml +1 -1
  5. data/data/config/_params.yaml +1 -1
  6. data/data/config/cmd_tlm_server.yaml +14 -0
  7. data/data/config/command.yaml +2 -0
  8. data/data/config/command_modifiers.yaml +18 -0
  9. data/data/config/item_modifiers.yaml +39 -0
  10. data/data/config/param_item_modifiers.yaml +5 -0
  11. data/data/config/parameter_modifiers.yaml +36 -0
  12. data/data/config/protocols.yaml +22 -6
  13. data/data/config/system.yaml +17 -0
  14. data/data/config/target.yaml +9 -0
  15. data/data/config/telemetry.yaml +7 -0
  16. data/data/config/telemetry_modifiers.yaml +13 -0
  17. data/data/config/tlm_viewer.yaml +5 -0
  18. data/data/crc.txt +20 -20
  19. data/demo/config/data/crc.txt +3 -3
  20. data/demo/config/targets/INST/screens/hs.txt +1 -1
  21. data/demo/config/targets/SYSTEM/cmd_tlm/limits_groups.txt +5 -10
  22. data/demo/config/targets/SYSTEM/lib/limits_groups.rb +33 -17
  23. data/lib/cosmos/core_ext/string.rb +1 -1
  24. data/lib/cosmos/gui/utilities/script_module_gui.rb +3 -3
  25. data/lib/cosmos/interfaces/protocols/length_protocol.rb +1 -1
  26. data/lib/cosmos/interfaces/protocols/template_protocol.rb +37 -6
  27. data/lib/cosmos/interfaces/udp_interface.rb +3 -3
  28. data/lib/cosmos/packets/packet_config.rb +1 -0
  29. data/lib/cosmos/packets/parsers/format_string_parser.rb +1 -0
  30. data/lib/cosmos/packets/parsers/limits_parser.rb +1 -0
  31. data/lib/cosmos/packets/parsers/state_parser.rb +3 -0
  32. data/lib/cosmos/packets/telemetry.rb +1 -1
  33. data/lib/cosmos/tools/cmd_sequence/cmd_sequence.rb +1 -1
  34. data/lib/cosmos/tools/cmd_tlm_server/limits_groups_background_task.rb +4 -3
  35. data/lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_config.rb +1 -1
  36. data/lib/cosmos/tools/tlm_viewer/screen.rb +3 -3
  37. data/lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb +5 -10
  38. data/lib/cosmos/tools/tlm_viewer/widgets/limits_widget.rb +1 -1
  39. data/lib/cosmos/tools/tlm_viewer/widgets/matrixbycolumns_widget.rb +3 -1
  40. data/lib/cosmos/top_level.rb +2 -4
  41. data/lib/cosmos/utilities/csv.rb +1 -1
  42. data/lib/cosmos/version.rb +4 -4
  43. data/spec/interfaces/protocols/template_protocol_spec.rb +119 -15
  44. data/spec/interfaces/udp_interface_spec.rb +8 -2
  45. data/spec/packets/packet_config_spec.rb +11 -0
  46. data/spec/packets/parsers/format_string_parser_spec.rb +11 -0
  47. data/spec/packets/parsers/limits_parser_spec.rb +21 -10
  48. data/spec/packets/parsers/packet_item_parser_spec.rb +5 -5
  49. data/spec/packets/parsers/state_parser_spec.rb +33 -0
  50. data/spec/tools/cmd_tlm_server/limits_groups_background_task_spec.rb +4 -4
  51. metadata +2 -2
@@ -17,7 +17,14 @@ module Cosmos
17
17
  describe UdpInterface do
18
18
  describe "initialize" do
19
19
  it "initializes the instance variables" do
20
- i = UdpInterface.new('localhost','8888','8889','8890','127.0.0.1','64','5','5','127.0.0.1')
20
+ i = UdpInterface.new('localhost','8888','8889','8890','localhost','64','5','5','localhost')
21
+ expect(i.instance_variable_get("@hostname")).to eql '127.0.0.1'
22
+ expect(i.instance_variable_get("@interface_address")).to eql '127.0.0.1'
23
+ expect(i.instance_variable_get("@bind_address")).to eql '127.0.0.1'
24
+ i = UdpInterface.new('10.10.10.1','8888','8889','8890','10.10.10.2','64','5','5','10.10.10.3')
25
+ expect(i.instance_variable_get("@hostname")).to eql '10.10.10.1'
26
+ expect(i.instance_variable_get("@interface_address")).to eql '10.10.10.2'
27
+ expect(i.instance_variable_get("@bind_address")).to eql '10.10.10.3'
21
28
  end
22
29
 
23
30
  it "is not writeable if no write port given" do
@@ -237,4 +244,3 @@ module Cosmos
237
244
  end
238
245
  end
239
246
  end
240
-
@@ -814,6 +814,17 @@ module Cosmos
814
814
  expect(@pc.telemetry["TGT1"]["PKT1"].read("ITEM1",:WITH_UNITS)).to eql "0 V"
815
815
  tf.unlink
816
816
  end
817
+
818
+ it "complains if STATE defined" do
819
+ tf = Tempfile.new('unittest')
820
+ tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
821
+ tf.puts ' ITEM item1 0 8 UINT'
822
+ tf.puts ' STATE ONE 1'
823
+ tf.puts ' UNITS Volts V'
824
+ tf.close
825
+ expect { @pc.process_file(tf.path, "TGT1") }.to raise_error(ConfigParser::Error, /Items with STATE can't define UNITS/)
826
+ tf.unlink
827
+ end
817
828
  end
818
829
 
819
830
  context "with META" do
@@ -53,6 +53,17 @@ module Cosmos
53
53
  tf.unlink
54
54
  end
55
55
 
56
+ it "complains if STATE is defined" do
57
+ tf = Tempfile.new('unittest')
58
+ tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
59
+ tf.puts 'ITEM myitem 0 8 UINT "Test Item"'
60
+ tf.puts 'STATE ONE 1'
61
+ tf.puts "FORMAT_STRING '0x%x'"
62
+ tf.close
63
+ expect { @pc.process_file(tf.path, "TGT1") }.to raise_error(ConfigParser::Error, /Items with STATE can't define FORMAT_STRING/)
64
+ tf.unlink
65
+ end
66
+
56
67
  it "complains about invalid format strings" do
57
68
  tf = Tempfile.new('unittest')
58
69
  tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
@@ -23,7 +23,7 @@ module Cosmos
23
23
  @pc = PacketConfig.new
24
24
  end
25
25
 
26
- it "raises if a current item is not defined" do
26
+ it "complains if a current item is not defined" do
27
27
  tf = Tempfile.new('unittest')
28
28
  tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
29
29
  tf.puts ' LIMITS mylimits 1 ENABLED 0 10 20 30 12 18'
@@ -32,7 +32,7 @@ module Cosmos
32
32
  tf.unlink
33
33
  end
34
34
 
35
- it "raises if there are not enough parameters" do
35
+ it "complains if there are not enough parameters" do
36
36
  tf = Tempfile.new('unittest')
37
37
  tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
38
38
  tf.puts ' ITEM myitem 0 8 UINT "Test Item"'
@@ -50,7 +50,7 @@ module Cosmos
50
50
  tf.unlink
51
51
  end
52
52
 
53
- it "raises if there are too many parameters" do
53
+ it "complains if there are too many parameters" do
54
54
  tf = Tempfile.new('unittest')
55
55
  tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
56
56
  tf.puts ' ITEM myitem 0 8 UINT "Test Item"'
@@ -60,7 +60,7 @@ module Cosmos
60
60
  tf.unlink
61
61
  end
62
62
 
63
- it "raises if applied to a command PARAMETER" do
63
+ it "complains if applied to a command PARAMETER" do
64
64
  tf = Tempfile.new('unittest')
65
65
  tf.puts 'COMMAND tgt1 pkt1 LITTLE_ENDIAN "Packet"'
66
66
  tf.puts ' APPEND_PARAMETER item1 16 UINT 0 0 0 "Item"'
@@ -70,7 +70,7 @@ module Cosmos
70
70
  tf.unlink
71
71
  end
72
72
 
73
- it "raises if a DEFAULT limits set isn't defined" do
73
+ it "complains if a DEFAULT limits set isn't defined" do
74
74
  tf = Tempfile.new('unittest')
75
75
  tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
76
76
  tf.puts ' APPEND_ITEM item1 16 UINT "Item"'
@@ -80,6 +80,17 @@ module Cosmos
80
80
  tf.unlink
81
81
  end
82
82
 
83
+ it "complains if STATES are defined" do
84
+ tf = Tempfile.new('unittest')
85
+ tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
86
+ tf.puts ' APPEND_ITEM item1 16 UINT "Item"'
87
+ tf.puts ' STATE ONE 1'
88
+ tf.puts ' LIMITS TVAC 3 ENABLED 1 2 6 7 3 5'
89
+ tf.close
90
+ expect { @pc.process_file(tf.path, "TGT1") }.to raise_error(ConfigParser::Error, /Items with STATE can't define LIMITS/)
91
+ tf.unlink
92
+ end
93
+
83
94
  it "sets a warning if a new limits set persistence isn't consistent with DEFAULT" do
84
95
  tf = Tempfile.new('unittest')
85
96
  tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
@@ -116,7 +127,7 @@ module Cosmos
116
127
  tf.unlink
117
128
  end
118
129
 
119
- it "raises if the second parameter isn't a number" do
130
+ it "complains if the second parameter isn't a number" do
120
131
  tf = Tempfile.new('unittest')
121
132
  tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
122
133
  tf.puts ' APPEND_ITEM item1 16 UINT "Item"'
@@ -126,7 +137,7 @@ module Cosmos
126
137
  tf.unlink
127
138
  end
128
139
 
129
- it "raises if the third parameter isn't ENABLED or DISABLED" do
140
+ it "complains if the third parameter isn't ENABLED or DISABLED" do
130
141
  tf = Tempfile.new('unittest')
131
142
  tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
132
143
  tf.puts ' APPEND_ITEM item1 16 UINT "Item"'
@@ -136,7 +147,7 @@ module Cosmos
136
147
  tf.unlink
137
148
  end
138
149
 
139
- it "raises if the fourth through ninth parameter aren't numbers'" do
150
+ it "complains if the fourth through ninth parameter aren't numbers'" do
140
151
  msgs = ['','','','','red low','yellow low','yellow high','red high','green low','green high']
141
152
  (4..9).each do |index|
142
153
  tf = Tempfile.new('unittest')
@@ -151,7 +162,7 @@ module Cosmos
151
162
  end
152
163
  end
153
164
 
154
- it "raises if the 4 limits are out of order" do
165
+ it "complains if the 4 limits are out of order" do
155
166
  tf = Tempfile.new('unittest')
156
167
  tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
157
168
  tf.puts ' APPEND_ITEM item1 16 UINT "Item"'
@@ -185,7 +196,7 @@ module Cosmos
185
196
  tf.unlink
186
197
  end
187
198
 
188
- it "raises if the 6 limits are out of order" do
199
+ it "complains if the 6 limits are out of order" do
189
200
  tf = Tempfile.new('unittest')
190
201
  tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
191
202
  tf.puts ' APPEND_ITEM item1 16 UINT "Item"'
@@ -33,7 +33,7 @@ module Cosmos
33
33
  tf.unlink
34
34
  end
35
35
 
36
- it "raises if given an incomplete definition" do
36
+ it "complains if given an incomplete definition" do
37
37
  tf = Tempfile.new('unittest')
38
38
  tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Description"'
39
39
  tf.puts ' ITEM ITEM1 8 0'
@@ -63,7 +63,7 @@ module Cosmos
63
63
  tf.unlink
64
64
  end
65
65
 
66
- it "raises if given a bad bit offset" do
66
+ it "complains if given a bad bit offset" do
67
67
  tf = Tempfile.new('unittest')
68
68
  tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Description"'
69
69
  tf.puts ' ITEM ITEM1 EIGHT 0 DERIVED'
@@ -72,7 +72,7 @@ module Cosmos
72
72
  tf.unlink
73
73
  end
74
74
 
75
- it "raises if given a bad bit size" do
75
+ it "complains if given a bad bit size" do
76
76
  tf = Tempfile.new('unittest')
77
77
  tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Description"'
78
78
  tf.puts ' ITEM ITEM1 8 ZERO DERIVED'
@@ -81,7 +81,7 @@ module Cosmos
81
81
  tf.unlink
82
82
  end
83
83
 
84
- it "raises if given a bad array size" do
84
+ it "complains if given a bad array size" do
85
85
  tf = Tempfile.new('unittest')
86
86
  tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Description"'
87
87
  tf.puts ' ARRAY_ITEM ITEM3 0 32 FLOAT EIGHT'
@@ -178,7 +178,7 @@ module Cosmos
178
178
  tf.unlink
179
179
  end
180
180
 
181
- it "raises if given an incomplete definition" do
181
+ it "complains if given an incomplete definition" do
182
182
  tf = Tempfile.new('unittest')
183
183
  tf.puts 'COMMAND tgt1 pkt1 LITTLE_ENDIAN "Description"'
184
184
  tf.puts ' PARAMETER ITEM1 8 0'
@@ -43,6 +43,39 @@ module Cosmos
43
43
  tf.unlink
44
44
  end
45
45
 
46
+ it "complains if LIMITS defined" do
47
+ tf = Tempfile.new('unittest')
48
+ tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
49
+ tf.puts ' ITEM myitem 0 8 UINT "Test Item"'
50
+ tf.puts ' LIMITS DEFAULT 3 ENABLED 1 2 6 7 3 5'
51
+ tf.puts ' STATE ONE 1'
52
+ tf.close
53
+ expect { @pc.process_file(tf.path, "TGT1") }.to raise_error(ConfigParser::Error, /Items with LIMITS can't define STATE/)
54
+ tf.unlink
55
+ end
56
+
57
+ it "complains if FORMAT_STRING defined" do
58
+ tf = Tempfile.new('unittest')
59
+ tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
60
+ tf.puts ' ITEM myitem 0 8 UINT "Test Item"'
61
+ tf.puts ' FORMAT_STRING "0x%x"'
62
+ tf.puts ' STATE ONE 1'
63
+ tf.close
64
+ expect { @pc.process_file(tf.path, "TGT1") }.to raise_error(ConfigParser::Error, /Items with FORMAT_STRING can't define STATE/)
65
+ tf.unlink
66
+ end
67
+
68
+ it "complains if UNITS defined" do
69
+ tf = Tempfile.new('unittest')
70
+ tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
71
+ tf.puts ' ITEM myitem 0 8 UINT "Test Item"'
72
+ tf.puts ' UNITS Kelvin K'
73
+ tf.puts ' STATE ONE 1'
74
+ tf.close
75
+ expect { @pc.process_file(tf.path, "TGT1") }.to raise_error(ConfigParser::Error, /Items with UNITS can't define STATE/)
76
+ tf.unlink
77
+ end
78
+
46
79
  it "complains if there are too many parameters" do
47
80
  tf = Tempfile.new('unittest')
48
81
  tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
@@ -62,11 +62,11 @@ module Cosmos
62
62
  Cosmos.kill_thread(self, thread)
63
63
  end
64
64
 
65
- it "processes the check methods at 1Hz" do
65
+ it "processes the check methods at a configurable rate" do
66
66
  class MyLimitsGroups3 < LimitsGroupsBackgroundTask
67
67
  attr_accessor :first_count, :second_count, :on_logic, :off_logic
68
- def initialize
69
- super()
68
+ def initialize(connect_delay, task_delay)
69
+ super(connect_delay, task_delay)
70
70
  @first_count = 0
71
71
  @second_count = 0
72
72
  @on_logic = false
@@ -85,7 +85,7 @@ module Cosmos
85
85
  process_group { false } # Never enable
86
86
  end
87
87
  end
88
- my = MyLimitsGroups3.new
88
+ my = MyLimitsGroups3.new(0, 1) # Run at 1Hz
89
89
  thread = Thread.new do
90
90
  my.call
91
91
  end
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: 4.0.1
4
+ version: 4.0.2
5
5
  platform: universal-java-1.8
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: 2017-08-23 00:00:00.000000000 Z
12
+ date: 2017-09-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  requirement: !ruby/object:Gem::Requirement