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

GUIDir.hh

Go to the documentation of this file.
00001 /*
00002 
00003     Direction finding GUI
00004     Copyright (C) 1999-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 <ctime>
00024 #include <string>
00025 
00026 #include <Alloc.hh>
00027 #include <dsp/DSPOp.hh>
00028 
00029 #include "Config.h"
00030 #include "CfgFile.hh"
00031 #include "FrameBuf.hh"
00032 #include "GtkUtils.hh"
00033 #include "Messages.hh"
00034 #include "SockClie.hh"
00035 #include "SockOp.hh"
00036 
00037 
00038 #ifndef GUIDIR_HH
00039     #define GUIDIR_HH
00040 
00041     #define DGUI_VER_MAJ            GLOBAL_VERSMAJ
00042     #define DGUI_VER_MIN            GLOBAL_VERSMIN
00043     #define DGUI_VER_PL             GLOBAL_VERSPL
00044     #define DGUI_PADDING            8
00045     #define DGUI_ENTRY_WIDTH        80
00046     #define DGUI_SERVER_MAXLEN      255
00047     #define DGUI_WORM_BG            0x00ffffff
00048     #define DGUI_WORM_FG            0x00000000
00049     #define DGUI_CONV_BUF_SIZE      255
00050 
00051     #define DGUI_ALGORITHM_ITEMS    4
00052     #define DGUI_SCALING_ITEMS      4
00053     #define DGUI_REMOVE_NOISE_ITEMS 5
00054     #define DGUI_PALETTE_ITEMS      9
00055 
00056 
00060     enum
00061     {
00062         DGUI_PAL_BW = 0,
00063         DGUI_PAL_HSV = 1,
00064         DGUI_PAL_LIGHT = 2,
00065         DGUI_PAL_TEMP = 3,
00066         DGUI_PAL_DIR = 4,
00067         DGUI_PAL_GREEN = 5,
00068         DGUI_PAL_GREEN2 = 6,
00069         DGUI_PAL_PUREGREEN = 7,
00070         DGUI_PAL_WB = 8
00071     };
00072 
00073 
00077     class clGUIDir
00078     {
00079             /* Variables */
00080             volatile bool bRun;
00081             volatile bool bConnected;
00082             volatile bool bFreezed;
00083             bool bSaving;
00084             int iSockH;
00085             int iDirectionScale;
00086             int iHistoryLines;
00087             int iPalette;
00088             int iClips;
00089             int iWormWidth;
00090             int iWormHeight;
00091             int iCursorX;
00092             int iCursorY;
00093             int iTIFFCompression;
00094             int iJPEGQuality;
00095             int iCompressMode;
00096             int iContSaveScans;
00097             int iScanCount;
00098             int iImgCount;
00099             long lResultMsgBufSize;
00100             long lResultCount;
00101             float fSoundSpeed;
00102             float fLeftDirDeg;
00103             float fRightDirDeg;
00104             GDT fIntegrationTime;
00105             stDirReq sDirRq;
00106             stDirRes sResultHeader;
00107             /* glib types */
00108             GList *glServers;
00109             /* gtk+ types */
00110             gint giGdkTag;
00111             guint guSbCtxt;
00112             // Top level
00113             GtkWidget *gwWindow;
00114             GtkWidget *gwVBox;
00115             GtkWidget *gwCBHide;
00116             GtkWidget *gwStatusBar;
00117             // Table 1
00118             GtkWidget *gwTable1;
00119             GtkWidget *gwLServer;
00120             GtkWidget *gwCServer;
00121             GtkWidget *gwBConnect;
00122             GtkWidget *gwBDisconnect;
00123             GtkWidget *gwCBFreeze;
00124             // Table 2
00125             GtkWidget *gwTable2;
00126             GtkWidget *gwLAlgorithm;
00127             GtkWidget *gwOMAlgorithm;
00128             GtkWidget *gwMAlgorithm;
00129             GtkWidget *gwaMIAlgorithm[DGUI_ALGORITHM_ITEMS];
00130             GtkWidget *gwLSoundSpeed;
00131             GtkWidget *gwESoundSpeed;
00132             GtkWidget *gwLLowFrequencyLimit;
00133             GtkWidget *gwELowFrequencyLimit;
00134             GtkWidget *gwLIntegrationTime;
00135             GtkWidget *gwEIntegrationTime;
00136             // Table 3
00137             GtkWidget *gwTable3;
00138             GtkWidget *gwLScaling;
00139             GtkWidget *gwOMScaling;
00140             GtkWidget *gwMScaling;
00141             GtkWidget *gwaMIScaling[DGUI_SCALING_ITEMS];
00142             GtkWidget *gwLScalingExponent;
00143             GtkWidget *gwEScalingExponent;
00144             GtkWidget *gwLRemoveNoise;
00145             GtkWidget *gwOMRemoveNoise;
00146             GtkWidget *gwMRemoveNoise;
00147             GtkWidget *gwaMIRemoveNoise[DGUI_REMOVE_NOISE_ITEMS];
00148             GtkWidget *gwLAlpha;
00149             GtkWidget *gwEAlpha;
00150             GtkWidget *gwLMeanLength;
00151             GtkWidget *gwEMeanLength;
00152             GtkWidget *gwLGapLength;
00153             GtkWidget *gwEGapLength;
00154             GtkWidget *gwCBNoFilter;
00155             GtkWidget *gwCBNormalize;
00156             GtkWidget *gwLPalette;
00157             GtkWidget *gwOMPalette;
00158             GtkWidget *gwMPalette;
00159             GtkWidget *gwaMIPalette[DGUI_PALETTE_ITEMS];
00160             // Table 4
00161             GtkWidget *gwTable4;
00162             GtkWidget *gwLLeftDirection;
00163             GtkWidget *gwELeftDirection;
00164             GtkWidget *gwLRightDirection;
00165             GtkWidget *gwERightDirection;
00166             GtkWidget *gwLSectorCount;
00167             GtkWidget *gwESectorCount;
00168             GtkWidget *gwLDirectionScale;
00169             GtkWidget *gwEDirectionScale;
00170             GtkWidget *gwCBSaving;
00171             GtkWidget *gwBSave;
00172             GtkWidget *gwFSSave;
00173             // Table worm
00174             GtkWidget *gwTableWorm;
00175             GtkWidget *gwHRDirection;
00176             GtkWidget *gwVRTime;
00177             GtkWidget *gwDAWorm;
00178             // Drawing primitives and cursors
00179             GdkGC *ggcWormBG;
00180             GdkGC *ggcWormFG;
00181             GdkCursor *gcCrossHair;
00182             /* Classes */
00183             std::string strImgFileName;
00184             clAlloc Results;
00185             clAlloc ResultMsgBuf;
00186             clAlloc ScaledResults;
00187             clCfgFile *Cfg;
00188             clFrameBuf FBDir;
00189             clGtkUtils GtkUtils;
00190             clSockClie SClient;
00191             clSockOp *SOp;
00192             clDirMsg DirMsg;
00193             clDSPOp DSP;
00194             /* Methods */
00195             bool Build ();
00196             bool ConnectSignals ();
00197             bool BuildTable1 ();
00198             bool BuildTable2 ();
00199             bool BuildTable3 ();
00200             bool BuildTable4 ();
00201             bool BuildTableWorm ();
00202             bool BuildDrawingPrims ();
00203             void FreeDrawingPrims ();
00204             bool ParseServerStr (char *, int *, const char *);
00205             bool InitConnection (const char *, int);
00206             void GetSettings ();
00207             bool SendSettings ();
00208             void PrintStatus ();
00209             void SaveInfo (const char *, time_t);
00210             void StartNewImgFile ();
00211         public:
00212             clGUIDir (int *, char ***);
00213             ~clGUIDir ();
00214             int Exec ();
00215             // Event handlers
00216             gint OnDelete (GtkWidget *, GdkEventAny *);
00217             void OnHideToggled (GtkToggleButton *, gpointer);
00218             gint OnConnectClick (GtkWidget *, gpointer gpData);
00219             void OnFreezeToggled (GtkToggleButton *, gpointer);
00220             gint OnExposeWorm (GtkWidget *, GdkEventExpose *);
00221             gint OnMotionWorm (GtkWidget *, GdkEventMotion *);
00222             gint OnPaletteActivate (GtkWidget *, gpointer);
00223             void OnSaveClicks (GtkWidget *, gpointer);
00224             void OnGdkInput (gpointer, gint, GdkInputCondition);
00225     };
00226 
00227 #endif
00228 

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