00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "TWaitCommand.hh"
00021 #include "TRunManager.hh"
00022 #include "TRegularExpression.hh"
00023
00024 static const Tstring _name = "/system/wait";
00025 static const Tstring _desc =
00026 "マネージャーのステータスがSleep a parent process."
00027 "\n"
00028 "Some thread processes go on."
00029 "\n"
00030 "This command can accept only one argument and must be digit."
00031 "\n"
00032 "CLDAQ> /system/wait 10";
00033
00034 TWaitCommand::TWaitCommand( TRunManager* manager )
00035 : TCommand( manager, _name, _desc )
00036 {;}
00037
00038 TWaitCommand::~TWaitCommand()
00039 {;}
00040
00041 Tvoid TWaitCommand::Execute( const TstringList& arguments )
00042 {
00043 static TRegularExpression regex( "^[0-9]+$" );
00044
00045
00046
00047
00048
00049 Tint sec = 1;
00050 if ( !arguments.empty() ) {
00051 Tstring strtime = arguments[ 0 ];
00052 if ( regex == strtime ) {
00053 sec = strtoi( strtime );
00054 }
00055 }
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067 while ( theRunManager -> GetStatus() != tStatusStandby ) {
00068 sleep( sec );
00069 }
00070
00071 return;
00072 }
00073
00074 #ifdef __CLDAQ_ROOT_DLL
00075 ClassImp(TWaitCommand)
00076 #endif