rfbeam 0.3.1 → 0.3.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8b330fbbd75049114a6b8be3c4870ac68723bb2a25fd0870e40e81304f215cc7
4
- data.tar.gz: f740ced4593c75173d216527ab4f0afcaf85cb323097a8b7a86f9c3ad7717a74
3
+ metadata.gz: daed0b3716d78b7783768008f4fb69a0b1dd790fe23aaaceb4682b8c68982341
4
+ data.tar.gz: 74b70ca29f4065966a59ab2801e0d1eaefbf7fab45f67a8b70062fd8cf944cff
5
5
  SHA512:
6
- metadata.gz: 5c6e265438debcac0e7a3cae53cbe68a589e9eca2529f57ca49179b70aa7ded7e8d0dab2052a748319fe6d02fe4b74640907c3909603e58b13f0b632cb5bbed5
7
- data.tar.gz: eb1d53dea2e385a06c8729657f3a9283c2da19120ce122c5b763ba83dc980235ae543bf31fc53e2b27338b43eeed760e2cf7fef407e8e9ac34f866916bc60bd5
6
+ metadata.gz: f4c29ec4115d65fb0fd8dd565c070d3124cf8ef32e863fd236346faac28265960c7e872ba166463180c84f20cc7db04b184551cfbda804bbcf98cb7d7de5e81f
7
+ data.tar.gz: 9e5763c1acbd1c4f4f45bdd481d4efc4fa66cff721f8ebfda263d89548110fe538bdbd8b4b36ad65f08f523fb3256a8052c275c039ba4e01b3394baaadfc689b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [0.3.1] - 2023-3-28
2
2
 
3
+ - Added setters for Parameter settings
4
+
5
+ ## [0.3.1] - 2023-3-28
6
+
3
7
  - Added setter for Max Distance
4
8
  - Added setter for Max Speed
5
9
  - Added setter for Threshold offset
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rfbeam (0.3.0)
4
+ rfbeam (0.3.1)
5
5
  activesupport (~> 6.1.0)
6
6
  rubyserial (~> 0.6.0)
7
7
  thor (~> 1.2.1)
data/README.md CHANGED
@@ -59,7 +59,7 @@ Returns the Parameter settings, values map to setting as detailed in the device
59
59
 
60
60
  ### config
61
61
 
62
- Returns a formatted String of all parameter settings
62
+ Returns a formatted String of all parameter settings. The only way to read parameter settings is with config
63
63
 
64
64
  radar.config
65
65
 
@@ -86,6 +86,198 @@ Returns a formatted String of all parameter settings
86
86
  Micro Detection Retrigger: Off
87
87
  Micro Detection Sensitivity: 4 (0 - 9, 0 = Min, 9 = Max)
88
88
 
