[Gpredict-svn] SF.net SVN: gpredict:[209] trunk
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
From: <cs...@us...> - 2009-03-21 13:09:27
|
Revision: 209 http://gpredict.svn.sourceforge.net/gpredict/?rev=209&view=rev Author: csete Date: 2009-03-21 13:09:10 +0000 (Sat, 21 Mar 2009) Log Message: ----------- Update code to include upconverter LO frequency. Modified Paths: -------------- trunk/ChangeLog trunk/src/sat-pref-rig-data.h trunk/src/sat-pref-rig-editor.c trunk/src/sat-pref-rig.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-03-21 12:51:22 UTC (rev 208) +++ trunk/ChangeLog 2009-03-21 13:09:10 UTC (rev 209) @@ -3,6 +3,11 @@ * src/radio-conf.[ch]: Added config field for uplink transverter LO. LO values are now optional. + * src/sat-pref-rig-data.h: + * src/sat-pref-rig.c: + * src/sat-pref-rig-editor.c: + Update code to include upconverter LO frequency. + 2009-03-21 Stephane Fillod <fi...@us...> Modified: trunk/src/sat-pref-rig-data.h =================================================================== --- trunk/src/sat-pref-rig-data.h 2009-03-21 12:51:22 UTC (rev 208) +++ trunk/src/sat-pref-rig-data.h 2009-03-21 13:09:10 UTC (rev 209) @@ -35,7 +35,8 @@ RIG_LIST_COL_PORT, /*!< Port number */ RIG_LIST_COL_TYPE, /*!< Radio type */ RIG_LIST_COL_PTT, /*!< PTT */ - RIG_LIST_COL_LO, /*!< Local oscillator freq */ + RIG_LIST_COL_LO, /*!< Local oscillator freq (downlink) */ + RIG_LIST_COL_LOUP, /*!< Local oscillato freq (uplink) */ RIG_LIST_COL_NUM /*!< The number of fields in the list. */ } rig_list_col_t; Modified: trunk/src/sat-pref-rig-editor.c =================================================================== --- trunk/src/sat-pref-rig-editor.c 2009-03-21 12:51:22 UTC (rev 208) +++ trunk/src/sat-pref-rig-editor.c 2009-03-21 13:09:10 UTC (rev 209) @@ -56,7 +56,8 @@ static GtkWidget *port; /* port number */ static GtkWidget *type; /* rig type */ static GtkWidget *ptt; /* PTT */ -static GtkWidget *lo; /* local oscillator */ +static GtkWidget *lo; /* local oscillator of downconverter */ +static GtkWidget *loup; /* local oscillator of upconverter */ static GtkWidget *create_editor_widgets (radio_conf_t *conf); @@ -144,7 +145,7 @@ - table = gtk_table_new (6, 4, FALSE); + table = gtk_table_new (7, 4, FALSE); gtk_container_set_border_width (GTK_CONTAINER (table), 5); gtk_table_set_col_spacings (GTK_TABLE (table), 5); gtk_table_set_row_spacings (GTK_TABLE (table), 5); @@ -212,7 +213,7 @@ "<b>TX only:</b> The radio shall only be used for uplink. "\ "If <i>Monitor PTT status</i> is checked the doppler tuning "\ "will be suspended while PTT is OFF (manual RX).\n"\ - "<b>RX/TX:</b> The radio should be used for both up- and downlink "\ + "<b>Simplex TRX:</b> The radio should be used for both up- and downlink "\ "but in simplex mode only. This option requires that the PTT status "\ "is monitored (otherwise gpredict cannot know whether to tune the "\ "RX or the TX).\n"\ @@ -232,8 +233,8 @@ gtk_table_attach_defaults (GTK_TABLE (table), ptt, 1, 4, 4, 5); - /* LO frequency */ - label = gtk_label_new (_("LO")); + /* Downconverter LO frequency */ + label = gtk_label_new (_("LO Down:")); gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 5, 6); @@ -241,13 +242,32 @@ gtk_spin_button_set_value (GTK_SPIN_BUTTON (lo), 0); gtk_spin_button_set_digits (GTK_SPIN_BUTTON (lo), 0); gtk_widget_set_tooltip_text (lo, - _("Enter the frequency of the local oscillator, if any.")); + _("Enter the frequency of the local oscillator "\ + " of the downconverter, if any.")); gtk_table_attach_defaults (GTK_TABLE (table), lo, 1, 3, 5, 6); label = gtk_label_new (_("MHz")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 3, 4, 5, 6); + /* Upconverter LO frequency */ + label = gtk_label_new (_("LO Up:")); + gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); + gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 6, 7); + + loup = gtk_spin_button_new_with_range (-10000, 10000, 1); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (loup), 0); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON (loup), 0); + gtk_widget_set_tooltip_text (loup, + _("Enter the frequency of the local oscillator "\ + "of the upconverter, if any.")); + gtk_table_attach_defaults (GTK_TABLE (table), loup, 1, 3, 6, 7); + + label = gtk_label_new (_("MHz")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_table_attach_defaults (GTK_TABLE (table), label, 3, 4, 6, 7); + + if (conf->name != NULL) update_widgets (conf); @@ -310,8 +330,12 @@ } - /* lo in MHz */ + /* lo down in MHz */ gtk_spin_button_set_value (GTK_SPIN_BUTTON (lo), conf->lo / 1000000.0); + + /* lo up in MHz */ + gtk_spin_button_set_value (GTK_SPIN_BUTTON (loup), conf->loup / 1000000.0); + } @@ -328,6 +352,7 @@ gtk_entry_set_text (GTK_ENTRY (host), ""); gtk_spin_button_set_value (GTK_SPIN_BUTTON (port), 4532); /* hamlib default? */ gtk_spin_button_set_value (GTK_SPIN_BUTTON (lo), 0); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (loup), 0); gtk_combo_box_set_active (GTK_COMBO_BOX (type), RIG_TYPE_RX); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ptt), FALSE); } @@ -358,9 +383,12 @@ /* port */ conf->port = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (port)); - /* lo freq */ + /* lo down freq */ conf->lo = 1000000.0*gtk_spin_button_get_value (GTK_SPIN_BUTTON (lo)); + /* lo up freq */ + conf->loup = 1000000.0*gtk_spin_button_get_value (GTK_SPIN_BUTTON (loup)); + /* rig type */ conf->type = gtk_combo_box_get_active (GTK_COMBO_BOX (type)); Modified: trunk/src/sat-pref-rig.c =================================================================== --- trunk/src/sat-pref-rig.c 2009-03-21 12:51:22 UTC (rev 208) +++ trunk/src/sat-pref-rig.c 2009-03-21 13:09:10 UTC (rev 209) @@ -168,9 +168,9 @@ NULL); gtk_tree_view_insert_column (GTK_TREE_VIEW (riglist), column, -1); - /* lo */ + /* transverter down */ renderer = gtk_cell_renderer_text_new (); - column = gtk_tree_view_column_new_with_attributes (_("LO Freq. (MHz)"), renderer, + column = gtk_tree_view_column_new_with_attributes (_("Downconverter LO"), renderer, "text", RIG_LIST_COL_LO, NULL); gtk_tree_view_column_set_cell_data_func (column, renderer, @@ -179,6 +179,17 @@ NULL); gtk_tree_view_insert_column (GTK_TREE_VIEW (riglist), column, -1); + /* transverter up */ + renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes (_("Upconverter LO"), renderer, + "text", RIG_LIST_COL_LOUP, + NULL); + gtk_tree_view_column_set_cell_data_func (column, renderer, + render_lo, + GUINT_TO_POINTER(RIG_LIST_COL_LOUP), + NULL); + gtk_tree_view_insert_column (GTK_TREE_VIEW (riglist), column, -1); + } @@ -202,7 +213,8 @@ G_TYPE_INT, // port G_TYPE_INT, // type G_TYPE_BOOLEAN, // PTT - G_TYPE_DOUBLE // LO + G_TYPE_DOUBLE, // LO DOWN + G_TYPE_DOUBLE // LO UO ); /* open configuration directory */ @@ -231,6 +243,7 @@ RIG_LIST_COL_TYPE, conf.type, RIG_LIST_COL_PTT, conf.ptt, RIG_LIST_COL_LO, conf.lo, + RIG_LIST_COL_LOUP, conf.loup, -1); sat_log_log (SAT_LOG_LEVEL_DEBUG, @@ -342,6 +355,7 @@ .type = RIG_TYPE_RX, .ptt = FALSE, .lo = 0.0, + .loup = 0.0, }; @@ -384,6 +398,7 @@ RIG_LIST_COL_TYPE, &conf.type, RIG_LIST_COL_PTT, &conf.ptt, RIG_LIST_COL_LO, &conf.lo, + RIG_LIST_COL_LOUP, &conf.loup, -1); radio_conf_save (&conf); @@ -424,6 +439,7 @@ .type = RIG_TYPE_RX, .ptt = FALSE, .lo = 0.0, + .loup = 0.0, }; /* run rig conf editor */ @@ -440,6 +456,7 @@ RIG_LIST_COL_TYPE, conf.type, RIG_LIST_COL_PTT, conf.ptt, RIG_LIST_COL_LO, conf.lo, + RIG_LIST_COL_LOUP, conf.loup, -1); g_free (conf.name); @@ -472,6 +489,7 @@ .type = RIG_TYPE_RX, .ptt = FALSE, .lo = 0.0, + .loup = 0.0, }; @@ -499,6 +517,7 @@ RIG_LIST_COL_TYPE, &conf.type, RIG_LIST_COL_PTT, &conf.ptt, RIG_LIST_COL_LO, &conf.lo, + RIG_LIST_COL_LOUP, &conf.loup, -1); } @@ -529,6 +548,7 @@ RIG_LIST_COL_TYPE, conf.type, RIG_LIST_COL_PTT, conf.ptt, RIG_LIST_COL_LO, conf.lo, + RIG_LIST_COL_LOUP, conf.loup, -1); } @@ -717,7 +737,7 @@ /* convert to MHz */ number /= 1000000.0; - buff = g_strdup_printf ("%.0f", number); + buff = g_strdup_printf ("%.0f MHz", number); g_object_set (renderer, "text", buff, NULL); g_free (buff); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |