My Project
|
00001 #ifndef ACQUIRENEUTRONSOURCEINFORMATIONCONTROLBASE 00002 #define ACQUIRENEUTRONSOURCEINFORMATIONCONTROLBASE 00003 00004 #define ACQUIRE_TIME 15 /* access time interval (sec) */ 00005 #define ACQUIRE_MAX 150 /* maximum access count */ 00006 00007 /* Signal Key */ 00008 #define BEAM_POWER "BP" /* Beam power */ 00009 #define CT_HISTORY "CT01" /* Beam power history(image) */ 00010 #define MODERATOR_TEMPERATURE "H2" /* Moderator temperature history(image) */ 00011 #define JPARC_STATUS "JP" /* Status of J-PARC(image) */ 00012 #define SHUTTER_STATUS "ST" /* Shutter opening-and-closing state(image) */ 00013 #define CT_3HOUR "CT3H" /* Current history 3 hour(image) */ 00014 #define CT_1DAY "CT1D" /* Current history 1 day(image) */ 00015 #define H2_ENTRANCE "H2in" /* Temperature of moderator hydrogen (entrance) */ 00016 #define H2ENTRANCE "h2in" /* for cgi parameter, Temperature of moderator hydrogen (entrance) */ 00017 #define H2_COUPLED "H2cm" /* Temperature of moderator hydrogen (coupled) */ 00018 #define H2COUPLED "h2cm" /* for cgi parameter, Temperature of moderator hydrogen (coupled) */ 00019 #define H2_DECOUPLED "H2dm" /* Temperature of moderator hydrogen (decoupled) */ 00020 #define H2DECOUPLED "h2dm" /* for cgi parameter, Temperature of moderator hydrogen (decoupled) */ 00021 #define H2_POISON "H2pm" /* Temperature of moderator hydrogen (poison) */ 00022 #define H2POISON "h2pm" /* for cgi parameter, Temperature of moderator hydrogen (poison) */ 00023 #define CT_MUON_TARGET "CT8" /* The number of protons (muon target) */ 00024 #define CT_NEUTRON_TARGET "CT9" /* The number of protons (neutron target) */ 00025 #define BEAM_STOP_START "BS" /* Beam stop time */ 00026 00027 //#include <sys/time> /* struct timeval */ 00028 #include <ctime> 00029 //#include <sstream> /* for ostringstream */ 00030 #include <iomanip> /* manipulator */ 00031 #include "AcquireNeutronSourceInformationBase.hh" 00032 #include "StringTools.hh" /* StringTools at StringDateToUInt4 */ 00034 class AcquireNeutronSourceInformationControlBase 00035 : public AcquireNeutronSourceInformationBase 00036 { 00037 private: 00038 protected: 00039 struct timeval StartingTime; /* Starting time of this API (micro sec) */ 00040 struct timeval LastTime; /* Last time of this API (micro sec) */ 00041 UInt4 AccessCount; /* The demand number of times of this API */ 00042 00043 public: 00044 AcquireNeutronSourceInformationControlBase(); 00046 00048 AcquireNeutronSourceInformationControlBase(string host_name); 00050 00053 virtual ~AcquireNeutronSourceInformationControlBase(); 00055 00057 Bool AcquireControl( const string Key ); 00058 00059 UInt4 StringDateToUInt4( const string Date, UInt4& year, UInt4& month, UInt4& day, UInt4& hour ); 00060 UInt4 StringTimeToStructTime( const string date_time, const string separator, struct tm *ltm ); 00061 string StructTimeToStringTime( struct tm *ltm, const string separator ); 00062 }; 00063 00064 #endif