00001 // ===================================================================== 00002 // $Id: TExitCommand.cc,v 1.4 2004/03/07 10:30:28 goiwai Exp $ 00003 // $Name: CLDAQ-1-14-03 $ 00004 // $Log: TExitCommand.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:31 goiwai 00013 // ファイルにコミットログをつけることにしました. 00014 // 00015 // ===================================================================== 00016 #include "TExitCommand.hh" 00017 #include "TUserInterface.hh" 00018 #include "TRunManager.hh" 00019 00020 static const Tstring _name = "exit"; 00021 static const Tstring _desc = "terminate this session by force."; 00022 00023 TExitCommand::TExitCommand( TRunManager* manager ) 00024 : TCommand( manager, _name, _desc ) 00025 {;} 00026 00027 TExitCommand::~TExitCommand() 00028 {;} 00029 00030 Tvoid TExitCommand::Execute( const TstringList& arguments ) 00031 { 00032 Tstatus_t status = theRunManager -> GetStatus(); 00033 switch ( status ) { 00034 case tStatusStandby: 00035 theRunManager -> ShutdownRun(); 00036 break; 00037 case tStatusReady: 00038 theRunManager -> SuspendRun(); 00039 theRunManager -> WaitReturnFromEventLoop(); 00040 theRunManager -> StopRun(); 00041 theRunManager -> ShutdownRun(); 00042 break; 00043 case tStatusBusy: 00044 theRunManager -> SuspendRun(); 00045 theRunManager -> WaitReturnFromEventLoop(); 00046 theRunManager -> StopRun(); 00047 theRunManager -> ShutdownRun(); 00048 break; 00049 case tStatusIdle: 00050 theRunManager -> StopRun(); 00051 theRunManager -> ShutdownRun(); 00052 break; 00053 case tStatusWaitingReady: 00054 theRunManager -> WaitReturnFromEventLoop(); 00055 theRunManager -> StopRun(); 00056 theRunManager -> ShutdownRun(); 00057 break; 00058 default: 00059 break; 00060 } 00061 return; 00062 } 00063 00064 #ifdef __CLDAQ_ROOT_DLL 00065 ClassImp(TExitCommand) 00066 #endif