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

Locate.hh

Go to the documentation of this file.
00001 /*
00002 
00003     Algorithm for locating sound sources in array field
00004     Copyright (C) 2000-2001 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 <Alloc.hh>
00024 #include <Condition.hh>
00025 #include <Mutex.hh>
00026 #include <dsp/DSPOp.hh>
00027 
00028 #include "Config.h"
00029 #include "CfgFile.hh"
00030 #include "Cluster.hh"
00031 #include "LocateSensor.hh"
00032 #include "LocateSystem.hh"
00033 #include "LogFile.hh"
00034 #include "Messages.hh"
00035 #include "SockClie.hh"
00036 #include "SockOp.hh"
00037 #include "SockServ.hh"
00038 
00039 
00040 #ifndef LOCATE_HH
00041     #define LOCATE_HH
00042 
00043     #define LOCATE_HOSTNAME_MAXLEN      256
00044     #define LOCATE_CONTROL_TAG          1
00045     #define LOCATE_PARAM_TAG            2
00046     #define LOCATE_NORMAL_TAG           3
00047 
00048     #define LOCATE_CTRL_ACK             0
00049     #define LOCATE_CTRL_STOP            1
00050 
00051 
00055     typedef struct _stDirCfg
00056     {
00057         long lWindowSize;
00058         float fSoundSpeed;
00059         float fLowFrequency;
00060         float fIntegrationTime;
00061         int iScaling;
00062         float fScalingExp;
00063         int iRemoveNoise;
00064         float fAlpha;
00065         long lMeanLength;
00066         long lGapLength;
00067     } stDirCfg, *stpDirCfg;
00068     
00069 
00073     class clLocate
00074     {
00075             volatile bool bRun;
00076             int iSensorCount;
00077             int iPort;
00078             int iMsgSize;
00079             long lWidth;
00080             long lHeight;
00081             GDT fWeight;
00082             GDT *fpLocMatrix;
00083             stDirCfg sDirCfg;
00084             clAlloc LocMatrix;
00085             clAlloc ResMsg;
00086             clCondition CndResMsg;
00087             clMutex MtxResMsg;
00088             clCfgFile Cfg;
00089             clDSPOp DSP;
00090             clLogFile Log;
00091             clLocateMsg Msg;
00092             clMPIComm MPICCtrl;
00093             clMPIComm MPICParam;
00094             clMPIComm MPICNormal;
00095             bool Initialize ();
00096             void SendParams (int, const char *, int, long, long, float);
00097         public:
00098             clLocate ();
00099             ~clLocate ();
00100             int Main (int, char **);
00101             void Stop ();
00102             void *ProcessThread (void *);
00103             void *ServeClientThread (void *);
00104     };
00105 
00106 
00110     class clSubLocate
00111     {
00112             int iHostPort;
00113             int iDirMsgSize;
00114             long lWidth;
00115             long lHeight;
00116             long lPosX;
00117             long lPosY;
00118             float fAzimuth;
00119             char cpHostName[LOCATE_HOSTNAME_MAXLEN];
00120             GDT *fpLevRes;
00121             GDT *fpDirRes;
00122             stDirCfg sDirCfg;
00123             clAlloc DirMsg;
00124             clAlloc LevRes;
00125             clAlloc DirRes;
00126             clLocateSensor LocSens;
00127             clMPIComm MPICCtrl;
00128             clMPIComm MPICParam;
00129             clMPIComm MPICNormal;
00130             clDirMsg2 Msg;
00131             clSockOp SOp;
00132             bool RecvParams ();
00133             bool Initialize ();
00134             bool ConnectDir ();
00135         public:
00136             clSubLocate ();
00137             ~clSubLocate ();
00138             int Main (int, char **);
00139     };
00140 
00141 #endif
00142 

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