Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

GUILevel.hh

Go to the documentation of this file.
00001 /*
00002 
00003     GUI for level server, header
00004     Copyright (C) 2000-2002 Jussi Laako
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 
00020 */
00021 
00022 
00023 #include <gtk/gtk.h>
00024 
00025 #include <Alloc.hh>
00026 
00027 #include "Config.h"
00028 #include "CfgFile.hh"
00029 #include "GtkUtils.hh"
00030 #include "Messages.hh"
00031 #include "SockClie.hh"
00032 #include "SockOp.hh"
00033 
00034 
00035 #ifndef GUILEVEL_HH
00036     #define GUILEVEL_HH
00037 
00038     #define GUILEV_VER_MAJ          GLOBAL_VERSMAJ
00039     #define GUILEV_VER_MIN          GLOBAL_VERSMIN
00040     #define GUILEV_VER_PL           GLOBAL_VERSPL
00041     #define GUILEV_WSPACING         8
00042     #define GUILEV_ENTRY_WIDTH      80
00043     #define GUILEV_SOFAR_WIDTH      600
00044     #define GUILEV_SOFAR_HEIGHT     100
00045     #define GUILEV_SERVER_MAXLEN    256
00046     #define GUILEV_CH_LOWER         1
00047     #define GUILEV_CH_UPPER         16
00048     #define GUILEV_LINE_BG          0x00ffffff
00049     #define GUILEV_LINE_FG          0x000000ff
00050 
00051     #define GUILEV_ALGORITHM_ITEMS  5
00052 
00053 
00057     class clGUILevel
00058     {
00059             bool bRun;
00060             bool bConnected;
00061             bool bFirstResult;
00062             int iBeamCount;
00063             long lResultPos;
00064             long lResultCount;
00065             float fDisplayLow;
00066             float fDisplayHigh;
00067             char cpResultBuf[GLOBAL_HEADER_LEN];
00068             stLevelReq sRequest;
00069             stpLevelRes spResults;
00070             /* glib types */
00071             guint guSbCtxt;
00072             gint iGdkInputTag;
00073             GList *glServer;
00074             /* --- === --- */
00075             /* Gdk types */
00076             GdkGC *ggcSofarBG;
00077             GdkGC *ggcSofarFG;
00078             GdkCursor *gcCrossHair;
00079             /* --- === --- */
00080             /* Gtk+ widgets */
00081             // Top level
00082             GtkWidget *gwWindow;
00083             GtkWidget *gwVBox;
00084             GtkWidget *gwStatusBar;
00085             // Table 1
00086             GtkWidget *gwTable1;
00087             GtkWidget *gwLServer;
00088             GtkWidget *gwCServer;
00089             GtkWidget *gwLChannel;
00090             GtkObject *goAChannel;
00091             GtkWidget *gwSBChannel;
00092             GtkWidget *gwBConnect;
00093             // Table 2
00094             GtkWidget *gwTable2;
00095             GtkWidget *gwLAlgorithm;
00096             GtkWidget *gwOMAlgorithm;
00097             GtkWidget *gwMAlgorithm;
00098             GtkWidget *gwaMIAlgorithm[GUILEV_ALGORITHM_ITEMS];
00099             GtkWidget *gwLIntegrationTime;
00100             GtkWidget *gwEIntegrationTime;
00101             GtkWidget *gwLLowFrequency;
00102             GtkWidget *gwELowFrequency;
00103             GtkWidget *gwLHighFrequency;
00104             GtkWidget *gwEHighFrequency;
00105             GtkWidget *gwLDisplayLow;
00106             GtkWidget *gwEDisplayLow;
00107             GtkWidget *gwLDisplayHigh;
00108             GtkWidget *gwEDisplayHigh;
00109             // Sofar
00110             GtkWidget *gwTableSofar;
00111             GtkWidget *gwHRTime;
00112             GtkWidget *gwVRLevel;
00113             GtkWidget *gwDASofar;
00114             /* --- === --- */
00115             //clAlloc ResultsBuf;
00116             clCfgFile CfgFile;
00117             clGtkUtils GtkUtils;
00118             clSockClie SClient;
00119             clSockOp SOp;
00120             clLevelMsg Msg;
00121             bool GetCfg ();
00122             bool Build ();
00123             bool BuildTable1 ();
00124             bool BuildTable2 ();
00125             bool BuildSofar ();
00126             bool ConnectSignals ();
00127             bool BuildDrawingPrims ();
00128             bool ConnectToServer (const char *, int);
00129             bool SendSettings ();
00130             void DisplayResults ();
00131             void InitializeDisplay ();
00132         public:
00133             clGUILevel ();
00134             ~clGUILevel ();
00135             int Main (int *, char ***);
00136             gboolean OnDelete (GtkWidget *, GdkEvent *, gpointer);
00137             void OnConnectClick (GtkButton *, gpointer);
00138             gboolean OnSofarExpose (GtkWidget *, GdkEventExpose *, gpointer);
00139             gboolean OnSofarMotion (GtkWidget *, GdkEventMotion *, gpointer);
00140             gboolean OnSofarConfigure (GtkWidget *, GdkEventConfigure *, 
00141                 gpointer);
00142             void OnGdkInput (gpointer, gint, GdkInputCondition);
00143     };
00144 
00145 #endif
00146 

Generated on Sun Oct 26 19:11:20 2003 for HASAS by doxygen 1.3.3