Thread: [Gpredict-svn] SF.net SVN: gpredict:[59] trunk/src/sat-pref-rig.c
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
|
From: <cs...@us...> - 2008-08-22 08:53:05
|
Revision: 59
http://gpredict.svn.sourceforge.net/gpredict/?rev=59&view=rev
Author: csete
Date: 2008-08-22 08:53:13 +0000 (Fri, 22 Aug 2008)
Log Message:
-----------
Removed unnecessary columns.
Modified Paths:
--------------
trunk/src/sat-pref-rig.c
Modified: trunk/src/sat-pref-rig.c
===================================================================
--- trunk/src/sat-pref-rig.c 2008-08-22 08:46:10 UTC (rev 58)
+++ trunk/src/sat-pref-rig.c 2008-08-22 08:53:13 UTC (rev 59)
@@ -131,79 +131,14 @@
NULL);
gtk_tree_view_insert_column (GTK_TREE_VIEW (riglist), column, -1);
- /* Model */
+ /* Host */
renderer = gtk_cell_renderer_text_new ();
- column = gtk_tree_view_column_new_with_attributes (_("Model"), renderer,
- "text", RIG_LIST_COL_MODEL,
+ column = gtk_tree_view_column_new_with_attributes (_("Host"), renderer,
+ "text", RIG_LIST_COL_HOST,
NULL);
gtk_tree_view_insert_column (GTK_TREE_VIEW (riglist), column, -1);
- /* Type */
- renderer = gtk_cell_renderer_text_new ();
- column = gtk_tree_view_column_new_with_attributes (_("Type"), renderer,
- "text", RIG_LIST_COL_TYPE,
- NULL);
- gtk_tree_view_column_set_cell_data_func (column, renderer,
- render_rig_type,
- GUINT_TO_POINTER(RIG_LIST_COL_TYPE),
- NULL);
- gtk_tree_view_insert_column (GTK_TREE_VIEW (riglist), column, -1);
- /* Port */
- renderer = gtk_cell_renderer_text_new ();
- column = gtk_tree_view_column_new_with_attributes (_("Port"), renderer,
- "text", RIG_LIST_COL_PORT,
- NULL);
- gtk_tree_view_insert_column (GTK_TREE_VIEW (riglist), column, -1);
-
- /* Speed */
- renderer = gtk_cell_renderer_text_new ();
- column = gtk_tree_view_column_new_with_attributes (_("Speed"), renderer,
- "text", RIG_LIST_COL_SPEED,
- NULL);
- gtk_tree_view_insert_column (GTK_TREE_VIEW (riglist), column, -1);
-
- /* Icom CI-V */
- renderer = gtk_cell_renderer_text_new ();
- column = gtk_tree_view_column_new_with_attributes (_("Icom CI-V"), renderer,
- "text", RIG_LIST_COL_CIV,
- NULL);
- gtk_tree_view_column_set_cell_data_func (column, renderer,
- render_civ,
- GUINT_TO_POINTER(RIG_LIST_COL_CIV),
- NULL);
- gtk_tree_view_insert_column (GTK_TREE_VIEW (riglist), column, -1);
-
- /* Extensions */
- renderer = gtk_cell_renderer_toggle_new ();
- column = gtk_tree_view_column_new_with_attributes (_("Ext"), renderer,
- "active", RIG_LIST_COL_EXT,
- NULL);
-
- gtk_tree_view_insert_column (GTK_TREE_VIEW (riglist), column, -1);
-
- /* DTR */
- renderer = gtk_cell_renderer_text_new ();
- column = gtk_tree_view_column_new_with_attributes (_("DTR Line"), renderer,
- "text", RIG_LIST_COL_DTR,
- NULL);
- gtk_tree_view_column_set_cell_data_func (column, renderer,
- render_dtr_rts,
- GUINT_TO_POINTER(RIG_LIST_COL_DTR),
- NULL);
- gtk_tree_view_insert_column (GTK_TREE_VIEW (riglist), column, -1);
-
- /* RTS */
- renderer = gtk_cell_renderer_text_new ();
- column = gtk_tree_view_column_new_with_attributes (_("RTS Line"), renderer,
- "text", RIG_LIST_COL_RTS,
- NULL);
- gtk_tree_view_column_set_cell_data_func (column, renderer,
- render_dtr_rts,
- GUINT_TO_POINTER(RIG_LIST_COL_RTS),
- NULL);
- gtk_tree_view_insert_column (GTK_TREE_VIEW (riglist), column, -1);
-
}
@@ -223,15 +158,7 @@
/* create a new list store */
liststore = gtk_list_store_new (RIG_LIST_COL_NUM,
G_TYPE_STRING, // name
- G_TYPE_STRING, // model
- G_TYPE_INT, // hamlib id
- G_TYPE_INT, // radio type
- G_TYPE_STRING, // port
- G_TYPE_INT, // speed
- G_TYPE_INT, // Icom CI-V
- G_TYPE_BOOLEAN, // Extensions
- G_TYPE_INT, // DTR line
- G_TYPE_INT // RTS line
+ G_TYPE_STRING // model
);
/* open configuration directory */
@@ -255,15 +182,7 @@
gtk_list_store_append (liststore, &item);
gtk_list_store_set (liststore, &item,
RIG_LIST_COL_NAME, conf.name,
- RIG_LIST_COL_MODEL, conf.model,
- RIG_LIST_COL_ID, conf.id,
- RIG_LIST_COL_TYPE, conf.type,
- RIG_LIST_COL_PORT, conf.port,
- RIG_LIST_COL_SPEED, conf.speed,
- RIG_LIST_COL_CIV, conf.civ,
- RIG_LIST_COL_EXT, conf.ext,
- RIG_LIST_COL_DTR, conf.dtr,
- RIG_LIST_COL_RTS, conf.rts,
+ RIG_LIST_COL_HOST, conf.host,
-1);
sat_log_log (SAT_LOG_LEVEL_DEBUG,
@@ -273,11 +192,9 @@
if (conf.name)
g_free (conf.name);
- if (conf.model)
- g_free (conf.model);
+ if (conf.host)
+ g_free (conf.host);
- if (conf.port)
- g_free (conf.port);
}
else {
/* there was an error */
@@ -372,15 +289,7 @@
radio_conf_t conf = {
.name = NULL,
- .model = NULL,
- .id = 0,
- .type = RADIO_TYPE_RX,
- .port = NULL,
- .speed = 0,
- .civ = 0,
- .ext = FALSE,
- .dtr = LINE_UNDEF,
- .rts = LINE_UNDEF,
+ .host = NULL,
};
@@ -418,15 +327,7 @@
/* store conf */
gtk_tree_model_get (model, &iter,
RIG_LIST_COL_NAME, &conf.name,
- RIG_LIST_COL_MODEL, &conf.model,
- RIG_LIST_COL_ID, &conf.id,
- RIG_LIST_COL_TYPE, &conf.type,
- RIG_LIST_COL_PORT, &conf.port,
- RIG_LIST_COL_SPEED, &conf.speed,
- RIG_LIST_COL_CIV, &conf.civ,
- RIG_LIST_COL_EXT, &conf.ext,
- RIG_LIST_COL_DTR, &conf.dtr,
- RIG_LIST_COL_RTS, &conf.rts,
+ RIG_LIST_COL_HOST, &conf.host,
-1);
radio_conf_save (&conf);
@@ -434,11 +335,9 @@
if (conf.name)
g_free (conf.name);
- if (conf.model)
- g_free (conf.model);
+ if (conf.host)
+ g_free (conf.host);
- if (conf.port)
- g_free (conf.port);
}
else {
sat_log_log (SAT_LOG_LEVEL_ERROR,
@@ -464,15 +363,7 @@
radio_conf_t conf = {
.name = NULL,
- .model = NULL,
- .id = 0,
- .type = RADIO_TYPE_RX,
- .port = NULL,
- .speed = 0,
- .civ = 0,
- .ext = FALSE,
- .dtr = LINE_UNDEF,
- .rts = LINE_UNDEF,
+ .host = NULL,
};
/* run rig conf editor */
@@ -484,24 +375,14 @@
gtk_list_store_append (liststore, &item);
gtk_list_store_set (liststore, &item,
RIG_LIST_COL_NAME, conf.name,
- RIG_LIST_COL_MODEL, conf.model,
- RIG_LIST_COL_ID, conf.id,
- RIG_LIST_COL_TYPE, conf.type,
- RIG_LIST_COL_PORT, conf.port,
- RIG_LIST_COL_SPEED, conf.speed,
- RIG_LIST_COL_CIV, conf.civ,
- RIG_LIST_COL_EXT, conf.ext,
- RIG_LIST_COL_DTR, conf.dtr,
- RIG_LIST_COL_RTS, conf.rts,
+ RIG_LIST_COL_HOST, conf.host,
-1);
g_free (conf.name);
- if (conf.model != NULL)
- g_free (conf.model);
+ if (conf.host != NULL)
+ g_free (conf.host);
- if (conf.port != NULL)
- g_free (conf.port);
}
}
@@ -522,15 +403,7 @@
radio_conf_t conf = {
.name = NULL,
- .model = NULL,
- .id = 0,
- .type = RADIO_TYPE_RX,
- .port = NULL,
- .speed = 0,
- .civ = 0,
- .ext = FALSE,
- .dtr = LINE_UNDEF,
- .rts = LINE_UNDEF,
+ .host = NULL,
};
@@ -553,15 +426,7 @@
if (gtk_tree_selection_get_selected(selection, &selmod, &iter)) {
gtk_tree_model_get (model, &iter,
RIG_LIST_COL_NAME, &conf.name,
- RIG_LIST_COL_MODEL, &conf.model,
- RIG_LIST_COL_ID, &conf.id,
- RIG_LIST_COL_TYPE, &conf.type,
- RIG_LIST_COL_PORT, &conf.port,
- RIG_LIST_COL_SPEED, &conf.speed,
- RIG_LIST_COL_CIV, &conf.civ,
- RIG_LIST_COL_EXT, &conf.ext,
- RIG_LIST_COL_DTR, &conf.dtr,
- RIG_LIST_COL_RTS, &conf.rts,
+ RIG_LIST_COL_HOST, &conf.host,
-1);
}
@@ -587,15 +452,7 @@
if (conf.name != NULL) {
gtk_list_store_set (GTK_LIST_STORE(model), &iter,
RIG_LIST_COL_NAME, conf.name,
- RIG_LIST_COL_MODEL, conf.model,
- RIG_LIST_COL_ID, conf.id,
- RIG_LIST_COL_TYPE, conf.type,
- RIG_LIST_COL_PORT, conf.port,
- RIG_LIST_COL_SPEED, conf.speed,
- RIG_LIST_COL_CIV, conf.civ,
- RIG_LIST_COL_EXT, conf.ext,
- RIG_LIST_COL_DTR, conf.dtr,
- RIG_LIST_COL_RTS, conf.rts,
+ RIG_LIST_COL_HOST, conf.host,
-1);
}
@@ -604,11 +461,8 @@
if (conf.name)
g_free (conf.name);
- if (conf.model != NULL)
- g_free (conf.model);
-
- if (conf.port != NULL)
- g_free (conf.port);
+ if (conf.host != NULL)
+ g_free (conf.host);
}
@@ -744,7 +598,7 @@
gtk_tree_model_get (model, iter, coli, &number, -1);
- switch (number) {
+/* switch (number) {
case LINE_OFF:
g_object_set (renderer, "text", "OFF", NULL);
@@ -767,7 +621,7 @@
break;
}
-
+ */
}
@@ -793,7 +647,7 @@
gtk_tree_model_get (model, iter, coli, &number, -1);
- switch (number) {
+/* switch (number) {
case RADIO_TYPE_RX:
g_object_set (renderer, "text", "RX", NULL);
@@ -818,7 +672,7 @@
g_object_set (renderer, "text", "RX", NULL);
break;
- }
+ }*/
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2008-12-28 14:30:02
|
Revision: 184
http://gpredict.svn.sourceforge.net/gpredict/?rev=184&view=rev
Author: csete
Date: 2008-12-28 14:29:59 +0000 (Sun, 28 Dec 2008)
Log Message:
-----------
Include rig type and ptt fields.
Modified Paths:
--------------
trunk/src/sat-pref-rig.c
Modified: trunk/src/sat-pref-rig.c
===================================================================
--- trunk/src/sat-pref-rig.c 2008-12-28 13:14:46 UTC (rev 183)
+++ trunk/src/sat-pref-rig.c 2008-12-28 14:29:59 UTC (rev 184)
@@ -58,6 +58,16 @@
GtkTreeModel *model,
GtkTreeIter *iter,
gpointer column);
+static void render_type (GtkTreeViewColumn *col,
+ GtkCellRenderer *renderer,
+ GtkTreeModel *model,
+ GtkTreeIter *iter,
+ gpointer column);
+static void render_ptt (GtkTreeViewColumn *col,
+ GtkCellRenderer *renderer,
+ GtkTreeModel *model,
+ GtkTreeIter *iter,
+ gpointer column);
static void render_lo (GtkTreeViewColumn *col,
GtkCellRenderer *renderer,
GtkTreeModel *model,
@@ -135,6 +145,28 @@
"text", RIG_LIST_COL_PORT,
NULL);
gtk_tree_view_insert_column (GTK_TREE_VIEW (riglist), column, -1);
+
+ /* rig type */
+ renderer = gtk_cell_renderer_text_new ();
+ column = gtk_tree_view_column_new_with_attributes (_("Rig Type"), renderer,
+ "text", RIG_LIST_COL_TYPE,
+ NULL);
+ gtk_tree_view_column_set_cell_data_func (column, renderer,
+ render_type,
+ GUINT_TO_POINTER(RIG_LIST_COL_TYPE),
+ NULL);
+ gtk_tree_view_insert_column (GTK_TREE_VIEW (riglist), column, -1);
+
+ /* PTT */
+ renderer = gtk_cell_renderer_text_new ();
+ column = gtk_tree_view_column_new_with_attributes (_("PTT Status"), renderer,
+ "text", RIG_LIST_COL_PTT,
+ NULL);
+ gtk_tree_view_column_set_cell_data_func (column, renderer,
+ render_ptt,
+ GUINT_TO_POINTER(RIG_LIST_COL_PTT),
+ NULL);
+ gtk_tree_view_insert_column (GTK_TREE_VIEW (riglist), column, -1);
/* lo */
renderer = gtk_cell_renderer_text_new ();
@@ -168,6 +200,8 @@
G_TYPE_STRING, // name
G_TYPE_STRING, // host
G_TYPE_INT, // port
+ G_TYPE_INT, // type
+ G_TYPE_BOOLEAN, // PTT
G_TYPE_DOUBLE // LO
);
@@ -194,6 +228,8 @@
RIG_LIST_COL_NAME, conf.name,
RIG_LIST_COL_HOST, conf.host,
RIG_LIST_COL_PORT, conf.port,
+ RIG_LIST_COL_TYPE, conf.type,
+ RIG_LIST_COL_PTT, conf.ptt,
RIG_LIST_COL_LO, conf.lo,
-1);
@@ -303,6 +339,8 @@
.name = NULL,
.host = NULL,
.port = 4532,
+ .type = RIG_TYPE_RX,
+ .ptt = FALSE,
.lo = 0.0,
};
@@ -343,6 +381,8 @@
RIG_LIST_COL_NAME, &conf.name,
RIG_LIST_COL_HOST, &conf.host,
RIG_LIST_COL_PORT, &conf.port,
+ RIG_LIST_COL_TYPE, &conf.type,
+ RIG_LIST_COL_PTT, &conf.ptt,
RIG_LIST_COL_LO, &conf.lo,
-1);
radio_conf_save (&conf);
@@ -381,6 +421,8 @@
.name = NULL,
.host = NULL,
.port = 4532,
+ .type = RIG_TYPE_RX,
+ .ptt = FALSE,
.lo = 0.0,
};
@@ -395,6 +437,8 @@
RIG_LIST_COL_NAME, conf.name,
RIG_LIST_COL_HOST, conf.host,
RIG_LIST_COL_PORT, conf.port,
+ RIG_LIST_COL_TYPE, conf.type,
+ RIG_LIST_COL_PTT, conf.ptt,
RIG_LIST_COL_LO, conf.lo,
-1);
@@ -425,6 +469,8 @@
.name = NULL,
.host = NULL,
.port = 4532,
+ .type = RIG_TYPE_RX,
+ .ptt = FALSE,
.lo = 0.0,
};
@@ -450,6 +496,8 @@
RIG_LIST_COL_NAME, &conf.name,
RIG_LIST_COL_HOST, &conf.host,
RIG_LIST_COL_PORT, &conf.port,
+ RIG_LIST_COL_TYPE, &conf.type,
+ RIG_LIST_COL_PTT, &conf.ptt,
RIG_LIST_COL_LO, &conf.lo,
-1);
@@ -478,6 +526,8 @@
RIG_LIST_COL_NAME, conf.name,
RIG_LIST_COL_HOST, conf.host,
RIG_LIST_COL_PORT, conf.port,
+ RIG_LIST_COL_TYPE, conf.type,
+ RIG_LIST_COL_PTT, conf.ptt,
RIG_LIST_COL_LO, conf.lo,
-1);
@@ -569,6 +619,79 @@
}
+/** \brief Render radio type.
+ * \param col Pointer to the tree view column.
+ * \param renderer Pointer to the renderer.
+ * \param model Pointer to the tree model.
+ * \param iter Pointer to the tree iterator.
+ * \param column The column number in the model.
+ *
+ * This function renders the radio type onto the riglist.
+*/
+static void render_type (GtkTreeViewColumn *col,
+ GtkCellRenderer *renderer,
+ GtkTreeModel *model,
+ GtkTreeIter *iter,
+ gpointer column)
+{
+ guint type;
+ guint coli = GPOINTER_TO_UINT (column);
+
+ gtk_tree_model_get (model, iter, coli, &type, -1);
+
+ switch (type) {
+ case RIG_TYPE_RX:
+ g_object_set (renderer, "text", _("RX only"), NULL);
+ break;
+
+ case RIG_TYPE_TX:
+ g_object_set (renderer, "text", _("TX only"), NULL);
+ break;
+
+ case RIG_TYPE_TRX:
+ g_object_set (renderer, "text", _("RX + TX"), NULL);
+ break;
+
+ case RIG_TYPE_DUPLEX:
+ g_object_set (renderer, "text", _("Duplex"), NULL);
+ break;
+
+ default:
+ g_object_set (renderer, "text", _("ERROR"), NULL);
+ break;
+ }
+
+}
+
+
+/** \brief Render PTT status usage.
+ * \param col Pointer to the tree view column.
+ * \param renderer Pointer to the renderer.
+ * \param model Pointer to the tree model.
+ * \param iter Pointer to the tree iterator.
+ * \param column The column number in the model.
+ *
+ * This function renders the PTT status usage onto the riglist.
+*/
+static void render_ptt (GtkTreeViewColumn *col,
+ GtkCellRenderer *renderer,
+ GtkTreeModel *model,
+ GtkTreeIter *iter,
+ gpointer column)
+{
+ gboolean ptt;
+ guint coli = GPOINTER_TO_UINT (column);
+
+ gtk_tree_model_get (model, iter, coli, &ptt, -1);
+
+ if (ptt)
+ g_object_set (renderer, "text", _("Monitor"), NULL);
+ else
+ g_object_set (renderer, "text", _("Ignore"), NULL);
+
+}
+
+
/** \brief Render Local Oscillator frequency.
* \param col Pointer to the tree view column.
* \param renderer Pointer to the renderer.
@@ -602,3 +725,4 @@
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2009-05-10 14:38:55
|
Revision: 295
http://gpredict.svn.sourceforge.net/gpredict/?rev=295&view=rev
Author: csete
Date: 2009-05-10 14:38:54 +0000 (Sun, 10 May 2009)
Log Message:
-----------
changed column names so that list fits into window.
Modified Paths:
--------------
trunk/src/sat-pref-rig.c
Modified: trunk/src/sat-pref-rig.c
===================================================================
--- trunk/src/sat-pref-rig.c 2009-05-10 13:57:23 UTC (rev 294)
+++ trunk/src/sat-pref-rig.c 2009-05-10 14:38:54 UTC (rev 295)
@@ -197,7 +197,7 @@
/* transverter down */
renderer = gtk_cell_renderer_text_new ();
- column = gtk_tree_view_column_new_with_attributes (_("Downconverter LO"), renderer,
+ column = gtk_tree_view_column_new_with_attributes (_("LO Down"), renderer,
"text", RIG_LIST_COL_LO,
NULL);
gtk_tree_view_column_set_cell_data_func (column, renderer,
@@ -208,7 +208,7 @@
/* transverter up */
renderer = gtk_cell_renderer_text_new ();
- column = gtk_tree_view_column_new_with_attributes (_("Upconverter LO"), renderer,
+ column = gtk_tree_view_column_new_with_attributes (_("LO Up"), renderer,
"text", RIG_LIST_COL_LOUP,
NULL);
gtk_tree_view_column_set_cell_data_func (column, renderer,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|