00001 // ===================================================================== 00002 // $Id: TRunEventLimitCommand.cc,v 1.4 2004/03/07 10:30:28 goiwai Exp $ 00003 // $Name: CLDAQ-1-14-03 $ 00004 // $Log: TRunEventLimitCommand.cc,v $ 00005 // Revision 1.4 2004/03/07 10:30:28 goiwai 00006 // ROOTに組みこむためのおまじないマクロを埋めこみました。 00007 // 全てにおいて完全に動作するわけではありません。 00008 // 00009 // Revision 1.3 2003/10/06 17:02:37 goiwai 00010 // *** empty log message *** 00011 // 00012 // Revision 1.2 2003/07/30 16:17:32 goiwai 00013 // ファイルにコミットログをつけることにしました. 00014 // 00015 // ===================================================================== 00016 #include "TRunEventLimitCommand.hh" 00017 #include "TRunManager.hh" 00018 00019 static const Tstring _name = "/run/eventlimit"; 00020 static const Tstring _desc = "set number of events taken in this run.\nif you want to cancel this limit, set to 0 or less.\nexample> /run/eventlimit 100"; 00021 00022 TRunEventLimitCommand::TRunEventLimitCommand( TRunManager* manager ) 00023 : TCommand( manager, _name, _desc ) 00024 {;} 00025 00026 TRunEventLimitCommand::~TRunEventLimitCommand() 00027 {;} 00028 00029 Tvoid TRunEventLimitCommand::Execute( const TstringList& arguments ) 00030 { 00031 if ( arguments.empty() ) { 00032 Tcout << theRunManager -> GetEventLimit() << Tendl; 00033 } else if ( arguments.size() == 1 ) { 00034 Tint nevents = strtol( arguments[ 0 ].c_str(), 0, 0 ); 00035 theRunManager -> SetEventLimit( nevents ); 00036 } else { 00037 ShowCommandDetail(); 00038 } 00039 00040 return; 00041 } 00042 00043 #ifdef __CLDAQ_ROOT_DLL 00044 ClassImp(TRunEventLimitCommand) 00045 #endif