diff options
-rw-r--r-- | gr-vrt/src/vrt_quadradio_source_32fc.h | 10 | ||||
-rw-r--r-- | gr-vrt/src/vrt_source_32fc.cc | 22 | ||||
-rw-r--r-- | gr-vrt/src/vrt_source_32fc.h | 6 | ||||
-rw-r--r-- | gr-wxgui/src/python/forms/forms.py | 8 |
4 files changed, 34 insertions, 12 deletions
diff --git a/gr-vrt/src/vrt_quadradio_source_32fc.h b/gr-vrt/src/vrt_quadradio_source_32fc.h index 799b07e86..45dad1f89 100644 --- a/gr-vrt/src/vrt_quadradio_source_32fc.h +++ b/gr-vrt/src/vrt_quadradio_source_32fc.h @@ -120,8 +120,14 @@ public: double get_lo_freq(void){return d_lo_freq;} bool get_lo_locked(void){return d_lo_locked;} double get_caldiv_temp(void){return d_caldiv_temp;} - int get_caldiv_ser_no(void){return d_caldiv_rev;} - int get_caldiv_rev_no(void){return d_caldiv_ser;} + int get_caldiv_serial(void){return d_caldiv_rev;} + int get_caldiv_revision(void){return d_caldiv_ser;} + + //gps public access methods + int get_utc_time(void){return d_utc_time;} + double get_altitude(void){return d_altitude;} + double get_longitude(void){return d_longitude;} + double get_latitude(void){return d_latitude;} }; diff --git a/gr-vrt/src/vrt_source_32fc.cc b/gr-vrt/src/vrt_source_32fc.cc index 0091619ab..3035813cc 100644 --- a/gr-vrt/src/vrt_source_32fc.cc +++ b/gr-vrt/src/vrt_source_32fc.cc @@ -171,14 +171,20 @@ vrt_source_32fc::work(int noutput_items, //we have a context packet, grab its useful information... //remember that things are in network byte order! if (h.get_if_context()){ - d_lo_freq = vrt_freq_to_double(ntohll(h.get_if_context()->caldiv.lo_freq)); - d_cal_freq = vrt_freq_to_double(ntohll(h.get_if_context()->caldiv.cal_freq)); - d_lo_locked = bool(ntohl(h.get_if_context()->caldiv.lo_locked)); - d_cal_locked = bool(ntohl(h.get_if_context()->caldiv.cal_locked)); - d_cal_enabled = bool(ntohl(h.get_if_context()->caldiv.cal_enabled)); - d_caldiv_temp = vrt_temp_to_double(ntohl(h.get_if_context()->caldiv.temp)); - d_caldiv_ser = ntohl(h.get_if_context()->caldiv.ser); - d_caldiv_rev = ntohl(h.get_if_context()->caldiv.rev); + //extract caldiv stuff + d_lo_freq = vrt_freq_to_double(ntohx(h.get_if_context()->caldiv.lo_freq)); + d_cal_freq = vrt_freq_to_double(ntohx(h.get_if_context()->caldiv.cal_freq)); + d_lo_locked = bool(ntohx(h.get_if_context()->caldiv.lo_locked)); + d_cal_locked = bool(ntohx(h.get_if_context()->caldiv.cal_locked)); + d_cal_enabled = bool(ntohx(h.get_if_context()->caldiv.cal_enabled)); + d_caldiv_temp = vrt_temp_to_double(ntohx(h.get_if_context()->caldiv.temp)); + d_caldiv_ser = ntohx(h.get_if_context()->caldiv.ser); + d_caldiv_rev = ntohx(h.get_if_context()->caldiv.rev); + //extract gps stuff + d_utc_time = ntohx(h.get_if_context()->gps.formatted_gps.integer_secs); + d_altitude = vrt_altitude_to_double(ntohx(h.get_if_context()->gps.formatted_gps.altitude)); + d_longitude = vrt_geo_angle_to_double(ntohx(h.get_if_context()->gps.formatted_gps.longitude)); + d_latitude = vrt_geo_angle_to_double(ntohx(h.get_if_context()->gps.formatted_gps.latitude)); } return oo; diff --git a/gr-vrt/src/vrt_source_32fc.h b/gr-vrt/src/vrt_source_32fc.h index 9d53fae33..46d80f442 100644 --- a/gr-vrt/src/vrt_source_32fc.h +++ b/gr-vrt/src/vrt_source_32fc.h @@ -43,6 +43,12 @@ protected: double d_caldiv_temp; int d_caldiv_rev; int d_caldiv_ser; + + //gps settings parsed from if context + int d_utc_time; + double d_altitude; + double d_longitude; + double d_latitude; public: ~vrt_source_32fc(); diff --git a/gr-wxgui/src/python/forms/forms.py b/gr-wxgui/src/python/forms/forms.py index 8dc58367d..19b30ffb0 100644 --- a/gr-wxgui/src/python/forms/forms.py +++ b/gr-wxgui/src/python/forms/forms.py @@ -194,15 +194,19 @@ class static_text(_form_base): @param label title label for this widget (optional) @param width the width of the form in px @param bold true to bold-ify the text (default=False) + @param units a suffix to add after the text @param converter forms.str_converter(), int_converter(), float_converter()... """ - def __init__(self, label='', width=-1, bold=False, converter=converters.str_converter(), **kwargs): + def __init__(self, label='', width=-1, bold=False, units='', converter=converters.str_converter(), **kwargs): + self._units = units _form_base.__init__(self, converter=converter, **kwargs) self._static_text = wx.StaticText(self._parent, size=wx.Size(width, -1)) if bold: make_bold(self._static_text) self._add_widget(self._static_text, label) - def _update(self, label): self._static_text.SetLabel(label); self._parent.Layout() + def _update(self, label): + if self._units: label += ' ' + self._units + self._static_text.SetLabel(label); self._parent.Layout() ######################################################################## # Text Box Form |