00001 #ifndef MODULECONFIGURATION_H
00002 #define MODULECONFIGURATION_H
00003
00004 #include <vector>
00005 #include <boost/shared_ptr.hpp>
00006 #include <CommonWithDsp/sctStructure.h>
00007 #include "Sct/Streamable.h"
00008 #include "Sct/SctParameters.h"
00009 #include "ChipConfiguration.h"
00010
00011 using std::vector;
00012 using boost::shared_ptr;
00013
00014 namespace SctData {
00015
00029 class ModuleConfiguration : public virtual Sct::Streamable {
00030
00031 public:
00035 ModuleConfiguration() throw();
00036 virtual ~ModuleConfiguration() throw();
00037
00041 ModuleConfiguration(const ModuleConfiguration& config) throw();
00042
00046 ModuleConfiguration& operator=(const ModuleConfiguration& config) throw();
00047
00048
00049 virtual std::string getClassName() const throw();
00050
00051
00052 ChipConfiguration& getChipConfiguration(const unsigned int chip) throw();
00053 const ChipConfiguration& getChipConfiguration(const unsigned int chip) const throw();
00054
00060 bool isPresent() const throw();
00066 bool isActive() const throw();
00068 void setActive(bool active) throw();
00070 bool usingPrimaryClock() const throw();
00071 void setUsingPrimaryClock(bool usePrimaryClock) throw();
00072
00074 bool channelIsMasked(const unsigned int ichannel) const throw();
00076 void maskChannel(const unsigned int ichannel) throw();
00078
00088 char getGroupId() const throw();
00090 void setGroupId(const char) throw();
00091
00095 const ABCDModule& getABCDModule() const;
00096
00100 ABCDModule& getABCDModule();
00101 private:
00102 ABCDModule configuration;
00103 vector<shared_ptr<ChipConfiguration> > chipConfigs;
00104 };
00105
00106
00107
00108
00109 inline bool ModuleConfiguration::isPresent() const throw() {
00110 return configuration.present == 0 ? false : true;
00111 }
00112
00113 inline bool ModuleConfiguration::isActive() const throw() {
00114 return configuration.active == 0 ? false : true;
00115 }
00116
00117 inline void ModuleConfiguration::setActive(bool active) throw() {
00118 configuration.active = active ? 1 : 0;
00119 }
00120
00121 inline bool ModuleConfiguration::usingPrimaryClock() const throw() {
00122 return configuration.select == 0 ? false : true;
00123 }
00124
00125 inline void ModuleConfiguration::setUsingPrimaryClock(bool usePrimaryClock) throw() {
00126 configuration.select = usePrimaryClock ? 1 : 0;
00127 }
00128
00129 inline char ModuleConfiguration::getGroupId() const throw(){
00130 return configuration.groupId;
00131 }
00132
00133 inline void ModuleConfiguration::setGroupId(const char id) throw(){
00134 configuration.groupId=id;
00135 }
00136 }
00137 #endif //#ifndef MODULECONFIGURATION_H
00138