[Gpredict-svn] SF.net SVN: gpredict:[214] trunk
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
|
From: <cs...@us...> - 2009-03-29 20:00:50
|
Revision: 214
http://gpredict.svn.sourceforge.net/gpredict/?rev=214&view=rev
Author: csete
Date: 2009-03-29 20:00:44 +0000 (Sun, 29 Mar 2009)
Log Message:
-----------
Added files for transpoder data file I/O.
Modified Paths:
--------------
trunk/po/POTFILES.in
trunk/src/Makefile.am
Added Paths:
-----------
trunk/src/trsp-conf.c
trunk/src/trsp-conf.h
Modified: trunk/po/POTFILES.in
===================================================================
--- trunk/po/POTFILES.in 2009-03-22 11:48:22 UTC (rev 213)
+++ trunk/po/POTFILES.in 2009-03-29 20:00:44 UTC (rev 214)
@@ -103,3 +103,4 @@
src/save-pass.c
src/tle-tools.c
src/tle-update.c
+src/trsp-conf.c
Modified: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am 2009-03-22 11:48:22 UTC (rev 213)
+++ trunk/src/Makefile.am 2009-03-29 20:00:44 UTC (rev 214)
@@ -71,6 +71,7 @@
qth-editor.c qth-editor.h \
radio-conf.c radio-conf.h \
rotor-conf.c rotor-conf.h \
+ trsp-conf.c trsp-conf.h \
sat-cfg.c sat-cfg.h \
sat-info.c sat-info.h \
sat-log.c sat-log.h \
Added: trunk/src/trsp-conf.c
===================================================================
--- trunk/src/trsp-conf.c (rev 0)
+++ trunk/src/trsp-conf.c 2009-03-29 20:00:44 UTC (rev 214)
@@ -0,0 +1,78 @@
+/* -*- 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-2008 Alexandru Csete.
+
+ Authors: Alexandru Csete <oz...@gm...>
+
+ Comments, questions and bugreports should be submitted via
+ http://sourceforge.net/projects/gpredict/
+ More details can be found at the project home page:
+
+ http://gpredict.oz9aec.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 "trsp-conf.h"
+
+#define KEY_UP_LOW "UP_LOW"
+#define KEY_UP_HIGH "UP_HIGH"
+#define KEY_DOWN_LOW "DOWN_LOW"
+#define KEY_DOWN_HIGH "DOWN_HIGH"
+#define KEY_INV "INVERT"
+
+
+GSList *read_tranponders (guint catnum)
+{
+ GKeyFile *cfg = NULL;
+ GError *error = NULL;
+ gchar *name,*fname,*confdir;
+
+ name = g_strdup_printf ("%d.tsrp", catnum);
+ confdir = get_conf_dir();
+ fname = g_strconcat (confdir, G_DIR_SEPARATOR_S,
+ "trsp", G_DIR_SEPARATOR_S,
+ name, NULL);
+
+ cfg = g_key_file_new ();
+ if (!g_key_file_load_from_file (cfg, fname, G_KEY_FILE_KEEP_COMMENTS, &error)) {
+ sat_log_log (SAT_LOG_LEVEL_ERROR,
+ _("%s: Error reading %s: %s"),
+ __FILE__, fname, error->message);
+ g_clear_error (&error);
+ g_key_file_free (cfg);
+ }
+
+ g_key_file_free (cfg);
+ g_free (name);
+ g_free (confdir);
+ g_free (fname);
+
+
+ return NULL;
+}
+
+void write_transponders (guint catnum, GSList *transp)
+{
+
+}
+
Added: trunk/src/trsp-conf.h
===================================================================
--- trunk/src/trsp-conf.h (rev 0)
+++ trunk/src/trsp-conf.h 2009-03-29 20:00:44 UTC (rev 214)
@@ -0,0 +1,52 @@
+/* -*- 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-2008 Alexandru Csete.
+
+ Authors: Alexandru Csete <oz...@gm...>
+
+ Comments, questions and bugreports should be submitted via
+ http://sourceforge.net/projects/gpredict/
+ More details can be found at the project home page:
+
+ http://gpredict.oz9aec.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 TRSP_CONF_H
+#define TRSP_CONF_H 1
+
+#include <glib.h>
+
+/* NOTE For beacons uplow=uphigh=0 and downlow=downhigh */
+typedef struct {
+ gchar *name; /*!< The name of the transponder (same as config group) */
+ gdouble uplow; /*!< Lower limit of uplink. */
+ gdouble uphigh; /*!< Upper limit of uplink. */
+ gdouble downlow; /*!< Lower limit of downlink. */
+ gdouble downhigh; /*!< Upper limit of donlink. */
+ gboolean invert; /*!< Flag indicating whether transponder is inverting. */
+} trsp_t;
+
+/* The actual data would then be a singly linked list with pointers to transponder_t structures */
+
+GSList *read_tranponders (guint catnum);
+void write_transponders (guint catnum, GSList *transp);
+
+
+
+#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|