77{
78 if( acommand.length() < 2 ) return fCommandSucceeded;
79
81 G4int returnVal = 0;
82
84
85
86 if( command.substr(0,11) == "/mpi/beamOn" ) {
87 g4mpi_-> ExecuteBeamOnThread(command);
88 returnVal = fCommandSucceeded;
89 } else if( command.substr(0,12) == "/mpi/.beamOn" ) {
90 G4bool threadStatus =
g4mpi_-> CheckThreadStatus();
91 if ( threadStatus ) {
93 G4cout << "G4MPIsession:: beamOn is still running." << G4endl;
94 }
95 returnVal = fCommandSucceeded;
96 } else {
97 returnVal = UI-> ApplyCommand(command);
98 }
99 } else {
100 returnVal = UI-> ApplyCommand(command);
101 }
102
103 G4int paramIndex = returnVal % 100;
104
105
106 G4int commandStatus = returnVal - paramIndex;
107
109 if( commandStatus != fCommandSucceeded ) {
110 cmd = FindCommand(command);
111 }
112
113 switch( commandStatus ) {
114 case fCommandSucceeded:
115 break;
116 case fCommandNotFound:
117 G4cerr << "command <" << UI-> SolveAlias(command)
118 << "> not found" << G4endl;
119 break;
120 case fIllegalApplicationState:
121 G4cerr << "illegal application state -- command refused" << G4endl;
122 break;
123 case fParameterOutOfRange:
124
125 break;
126 case fParameterOutOfCandidates:
127 G4cerr << "Parameter is out of candidate list (index "
128 << paramIndex << ")" << G4endl;
129 G4cerr << "Candidates : "
130 << cmd->GetParameter(paramIndex)-> GetParameterCandidates()
131 << G4endl;
132 break;
133 case fParameterUnreadable:
134 G4cerr << "Parameter is wrong type and/or is not omittable (index "
135 << paramIndex << ")" << G4endl;
136 break;
137 case fAliasNotFound:
138
139 break;
140 default:
141 G4cerr << "command refused (" << commandStatus << ")" << G4endl;
142 }
143
144 return returnVal;
145}
G4String BypassCommand(const G4String &command) const