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

BeamSrv2.hh

Go to the documentation of this file.
00001 /*
00002 
00003     Beamforming input server
00004     Copyright (C) 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 #include <Alloc.hh>
00023 #include <Condition.hh>
00024 #include <Mutex.hh>
00025 #include <Semaphore.hh>
00026 
00027 #include <dsp/DSPOp.hh>
00028 #include <dsp/RecDecimator.hh>
00029 
00030 #include "Config.h"
00031 #include "LocalMsg.h"
00032 #include "CfgFile.hh"
00033 #include "FreqBeamDipole.hh"
00034 #include "FreqBeamLine.hh"
00035 #include "LogFile.hh"
00036 #include "Messages.hh"
00037 #include "SockClie.hh"
00038 #include "SockOp.hh"
00039 #include "SockServ.hh"
00040 
00041 #include "BeamCommon.hh"
00042 
00043 
00044 #ifndef BEAMSRV2_HH
00045 #define BEAMSRV2_HH
00046 
00047 #   define BS_TAG_READY     1
00048 #   define BS_TAG_RES       2
00049 
00050 
00052     bool BeamCommNodeParams (stBeamNodeParams &);
00053     bool BeamCommInData (GDT *, int);
00054 
00055 
00063     class clBeamSrv2Master
00064     {
00065             int iFilterType;
00066             int iDecimate;
00067             int iDecFact;
00068             int iChOffset;
00069             int iOutDataCount;
00070             char cpLogBuf[BS_LOGBUFSIZE];
00071             stRawDataFirst sInHdr;
00072             stBeamNodeParams sNodeParams;
00073             clAlloc FiltWork;
00074             clCfgFile Cfg;
00075             clDSPOp DSP;
00076             clLogFile Log;
00077             clRecDecimator *FilterBank;
00078             clSockOp SOpIn;
00079             clSockServ SServ;
00080             /* Input data, thread shared */
00081             clReBuffer InBuf;
00082             clSemaphore SemIn;
00083             clMutex MtxIn;
00084             /* Output data, thread shared */
00085             clAlloc OutData;
00086             clCondition CndOut;
00087             clMutex MtxOut;
00088             /* - */
00089             bool ReadConfig ();
00090             bool InitFilterBank ();
00091             bool InitProcessing ();
00092             bool WaitReady ();
00093             void ProcessLoop ();
00094             void CompactData (GDT *, const GDT *, long, long, long, long);
00095             bool FilterData (GDT *, const GDT *, long, long, long, long);
00096         public:
00097             clBeamSrv2Master ();
00098             ~clBeamSrv2Master ();
00099             int Main (int *, char ***);
00100             static void Abort (int = 0);
00101             void *InDataThread (void *);
00102             void *ServerThread (void *);
00103             void *ServeClientThread (void *);
00104     };
00105 
00106 
00112     class clBeamSrv2Slave
00113     {
00114             int iRank;
00115             stBeamNodeParams sNodeParams;
00116             clFreqBeamDipole FBDipole;
00117             clFreqBeamLine FBLine;
00118             bool SendReady ();
00119             bool SendRes (GDT *, int);
00120         public:
00121             clBeamSrv2Slave (int);
00122             ~clBeamSrv2Slave ();
00123             int Main (int *, char ***);
00124     };
00125 
00126 #endif

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