89
+ ## Parameter setters
90
+
91
+ ### Base Frequency
92
+
93
+ 0 = low, 1 = middle (default), 2 = high
94
+
95
+ alias :rbfr
96
+
97
+ ```ruby
98
+ set_base_frequency(1)
99
+ ```
100
+
101
+ ### Maximum Speed
102
+
103
+ 0 = 12.5km/h, 1 = 25km/h (default), 2 = 50km/h, 3 = 100km/h, alias :rspi
104
+
105
+ ```ruby
106
+ set_max_speed(1)
107
+ ```
108
+
109
+ ### Maximum Range
110
+
111
+ 0 = 5m, 1 = 10m (default), 2 = 30m, 3 = 100m, alias :rrai
112
+
113
+ ```ruby
114
+ set_max_range(1)
115
+ ```
116
+
117
+ ### Threshold Offset
118
+
119
+ 10 - 60db, (default = 30), alias :thof
120
+
121
+ ```ruby
122
+ set_threshold_offset(30)
123
+ ```
124
+
125
+ ### Tracking filter type
126
+
127
+ 0 = Standard (Default), 1 = Fast Tracking, 2 = Long visibility, alias :trtf
128
+
129
+ ```ruby
130
+ set_tracking_filter(0)
131
+ ```
132
+
133
+ ### Vibration suppression
134
+
135
+ 0 - 16, 0 = No Suppression, 16 = High Suppression, default = 2, alias :visu
136
+
137
+ ```ruby
138
+ set_vibration_suppression(2)
139
+ ```
140
+
141
+ ### Minimum Detection distance
142
+
143
+ 0 - 100% of Range setting, default = 0, alias :mira
144
+
145
+ ```ruby
146
+ set_min_detection_distance(0)
147
+ ```
148
+
149
+ ### Maximum Detection distance
150
+
151
+ 0 - 100% of Range setting, default = 50, alias :mara
152
+
153
+ ```ruby
154
+ set_max_detection_distance(50)
155
+ ```
156
+
157
+ ### Minimum Detection Angle
158
+
159
+ -90° - 90°, default = -90, alias :mian
160
+
161
+ ```ruby
162
+ set_min_detection_angle(-90
163
+ ```
164
+
165
+ ### Maximum Detection Angle
166
+
167
+ -90° - 90°, default = 90, alias :maan
168
+
169
+ ```ruby
170
+ set_min_detection_angle(90)
171
+ ```
172
+
173
+ ### Minimum Detection Speed
174
+
175
+ 0 - 100% of Speed setting, default = 0, alias :misp
176
+
177
+ ```ruby
178
+ set_min_detection_speed(0)
179
+ ```
180
+
181
+ ### Maximum Detection Speed
182
+
183
+ 0 - 100% of Speed setting, default = 100, alias :masp
184
+
185
+ ```ruby
186
+ set_max_detection_speed(100)
187
+ ```
188
+
189
+ ### Detection Direction
190
+
191
+ 0 = Receding, 1 = Approaching, 2 = Both (default), alias :dedi
192
+
193
+ ```ruby
194
+ set_detection_direction(2)
195
+ ```
196
+
197
+ ### Range Threshold
198
+
199
+ 0 - 100% of Range setting, default = 10, alias :rath
200
+
201
+ ```ruby
202
+ set_range_threshold(10)
203
+ ```
204
+
205
+ ### Angle Threshold
206
+
207
+ -90° to 90°, default = 0, alias :anth
208
+
209
+ ```ruby
210
+ set_range_threshold(0)
211
+ ```
212
+
213
+ ### Speed Threshold
214
+
215
+ 0 - 100% of speed setting, default = 50, alias :spth
216
+
217
+ ```ruby
218
+ set_angle_threshold(50)
219
+ ```
220
+
221
+ ### Digital output 1
222
+
223
+ 0 = Direction, 1 = Angle, 2 = Range, 3 = Speed, 4 = Micro Detection, default = 0
224
+
225
+ alias :dig1, :set_dio_1
226
+
227
+ ```ruby
228
+ set_dio_1(0)
229
+ ```
230
+
231
+ ### Digital output 2
232
+
233
+ 0 = Direction, 1 = Angle, 2 = Range, 3 = Speed, 4 = Micro Detection, default = 1
234
+
235
+ alias :dig2, :set_dio_2
236
+
237
+ ```ruby
238
+ set_dio_2(1)
239
+ ```
240
+
241
+ ### Digital output 3
242
+
243
+ 0 = Direction, 1 = Angle, 2 = Range, 3 = Speed, 4 = Micro Detection, default = 2
244
+
245
+ alias :dig3, :set_dio_3
246
+
247
+ ```ruby
248
+ set_dio_3(2)
249
+ ```
250
+
251
+ ### Hold Time
252
+
253
+ 1 - 7200s, default = 1
254
+
255
+ alias :hold
256
+
257
+ ```ruby
258
+ set_hold_time(1)
259
+ ```
260
+
261
+ ### Micro Detection retrigger
262
+
263
+ 0 = Off (default), 1 = Retrigger
264
+
265
+ alias: :mide
266
+
267
+ ```ruby
268
+ set_micro_detection_retrigger(0)
269
+ ```
270
+
271
+ ### Micro Detection sensitivity
272
+
273
+ 0 - 9, 0 = Min, 9 = Max, default = 4
274
+
275
+ alias: :mids
276
+
277
+ ```ruby
278
+ set_micro_detection_sensitivty(4)
279
+ ```
280
+
89
281
  ## Development
90
282
 
91
283
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -32,7 +32,7 @@ module RfBeam
32
32
 
33
33
  # Maximum Range, 0 = 5m, 1 = 10m (default), 2 = 30m, 3 = 100m
34
34
  def set_max_range(range = 1)
35
- set_parameter :rrai, range, :unit8
35
+ set_parameter :rrai, range, :uint8
36
36
  end
37
37
  alias_method :rrai, :set_max_range
38
38
 
@@ -41,9 +41,143 @@ module RfBeam
41
41
  range = 10..60
42
42
  return false unless range.include?(offset)
43
43
 
44
- set_parameter :thof, range, :unit8
44
+ set_parameter :thof, offset, :uint8
45
45
  end
46
46
  alias_method :thof, :set_threshold_offset
47
+
48
+ # Tracking filter type, 0 = Standard (Default), 1 = Fast Tracking, 2 = Long visibility
49
+ def set_tracking_filter(type = 0)
50
+ set_parameter :trft, type, :uint8
51
+ end
52
+ alias_method :trtf, :set_tracking_filter
53
+
54
+ # Vibration suppression, 0 - 16, 0 = No Suppression, 16 = High Suppression, default = 2
55
+ def set_vibration_suppression(value = 2)
56
+ set_parameter :visu, value, :uint8
57
+ end
58
+ alias_method :visu, :set_vibration_suppression
59
+
60
+ # Minimum Detection distance, 0 - 100% of Range setting, default = 0
61
+ def set_min_detection_distance(value = 0)
62
+ set_parameter :mira, value, :uint8
63
+ end
64
+ alias_method :mira, :set_min_detection_distance
65
+
66
+ # Maximum Detection distance, 0 - 100% of Range setting, default = 50
67
+ def set_max_detection_distance(value = 50)
68
+ set_parameter :mara, value, :uint8
69
+ end
70
+ alias_method :mara, :set_max_detection_distance
71
+
72
+ # Minimum Detection Angle, -90° - 90°, default = -90
73
+ def set_min_detection_angle(angle = -90)
74
+ set_parameter :mian, angle, :int8
75
+ end
76
+ alias_method :mian, :set_min_detection_distance
77
+
78
+ # Maximum Detection Angle, -90° - 90°, default = 90
79
+ def set_min_detection_angle(angle = 90)
80
+ set_parameter :maan, angle, :int8
81
+ end
82
+ alias_method :maan, :set_min_detection_angle
83
+
84
+ # Minimum Detection Speed, 0 - 100% of Speed setting, default = 0
85
+ def set_min_detection_speed(speed = 0)
86
+ set_parameter :misp, speed, :uint8
87
+ end
88
+ alias_method :misp, :set_min_detection_speed
89
+
90
+ # Maximum Detection Speed, 0 - 100% of Speed setting, default = 100
91
+ def set_max_detection_speed(speed = 100)
92
+ set_parameter :masp, speed, :uint8
93
+ end
94
+ alias_method :masp, :set_max_detection_speed
95
+
96
+ # Detection Direction, 0 = Receding, 1 = Approaching, 2 = Both (default)
97
+ def set_detection_direction(direction = 2)
98
+ set_parameter :dedi, direction, :uint8
99
+ end
100
+ alias_method :dedi, :set_detection_direction
101
+
102
+ # Range Threshold, 0 - 100% of Range setting, default = 10
103
+ def set_range_threshold(value = 10)
104
+ range = 0..100
105
+ return false unless range.include?(value)
106
+
107
+ set_parameter :rath, value, :uint8
108
+ end
109
+ alias_method :rath, :set_range_threshold
110
+
111
+ # Angle Threshold, -90° to 90°, default = 0
112
+ def set_range_threshold(value = 0)
113
+ range = -90..90
114
+ return false unless range.include?(value)
115
+
116
+ set_parameter :anth, value, :int8
117
+ end
118
+ alias_method :anth, :set_range_threshold
119
+
120
+ # Speed Threshold, 0 - 100% of speed setting, default = 50
121
+ def set_angle_threshold(value = 50)
122
+ range = 0..100
123
+ return false unless range.include?(value)
124
+
125
+ set_parameter :spth, value, :uint8
126
+ end
127
+ alias_method :spth, :set_angle_threshold
128
+
129
+ # Digital output 1, 0 = Direction, 1 = Angle, 2 = Range, 3 = Speed, 4 = Micro Detection, default = 0
130
+ def set_dio_1(value = 0)
131
+ range = 0..4
132
+ return false unless range.include?(value)
133
+
134
+ set_parameter :dig1, value, :uint8
135
+ end
136
+ alias_method :dig1, :set_dio_1
137
+
138
+ # Digital output 2, 0 = Direction, 1 = Angle, 2 = Range, 3 = Speed, 4 = Micro Detection, default = 1
139
+ def set_dio_2(value = 1)
140
+ range = 0..4
141
+ return false unless range.include?(value)
142
+
143
+ set_parameter :dig2, value, :uint8
144
+ end
145
+ alias_method :dig2, :set_dio_2
146
+
147
+ # Digital output 3, 0 = Direction, 1 = Angle, 2 = Range, 3 = Speed, 4 = Micro Detection, default = 2
148
+ def set_dio_3(value = 2)
149
+ range = 0..4
150
+ return false unless range.include?(value)
151
+
152
+ set_parameter :dig3, value, :uint8
153
+ end
154
+ alias_method :dig3, :set_dio_3
155
+
156
+ # Hold Time, 1 - 7200s, default = 1
157
+ def set_hold_time(time = 1)
158
+ range = 1..7200
159
+ return false unless range.include?(time)
160
+
161
+ set_parameter :hold, time, :uint16
162
+ end
163
+ alias_method :hold, :set_hold_time
164
+
165
+ # Micro Detection retrigger, 0 = Off (default), 1 = Retrigger
166
+ def set_micro_detection_retrigger(value = 0)
167
+ return false unless (value == 0 || value == 1)
168
+
169
+ set_parameter :mide, value, :uint8
170
+ end
171
+ alias_method :mide, :set_micro_detection_retrigger
172
+
173
+ # Micro Detection sensitivity, 0 - 9, 0 = Min, 9 = Max, default = 4
174
+ def set_micro_detection_sensitivty(value = 4)
175
+ range = 0..9
176
+ return false unless range.include?(value)
177
+
178
+ set_parameter :mids, value, :uint8
179
+ end
180
+ alias_method :mids, :set_micro_detection_sensitivty
47
181
 
