cosmos-multi_field_bit_conversion 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +20 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +51 -0
- data/Rakefile +11 -0
- data/config/data/README.txt +1 -0
- data/config/data/crc.txt +198 -0
- data/config/system/system.txt +29 -0
- data/config/targets/COSMOS/cmd_tlm/cosmos_server_cmds.txt +41 -0
- data/config/targets/COSMOS/cmd_tlm/cosmos_server_tlm.txt +15 -0
- data/config/targets/COSMOS/cmd_tlm_server.txt +6 -0
- data/config/targets/COSMOS/screens/limits_change.txt +20 -0
- data/config/targets/COSMOS/screens/version.txt +19 -0
- data/config/targets/COSMOS/target.txt +9 -0
- data/config/targets/PI/cmd_tlm/pi_tlm_test.txt +12 -0
- data/config/targets/PI/cmd_tlm/pi_tlm_test_1.txt +13 -0
- data/config/targets/PI/cmd_tlm/pi_tlm_test_2.txt +68 -0
- data/config/targets/PI/cmd_tlm/pi_tlm_test_3.txt +12 -0
- data/config/targets/PI/cmd_tlm_server.txt +4 -0
- data/config/targets/PI/target.txt +4 -0
- data/cosmos-multi_field_bit_conversion.gemspec +26 -0
- data/lib/cosmos/multi_field_bit_conversion.rb +26 -0
- data/test/multi_field_bit_conversion_test.rb +41 -0
- data/test/test_helper.rb +2 -0
- metadata +117 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b670b9b029398c0b17b9f0dccaeab01004c6c753
|
4
|
+
data.tar.gz: cd9c2ed72dbaafb2d2b7990258bc2940dd318e30
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f76a8046a1e89b834f7d44d028cac71b7f7295cbb3a931f724f98e5570e4478e745548c98c8d2226067206b8fda6c7301cad6e0dc8fa97720748adb3833f24fe
|
7
|
+
data.tar.gz: 35d355776d1fd88e9e95d5e68bc5b9fd3bd374f7b0f15d706af686ee1ff1da26e4ddb98acd6b429d0ab1c7be5d5e2b70bd31c7727e9b7cd486240af92fa5764f
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2019 Nick Benoit
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# Cosmos::MultiFieldBitConversion
|
2
|
+
|
3
|
+
A cosmos read conversion designed to combine the bits of several uint fields. Where values on the left are more significant, and values on the right are less significant. This conversaion will work with any number of uint fields, of any size.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'cosmos-multi_field_bit_conversion'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install cosmos-multi_field_bit_conversion
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
In your telemetry definition file: `config/targets/my-target/cmd_tlm/test.txt`
|
22
|
+
```
|
23
|
+
TELEMETRY PI TEST LITTLE_ENDIAN "Test Aggregate Packet"
|
24
|
+
APPEND_ID_ITEM TST_PK_ID 16 UINT 149 "Packet ID which must be 149"
|
25
|
+
APPEND_ITEM VALUE_A 8 UINT
|
26
|
+
APPEND_ITEM VALUE_B 8 UINT
|
27
|
+
|
28
|
+
ITEM HEAD_LENGTH 32 16 UINT
|
29
|
+
|
30
|
+
APPEND_ITEM VALUE_C 8 UINT
|
31
|
+
APPEND_ITEM VALUE_D 8 UINT
|
32
|
+
ITEM BOTH_FIELDS 0 0 DERIVED "Description"
|
33
|
+
READ_CONVERSION cosmos/multi_field_bit_conversion.rb VALUE_C VALUE_D
|
34
|
+
|
35
|
+
## Both fields is essentially (VALUE_C << 8 | VALUE_D)
|
36
|
+
|
37
|
+
|
38
|
+
```
|
39
|
+
|
40
|
+
In your target definition file `config/targets/my-target/target.txt`
|
41
|
+
```
|
42
|
+
REQUIRE cosmos/multi_field_bit_conversion.rb
|
43
|
+
```
|
44
|
+
|
45
|
+
## Contributing
|
46
|
+
|
47
|
+
1. Fork it
|
48
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
49
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
50
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
51
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
This file is here to make sure this folder is included in the release.
|
data/config/data/crc.txt
ADDED
@@ -0,0 +1,198 @@
|
|
1
|
+
USER_MODIFIED
|
2
|
+
"lib/aggregate_packet_mapper.rb" 0x4068112E
|
3
|
+
"lib/aggregate_packet_processor.rb" 0x4258B00E
|
4
|
+
"lib/base_name_map.rb" 0x91E8E143
|
5
|
+
"lib/hkadc_conversion.rb" 0x38DDC76C
|
6
|
+
"lib/hkadc_lpsweep.rb" 0xBAF00449
|
7
|
+
"lib/my_interface.rb" 0xFC3F089B
|
8
|
+
"lib/science_granule_conversion.rb" 0x8610D03A
|
9
|
+
"lib/SLP_EFP_conv.rb" 0x7C0E5B8B
|
10
|
+
"lib/sport_packet_mapper.rb" 0xECFFCB48
|
11
|
+
"lib/temp_conversion.rb" 0xD7C76546
|
12
|
+
"lib/time_transformer.rb" 0x49551667
|
13
|
+
"lib/unpacking_interface.rb" 0x77A29883
|
14
|
+
"lib/user_version.rb" 0x8F282EE9
|
15
|
+
"config/data/README.txt" 0x93B2C07E
|
16
|
+
"config/system/system.txt" 0x6764F0C9
|
17
|
+
"config/targets/COSMOS/cmd_tlm/cosmos_server_cmds.txt" 0xE2F62B11
|
18
|
+
"config/targets/COSMOS/cmd_tlm/cosmos_server_tlm.txt" 0xC667CCD6
|
19
|
+
"config/targets/COSMOS/cmd_tlm_server.txt" 0xE53A4164
|
20
|
+
"config/targets/COSMOS/screens/limits_change.txt" 0xE8C47C54
|
21
|
+
"config/targets/COSMOS/screens/version.txt" 0x393D4F72
|
22
|
+
"config/targets/COSMOS/target.txt" 0x6C6F9A95
|
23
|
+
"config/targets/PI/cmd_tlm/cmd.txt" 0x3BB1B28F
|
24
|
+
"config/targets/PI/cmd_tlm/pi_tlm_SIPSweep.txt" 0x9A301D03
|
25
|
+
"config/targets/PI/cmd_tlm/pi_tlm_SIPTrack.txt" 0x34D43077
|
26
|
+
"config/targets/PI/cmd_tlm/pi_tlm_SLPScience.txt" 0x2C18FDF6
|
27
|
+
"config/targets/PI/cmd_tlm/pi_tlm_SLPScience2.txt" 0xF7D801F2
|
28
|
+
"config/targets/PI/cmd_tlm/pi_tlm_SLPsweep.txt" 0xC2BC6243
|
29
|
+
"config/targets/PI/cmd_tlm/pi_tlm_status.txt" 0x650698C8
|
30
|
+
"config/targets/PI/cmd_tlm/pi_tlm_test.txt" 0xB566CE74
|
31
|
+
"config/targets/PI/cmd_tlm/pi_tlm_test_1.txt" 0x850AAB7C
|
32
|
+
"config/targets/PI/cmd_tlm/pi_tlm_test_2.txt" 0xC62CC0C9
|
33
|
+
"config/targets/PI/cmd_tlm/pi_tlm_wave.txt" 0x030FE66E
|
34
|
+
"config/targets/PI/cmd_tlm_server.txt" 0x817CA568
|
35
|
+
"config/targets/PI/cmd_tlm_server_old.txt" 0xFFC7442F
|
36
|
+
"config/targets/PI/lib/multi_field_bit_conversion.rb" 0x9FAFF32B
|
37
|
+
"config/targets/PI/screens/command_display.txt" 0x17744D99
|
38
|
+
"config/targets/PI/screens/science_display.txt" 0x236FE1EE
|
39
|
+
"config/targets/PI/screens/sip_sweep_display.txt" 0x64862E3D
|
40
|
+
"config/targets/PI/screens/sip_track_display.txt" 0x6ED816C8
|
41
|
+
"config/targets/PI/screens/slp_sweep_display.txt" 0x0DA05B4E
|
42
|
+
"config/targets/PI/screens/status_display.txt" 0xD7D2428A
|
43
|
+
"config/targets/PI/screens/wave_display.txt" 0x5397D35B
|
44
|
+
"config/targets/PI/target.txt" 0x56F1158D
|
45
|
+
"config/tools/cmd_tlm_server/cmd_tlm_server.txt" 0xC6819D73
|
46
|
+
"config/tools/data_viewer/data_viewer.txt" 0xAEE0B7DF
|
47
|
+
"config/tools/handbook_creator/default_toc.xsl" 0x4122A040
|
48
|
+
"config/tools/handbook_creator/handbook_creator.txt" 0x64E4B5CC
|
49
|
+
"config/tools/handbook_creator/templates/command_packets.html.erb" 0x9897CA7A
|
50
|
+
"config/tools/handbook_creator/templates/command_toc.html.erb" 0x9159BCF9
|
51
|
+
"config/tools/handbook_creator/templates/footer.html.erb" 0x0E1F9800
|
52
|
+
"config/tools/handbook_creator/templates/header.html.erb" 0x1E490C2A
|
53
|
+
"config/tools/handbook_creator/templates/limits_groups.html.erb" 0x40FDF34C
|
54
|
+
"config/tools/handbook_creator/templates/nav.html.erb" 0xDF65AAEA
|
55
|
+
"config/tools/handbook_creator/templates/overview.html.erb" 0xDC4DD2B8
|
56
|
+
"config/tools/handbook_creator/templates/pdf_cover.html.erb" 0x7AAB9A42
|
57
|
+
"config/tools/handbook_creator/templates/pdf_footer.html.erb" 0xF0D3EB77
|
58
|
+
"config/tools/handbook_creator/templates/pdf_header.html.erb" 0x3020FEE1
|
59
|
+
"config/tools/handbook_creator/templates/telemetry_packets.html.erb" 0x44BD9695
|
60
|
+
"config/tools/handbook_creator/templates/telemetry_toc.html.erb" 0x610E3BC5
|
61
|
+
"config/tools/handbook_creator/templates/title.html.erb" 0xBC66E2BC
|
62
|
+
"config/tools/launcher/launcher.txt" 0x2F6ABBDB
|
63
|
+
"config/tools/limits_monitor/README.txt" 0x93B2C07E
|
64
|
+
"config/tools/opengl_builder/README.txt" 0x93B2C07E
|
65
|
+
"config/tools/script_runner/script_runner.txt" 0x1EECD803
|
66
|
+
"config/tools/table_manager/README.txt" 0x93B2C07E
|
67
|
+
"config/tools/test_runner/test_runner.txt" 0xD24409D2
|
68
|
+
"config/tools/tlm_extractor/diff-calibration.txt" 0xB96B9CA5
|
69
|
+
"config/tools/tlm_extractor/everything.txt" 0xA6C1B8E0
|
70
|
+
"config/tools/tlm_extractor/level_calibration.txt" 0x002C9B17
|
71
|
+
"config/tools/tlm_extractor/Pressure_Curve.txt" 0xDD01E92C
|
72
|
+
"config/tools/tlm_extractor/README.txt" 0x93B2C07E
|
73
|
+
"config/tools/tlm_grapher/everything.txt" 0x6D74DC74
|
74
|
+
"config/tools/tlm_grapher/level.txt" 0x897E659A
|
75
|
+
"config/tools/tlm_grapher/power.txt" 0x84A1E1E2
|
76
|
+
"config/tools/tlm_grapher/pressure.txt" 0xAD680050
|
77
|
+
"config/tools/tlm_grapher/README.txt" 0x93B2C07E
|
78
|
+
"config/tools/tlm_grapher/temperatures.txt" 0x1D7DE415
|
79
|
+
"config/tools/tlm_grapher/temperatures_Rev2.txt" 0x6169AD4A
|
80
|
+
"config/tools/tlm_grapher/venturi.txt" 0x4B601735
|
81
|
+
"config/tools/tlm_viewer/tlm_viewer.txt" 0xD9071527
|
82
|
+
"tools/CmdExtractor" 0x96E82AC3
|
83
|
+
"tools/CmdExtractor.bat" 0x09A34857
|
84
|
+
"tools/CmdSender" 0x10346CF4
|
85
|
+
"tools/CmdSender.bat" 0x09A34857
|
86
|
+
"tools/CmdTlmServer" 0x4C7A4FCB
|
87
|
+
"tools/CmdTlmServer.bat" 0x09A34857
|
88
|
+
"tools/DataViewer" 0x9D20734C
|
89
|
+
"tools/DataViewer.bat" 0x09A34857
|
90
|
+
"tools/HandbookCreator" 0xD927814C
|
91
|
+
"tools/HandbookCreator.bat" 0x09A34857
|
92
|
+
"tools/Launcher" 0xFD4E356C
|
93
|
+
"tools/Launcher.bat" 0x09A34857
|
94
|
+
"tools/LimitsMonitor" 0x04FD96D8
|
95
|
+
"tools/LimitsMonitor.bat" 0x09A34857
|
96
|
+
"tools/mac/CmdExtractor.app/Contents/Info.plist" 0x0E89084D
|
97
|
+
"tools/mac/CmdExtractor.app/Contents/MacOS/CmdExtractor.rb" 0x96E82AC3
|
98
|
+
"tools/mac/CmdExtractor.app/Contents/MacOS/main.sh" 0xEE3EC072
|
99
|
+
"tools/mac/CmdExtractor.app/Contents/MacOS/tool_launch.rb" 0x0BDB6696
|
100
|
+
"tools/mac/CmdExtractor.app/Contents/Resources/appIcon.icns" 0x39862FA7
|
101
|
+
"tools/mac/CmdSender.app/Contents/Info.plist" 0x87039019
|
102
|
+
"tools/mac/CmdSender.app/Contents/MacOS/CmdSender.rb" 0x10346CF4
|
103
|
+
"tools/mac/CmdSender.app/Contents/MacOS/main.sh" 0x707CA873
|
104
|
+
"tools/mac/CmdSender.app/Contents/MacOS/tool_launch.rb" 0x0BDB6696
|
105
|
+
"tools/mac/CmdSender.app/Contents/Resources/appIcon.icns" 0xEC403A52
|
106
|
+
"tools/mac/CmdTlmServer.app/Contents/Info.plist" 0x97E53674
|
107
|
+
"tools/mac/CmdTlmServer.app/Contents/MacOS/CmdTlmServer.rb" 0x4C7A4FCB
|
108
|
+
"tools/mac/CmdTlmServer.app/Contents/MacOS/main.sh" 0x1F1443E6
|
109
|
+
"tools/mac/CmdTlmServer.app/Contents/MacOS/tool_launch.rb" 0x0BDB6696
|
110
|
+
"tools/mac/CmdTlmServer.app/Contents/Resources/appIcon.icns" 0x972CDCC6
|
111
|
+
"tools/mac/DataViewer.app/Contents/Info.plist" 0xB79CA16B
|
112
|
+
"tools/mac/DataViewer.app/Contents/MacOS/DataViewer.rb" 0x9D20734C
|
113
|
+
"tools/mac/DataViewer.app/Contents/MacOS/main.sh" 0xD40D9D6C
|
114
|
+
"tools/mac/DataViewer.app/Contents/MacOS/tool_launch.rb" 0x0BDB6696
|
115
|
+
"tools/mac/DataViewer.app/Contents/Resources/appIcon.icns" 0x3EC9B207
|
116
|
+
"tools/mac/HandbookCreator.app/Contents/Info.plist" 0x7591A548
|
117
|
+
"tools/mac/HandbookCreator.app/Contents/MacOS/HandbookCreator.rb" 0xD927814C
|
118
|
+
"tools/mac/HandbookCreator.app/Contents/MacOS/main.sh" 0x358F92E1
|
119
|
+
"tools/mac/HandbookCreator.app/Contents/MacOS/tool_launch.rb" 0x0BDB6696
|
120
|
+
"tools/mac/HandbookCreator.app/Contents/Resources/appIcon.icns" 0xCEA7C465
|
121
|
+
"tools/mac/Launcher.app/Contents/Info.plist" 0x32A1EF14
|
122
|
+
"tools/mac/Launcher.app/Contents/MacOS/Launcher.rb" 0xFD4E356C
|
123
|
+
"tools/mac/Launcher.app/Contents/MacOS/main.sh" 0x0B32DAE8
|
124
|
+
"tools/mac/Launcher.app/Contents/MacOS/tool_launch.rb" 0x0BDB6696
|
125
|
+
"tools/mac/Launcher.app/Contents/Resources/appIcon.icns" 0x8857CD2B
|
126
|
+
"tools/mac/LimitsMonitor.app/Contents/Info.plist" 0xAF650287
|
127
|
+
"tools/mac/LimitsMonitor.app/Contents/MacOS/LimitsMonitor.rb" 0x04FD96D8
|
128
|
+
"tools/mac/LimitsMonitor.app/Contents/MacOS/main.sh" 0xAAF1493C
|
129
|
+
"tools/mac/LimitsMonitor.app/Contents/MacOS/tool_launch.rb" 0x0BDB6696
|
130
|
+
"tools/mac/LimitsMonitor.app/Contents/Resources/appIcon.icns" 0xC98BF799
|
131
|
+
"tools/mac/OpenGLBuilder.app/Contents/Info.plist" 0x3C2E542D
|
132
|
+
"tools/mac/OpenGLBuilder.app/Contents/MacOS/main.sh" 0xAD05D35B
|
133
|
+
"tools/mac/OpenGLBuilder.app/Contents/MacOS/OpenGLBuilder.rb" 0x585EA691
|
134
|
+
"tools/mac/OpenGLBuilder.app/Contents/MacOS/tool_launch.rb" 0x0BDB6696
|
135
|
+
"tools/mac/OpenGLBuilder.app/Contents/Resources/appIcon.icns" 0x8DDBD837
|
136
|
+
"tools/mac/PacketViewer.app/Contents/Info.plist" 0x6934BF89
|
137
|
+
"tools/mac/PacketViewer.app/Contents/MacOS/main.sh" 0x47F54F98
|
138
|
+
"tools/mac/PacketViewer.app/Contents/MacOS/PacketViewer.rb" 0xF23A40BB
|
139
|
+
"tools/mac/PacketViewer.app/Contents/MacOS/tool_launch.rb" 0x0BDB6696
|
140
|
+
"tools/mac/PacketViewer.app/Contents/Resources/appIcon.icns" 0xDF373DAE
|
141
|
+
"tools/mac/Replay.app/Contents/Info.plist" 0x894AC4CF
|
142
|
+
"tools/mac/Replay.app/Contents/MacOS/main.sh" 0x42370A6F
|
143
|
+
"tools/mac/Replay.app/Contents/MacOS/Replay.rb" 0xAC00D2AD
|
144
|
+
"tools/mac/Replay.app/Contents/MacOS/tool_launch.rb" 0x0BDB6696
|
145
|
+
"tools/mac/Replay.app/Contents/Resources/appIcon.icns" 0x0E6B32E5
|
146
|
+
"tools/mac/ScriptRunner.app/Contents/Info.plist" 0x1BC8C5E9
|
147
|
+
"tools/mac/ScriptRunner.app/Contents/MacOS/main.sh" 0xCE8AE11F
|
148
|
+
"tools/mac/ScriptRunner.app/Contents/MacOS/ScriptRunner.rb" 0x20F38758
|
149
|
+
"tools/mac/ScriptRunner.app/Contents/MacOS/tool_launch.rb" 0x0BDB6696
|
150
|
+
"tools/mac/ScriptRunner.app/Contents/Resources/appIcon.icns" 0x9246743E
|
151
|
+
"tools/mac/TableManager.app/Contents/Info.plist" 0xF6A5877F
|
152
|
+
"tools/mac/TableManager.app/Contents/MacOS/main.sh" 0x68092BA9
|
153
|
+
"tools/mac/TableManager.app/Contents/MacOS/TableManager.rb" 0x71F21C88
|
154
|
+
"tools/mac/TableManager.app/Contents/MacOS/tool_launch.rb" 0x0BDB6696
|
155
|
+
"tools/mac/TableManager.app/Contents/Resources/appIcon.icns" 0xEBF5074E
|
156
|
+
"tools/mac/TestRunner.app/Contents/Info.plist" 0x482B3BA5
|
157
|
+
"tools/mac/TestRunner.app/Contents/MacOS/main.sh" 0x5A8D958C
|
158
|
+
"tools/mac/TestRunner.app/Contents/MacOS/TestRunner.rb" 0x0B0E0B8B
|
159
|
+
"tools/mac/TestRunner.app/Contents/MacOS/tool_launch.rb" 0x0BDB6696
|
160
|
+
"tools/mac/TestRunner.app/Contents/Resources/appIcon.icns" 0xC8D32D55
|
161
|
+
"tools/mac/TlmExtractor.app/Contents/Info.plist" 0x343784F4
|
162
|
+
"tools/mac/TlmExtractor.app/Contents/MacOS/main.sh" 0x348F7440
|
163
|
+
"tools/mac/TlmExtractor.app/Contents/MacOS/TlmExtractor.rb" 0x1EC4639A
|
164
|
+
"tools/mac/TlmExtractor.app/Contents/MacOS/tool_launch.rb" 0x0BDB6696
|
165
|
+
"tools/mac/TlmExtractor.app/Contents/Resources/appIcon.icns" 0x0AC88876
|
166
|
+
"tools/mac/TlmGrapher.app/Contents/Info.plist" 0x3623B978
|
167
|
+
"tools/mac/TlmGrapher.app/Contents/MacOS/main.sh" 0x7BE28DE6
|
168
|
+
"tools/mac/TlmGrapher.app/Contents/MacOS/TlmGrapher.rb" 0x9464F502
|
169
|
+
"tools/mac/TlmGrapher.app/Contents/MacOS/tool_launch.rb" 0x0BDB6696
|
170
|
+
"tools/mac/TlmGrapher.app/Contents/Resources/appIcon.icns" 0xCA324F50
|
171
|
+
"tools/mac/TlmViewer.app/Contents/Info.plist" 0x821041E0
|
172
|
+
"tools/mac/TlmViewer.app/Contents/MacOS/main.sh" 0xE2F1EAFE
|
173
|
+
"tools/mac/TlmViewer.app/Contents/MacOS/TlmViewer.rb" 0xFE723189
|
174
|
+
"tools/mac/TlmViewer.app/Contents/MacOS/tool_launch.rb" 0x0BDB6696
|
175
|
+
"tools/mac/TlmViewer.app/Contents/Resources/appIcon.icns" 0x1CBA8EB3
|
176
|
+
"tools/OpenGLBuilder" 0x585EA691
|
177
|
+
"tools/OpenGLBuilder.bat" 0x09A34857
|
178
|
+
"tools/PacketViewer" 0xF23A40BB
|
179
|
+
"tools/PacketViewer.bat" 0x09A34857
|
180
|
+
"tools/Replay" 0xAC00D2AD
|
181
|
+
"tools/Replay.bat" 0x09A34857
|
182
|
+
"tools/ScriptRunner" 0x20F38758
|
183
|
+
"tools/ScriptRunner.bat" 0x09A34857
|
184
|
+
"tools/TableManager" 0x71F21C88
|
185
|
+
"tools/TableManager.bat" 0x09A34857
|
186
|
+
"tools/TestRunner" 0x0B0E0B8B
|
187
|
+
"tools/TestRunner.bat" 0x09A34857
|
188
|
+
"tools/TlmExtractor" 0x1EC4639A
|
189
|
+
"tools/TlmExtractor.bat" 0x09A34857
|
190
|
+
"tools/TlmGrapher" 0x9464F502
|
191
|
+
"tools/TlmGrapher.bat" 0x09A34857
|
192
|
+
"tools/TlmViewer" 0xFE723189
|
193
|
+
"tools/TlmViewer.bat" 0x09A34857
|
194
|
+
"tools/ToolLaunch.bat" 0x7896E14C
|
195
|
+
"tools/tool_launch.rb" 0x0BDB6696
|
196
|
+
"procedures/auto_test.rb" 0xD7D98CDB
|
197
|
+
"procedures/handshake.rb" 0x69D9F3B2
|
198
|
+
"procedures/README.txt" 0x93B2C07E
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# Declare Targets that make up the system
|
2
|
+
# DECLARE_TARGET target_name [substitute_name]
|
3
|
+
DECLARE_TARGET PI
|
4
|
+
AUTO_DECLARE_TARGETS
|
5
|
+
# DECLARE_TARGET SYSTEM
|
6
|
+
|
7
|
+
# Ethernet Ports
|
8
|
+
#PORT CTS_API 7777
|
9
|
+
#PORT TLMVIEWER_API 7778
|
10
|
+
#PORT CTS_PREIDENTIFIED 7779
|
11
|
+
|
12
|
+
# Default Packet Log Writer and Reader
|
13
|
+
#DEFAULT_PACKET_LOG_WRITER packet_log_writer.rb
|
14
|
+
#DEFAULT_PACKET_LOG_READER packet_log_reader.rb
|
15
|
+
|
16
|
+
# Paths
|
17
|
+
PATH LOGS ./outputs/logs
|
18
|
+
PATH TMP ./outputs/tmp
|
19
|
+
PATH SAVED_CONFIG ./outputs/saved_config
|
20
|
+
PATH TABLES ./outputs/tables
|
21
|
+
PATH HANDBOOKS ./outputs/handbooks
|
22
|
+
PATH PROCEDURES ./procedures
|
23
|
+
|
24
|
+
# Command and Telemetry Database Version (Optional)
|
25
|
+
# CMD_TLM_VERSION version
|
26
|
+
|
27
|
+
# DISABLE_DNS
|
28
|
+
|
29
|
+
ALLOW_ACCESS ALL
|
@@ -0,0 +1,41 @@
|
|
1
|
+
COMMAND COSMOS STARTLOGGING BIG_ENDIAN "Starts logging both commands and telemetry for an interface"
|
2
|
+
APPEND_PARAMETER SYNC 32 UINT 0x1ACFFC1D 0x1ACFFC1D 0x1ACFFC1D "COSMOS Command Sync Pattern"
|
3
|
+
APPEND_ID_PARAMETER OPCODE 32 UINT 2 2 2 "COSMOS Command Opcode"
|
4
|
+
APPEND_PARAMETER LENGTH 32 UINT 0 65536 3 "COSMOS Command Length of Command Data in Bytes"
|
5
|
+
APPEND_PARAMETER INTERFACE 256 STRING "ALL" "Interface to start logging on - ALL starts logging on all interfaces"
|
6
|
+
APPEND_PARAMETER LABEL 0 STRING "" "Optional label to place on log files"
|
7
|
+
|
8
|
+
COMMAND COSMOS STARTCMDLOG BIG_ENDIAN "Starts logging commands for an interface"
|
9
|
+
APPEND_PARAMETER SYNC 32 UINT 0x1ACFFC1D 0x1ACFFC1D 0x1ACFFC1D "COSMOS Command Sync Pattern"
|
10
|
+
APPEND_ID_PARAMETER OPCODE 32 UINT 3 3 3 "COSMOS Command Opcode"
|
11
|
+
APPEND_PARAMETER LENGTH 32 UINT 0 65536 3 "COSMOS Command Length of Command Data in Bytes"
|
12
|
+
APPEND_PARAMETER INTERFACE 256 STRING "ALL" "Interface to start logging on - ALL starts logging on all interfaces"
|
13
|
+
APPEND_PARAMETER LABEL 0 STRING "" "Optional label to place on log files"
|
14
|
+
|
15
|
+
COMMAND COSMOS STARTTLMLOG BIG_ENDIAN "Starts logging telemetry for an interface"
|
16
|
+
APPEND_PARAMETER SYNC 32 UINT 0x1ACFFC1D 0x1ACFFC1D 0x1ACFFC1D "COSMOS Command Sync Pattern"
|
17
|
+
APPEND_ID_PARAMETER OPCODE 32 UINT 4 4 4 "COSMOS Command Opcode"
|
18
|
+
APPEND_PARAMETER LENGTH 32 UINT 0 65536 3 "COSMOS Command Length of Command Data in Bytes"
|
19
|
+
APPEND_PARAMETER INTERFACE 256 STRING "ALL" "Interface to start logging on - ALL starts logging on all interfaces"
|
20
|
+
APPEND_PARAMETER LABEL 0 STRING "" "Optional label to place on log files"
|
21
|
+
|
22
|
+
COMMAND COSMOS STOPLOGGING BIG_ENDIAN "Stops logging both commands and telemetry for an interface"
|
23
|
+
APPEND_PARAMETER SYNC 32 UINT 0x1ACFFC1D 0x1ACFFC1D 0x1ACFFC1D "COSMOS Command Sync Pattern"
|
24
|
+
APPEND_ID_PARAMETER OPCODE 32 UINT 5 5 5 "COSMOS Command Opcode"
|
25
|
+
APPEND_PARAMETER LENGTH 32 UINT 0 65536 3 "COSMOS Command Length of Command Data in Bytes"
|
26
|
+
APPEND_PARAMETER INTERFACE 256 STRING "ALL" "Interface to stop logging on - ALL stops logging on all interfaces"
|
27
|
+
APPEND_PARAMETER LABEL 0 STRING "" "Optional label to place on log files"
|
28
|
+
|
29
|
+
COMMAND COSMOS STOPCMDLOG BIG_ENDIAN "Stops logging commands for an interface"
|
30
|
+
APPEND_PARAMETER SYNC 32 UINT 0x1ACFFC1D 0x1ACFFC1D 0x1ACFFC1D "COSMOS Command Sync Pattern"
|
31
|
+
APPEND_ID_PARAMETER OPCODE 32 UINT 6 6 6 "COSMOS Command Opcode"
|
32
|
+
APPEND_PARAMETER LENGTH 32 UINT 0 65536 3 "COSMOS Command Length of Command Data in Bytes"
|
33
|
+
APPEND_PARAMETER INTERFACE 256 STRING "ALL" "Interface to stop logging on - ALL stops logging on all interfaces"
|
34
|
+
APPEND_PARAMETER LABEL 0 STRING "" "Optional label to place on log files"
|
35
|
+
|
36
|
+
COMMAND COSMOS STOPTLMLOG BIG_ENDIAN "Stops logging telemetry for an interface"
|
37
|
+
APPEND_PARAMETER SYNC 32 UINT 0x1ACFFC1D 0x1ACFFC1D 0x1ACFFC1D "COSMOS Command Sync Pattern"
|
38
|
+
APPEND_ID_PARAMETER OPCODE 32 UINT 7 7 7 "COSMOS Command Opcode"
|
39
|
+
APPEND_PARAMETER LENGTH 32 UINT 0 65536 3 "COSMOS Command Length of Command Data in Bytes"
|
40
|
+
APPEND_PARAMETER INTERFACE 256 STRING "ALL" "Interface to stop logging on - ALL stops logging on all interfaces"
|
41
|
+
APPEND_PARAMETER LABEL 0 STRING "" "Optional label to place on log files"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
TELEMETRY COSMOS VERSION BIG_ENDIAN "COSMOS version information"
|
2
|
+
APPEND_ID_ITEM PKT_ID 8 UINT 1 "Packet ID"
|
3
|
+
APPEND_ITEM COSMOS 240 STRING "COSMOS version"
|
4
|
+
APPEND_ITEM RUBY 240 STRING "Ruby version"
|
5
|
+
APPEND_ITEM CTDB 240 STRING "Command Telemetry Database Version"
|
6
|
+
APPEND_ITEM USER 240 STRING "User Version"
|
7
|
+
|
8
|
+
TELEMETRY COSMOS LIMITS_CHANGE BIG_ENDIAN "COSMOS limits change"
|
9
|
+
APPEND_ID_ITEM PKT_ID 8 UINT 2 "Packet ID"
|
10
|
+
APPEND_ITEM TARGET 240 STRING "Target name"
|
11
|
+
APPEND_ITEM PACKET 240 STRING "Packet name"
|
12
|
+
APPEND_ITEM ITEM 240 STRING "Item that changed limits state"
|
13
|
+
APPEND_ITEM OLD_STATE 240 STRING "The old limit state"
|
14
|
+
APPEND_ITEM NEW_STATE 240 STRING "The new limit state"
|
15
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
SCREEN AUTO AUTO 0.5
|
2
|
+
|
3
|
+
VERTICAL
|
4
|
+
|
5
|
+
TITLE "COSMOS Limits Change"
|
6
|
+
SETTING BACKCOLOR 162 181 205
|
7
|
+
SETTING TEXTCOLOR black
|
8
|
+
|
9
|
+
LABELVALUE COSMOS LIMITS_CHANGE RECEIVED_TIMESECONDS WITH_UNITS 30
|
10
|
+
LABELVALUE COSMOS LIMITS_CHANGE RECEIVED_TIMEFORMATTED WITH_UNITS 30
|
11
|
+
LABELVALUE COSMOS LIMITS_CHANGE RECEIVED_COUNT WITH_UNITS 30
|
12
|
+
LABELVALUE COSMOS LIMITS_CHANGE pkt_id WITH_UNITS 30
|
13
|
+
LABELVALUE COSMOS LIMITS_CHANGE target WITH_UNITS 30
|
14
|
+
LABELVALUE COSMOS limits_change PACKET WITH_UNITS 30
|
15
|
+
LABELVALUE COSMOS limits_change ITEM WITH_UNITS 30
|
16
|
+
LABELVALUE cosmos LIMITS_CHANGE OLD_STATE WITH_UNITS 30
|
17
|
+
LABELVALUE cosmos LIMITS_CHANGE NEW_STATE WITH_UNITS 30
|
18
|
+
END
|
19
|
+
|
20
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
SCREEN AUTO AUTO 0.5
|
2
|
+
|
3
|
+
VERTICAL
|
4
|
+
|
5
|
+
TITLE "COSMOS Version"
|
6
|
+
SETTING BACKCOLOR 162 181 205
|
7
|
+
SETTING TEXTCOLOR black
|
8
|
+
|
9
|
+
LABELVALUE COSMOS VERSION RECEIVED_TIMESECONDS WITH_UNITS 30
|
10
|
+
LABELVALUE COSMOS VERSION RECEIVED_TIMEFORMATTED WITH_UNITS 30
|
11
|
+
LABELVALUE COSMOS VERSION RECEIVED_COUNT WITH_UNITS 30
|
12
|
+
LABELVALUE COSMOS VERSION PKT_ID WITH_UNITS 30
|
13
|
+
LABELVALUE COSMOS VERSION COSMOS WITH_UNITS 30
|
14
|
+
LABELVALUE COSMOS VERSION RUBY WITH_UNITS 30
|
15
|
+
LABELVALUE COSMOS VERSION CTDB WITH_UNITS 30
|
16
|
+
LABELVALUE COSMOS VERSION USER WITH_UNITS 30
|
17
|
+
END
|
18
|
+
|
19
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
TELEMETRY PI TEST LITTLE_ENDIAN "Test Aggregate Packet"
|
2
|
+
APPEND_ID_ITEM TST_PK_ID 16 UINT 149 "Packet ID which must be 149"
|
3
|
+
APPEND_ITEM VALUE_A 8 UINT
|
4
|
+
APPEND_ITEM VALUE_B 8 UINT
|
5
|
+
|
6
|
+
ITEM HEAD_LENGTH 32 16 UINT
|
7
|
+
|
8
|
+
APPEND_ITEM VALUE_C 8 UINT
|
9
|
+
APPEND_ITEM VALUE_D 8 UINT
|
10
|
+
# ITEM TEMP_AVERAGE 0 0 DERIVED "Yo"
|
11
|
+
# READ_CONVERSION multi_field_bit_conversion.rb VALUE_C VALUE_D
|
12
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
TELEMETRY PI TEST_1 LITTLE_ENDIAN "Test Packet"
|
2
|
+
APPEND_ID_ITEM TST_PK_ID 16 UINT 150 "Packet ID which must be 149"
|
3
|
+
APPEND_ITEM VALUE_A 8 UINT
|
4
|
+
APPEND_ITEM VALUE_B 8 UINT
|
5
|
+
|
6
|
+
ITEM HEAD_LENGTH 32 16 UINT
|
7
|
+
|
8
|
+
APPEND_ITEM VALUE_C_0 8 UINT
|
9
|
+
APPEND_ITEM VALUE_D_0 8 UINT
|
10
|
+
APPEND_ITEM VALUE_C_1 8 UINT
|
11
|
+
APPEND_ITEM VALUE_D_1 8 UINT
|
12
|
+
APPEND_ITEM VALUE_C_2 8 UINT
|
13
|
+
APPEND_ITEM VALUE_D_2 8 UINT
|
@@ -0,0 +1,68 @@
|
|
1
|
+
TELEMETRY PI TEST_2 LITTLE_ENDIAN "Test Packet"
|
2
|
+
APPEND_ID_ITEM TST_PK_ID 16 UINT 151 "Packet ID which must be 149"
|
3
|
+
APPEND_ITEM VALUE_A 8 UINT
|
4
|
+
APPEND_ITEM VALUE_B 8 UINT
|
5
|
+
|
6
|
+
ITEM HEAD_LENGTH 32 16 UINT
|
7
|
+
|
8
|
+
APPEND_ITEM VALUE_C_0 8 UINT
|
9
|
+
APPEND_ITEM VALUE_D_0 8 UINT
|
10
|
+
APPEND_ITEM VALUE_C_1 8 UINT
|
11
|
+
APPEND_ITEM VALUE_D_1 8 UINT
|
12
|
+
APPEND_ITEM VALUE_C_2 8 UINT
|
13
|
+
APPEND_ITEM VALUE_D_2 8 UINT
|
14
|
+
APPEND_ITEM VALUE_C_3 8 UINT
|
15
|
+
APPEND_ITEM VALUE_D_3 8 UINT
|
16
|
+
APPEND_ITEM VALUE_C_4 8 UINT
|
17
|
+
APPEND_ITEM VALUE_D_4 8 UINT
|
18
|
+
APPEND_ITEM VALUE_C_5 8 UINT
|
19
|
+
APPEND_ITEM VALUE_D_5 8 UINT
|
20
|
+
APPEND_ITEM VALUE_C_6 8 UINT
|
21
|
+
APPEND_ITEM VALUE_D_6 8 UINT
|
22
|
+
APPEND_ITEM VALUE_C_7 8 UINT
|
23
|
+
APPEND_ITEM VALUE_D_7 8 UINT
|
24
|
+
APPEND_ITEM VALUE_C_8 8 UINT
|
25
|
+
APPEND_ITEM VALUE_D_8 8 UINT
|
26
|
+
APPEND_ITEM VALUE_C_9 8 UINT
|
27
|
+
APPEND_ITEM VALUE_D_9 8 UINT
|
28
|
+
APPEND_ITEM VALUE_C_10 8 UINT
|
29
|
+
APPEND_ITEM VALUE_D_10 8 UINT
|
30
|
+
APPEND_ITEM VALUE_C_11 8 UINT
|
31
|
+
APPEND_ITEM VALUE_D_11 8 UINT
|
32
|
+
APPEND_ITEM VALUE_C_12 8 UINT
|
33
|
+
APPEND_ITEM VALUE_D_12 8 UINT
|
34
|
+
APPEND_ITEM VALUE_C_13 8 UINT
|
35
|
+
APPEND_ITEM VALUE_D_13 8 UINT
|
36
|
+
APPEND_ITEM VALUE_C_14 8 UINT
|
37
|
+
APPEND_ITEM VALUE_D_14 8 UINT
|
38
|
+
APPEND_ITEM VALUE_C_15 8 UINT
|
39
|
+
APPEND_ITEM VALUE_D_15 8 UINT
|
40
|
+
APPEND_ITEM VALUE_C_16 8 UINT
|
41
|
+
APPEND_ITEM VALUE_D_16 8 UINT
|
42
|
+
APPEND_ITEM VALUE_C_17 8 UINT
|
43
|
+
APPEND_ITEM VALUE_D_17 8 UINT
|
44
|
+
APPEND_ITEM VALUE_C_18 8 UINT
|
45
|
+
APPEND_ITEM VALUE_D_18 8 UINT
|
46
|
+
APPEND_ITEM VALUE_C_19 8 UINT
|
47
|
+
APPEND_ITEM VALUE_D_19 8 UINT
|
48
|
+
APPEND_ITEM VALUE_C_20 8 UINT
|
49
|
+
APPEND_ITEM VALUE_D_20 8 UINT
|
50
|
+
APPEND_ITEM VALUE_C_21 8 UINT
|
51
|
+
APPEND_ITEM VALUE_D_21 8 UINT
|
52
|
+
APPEND_ITEM VALUE_C_22 8 UINT
|
53
|
+
APPEND_ITEM VALUE_D_23 8 UINT
|
54
|
+
APPEND_ITEM VALUE_C_24 8 UINT
|
55
|
+
APPEND_ITEM VALUE_D_24 8 UINT
|
56
|
+
APPEND_ITEM VALUE_C_25 8 UINT
|
57
|
+
APPEND_ITEM VALUE_D_25 8 UINT
|
58
|
+
APPEND_ITEM VALUE_C_26 8 UINT
|
59
|
+
APPEND_ITEM VALUE_D_26 8 UINT
|
60
|
+
APPEND_ITEM VALUE_C_27 8 UINT
|
61
|
+
APPEND_ITEM VALUE_D_27 8 UINT
|
62
|
+
APPEND_ITEM VALUE_C_28 8 UINT
|
63
|
+
APPEND_ITEM VALUE_D_28 8 UINT
|
64
|
+
APPEND_ITEM VALUE_C_29 8 UINT
|
65
|
+
APPEND_ITEM VALUE_D_29 8 UINT
|
66
|
+
APPEND_ITEM VALUE_C_30 8 UINT
|
67
|
+
APPEND_ITEM VALUE_D_30 8 UINT
|
68
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
TELEMETRY PI TEST_3 LITTLE_ENDIAN "Test Aggregate Packet"
|
2
|
+
APPEND_ID_ITEM TST_PK_ID 16 UINT 153 "Packet ID which must be 149"
|
3
|
+
APPEND_ITEM VALUE_A 8 INT
|
4
|
+
APPEND_ITEM VALUE_B 8 INT
|
5
|
+
|
6
|
+
ITEM HEAD_LENGTH 32 16 UINT
|
7
|
+
|
8
|
+
APPEND_ITEM VALUE_C 16 UINT
|
9
|
+
APPEND_ITEM VALUE_D 4 UINT
|
10
|
+
# ITEM TEMP_AVERAGE 0 0 DERIVED "Yo"
|
11
|
+
# READ_CONVERSION multi_field_bit_conversion.rb VALUE_C VALUE_D
|
12
|
+
|
@@ -0,0 +1,4 @@
|
|
1
|
+
#INTERFACE NAME INTERFACE FILE WRITE READ W TIMEOUT R TIMEOUT STREAM ARGUMENTS
|
2
|
+
#-----------------------------------------------------------------------------------------------------------------------------------------
|
3
|
+
INTERFACE PI_TCPIP unpacking_interface.rb 4810 4810 nil nil LENGTH 32 16 7 1 LITTLE_ENDIAN 0 nil 10532
|
4
|
+
TARGET PI
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "cosmos-multi_field_bit_conversion"
|
7
|
+
spec.version = "0.1.0"
|
8
|
+
spec.authors = ["Nick Benoit"]
|
9
|
+
spec.email = ["nick.benoit14@gmail.com"]
|
10
|
+
spec.description = %q{A cosmos read conversion designed to combine the bits of several uint fields.
|
11
|
+
}
|
12
|
+
spec.summary = %q{Combine cosmos uint fields of differing bit lengths where values on the left are more significant, and values on the right are less significant. This conversaion will work with any number of uint fields, of any size.}
|
13
|
+
spec.homepage = "https://github.com/nick-benoit14/cosmos-multi_field_bit_conversion"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
|
24
|
+
|
25
|
+
spec.add_runtime_dependency "cosmos", "4.3"
|
26
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require "cosmos/conversions/conversion"
|
2
|
+
|
3
|
+
module Cosmos
|
4
|
+
class MultiFieldBitConversion < Conversion
|
5
|
+
def initialize(*args)
|
6
|
+
super()
|
7
|
+
@fields = args
|
8
|
+
end
|
9
|
+
|
10
|
+
def call(value, packet, buffer)
|
11
|
+
return 0 if @fields.empty?
|
12
|
+
|
13
|
+
items = @fields.map {|f| packet.get_item(f)}
|
14
|
+
type = items.map{|i| i.data_type }.uniq.first
|
15
|
+
size = items.map{|i| i.bit_size }.sum
|
16
|
+
|
17
|
+
@converted_type = type
|
18
|
+
@converted_bit_size = size
|
19
|
+
|
20
|
+
items.reduce(0) do |acc, item|
|
21
|
+
shifted = acc << item.bit_size
|
22
|
+
shifted|packet.read(item.name)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require_relative 'test_helper'
|
2
|
+
require 'cosmos'
|
3
|
+
require 'test/unit'
|
4
|
+
require 'pry'
|
5
|
+
|
6
|
+
module Cosmos
|
7
|
+
#module MultiFieldBitConversion
|
8
|
+
class TestMultiFieldBitConversion < Test::Unit::TestCase
|
9
|
+
def self.build_agg_packet
|
10
|
+
packet = System.telemetry.packet('PI', 'TEST_3')
|
11
|
+
|
12
|
+
|
13
|
+
packet.write('TST_PK_ID', 150)
|
14
|
+
packet.write('VALUE_A', 100)
|
15
|
+
packet.write('VALUE_B', -10)
|
16
|
+
|
17
|
+
packet.write('VALUE_C', 140) #8c
|
18
|
+
packet.write('VALUE_D', 7) #7
|
19
|
+
packet
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_uint
|
23
|
+
packet = self.class.build_agg_packet
|
24
|
+
conversion = MultiFieldBitConversion.new('VALUE_C', 'VALUE_D')
|
25
|
+
result = conversion.call(nil, packet, [])
|
26
|
+
assert_equal result, 2247 # 8c7
|
27
|
+
assert_equal conversion.converted_type, :UINT
|
28
|
+
assert_equal conversion.converted_bit_size, 20
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_int
|
32
|
+
packet = self.class.build_agg_packet
|
33
|
+
conversion = MultiFieldBitConversion.new('VALUE_B', 'VALUE_A')
|
34
|
+
result = conversion.call(nil, packet, [])
|
35
|
+
assert_equal result, -2460
|
36
|
+
assert_equal conversion.converted_type, :INT
|
37
|
+
assert_equal conversion.converted_bit_size, 16
|
38
|
+
end
|
39
|
+
end
|
40
|
+
#end
|
41
|
+
end
|
data/test/test_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cosmos-multi_field_bit_conversion
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Nick Benoit
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-04-20 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: cosmos
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '4.3'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '4.3'
|
55
|
+
description: 'A cosmos read conversion designed to combine the bits of several uint
|
56
|
+
fields.
|
57
|
+
|
58
|
+
'
|
59
|
+
email:
|
60
|
+
- nick.benoit14@gmail.com
|
61
|
+
executables: []
|
62
|
+
extensions: []
|
63
|
+
extra_rdoc_files: []
|
64
|
+
files:
|
65
|
+
- ".gitignore"
|
66
|
+
- Gemfile
|
67
|
+
- LICENSE.txt
|
68
|
+
- README.md
|
69
|
+
- Rakefile
|
70
|
+
- config/data/README.txt
|
71
|
+
- config/data/crc.txt
|
72
|
+
- config/system/system.txt
|
73
|
+
- config/targets/COSMOS/cmd_tlm/cosmos_server_cmds.txt
|
74
|
+
- config/targets/COSMOS/cmd_tlm/cosmos_server_tlm.txt
|
75
|
+
- config/targets/COSMOS/cmd_tlm_server.txt
|
76
|
+
- config/targets/COSMOS/screens/limits_change.txt
|
77
|
+
- config/targets/COSMOS/screens/version.txt
|
78
|
+
- config/targets/COSMOS/target.txt
|
79
|
+
- config/targets/PI/cmd_tlm/pi_tlm_test.txt
|
80
|
+
- config/targets/PI/cmd_tlm/pi_tlm_test_1.txt
|
81
|
+
- config/targets/PI/cmd_tlm/pi_tlm_test_2.txt
|
82
|
+
- config/targets/PI/cmd_tlm/pi_tlm_test_3.txt
|
83
|
+
- config/targets/PI/cmd_tlm_server.txt
|
84
|
+
- config/targets/PI/target.txt
|
85
|
+
- cosmos-multi_field_bit_conversion.gemspec
|
86
|
+
- lib/cosmos/multi_field_bit_conversion.rb
|
87
|
+
- test/multi_field_bit_conversion_test.rb
|
88
|
+
- test/test_helper.rb
|
89
|
+
homepage: https://github.com/nick-benoit14/cosmos-multi_field_bit_conversion
|
90
|
+
licenses:
|
91
|
+
- MIT
|
92
|
+
metadata: {}
|
93
|
+
post_install_message:
|
94
|
+
rdoc_options: []
|
95
|
+
require_paths:
|
96
|
+
- lib
|
97
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0'
|
107
|
+
requirements: []
|
108
|
+
rubyforge_project:
|
109
|
+
rubygems_version: 2.4.8
|
110
|
+
signing_key:
|
111
|
+
specification_version: 4
|
112
|
+
summary: Combine cosmos uint fields of differing bit lengths where values on the left
|
113
|
+
are more significant, and values on the right are less significant. This conversaion
|
114
|
+
will work with any number of uint fields, of any size.
|
115
|
+
test_files:
|
116
|
+
- test/multi_field_bit_conversion_test.rb
|
117
|
+
- test/test_helper.rb
|