#ifndef __TC2LVMEModule_h__
#define __TC2LVMEModule_h__
#include "TMrbC2Lynx.h"
#include "TMrbNamedX.h"
#include "M2L_MessageTypes.h"
#include "M2L_CommonStructs.h"
class TC2LVMEModule : public TMrbNamedX {
public:
TC2LVMEModule() {};
TC2LVMEModule(const Char_t * ModuleName, const Char_t * ModuleType,
UInt_t Address = 0, Int_t SegSize = 0, Int_t NofChannels = 0, UInt_t Mapping = 0, Bool_t Offline = kFALSE);
~TC2LVMEModule() {};
inline UInt_t GetHandle() { return((UInt_t) this->GetIndex()); };
inline const Char_t * GetType() { return(this->GetTitle()); };
inline UInt_t GetAddress() { return(fBaseAddress); };
inline Int_t GetSegSize() { return(fSegSize); };
inline Int_t GetMapping() { return(fMapping); };
inline Int_t GetNofChannels() { return(fNofChannels); };
Bool_t Connect(UInt_t Address, Int_t SegSize, Int_t NofChannels, UInt_t Mapping);
Bool_t GetModuleInfo();
inline TMrbNamedX * FindFunction(Int_t Fcode) { return(fLofFunctionTypes.FindByIndex(Fcode)); };
inline void SetOffline(Bool_t Flag = kTRUE) { fOffline = Flag; };
inline Bool_t IsOffline() { return(fOffline); };
inline void SetVerbose(Bool_t Flag = kTRUE) { fVerbose = Flag; };
inline Bool_t IsVerbose() { return(fVerbose); };
inline void Help() { gSystem->Exec(Form("mrbHelp %s", this->ClassName())); };
protected:
inline void SetAddress(UInt_t Address) { fBaseAddress = Address; };
inline void SetSegSize(Int_t SegSize) { fSegSize = SegSize; };
inline void SetMapping(UInt_t Mapping) { fMapping = Mapping; };
inline void SetNofChannels(Int_t NofChannels) { fNofChannels = NofChannels; };
inline void SetHandle(UInt_t Handle) { this->SetIndex((Int_t) Handle); };
protected:
Bool_t fVerbose;
Bool_t fOffline;
UInt_t fBaseAddress;
Int_t fSegSize;
UInt_t fMapping;
Int_t fNofChannels;
TString fSettingsFile;
TMrbLofNamedX fLofFunctionTypes;
ClassDef(TC2LVMEModule, 1)
};
#endif