Skip to content

Instantly share code, notes, and snippets.

@btgoodwin
Created April 22, 2015 17:56
Show Gist options
  • Save btgoodwin/3c3eb1fffc66c04f5f74 to your computer and use it in GitHub Desktop.
Save btgoodwin/3c3eb1fffc66c04f5f74 to your computer and use it in GitHub Desktop.
Simple set of frontend GPS definitions in Python since the code generator doesn't support it right now.
'''
This can be pasted at the head of your implementation class file. In your implementation
initialize() method, replace the port with this new one and add 2 private members attached
to two public properties:
def initialize(self):
baseclass.initialize()
self.port_port_name = self.My_PortFRONTENDGPSIn(self, 'port_name')
self._GPSInfo = GPSInfo()
self._GpsTimePos = GpsTimePos()
@property
def GPSInfo(self):
return self._GPSInfo
@property
def GpsTimePos(self):
return self._GpsTimePos
Then implement whatever methods of updating those two GPS structures however you need.
'''
import bulkio
# https://github.com/RedhawkSDR/frontendInterfaces/blob/develop-2.2/Frontend.idl
class PositionInfo:
valid = False
datum = ''
lat = 0.0
lon = 0.0
alt = 0.0
# https://github.com/RedhawkSDR/frontendInterfaces/blob/develop-2.2/GPS.idl
class GPSInfo:
source_id = ''
rf_flow_id = ''
mode = ''
fom = 0
tfom = 0
datumID = 0
time_offset = 0.0
freq_offset = 0.0
time_variance = 0.0
freq_variance = 0.0
satellite_count = 0
snr = 0.0
status_message = ''
timestamp = bulkio.timestamp.now()
additional_info = []
class GpsTimePos:
position = PositionInfo()
timestamp = bulkio.timestamp.now()
class My_PortFRONTENDGPSIn(PortFRONTENDGPSIn_i):
def _get_gps_info(self):
return self.parent.GPSInfo
def _get_gps_time_pos(self):
return self.parent.GpsTimePos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment