gpredict-svn Mailing List for Gpredict (Page 38)
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
You can subscribe to this list here.
2008 |
Jan
(24) |
Feb
|
Mar
(6) |
Apr
(14) |
May
(9) |
Jun
|
Jul
|
Aug
(25) |
Sep
(60) |
Oct
(26) |
Nov
|
Dec
(20) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
|
Feb
(2) |
Mar
(22) |
Apr
(61) |
May
(57) |
Jun
|
Jul
(3) |
Aug
(83) |
Sep
(35) |
Oct
(50) |
Nov
(28) |
Dec
(34) |
2010 |
Jan
(29) |
Feb
(15) |
Mar
(2) |
Apr
|
May
(6) |
Jun
(2) |
Jul
(24) |
Aug
(2) |
Sep
(9) |
Oct
(43) |
Nov
(22) |
Dec
(6) |
2011 |
Jan
(24) |
Feb
(22) |
Mar
(31) |
Apr
(13) |
May
(10) |
Jun
(10) |
Jul
(43) |
Aug
(12) |
Sep
(18) |
Oct
(33) |
Nov
(18) |
Dec
(4) |
From: <cs...@us...> - 2008-04-20 13:39:31
|
Revision: 33 http://gpredict.svn.sourceforge.net/gpredict/?rev=33&view=rev Author: csete Date: 2008-04-20 06:28:01 -0700 (Sun, 20 Apr 2008) Log Message: ----------- Added generic interface to hardware drivers. Modified Paths: -------------- trunk/ChangeLog trunk/po/POTFILES.in trunk/src/Makefile.am trunk/win32/Makefile Added Paths: ----------- trunk/src/rig-io.c trunk/src/rig-io.h Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-04-09 21:55:53 UTC (rev 32) +++ trunk/ChangeLog 2008-04-20 13:28:01 UTC (rev 33) @@ -1,3 +1,9 @@ +2008-04-20; Alexandru Csete <oz...@gm...> + + * src/rig-io.[ch]: + Added generic interface to hardware drivers. + + 2008-03-30; Alexandru Csete <oz...@gm...> * src/gtk-freq-ctrl.c, gtk-freq-ctrl.h: Modified: trunk/po/POTFILES.in =================================================================== --- trunk/po/POTFILES.in 2008-04-09 21:55:53 UTC (rev 32) +++ trunk/po/POTFILES.in 2008-04-20 13:28:01 UTC (rev 33) @@ -30,6 +30,7 @@ src/predict-tools.c src/radio-conf.c src/rdv.c +src/rig-io.c src/rotor-conf.c src/sat-cfg.c src/sat-log.c Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2008-04-09 21:55:53 UTC (rev 32) +++ trunk/src/Makefile.am 2008-04-20 13:28:01 UTC (rev 33) @@ -68,6 +68,7 @@ predict-tools.c predict-tools.h \ qth-editor.c qth-editor.h \ radio-conf.c radio-conf.h \ + rig-io.c rig-io.h \ rotor-conf.c rotor-conf.h \ rdv.c rdv.h \ sat-cfg.c sat-cfg.h \ Added: trunk/src/rig-io.c =================================================================== --- trunk/src/rig-io.c (rev 0) +++ trunk/src/rig-io.c 2008-04-20 13:28:01 UTC (rev 33) @@ -0,0 +1,97 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + Gpredict: Real-time satellite tracking and orbit prediction program + + Copyright (C) 2001-2007 Alexandru Csete. + + Authors: Alexandru Csete <oz...@gm...> + + Comments, questions and bugreports should be submitted via + http://sourceforge.net/projects/groundstation/ + More details can be found at the project home page: + + http://groundstation.sourceforge.net/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, visit http://www.fsf.org/ + + +*/ +/** \brief Hardware driver wrapper + * + * The purpose of this module is to provide a generic interace to the + * hardware driver, regardless of whether it is a single/dual rig hamlib, + * or any other interface. + */ + +#include <glib.h> + + +/** \brief Initialise hardware interface. + * \param uplink Name of the uplink configuration. + * \param downlink Name of the downlink configuration. + * \return 0 if successful, non-zero if an error occured + * + */ +gint rig_io_init (const gchar* uplink, const gchar *downlink) +{ + return 0; +} + +/** \brief Shut down hardware interface. + * + */ +gint rig_io_shutdown () +{ + return 0; +} + + +/** \brief Set uplink frequency. + * \param freq The desired uplink frequency in Hz. + * + */ +void rig_io_set_uplink_freq (gdouble freq) +{ +} + + +/** \brief Read uplink frequency. + * \param freq The current uplink frequency in Hz. + * + */ +void rig_io_get_uplink_freq (gdouble *freq) +{ + *freq = 0.0; +} + + +/** \brief Set downlink frequency + * \param The desired downlink frequency in Hz. + * + */ +void rig_io_set_downlink_freq (gdouble freq) +{ +} + + +/** \brief Read downlink frequency. + * \param freq The current downlink frequency in Hz. + * + */ +void rig_io_get_downlink_freq (gdouble *freq) +{ + *freq = 0.0; +} + + Added: trunk/src/rig-io.h =================================================================== --- trunk/src/rig-io.h (rev 0) +++ trunk/src/rig-io.h 2008-04-20 13:28:01 UTC (rev 33) @@ -0,0 +1,45 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + Gpredict: Real-time satellite tracking and orbit prediction program + + Copyright (C) 2001-2007 Alexandru Csete. + + Authors: Alexandru Csete <oz...@gm...> + + Comments, questions and bugreports should be submitted via + http://sourceforge.net/projects/groundstation/ + More details can be found at the project home page: + + http://groundstation.sourceforge.net/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, visit http://www.fsf.org/ + + +*/ +#ifndef RIG_IO_H +#define RIG_IO_H 1 + +#include <glib.h> + + +gint rig_io_init (const gchar* uplink, const gchar *downlink); +gint rig_io_shutdown (void); + +void rig_io_set_uplink_freq (gdouble freq); +void rig_io_get_uplink_freq (gdouble *freq); + +void rig_io_set_downlink_freq (gdouble freq); +void rig_io_get_downlink_freq (gdouble *freq); + +#endif Modified: trunk/win32/Makefile =================================================================== --- trunk/win32/Makefile 2008-04-09 21:55:53 UTC (rev 32) +++ trunk/win32/Makefile 2008-04-20 13:28:01 UTC (rev 33) @@ -118,6 +118,7 @@ predict-tools.c \ qth-editor.c \ radio-conf.c \ + rig-io.c \ rotor-conf.c \ rdv.c \ sat-cfg.c \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2008-04-09 21:56:46
|
Revision: 32 http://gpredict.svn.sourceforge.net/gpredict/?rev=32&view=rev Author: csete Date: 2008-04-09 14:55:53 -0700 (Wed, 09 Apr 2008) Log Message: ----------- Added all source files. Modified Paths: -------------- trunk/po/POTFILES.in Modified: trunk/po/POTFILES.in =================================================================== --- trunk/po/POTFILES.in 2008-03-30 11:52:23 UTC (rev 31) +++ trunk/po/POTFILES.in 2008-04-09 21:55:53 UTC (rev 32) @@ -3,11 +3,20 @@ src/compat.c src/first-time.c src/gpredict-utils.c +src/gtk-azel-plot.c +src/gtk-met.c +src/gtk-polar-plot.c +src/gtk-polar-view-popup.c +src/gtk-polar-view.c src/gtk-sat-data.c src/gtk-sat-list.c src/gtk-sat-list-col-sel.c +src/gtk-sat-map-ground-track.c +src/gtk-sat-map-popup.c +src/gtk-sat-map.c src/gtk-sat-module.c src/gtk-sat-module-popup.c +src/gtk-sat-module-tmg.c src/gtk-sat-tree.c src/gui.c src/loc-tree.c @@ -16,10 +25,23 @@ src/mod-cfg.c src/mod-mgr.c src/orbit-tools.c +src/pass-popup-menu.c +src/pass-to-txt.c src/predict-tools.c +src/radio-conf.c +src/rdv.c +src/rotor-conf.c src/sat-cfg.c src/sat-log.c +src/sat-log-browser.c src/sat-monitor.c +src/sat-pass-dialogs.c +src/sat-popup-menu.c +src/sat-pref-conditions.c +src/sat-pref-help.c +src/sat-pref-rig-editor.c +src/sat-pref-rot-editor.c +src/sat-pref-single-sat.c src/sat-pref-debug.c src/sat-pref-formats.c src/sat-pref-general.c @@ -40,5 +62,70 @@ src/sat-pref-sky-at-glance.c src/sat-pref-tle.c src/sat-pref.c +src/sat-vis.c +src/save-pass.c src/tle-lookup.c - +src/tle-tools.c +src/tle-update.c +src/gpredict-help.c +src/gtk-single-sat.c +src/gtk-sky-glance.c +src/map-selector.c +src/mod-cfg-get-param.c +src/qth-editor.c +src/gpredict-help.c +src/gtk-azel-plot.c +src/gtk-met.c +src/gtk-polar-plot.c +src/gtk-polar-view-popup.c +src/gtk-polar-view.c +src/gtk-sat-map-ground-track.c +src/gtk-sat-map-popup.c +src/gtk-sat-map.c +src/gtk-sat-module-tmg.c +src/gtk-single-sat.c +src/gtk-sky-glance.c +src/map-selector.c +src/mod-cfg-get-param.c +src/pass-popup-menu.c +src/pass-to-txt.c +src/qth-editor.c +src/radio-conf.c +src/rdv.c +src/rotor-conf.c +src/sat-log-browser.c +src/sat-pass-dialogs.c +src/sat-popup-menu.c +src/sat-pref-conditions.c +src/sat-pref-help.c +src/sat-pref-rig-editor.c +src/sat-pref-rot-editor.c +src/sat-pref-single-sat.c +src/sat-vis.c +src/save-pass.c +src/tle-tools.c +src/tle-update.c +goocanv8/src/goocanvas.c +goocanv8/src/goocanvasellipse.c +goocanv8/src/goocanvasimage.c +goocanv8/src/goocanvasitem.c +goocanv8/src/goocanvasitemmodel.c +goocanv8/src/goocanvasitemsimple.c +goocanv8/src/goocanvaspath.c +goocanv8/src/goocanvaspolyline.c +goocanv8/src/goocanvasrect.c +goocanv8/src/goocanvastable.c +goocanv8/src/goocanvastext.c +goocanv8/src/goocanvaswidget.c +goocanv8/src/goocanvas.c +goocanv8/src/goocanvasellipse.c +goocanv8/src/goocanvasimage.c +goocanv8/src/goocanvasitem.c +goocanv8/src/goocanvasitemmodel.c +goocanv8/src/goocanvasitemsimple.c +goocanv8/src/goocanvaspath.c +goocanv8/src/goocanvaspolyline.c +goocanv8/src/goocanvasrect.c +goocanv8/src/goocanvastable.c +goocanv8/src/goocanvastext.c +goocanv8/src/goocanvaswidget.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2008-03-30 11:52:18
|
Revision: 31 http://gpredict.svn.sourceforge.net/gpredict/?rev=31&view=rev Author: csete Date: 2008-03-30 04:52:23 -0700 (Sun, 30 Mar 2008) Log Message: ----------- Added ranges and initial values. Modified Paths: -------------- trunk/src/gtk-freq-ctrl.c trunk/src/gtk-freq-ctrl.h trunk/src/gtk-rot-ctrl.c trunk/src/gtk-rot-ctrl.h Modified: trunk/src/gtk-freq-ctrl.c =================================================================== --- trunk/src/gtk-freq-ctrl.c 2008-03-30 10:37:53 UTC (rev 30) +++ trunk/src/gtk-freq-ctrl.c 2008-03-30 11:52:23 UTC (rev 31) @@ -117,11 +117,12 @@ /** \brief Create a new Frequency control widget. + * \param[in] val The initial value of the control. * \return A new frequency control widget. * */ GtkWidget * -gtk_freq_ctrl_new () +gtk_freq_ctrl_new (gdouble val) { GtkWidget *widget; GtkWidget *table; @@ -129,8 +130,9 @@ widget = g_object_new (GTK_TYPE_FREQ_CTRL, NULL); + GTK_FREQ_CTRL(widget)->value = val; + gtk_freq_ctrl_update (GTK_FREQ_CTRL(widget)); - gtk_widget_show_all (widget); return widget; Modified: trunk/src/gtk-freq-ctrl.h =================================================================== --- trunk/src/gtk-freq-ctrl.h 2008-03-30 10:37:53 UTC (rev 30) +++ trunk/src/gtk-freq-ctrl.h 2008-03-30 11:52:23 UTC (rev 31) @@ -72,7 +72,7 @@ GtkType gtk_freq_ctrl_get_type (void); -GtkWidget* gtk_freq_ctrl_new (void); +GtkWidget* gtk_freq_ctrl_new (gdouble val); void gtk_freq_ctrl_set_value (GtkFreqCtrl *ctrl, gdouble val); gdouble gtk_freq_ctrl_get_value (GtkFreqCtrl *ctrl); Modified: trunk/src/gtk-rot-ctrl.c =================================================================== --- trunk/src/gtk-rot-ctrl.c 2008-03-30 10:37:53 UTC (rev 30) +++ trunk/src/gtk-rot-ctrl.c 2008-03-30 11:52:23 UTC (rev 31) @@ -119,11 +119,12 @@ /** \brief Create a new rotor control widget. * \param[in] min The lower limit in decimal degrees. * \param[in] max The upper limit in decimal degrees. + * \param[in] val The initial value of the control. * \return A new rotor control widget. * */ GtkWidget * -gtk_rot_ctrl_new (gfloat min, gfloat max) +gtk_rot_ctrl_new (gfloat min, gfloat max, gfloat val) { GtkWidget *widget; GtkWidget *table; @@ -131,10 +132,16 @@ widget = g_object_new (GTK_TYPE_ROT_CTRL, NULL); + GTK_ROT_CTRL(widget)->min = min; + GTK_ROT_CTRL(widget)->max = max; + GTK_ROT_CTRL(widget)->value = val; + + gtk_rot_ctrl_update (GTK_ROT_CTRL(widget)); - gtk_widget_show_all (widget); + + return widget; } @@ -148,7 +155,8 @@ gtk_rot_ctrl_set_value (GtkRotCtrl *ctrl, gfloat val) { /* set the new value */ - ctrl->value = val; + if ((val >= ctrl->min) && (val <= ctrl->max)) + ctrl->value = val; /* update the display */ gtk_rot_ctrl_update (ctrl); Modified: trunk/src/gtk-rot-ctrl.h =================================================================== --- trunk/src/gtk-rot-ctrl.h 2008-03-30 10:37:53 UTC (rev 30) +++ trunk/src/gtk-rot-ctrl.h 2008-03-30 11:52:23 UTC (rev 31) @@ -61,6 +61,8 @@ { GtkVBox vbox; + gfloat min; + gfloat max; gfloat value; }; @@ -72,7 +74,7 @@ GtkType gtk_rot_ctrl_get_type (void); -GtkWidget* gtk_rot_ctrl_new (gfloat min, gfloat max); +GtkWidget* gtk_rot_ctrl_new (gfloat min, gfloat max, gfloat val); void gtk_rot_ctrl_set_value (GtkRotCtrl *ctrl, gfloat val); gfloat gtk_rot_ctrl_get_value (GtkRotCtrl *ctrl); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2008-03-30 10:37:51
|
Revision: 30 http://gpredict.svn.sourceforge.net/gpredict/?rev=30&view=rev Author: csete Date: 2008-03-30 03:37:53 -0700 (Sun, 30 Mar 2008) Log Message: ----------- Added new files. Modified Paths: -------------- trunk/ChangeLog trunk/src/Makefile.am trunk/src/gtk-freq-ctrl.c trunk/win32/Makefile Added Paths: ----------- trunk/src/gtk-rot-ctrl.c trunk/src/gtk-rot-ctrl.h Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-03-30 10:16:10 UTC (rev 29) +++ trunk/ChangeLog 2008-03-30 10:37:53 UTC (rev 30) @@ -1,6 +1,7 @@ 2008-03-30; Alexandru Csete <oz...@gm...> * src/gtk-freq-ctrl.c, gtk-freq-ctrl.h: + * src/gtk-rot-ctrl.c, gtk-rot-ctrl.h: Added files. Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2008-03-30 10:16:10 UTC (rev 29) +++ trunk/src/Makefile.am 2008-03-30 10:37:53 UTC (rev 30) @@ -40,6 +40,7 @@ gtk-polar-plot.c gtk-polar-plot.h \ gtk-polar-view.c gtk-polar-view.h \ gtk-polar-view-popup.c gtk-polar-view-popup.h \ + gtk-rot-ctrl.c gtk-rot-ctrl.h \ gtk-sat-data.c gtk-sat-data.h \ gtk-sat-list.c gtk-sat-list.h \ gtk-sat-list-col-sel.c gtk-sat-list-col-sel.h \ Modified: trunk/src/gtk-freq-ctrl.c =================================================================== --- trunk/src/gtk-freq-ctrl.c 2008-03-30 10:16:10 UTC (rev 29) +++ trunk/src/gtk-freq-ctrl.c 2008-03-30 10:37:53 UTC (rev 30) @@ -45,7 +45,9 @@ static void gtk_freq_ctrl_init (GtkFreqCtrl *list); static void gtk_freq_ctrl_destroy (GtkObject *object); +static void gtk_freq_ctrl_update (GtkFreqCtrl *ctrl); + static GtkHBoxClass *parent_class = NULL; @@ -100,7 +102,7 @@ static void -gtk_freq_ctrl_init (GtkFreqCtrl *list) +gtk_freq_ctrl_init (GtkFreqCtrl *ctrl) { @@ -114,7 +116,10 @@ - +/** \brief Create a new Frequency control widget. + * \return A new frequency control widget. + * + */ GtkWidget * gtk_freq_ctrl_new () { @@ -132,3 +137,43 @@ } +/** \brief Set the value of the frequency control widget. + * \param[in] ctrl THe frequency control widget. + * \param[in] val The new value. + * + */ +void +gtk_freq_ctrl_set_value (GtkFreqCtrl *ctrl, gdouble val) +{ + /* set the new value */ + ctrl->value = val; + + /* update the display */ + gtk_freq_ctrl_update (ctrl); +} + + +/** \brief Get the current value of the frequency control widget. + * \param[in] ctrl The frequency control widget. + * \return The current value. + * + * Hint: For reading the value you can also access ctrl->value. + * + */ +gdouble +gtk_freq_ctrl_get_value (GtkFreqCtrl *ctrl) +{ + return ctrl->value; +} + + + +/** \brief Update frequency display widget. + * \param[in] ctrl The frequency control widget. + * + */ +static void +gtk_freq_ctrl_update (GtkFreqCtrl *ctrl) +{ + +} Added: trunk/src/gtk-rot-ctrl.c =================================================================== --- trunk/src/gtk-rot-ctrl.c (rev 0) +++ trunk/src/gtk-rot-ctrl.c 2008-03-30 10:37:53 UTC (rev 30) @@ -0,0 +1,181 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + Gpredict: Real-time satellite tracking and orbit prediction program + + Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC. + + Authors: Alexandru Csete <oz...@gm...> + + Comments, questions and bugreports should be submitted via + http://sourceforge.net/projects/groundstation/ + More details can be found at the project home page: + + http://groundstation.sourceforge.net/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, visit http://www.fsf.org/ +*/ +/** \brief ROTOR control. + * + * More info... + * + * \bug This should be a generic widget, not just rotor specific + * + */ +#include <gtk/gtk.h> +#include <glib/gi18n.h> +#include "gtk-rot-ctrl.h" +#ifdef HAVE_CONFIG_H +# include <build-config.h> +#endif + + + +static void gtk_rot_ctrl_class_init (GtkRotCtrlClass *class); +static void gtk_rot_ctrl_init (GtkRotCtrl *list); +static void gtk_rot_ctrl_destroy (GtkObject *object); + +static void gtk_rot_ctrl_update (GtkRotCtrl *ctrl); + + +static GtkHBoxClass *parent_class = NULL; + + +GType +gtk_rot_ctrl_get_type () +{ + static GType gtk_rot_ctrl_type = 0; + + if (!gtk_rot_ctrl_type) { + + static const GTypeInfo gtk_rot_ctrl_info = { + sizeof (GtkRotCtrlClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gtk_rot_ctrl_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GtkRotCtrl), + 5, /* n_preallocs */ + (GInstanceInitFunc) gtk_rot_ctrl_init, + }; + + gtk_rot_ctrl_type = g_type_register_static (GTK_TYPE_VBOX, + "GtkRotCtrl", + >k_rot_ctrl_info, + 0); + } + + return gtk_rot_ctrl_type; +} + + +static void +gtk_rot_ctrl_class_init (GtkRotCtrlClass *class) +{ + GObjectClass *gobject_class; + GtkObjectClass *object_class; + GtkWidgetClass *widget_class; + GtkContainerClass *container_class; + + gobject_class = G_OBJECT_CLASS (class); + object_class = (GtkObjectClass*) class; + widget_class = (GtkWidgetClass*) class; + container_class = (GtkContainerClass*) class; + + parent_class = g_type_class_peek_parent (class); + + object_class->destroy = gtk_rot_ctrl_destroy; + +} + + + +static void +gtk_rot_ctrl_init (GtkRotCtrl *ctrl) +{ + + +} + +static void +gtk_rot_ctrl_destroy (GtkObject *object) +{ + (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); +} + + + +/** \brief Create a new rotor control widget. + * \param[in] min The lower limit in decimal degrees. + * \param[in] max The upper limit in decimal degrees. + * \return A new rotor control widget. + * + */ +GtkWidget * +gtk_rot_ctrl_new (gfloat min, gfloat max) +{ + GtkWidget *widget; + GtkWidget *table; + + + widget = g_object_new (GTK_TYPE_ROT_CTRL, NULL); + + + + gtk_widget_show_all (widget); + + return widget; +} + + +/** \brief Set the value of the rotor control widget. + * \param[in] ctrl The rotor control widget. + * \param[in] val The new value. + * + */ +void +gtk_rot_ctrl_set_value (GtkRotCtrl *ctrl, gfloat val) +{ + /* set the new value */ + ctrl->value = val; + + /* update the display */ + gtk_rot_ctrl_update (ctrl); +} + + +/** \brief Get the current value of the rotor control widget. + * \param[in] ctrl The rotor control widget. + * \return The current value. + * + * Hint: For reading the value you can also access ctrl->value. + * + */ +gfloat +gtk_rot_ctrl_get_value (GtkRotCtrl *ctrl) +{ + return ctrl->value; +} + + + +/** \brief Update rotor display widget. + * \param[in] ctrl The rottor control widget. + * + */ +static void +gtk_rot_ctrl_update (GtkRotCtrl *ctrl) +{ + +} Added: trunk/src/gtk-rot-ctrl.h =================================================================== --- trunk/src/gtk-rot-ctrl.h (rev 0) +++ trunk/src/gtk-rot-ctrl.h 2008-03-30 10:37:53 UTC (rev 30) @@ -0,0 +1,86 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + Gpredict: Real-time satellite tracking and orbit prediction program + + Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC. + + Authors: Alexandru Csete <oz...@gm...> + + Comments, questions and bugreports should be submitted via + http://sourceforge.net/projects/groundstation/ + More details can be found at the project home page: + + http://groundstation.sourceforge.net/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, visit http://www.fsf.org/ +*/ +#ifndef __GTK_ROT_CTRL_H__ +#define __GTK_ROT_CTRL_H__ 1 + +#include <glib.h> +#include <glib/gi18n.h> +#include <gtk/gtk.h> + + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + + + +#define GTK_TYPE_ROT_CTRL (gtk_rot_ctrl_get_type ()) +#define GTK_ROT_CTRL(obj) GTK_CHECK_CAST (obj,\ + gtk_rot_ctrl_get_type (),\ + GtkRotCtrl) + +#define GTK_ROT_CTRL_CLASS(klass) GTK_CHECK_CLASS_CAST (klass,\ + gtk_rot_ctrl_get_type (),\ + GtkRotCtrlClass) + +#define IS_GTK_ROT_CTRL(obj) GTK_CHECK_TYPE (obj, gtk_rot_ctrl_get_type ()) + + +typedef struct _gtk_rot_ctrl GtkRotCtrl; +typedef struct _GtkRotCtrlClass GtkRotCtrlClass; + + + +struct _gtk_rot_ctrl +{ + GtkVBox vbox; + + gfloat value; +}; + +struct _GtkRotCtrlClass +{ + GtkVBoxClass parent_class; +}; + + + +GtkType gtk_rot_ctrl_get_type (void); +GtkWidget* gtk_rot_ctrl_new (gfloat min, gfloat max); +void gtk_rot_ctrl_set_value (GtkRotCtrl *ctrl, gfloat val); +gfloat gtk_rot_ctrl_get_value (GtkRotCtrl *ctrl); + + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __GTK_ROT_CTRL_H__ */ Modified: trunk/win32/Makefile =================================================================== --- trunk/win32/Makefile 2008-03-30 10:16:10 UTC (rev 29) +++ trunk/win32/Makefile 2008-03-30 10:37:53 UTC (rev 30) @@ -90,6 +90,7 @@ gtk-polar-plot.c \ gtk-polar-view.c \ gtk-polar-view-popup.c \ + gtk-rot-ctrl.c \ gtk-sat-data.c \ gtk-sat-list.c \ gtk-sat-list-col-sel.c \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2008-03-30 10:16:15
|
Revision: 29 http://gpredict.svn.sourceforge.net/gpredict/?rev=29&view=rev Author: csete Date: 2008-03-30 03:16:10 -0700 (Sun, 30 Mar 2008) Log Message: ----------- Added new files. Modified Paths: -------------- trunk/ChangeLog trunk/src/Makefile.am trunk/win32/Makefile Added Paths: ----------- trunk/src/gtk-freq-ctrl.c trunk/src/gtk-freq-ctrl.h Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-03-27 14:55:34 UTC (rev 28) +++ trunk/ChangeLog 2008-03-30 10:16:10 UTC (rev 29) @@ -1,3 +1,9 @@ +2008-03-30; Alexandru Csete <oz...@gm...> + + * src/gtk-freq-ctrl.c, gtk-freq-ctrl.h: + Added files. + + 2008-03-27; Alexandru Csete <oz...@gm...> * src/radio-conf.[ch]: Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2008-03-27 14:55:34 UTC (rev 28) +++ trunk/src/Makefile.am 2008-03-30 10:16:10 UTC (rev 29) @@ -35,6 +35,7 @@ gpredict-url-hook.c gpredict-url-hook.h \ gpredict-utils.c gpredict-utils.h \ gtk-azel-plot.c gtk-azel-plot.h \ + gtk-freq-ctrl.c gtk-freq-ctrl.h \ gtk-met.c gtk-met.h \ gtk-polar-plot.c gtk-polar-plot.h \ gtk-polar-view.c gtk-polar-view.h \ Added: trunk/src/gtk-freq-ctrl.c =================================================================== --- trunk/src/gtk-freq-ctrl.c (rev 0) +++ trunk/src/gtk-freq-ctrl.c 2008-03-30 10:16:10 UTC (rev 29) @@ -0,0 +1,134 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + Gpredict: Real-time satellite tracking and orbit prediction program + + Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC. + + Authors: Alexandru Csete <oz...@gm...> + + Comments, questions and bugreports should be submitted via + http://sourceforge.net/projects/groundstation/ + More details can be found at the project home page: + + http://groundstation.sourceforge.net/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, visit http://www.fsf.org/ +*/ +/** \brief FREQ control. + * + * More info... + * + * \bug This should be a generic widget, not just frequency specific + * + */ +#include <gtk/gtk.h> +#include <glib/gi18n.h> +#include "gtk-freq-ctrl.h" +#ifdef HAVE_CONFIG_H +# include <build-config.h> +#endif + + + +static void gtk_freq_ctrl_class_init (GtkFreqCtrlClass *class); +static void gtk_freq_ctrl_init (GtkFreqCtrl *list); +static void gtk_freq_ctrl_destroy (GtkObject *object); + + +static GtkHBoxClass *parent_class = NULL; + + +GType +gtk_freq_ctrl_get_type () +{ + static GType gtk_freq_ctrl_type = 0; + + if (!gtk_freq_ctrl_type) { + + static const GTypeInfo gtk_freq_ctrl_info = { + sizeof (GtkFreqCtrlClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gtk_freq_ctrl_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GtkFreqCtrl), + 5, /* n_preallocs */ + (GInstanceInitFunc) gtk_freq_ctrl_init, + }; + + gtk_freq_ctrl_type = g_type_register_static (GTK_TYPE_VBOX, + "GtkFreqCtrl", + >k_freq_ctrl_info, + 0); + } + + return gtk_freq_ctrl_type; +} + + +static void +gtk_freq_ctrl_class_init (GtkFreqCtrlClass *class) +{ + GObjectClass *gobject_class; + GtkObjectClass *object_class; + GtkWidgetClass *widget_class; + GtkContainerClass *container_class; + + gobject_class = G_OBJECT_CLASS (class); + object_class = (GtkObjectClass*) class; + widget_class = (GtkWidgetClass*) class; + container_class = (GtkContainerClass*) class; + + parent_class = g_type_class_peek_parent (class); + + object_class->destroy = gtk_freq_ctrl_destroy; + +} + + + +static void +gtk_freq_ctrl_init (GtkFreqCtrl *list) +{ + + +} + +static void +gtk_freq_ctrl_destroy (GtkObject *object) +{ + (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); +} + + + + +GtkWidget * +gtk_freq_ctrl_new () +{ + GtkWidget *widget; + GtkWidget *table; + + + widget = g_object_new (GTK_TYPE_FREQ_CTRL, NULL); + + + + gtk_widget_show_all (widget); + + return widget; +} + + Added: trunk/src/gtk-freq-ctrl.h =================================================================== --- trunk/src/gtk-freq-ctrl.h (rev 0) +++ trunk/src/gtk-freq-ctrl.h 2008-03-30 10:16:10 UTC (rev 29) @@ -0,0 +1,86 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + Gpredict: Real-time satellite tracking and orbit prediction program + + Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC. + + Authors: Alexandru Csete <oz...@gm...> + + Comments, questions and bugreports should be submitted via + http://sourceforge.net/projects/groundstation/ + More details can be found at the project home page: + + http://groundstation.sourceforge.net/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, visit http://www.fsf.org/ +*/ +#ifndef __GTK_FREQ_CTRL_H__ +#define __GTK_FREQ_CTRL_H__ 1 + +#include <glib.h> +#include <glib/gi18n.h> +#include <gtk/gtk.h> + + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + + + +#define GTK_TYPE_FREQ_CTRL (gtk_freq_ctrl_get_type ()) +#define GTK_FREQ_CTRL(obj) GTK_CHECK_CAST (obj,\ + gtk_freq_ctrl_get_type (),\ + GtkFreqCtrl) + +#define GTK_FREQ_CTRL_CLASS(klass) GTK_CHECK_CLASS_CAST (klass,\ + gtk_freq_ctrl_get_type (),\ + GtkFreqCtrlClass) + +#define IS_GTK_FREQ_CTRL(obj) GTK_CHECK_TYPE (obj, gtk_freq_ctrl_get_type ()) + + +typedef struct _gtk_freq_ctrl GtkFreqCtrl; +typedef struct _GtkFreqCtrlClass GtkFreqCtrlClass; + + + +struct _gtk_freq_ctrl +{ + GtkVBox vbox; + + gdouble value; +}; + +struct _GtkFreqCtrlClass +{ + GtkVBoxClass parent_class; +}; + + + +GtkType gtk_freq_ctrl_get_type (void); +GtkWidget* gtk_freq_ctrl_new (void); +void gtk_freq_ctrl_set_value (GtkFreqCtrl *ctrl, gdouble val); +gdouble gtk_freq_ctrl_get_value (GtkFreqCtrl *ctrl); + + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __GTK_FREQ_CTRL_H__ */ Modified: trunk/win32/Makefile =================================================================== --- trunk/win32/Makefile 2008-03-27 14:55:34 UTC (rev 28) +++ trunk/win32/Makefile 2008-03-30 10:16:10 UTC (rev 29) @@ -86,6 +86,7 @@ gpredict-url-hook.c \ gpredict-utils.c \ gtk-azel-plot.c \ + gtk-freq-ctrl.c \ gtk-polar-plot.c \ gtk-polar-view.c \ gtk-polar-view-popup.c \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2008-03-27 14:56:18
|
Revision: 28 http://gpredict.svn.sourceforge.net/gpredict/?rev=28&view=rev Author: csete Date: 2008-03-27 07:55:34 -0700 (Thu, 27 Mar 2008) Log Message: ----------- Added radio and antenna control menu items. Modified Paths: -------------- trunk/ChangeLog trunk/src/gtk-sat-module-popup.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-03-27 12:45:46 UTC (rev 27) +++ trunk/ChangeLog 2008-03-27 14:55:34 UTC (rev 28) @@ -6,8 +6,11 @@ * src/sat-pref-rig.c: * src/sat-pref-rig-editor.c: * src/sat-pref-rig-data.h: - Added configuration controls for CAT extensions + Added configuration controls for CAT extensions. + * src/gtk-sat-module-popup.c: + Added menu items for radio and rotator control. + 2008-03-17; Alexandru Csete <oz...@gm...> Modified: trunk/src/gtk-sat-module-popup.c =================================================================== --- trunk/src/gtk-sat-module-popup.c 2008-03-27 12:45:46 UTC (rev 27) +++ trunk/src/gtk-sat-module-popup.c 2008-03-27 14:55:34 UTC (rev 28) @@ -53,6 +53,8 @@ static void screen_state_cb (GtkWidget *menuitem, gpointer data); static void sky_at_glance_cb (GtkWidget *menuitem, gpointer data); static void tmgr_cb (GtkWidget *menuitem, gpointer data); +static void rigctrl_cb (GtkWidget *menuitem, gpointer data); +static void rotctrl_cb (GtkWidget *menuitem, gpointer data); static void delete_cb (GtkWidget *menuitem, gpointer data); static void close_cb (GtkWidget *menuitem, gpointer data); static void name_changed (GtkWidget *widget, gpointer data); @@ -155,8 +157,29 @@ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); g_signal_connect (menuitem, "activate", G_CALLBACK (tmgr_cb), module); + + /* separator */ + menuitem = gtk_separator_menu_item_new (); + gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); - + /* Radio Control */ + menuitem = gtk_image_menu_item_new_with_label (_("Radio Control")); + buff = icon_file_name ("gpredict-oscilloscope-small.png"); + image = gtk_image_new_from_file (buff); + g_free (buff); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); + gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); + g_signal_connect (menuitem, "activate", G_CALLBACK (rigctrl_cb), module); + + /* Antenna Control */ + menuitem = gtk_image_menu_item_new_with_label (_("Antenna Control")); + buff = icon_file_name ("gpredict-antenna-small.png"); + image = gtk_image_new_from_file (buff); + g_free (buff); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); + gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); + g_signal_connect (menuitem, "activate", G_CALLBACK (rotctrl_cb), module); + /* separator */ menuitem = gtk_separator_menu_item_new (); gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); @@ -816,6 +839,26 @@ tmg_create (module); } +/** \brief Open Radio control window. */ +static void +rigctrl_cb (GtkWidget *menuitem, gpointer data) +{ + GtkSatModule *module = GTK_SAT_MODULE (data); + + +} + +/** \brief Open antenna rotator control window. */ +static void +rotctrl_cb (GtkWidget *menuitem, gpointer data) +{ + GtkSatModule *module = GTK_SAT_MODULE (data); + + +} + + + /** \brief Close module. * * This function is called when the user selects the close menu This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2008-03-27 12:50:05
|
Revision: 27 http://gpredict.svn.sourceforge.net/gpredict/?rev=27&view=rev Author: csete Date: 2008-03-27 05:45:46 -0700 (Thu, 27 Mar 2008) Log Message: ----------- Added controls for enabling extended CAT commands (i.e. commands that are not supported by hamlib). Modified Paths: -------------- trunk/ChangeLog trunk/src/radio-conf.c trunk/src/radio-conf.h 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 2008-03-18 00:25:51 UTC (rev 26) +++ trunk/ChangeLog 2008-03-27 12:45:46 UTC (rev 27) @@ -1,5 +1,23 @@ -2008-01-26; Alexandur Csete <oz...@gm...> +2008-03-27; Alexandru Csete <oz...@gm...> + * src/radio-conf.[ch]: + Added parameter for enabling built-in radio extensions. + + * src/sat-pref-rig.c: + * src/sat-pref-rig-editor.c: + * src/sat-pref-rig-data.h: + Added configuration controls for CAT extensions + + +2008-03-17; Alexandru Csete <oz...@gm...> + + * src/sat-pref-rig.c: + Fixed bug that caused incorrect display of DTR and RTS line settings in + the radio list. + + +2008-01-26; Alexandru Csete <oz...@gm...> + * src/rotor-conf.[ch]: * src/sat-pref-rot.c: * src/sat-pref-rot-editor.c Modified: trunk/src/radio-conf.c =================================================================== --- trunk/src/radio-conf.c 2008-03-18 00:25:51 UTC (rev 26) +++ trunk/src/radio-conf.c 2008-03-27 12:45:46 UTC (rev 27) @@ -41,6 +41,7 @@ #define KEY_PORT "Port" #define KEY_SPEED "Speed" #define KEY_CIV "CIV" +#define KEY_EXT "EXT" #define KEY_DTR "DTR" #define KEY_RTS "RTS" @@ -91,6 +92,7 @@ conf->port = g_key_file_get_string (cfg, GROUP, KEY_PORT, NULL); conf->speed = g_key_file_get_integer (cfg, GROUP, KEY_SPEED, NULL); conf->civ = g_key_file_get_integer (cfg, GROUP, KEY_CIV, NULL); + conf->ext = g_key_file_get_boolean (cfg, GROUP, KEY_EXT, NULL); conf->dtr = g_key_file_get_integer (cfg, GROUP, KEY_DTR, NULL); conf->rts = g_key_file_get_integer (cfg, GROUP, KEY_RTS, NULL); @@ -127,6 +129,7 @@ g_key_file_set_string (cfg, GROUP, KEY_PORT, conf->port); g_key_file_set_integer (cfg, GROUP, KEY_SPEED, conf->speed); g_key_file_set_integer (cfg, GROUP, KEY_CIV, conf->civ); + g_key_file_set_boolean (cfg, GROUP, KEY_EXT, conf->ext); g_key_file_set_integer (cfg, GROUP, KEY_DTR, conf->dtr); g_key_file_set_integer (cfg, GROUP, KEY_RTS, conf->rts); Modified: trunk/src/radio-conf.h =================================================================== --- trunk/src/radio-conf.h 2008-03-18 00:25:51 UTC (rev 26) +++ trunk/src/radio-conf.h 2008-03-27 12:45:46 UTC (rev 27) @@ -61,6 +61,7 @@ gchar *port; /*!< Device name, e.g. /dev/ttyS0. */ guint speed; /*!< Serial speed. */ guint civ; /*!< ICOM CI-V address. */ + gboolean ext; /*!< Use built in extensions if available. */ ctrl_stat_t dtr; /*!< DTR line usage. */ ctrl_stat_t rts; /*!< PTT line usage. */ } radio_conf_t; Modified: trunk/src/sat-pref-rig-data.h =================================================================== --- trunk/src/sat-pref-rig-data.h 2008-03-18 00:25:51 UTC (rev 26) +++ trunk/src/sat-pref-rig-data.h 2008-03-27 12:45:46 UTC (rev 27) @@ -37,6 +37,7 @@ RIG_LIST_COL_PORT, /*!< Port / Device, e.g. /dev/ttyS0. */ RIG_LIST_COL_SPEED, /*!< Serial speed. */ RIG_LIST_COL_CIV, /*!< CI-V address for Icom rigs. */ + RIG_LIST_COL_EXT, /*!< Use built-in extensions. */ RIG_LIST_COL_DTR, /*!< DTR line usage */ RIG_LIST_COL_RTS, /*!< RTS line usage */ RIG_LIST_COL_NUM /*!< The number of fields in the list. */ Modified: trunk/src/sat-pref-rig-editor.c =================================================================== --- trunk/src/sat-pref-rig-editor.c 2008-03-18 00:25:51 UTC (rev 26) +++ trunk/src/sat-pref-rig-editor.c 2008-03-27 12:45:46 UTC (rev 27) @@ -56,6 +56,7 @@ static GtkWidget *name; /* Configuration name */ static GtkWidget *model; /* radio model, e.g. TS-2000 */ static GtkWidget *civ; /* Icom CI-V address */ +static GtkWidget *ext; /* Built-in extensions */ static GtkWidget *type; /* radio type */ static GtkWidget *port; /* port selector */ static GtkWidget *speed; /* serial speed selector */ @@ -240,6 +241,16 @@ _("Select radio type. Consult the user manual, if unsure")); gtk_table_attach_defaults (GTK_TABLE (table), type, 1, 2, 2, 3); + + /* Enable built-in extensions */ + ext = gtk_check_button_new_with_label (_("Extended CAT")); + gtk_widget_set_tooltip_text (ext, + _("Enable built-in gpredict CAT extensions if they are "\ + "available. This allows the use of commands that are "\ + "not supported by hamlib, but are necessary for full "\ + "duplex operation with IC-910, FT-847, etc.")); + gtk_table_attach_defaults (GTK_TABLE (table), ext, 3, 5, 2, 3); + /* Port */ label = gtk_label_new (_("Port")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); @@ -377,6 +388,9 @@ /* CI-V */ gtk_combo_box_set_active (GTK_COMBO_BOX (civ), conf->civ); + /* Extension */ + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ext), conf->ext); + /* DTR and RTS lines */ gtk_combo_box_set_active (GTK_COMBO_BOX (dtr), conf->dtr); gtk_combo_box_set_active (GTK_COMBO_BOX (rts), conf->rts); @@ -398,6 +412,7 @@ gtk_combo_box_set_active (GTK_COMBO_BOX (port), 0); gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 4); gtk_combo_box_set_active (GTK_COMBO_BOX (civ), 0); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ext), FALSE); gtk_combo_box_set_active (GTK_COMBO_BOX (dtr), 0); gtk_combo_box_set_active (GTK_COMBO_BOX (rts), 0); } @@ -455,6 +470,9 @@ /* CI-V */ conf->civ = gtk_combo_box_get_active (GTK_COMBO_BOX (civ)); + /* Extensions */ + conf->ext = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (ext)); + /* serial speed */ switch (gtk_combo_box_get_active (GTK_COMBO_BOX (speed))) { case 0: Modified: trunk/src/sat-pref-rig.c =================================================================== --- trunk/src/sat-pref-rig.c 2008-03-18 00:25:51 UTC (rev 26) +++ trunk/src/sat-pref-rig.c 2008-03-27 12:45:46 UTC (rev 27) @@ -114,6 +114,7 @@ riglist = gtk_tree_view_new (); + gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (riglist), TRUE); model = create_and_fill_model (); gtk_tree_view_set_model (GTK_TREE_VIEW (riglist), model); @@ -173,6 +174,14 @@ 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, @@ -220,6 +229,7 @@ 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 ); @@ -251,6 +261,7 @@ 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, -1); @@ -367,6 +378,7 @@ .port = NULL, .speed = 0, .civ = 0, + .ext = FALSE, .dtr = LINE_UNDEF, .rts = LINE_UNDEF, }; @@ -412,6 +424,7 @@ 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, -1); @@ -457,6 +470,7 @@ .port = NULL, .speed = 0, .civ = 0, + .ext = FALSE, .dtr = LINE_UNDEF, .rts = LINE_UNDEF, }; @@ -476,6 +490,7 @@ 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, -1); @@ -513,6 +528,7 @@ .port = NULL, .speed = 0, .civ = 0, + .ext = FALSE, .dtr = LINE_UNDEF, .rts = LINE_UNDEF, }; @@ -543,6 +559,7 @@ 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, -1); @@ -576,6 +593,7 @@ 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, -1); @@ -703,6 +721,7 @@ g_free (buff); } + /** \brief Render DTR or RTS columns address. * \param col Pointer to the tree view column. * \param renderer Pointer to the renderer. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2008-03-18 00:25:45
|
Revision: 26 http://gpredict.svn.sourceforge.net/gpredict/?rev=26&view=rev Author: csete Date: 2008-03-17 17:25:51 -0700 (Mon, 17 Mar 2008) Log Message: ----------- Display correct DTR and RTS line setting. Modified Paths: -------------- trunk/src/sat-pref-rig.c Modified: trunk/src/sat-pref-rig.c =================================================================== --- trunk/src/sat-pref-rig.c 2008-01-27 21:56:22 UTC (rev 25) +++ trunk/src/sat-pref-rig.c 2008-03-18 00:25:51 UTC (rev 26) @@ -727,6 +727,10 @@ switch (number) { + case LINE_OFF: + g_object_set (renderer, "text", "OFF", NULL); + break; + case LINE_ON: g_object_set (renderer, "text", "ON", NULL); break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2008-01-27 21:56:37
|
Revision: 25 http://gpredict.svn.sourceforge.net/gpredict/?rev=25&view=rev Author: csete Date: 2008-01-27 13:56:22 -0800 (Sun, 27 Jan 2008) Log Message: ----------- Added print button. Modified Paths: -------------- trunk/src/sat-pass-dialogs.c Modified: trunk/src/sat-pass-dialogs.c =================================================================== --- trunk/src/sat-pass-dialogs.c 2008-01-26 23:33:02 UTC (rev 24) +++ trunk/src/sat-pass-dialogs.c 2008-01-27 21:56:22 UTC (rev 25) @@ -490,7 +490,7 @@ dialog = gtk_dialog_new_with_buttons (title, GTK_WINDOW (toplevel), GTK_DIALOG_DESTROY_WITH_PARENT, - //GTK_STOCK_PRINT, RESPONSE_PRINT, + GTK_STOCK_PRINT, RESPONSE_PRINT, GTK_STOCK_SAVE, RESPONSE_SAVE, GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL); @@ -543,6 +543,9 @@ switch (response) { case RESPONSE_PRINT: + sat_log_log (SAT_LOG_LEVEL_ERROR, + _("%s: PRINT not implemented"), + __FUNCTION__); break; case RESPONSE_SAVE: @@ -1088,7 +1091,7 @@ dialog = gtk_dialog_new_with_buttons (title, GTK_WINDOW (toplevel), GTK_DIALOG_DESTROY_WITH_PARENT, - //GTK_STOCK_PRINT, RESPONSE_PRINT, + GTK_STOCK_PRINT, RESPONSE_PRINT, GTK_STOCK_SAVE, RESPONSE_SAVE, GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, @@ -1141,7 +1144,10 @@ switch (response) { case RESPONSE_PRINT: - break; + sat_log_log (SAT_LOG_LEVEL_ERROR, + _("%s: PRINT not implemented"), + __FUNCTION__); + break; case RESPONSE_SAVE: save_passes (dialog); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2008-01-26 23:32:58
|
Revision: 24 http://gpredict.svn.sourceforge.net/gpredict/?rev=24&view=rev Author: csete Date: 2008-01-26 15:33:02 -0800 (Sat, 26 Jan 2008) Log Message: ----------- Added support for Az and El limits. Modified Paths: -------------- trunk/ChangeLog trunk/goocanv8/Makefile.in trunk/goocanv8/aclocal.m4 trunk/goocanv8/configure trunk/goocanv8/src/Makefile.in trunk/src/rotor-conf.c trunk/src/rotor-conf.h trunk/src/sat-pref-rot-data.h trunk/src/sat-pref-rot-editor.c trunk/src/sat-pref-rot.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-01-24 23:38:45 UTC (rev 23) +++ trunk/ChangeLog 2008-01-26 23:33:02 UTC (rev 24) @@ -1,3 +1,12 @@ +2008-01-26; Alexandur Csete <oz...@gm...> + + * src/rotor-conf.[ch]: + * src/sat-pref-rot.c: + * src/sat-pref-rot-editor.c + * src/sat-pref-rot-data.h: + Added support for Az and El limits. + + 2008-01-24; Alexandru Csete <oz...@gm...> * src/sat-pref-rig-editor.[ch]: Modified: trunk/goocanv8/Makefile.in =================================================================== --- trunk/goocanv8/Makefile.in 2008-01-24 23:38:45 UTC (rev 23) +++ trunk/goocanv8/Makefile.in 2008-01-26 23:33:02 UTC (rev 24) @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -13,15 +13,11 @@ # PARTICULAR PURPOSE. @SET_MAKE@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -35,18 +31,18 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/goocanvas.pc.in $(top_srcdir)/configure AUTHORS \ COPYING ChangeLog INSTALL NEWS TODO config.guess config.sub \ depcomp install-sh ltmain.sh missing mkinstalldirs -subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno configure.status.lineno + configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = goocanvas.pc @@ -54,10 +50,13 @@ DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ - install-exec-recursive install-info-recursive \ - install-recursive installcheck-recursive installdirs-recursive \ - pdf-recursive ps-recursive uninstall-info-recursive \ - uninstall-recursive + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) @@ -73,8 +72,6 @@ distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ @@ -110,6 +107,7 @@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ +INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -124,9 +122,8 @@ LTLIBOBJS = @LTLIBOBJS@ LT_VERSION_INFO = @LT_VERSION_INFO@ MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ @@ -142,8 +139,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ -PLATFORM_WIN32_FALSE = @PLATFORM_WIN32_FALSE@ -PLATFORM_WIN32_TRUE = @PLATFORM_WIN32_TRUE@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ @@ -157,13 +152,13 @@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -175,6 +170,7 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ +builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ @@ -202,8 +198,11 @@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ SUBDIRS = src po # require automake 1.7 @@ -253,7 +252,7 @@ config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ - $(MAKE) stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @@ -277,7 +276,6 @@ distclean-libtool: -rm -f libtool -uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -310,8 +308,7 @@ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: +$(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ @@ -413,24 +410,22 @@ distdir: $(DISTFILES) $(am__remove_distdir) - mkdir $(distdir) - $(mkdir_p) $(distdir)/. $(distdir)/po - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ + test -d $(distdir) || mkdir $(distdir) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ @@ -444,7 +439,7 @@ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ - || $(mkdir_p) "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ @@ -452,6 +447,8 @@ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ @@ -459,7 +456,7 @@ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz @@ -534,7 +531,7 @@ $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ @@ -604,12 +601,20 @@ install-data-am: +install-dvi: install-dvi-recursive + install-exec-am: +install-html: install-html-recursive + install-info: install-info-recursive install-man: +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + installcheck-am: maintainer-clean: maintainer-clean-recursive @@ -630,24 +635,26 @@ ps-am: -uninstall-am: uninstall-info-am +uninstall-am: -uninstall-info: uninstall-info-recursive +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ - check-am clean clean-generic clean-libtool clean-recursive \ - ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ - dist-shar dist-tarZ dist-zip distcheck distclean \ +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-generic \ + clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ + dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \ distclean-generic distclean-hdr distclean-libtool \ - distclean-recursive distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-generic \ - mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am uninstall-info-am + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. Modified: trunk/goocanv8/aclocal.m4 =================================================================== --- trunk/goocanv8/aclocal.m4 2008-01-24 23:38:45 UTC (rev 23) +++ trunk/goocanv8/aclocal.m4 2008-01-26 23:33:02 UTC (rev 24) @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.9.6 -*- Autoconf -*- +# generated automatically by aclocal 1.10 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005 Free Software Foundation, Inc. +# 2005, 2006 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -11,6 +11,11 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. +m4_if(m4_PACKAGE_VERSION, [2.61],, +[m4_fatal([this file was generated for autoconf 2.61. +You have another version of autoconf. If you want to use that, +you should regenerate the build system entirely.], [63])]) + # Copyright (C) 1995-2002 Free Software Foundation, Inc. # Copyright (C) 2001-2003,2004 Red Hat, Inc. # @@ -7184,7 +7189,7 @@ fi[]dnl ])# PKG_CHECK_MODULES -# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -7194,14 +7199,29 @@ # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. -AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.10' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.10], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- -# Call AM_AUTOMAKE_VERSION so it can be traced. +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.9.6])]) +[AM_AUTOMAKE_VERSION([1.10])dnl +_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- @@ -7258,14 +7278,14 @@ # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 7 +# serial 8 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- @@ -7274,8 +7294,10 @@ [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE]) -AC_SUBST([$1_FALSE]) +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl if $2; then $1_TRUE= $1_FALSE='#' @@ -7289,15 +7311,14 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 8 +# serial 9 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -7325,6 +7346,7 @@ ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) @@ -7390,6 +7412,7 @@ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then @@ -7442,7 +7465,8 @@ AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- @@ -7467,8 +7491,9 @@ # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue @@ -7515,8 +7540,8 @@ # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -7539,16 +7564,20 @@ # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.58])dnl +[AC_PREREQ([2.60])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi fi # test whether we have cygpath @@ -7568,6 +7597,9 @@ AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl @@ -7603,6 +7635,10 @@ [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) ]) @@ -7638,7 +7674,7 @@ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -install_sh=${install_sh-"$am_aux_dir/install-sh"} +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. @@ -7745,14 +7781,14 @@ # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 +# serial 5 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ @@ -7768,6 +7804,7 @@ # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then @@ -7778,7 +7815,7 @@ fi ]) -# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -7786,60 +7823,23 @@ # AM_PROG_MKDIR_P # --------------- -# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. -# -# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories -# created by `make install' are always world readable, even if the -# installer happens to have an overly restrictive umask (e.g. 077). -# This was a mistake. There are at least two reasons why we must not -# use `-m 0755': -# - it causes special bits like SGID to be ignored, -# - it may be too restrictive (some setups expect 775 directories). -# -# Do not use -m 0755 and let people choose whatever they expect by -# setting umask. -# -# We cannot accept any implementation of `mkdir' that recognizes `-p'. -# Some implementations (such as Solaris 8's) are not thread-safe: if a -# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' -# concurrently, both version can detect that a/ is missing, but only -# one can create it and the other will error out. Consequently we -# restrict ourselves to GNU make (using the --version option ensures -# this.) +# Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], -[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # We used to keeping the `.' as first argument, in order to - # allow $(mkdir_p) to be used without argument. As in - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. However this is wrong - # for two reasons: - # 1. if the package is installed by a user who cannot write `.' - # make install will fail, - # 2. the above comment should most certainly read - # $(mkdir_p) $(DESTDIR)$(somedir) - # so it does not work when $(somedir) is undefined and - # $(DESTDIR) is not. - # To support the latter case, we have to write - # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), - # so the `.' trick is pointless. - mkdir_p='mkdir -p --' -else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' - else - mkdir_p='$(install_sh) -d' - fi -fi -AC_SUBST([mkdir_p])]) +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) # Helper functions for option handling. -*- Autoconf -*- @@ -7951,9 +7951,21 @@ if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) +# Copyright (C) 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. Modified: trunk/goocanv8/configure =================================================================== --- trunk/goocanv8/configure 2008-01-24 23:38:45 UTC (rev 23) +++ trunk/goocanv8/configure 2008-01-26 23:33:02 UTC (rev 24) @@ -807,6 +807,7 @@ INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA +am__isrc CYGPATH_W PACKAGE VERSION @@ -1971,7 +1972,8 @@ ac_config_headers="$ac_config_headers config.h" -am__api_version="1.9" +am__api_version='1.10' + ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then @@ -2154,39 +2156,54 @@ echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi -if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # We used to keeping the `.' as first argument, in order to - # allow $(mkdir_p) to be used without argument. As in - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. However this is wrong - # for two reasons: - # 1. if the package is installed by a user who cannot write `.' - # make install will fail, - # 2. the above comment should most certainly read - # $(mkdir_p) $(DESTDIR)$(somedir) - # so it does not work when $(somedir) is undefined and - # $(DESTDIR) is not. - # To support the latter case, we have to write - # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), - # so the `.' trick is pointless. - mkdir_p='mkdir -p --' +{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done +done +IFS=$as_save_IFS + +fi + + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" else - mkdir_p='$(install_sh) -d' + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" fi fi +{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +echo "${ECHO_T}$MKDIR_P" >&6; } +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -2268,12 +2285,16 @@ fi rmdir .tst 2>/dev/null -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } + fi fi # test whether we have cygpath @@ -2316,7 +2337,7 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} -install_sh=${install_sh-"$am_aux_dir/install-sh"} +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right @@ -2420,7 +2441,7 @@ fi fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. @@ -2457,9 +2478,7 @@ { echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6; } - - -if test $USE_MAINTAINER_MODE = yes; then + if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else @@ -2524,9 +2543,7 @@ am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi - - -if test "x$enable_dependency_tracking" != xno; then + if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else @@ -2535,7 +2552,6 @@ fi - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3522,6 +3538,7 @@ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then @@ -3551,9 +3568,7 @@ echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - -if + if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= @@ -4391,6 +4406,7 @@ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then @@ -4420,9 +4436,7 @@ echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - -if + if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= @@ -5645,7 +5659,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 5648 "configure"' > conftest.$ac_ext + echo '#line 5662 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -6471,6 +6485,7 @@ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then @@ -6500,9 +6515,7 @@ echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type - - -if + if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= @@ -7978,11 +7991,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7981: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7994: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7985: \$? = $ac_status" >&5 + echo "$as_me:7998: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -8268,11 +8281,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8271: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8284: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8275: \$? = $ac_status" >&5 + echo "$as_me:8288: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -8372,11 +8385,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8375: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8388: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8379: \$? = $ac_status" >&5 + echo "$as_me:8392: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -10734,7 +10747,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 10737 "configure" +#line 10750 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10834,7 +10847,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 10837 "configure" +#line 10850 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13254,11 +13267,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13257: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13270: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13261: \$? = $ac_status" >&5 + echo "$as_me:13274: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -13358,11 +13371,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13361: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13374: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13365: \$? = $ac_status" >&5 + echo "$as_me:13378: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14935,11 +14948,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14938: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14951: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14942: \$? = $ac_status" >&5 + echo "$as_me:14955: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -15039,11 +15052,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15042: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15055: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15046: \$? = $ac_status" >&5 + echo "$as_me:15059: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17239,11 +17252,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17242: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17255: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:17246: \$? = $ac_status" >&5 + echo "$as_me:17259: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -17529,11 +17542,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17532: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17545: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:17536: \$? = $ac_status" >&5 + echo "$as_me:17549: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -17633,11 +17646,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17636: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17649: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:17640: \$? = $ac_status" >&5 + echo "$as_me:17653: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -22141,9 +22154,7 @@ esac { echo "$as_me:$LINENO: result: $platform_win32" >&5 echo "${ECHO_T}$platform_win32" >&6; } - - -if test "$platform_win32" = "yes"; then + if test "$platform_win32" = "yes"; then PLATFORM_WIN32_TRUE= PLATFORM_WIN32_FALSE='#' else @@ -22658,6 +22669,7 @@ ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -22870,6 +22882,7 @@ INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim +am__isrc!$am__isrc$ac_delim CYGPATH_W!$CYGPATH_W$ac_delim PACKAGE!$PACKAGE$ac_delim VERSION!$VERSION$ac_delim @@ -22926,7 +22939,6 @@ RANLIB!$RANLIB$ac_delim CXX!$CXX$ac_delim CXXFLAGS!$CXXFLAGS$ac_delim -ac_ct_CXX!$ac_ct_CXX$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -22968,6 +22980,7 @@ ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +ac_ct_CXX!$ac_ct_CXX$ac_delim CXXDEPMODE!$CXXDEPMODE$ac_delim am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim @@ -23006,7 +23019,7 @@ LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 36; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 37; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 @@ -23233,6 +23246,11 @@ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -23286,6 +23304,7 @@ s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out @@ -23450,8 +23469,9 @@ # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ Modified: trunk/goocanv8/src/Makefile.in =================================================================== --- trunk/goocanv8/src/Makefile.in 2008-01-24 23:38:45 UTC (rev 23) +++ trunk/goocanv8/src/Makefile.in 2008-01-26 23:33:02 UTC (rev 24) @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,15 +15,11 @@ @SET_MAKE@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -58,17 +54,21 @@ goocanvastext.lo goocanvasutils.lo goocanvaswidget.lo \ goocanvas.lo libgoocanvas_la_OBJECTS = $(am_libgoocanvas_la_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +libgoocanvas_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libgoocanvas_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ SOURCES = $(libgoocanvas_la_SOURCES) DIST_SOURCES = $(libgoocanvas_la_SOURCES) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -84,8 +84,6 @@ CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ @@ -121,6 +119,7 @@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ +INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -135,9 +134,8 @@ LTLIBOBJS = @LTLIBOBJS@ LT_VERSION_INFO = @LT_VERSION_INFO@ MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ @@ -153,8 +151,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ -PLATFORM_WIN32_FALSE = @PLATFORM_WIN32_FALSE@ -PLATFORM_WIN32_TRUE = @PLATFORM_WIN32_TRUE@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ @@ -168,13 +164,13 @@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -186,6 +182,7 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ +builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ @@ -213,8 +210,11 @@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ INCLUDES = \ -DG_DISABLE_DEPRECATED -DPANGO_DISABLE_DEPRECATED \ -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED \ @@ -341,7 +341,7 @@ rm -f "$${dir}/so_locations"; \ done libgoocanvas.la: $(libgoocanvas_la_OBJECTS) $(libgoocanvas_la_DEPENDENCIES) - $(LINK) $(libgoocanvas_la_LDFLAGS) $(libgoocanvas_la_OBJECTS) $(libgoocanvas_la_LIBADD) $(LIBS) + $(libgoocanvas_la_LINK) $(libgoocanvas_la_OBJECTS) $(libgoocanvas_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -369,22 +369,22 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvaswidget.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< @@ -394,13 +394,9 @@ clean-libtool: -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: install-libgoocanvasincludeHEADERS: $(libgoocanvasinclude_HEADERS) @$(NORMAL_INSTALL) - test -z "$(libgoocanvasincludedir)" || $(mkdir_p) "$(DESTDIR)$(libgoocanvasincludedir)" + test -z "$(libgoocanvasincludedir)" || $(MKDIR_P) "$(DESTDIR)$(libgoocanvasincludedir)" @list='$(libgoocanvasinclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ @@ -465,22 +461,21 @@ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ @@ -497,7 +492,7 @@ all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libgoocanvasincludedir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am @@ -536,7 +531,7 @@ -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags + distclean-tags dvi: dvi-am @@ -550,12 +545,20 @@ install-data-am: install-libgoocanvasincludeHEADERS +install-dvi: install-dvi-am + install-exec-am: +install-html: install-html-am + install-info: install-info-am install-man: +install-pdf: install-pdf-am + +install-ps: install-ps-am + installcheck-am: maintainer-clean: maintainer-clean-am @@ -576,19 +579,23 @@ ps-am: -uninstall-am: uninstall-info-am uninstall-libgoocanvasincludeHEADERS +uninstall-am: uninstall-libgoocanvasincludeHEADERS +.MAKE: install-am install-strip + .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am \ - install-libgoocanvasincludeHEADERS install-man install-strip \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am \ + install-libgoocanvasincludeHEADERS install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-info-am \ + tags uninstall uninstall-am \ uninstall-libgoocanvasincludeHEADERS Modified: trunk/src/rotor-conf.c =================================================================== --- trunk/src/rotor-conf.c 2008-01-24 23:38:45 UTC (rev 23) +++ trunk/src/rotor-conf.c 2008-01-26 23:33:02 UTC (rev 24) @@ -40,6 +40,10 @@ #define KEY_TYPE "Type" #define KEY_PORT "Port" #define KEY_SPEED "Speed" +#define KEY_MINAZ "MinAz" +#define KEY_MAXAZ "MaxAz" +#define KEY_MINEL "MinEl" +#define KEY_MAXEL "MaxEl" /** \brief Read rotator configuration. @@ -87,6 +91,10 @@ conf->type = g_key_file_get_integer (cfg, GROUP, KEY_TYPE, NULL); conf->port = g_key_file_get_string (cfg, GROUP, KEY_PORT, NULL); conf->speed = g_key_file_get_integer (cfg, GROUP, KEY_SPEED, NULL); + conf->minaz = g_key_file_get_integer (cfg, GROUP, KEY_MINAZ, NULL); + conf->maxaz = g_key_file_get_integer (cfg, GROUP, KEY_MAXAZ, NULL); + conf->minel = g_key_file_get_integer (cfg, GROUP, KEY_MINEL, NULL); + conf->maxel = g_key_file_get_integer (cfg, GROUP, KEY_MAXEL, NULL); g_key_file_free (cfg); @@ -120,6 +128,10 @@ g_key_file_set_integer (cfg, GROUP, KEY_TYPE, conf->type); g_key_file_set_string (cfg, GROUP, KEY_PORT, conf->port); g_key_file_set_integer (cfg, GROUP, KEY_SPEED, conf->speed); + g_key_file_set_integer (cfg, GROUP, KEY_MINAZ, conf->minaz); + g_key_file_set_integer (cfg, GROUP, KEY_MAXAZ, conf->maxaz); + g_key_file_set_integer (cfg, GROUP, KEY_MINEL, conf->minel); + g_key_file_set_integer (cfg, GROUP, KEY_MAXEL, conf->maxel); /* convert to text sdata */ data = g_key_file_to_data (cfg, &len, NULL); Modified: trunk/src/rotor-conf.h =================================================================== --- trunk/src/rotor-conf.h 2008-01-24 23:38:45 UTC (rev 23) +++ trunk/src/rotor-conf.h 2008-01-26 23:33:02 UTC (rev 24) @@ -51,6 +51,10 @@ rotor_type_t type; /*!< Rotator type. */ gchar *port; /*!< Device name, e.g. /dev/ttyS0. */ guint speed; /*!< Serial speed. */ + gint minaz; /*!< Lower azimuth limit */ + gint maxaz; /*!< Upper azimuth limit */ + gint minel; /*!< Lower elevation limit */ + gint maxel; /*!< Upper elevation limit */ } rotor_conf_t; Modified: trunk/src/sat-pref-rot-data.h =================================================================== --- trunk/src/sat-pref-rot-data.h 2008-01-24 23:38:45 UTC (rev 23) +++ trunk/src/sat-pref-rot-data.h 2008-01-26 23:33:02 UTC (rev 24) @@ -36,6 +36,10 @@ ROT_LIST_COL_TYPE, /*!< Rtator type. */ ROT_LIST_COL_PORT, /*!< Port / Device, e.g. /dev/ttyS0. */ ROT_LIST_COL_SPEED, /*!< Serial speed. */ + ROT_LIST_COL_MINAZ, /*!< Lower azimuth limit. */ + ROT_LIST_COL_MAXAZ, /*!< Upper azimuth limit. */ + ROT_LIST_COL_MINEL, /*!< Lower elevation limit. */ + ROT_LIST_COL_MAXEL, /*!< Upper elevation limit. */ ROT_LIST_COL_NUM /*!< The number of fields in the list. */ } rotor_list_col_t; Modified: trunk/src/sat-pref-rot-editor.c =================================================================== --- trunk/src/sat-pref-rot-editor.c 2008-01-24 23:38:45 UTC (rev 23) +++ trunk/src/sat-pref-rot-editor.c 2008-01-26 23:33:02 UTC (rev 24) @@ -58,6 +58,10 @@ static GtkWidget *type; /* rotor type */ static GtkWidget *port; /* port selector */ static GtkWidget *speed; /* serial speed selector */ +static GtkWidget *minaz; +static GtkWidget *maxaz; +static GtkWidget *minel; +static GtkWidget *maxel; static GtkWidget *create_editor_widgets (rotor_conf_t *conf); @@ -75,6 +79,7 @@ GtkTreeIter *iter, gpointer data); static void select_rot (guint rotid); +static void rot_type_changed (GtkComboBox *box, gpointer data); /** \brief Add or edit a rotor configuration. @@ -208,6 +213,8 @@ gtk_combo_box_append_text (GTK_COMBO_BOX (type), _("EL")); gtk_combo_box_append_text (GTK_COMBO_BOX (type), _("AZ / EL")); gtk_combo_box_set_active (GTK_COMBO_BOX (type), 2); + g_signal_connect (G_OBJECT (type), "changed", + G_CALLBACK (rot_type_changed), NULL); gtk_widget_set_tooltip_text (type, _("Select rotor type.")); gtk_table_attach_defaults (GTK_TABLE (table), type, 1, 2, 2, 3); @@ -250,8 +257,48 @@ gtk_widget_set_tooltip_text (speed, _("Select serial port speed")); gtk_table_attach_defaults (GTK_TABLE (table), speed, 1, 2, 4, 5); + /* separator */ + gtk_table_attach (GTK_TABLE (table), gtk_vseparator_new(), 2, 3, 1, 5, + GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 5, 0); - if (conf->name != NULL) + /* Az and El limits */ + label = gtk_label_new (_(" Min Az")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_table_attach_defaults (GTK_TABLE (table), label, 3, 4, 1, 2); + minaz = gtk_spin_button_new_with_range (-40, 40, 1); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (minaz), 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (minaz), TRUE); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (minaz), FALSE); + gtk_table_attach_defaults (GTK_TABLE (table), minaz, 4, 5, 1, 2); + + label = gtk_label_new (_(" Max Az")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_table_attach_defaults (GTK_TABLE (table), label, 3, 4, 2, 3); + maxaz = gtk_spin_button_new_with_range (360, 450, 1); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (maxaz), 360); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (maxaz), TRUE); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (maxaz), FALSE); + gtk_table_attach_defaults (GTK_TABLE (table), maxaz, ... [truncated message content] |
From: <cs...@us...> - 2008-01-24 23:38:50
|
Revision: 23 http://gpredict.svn.sourceforge.net/gpredict/?rev=23&view=rev Author: csete Date: 2008-01-24 15:38:45 -0800 (Thu, 24 Jan 2008) Log Message: ----------- Added missing 4800 rate. Modified Paths: -------------- trunk/src/sat-pref-rig-editor.c trunk/src/sat-pref-rot-editor.c Modified: trunk/src/sat-pref-rig-editor.c =================================================================== --- trunk/src/sat-pref-rig-editor.c 2008-01-24 23:34:50 UTC (rev 22) +++ trunk/src/sat-pref-rig-editor.c 2008-01-24 23:38:45 UTC (rev 23) @@ -351,21 +351,24 @@ case 2400: gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 2); break; - case 9600: + case 4800: gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 3); break; - case 19200: + case 9600: gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 4); break; - case 38400: + case 19200: gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 5); break; - case 57600: + case 38400: gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 6); break; - case 115200: + case 57600: gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 7); break; + case 115200: + gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 8); + break; default: gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 4); break; Modified: trunk/src/sat-pref-rot-editor.c =================================================================== --- trunk/src/sat-pref-rot-editor.c 2008-01-24 23:34:50 UTC (rev 22) +++ trunk/src/sat-pref-rot-editor.c 2008-01-24 23:38:45 UTC (rev 23) @@ -290,21 +290,24 @@ case 2400: gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 2); break; - case 9600: + case 4800: gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 3); break; - case 19200: + case 9600: gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 4); break; - case 38400: + case 19200: gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 5); break; - case 57600: + case 38400: gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 6); break; - case 115200: + case 57600: gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 7); break; + case 115200: + gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 8); + break; default: gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 4); break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2008-01-24 23:34:50
|
Revision: 22 http://gpredict.svn.sourceforge.net/gpredict/?rev=22&view=rev Author: csete Date: 2008-01-24 15:34:50 -0800 (Thu, 24 Jan 2008) Log Message: ----------- Added rotator configuration code. Modified Paths: -------------- trunk/ChangeLog trunk/src/Makefile.am trunk/src/rotor-conf.c trunk/src/rotor-conf.h trunk/src/sat-pref-rig.c trunk/src/sat-pref-rig.h trunk/src/sat-pref-rot-data.h trunk/src/sat-pref-rot-editor.c trunk/src/sat-pref-rot.c trunk/src/sat-pref-rot.h Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-01-24 22:58:40 UTC (rev 21) +++ trunk/ChangeLog 2008-01-24 23:34:50 UTC (rev 22) @@ -3,6 +3,17 @@ * src/sat-pref-rig-editor.[ch]: Finished first draft of radio configuration editor. + * src/sat-pref-rig.c: + Finished radio configuration page. + + * src/rotor-conf.[ch]: + * src/sat-pref-rot-editor.[ch]: + * src/sat-pref-rot-data.h: + Added files with functions to read and save rotator configuration. + + * src/sat-pref-rot.c: + Updated to use new rotator configuration code. + 2008-01-12; Alexandru Csete <oz...@gm...> Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2008-01-24 22:58:40 UTC (rev 21) +++ trunk/src/Makefile.am 2008-01-24 23:34:50 UTC (rev 22) @@ -92,7 +92,7 @@ sat-pref-interfaces.c sat-pref-interfaces.h \ sat-pref-rig.c sat-pref-rig.h sat-pref-rig-data.h \ sat-pref-rig-editor.c sat-pref-rig-editor.h \ - sat-pref-rot.c sat-pref-rot.h \ + sat-pref-rot.c sat-pref-rot.h sat-pref-rot-data.h \ sat-pref-rot-editor.c sat-pref-rot-editor.h \ sat-pref-predict.c sat-pref-predict.h \ sat-pref-conditions.c sat-pref-conditions.h \ Modified: trunk/src/rotor-conf.c =================================================================== --- trunk/src/rotor-conf.c 2008-01-24 22:58:40 UTC (rev 21) +++ trunk/src/rotor-conf.c 2008-01-24 23:34:50 UTC (rev 22) @@ -101,7 +101,7 @@ * .rig file. conf->name must contain the file name of the configuration * (no path, just file name and without the .rot extension). */ -void rotor_conf_save (radio_conf_t *conf) +void rotor_conf_save (rotor_conf_t *conf) { GKeyFile *cfg = NULL; gchar *confdir; Modified: trunk/src/rotor-conf.h =================================================================== --- trunk/src/rotor-conf.h 2008-01-24 22:58:40 UTC (rev 21) +++ trunk/src/rotor-conf.h 2008-01-24 23:34:50 UTC (rev 22) @@ -55,6 +55,6 @@ gboolean rotor_conf_read (rotor_conf_t *conf); -void rotor_conf_save (rtor_conf_t *conf); +void rotor_conf_save (rotor_conf_t *conf); #endif Modified: trunk/src/sat-pref-rig.c =================================================================== --- trunk/src/sat-pref-rig.c 2008-01-24 22:58:40 UTC (rev 21) +++ trunk/src/sat-pref-rig.c 2008-01-24 23:34:50 UTC (rev 22) @@ -40,7 +40,7 @@ #include "sat-pref-rig-editor.h" #include "sat-pref-rig.h" - +#ifdef HAVE_HAMLIB extern GtkWidget *window; /* dialog window defined in sat-pref.c */ @@ -800,6 +800,4 @@ } - - - +#endif Modified: trunk/src/sat-pref-rig.h =================================================================== --- trunk/src/sat-pref-rig.h 2008-01-24 22:58:40 UTC (rev 21) +++ trunk/src/sat-pref-rig.h 2008-01-24 23:34:50 UTC (rev 22) @@ -28,10 +28,10 @@ #ifndef SAT_PREF_RIG_H #define SAT_PREF_RIG_H 1 - +#ifdef HAVE_HAMLIB GtkWidget *sat_pref_rig_create (void); void sat_pref_rig_cancel (void); void sat_pref_rig_ok (void); +#endif - #endif Modified: trunk/src/sat-pref-rot-data.h =================================================================== --- trunk/src/sat-pref-rot-data.h 2008-01-24 22:58:40 UTC (rev 21) +++ trunk/src/sat-pref-rot-data.h 2008-01-24 23:34:50 UTC (rev 22) @@ -30,13 +30,13 @@ /** \brief Coumn definitions for rotator list. */ typedef enum { - RIG_LIST_COL_NAME = 0, /*!< File name. */ - RIG_LIST_COL_MODEL, /*!< Model */ - RIG_LIST_COL_ID, /*!< Hamlib ID. */ - RIG_LIST_COL_TYPE, /*!< Rtator type. */ - RIG_LIST_COL_PORT, /*!< Port / Device, e.g. /dev/ttyS0. */ - RIG_LIST_COL_SPEED, /*!< Serial speed. */ - RIG_LIST_COL_NUM /*!< The number of fields in the list. */ + ROT_LIST_COL_NAME = 0, /*!< File name. */ + ROT_LIST_COL_MODEL, /*!< Model */ + ROT_LIST_COL_ID, /*!< Hamlib ID. */ + ROT_LIST_COL_TYPE, /*!< Rtator type. */ + ROT_LIST_COL_PORT, /*!< Port / Device, e.g. /dev/ttyS0. */ + ROT_LIST_COL_SPEED, /*!< Serial speed. */ + ROT_LIST_COL_NUM /*!< The number of fields in the list. */ } rotor_list_col_t; Modified: trunk/src/sat-pref-rot-editor.c =================================================================== --- trunk/src/sat-pref-rot-editor.c 2008-01-24 22:58:40 UTC (rev 21) +++ trunk/src/sat-pref-rot-editor.c 2008-01-24 23:34:50 UTC (rev 22) @@ -26,7 +26,7 @@ along with this program; if not, visit http://www.fsf.org/ */ -/** \brief Edit radio configuration. +/** \brief Edit rotator configuration. * */ @@ -40,11 +40,11 @@ #include "gpredict-utils.h" #include "sat-cfg.h" #include "sat-log.h" -#include "radio-conf.h" -#include "sat-pref-rig-editor.h" +#include "rotor-conf.h" +#include "sat-pref-rot-editor.h" #ifdef HAVE_HAMLIB -# include <hamlib/rig.h> +# include <hamlib/rotator.h> extern GtkWidget *window; /* dialog window defined in sat-pref.c */ @@ -54,45 +54,43 @@ /* private widgets */ static GtkWidget *dialog; /* dialog window */ static GtkWidget *name; /* Configuration name */ -static GtkWidget *model; /* radio model, e.g. TS-2000 */ -static GtkWidget *civ; /* Icom CI-V address */ -static GtkWidget *type; /* radio type */ +static GtkWidget *model; /* rotor model, e.g. TS-2000 */ +static GtkWidget *type; /* rotor type */ static GtkWidget *port; /* port selector */ static GtkWidget *speed; /* serial speed selector */ -static GtkWidget *dtr,*rts; /* DTR and RTS line states */ -static GtkWidget *create_editor_widgets (radio_conf_t *conf); -static void update_widgets (radio_conf_t *conf); +static GtkWidget *create_editor_widgets (rotor_conf_t *conf); +static void update_widgets (rotor_conf_t *conf); static void clear_widgets (void); -static gboolean apply_changes (radio_conf_t *conf); +static gboolean apply_changes (rotor_conf_t *conf); static void name_changed (GtkWidget *widget, gpointer data); -static GtkTreeModel *create_rig_model (void); -static gint rig_list_add (const struct rig_caps *, void *); -static gint rig_list_compare_mfg (gconstpointer, gconstpointer); -static gint rig_list_compare_mod (gconstpointer, gconstpointer); -static void is_rig_model (GtkCellLayout *cell_layout, +static GtkTreeModel *create_rot_model (void); +static gint rot_list_add (const struct rot_caps *, void *); +static gint rot_list_compare_mfg (gconstpointer, gconstpointer); +static gint rot_list_compare_mod (gconstpointer, gconstpointer); +static void is_rot_model (GtkCellLayout *cell_layout, GtkCellRenderer *cell, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data); -static void select_rig (guint rigid); +static void select_rot (guint rotid); -/** \brief Add or edit a radio configuration. - * \param conf Pointer to a radio configuration. +/** \brief Add or edit a rotor configuration. + * \param conf Pointer to a rotator configuration. * - * Of conf->name is not NULL the widgets will be populated with the data. + * If conf->name is not NULL the widgets will be populated with the data. */ void -sat_pref_rig_editor_run (radio_conf_t *conf) +sat_pref_rot_editor_run (rotor_conf_t *conf) { gint response; gboolean finished = FALSE; /* crate dialog and add contents */ - dialog = gtk_dialog_new_with_buttons (_("Edit radio configuration"), + dialog = gtk_dialog_new_with_buttons (_("Edit rotator configuration"), GTK_WINDOW (window), GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, @@ -149,14 +147,12 @@ /** \brief Create and initialise widgets */ static GtkWidget * -create_editor_widgets (radio_conf_t *conf) +create_editor_widgets (rotor_conf_t *conf) { GtkWidget *table; GtkWidget *label; - GtkTreeModel *riglist; + GtkTreeModel *rotlist; GtkCellRenderer *renderer; - gchar *buff; - guint i; table = gtk_table_new (5, 5, FALSE); @@ -172,7 +168,7 @@ name = gtk_entry_new (); gtk_entry_set_max_length (GTK_ENTRY (name), 25); gtk_widget_set_tooltip_text (name, - _("Enter a short name for this configuration, e.g. IC910-1.\n"\ + _("Enter a short name for this configuration, e.g. ROTOR-1.\n"\ "Allowed charachters: 0..9, a..z, A..Z, - and _")); gtk_table_attach_defaults (GTK_TABLE (table), name, 1, 4, 0, 1); @@ -186,9 +182,9 @@ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 1, 2); - riglist = create_rig_model (); - model = gtk_combo_box_new_with_model (riglist); - g_object_unref (riglist); + rotlist = create_rot_model (); + model = gtk_combo_box_new_with_model (rotlist); + g_object_unref (rotlist); gtk_table_attach_defaults (GTK_TABLE (table), model, 1, 2, 1, 2); renderer = gtk_cell_renderer_text_new (); @@ -198,46 +194,22 @@ NULL); gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (model), renderer, - is_rig_model, + is_rot_model, NULL, NULL); - gtk_widget_set_tooltip_text (model, _("Click to select a radio.")); - select_rig (1); + gtk_widget_set_tooltip_text (model, _("Click to select a driver.")); + select_rot (1); - /* ICOM CI-V adress */ - label = gtk_label_new (_("ICOM CI-V")); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, 3, 4, 1, 2); - - civ = gtk_combo_box_new_text (); - gtk_widget_set_tooltip_text (civ, - _("Select ICOM CI-V address of the radio.")); - - /* works, but pretty lame... */ - gtk_combo_box_append_text (GTK_COMBO_BOX (civ), _("Default")); - for (i = 1; i < 0xF0; i++) { - if (i < 0x10) - buff = g_strdup_printf ("0x0%X", i); - else - buff = g_strdup_printf ("0x%X", i); - gtk_combo_box_append_text (GTK_COMBO_BOX (civ), buff); - g_free (buff); - } - gtk_combo_box_set_active (GTK_COMBO_BOX (civ), 0); - gtk_table_attach_defaults (GTK_TABLE (table), civ, 4, 5, 1, 2); - - /* Type */ label = gtk_label_new (_("Type")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 2, 3); type = gtk_combo_box_new_text (); - gtk_combo_box_append_text (GTK_COMBO_BOX (type), _("Receiver")); - gtk_combo_box_append_text (GTK_COMBO_BOX (type), _("Transmitter")); - gtk_combo_box_append_text (GTK_COMBO_BOX (type), _("RX + TX")); - gtk_combo_box_append_text (GTK_COMBO_BOX (type), _("Full Duplex")); - gtk_combo_box_set_active (GTK_COMBO_BOX (type), 0); + gtk_combo_box_append_text (GTK_COMBO_BOX (type), _("AZ")); + gtk_combo_box_append_text (GTK_COMBO_BOX (type), _("EL")); + gtk_combo_box_append_text (GTK_COMBO_BOX (type), _("AZ / EL")); + gtk_combo_box_set_active (GTK_COMBO_BOX (type), 2); gtk_widget_set_tooltip_text (type, - _("Select radio type. Consult the user manual, if unsure")); + _("Select rotor type.")); gtk_table_attach_defaults (GTK_TABLE (table), type, 1, 2, 2, 3); /* Port */ @@ -259,21 +231,6 @@ gtk_widget_set_tooltip_text (port, _("Select or enter communication port")); gtk_table_attach_defaults (GTK_TABLE (table), port, 1, 2, 3, 4); - /* DTR State */ - label = gtk_label_new (_("DTR Line")); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, 3, 4, 3, 4); - - dtr = gtk_combo_box_new_text (); - gtk_combo_box_append_text (GTK_COMBO_BOX (dtr), _("Undefined")); - gtk_combo_box_append_text (GTK_COMBO_BOX (dtr), _("OFF")); - gtk_combo_box_append_text (GTK_COMBO_BOX (dtr), _("ON")); - gtk_combo_box_append_text (GTK_COMBO_BOX (dtr), _("PTT")); - gtk_combo_box_append_text (GTK_COMBO_BOX (dtr), _("CW")); - gtk_combo_box_set_active (GTK_COMBO_BOX (dtr), 0); - gtk_widget_set_tooltip_text (dtr, _("Select status and use of DTR line")); - gtk_table_attach_defaults (GTK_TABLE (table), dtr, 4, 5, 3, 4); - /* Speed */ label = gtk_label_new (_("Rate")); @@ -293,25 +250,7 @@ gtk_widget_set_tooltip_text (speed, _("Select serial port speed")); gtk_table_attach_defaults (GTK_TABLE (table), speed, 1, 2, 4, 5); - /* RTS State */ - label = gtk_label_new (_("RTS Line")); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, 3, 4, 4, 5); - - rts = gtk_combo_box_new_text (); - gtk_combo_box_append_text (GTK_COMBO_BOX (rts), _("Undefined")); - gtk_combo_box_append_text (GTK_COMBO_BOX (rts), _("OFF")); - gtk_combo_box_append_text (GTK_COMBO_BOX (rts), _("ON")); - gtk_combo_box_append_text (GTK_COMBO_BOX (rts), _("PTT")); - gtk_combo_box_append_text (GTK_COMBO_BOX (rts), _("CW")); - gtk_combo_box_set_active (GTK_COMBO_BOX (rts), 0); - gtk_widget_set_tooltip_text (rts, _("Select status and use of RTS line")); - gtk_table_attach_defaults (GTK_TABLE (table), rts, 4, 5, 4, 5); - /* separator between port/speed and DTR/RTS */ - gtk_table_attach (GTK_TABLE (table), gtk_vseparator_new(), 2, 3, 1, 5, - GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 5, 0); - if (conf->name != NULL) update_widgets (conf); @@ -324,17 +263,17 @@ /** \brief Update widgets from the currently selected row in the treeview */ static void -update_widgets (radio_conf_t *conf) +update_widgets (rotor_conf_t *conf) { /* configuration name */ gtk_entry_set_text (GTK_ENTRY (name), conf->name); /* model */ - select_rig (conf->id); + select_rot (conf->id); /* type */ - gtk_combo_box_set_active (GTK_COMBO_BOX (type), conf->type); + gtk_combo_box_set_active (GTK_COMBO_BOX (type), conf->type-1); /* port */ gtk_combo_box_prepend_text (GTK_COMBO_BOX (port), conf->port); @@ -371,12 +310,6 @@ break; } - /* CI-V */ - gtk_combo_box_set_active (GTK_COMBO_BOX (civ), conf->civ); - - /* DTR and RTS lines */ - gtk_combo_box_set_active (GTK_COMBO_BOX (dtr), conf->dtr); - gtk_combo_box_set_active (GTK_COMBO_BOX (rts), conf->rts); } @@ -390,13 +323,10 @@ clear_widgets () { gtk_entry_set_text (GTK_ENTRY (name), ""); - select_rig (1); - gtk_combo_box_set_active (GTK_COMBO_BOX (type), 0); + select_rot (1); + gtk_combo_box_set_active (GTK_COMBO_BOX (type), 2); gtk_combo_box_set_active (GTK_COMBO_BOX (port), 0); gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 4); - gtk_combo_box_set_active (GTK_COMBO_BOX (civ), 0); - gtk_combo_box_set_active (GTK_COMBO_BOX (dtr), 0); - gtk_combo_box_set_active (GTK_COMBO_BOX (rts), 0); } @@ -406,10 +336,10 @@ * This function is usually called when the user clicks the OK button. */ static gboolean -apply_changes (radio_conf_t *conf) +apply_changes (rotor_conf_t *conf) { GtkTreeIter iter1,iter2; - GtkTreeModel *riglist; + GtkTreeModel *rotlist; gchar *b1,*b2; guint id; @@ -426,22 +356,22 @@ /* iter1 is needed to construct full model name */ gtk_combo_box_get_active_iter (GTK_COMBO_BOX (model), &iter2); - riglist = gtk_combo_box_get_model (GTK_COMBO_BOX (model)); - gtk_tree_model_iter_parent (riglist, &iter1, &iter2); + rotlist = gtk_combo_box_get_model (GTK_COMBO_BOX (model)); + gtk_tree_model_iter_parent (rotlist, &iter1, &iter2); /* build model string */ - gtk_tree_model_get (riglist, &iter1, 0, &b1, -1); - gtk_tree_model_get (riglist, &iter2, 0, &b2, -1); + gtk_tree_model_get (rotlist, &iter1, 0, &b1, -1); + gtk_tree_model_get (rotlist, &iter2, 0, &b2, -1); conf->model = g_strconcat (b1, " ", b2, NULL); g_free (b1); g_free (b2); /* ID */ - gtk_tree_model_get (riglist, &iter2, 1, &id, -1); + gtk_tree_model_get (rotlist, &iter2, 1, &id, -1); conf->id = id; - /* radio type */ - conf->type = gtk_combo_box_get_active (GTK_COMBO_BOX (type)); + /* rotor type */ + conf->type = gtk_combo_box_get_active (GTK_COMBO_BOX (type))+1; /* port / device */ if (conf->port) @@ -449,8 +379,6 @@ conf->port = gtk_combo_box_get_active_text (GTK_COMBO_BOX (port)); - /* CI-V */ - conf->civ = gtk_combo_box_get_active (GTK_COMBO_BOX (civ)); /* serial speed */ switch (gtk_combo_box_get_active (GTK_COMBO_BOX (speed))) { @@ -486,9 +414,6 @@ break; } - /* DTR and RTS */ - conf->dtr = gtk_combo_box_get_active (GTK_COMBO_BOX (dtr)); - conf->rts = gtk_combo_box_get_active (GTK_COMBO_BOX (rts)); return TRUE; } @@ -553,23 +478,23 @@ } -/** \brief Radio info to be used when building the rig model */ +/** \brief Rotor info to be used when building the rot model */ typedef struct { gint id; /*!< Model ID. */ gchar *mfg; /*!< Manufacurer name (eg. KENWOOD). */ - gchar *model; /*!< Radio model (eg. TS-440). */ -} rig_info_t; + gchar *model; /*!< rotor model (eg. TS-440). */ +} rot_info_t; -/** \brief Build tree model containing radios. - * \return A tree model where the radios are ordered according to +/** \brief Build tree model containing rotators. + * \return A tree model where the rotator are ordered according to * manufacturer. * */ -static GtkTreeModel *create_rig_model () +static GtkTreeModel *create_rot_model () { GArray *array; - rig_info_t *info; + rot_info_t *info; GtkTreeIter iter1; /* iter used for manufacturer */ GtkTreeIter iter2; /* iter used for model */ GtkTreeStore *store; @@ -578,19 +503,19 @@ gint i; - /* create araay containing rigs */ - array = g_array_new (FALSE, FALSE, sizeof (rig_info_t)); - rig_load_all_backends(); + /* create araay containing rots */ + array = g_array_new (FALSE, FALSE, sizeof (rot_info_t)); + rot_load_all_backends(); - /* fill list using rig_list_foreach */ - status = rig_list_foreach (rig_list_add, (void *) array); + /* fill list using rot_list_foreach */ + status = rot_list_foreach (rot_list_add, (void *) array); /* sort the array, first by model then by mfg */ - g_array_sort (array, rig_list_compare_mod); - g_array_sort (array, rig_list_compare_mfg); + g_array_sort (array, rot_list_compare_mod); + g_array_sort (array, rot_list_compare_mfg); sat_log_log (SAT_LOG_LEVEL_DEBUG, - _("%s:%d: Read %d distinct radios into array."), + _("%s:%d: Read %d distinct rotators into array."), __FILE__, __LINE__, array->len); /* create a tree store with two cols (name and ID) */ @@ -599,8 +524,8 @@ /* add array contents to treestore */ for (i = 0; i < array->len; i++) { - /* get rig info struct */ - info = &g_array_index (array, rig_info_t, i); + /* get rotor info struct */ + info = &g_array_index (array, rot_info_t, i); if (gtk_tree_store_iter_is_valid (store, &iter1)) { /* iter1 is valid, i.e. we already have a manufacturer */ @@ -620,7 +545,7 @@ gtk_tree_store_set (store, &iter1, 0, info->mfg, -1); } - /* iter1 points to the parent mfg; insert this rig */ + /* iter1 points to the parent mfg; insert this rot */ gtk_tree_store_append (store, &iter2, &iter1); gtk_tree_store_set (store, &iter2, 0, info->model, @@ -638,29 +563,28 @@ } -/** \brief Add new entry to list of radios. - * \param caps Structure with the capablities of thecurrent radio. +/** \brief Add new entry to list of rotators. + * \param caps Structure with the capablities of the current rotator. * \param array Pointer to the GArray into which the new entry should be * stored. - * \return Always 1 to keep rig_list_foreach running. + * \return Always 1 to keep rot_list_foreach running. * - * This function is called by the rig_list_foreach hamlib function for each - * supported radio. It copies the relevant data into a grig_rig_info_t + * This function is called by the rot_list_foreach hamlib function for each + * supported rotator. It copies the relevant data into a rot_info_t * structure and adds the new entry to the GArray containing the list of - * supported radios. + * supported rotators. * - * \sa rig_list_compare */ static gint -rig_list_add (const struct rig_caps *caps, void *array) +rot_list_add (const struct rot_caps *caps, void *array) { - rig_info_t *info; + rot_info_t *info; /* create new entry */ - info = g_malloc (sizeof (rig_info_t)); + info = g_malloc (sizeof (rot_info_t)); /* fill values */ - info->id = caps->rig_model; + info->id = caps->rot_model; info->mfg = g_strdup (caps->mfg_name); info->model = g_strdup (caps->model_name); @@ -673,23 +597,22 @@ -/** \brief Compare two rig info entries. +/** \brief Compare two rot info entries. * \param a Pointer to the first entry. * \param b Pointer to the second entry. * \return Negative value if a < b; zero if a = b; positive value if a > b. * - * This function is used to compare two rig entries in the list of radios - * when the list is sorted. It compares the manufacturer of the two radios. + * This function is used to compare two rot entries in the list of rotators + * when the list is sorted. It compares the manufacturer of the two rotators. * - * \sa rig_list_add */ static gint -rig_list_compare_mfg (gconstpointer a, gconstpointer b) +rot_list_compare_mfg (gconstpointer a, gconstpointer b) { gchar *ida, *idb; - ida = ((rig_info_t *) a)->mfg; - idb = ((rig_info_t *) b)->mfg; + ida = ((rot_info_t *) a)->mfg; + idb = ((rot_info_t *) b)->mfg; if (g_ascii_strcasecmp(ida,idb) < 0) { return -1; @@ -705,23 +628,22 @@ -/** \brief Compare two rig info entries. +/** \brief Compare two rot info entries. * \param a Pointer to the first entry. * \param b Pointer to the second entry. * \return Negative value if a < b; zero if a = b; positive value if a > b. * - * This function is used to compare two rig entries in the list of radios - * when the list is sorted. It compares the model of the two radios. + * This function is used to compare two rot entries in the list of rotators + * when the list is sorted. It compares the model of the two rotators * - * \sa rig_list_add */ static gint -rig_list_compare_mod (gconstpointer a, gconstpointer b) +rot_list_compare_mod (gconstpointer a, gconstpointer b) { gchar *ida, *idb; - ida = ((rig_info_t *) a)->model; - idb = ((rig_info_t *) b)->model; + ida = ((rot_info_t *) a)->model; + idb = ((rot_info_t *) b)->model; if (g_ascii_strcasecmp(ida,idb) < 0) { return -1; @@ -738,12 +660,12 @@ /** \brief Set cell sensitivity. * - * This function is used to disable the sensitive of manifacturer entries + * This function is used to disable the sensitivity of manufacturer entries * as children. Otherwise, the manufacturer would appear as the first entry * in a submenu. * */ static void -is_rig_model (GtkCellLayout *cell_layout, +is_rot_model (GtkCellLayout *cell_layout, GtkCellRenderer *cell, GtkTreeModel *tree_model, GtkTreeIter *iter, @@ -757,44 +679,44 @@ } -/** \brief Select a radio in the combo box. - * \param rigid The hamlib id of the radio. +/** \brief Select a rotator in the combo box. + * \param rotid The hamlib id of the rotator. * - * This function selects the specified radio in the combobox. This is done + * This function selects the specified rotator in the combobox. This is done * by looping over all items in the tree model until a match is reached * (or there are no more items left). */ static void -select_rig (guint rigid) +select_rot (guint rotid) { GtkTreeIter iter1,iter2; - GtkTreeModel *riglist; + GtkTreeModel *rotlist; guint i,j,n,m; - guint thisrig = 0; + guint thisrot = 0; /* get the tree model */ - riglist = gtk_combo_box_get_model (GTK_COMBO_BOX (model)); + rotlist = gtk_combo_box_get_model (GTK_COMBO_BOX (model)); /* get the number of toplevel nodes */ - n = gtk_tree_model_iter_n_children (riglist, NULL); + n = gtk_tree_model_iter_n_children (rotlist, NULL); for (i = 0; i < n; i++) { /* get the i'th toplevel node */ - if (gtk_tree_model_iter_nth_child (riglist, &iter1, NULL, i)) { + if (gtk_tree_model_iter_nth_child (rotlist, &iter1, NULL, i)) { /* get the number of children */ - m = gtk_tree_model_iter_n_children (riglist, &iter1); + m = gtk_tree_model_iter_n_children (rotlist, &iter1); for (j = 0; j < m; j++) { /* get the j'th child */ - if (gtk_tree_model_iter_nth_child (riglist, &iter2, &iter1, j)) { + if (gtk_tree_model_iter_nth_child (rotlist, &iter2, &iter1, j)) { /* get ID of this model */ - gtk_tree_model_get (riglist, &iter2, 1, &thisrig, -1); + gtk_tree_model_get (rotlist, &iter2, 1, &thisrot, -1); - if (thisrig == rigid) { - /* select this rig and terminate loop */ + if (thisrot == rotid) { + /* select this rot and terminate loop */ gtk_combo_box_set_active_iter (GTK_COMBO_BOX (model), &iter2); j = m; i = n; Modified: trunk/src/sat-pref-rot.c =================================================================== --- trunk/src/sat-pref-rot.c 2008-01-24 22:58:40 UTC (rev 21) +++ trunk/src/sat-pref-rot.c 2008-01-24 23:34:50 UTC (rev 22) @@ -27,38 +27,589 @@ */ #include <gtk/gtk.h> #include <glib/gi18n.h> +#include <glib/gstdio.h> #ifdef HAVE_CONFIG_H # include <build-config.h> #endif +#include "gpredict-utils.h" #include "sat-cfg.h" +#include "sat-log.h" +#include "compat.h" +#include "rotor-conf.h" +#include "sat-pref-rot-data.h" +#include "sat-pref-rot-editor.h" #include "sat-pref-rot.h" -/** \brief Create and initialise widgets for the rotators tab. +#ifdef HAVE_HAMLIB + +extern GtkWidget *window; /* dialog window defined in sat-pref.c */ + + +/* private function declarations */ +static void create_rot_list (void); +static GtkTreeModel *create_and_fill_model (void); +static GtkWidget *create_buttons (void); + +static void add_cb (GtkWidget *button, gpointer data); +static void edit_cb (GtkWidget *button, gpointer data); +static void delete_cb (GtkWidget *button, gpointer data); + +static void render_rot_type (GtkTreeViewColumn *col, + GtkCellRenderer *renderer, + GtkTreeModel *model, + GtkTreeIter *iter, + gpointer column); + +/* global objects */ +static GtkWidget *addbutton; +static GtkWidget *editbutton; +static GtkWidget *delbutton; +static GtkWidget *rotlist; + + +/** \brief Create and initialise widgets for the radios tab. */ +GtkWidget *sat_pref_rot_create () +{ + GtkWidget *vbox; /* vbox containing the list part and the details part */ + GtkWidget *swin; + + + vbox = gtk_vbox_new (FALSE, 10); + gtk_container_set_border_width (GTK_CONTAINER (vbox), 10); + + /* create rot list and pack into scrolled window */ + create_rot_list (); + swin = gtk_scrolled_window_new (NULL, NULL); + gtk_container_add (GTK_CONTAINER (swin), rotlist); + + gtk_box_pack_start (GTK_BOX (vbox), swin, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (vbox), create_buttons (), FALSE, FALSE, 0); + + return vbox; +} + + +/** \brief Create Radio configuration list widget. * - * The widgets must be preloaded with values from config. If config - * is NULL, sensible default values, eg. those from defaults.h should - * be laoded. */ -GtkWidget *sat_pref_rot_create () +static void create_rot_list () { - return gtk_label_new ("Rotators"); + GtkTreeModel *model; + GtkCellRenderer *renderer; + GtkTreeViewColumn *column; + + + rotlist = gtk_tree_view_new (); + + model = create_and_fill_model (); + gtk_tree_view_set_model (GTK_TREE_VIEW (rotlist), model); + g_object_unref (model); + + /* Conf name */ + renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes (_("Config Name"), renderer, + "text", ROT_LIST_COL_NAME, + NULL); + gtk_tree_view_insert_column (GTK_TREE_VIEW (rotlist), column, -1); + + /* Model */ + renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes (_("Model"), renderer, + "text", ROT_LIST_COL_MODEL, + NULL); + gtk_tree_view_insert_column (GTK_TREE_VIEW (rotlist), column, -1); + + /* Type */ + renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes (_("Type"), renderer, + "text", ROT_LIST_COL_TYPE, + NULL); + gtk_tree_view_column_set_cell_data_func (column, renderer, + render_rot_type, + GUINT_TO_POINTER(ROT_LIST_COL_TYPE), + NULL); + gtk_tree_view_insert_column (GTK_TREE_VIEW (rotlist), column, -1); + + /* Port */ + renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes (_("Port"), renderer, + "text", ROT_LIST_COL_PORT, + NULL); + gtk_tree_view_insert_column (GTK_TREE_VIEW (rotlist), column, -1); + + /* Speed */ + renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes (_("Speed"), renderer, + "text", ROT_LIST_COL_SPEED, + NULL); + gtk_tree_view_insert_column (GTK_TREE_VIEW (rotlist), column, -1); + } +/** \brief Create data storage for rotator configuration list. */ +static GtkTreeModel *create_and_fill_model () +{ + GtkListStore *liststore; /* the list store data structure */ + GtkTreeIter item; /* new item added to the list store */ + GDir *dir = NULL; /* directory handle */ + GError *error = NULL; /* error flag and info */ + gchar *cfgdir; + gchar *dirname; /* directory name */ + gchar **vbuff; + const gchar *filename; /* file name */ + rotor_conf_t conf; + + /* create a new list store */ + liststore = gtk_list_store_new (ROT_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 + ); + + /* open configuration directory */ + cfgdir = get_conf_dir (); + dirname = g_strconcat (cfgdir, G_DIR_SEPARATOR_S, + "hwconf", NULL); + g_free (cfgdir); + + dir = g_dir_open (dirname, 0, &error); + if (dir) { + /* read each .rot file */ + while ((filename = g_dir_read_name (dir))) { + + if (g_strrstr (filename, ".rot")) { + + vbuff = g_strsplit (filename, ".rot", 0); + conf.name = g_strdup (vbuff[0]); + g_strfreev (vbuff); + if (rotor_conf_read (&conf)) { + /* insert conf into liststore */ + gtk_list_store_append (liststore, &item); + gtk_list_store_set (liststore, &item, + ROT_LIST_COL_NAME, conf.name, + ROT_LIST_COL_MODEL, conf.model, + ROT_LIST_COL_ID, conf.id, + ROT_LIST_COL_TYPE, conf.type, + ROT_LIST_COL_PORT, conf.port, + ROT_LIST_COL_SPEED, conf.speed, + -1); + + sat_log_log (SAT_LOG_LEVEL_DEBUG, + _("%s:%d: Read %s"), + __FILE__, __LINE__, filename); + /* clean up memory */ + if (conf.name) + g_free (conf.name); + + if (conf.model) + g_free (conf.model); + + if (conf.port) + g_free (conf.port); + } + else { + /* there was an error */ + sat_log_log (SAT_LOG_LEVEL_ERROR, + _("%s:%d: Failed to read %s"), + __FILE__, __LINE__, conf.name); + + g_free (conf.name); + } + } + } + } + else { + sat_log_log (SAT_LOG_LEVEL_ERROR, + _("%s:%d: Failed to open hwconf dir (%s)"), + __FILE__, __LINE__, error->message); + g_clear_error (&error); + } + + g_free (dirname); + g_dir_close (dir); + + return GTK_TREE_MODEL (liststore); +} + + +/** \brief Create buttons. + * \return A button box containing the buttons. + * + * This function creates and initialises the three buttons below the rot list. + * The treeview widget is needed by the buttons when they are activated. + * + */ +static GtkWidget *create_buttons (void) +{ + GtkWidget *box; + + /* add button */ + addbutton = gpredict_hstock_button (GTK_STOCK_ADD, + _("Add New"), + _("Add a new rotator to the list")); + g_signal_connect (addbutton, "clicked", G_CALLBACK (add_cb), NULL); + + /* edit button */ + editbutton = gpredict_hstock_button (GTK_STOCK_EDIT, + _("Edit"), + _("Edit the currently selected rotator")); + g_signal_connect (editbutton, "clicked", G_CALLBACK (edit_cb), NULL); + + /* delete button; don't forget to delete file.... */ + delbutton = gpredict_hstock_button (GTK_STOCK_DELETE, + _("Delete"), + _("Delete the selected rotator")); + g_signal_connect (delbutton, "clicked", G_CALLBACK (delete_cb), NULL); + + /* vertical button box */ + box = gtk_hbutton_box_new (); + gtk_button_box_set_layout (GTK_BUTTON_BOX (box), GTK_BUTTONBOX_START); + + gtk_container_add (GTK_CONTAINER (box), addbutton); + gtk_container_add (GTK_CONTAINER (box), editbutton); + gtk_container_add (GTK_CONTAINER (box), delbutton); + + + return box; +} + + + /** \brief User pressed cancel. Any changes to config must be cancelled. */ -void -sat_pref_rot_cancel () +void sat_pref_rot_cancel () { } /** \brief User pressed OK. Any changes should be stored in config. + * + * First, all .rot files are deleted, whereafter the rotator configurations in + * the rotlist are saved one by one. */ -void -sat_pref_rot_ok () +void sat_pref_rot_ok () { + GDir *dir = NULL; /* directory handle */ + GError *error = NULL; /* error flag and info */ + gchar *buff,*dirname; + const gchar *filename; + GtkTreeIter iter; /* new item added to the list store */ + GtkTreeModel *model; + guint i,n; + + rotor_conf_t conf = { + .name = NULL, + .model = NULL, + .id = 0, + .type = ROTOR_TYPE_AZEL, + .port = NULL, + .speed = 0, + }; + + + /* delete all .rot files */ + buff = get_conf_dir (); + dirname = g_strconcat (buff, G_DIR_SEPARATOR_S, + "hwconf", NULL); + g_free (buff); + + dir = g_dir_open (dirname, 0, &error); + if (dir) { + /* read each .rot file */ + while ((filename = g_dir_read_name (dir))) { + + if (g_strrstr (filename, ".rot")) { + + buff = g_strconcat (dirname, G_DIR_SEPARATOR_S, filename, NULL); + g_remove (buff); + g_free (buff); + } + } + } + + g_free (dirname); + g_dir_close (dir); + + /* create new .rot files for the radios in the rotlist */ + model = gtk_tree_view_get_model (GTK_TREE_VIEW (rotlist)); + n = gtk_tree_model_iter_n_children (model, NULL); + for (i = 0; i < n; i++) { + + /* get radio conf */ + if (gtk_tree_model_iter_nth_child (model, &iter, NULL, i)) { + + /* store conf */ + gtk_tree_model_get (model, &iter, + ROT_LIST_COL_NAME, &conf.name, + ROT_LIST_COL_MODEL, &conf.model, + ROT_LIST_COL_ID, &conf.id, + ROT_LIST_COL_TYPE, &conf.type, + ROT_LIST_COL_PORT, &conf.port, + ROT_LIST_COL_SPEED, &conf.speed, + -1); + rotor_conf_save (&conf); + + /* free conf buffer */ + if (conf.name) + g_free (conf.name); + + if (conf.model) + g_free (conf.model); + + if (conf.port) + g_free (conf.port); + } + else { + sat_log_log (SAT_LOG_LEVEL_ERROR, + _("%s: Failed to get ROT %s"), + __FUNCTION__, i); + } + } + } +/** \brief Add a new rotor configuration + * \param button Pointer to the Add button. + * \param data User data (null). + * + * This function executes the rotor configuration editor. + */ +static void add_cb (GtkWidget *button, gpointer data) +{ + GtkTreeIter item; /* new item added to the list store */ + GtkListStore *liststore; + + rotor_conf_t conf = { + .name = NULL, + .model = NULL, + .id = 0, + .type = ROTOR_TYPE_AZEL, + .port = NULL, + .speed = 0, + }; + + /* run rot conf editor */ + sat_pref_rot_editor_run (&conf); + + /* add new rot to the list */ + if (conf.name != NULL) { + liststore = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (rotlist))); + gtk_list_store_append (liststore, &item); + gtk_list_store_set (liststore, &item, + ROT_LIST_COL_NAME, conf.name, + ROT_LIST_COL_MODEL, conf.model, + ROT_LIST_COL_ID, conf.id, + ROT_LIST_COL_TYPE, conf.type, + ROT_LIST_COL_PORT, conf.port, + ROT_LIST_COL_SPEED, conf.speed, + -1); + + g_free (conf.name); + + if (conf.model != NULL) + g_free (conf.model); + + if (conf.port != NULL) + g_free (conf.port); + } +} + + +/** \brief Add a new rotor configuration + * \param button Pointer to the Add button. + * \param data User data (null). + * + * This function executes the rotor configuration editor. + * + */ +static void edit_cb (GtkWidget *button, gpointer data) +{ + GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW(rotlist)); + GtkTreeModel *selmod; + GtkTreeSelection *selection; + GtkTreeIter iter; + + rotor_conf_t conf = { + .name = NULL, + .model = NULL, + .id = 0, + .type = ROTOR_TYPE_AZEL, + .port = NULL, + .speed = 0, + }; + + + /* If there are no entries, we have a bug since the button should + have been disabled. */ + if (gtk_tree_model_iter_n_children (model, NULL) < 1) { + + sat_log_log (SAT_LOG_LEVEL_BUG, + _("%s:%s: Edit button should have been disabled."), + __FILE__, __FUNCTION__); + //gtk_widget_set_sensitive (button, FALSE); + + return; + } + + /* get selected row + FIXME: do we really need to work with two models? + */ + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (rotlist)); + if (gtk_tree_selection_get_selected(selection, &selmod, &iter)) { + gtk_tree_model_get (model, &iter, + ROT_LIST_COL_NAME, &conf.name, + ROT_LIST_COL_MODEL, &conf.model, + ROT_LIST_COL_ID, &conf.id, + ROT_LIST_COL_TYPE, &conf.type, + ROT_LIST_COL_PORT, &conf.port, + ROT_LIST_COL_SPEED, &conf.speed, + -1); + + } + else { + GtkWidget *dialog; + dialog = gtk_message_dialog_new (GTK_WINDOW (window), + GTK_DIALOG_MODAL | + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + _("Select the rotator you want to edit\n"\ + "and try again!")); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + + return; + } + + /* run radio configuration editor */ + sat_pref_rot_editor_run (&conf); + + /* apply changes */ + if (conf.name != NULL) { + gtk_list_store_set (GTK_LIST_STORE(model), &iter, + ROT_LIST_COL_NAME, conf.name, + ROT_LIST_COL_MODEL, conf.model, + ROT_LIST_COL_ID, conf.id, + ROT_LIST_COL_TYPE, conf.type, + ROT_LIST_COL_PORT, conf.port, + ROT_LIST_COL_SPEED, conf.speed, + -1); + + } + + /* clean up memory */ + if (conf.name) + g_free (conf.name); + + if (conf.model != NULL) + g_free (conf.model); + + if (conf.port != NULL) + g_free (conf.port); + +} + + +/** \brief Delete selected rotator configuration + * + * This function is called when the user clicks the Delete button. + * + */ +static void delete_cb (GtkWidget *button, gpointer data) +{ + GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW(rotlist)); + GtkTreeSelection *selection; + GtkTreeIter iter; + + + /* If there are no entries, we have a bug since the button should + have been disabled. */ + if (gtk_tree_model_iter_n_children (model, NULL) < 1) { + + sat_log_log (SAT_LOG_LEVEL_BUG, + _("%s:%s: Delete button should have been disabled."), + __FILE__, __FUNCTION__); + //gtk_widget_set_sensitive (button, FALSE); + + return; + } + + /* get selected row */ + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (rotlist)); + if (gtk_tree_selection_get_selected(selection, NULL, &iter)) { + gtk_list_store_remove (GTK_LIST_STORE(model), &iter); + } + else { + GtkWidget *dialog; + dialog = gtk_message_dialog_new (GTK_WINDOW (window), + GTK_DIALOG_MODAL | + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + _("Select the rotator you want to delete\n"\ + "and try again!")); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + + } +} + + + + + +/** \brief Render rotator 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 rotator type onto the rotator list. + * The rotator type is stored as enum; however, we want to display it + * using some escriptive text, e.g. "AZ", "EL", and so on + */ +static void render_rot_type (GtkTreeViewColumn *col, + GtkCellRenderer *renderer, + GtkTreeModel *model, + GtkTreeIter *iter, + gpointer column) +{ + guint number; + guint coli = GPOINTER_TO_UINT (column); + + gtk_tree_model_get (model, iter, coli, &number, -1); + + switch (number) { + + case ROTOR_TYPE_AZ: + g_object_set (renderer, "text", "AZ", NULL); + break; + + case ROTOR_TYPE_EL: + g_object_set (renderer, "text", "EL", NULL); + break; + + case ROTOR_TYPE_AZEL: + g_object_set (renderer, "text", "AZ/EL", NULL); + break; + + default: + sat_log_log (SAT_LOG_LEVEL_ERROR, + _("%s:%s: Invalid type: %d. Using AZ."), + __FILE__, __FUNCTION__, number); + g_object_set (renderer, "text", "AZ", NULL); + break; + + } + +} + + +#endif Modified: trunk/src/sat-pref-rot.h =================================================================== --- trunk/src/sat-pref-rot.h 2008-01-24 22:58:40 UTC (rev 21) +++ trunk/src/sat-pref-rot.h 2008-01-24 23:34:50 UTC (rev 22) @@ -28,10 +28,10 @@ #ifndef SAT_PREF_ROT_H #define SAT_PREF_ROT_H 1 - +#ifdef HAVE_HAMLIB GtkWidget *sat_pref_rot_create (void); void sat_pref_rot_cancel (void); void sat_pref_rot_ok (void); +#endif - #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2008-01-24 22:58:38
|
Revision: 21 http://gpredict.svn.sourceforge.net/gpredict/?rev=21&view=rev Author: csete Date: 2008-01-24 14:58:40 -0800 (Thu, 24 Jan 2008) Log Message: ----------- Added files. Added Paths: ----------- trunk/src/sat-pref-rot-editor.c trunk/src/sat-pref-rot-editor.h Added: trunk/src/sat-pref-rot-editor.c =================================================================== --- trunk/src/sat-pref-rot-editor.c (rev 0) +++ trunk/src/sat-pref-rot-editor.c 2008-01-24 22:58:40 UTC (rev 21) @@ -0,0 +1,822 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + Gpredict: Real-time satellite tracking and orbit prediction program + + Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC. + + Authors: Alexandru Csete <oz...@gm...> + + Comments, questions and bugreports should be submitted via + http://sourceforge.net/projects/groundstation/ + More details can be found at the project home page: + + http://groundstation.sourceforge.net/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, visit http://www.fsf.org/ +*/ + +/** \brief Edit radio configuration. + * + */ + +#include <gtk/gtk.h> +#include <glib/gi18n.h> +#include <glib/gstdio.h> +#include <math.h> +#ifdef HAVE_CONFIG_H +# include <build-config.h> +#endif +#include "gpredict-utils.h" +#include "sat-cfg.h" +#include "sat-log.h" +#include "radio-conf.h" +#include "sat-pref-rig-editor.h" + +#ifdef HAVE_HAMLIB +# include <hamlib/rig.h> + + +extern GtkWidget *window; /* dialog window defined in sat-pref.c */ + + + +/* private widgets */ +static GtkWidget *dialog; /* dialog window */ +static GtkWidget *name; /* Configuration name */ +static GtkWidget *model; /* radio model, e.g. TS-2000 */ +static GtkWidget *civ; /* Icom CI-V address */ +static GtkWidget *type; /* radio type */ +static GtkWidget *port; /* port selector */ +static GtkWidget *speed; /* serial speed selector */ +static GtkWidget *dtr,*rts; /* DTR and RTS line states */ + + +static GtkWidget *create_editor_widgets (radio_conf_t *conf); +static void update_widgets (radio_conf_t *conf); +static void clear_widgets (void); +static gboolean apply_changes (radio_conf_t *conf); +static void name_changed (GtkWidget *widget, gpointer data); +static GtkTreeModel *create_rig_model (void); +static gint rig_list_add (const struct rig_caps *, void *); +static gint rig_list_compare_mfg (gconstpointer, gconstpointer); +static gint rig_list_compare_mod (gconstpointer, gconstpointer); +static void is_rig_model (GtkCellLayout *cell_layout, + GtkCellRenderer *cell, + GtkTreeModel *tree_model, + GtkTreeIter *iter, + gpointer data); +static void select_rig (guint rigid); + + +/** \brief Add or edit a radio configuration. + * \param conf Pointer to a radio configuration. + * + * Of conf->name is not NULL the widgets will be populated with the data. + */ +void +sat_pref_rig_editor_run (radio_conf_t *conf) +{ + gint response; + gboolean finished = FALSE; + + + /* crate dialog and add contents */ + dialog = gtk_dialog_new_with_buttons (_("Edit radio configuration"), + GTK_WINDOW (window), + GTK_DIALOG_MODAL | + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_CLEAR, + GTK_RESPONSE_REJECT, + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL, + GTK_STOCK_OK, + GTK_RESPONSE_OK, + NULL); + + /* disable OK button to begin with */ + gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), + GTK_RESPONSE_OK, + FALSE); + + gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), + create_editor_widgets (conf)); + + /* this hacky-thing is to keep the dialog running in case the + CLEAR button is plressed. OK and CANCEL will exit the loop + */ + while (!finished) { + + response = gtk_dialog_run (GTK_DIALOG (dialog)); + + switch (response) { + + /* OK */ + case GTK_RESPONSE_OK: + if (apply_changes (conf)) { + finished = TRUE; + } + else { + finished = FALSE; + } + break; + + /* CLEAR */ + case GTK_RESPONSE_REJECT: + clear_widgets (); + break; + + /* Everything else is considered CANCEL */ + default: + finished = TRUE; + break; + } + } + + gtk_widget_destroy (dialog); +} + + +/** \brief Create and initialise widgets */ +static GtkWidget * +create_editor_widgets (radio_conf_t *conf) +{ + GtkWidget *table; + GtkWidget *label; + GtkTreeModel *riglist; + GtkCellRenderer *renderer; + gchar *buff; + guint i; + + + table = gtk_table_new (5, 5, 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); + + /* Config name */ + label = gtk_label_new (_("Name")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 4, 0, 1); + + name = gtk_entry_new (); + gtk_entry_set_max_length (GTK_ENTRY (name), 25); + gtk_widget_set_tooltip_text (name, + _("Enter a short name for this configuration, e.g. IC910-1.\n"\ + "Allowed charachters: 0..9, a..z, A..Z, - and _")); + gtk_table_attach_defaults (GTK_TABLE (table), name, 1, 4, 0, 1); + + /* attach changed signal so that we can enable OK button when + a proper name has been entered + */ + g_signal_connect (name, "changed", G_CALLBACK (name_changed), NULL); + + /* Model */ + label = gtk_label_new (_("Model")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 1, 2); + + riglist = create_rig_model (); + model = gtk_combo_box_new_with_model (riglist); + g_object_unref (riglist); + gtk_table_attach_defaults (GTK_TABLE (table), model, 1, 2, 1, 2); + + renderer = gtk_cell_renderer_text_new (); + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (model), renderer, TRUE); + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (model), renderer, + "text", 0, + NULL); + gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (model), + renderer, + is_rig_model, + NULL, NULL); + gtk_widget_set_tooltip_text (model, _("Click to select a radio.")); + select_rig (1); + + /* ICOM CI-V adress */ + label = gtk_label_new (_("ICOM CI-V")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_table_attach_defaults (GTK_TABLE (table), label, 3, 4, 1, 2); + + civ = gtk_combo_box_new_text (); + gtk_widget_set_tooltip_text (civ, + _("Select ICOM CI-V address of the radio.")); + + /* works, but pretty lame... */ + gtk_combo_box_append_text (GTK_COMBO_BOX (civ), _("Default")); + for (i = 1; i < 0xF0; i++) { + if (i < 0x10) + buff = g_strdup_printf ("0x0%X", i); + else + buff = g_strdup_printf ("0x%X", i); + gtk_combo_box_append_text (GTK_COMBO_BOX (civ), buff); + g_free (buff); + } + gtk_combo_box_set_active (GTK_COMBO_BOX (civ), 0); + gtk_table_attach_defaults (GTK_TABLE (table), civ, 4, 5, 1, 2); + + + /* Type */ + label = gtk_label_new (_("Type")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 2, 3); + type = gtk_combo_box_new_text (); + gtk_combo_box_append_text (GTK_COMBO_BOX (type), _("Receiver")); + gtk_combo_box_append_text (GTK_COMBO_BOX (type), _("Transmitter")); + gtk_combo_box_append_text (GTK_COMBO_BOX (type), _("RX + TX")); + gtk_combo_box_append_text (GTK_COMBO_BOX (type), _("Full Duplex")); + gtk_combo_box_set_active (GTK_COMBO_BOX (type), 0); + gtk_widget_set_tooltip_text (type, + _("Select radio type. Consult the user manual, if unsure")); + gtk_table_attach_defaults (GTK_TABLE (table), type, 1, 2, 2, 3); + + /* Port */ + label = gtk_label_new (_("Port")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 3, 4); + + port = gtk_combo_box_entry_new_text (); + if (conf->port != NULL) { + gtk_combo_box_append_text (GTK_COMBO_BOX (port), conf->port); + } + gtk_combo_box_append_text (GTK_COMBO_BOX (port), "/dev/ttyS0"); + gtk_combo_box_append_text (GTK_COMBO_BOX (port), "/dev/ttyS1"); + gtk_combo_box_append_text (GTK_COMBO_BOX (port), "/dev/ttyS2"); + gtk_combo_box_append_text (GTK_COMBO_BOX (port), "/dev/ttyUSB0"); + gtk_combo_box_append_text (GTK_COMBO_BOX (port), "/dev/ttyUSB1"); + gtk_combo_box_append_text (GTK_COMBO_BOX (port), "/dev/ttyUSB2"); + gtk_combo_box_set_active (GTK_COMBO_BOX (port), 0); + gtk_widget_set_tooltip_text (port, _("Select or enter communication port")); + gtk_table_attach_defaults (GTK_TABLE (table), port, 1, 2, 3, 4); + + /* DTR State */ + label = gtk_label_new (_("DTR Line")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_table_attach_defaults (GTK_TABLE (table), label, 3, 4, 3, 4); + + dtr = gtk_combo_box_new_text (); + gtk_combo_box_append_text (GTK_COMBO_BOX (dtr), _("Undefined")); + gtk_combo_box_append_text (GTK_COMBO_BOX (dtr), _("OFF")); + gtk_combo_box_append_text (GTK_COMBO_BOX (dtr), _("ON")); + gtk_combo_box_append_text (GTK_COMBO_BOX (dtr), _("PTT")); + gtk_combo_box_append_text (GTK_COMBO_BOX (dtr), _("CW")); + gtk_combo_box_set_active (GTK_COMBO_BOX (dtr), 0); + gtk_widget_set_tooltip_text (dtr, _("Select status and use of DTR line")); + gtk_table_attach_defaults (GTK_TABLE (table), dtr, 4, 5, 3, 4); + + + /* Speed */ + label = gtk_label_new (_("Rate")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 4, 5); + speed = gtk_combo_box_new_text (); + gtk_combo_box_append_text (GTK_COMBO_BOX (speed), "300"); + gtk_combo_box_append_text (GTK_COMBO_BOX (speed), "1200"); + gtk_combo_box_append_text (GTK_COMBO_BOX (speed), "2400"); + gtk_combo_box_append_text (GTK_COMBO_BOX (speed), "4800"); + gtk_combo_box_append_text (GTK_COMBO_BOX (speed), "9600"); + gtk_combo_box_append_text (GTK_COMBO_BOX (speed), "19200"); + gtk_combo_box_append_text (GTK_COMBO_BOX (speed), "38400"); + gtk_combo_box_append_text (GTK_COMBO_BOX (speed), "57600"); + gtk_combo_box_append_text (GTK_COMBO_BOX (speed), "115200"); + gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 4); + gtk_widget_set_tooltip_text (speed, _("Select serial port speed")); + gtk_table_attach_defaults (GTK_TABLE (table), speed, 1, 2, 4, 5); + + /* RTS State */ + label = gtk_label_new (_("RTS Line")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_table_attach_defaults (GTK_TABLE (table), label, 3, 4, 4, 5); + + rts = gtk_combo_box_new_text (); + gtk_combo_box_append_text (GTK_COMBO_BOX (rts), _("Undefined")); + gtk_combo_box_append_text (GTK_COMBO_BOX (rts), _("OFF")); + gtk_combo_box_append_text (GTK_COMBO_BOX (rts), _("ON")); + gtk_combo_box_append_text (GTK_COMBO_BOX (rts), _("PTT")); + gtk_combo_box_append_text (GTK_COMBO_BOX (rts), _("CW")); + gtk_combo_box_set_active (GTK_COMBO_BOX (rts), 0); + gtk_widget_set_tooltip_text (rts, _("Select status and use of RTS line")); + gtk_table_attach_defaults (GTK_TABLE (table), rts, 4, 5, 4, 5); + + /* separator between port/speed and DTR/RTS */ + gtk_table_attach (GTK_TABLE (table), gtk_vseparator_new(), 2, 3, 1, 5, + GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 5, 0); + + if (conf->name != NULL) + update_widgets (conf); + + gtk_widget_show_all (table); + + return table; +} + + +/** \brief Update widgets from the currently selected row in the treeview + */ +static void +update_widgets (radio_conf_t *conf) +{ + + /* configuration name */ + gtk_entry_set_text (GTK_ENTRY (name), conf->name); + + /* model */ + select_rig (conf->id); + + /* type */ + gtk_combo_box_set_active (GTK_COMBO_BOX (type), conf->type); + + /* port */ + gtk_combo_box_prepend_text (GTK_COMBO_BOX (port), conf->port); + gtk_combo_box_set_active (GTK_COMBO_BOX (port), 0); + + /*serial speed */ + switch (conf->speed) { + case 300: + gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 0); + break; + case 1200: + gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 1); + break; + case 2400: + gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 2); + break; + case 9600: + gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 3); + break; + case 19200: + gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 4); + break; + case 38400: + gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 5); + break; + case 57600: + gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 6); + break; + case 115200: + gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 7); + break; + default: + gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 4); + break; + } + + /* CI-V */ + gtk_combo_box_set_active (GTK_COMBO_BOX (civ), conf->civ); + + /* DTR and RTS lines */ + gtk_combo_box_set_active (GTK_COMBO_BOX (dtr), conf->dtr); + gtk_combo_box_set_active (GTK_COMBO_BOX (rts), conf->rts); +} + + + +/** \brief Clear the contents of all widgets. + * + * This function is usually called when the user clicks on the CLEAR button + * + */ +static void +clear_widgets () +{ + gtk_entry_set_text (GTK_ENTRY (name), ""); + select_rig (1); + gtk_combo_box_set_active (GTK_COMBO_BOX (type), 0); + gtk_combo_box_set_active (GTK_COMBO_BOX (port), 0); + gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 4); + gtk_combo_box_set_active (GTK_COMBO_BOX (civ), 0); + gtk_combo_box_set_active (GTK_COMBO_BOX (dtr), 0); + gtk_combo_box_set_active (GTK_COMBO_BOX (rts), 0); +} + + +/** \brief Apply changes. + * \return TRUE if things are ok, FALSE otherwise. + * + * This function is usually called when the user clicks the OK button. + */ +static gboolean +apply_changes (radio_conf_t *conf) +{ + GtkTreeIter iter1,iter2; + GtkTreeModel *riglist; + gchar *b1,*b2; + guint id; + + + /* name */ + if (conf->name) + g_free (conf->name); + + conf->name = g_strdup (gtk_entry_get_text (GTK_ENTRY (name))); + + /* model */ + if (conf->model) + g_free (conf->model); + + /* iter1 is needed to construct full model name */ + gtk_combo_box_get_active_iter (GTK_COMBO_BOX (model), &iter2); + riglist = gtk_combo_box_get_model (GTK_COMBO_BOX (model)); + gtk_tree_model_iter_parent (riglist, &iter1, &iter2); + + /* build model string */ + gtk_tree_model_get (riglist, &iter1, 0, &b1, -1); + gtk_tree_model_get (riglist, &iter2, 0, &b2, -1); + conf->model = g_strconcat (b1, " ", b2, NULL); + g_free (b1); + g_free (b2); + + /* ID */ + gtk_tree_model_get (riglist, &iter2, 1, &id, -1); + conf->id = id; + + /* radio type */ + conf->type = gtk_combo_box_get_active (GTK_COMBO_BOX (type)); + + /* port / device */ + if (conf->port) + g_free (conf->port); + + conf->port = gtk_combo_box_get_active_text (GTK_COMBO_BOX (port)); + + /* CI-V */ + conf->civ = gtk_combo_box_get_active (GTK_COMBO_BOX (civ)); + + /* serial speed */ + switch (gtk_combo_box_get_active (GTK_COMBO_BOX (speed))) { + case 0: + conf->speed = 300; + break; + case 1: + conf->speed = 1200; + break; + case 2: + conf->speed = 2400; + break; + case 3: + conf->speed = 4800; + break; + case 4: + conf->speed = 9600; + break; + case 5: + conf->speed = 19200; + break; + case 6: + conf->speed = 38400; + break; + case 7: + conf->speed = 57600; + break; + case 8: + conf->speed = 115200; + break; + default: + conf->speed = 9600; + break; + } + + /* DTR and RTS */ + conf->dtr = gtk_combo_box_get_active (GTK_COMBO_BOX (dtr)); + conf->rts = gtk_combo_box_get_active (GTK_COMBO_BOX (rts)); + + return TRUE; +} + + + +/** \brief Manage name changes. + * + * This function is called when the contents of the name entry changes. + * The primary purpose of this function is to check whether the char length + * of the name is greater than zero, if yes enable the OK button of the dialog. + */ +static void +name_changed (GtkWidget *widget, gpointer data) +{ + const gchar *text; + gchar *entry, *end, *j; + gint len, pos; + + + /* step 1: ensure that only valid characters are entered + (stolen from xlog, tnx pg4i) + */ + entry = gtk_editable_get_chars (GTK_EDITABLE (widget), 0, -1); + if ((len = g_utf8_strlen (entry, -1)) > 0) + { + end = entry + g_utf8_strlen (entry, -1); + for (j = entry; j < end; ++j) + { + switch (*j) + { + case '0' ... '9': + case 'a' ... 'z': + case 'A' ... 'Z': + case '-': + case '_': + break; + default: + gdk_beep (); + pos = gtk_editable_get_position (GTK_EDITABLE (widget)); + gtk_editable_delete_text (GTK_EDITABLE (widget), + pos, pos+1); + break; + } + } + } + + + /* step 2: if name seems all right, enable OK button */ + text = gtk_entry_get_text (GTK_ENTRY (widget)); + + if (g_utf8_strlen (text, -1) > 0) { + gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), + GTK_RESPONSE_OK, + TRUE); + } + else { + gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), + GTK_RESPONSE_OK, + FALSE); + } +} + + +/** \brief Radio info to be used when building the rig model */ +typedef struct { + gint id; /*!< Model ID. */ + gchar *mfg; /*!< Manufacurer name (eg. KENWOOD). */ + gchar *model; /*!< Radio model (eg. TS-440). */ +} rig_info_t; + + +/** \brief Build tree model containing radios. + * \return A tree model where the radios are ordered according to + * manufacturer. + * + */ +static GtkTreeModel *create_rig_model () +{ + GArray *array; + rig_info_t *info; + GtkTreeIter iter1; /* iter used for manufacturer */ + GtkTreeIter iter2; /* iter used for model */ + GtkTreeStore *store; + gchar *buff; + gint status; + gint i; + + + /* create araay containing rigs */ + array = g_array_new (FALSE, FALSE, sizeof (rig_info_t)); + rig_load_all_backends(); + + /* fill list using rig_list_foreach */ + status = rig_list_foreach (rig_list_add, (void *) array); + + /* sort the array, first by model then by mfg */ + g_array_sort (array, rig_list_compare_mod); + g_array_sort (array, rig_list_compare_mfg); + + sat_log_log (SAT_LOG_LEVEL_DEBUG, + _("%s:%d: Read %d distinct radios into array."), + __FILE__, __LINE__, array->len); + + /* create a tree store with two cols (name and ID) */ + store = gtk_tree_store_new (2, G_TYPE_STRING, G_TYPE_INT); + + /* add array contents to treestore */ + for (i = 0; i < array->len; i++) { + + /* get rig info struct */ + info = &g_array_index (array, rig_info_t, i); + + if (gtk_tree_store_iter_is_valid (store, &iter1)) { + /* iter1 is valid, i.e. we already have a manufacturer */ + gtk_tree_model_get (GTK_TREE_MODEL (store), &iter1, + 0, &buff, + -1); + if (g_ascii_strcasecmp (buff, info->mfg)) { + /* mfg different, add new mfg */ + gtk_tree_store_append (store, &iter1, NULL); + gtk_tree_store_set (store, &iter1, 0, info->mfg, -1); + } + /* else: mfg are identical; nothing to do */ + } + else { + /* iter1 is not valid, so add the first manufacturer */ + gtk_tree_store_append (store, &iter1, NULL); + gtk_tree_store_set (store, &iter1, 0, info->mfg, -1); + } + + /* iter1 points to the parent mfg; insert this rig */ + gtk_tree_store_append (store, &iter2, &iter1); + gtk_tree_store_set (store, &iter2, + 0, info->model, + 1, info->id, + -1); + + /* done with this model */ + g_free (info->mfg); + g_free (info->model); + } + + g_array_free (array,TRUE); + + return GTK_TREE_MODEL (store); +} + + +/** \brief Add new entry to list of radios. + * \param caps Structure with the capablities of thecurrent radio. + * \param array Pointer to the GArray into which the new entry should be + * stored. + * \return Always 1 to keep rig_list_foreach running. + * + * This function is called by the rig_list_foreach hamlib function for each + * supported radio. It copies the relevant data into a grig_rig_info_t + * structure and adds the new entry to the GArray containing the list of + * supported radios. + * + * \sa rig_list_compare + */ +static gint +rig_list_add (const struct rig_caps *caps, void *array) +{ + rig_info_t *info; + + /* create new entry */ + info = g_malloc (sizeof (rig_info_t)); + + /* fill values */ + info->id = caps->rig_model; + info->mfg = g_strdup (caps->mfg_name); + info->model = g_strdup (caps->model_name); + + /* append new element to array */ + array = (void *) g_array_append_vals ((GArray *) array, info, 1); + + /* keep on running */ + return 1; +} + + + +/** \brief Compare two rig info entries. + * \param a Pointer to the first entry. + * \param b Pointer to the second entry. + * \return Negative value if a < b; zero if a = b; positive value if a > b. + * + * This function is used to compare two rig entries in the list of radios + * when the list is sorted. It compares the manufacturer of the two radios. + * + * \sa rig_list_add + */ +static gint +rig_list_compare_mfg (gconstpointer a, gconstpointer b) +{ + gchar *ida, *idb; + + ida = ((rig_info_t *) a)->mfg; + idb = ((rig_info_t *) b)->mfg; + + if (g_ascii_strcasecmp(ida,idb) < 0) { + return -1; + } + else if (g_ascii_strcasecmp(ida,idb) > 0) { + return 1; + } + else { + return 0; + } + +} + + + +/** \brief Compare two rig info entries. + * \param a Pointer to the first entry. + * \param b Pointer to the second entry. + * \return Negative value if a < b; zero if a = b; positive value if a > b. + * + * This function is used to compare two rig entries in the list of radios + * when the list is sorted. It compares the model of the two radios. + * + * \sa rig_list_add + */ +static gint +rig_list_compare_mod (gconstpointer a, gconstpointer b) +{ + gchar *ida, *idb; + + ida = ((rig_info_t *) a)->model; + idb = ((rig_info_t *) b)->model; + + if (g_ascii_strcasecmp(ida,idb) < 0) { + return -1; + } + else if (g_ascii_strcasecmp(ida,idb) > 0) { + return 1; + } + else { + return 0; + } + +} + + +/** \brief Set cell sensitivity. + * + * This function is used to disable the sensitive of manifacturer entries + * as children. Otherwise, the manufacturer would appear as the first entry + * in a submenu. + * */ +static void +is_rig_model (GtkCellLayout *cell_layout, + GtkCellRenderer *cell, + GtkTreeModel *tree_model, + GtkTreeIter *iter, + gpointer data) +{ + gboolean sensitive; + + sensitive = !gtk_tree_model_iter_has_child (tree_model, iter); + + g_object_set (cell, "sensitive", sensitive, NULL); +} + + +/** \brief Select a radio in the combo box. + * \param rigid The hamlib id of the radio. + * + * This function selects the specified radio in the combobox. This is done + * by looping over all items in the tree model until a match is reached + * (or there are no more items left). + */ +static void +select_rig (guint rigid) +{ + GtkTreeIter iter1,iter2; + GtkTreeModel *riglist; + guint i,j,n,m; + guint thisrig = 0; + + + /* get the tree model */ + riglist = gtk_combo_box_get_model (GTK_COMBO_BOX (model)); + + /* get the number of toplevel nodes */ + n = gtk_tree_model_iter_n_children (riglist, NULL); + for (i = 0; i < n; i++) { + + /* get the i'th toplevel node */ + if (gtk_tree_model_iter_nth_child (riglist, &iter1, NULL, i)) { + + /* get the number of children */ + m = gtk_tree_model_iter_n_children (riglist, &iter1); + for (j = 0; j < m; j++) { + + /* get the j'th child */ + if (gtk_tree_model_iter_nth_child (riglist, &iter2, &iter1, j)) { + + /* get ID of this model */ + gtk_tree_model_get (riglist, &iter2, 1, &thisrig, -1); + + if (thisrig == rigid) { + /* select this rig and terminate loop */ + gtk_combo_box_set_active_iter (GTK_COMBO_BOX (model), &iter2); + j = m; + i = n; + } + } + else { + sat_log_log (SAT_LOG_LEVEL_BUG, + _("%s:%s: NULL child node at index %d:%d"), + __FILE__, __FUNCTION__, i, j); + + } + } + + } + else { + sat_log_log (SAT_LOG_LEVEL_BUG, + _("%s:%s: NULL toplevel node at index %d"), + __FILE__, __FUNCTION__, i); + } + } + + +} + +#endif Added: trunk/src/sat-pref-rot-editor.h =================================================================== --- trunk/src/sat-pref-rot-editor.h (rev 0) +++ trunk/src/sat-pref-rot-editor.h 2008-01-24 22:58:40 UTC (rev 21) @@ -0,0 +1,38 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + Gpredict: Real-time satellite tracking and orbit prediction program + + Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC. + + Authors: Alexandru Csete <oz...@gm...> + + Comments, questions and bugreports should be submitted via + http://sourceforge.net/projects/groundstation/ + More details can be found at the project home page: + + http://groundstation.sourceforge.net/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, visit http://www.fsf.org/ +*/ +#ifndef SAT_PREF_ROT_EDITOR_H +#define SAT_PREF_ROT_EDITOR_H 1 + +#include <gtk/gtk.h> +#include "rotor-conf.h" + +#ifdef HAVE_HAMLIB +void sat_pref_rot_editor_run (rotor_conf_t *conf); +#endif + +#endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2008-01-24 22:34:57
|
Revision: 20 http://gpredict.svn.sourceforge.net/gpredict/?rev=20&view=rev Author: csete Date: 2008-01-24 14:34:58 -0800 (Thu, 24 Jan 2008) Log Message: ----------- Added file. Added Paths: ----------- trunk/src/sat-pref-rot-data.h Added: trunk/src/sat-pref-rot-data.h =================================================================== --- trunk/src/sat-pref-rot-data.h (rev 0) +++ trunk/src/sat-pref-rot-data.h 2008-01-24 22:34:58 UTC (rev 20) @@ -0,0 +1,43 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + Gpredict: Real-time satellite tracking and orbit prediction program + + Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC. + + Authors: Alexandru Csete <oz...@gm...> + + Comments, questions and bugreports should be submitted via + http://sourceforge.net/projects/groundstation/ + More details can be found at the project home page: + + http://groundstation.sourceforge.net/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, visit http://www.fsf.org/ +*/ +#ifndef SAT_PREF_ROT_DATA_H +#define SAT_PREF_ROT_DATA_H 1 + +/** \brief Coumn definitions for rotator list. */ +typedef enum { + RIG_LIST_COL_NAME = 0, /*!< File name. */ + RIG_LIST_COL_MODEL, /*!< Model */ + RIG_LIST_COL_ID, /*!< Hamlib ID. */ + RIG_LIST_COL_TYPE, /*!< Rtator type. */ + RIG_LIST_COL_PORT, /*!< Port / Device, e.g. /dev/ttyS0. */ + RIG_LIST_COL_SPEED, /*!< Serial speed. */ + RIG_LIST_COL_NUM /*!< The number of fields in the list. */ +} rotor_list_col_t; + + +#endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2008-01-24 21:39:31
|
Revision: 19 http://gpredict.svn.sourceforge.net/gpredict/?rev=19&view=rev Author: csete Date: 2008-01-24 13:39:25 -0800 (Thu, 24 Jan 2008) Log Message: ----------- Added files with functions to read and save rotator configuration. Added Paths: ----------- trunk/src/rotor-conf.c trunk/src/rotor-conf.h Added: trunk/src/rotor-conf.c =================================================================== --- trunk/src/rotor-conf.c (rev 0) +++ trunk/src/rotor-conf.c 2008-01-24 21:39:25 UTC (rev 19) @@ -0,0 +1,138 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + Gpredict: Real-time satellite tracking and orbit prediction program + + Copyright (C) 2001-2007 Alexandru Csete. + + Authors: Alexandru Csete <oz...@gm...> + + Comments, questions and bugreports should be submitted via + http://sourceforge.net/projects/groundstation/ + More details can be found at the project home page: + + http://groundstation.sourceforge.net/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, visit http://www.fsf.org/ + +*/ + +#include <gtk/gtk.h> +#include <glib/gi18n.h> +#include "sat-log.h" +#include "compat.h" + +#include "rotor-conf.h" + +#define GROUP "Rotator" +#define KEY_MODEL "Model" +#define KEY_ID "ID" +#define KEY_TYPE "Type" +#define KEY_PORT "Port" +#define KEY_SPEED "Speed" + + +/** \brief Read rotator configuration. + * \param conf Pointer to a rotor_conf_t structure where the data will be + * stored. + * + * This function reads a rotoator configuration from a .rot file into conf. + * conf->name must contain the file name of the configuration (no path, just + * file name and without the .rot extension). + */ +gboolean rotor_conf_read (rotor_conf_t *conf) +{ + GKeyFile *cfg = NULL; + gchar *confdir; + gchar *fname; + + + if (conf->name == NULL) + return FALSE; + + confdir = get_conf_dir(); + fname = g_strconcat (confdir, G_DIR_SEPARATOR_S, + "hwconf", G_DIR_SEPARATOR_S, + conf->name, ".rot", NULL); + g_free (confdir); + + /* open .grc file */ + cfg = g_key_file_new (); + g_key_file_load_from_file(cfg, fname, 0, NULL); + + if (cfg == NULL) { + sat_log_log (SAT_LOG_LEVEL_ERROR, + _("%s: Could not load file %s\n"), + __FUNCTION__, fname); + g_free (fname); + + return FALSE; + } + + g_free (fname); + + /* read parameters */ + conf->model = g_key_file_get_string (cfg, GROUP, KEY_MODEL, NULL); + conf->id = g_key_file_get_integer (cfg, GROUP, KEY_ID, NULL); + conf->type = g_key_file_get_integer (cfg, GROUP, KEY_TYPE, NULL); + conf->port = g_key_file_get_string (cfg, GROUP, KEY_PORT, NULL); + conf->speed = g_key_file_get_integer (cfg, GROUP, KEY_SPEED, NULL); + + g_key_file_free (cfg); + + return TRUE; +} + + +/** \brief Save rotator configuration. + * \param conf Pointer to the rotator configuration. + * + * This function saves the rotator configuration stored in conf to a + * .rig file. conf->name must contain the file name of the configuration + * (no path, just file name and without the .rot extension). + */ +void rotor_conf_save (radio_conf_t *conf) +{ + GKeyFile *cfg = NULL; + gchar *confdir; + gchar *fname; + gchar *data; + gsize len; + + if (conf->name == NULL) + return; + + /* create a config structure */ + cfg = g_key_file_new(); + + g_key_file_set_string (cfg, GROUP, KEY_MODEL, conf->model); + g_key_file_set_integer (cfg, GROUP, KEY_ID, conf->id); + g_key_file_set_integer (cfg, GROUP, KEY_TYPE, conf->type); + g_key_file_set_string (cfg, GROUP, KEY_PORT, conf->port); + g_key_file_set_integer (cfg, GROUP, KEY_SPEED, conf->speed); + + /* convert to text sdata */ + data = g_key_file_to_data (cfg, &len, NULL); + + confdir = get_conf_dir(); + fname = g_strconcat (confdir, G_DIR_SEPARATOR_S, + "hwconf", G_DIR_SEPARATOR_S, + conf->name, ".rot", NULL); + g_free (confdir); + + g_file_set_contents (fname, data, len, NULL); + + g_free (fname); + g_free (data); + g_key_file_free (cfg); +} Added: trunk/src/rotor-conf.h =================================================================== --- trunk/src/rotor-conf.h (rev 0) +++ trunk/src/rotor-conf.h 2008-01-24 21:39:25 UTC (rev 19) @@ -0,0 +1,60 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + Gpredict: Real-time satellite tracking and orbit prediction program + + Copyright (C) 2001-2007 Alexandru Csete. + + Authors: Alexandru Csete <oz...@gm...> + + Comments, questions and bugreports should be submitted via + http://sourceforge.net/projects/groundstation/ + More details can be found at the project home page: + + http://groundstation.sourceforge.net/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, visit http://www.fsf.org/ + + +*/ +#ifndef ROTOR_CONF_H +#define ROTOR_CONF_H 1 + +#include <glib.h> + + + + +/** \brief Rotator type definitions. */ +typedef enum { + ROTOR_TYPE_AZ = 1, /*!< Azimuth rotator. */ + ROTOR_TYPE_EL = 2, /*!< Elevation rotator. */ + ROTOR_TYPE_AZEL = 3 /*!< Both azimuth and elevation rotator. */ +} rotor_type_t; + + +/** \brief Rotator configuration. */ +typedef struct { + gchar *name; /*!< Configuration file name, less .rot */ + gchar *model; /*!< Rotator model. */ + guint id; /*!< Hamlib ID. */ + rotor_type_t type; /*!< Rotator type. */ + gchar *port; /*!< Device name, e.g. /dev/ttyS0. */ + guint speed; /*!< Serial speed. */ +} rotor_conf_t; + + +gboolean rotor_conf_read (rotor_conf_t *conf); +void rotor_conf_save (rtor_conf_t *conf); + +#endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2008-01-24 21:34:32
|
Revision: 18 http://gpredict.svn.sourceforge.net/gpredict/?rev=18&view=rev Author: csete Date: 2008-01-24 13:34:18 -0800 (Thu, 24 Jan 2008) Log Message: ----------- Added files with rotator configuration code to build list. Modified Paths: -------------- trunk/win32/Makefile Modified: trunk/win32/Makefile =================================================================== --- trunk/win32/Makefile 2008-01-24 21:33:28 UTC (rev 17) +++ trunk/win32/Makefile 2008-01-24 21:34:18 UTC (rev 18) @@ -116,6 +116,7 @@ predict-tools.c \ qth-editor.c \ radio-conf.c \ + rotor-conf.c \ rdv.c \ sat-cfg.c \ sat-debugger.c \ @@ -142,7 +143,9 @@ sat-pref-qth-editor.c \ sat-pref-refresh.c \ sat-pref-rig.c \ + sat-pref-rig-editor.c \ sat-pref-rot.c \ + sat-pref-rot-editor.c \ sat-pref-single-pass.c \ sat-pref-single-sat.c \ sat-pref-sky-at-glance.c \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2008-01-24 21:33:56
|
Revision: 17 http://gpredict.svn.sourceforge.net/gpredict/?rev=17&view=rev Author: csete Date: 2008-01-24 13:33:28 -0800 (Thu, 24 Jan 2008) Log Message: ----------- Added files with rotator configuration code to build list. Modified Paths: -------------- trunk/src/Makefile.am Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2008-01-24 21:06:10 UTC (rev 16) +++ trunk/src/Makefile.am 2008-01-24 21:33:28 UTC (rev 17) @@ -66,6 +66,7 @@ predict-tools.c predict-tools.h \ qth-editor.c qth-editor.h \ radio-conf.c radio-conf.h \ + rotor-conf.c rotor-conf.h \ rdv.c rdv.h \ sat-cfg.c sat-cfg.h \ sat-log.c sat-log.h \ @@ -92,6 +93,7 @@ sat-pref-rig.c sat-pref-rig.h sat-pref-rig-data.h \ sat-pref-rig-editor.c sat-pref-rig-editor.h \ sat-pref-rot.c sat-pref-rot.h \ + sat-pref-rot-editor.c sat-pref-rot-editor.h \ sat-pref-predict.c sat-pref-predict.h \ sat-pref-conditions.c sat-pref-conditions.h \ sat-pref-multi-pass.c sat-pref-multi-pass.h \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2008-01-24 21:06:05
|
Revision: 16 http://gpredict.svn.sourceforge.net/gpredict/?rev=16&view=rev Author: csete Date: 2008-01-24 13:06:10 -0800 (Thu, 24 Jan 2008) Log Message: ----------- Finished radio configuration page. Modified Paths: -------------- trunk/src/sat-pref-rig.c Modified: trunk/src/sat-pref-rig.c =================================================================== --- trunk/src/sat-pref-rig.c 2008-01-24 20:48:48 UTC (rev 15) +++ trunk/src/sat-pref-rig.c 2008-01-24 21:06:10 UTC (rev 16) @@ -27,6 +27,7 @@ */ #include <gtk/gtk.h> #include <glib/gi18n.h> +#include <glib/gstdio.h> #ifdef HAVE_CONFIG_H # include <build-config.h> #endif @@ -206,8 +207,8 @@ GError *error = NULL; /* error flag and info */ gchar *cfgdir; gchar *dirname; /* directory name */ + gchar **vbuff; const gchar *filename; /* file name */ - gchar *buff; radio_conf_t conf; /* create a new list store */ @@ -236,7 +237,9 @@ if (g_strrstr (filename, ".rig")) { - conf.name = g_strdup (filename); + vbuff = g_strsplit (filename, ".rig", 0); + conf.name = g_strdup (vbuff[0]); + g_strfreev (vbuff); if (radio_conf_read (&conf)) { /* insert conf into liststore */ gtk_list_store_append (liststore, &item); @@ -348,9 +351,88 @@ */ void sat_pref_rig_ok () { + GDir *dir = NULL; /* directory handle */ + GError *error = NULL; /* error flag and info */ + gchar *buff,*dirname; + const gchar *filename; + GtkTreeIter iter; /* new item added to the list store */ + GtkTreeModel *model; + guint i,n; + + radio_conf_t conf = { + .name = NULL, + .model = NULL, + .id = 0, + .type = RADIO_TYPE_RX, + .port = NULL, + .speed = 0, + .civ = 0, + .dtr = LINE_UNDEF, + .rts = LINE_UNDEF, + }; + + /* delete all .rig files */ + buff = get_conf_dir (); + dirname = g_strconcat (buff, G_DIR_SEPARATOR_S, + "hwconf", NULL); + g_free (buff); + dir = g_dir_open (dirname, 0, &error); + if (dir) { + /* read each .rig file */ + while ((filename = g_dir_read_name (dir))) { + + if (g_strrstr (filename, ".rig")) { + + buff = g_strconcat (dirname, G_DIR_SEPARATOR_S, filename, NULL); + g_remove (buff); + g_free (buff); + } + } + } + + g_free (dirname); + g_dir_close (dir); + /* create new .rig files for the radios in the riglist */ + model = gtk_tree_view_get_model (GTK_TREE_VIEW (riglist)); + n = gtk_tree_model_iter_n_children (model, NULL); + for (i = 0; i < n; i++) { + + /* get radio conf */ + if (gtk_tree_model_iter_nth_child (model, &iter, NULL, i)) { + + /* 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_DTR, &conf.dtr, + RIG_LIST_COL_RTS, &conf.rts, + -1); + radio_conf_save (&conf); + + /* free conf buffer */ + if (conf.name) + g_free (conf.name); + + if (conf.model) + g_free (conf.model); + + if (conf.port) + g_free (conf.port); + } + else { + sat_log_log (SAT_LOG_LEVEL_ERROR, + _("%s: Failed to get RIG %s"), + __FUNCTION__, i); + } + } } @@ -364,6 +446,9 @@ */ static void add_cb (GtkWidget *button, gpointer data) { + GtkTreeIter item; /* new item added to the list store */ + GtkListStore *liststore; + radio_conf_t conf = { .name = NULL, .model = NULL, @@ -376,8 +461,33 @@ .rts = LINE_UNDEF, }; + /* run rig conf editor */ + sat_pref_rig_editor_run (&conf); - sat_pref_rig_editor_run (&conf); + /* add new rig to the list */ + if (conf.name != NULL) { + liststore = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (riglist))); + 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_DTR, conf.dtr, + RIG_LIST_COL_RTS, conf.rts, + -1); + + g_free (conf.name); + + if (conf.model != NULL) + g_free (conf.model); + + if (conf.port != NULL) + g_free (conf.port); + } } @@ -394,7 +504,18 @@ GtkTreeModel *selmod; GtkTreeSelection *selection; GtkTreeIter iter; - radio_conf_t conf; + + radio_conf_t conf = { + .name = NULL, + .model = NULL, + .id = 0, + .type = RADIO_TYPE_RX, + .port = NULL, + .speed = 0, + .civ = 0, + .dtr = LINE_UNDEF, + .rts = LINE_UNDEF, + }; /* If there are no entries, we have a bug since the button should @@ -414,6 +535,17 @@ */ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (riglist)); 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_DTR, &conf.dtr, + RIG_LIST_COL_RTS, &conf.rts, + -1); } else { @@ -428,10 +560,38 @@ gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); + return; } + /* run radio configuration editor */ + sat_pref_rig_editor_run (&conf); - sat_pref_rig_editor_run (&conf); + /* apply changes */ + 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_DTR, conf.dtr, + RIG_LIST_COL_RTS, conf.rts, + -1); + + } + + /* clean up memory */ + if (conf.name) + g_free (conf.name); + + if (conf.model != NULL) + g_free (conf.model); + + if (conf.port != NULL) + g_free (conf.port); + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2008-01-24 20:48:43
|
Revision: 15 http://gpredict.svn.sourceforge.net/gpredict/?rev=15&view=rev Author: csete Date: 2008-01-24 12:48:48 -0800 (Thu, 24 Jan 2008) Log Message: ----------- Changed radio conf structure so that configuration name doe not include file extension. Modified Paths: -------------- trunk/src/radio-conf.c trunk/src/radio-conf.h Modified: trunk/src/radio-conf.c =================================================================== --- trunk/src/radio-conf.c 2008-01-24 18:41:41 UTC (rev 14) +++ trunk/src/radio-conf.c 2008-01-24 20:48:48 UTC (rev 15) @@ -66,7 +66,7 @@ confdir = get_conf_dir(); fname = g_strconcat (confdir, G_DIR_SEPARATOR_S, "hwconf", G_DIR_SEPARATOR_S, - conf->name, NULL); + conf->name, ".rig", NULL); g_free (confdir); /* open .grc file */ @@ -136,7 +136,7 @@ confdir = get_conf_dir(); fname = g_strconcat (confdir, G_DIR_SEPARATOR_S, "hwconf", G_DIR_SEPARATOR_S, - conf->name, NULL); + conf->name, ".rig", NULL); g_free (confdir); g_file_set_contents (fname, data, len, NULL); Modified: trunk/src/radio-conf.h =================================================================== --- trunk/src/radio-conf.h 2008-01-24 18:41:41 UTC (rev 14) +++ trunk/src/radio-conf.h 2008-01-24 20:48:48 UTC (rev 15) @@ -54,7 +54,7 @@ /** \brief Radio configuration. */ typedef struct { - gchar *name; /*!< Configuration file name. */ + gchar *name; /*!< Configuration file name, less .rig. */ gchar *model; /*!< Radio model, e.g. ICOM IC-910H. */ guint id; /*!< Hamlib ID. */ radio_type_t type; /*!< Radio type. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2008-01-24 18:41:42
|
Revision: 14 http://gpredict.svn.sourceforge.net/gpredict/?rev=14&view=rev Author: csete Date: 2008-01-24 10:41:41 -0800 (Thu, 24 Jan 2008) Log Message: ----------- Forgot to store configuration name. Modified Paths: -------------- trunk/src/sat-pref-rig-editor.c Modified: trunk/src/sat-pref-rig-editor.c =================================================================== --- trunk/src/sat-pref-rig-editor.c 2008-01-24 18:31:14 UTC (rev 13) +++ trunk/src/sat-pref-rig-editor.c 2008-01-24 18:41:41 UTC (rev 14) @@ -418,6 +418,8 @@ if (conf->name) g_free (conf->name); + conf->name = g_strdup (gtk_entry_get_text (GTK_ENTRY (name))); + /* model */ if (conf->model) g_free (conf->model); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2008-01-24 18:31:30
|
Revision: 13 http://gpredict.svn.sourceforge.net/gpredict/?rev=13&view=rev Author: csete Date: 2008-01-24 10:31:14 -0800 (Thu, 24 Jan 2008) Log Message: ----------- Updated. Modified Paths: -------------- trunk/ChangeLog Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-01-24 18:29:33 UTC (rev 12) +++ trunk/ChangeLog 2008-01-24 18:31:14 UTC (rev 13) @@ -1,3 +1,9 @@ +2008-01-24; Alexandru Csete <oz...@gm...> + + * src/sat-pref-rig-editor.[ch]: + Finished first draft of radio configuration editor. + + 2008-01-12; Alexandru Csete <oz...@gm...> * src/radio-conf.[ch]: @@ -2,2 +8,4 @@ Added parameter for radio type (RX, TX, TRX, FULL_DUPL). + + 2008-01-21; Alexandru Csete <oz...@gm...> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2008-01-24 18:29:34
|
Revision: 12 http://gpredict.svn.sourceforge.net/gpredict/?rev=12&view=rev Author: csete Date: 2008-01-24 10:29:33 -0800 (Thu, 24 Jan 2008) Log Message: ----------- Finished rig configuration editor. Modified Paths: -------------- trunk/src/sat-pref-rig-editor.c trunk/src/sat-pref-rig-editor.h Modified: trunk/src/sat-pref-rig-editor.c =================================================================== --- trunk/src/sat-pref-rig-editor.c 2008-01-22 23:13:00 UTC (rev 11) +++ trunk/src/sat-pref-rig-editor.c 2008-01-24 18:29:33 UTC (rev 12) @@ -43,10 +43,10 @@ #include "radio-conf.h" #include "sat-pref-rig-editor.h" +#ifdef HAVE_HAMLIB +# include <hamlib/rig.h> -#include <hamlib/rig.h> - extern GtkWidget *window; /* dialog window defined in sat-pref.c */ @@ -55,6 +55,7 @@ static GtkWidget *dialog; /* dialog window */ static GtkWidget *name; /* Configuration name */ static GtkWidget *model; /* radio model, e.g. TS-2000 */ +static GtkWidget *civ; /* Icom CI-V address */ static GtkWidget *type; /* radio type */ static GtkWidget *port; /* port selector */ static GtkWidget *speed; /* serial speed selector */ @@ -75,6 +76,7 @@ GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data); +static void select_rig (guint rigid); /** \brief Add or edit a radio configuration. @@ -153,6 +155,8 @@ GtkWidget *label; GtkTreeModel *riglist; GtkCellRenderer *renderer; + gchar *buff; + guint i; table = gtk_table_new (5, 5, FALSE); @@ -197,8 +201,31 @@ is_rig_model, NULL, NULL); gtk_widget_set_tooltip_text (model, _("Click to select a radio.")); + select_rig (1); + /* ICOM CI-V adress */ + label = gtk_label_new (_("ICOM CI-V")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_table_attach_defaults (GTK_TABLE (table), label, 3, 4, 1, 2); + + civ = gtk_combo_box_new_text (); + gtk_widget_set_tooltip_text (civ, + _("Select ICOM CI-V address of the radio.")); + + /* works, but pretty lame... */ + gtk_combo_box_append_text (GTK_COMBO_BOX (civ), _("Default")); + for (i = 1; i < 0xF0; i++) { + if (i < 0x10) + buff = g_strdup_printf ("0x0%X", i); + else + buff = g_strdup_printf ("0x%X", i); + gtk_combo_box_append_text (GTK_COMBO_BOX (civ), buff); + g_free (buff); + } + gtk_combo_box_set_active (GTK_COMBO_BOX (civ), 0); + gtk_table_attach_defaults (GTK_TABLE (table), civ, 4, 5, 1, 2); + /* Type */ label = gtk_label_new (_("Type")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); @@ -282,7 +309,7 @@ gtk_table_attach_defaults (GTK_TABLE (table), rts, 4, 5, 4, 5); /* separator between port/speed and DTR/RTS */ - gtk_table_attach (GTK_TABLE (table), gtk_vseparator_new(), 2, 3, 3, 5, + gtk_table_attach (GTK_TABLE (table), gtk_vseparator_new(), 2, 3, 1, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 5, 0); if (conf->name != NULL) @@ -304,10 +331,15 @@ gtk_entry_set_text (GTK_ENTRY (name), conf->name); /* model */ + select_rig (conf->id); /* type */ gtk_combo_box_set_active (GTK_COMBO_BOX (type), conf->type); + /* port */ + gtk_combo_box_prepend_text (GTK_COMBO_BOX (port), conf->port); + gtk_combo_box_set_active (GTK_COMBO_BOX (port), 0); + /*serial speed */ switch (conf->speed) { case 300: @@ -339,6 +371,9 @@ break; } + /* CI-V */ + gtk_combo_box_set_active (GTK_COMBO_BOX (civ), conf->civ); + /* DTR and RTS lines */ gtk_combo_box_set_active (GTK_COMBO_BOX (dtr), conf->dtr); gtk_combo_box_set_active (GTK_COMBO_BOX (rts), conf->rts); @@ -354,6 +389,14 @@ static void clear_widgets () { + gtk_entry_set_text (GTK_ENTRY (name), ""); + select_rig (1); + gtk_combo_box_set_active (GTK_COMBO_BOX (type), 0); + gtk_combo_box_set_active (GTK_COMBO_BOX (port), 0); + gtk_combo_box_set_active (GTK_COMBO_BOX (speed), 4); + gtk_combo_box_set_active (GTK_COMBO_BOX (civ), 0); + gtk_combo_box_set_active (GTK_COMBO_BOX (dtr), 0); + gtk_combo_box_set_active (GTK_COMBO_BOX (rts), 0); } @@ -365,7 +408,86 @@ static gboolean apply_changes (radio_conf_t *conf) { + GtkTreeIter iter1,iter2; + GtkTreeModel *riglist; + gchar *b1,*b2; + guint id; + + + /* name */ + if (conf->name) + g_free (conf->name); + /* model */ + if (conf->model) + g_free (conf->model); + + /* iter1 is needed to construct full model name */ + gtk_combo_box_get_active_iter (GTK_COMBO_BOX (model), &iter2); + riglist = gtk_combo_box_get_model (GTK_COMBO_BOX (model)); + gtk_tree_model_iter_parent (riglist, &iter1, &iter2); + + /* build model string */ + gtk_tree_model_get (riglist, &iter1, 0, &b1, -1); + gtk_tree_model_get (riglist, &iter2, 0, &b2, -1); + conf->model = g_strconcat (b1, " ", b2, NULL); + g_free (b1); + g_free (b2); + + /* ID */ + gtk_tree_model_get (riglist, &iter2, 1, &id, -1); + conf->id = id; + + /* radio type */ + conf->type = gtk_combo_box_get_active (GTK_COMBO_BOX (type)); + + /* port / device */ + if (conf->port) + g_free (conf->port); + + conf->port = gtk_combo_box_get_active_text (GTK_COMBO_BOX (port)); + + /* CI-V */ + conf->civ = gtk_combo_box_get_active (GTK_COMBO_BOX (civ)); + + /* serial speed */ + switch (gtk_combo_box_get_active (GTK_COMBO_BOX (speed))) { + case 0: + conf->speed = 300; + break; + case 1: + conf->speed = 1200; + break; + case 2: + conf->speed = 2400; + break; + case 3: + conf->speed = 4800; + break; + case 4: + conf->speed = 9600; + break; + case 5: + conf->speed = 19200; + break; + case 6: + conf->speed = 38400; + break; + case 7: + conf->speed = 57600; + break; + case 8: + conf->speed = 115200; + break; + default: + conf->speed = 9600; + break; + } + + /* DTR and RTS */ + conf->dtr = gtk_combo_box_get_active (GTK_COMBO_BOX (dtr)); + conf->rts = gtk_combo_box_get_active (GTK_COMBO_BOX (rts)); + return TRUE; } @@ -631,3 +753,68 @@ g_object_set (cell, "sensitive", sensitive, NULL); } + + +/** \brief Select a radio in the combo box. + * \param rigid The hamlib id of the radio. + * + * This function selects the specified radio in the combobox. This is done + * by looping over all items in the tree model until a match is reached + * (or there are no more items left). + */ +static void +select_rig (guint rigid) +{ + GtkTreeIter iter1,iter2; + GtkTreeModel *riglist; + guint i,j,n,m; + guint thisrig = 0; + + + /* get the tree model */ + riglist = gtk_combo_box_get_model (GTK_COMBO_BOX (model)); + + /* get the number of toplevel nodes */ + n = gtk_tree_model_iter_n_children (riglist, NULL); + for (i = 0; i < n; i++) { + + /* get the i'th toplevel node */ + if (gtk_tree_model_iter_nth_child (riglist, &iter1, NULL, i)) { + + /* get the number of children */ + m = gtk_tree_model_iter_n_children (riglist, &iter1); + for (j = 0; j < m; j++) { + + /* get the j'th child */ + if (gtk_tree_model_iter_nth_child (riglist, &iter2, &iter1, j)) { + + /* get ID of this model */ + gtk_tree_model_get (riglist, &iter2, 1, &thisrig, -1); + + if (thisrig == rigid) { + /* select this rig and terminate loop */ + gtk_combo_box_set_active_iter (GTK_COMBO_BOX (model), &iter2); + j = m; + i = n; + } + } + else { + sat_log_log (SAT_LOG_LEVEL_BUG, + _("%s:%s: NULL child node at index %d:%d"), + __FILE__, __FUNCTION__, i, j); + + } + } + + } + else { + sat_log_log (SAT_LOG_LEVEL_BUG, + _("%s:%s: NULL toplevel node at index %d"), + __FILE__, __FUNCTION__, i); + } + } + + +} + +#endif Modified: trunk/src/sat-pref-rig-editor.h =================================================================== --- trunk/src/sat-pref-rig-editor.h 2008-01-22 23:13:00 UTC (rev 11) +++ trunk/src/sat-pref-rig-editor.h 2008-01-24 18:29:33 UTC (rev 12) @@ -31,8 +31,8 @@ #include <gtk/gtk.h> #include "radio-conf.h" - +#ifdef HAVE_HAMLIB void sat_pref_rig_editor_run (radio_conf_t *conf); +#endif - #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2008-01-22 23:12:58
|
Revision: 11 http://gpredict.svn.sourceforge.net/gpredict/?rev=11&view=rev Author: csete Date: 2008-01-22 15:13:00 -0800 (Tue, 22 Jan 2008) Log Message: ----------- Added combo box containing supported radios. Modified Paths: -------------- trunk/src/sat-pref-rig-editor.c Modified: trunk/src/sat-pref-rig-editor.c =================================================================== --- trunk/src/sat-pref-rig-editor.c 2008-01-22 19:37:12 UTC (rev 10) +++ trunk/src/sat-pref-rig-editor.c 2008-01-22 23:13:00 UTC (rev 11) @@ -44,6 +44,7 @@ #include "sat-pref-rig-editor.h" +#include <hamlib/rig.h> extern GtkWidget *window; /* dialog window defined in sat-pref.c */ @@ -53,19 +54,29 @@ /* private widgets */ static GtkWidget *dialog; /* dialog window */ static GtkWidget *name; /* Configuration name */ -static GtkWidget *model; /* radio model, e.g. Kenwood TS-2000 */ +static GtkWidget *model; /* radio model, e.g. TS-2000 */ static GtkWidget *type; /* radio type */ static GtkWidget *port; /* port selector */ static GtkWidget *speed; /* serial speed selector */ static GtkWidget *dtr,*rts; /* DTR and RTS line states */ -static GtkWidget *create_editor_widgets (radio_conf_t *conf); -static void update_widgets (radio_conf_t *conf); -static void clear_widgets (void); -static gboolean apply_changes (radio_conf_t *conf); -static void name_changed (GtkWidget *widget, gpointer data); +static GtkWidget *create_editor_widgets (radio_conf_t *conf); +static void update_widgets (radio_conf_t *conf); +static void clear_widgets (void); +static gboolean apply_changes (radio_conf_t *conf); +static void name_changed (GtkWidget *widget, gpointer data); +static GtkTreeModel *create_rig_model (void); +static gint rig_list_add (const struct rig_caps *, void *); +static gint rig_list_compare_mfg (gconstpointer, gconstpointer); +static gint rig_list_compare_mod (gconstpointer, gconstpointer); +static void is_rig_model (GtkCellLayout *cell_layout, + GtkCellRenderer *cell, + GtkTreeModel *tree_model, + GtkTreeIter *iter, + gpointer data); + /** \brief Add or edit a radio configuration. * \param conf Pointer to a radio configuration. * @@ -138,8 +149,10 @@ static GtkWidget * create_editor_widgets (radio_conf_t *conf) { - GtkWidget *table; - GtkWidget *label; + GtkWidget *table; + GtkWidget *label; + GtkTreeModel *riglist; + GtkCellRenderer *renderer; table = gtk_table_new (5, 5, FALSE); @@ -169,7 +182,22 @@ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 1, 2); - + riglist = create_rig_model (); + model = gtk_combo_box_new_with_model (riglist); + g_object_unref (riglist); + gtk_table_attach_defaults (GTK_TABLE (table), model, 1, 2, 1, 2); + + renderer = gtk_cell_renderer_text_new (); + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (model), renderer, TRUE); + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (model), renderer, + "text", 0, + NULL); + gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (model), + renderer, + is_rig_model, + NULL, NULL); + gtk_widget_set_tooltip_text (model, _("Click to select a radio.")); + /* Type */ label = gtk_label_new (_("Type")); @@ -401,4 +429,205 @@ } +/** \brief Radio info to be used when building the rig model */ +typedef struct { + gint id; /*!< Model ID. */ + gchar *mfg; /*!< Manufacurer name (eg. KENWOOD). */ + gchar *model; /*!< Radio model (eg. TS-440). */ +} rig_info_t; + +/** \brief Build tree model containing radios. + * \return A tree model where the radios are ordered according to + * manufacturer. + * + */ +static GtkTreeModel *create_rig_model () +{ + GArray *array; + rig_info_t *info; + GtkTreeIter iter1; /* iter used for manufacturer */ + GtkTreeIter iter2; /* iter used for model */ + GtkTreeStore *store; + gchar *buff; + gint status; + gint i; + + + /* create araay containing rigs */ + array = g_array_new (FALSE, FALSE, sizeof (rig_info_t)); + rig_load_all_backends(); + + /* fill list using rig_list_foreach */ + status = rig_list_foreach (rig_list_add, (void *) array); + + /* sort the array, first by model then by mfg */ + g_array_sort (array, rig_list_compare_mod); + g_array_sort (array, rig_list_compare_mfg); + + sat_log_log (SAT_LOG_LEVEL_DEBUG, + _("%s:%d: Read %d distinct radios into array."), + __FILE__, __LINE__, array->len); + + /* create a tree store with two cols (name and ID) */ + store = gtk_tree_store_new (2, G_TYPE_STRING, G_TYPE_INT); + + /* add array contents to treestore */ + for (i = 0; i < array->len; i++) { + + /* get rig info struct */ + info = &g_array_index (array, rig_info_t, i); + + if (gtk_tree_store_iter_is_valid (store, &iter1)) { + /* iter1 is valid, i.e. we already have a manufacturer */ + gtk_tree_model_get (GTK_TREE_MODEL (store), &iter1, + 0, &buff, + -1); + if (g_ascii_strcasecmp (buff, info->mfg)) { + /* mfg different, add new mfg */ + gtk_tree_store_append (store, &iter1, NULL); + gtk_tree_store_set (store, &iter1, 0, info->mfg, -1); + } + /* else: mfg are identical; nothing to do */ + } + else { + /* iter1 is not valid, so add the first manufacturer */ + gtk_tree_store_append (store, &iter1, NULL); + gtk_tree_store_set (store, &iter1, 0, info->mfg, -1); + } + + /* iter1 points to the parent mfg; insert this rig */ + gtk_tree_store_append (store, &iter2, &iter1); + gtk_tree_store_set (store, &iter2, + 0, info->model, + 1, info->id, + -1); + + /* done with this model */ + g_free (info->mfg); + g_free (info->model); + } + + g_array_free (array,TRUE); + + return GTK_TREE_MODEL (store); +} + + +/** \brief Add new entry to list of radios. + * \param caps Structure with the capablities of thecurrent radio. + * \param array Pointer to the GArray into which the new entry should be + * stored. + * \return Always 1 to keep rig_list_foreach running. + * + * This function is called by the rig_list_foreach hamlib function for each + * supported radio. It copies the relevant data into a grig_rig_info_t + * structure and adds the new entry to the GArray containing the list of + * supported radios. + * + * \sa rig_list_compare + */ +static gint +rig_list_add (const struct rig_caps *caps, void *array) +{ + rig_info_t *info; + + /* create new entry */ + info = g_malloc (sizeof (rig_info_t)); + + /* fill values */ + info->id = caps->rig_model; + info->mfg = g_strdup (caps->mfg_name); + info->model = g_strdup (caps->model_name); + + /* append new element to array */ + array = (void *) g_array_append_vals ((GArray *) array, info, 1); + + /* keep on running */ + return 1; +} + + + +/** \brief Compare two rig info entries. + * \param a Pointer to the first entry. + * \param b Pointer to the second entry. + * \return Negative value if a < b; zero if a = b; positive value if a > b. + * + * This function is used to compare two rig entries in the list of radios + * when the list is sorted. It compares the manufacturer of the two radios. + * + * \sa rig_list_add + */ +static gint +rig_list_compare_mfg (gconstpointer a, gconstpointer b) +{ + gchar *ida, *idb; + + ida = ((rig_info_t *) a)->mfg; + idb = ((rig_info_t *) b)->mfg; + + if (g_ascii_strcasecmp(ida,idb) < 0) { + return -1; + } + else if (g_ascii_strcasecmp(ida,idb) > 0) { + return 1; + } + else { + return 0; + } + +} + + + +/** \brief Compare two rig info entries. + * \param a Pointer to the first entry. + * \param b Pointer to the second entry. + * \return Negative value if a < b; zero if a = b; positive value if a > b. + * + * This function is used to compare two rig entries in the list of radios + * when the list is sorted. It compares the model of the two radios. + * + * \sa rig_list_add + */ +static gint +rig_list_compare_mod (gconstpointer a, gconstpointer b) +{ + gchar *ida, *idb; + + ida = ((rig_info_t *) a)->model; + idb = ((rig_info_t *) b)->model; + + if (g_ascii_strcasecmp(ida,idb) < 0) { + return -1; + } + else if (g_ascii_strcasecmp(ida,idb) > 0) { + return 1; + } + else { + return 0; + } + +} + + +/** \brief Set cell sensitivity. + * + * This function is used to disable the sensitive of manifacturer entries + * as children. Otherwise, the manufacturer would appear as the first entry + * in a submenu. + * */ +static void +is_rig_model (GtkCellLayout *cell_layout, + GtkCellRenderer *cell, + GtkTreeModel *tree_model, + GtkTreeIter *iter, + gpointer data) +{ + gboolean sensitive; + + sensitive = !gtk_tree_model_iter_has_child (tree_model, iter); + + g_object_set (cell, "sensitive", sensitive, NULL); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2008-01-22 19:37:07
|
Revision: 10 http://gpredict.svn.sourceforge.net/gpredict/?rev=10&view=rev Author: csete Date: 2008-01-22 11:37:12 -0800 (Tue, 22 Jan 2008) Log Message: ----------- Added check for hamlib. Modified Paths: -------------- trunk/configure.ac Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2008-01-21 22:34:23 UTC (rev 9) +++ trunk/configure.ac 2008-01-22 19:37:12 UTC (rev 10) @@ -39,6 +39,18 @@ ]) +dnl check for hamlib +PKG_CHECK_MODULES(HAMLIB, hamlib, [ + CFLAGS="$CFLAGS $HAMLIB_CFLAGS"; + LIBS="$LIBS $HAMLIB_LIBS"; + havehamlib=true; + AC_DEFINE(HAVE_HAMLIB, 1, [Define if hamlib is available]) + ], [ + havehamlib=false; + AC_DEFINE(HAVE_HAMLIB, 0, [Define if hamlib is unvailable]) + +]) + dnl Add the languages which your application supports here. dnl Note that other progs only have ALL_LINGUAS and AM_GLIB_GNU_GETTEXT ALL_LINGUAS= @@ -67,6 +79,9 @@ if test "$havecurl" = true ; then CURL_V=`pkg-config --modversion libcurl` fi +if test "$havehamlib" = true ; then + HAML_V=`pkg-config --modversion hamlib` +fi AC_SUBST(CFLAGS) @@ -103,6 +118,11 @@ else echo Curl version....... : none fi +if test "$havehamlib" = true ; then +echo Hamlib version..... : $HAML_V +else +echo Hamlib version..... : none +fi echo Enable coverage.... : $enable_coverage echo This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2008-01-21 22:34:18
|
Revision: 9 http://gpredict.svn.sourceforge.net/gpredict/?rev=9&view=rev Author: csete Date: 2008-01-21 14:34:23 -0800 (Mon, 21 Jan 2008) Log Message: ----------- Updated. Modified Paths: -------------- trunk/ChangeLog trunk/src/sat-pref-rig-data.h Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-01-21 22:33:57 UTC (rev 8) +++ trunk/ChangeLog 2008-01-21 22:34:23 UTC (rev 9) @@ -2,8 +2,15 @@ * src/radio-conf.[ch]: Added parameter for radio type (RX, TX, TRX, FULL_DUPL). +2008-01-21; Alexandru Csete <oz...@gm...> + + * src/radio-conf.[ch], src/sat-pref-rig.c: + Removed manufacturer field. Will be part of the model. + * src/sat-pref-rig-editor.c: + Added all widgets except the rig model selector. + 2008-01-01; Alexandru Csete <oz...@gm...> * src/compat.[ch]: Modified: trunk/src/sat-pref-rig-data.h =================================================================== --- trunk/src/sat-pref-rig-data.h 2008-01-21 22:33:57 UTC (rev 8) +++ trunk/src/sat-pref-rig-data.h 2008-01-21 22:34:23 UTC (rev 9) @@ -31,7 +31,6 @@ /** \brief Coumn definitions for radio list. */ typedef enum { RIG_LIST_COL_NAME = 0, /*!< File name. */ - RIG_LIST_COL_COMP, /*!< Company, e.g. Yaesu. */ RIG_LIST_COL_MODEL, /*!< Model, e.g. FT-847. */ RIG_LIST_COL_ID, /*!< Hamlib ID. */ RIG_LIST_COL_TYPE, /*!< Radio type (RX, TX, TRX, FULL_DUP. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |