00001 /******************************************************************** 00002 * The Data Acquisition Backbone Core (DABC) 00003 ******************************************************************** 00004 * Copyright (C) 2009- 00005 * GSI Helmholtzzentrum fuer Schwerionenforschung GmbH 00006 * Planckstr. 1 00007 * 64291 Darmstadt 00008 * Germany 00009 * Contact: http://dabc.gsi.de 00010 ******************************************************************** 00011 * This software can be used under the GPL license agreements as stated 00012 * in LICENSE.txt file which is part of the distribution. 00013 ********************************************************************/ 00014 00015 #ifndef ROC_AbbTransport 00016 #define ROC_AbbTransport 00017 00018 #ifndef DABC_DataTransport 00019 #include "dabc/DataTransport.h" 00020 #endif 00021 00022 #include <vector> 00023 00024 #include "roc/Message.h" 00025 00026 #include "roc/AbbContext.h" 00027 00028 namespace roc { 00029 00030 class AbbDevice; 00031 00032 class AbbTransport : public dabc::DataTransport { 00033 00034 friend class AbbDevice; 00035 00036 protected: 00037 00038 AbbDevice* fDevice; 00039 AbbContextRef fContext; 00040 unsigned fBufferSize; 00041 bool fDaqRunning; 00042 bool fMbsHeader; 00043 int fBufCounter; 00044 bool fManyRocs; 00046 std::vector<void*> fDMABuffers; 00047 bool fMapError; 00048 int fFormat; 00049 00050 dabc::TimeStamp fLastDMAtime; 00051 00052 double fFlushTime; 00053 unsigned fOpticPath; 00054 uint32_t fBrdId; 00055 uint32_t fHwType; 00056 00057 virtual void ProcessPoolChanged(dabc::MemoryPool* pool); 00058 00059 virtual unsigned Read_Size(); 00060 00061 virtual unsigned Read_Complete(dabc::Buffer& buf); 00062 00063 virtual double Read_Timeout() { return 0.001; } 00064 00065 virtual int GetParameter(const char* name); 00066 00067 public: 00068 AbbTransport(AbbDevice* dev, dabc::Reference port, unsigned path, 00069 uint32_t rocid, uint32_t hwtyp, dabc::Command cmd = 0); 00070 virtual ~AbbTransport(); 00071 00072 virtual int ExecuteCommand(dabc::Command cmd); 00073 00074 virtual void StartTransport(); 00075 virtual void StopTransport(); 00076 }; 00077 00078 } 00079 00080 #endif