RunController.h

00001 #ifndef SCTCALIBRATIONRUNCONTROLLER_H
00002 #define SCTCALIBRATIONRUNCONTROLLER_H
00003 
00004 #ifdef linux
00005 #undef linux
00006 #endif
00007 
00008 #include <rc/UserRoutines.h>
00009 #include <boost/utility.hpp>
00010 #include <string>
00011 
00012 using std::string;
00013 
00014 class ISCallbackInfo;
00015 
00016 namespace SctCalibrationController {
00017 
00018 class CalibrationControllerImpl;
00019 
00020 class RunControl : public RC::UserRoutines, boost::noncopyable {
00021 public:
00022     enum ErrorState {
00023         SCTAPI_ACCESS_FAILURE
00024     };
00025 
00026     static RunControl& instance();
00027 
00028     //methods associated with Alive
00029     //  virtual void enterAlive();
00030     //virtual void exitAlive();
00031     //  virtual void killaction ();
00032     virtual bool resetAction ();
00033 
00034     //methods associated to Initial
00035     //  virtual void enterInitial();
00036     //  virtual void exitInitial();
00041     virtual bool loadAction ();
00042     //virtual void terminateaction ();
00043 
00044     //methods associated with Active
00045     //virtual void enterActive();
00046     //  virtual void exitActive();
00047     //  virtual int stopaction ();
00048 
00049     //methods associated with Running
00050     virtual bool prepareAction();
00051 
00052     virtual bool stopEFAction();
00053 
00054     //  virtual int pauseaction ();
00055 
00056     //methods associated with Paused
00057     //  virtual void enterPaused();
00058     //  virtual void exitPaused();
00059     //  virtual int stepaction ();
00060     //  virtual int resumeaction ();
00061 
00062     //methods associated with Configured
00063     //virtual void enterConfigured();
00064     //  virtual void exitConfigured();
00065     //virtual int unconfigaction();
00066 
00067     // ?? What has this become?? (LESTER) virtual int startAction ();
00068 
00069     //methods associated with Loaded
00070     //  virtual void enterLoaded();
00071     //  virtual void exitLoaded();
00072     virtual bool unloadAction ();
00073     virtual bool configureAction ();
00074 
00078     void sctApiError(/*ErrorState state, */const string& reason);
00079 private:
00080     int getRunNumber();
00081     std::string getRunType() const;
00082     bool sendRunTypeToSctApi() const;
00083     RunControl();
00084     CalibrationControllerImpl& cc;
00085     Sct_SctApi::SctApiIPC_var api;
00086     boost::shared_ptr<ISInfoDictionary> m_isInfoDictionary;
00087  public:
00088     static const int defaultRunNumber = 0;
00089 };
00090 
00091 }
00092 
00093 #endif //SCTCALIBRATIONRUNCONTROLLER_H

Generated on Mon Feb 6 14:01:26 2006 for SCT DAQ/DCS Software - C++ by  doxygen 1.4.6