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

Direction.hh

Go to the documentation of this file.
00001 /*
00002 
00003     Direction calculation
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 <pthread.h>
00024 #include <time.h>
00025 #include <sys/time.h>
00026 
00027 #include <Alloc.hh>
00028 #include <Condition.hh>
00029 #include <Mutex.hh>
00030 #include <dsp/DSPOp.hh>
00031 
00032 #include "Config.h"
00033 #include "LocalMsg.h"
00034 #define AB_COMPILE
00035 #include "ArrayBase.hh"
00036 #include "ArrayDipole.hh"
00037 #include "BeamDipole.hh"
00038 #include "CorrDipole.hh"
00039 #include "CfgFile.hh"
00040 #include "Messages.hh"
00041 #include "RemoveNoise.hh"
00042 #include "SockClie.hh"
00043 #include "SockOp.hh"
00044 
00045 
00046 #ifndef DIRECTION_HH
00047     #define DIRECTION_HH
00048 
00049 
00053     enum
00054     {
00055         DIR_ARRAY_TYPE_DIPOLE = 0,
00056         DIR_ARRAY_TYPE_TRIANGLE = 1,
00057         DIR_ARRAY_TYPE_LINE = 2,
00058         DIR_ARRAY_TYPE_PLANE = 3,
00059         DIR_ARRAY_TYPE_CYLINDER = 4,
00060         DIR_ARRAY_TYPE_SPHERE = 5
00061     };
00062 
00063 
00067     class clDirection
00068     {
00069             // Variables
00070             volatile bool bRun;
00071             volatile bool bConnected;
00072             int iProcessorCount;
00073             int iStartChannel;
00074             int iArrayType;
00075             int iShadingType;
00076             int iHorizSensors;
00077             int iVertSensors;
00078             int iRawBufSize;
00079             volatile int iResultsRefCount;
00080             long lWindowSize;
00081             double dTimingReal;
00082             GDT fSensorSpacing;
00083             GDT fpHorizSpacing[BF_MAX_X_SENSORS];
00084             GDT fpVertSpacing[BF_MAX_Y_SENSORS];
00085             clock_t ctTiming;
00086             pthread_t tidReceiveData;
00087             pthread_t tidpProcessData[DIR_MAX_CPUS];
00088             pthread_t tidSendResults;
00089             // Structures
00090             stDirReq sDirRequest;
00091             stDirRes sDirResHdr;
00092             stRawDataFirst sDataFirst;
00093             // Classes
00094             clCondition CndDataReady;
00095             clCondition CndResultsReady;
00096             clMutex MtxClassData;
00097             clMutex MtxDataReady;
00098             clMutex MtxResultsReady;
00099             clCfgFile *CfgStreamDist;
00100             clCfgFile *CfgDirection;
00101             clSockClie SClient;
00102             clSockOp *SOpRequest;
00103             clSockOp *SOpResult;
00104             clSockOp *SOpData;
00105             clDirMsg DirMsg;
00106             clDSPAlloc RawData;
00107             clDSPAlloc DirResData;
00108             clDSPOp DSP;
00109             clRemoveNoise NoiseEstRem;
00110             clArrayDipole ArDipole;
00111             clBeamDipole *BeDipole[DIR_MAX_CPUS];
00112             clCorrDipole *CoDipole[DIR_MAX_CPUS];
00113             // Methods
00114             bool GetRequest ();
00115             bool GetFirstMsg ();
00116             bool InitArray ();
00117             void Stop ();
00118             void Scale (GDT *);
00119             void CalcDipoleBeams (int, long, long, bool);
00120             void CalcDipoleCorrs (int, long, long, bool);
00121             void StartTiming ();
00122             void StopTiming ();
00123         public:
00124             clDirection (int, int);
00125             ~clDirection ();
00129             int Exec ();
00133             void *ReceiveData (void *);
00137             void *ProcessData (void *);
00141             void *SendResults (void *);
00142     };
00143 
00144 #endif
00145 

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