fdhwlib  2.0.25
/home/kopmann/git-mirror/fdhwlib/fdhwlib/katrinhw4/subrackkatrin.h
Go to the documentation of this file.
00001 /***************************************************************************
00002     subracksatrin.h      -  description
00003 
00004     begin                : Sep 21 2009
00005     copyright            : (C) 2000 by Till Bergmann
00006     email                : bergmann@ipe.fzk.de
00007  ***************************************************************************/
00008 
00009 
00010 #ifndef _HW4_SUBRACKKATRIN_H_INCLUDED
00011 #define _HW4_SUBRACKKATRIN_H_INCLUDED
00012 
00013 
00014 #define SUBRACK_VER 100
00015 
00016 #include <cstdio>
00017 
00018 #include <akutil/akinifile.h>
00019 
00020 #include <Hw/subrackbase.h>
00021 #include <katrinhw4/sltkatrin.h>
00022 #include <katrinhw4/fltkatrin.h>
00023 
00024 
00415 class SimpleSocket;
00416 
00417 
00418 //namespace katrinhw4 {  //TODO: do I need a new namespace? -tb-
00419 namespace hw4 {
00420 
00421 class SltKatrin;
00422 class FltKatrin;
00423 
00424 
00425 
00435 class SubrackKatrin : public SubrackBase {
00436 
00437 public:
00445   SubrackKatrin(const char *inifile="FE.ini",int mode=0);
00446 
00447   ~SubrackKatrin();
00448 
00452   int readExpectedConfig(const char *config, const char *configdir);
00453 
00454   void printConfigToInifile(const char *config, const char *configdir);
00455 
00464     int checkConfig();
00465 
00469   void reset();
00470 
00474   void configure();
00475 
00476 
00500   void init(FILE *fout, char *inifile);
00501 
00506 #ifdef __linux__
00507   int handleErrors();
00508 #endif
00509 
00512 #ifdef __linux__
00513   int closeHandler();
00514 #endif
00515 
00516   SltKatrin * theSlt;
00517 
00518   FltKatrin * theFlt[20];
00519 
00520 
00521 //protected:
00523   int initIRHandler(const char *inifile="");
00524 
00526   int closeIRHandler();
00527 
00529   int waitForInterrupt(unsigned long *irVector);
00530 
00531 
00543    int testFltConfig(FILE *fout, int level=1, bool header=false);
00544 
00549    int testFltStatistic(FILE *fout, int level=1, bool header=false);
00550 
00551 
00554    int testFltHitrateController(FILE *fout, int level=1, bool useStat=false, bool header=false);
00555 
00556 
00558    int testSltConfiguration(FILE *fout, int level=1, bool header=true);
00559 
00562    unsigned long setSecondCounter(int board = -1);
00563 
00564 private:
00565   SimpleSocket *s;
00566 
00567 #ifdef __linux__
00568   pid_t pHandler;
00569 #endif
00570 
00572   float meanADCVar;
00573 
00575   int timebase;
00576 
00577 };
00578         
00579 } // namespace hw4
00580         
00581 #endif // _HW4_SUBRACKKATRIN_H_INCLUDED
00582