Class: Radio::Rig

Inherits:
Object
  • Object
show all
Includes:
LO, Rx, SSB, Spectrum, Utils
Defined in:
lib/radio/rig.rb,
lib/radio/rig/lo.rb,
lib/radio/rig/rx.rb,
lib/radio/rig/ssb.rb,
lib/radio/rig/spectrum.rb

Defined Under Namespace

Modules: LO, Rx, SSB, Spectrum

Constant Summary

Constants included from Utils

Utils::FIRPM_CACHE_FILENAME, Utils::FIRPM_CACHE_VERSION

Instance Method Summary collapse

Methods included from SSB

#af=, #set_lsb, #set_usb, #tune=

Methods included from LO

#lo, #lo=

Methods included from Rx

#rx=

Methods included from Spectrum

#spectrum

Methods included from Utils

firpm, hamming_window, hamming_window!, kaiser_estimate

Constructor Details

#initializeRig

Returns a new instance of Rig.



26
27
28
29
30
31
# File 'lib/radio/rig.rb', line 26

def initialize
  @semaphore = Mutex.new
  @listeners = {}
  @listeners_mutex = Mutex.new
  super
end

Instance Method Details

#deregister(queue) ⇒ Object



39
40
41
42
43
# File 'lib/radio/rig.rb', line 39

def deregister queue
  @listeners_mutex.synchronize do
    @listeners.delete queue
  end
end

#iq?Boolean

Returns:

  • (Boolean)


52
53
54
55
56
57
# File 'lib/radio/rig.rb', line 52

def iq?
  @semaphore.synchronize do
    return @rx.input_channels == 2 if @rx
    return false
  end
end

#rateObject



45
46
47
48
49
50
# File 'lib/radio/rig.rb', line 45

def rate
  @semaphore.synchronize do
    return @rx.rate if @rx
    return 0
  end
end

#register(queue) ⇒ Object



33
34
35
36
37
# File 'lib/radio/rig.rb', line 33

def register queue
  @listeners_mutex.synchronize do
    @listeners[queue] = true
  end
end