48
182
  private
49
183
 
@@ -76,10 +210,10 @@ module RfBeam
76
210
  output << "Minimum Detection Distance: #{data[9]} , (#{PARAMETER_STRUCTURE[:min_detection_distance]})\n"
77
211
  output << "Maximum Detection Distance: #{data[10]} , (#{PARAMETER_STRUCTURE[:max_detection_distance]})\n"
78
212
  output << "Minimum Detection Angle: #{data[11]}° , (#{PARAMETER_STRUCTURE[:min_detection_angle]})\n"
79
- output << "Maximum Detection Angle: #{data[12]}° , (#{PARAMETER_STRUCTURE[:max_detection_distance]})\n"
80
- output << "Maximum Detection Speed: #{data[13]} , (#{PARAMETER_STRUCTURE[:min_detection_speed]})\n"
213
+ output << "Maximum Detection Angle: #{data[12]}° , (#{PARAMETER_STRUCTURE[:max_detection_angle]})\n"
214
+ output << "Minimum Detection Speed: #{data[13]} , (#{PARAMETER_STRUCTURE[:min_detection_speed]})\n"
81
215
  output << "Maximum Detection Speed: #{data[14]} , (#{PARAMETER_STRUCTURE[:max_detection_speed]})\n"
82
- output << "Detection Direction: #{data[15]}"
216
+ output << "Detection Direction: #{PARAMETER_STRUCTURE[:detection_direction][data[15]]}\n"
83
217
  output << "Range Threshold: #{data[16]}%, (#{PARAMETER_STRUCTURE[:range_threshold]})\n"
84
218
  output << "Angle Threshold: #{data[17]}°, (#{PARAMETER_STRUCTURE[:angle_threshold]})\n"
85
219
  output << "Speed Threshold: #{data[18]}%, (#{PARAMETER_STRUCTURE[:speed_threshold]})\n"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RfBeam
4
- VERSION = '0.3.1'
4
+ VERSION = '0.3.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rfbeam
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Carruthers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-28 00:00:00.000000000 Z
11
+ date: 2023-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport