MLCBaseController.hh

Go to the documentation of this file.
00001 
00002 #ifndef _M_LCBASECONTROLLER_HH_
00003 #define _M_LCBASECONTROLLER_HH_
00004 
00005 #include <set>
00006 #include <map>
00007 
00008 #include "QDriver.hh"
00009 #include "QLCSharedDefs.hh"
00010 
00011 class QEleChannelConfig;
00012 class QError;
00013 
00099 class MLCBaseController : public QDriver
00100 {
00101 public:
00103    MLCBaseController(const std::string& name, QSequence* s);
00104    
00106    virtual ~MLCBaseController();
00107    
00109    Action Init();
00110    
00112    Action Do(QEvent* ev);
00113    
00115    Action Done();
00116 
00117 protected:
00119    const std::set<int>& GetActiveChannels() const { return fActiveChannels; }
00120    
00122    virtual QError ReadWorkFlow() = 0;
00123    
00128    virtual QError MakeGroups(std::vector<std::set<int> >& groups) const;
00129 
00137    virtual ActionId SetupNextConf() = 0;
00138 
00140    virtual void InitFlowController() = 0;
00141 
00143    std::map<int, QEleChannelConfig*> GetCurrentConfigs();
00144 
00151    std::set<int> GetCurrentGroup() const
00152    {
00153       if(fGroups.empty())
00154          return std::set<int>();
00155       else
00156          return fGroups.at(fCurrGroupId);
00157    }
00158 
00163    virtual void SetProcedureType() = 0;
00164 
00173    QLCProcedure_t fProcedureType;
00174 
00176    void SetExternalBiasV(double biasV)
00177    { fExternalBiasV = biasV; }
00178 
00179 private:
00181    std::string fMatrixName;
00182 
00187    double fExternalBiasV;
00188 
00190    int fSleepAfterChangeSec;
00191 
00193    int fStepTimeoutSec;
00194 
00196    time_t fTimeOfLastChangeUnix;
00197 
00199    std::set<int> fActiveChannels;
00200 
00202    std::vector<std::set<int> > fGroups;
00203    
00205    size_t fCurrGroupId;
00206 
00208    std::map<int, QEleChannelConfig*> fConfigs;
00209 
00211    std::set<int> fWrongPolarityChannels;
00212 
00214    std::set<int> fChannelsWithHeater;
00215 
00224    QError ReadInitFile();
00225 
00227    void InitHandler();
00228 
00240    ActionId NextConf();
00241 };
00242 
00243 #endif

Generated on Tue Nov 16 10:49:57 2010 for CUORE Software by  doxygen 1.5.6