You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the Laboratory for Atmospheric and Space Physics (LASP) at the University of Colorado Boulder (CU), we use gpredict to control Doppler shift of our GNU Radio-based UHF transceiver and S-band receiver in our ground station. We also use gpredict for control of our UHF antenna rotator. (Our s-band dish uses its own proprietary software for tracking.) We use a set of home-grown shell and Python scripts to automate launching gpredict and our GNU Radio flowgraph (and some other internal software) a few minutes before each pass, but some human interaction is required to click buttons in the gpredict interface that are not currently managed in the gpredict config files (i.e., those which reset to default values when the software is restarted).
We would like if this automation software could be entirely autonomous—that is to say, not requiring any human interaction whatsoever.
One issue with gpredict as it currently stands is the rig control window default transmit and receive frequencies are initialized to a hard-coded value (145.890 MHz): there is no way to configure this value differently without modifying the source code and building a new executable. Ideally, this would be saved in the per-radio .rig configuration files.
Summary of existing code
The rig control window as of the latest version of gpredict appears as follows:
The widgets for adjusting the radio frequency are implemented in gtk-freq-knob.c and gtk-freq-knob.h. These widgets are instantiated in gtk-rig-ctrl.c in the create_uplink_widgets() and create_downlink_widgets() routines—on the downlink side, this looks like the following:
The uplink side is similar. The currently-in-use frequencies displayed below these widgets is likewise instantiated in said routines, and also uses this 145890000.0 "magic number":
Here are screenshots showing what the rig list and rig editor windows look like after the changes described below are implemented:
Summary of proposed code changes
It seems like a useful modification to gpredict would be to add default uplink and downlink frequecies to the rig config file (.rig). This requires the following changes:
Add new member variables to the radio_conf_t struct in radio-conf.h to provide runtime storage of the default per-radio uplink and downlink frequencies
Add UI controls to the rig editor window to allow viewing and changing the default uplink and downlink frequencies
Add columns to the rig list to display the default uplink and downlink frequencies in their own columns
Implementation
Adding configuration file options
Two new variables are added to the radio_conf_t struct in radio-conf.h, defUpFreq and defDnFreq:
diff --git a/src/radio-conf.h b/src/radio-conf.h
index a5c3aa5..a8b9578 100644
--- a/src/radio-conf.h+++ b/src/radio-conf.h@@ -65,6 +65,8 @@ typedef struct {
gdouble lo; /*!< local oscillator freq in Hz (using double for
compatibility with rest of code). Downlink. */
gdouble loup; /*!< local oscillator freq in Hz for uplink. */
+ gdouble defUpFreq; /*!< Default uplink in Hertz */+ gdouble defDnFreq; /*!< Default downlink frequency in Hertz */
rig_type_t type; /*!< Radio type */
ptt_type_t ptt; /*!< PTT type (needed for RX, TX, and TRX) */
vfo_t vfoDown; /*!< Downlink VFO for full-duplex radios */
Next, keys for these options are added to radio-conf.c. These will be used later:
First, we add enumeration values representing the two columns we will be adding to the rig list (default uplink and downlink frequency):
diff --git a/src/sat-pref-rig-data.h b/src/sat-pref-rig-data.h
index eea4e56..1330e07 100644
--- a/src/sat-pref-rig-data.h+++ b/src/sat-pref-rig-data.h@@ -38,6 +38,8 @@ typedef enum {
RIG_LIST_COL_VFODOWN, /*!< VFO down */
RIG_LIST_COL_LO, /*!< Local oscillator freq (downlink) */
RIG_LIST_COL_LOUP, /*!< Local oscillato freq (uplink) */
+ RIG_LIST_COL_DEF_UP_FREQ, /*!< Default uplink frequency */+ RIG_LIST_COL_DEF_DN_FREQ, /*!< Default downlink frequency */
RIG_LIST_COL_SIGAOS, /*!< Signal AOS */
RIG_LIST_COL_SIGLOS, /*!< Signal LOS */
RIG_LIST_COL_NUM /*!< The number of fields in the list. */
sat-pref-rig.c
The data model
The list store (data model) must be modified to include the new columns:
@@ -53,13 +53,15 @@ static GtkTreeModel *create_and_fill_model()
/* create a new list store */
liststore = gtk_list_store_new(RIG_LIST_COL_NUM, G_TYPE_STRING, // name
G_TYPE_STRING, // host
G_TYPE_INT, // port
G_TYPE_INT, // type
G_TYPE_INT, // PTT
G_TYPE_INT, // VFO Up
G_TYPE_INT, // VFO Down
G_TYPE_DOUBLE, // LO DOWN
G_TYPE_DOUBLE, // LO UO
+ G_TYPE_DOUBLE, // Default down freq.+ G_TYPE_DOUBLE, // Default up freq.
G_TYPE_BOOLEAN, // AOS signalling
G_TYPE_BOOLEAN // LOS signalling
);
Likewise every instance of gtk_list_store_set and gtk_tree_model_get must be modified to include these new columns:
Problem statement
At the Laboratory for Atmospheric and Space Physics (LASP) at the University of Colorado Boulder (CU), we use gpredict to control Doppler shift of our GNU Radio-based UHF transceiver and S-band receiver in our ground station. We also use gpredict for control of our UHF antenna rotator. (Our s-band dish uses its own proprietary software for tracking.) We use a set of home-grown shell and Python scripts to automate launching gpredict and our GNU Radio flowgraph (and some other internal software) a few minutes before each pass, but some human interaction is required to click buttons in the gpredict interface that are not currently managed in the gpredict config files (i.e., those which reset to default values when the software is restarted).
We would like if this automation software could be entirely autonomous—that is to say, not requiring any human interaction whatsoever.
One issue with gpredict as it currently stands is the rig control window default transmit and receive frequencies are initialized to a hard-coded value (145.890 MHz): there is no way to configure this value differently without modifying the source code and building a new executable. Ideally, this would be saved in the per-radio
.rig
configuration files.Summary of existing code
The rig control window as of the latest version of gpredict appears as follows:
The widgets for adjusting the radio frequency are implemented in
gtk-freq-knob.c
andgtk-freq-knob.h
. These widgets are instantiated ingtk-rig-ctrl.c
in thecreate_uplink_widgets()
andcreate_downlink_widgets()
routines—on the downlink side, this looks like the following:gpredict/src/gtk-rig-ctrl.c
Lines 463 to 467 in a0a5636
The uplink side is similar. The currently-in-use frequencies displayed below these widgets is likewise instantiated in said routines, and also uses this 145890000.0 "magic number":
gpredict/src/gtk-rig-ctrl.c
Lines 489 to 496 in a0a5636
Screenshots of modified program
Here are screenshots showing what the rig list and rig editor windows look like after the changes described below are implemented:
Summary of proposed code changes
It seems like a useful modification to gpredict would be to add default uplink and downlink frequecies to the rig config file (
.rig
). This requires the following changes:radio_conf_t
struct inradio-conf.h
to provide runtime storage of the default per-radio uplink and downlink frequenciesradio_conf_read()
inradio-conf.c
to read default uplink and downlink frequencies from the.rig
config filesradio_conf_save()
inradio-conf.c
to save default uplink and downlink frequencies to the.rig
config filesImplementation
Adding configuration file options
Two new variables are added to the
radio_conf_t
struct inradio-conf.h
,defUpFreq
anddefDnFreq
:Next, keys for these options are added to
radio-conf.c
. These will be used later:With the keys defined, parser code for these options is added to
radio_conf_read()
in the same file:The parser for
KEY_DEF_DN_FREQ
is similar.Finally, we must also remember to save these configuration settings in
radio_conf_save
:Modifying the rig editor dialog window
Adding these options to the rig editor UI involves modifying the following methods in
sat-pref-rig-editor.c
:clear_widgets()
, which initializes widgets to their default values,update_widgets()
, which initializes the widgets with values read from a configuration file,create_editor_widgets()
, which populates the UI controls, andapply_changes()
, which saves changes to aradio_conf_t
struct.Common
First, we must add two global pointers to
sat-pref-rig-editor.c
for the new widgets that we will be adding:create_editor_widgets()
Controls are added for adjusting downlink frequency to
create_editor_widgets()
:The code which adds uplink frequency adjustment is similar.
As two new rows are inserted in the widget table above AOS/LOS signaling, these controls must be shifted down by one:
clear_editor_widgets()
Changes to this method are very simple:
update_widgets()
apply_changes()
Modifying the rig list
sat-pref-rig-data.h
First, we add enumeration values representing the two columns we will be adding to the rig list (default uplink and downlink frequency):
sat-pref-rig.c
The data model
The list store (data model) must be modified to include the new columns:
Likewise every instance of
gtk_list_store_set
andgtk_tree_model_get
must be modified to include these new columns:The edit, add, and ok button callbacks must be changed:
Adding UI controls
Lastly, the number of digits printed after the decimal point in the rig list columns is increased from 0 to 3:
Pull request
A pull request implementing these changes has been opened: see #274.
The text was updated successfully, but these errors were encountered: