fldigi 0.0.13 → 0.0.14
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.
- data/lib/fldigi.rb +30 -12
- metadata +1 -1
data/lib/fldigi.rb
CHANGED
@@ -27,6 +27,10 @@
|
|
27
27
|
#
|
28
28
|
# Version History:
|
29
29
|
#
|
30
|
+
# 0.0.14 - 06/28/2014 - jfrancis - Be more consistent about to_f vs.
|
31
|
+
# to_i. Also, add a function to return actual radio freq (instead of
|
32
|
+
# specified freq).
|
33
|
+
#
|
30
34
|
# 0.0.13 - 06/11/2014 - jfrancis - A bunch of clean-up here. I almost
|
31
35
|
# certainly broke some code with this one. I changed @freq to
|
32
36
|
# @dial_freq to more accurately reflect what's going on, and added a
|
@@ -264,14 +268,14 @@ class Fldigi
|
|
264
268
|
# all-purpose solution to this one, but at least it allows for
|
265
269
|
# consistent and automated use of the library without having to do
|
266
270
|
# the conversions in your own code.
|
267
|
-
@dial_freq=@dial_freq.
|
271
|
+
@dial_freq=@dial_freq.to_i
|
268
272
|
if (@dial_freq!=@dial_freq_old or @offset!=@offset_old) and @rigctl
|
269
273
|
@dial_freq_old=@dial_freq
|
270
274
|
@offset_old=@offset
|
271
|
-
if @dial_freq+@offset.
|
272
|
-
self.sendcmd("main.set_frequency", @dial_freq+@offset.
|
275
|
+
if @dial_freq+@offset.to_i!=self.sendcmd("main.get_frequency").to_i
|
276
|
+
self.sendcmd("main.set_frequency", @dial_freq+@offset.to_i)
|
273
277
|
sleep 0.5
|
274
|
-
if @dial_freq+@offset.
|
278
|
+
if @dial_freq+@offset.to_i!=self.sendcmd("main.get_frequency").to_i
|
275
279
|
return false
|
276
280
|
end
|
277
281
|
end
|
@@ -311,14 +315,22 @@ class Fldigi
|
|
311
315
|
end
|
312
316
|
end
|
313
317
|
|
314
|
-
# Get/set the
|
315
|
-
#
|
316
|
-
#
|
317
|
-
#
|
318
|
-
#
|
319
|
-
#
|
320
|
-
#
|
321
|
-
#
|
318
|
+
# Get/set the transmit frequency (dial frequency plus carrier). If
|
319
|
+
# you don't supply a parameter, this method returns the transmit
|
320
|
+
# frequency you most recently specified. IMPORTANT: The returned
|
321
|
+
# value may not be where the radio is currently tuned. This
|
322
|
+
# function returns what you *told* the radio to be, which could be
|
323
|
+
# different than what it's currently set to. It's entirely possible
|
324
|
+
# that the user turned the knob after you set the frequency. If you
|
325
|
+
# want to see what the radio is *actually* tuned to, use the
|
326
|
+
# radio_freq() method (below). This method does, however, go out
|
327
|
+
# and read the actual current carrier, as that tends to float around
|
328
|
+
# due to both the user clicking on the waterfall, and naturally due
|
329
|
+
# to AFC. If you do supply a parameter, it sets the transmit
|
330
|
+
# frequency by subtracting the currently requested carrier (ie, not
|
331
|
+
# the actual current carrier, but what you set @carrier to) from the
|
332
|
+
# supplied frequency, then setting @dial_freq to that value. For
|
333
|
+
# example, if @carrier was set to 1000 and you called
|
322
334
|
# self.freq(14071000), @dial_freq would be set to 14070000. Note
|
323
335
|
# that this only sets up all the values in the object, you still
|
324
336
|
# have to "push" them to the radio with the self.config() method.
|
@@ -330,6 +342,12 @@ class Fldigi
|
|
330
342
|
end
|
331
343
|
end
|
332
344
|
|
345
|
+
# Read the real freq plus real carrier from the radio (contrast with
|
346
|
+
# freq() above).
|
347
|
+
def radio_freq
|
348
|
+
return (self.sendcmd("main.get_frequency").to_i+self.get_carrier()).to_i
|
349
|
+
end
|
350
|
+
|
333
351
|
# Send the currently buffered data using the carrier, mode,
|
334
352
|
# frequency, etc. currently configured. The current code will wait
|
335
353
|
# up to @start_wait (10) seconds for the first character to be
|