fldigi 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/fldigi.rb +27 -6
  2. metadata +1 -1
@@ -18,6 +18,8 @@
18
18
 
19
19
  # Version History:
20
20
  #
21
+ # 0.0.11 - 05/29/2014 - jfrancis - Added optional offset.
22
+ #
21
23
  # 0.0.10 - 05/26/2014 - jfrancis - Forgot the 'require'.
22
24
  #
23
25
  # 0.0.9 - 05/26/2014 - jfrancis - Added a lot of code comments.
@@ -34,7 +36,7 @@
34
36
  require "xmlrpc/client"
35
37
 
36
38
  class Fldigi
37
- attr_accessor :rigctl, :freq, :carrier, :call, :modem, :afc, :rsid, :sideband, :squelch, :slevel, :spot, :delay, :grid, :phg, :band
39
+ attr_accessor :rigctl, :freq, :carrier, :call, :modem, :afc, :rsid, :sideband, :squelch, :slevel, :spot, :delay, :grid, :phg, :band, :offset
38
40
 
39
41
  # Do the initial setup. All arguments are optional, default is
40
42
  # rigctl, localhost, standard port. If you have no rig control,
@@ -70,6 +72,8 @@ class Fldigi
70
72
  @slevel_old=nil
71
73
  @spot=nil
72
74
  @spot_old=nil
75
+ @offset=0
76
+ @offset_old=0
73
77
 
74
78
  # Propnet stuff.
75
79
  @band=nil
@@ -197,14 +201,31 @@ class Fldigi
197
201
  # seconds work with all of my radios, but it's possible this will
198
202
  # need to be tweaked. Send me an e-mail if this value is not
199
203
  # adequate for your radio, and I'll figure out a plan. So far, it
200
- # works on my IC-706MkII, my IC-756Pro, and my FT-817.
204
+ # works on my IC-706MkII, my IC-756Pro, and my FT-817. The value
205
+ # for @offset is added to the desired frequency. This is for use
206
+ # when you want all of your radios to be on a very specific given
207
+ # frequency. You must choose one as "the standard", then figure
208
+ # out the offset for each rig from that standard. For example, my
209
+ # FT-817 transmits 180hz lower (for a given equal temperature).
210
+ # Assuming I've chosen my IC-706MkII as my standard (of course,
211
+ # you could use WWV or some such, as well), I need to set @offset
212
+ # to -180 whenever using my FT-817 if I want them to be on the
213
+ # exact same frequency. This value could be added to either the
214
+ # dial frequency or the carrier. I chose the dial frequency,
215
+ # since a lot of people reference the carrier more often than the
216
+ # dial. That way, when one person says he's at "1000", it'll be
217
+ # "1000" on the other radio, as well. There's no good, clean,
218
+ # all-purpose solution to this one, but at least it allows for
219
+ # consistent and automated use of the library without having to do
220
+ # the conversions in your own code.
201
221
  @freq=@freq.to_f
202
- if @freq!=@freq_old and @rigctl
222
+ if (@freq!=@freq_old or @offset!=@offset_old) and @rigctl
203
223
  @freq_old=@freq
204
- if @freq!=self.sendcmd("main.get_frequency")
205
- self.sendcmd("main.set_frequency", @freq)
224
+ @offset_old=@offset
225
+ if @freq+@offset.to_f!=self.sendcmd("main.get_frequency")
226
+ self.sendcmd("main.set_frequency", @freq+@offset.to_f)
206
227
  sleep 0.5
207
- if @freq!=self.sendcmd("main.get_frequency")
228
+ if @freq+@offset.to_f!=self.sendcmd("main.get_frequency")
208
229
  return false
209
230
  end
210
231
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fldigi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: