48 controlDirectory->
SetGuidance(
"UI control commands.");
51 macroPathCommand->
SetGuidance(
"Set macro search path"
52 "with colon-separated list.");
56 ExecuteCommand->
SetGuidance(
"Execute a macro file.");
60 loopCommand =
new G4UIcommand(
"/control/loop",
this);
61 loopCommand->
SetGuidance(
"Execute a macro file more than once.");
62 loopCommand->
SetGuidance(
"Loop counter can be used as an aliased variable.");
76 foreachCommand =
new G4UIcommand(
"/control/foreach",
this);
77 foreachCommand->
SetGuidance(
"Execute a macro file more than once.");
78 foreachCommand->
SetGuidance(
"Loop counter can be used as an aliased variable.");
79 foreachCommand->
SetGuidance(
"Values must be separated by a space.");
89 suppressAbortionCommand->
SetGuidance(
"Suppress the program abortion caused by G4Exception.");
90 suppressAbortionCommand->
SetGuidance(
"Suppression level = 0 : no suppression");
91 suppressAbortionCommand->
SetGuidance(
" = 1 : suppress during EventProc state");
92 suppressAbortionCommand->
SetGuidance(
" = 2 : full suppression, i.e. no abortion by G4Exception");
93 suppressAbortionCommand->
SetGuidance(
"When abortion is suppressed, you will get error messages issued by G4Exception,");
94 suppressAbortionCommand->
SetGuidance(
"and there is NO guarantee for the correct result after the G4Exception error message.");
96 suppressAbortionCommand->
SetRange(
"level >= 0 && level <= 2");
100 verboseCommand->
SetGuidance(
"Applied command will also be shown on screen.");
101 verboseCommand->
SetGuidance(
"This command is useful with MACRO file.");
103 verboseCommand->
SetGuidance(
" 1 : only the valid commands are shown.");
104 verboseCommand->
SetGuidance(
" 2 : comment lines are also shown (default).");
106 verboseCommand->
SetRange(
"switch >= 0 && switch <=2");
110 historyCommand->
SetGuidance(
"Store command history to a file.");
111 historyCommand->
SetGuidance(
"Defaul file name is G4history.macro.");
115 stopStoreHistoryCommand
117 stopStoreHistoryCommand->
SetGuidance(
"Stop saving history file.");
119 aliasCommand =
new G4UIcommand(
"/control/alias",
this);
121 aliasCommand->
SetGuidance(
"String can be aliased by this command.");
122 aliasCommand->
SetGuidance(
"The string may contain one or more spaces,");
123 aliasCommand->
SetGuidance(
"the string must be enclosed by double quotes (\").");
124 aliasCommand->
SetGuidance(
"To use an alias, enclose the alias name with");
125 aliasCommand->
SetGuidance(
"parenthis \"{\" and \"}\".");
139 getEnvCmd->
SetGuidance(
"Get a shell environment variable and define it as an alias.");
142 echoCmd->
SetGuidance(
"Display the aliased value.");
145 shellCommand->
SetGuidance(
"Execute a (Unix) SHELL command.");
148 ManualCommand->
SetGuidance(
"Display all of sub-directories and commands.");
149 ManualCommand->
SetGuidance(
"Directory path should be given by FULL-PATH.");
155 HTMLCommand->
SetGuidance(
"Generate HTML files for all of sub-directories and commands.");
156 HTMLCommand->
SetGuidance(
"Directory path should be given by FULL-PATH.");
162 maxStoredHistCommand->
SetGuidance(
"Set maximum number of stored UI commands.");
167 ifCommand->
SetGuidance(
"Execute a macro file if the expression is true.");
168 ifCommand->
SetGuidance(
" Syntax : <double> <comp> <double> <macro_file>");
181 addCommand->
SetGuidance(
"Define a new alias as the sum of two values.");
182 addCommand->
SetGuidance(
" Syntax : <new_alias> <value1> <value2>");
183 addCommand->
SetGuidance(
" <new_alias> may be an already existing alias. If it is the case,");
184 addCommand->
SetGuidance(
" aliased value is alternated.");
192 subtractCommand =
new G4UIcommand(
"/control/subtract",
this);
193 subtractCommand->
SetGuidance(
"Define a new alias as the subtraction of two values.");
194 subtractCommand->
SetGuidance(
" Syntax : <new_alias> <value1> <value2>");
195 subtractCommand->
SetGuidance(
" <new_alias> may be an already existing alias. If it is the case,");
196 subtractCommand->
SetGuidance(
" aliased value is alternated.");
204 multiplyCommand =
new G4UIcommand(
"/control/multiply",
this);
205 multiplyCommand->
SetGuidance(
"Define a new alias as the multiplification of two values.");
206 multiplyCommand->
SetGuidance(
" Syntax : <new_alias> <value1> <value2>");
207 multiplyCommand->
SetGuidance(
" <new_alias> may be an already existing alias. If it is the case,");
208 multiplyCommand->
SetGuidance(
" aliased value is alternated.");
216 divideCommand =
new G4UIcommand(
"/control/divide",
this);
217 divideCommand->
SetGuidance(
"Define a new alias as the division of two values.");
218 divideCommand->
SetGuidance(
" Syntax : <new_alias> <value1> <value2>");
219 divideCommand->
SetGuidance(
" <new_alias> may be an already existing alias. If it is the case,");
220 divideCommand->
SetGuidance(
" aliased value is alternated.");
229 remainderCommand =
new G4UIcommand(
"/control/remainder",
this);
230 remainderCommand->
SetGuidance(
"Define a new alias as the remainder of two values.");
231 remainderCommand->
SetGuidance(
" Syntax : <new_alias> <value1> <value2>");
232 remainderCommand->
SetGuidance(
" <new_alias> may be an already existing alias. If it is the case,");
233 remainderCommand->
SetGuidance(
" aliased value is alternated.");
246 delete macroPathCommand;
247 delete ExecuteCommand;
248 delete suppressAbortionCommand;
249 delete verboseCommand;
250 delete historyCommand;
251 delete stopStoreHistoryCommand;
252 delete ManualCommand;
254 delete unaliasCommand;
255 delete listAliasCommand;
260 delete foreachCommand;
262 delete maxStoredHistCommand;
265 delete subtractCommand;
266 delete multiplyCommand;
267 delete divideCommand;
268 delete remainderCommand;
270 delete controlDirectory;
277 if( command == macroPathCommand) {
278 UI-> SetMacroSearchPath(newValue);
279 UI-> ParseMacroSearchPath();
281 if(command==ExecuteCommand)
283 UI-> ExecuteMacroFile(UI-> FindMacroPath(newValue));
285 if(command==suppressAbortionCommand)
289 if(command==verboseCommand)
293 if(command==historyCommand)
297 if(command==stopStoreHistoryCommand)
301 if(command==ManualCommand)
305 if(command==aliasCommand)
309 if(command==unaliasCommand)
313 if(command==listAliasCommand)
317 if(command==getEnvCmd)
324 st += getenv(newValue);
328 {
G4cerr <<
"<" << newValue <<
"> is not defined as a shell variable. Command ignored." <<
G4endl; }
332 if(command==shellCommand)
336 if(command==loopCommand)
340 if(command==foreachCommand)
344 if(command==HTMLCommand)
348 if(command==maxStoredHistCommand)
352 if(command==ifCommand)
360 if(comp==
">") x = (l>
r);
361 else if(comp==
">=") x = (l>=
r);
362 else if(comp==
"<") x = (l<
r);
363 else if(comp==
"<=") x = (l<=
r);
364 else if(comp==
"==") x = (l==
r);
365 else if(comp==
"!=") x = (l!=
r);
368 if(command==addCommand)
380 if(command==subtractCommand)
392 if(command==multiplyCommand)
404 if(command==divideCommand)
416 if(command==remainderCommand)
435 if( command == macroPathCommand ) {
436 currentValue = UI-> GetMacroSearchPath();
438 if(command==verboseCommand)
442 if(command==suppressAbortionCommand)
446 if(command==maxStoredHistCommand)
void ForeachS(const char *valueList)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void ExecuteMacroFile(const char *fileName)
void SetParameter(G4UIparameter *const newParameter)
void RemoveAlias(const char *aliasName)
void SetAlias(const char *aliasLine)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4int GetNewIntValue(const char *paramString)
void SetParameterRange(const char *theRange)
void SetParameterCandidates(const char *theString)
void SetNewValue(G4UIcommand *command, G4String newValue)
void SetToBeBroadcasted(G4bool val)
void SetDefaultValue(const char *theDefaultValue)
static G4String ConvertToString(G4bool boolVal)
G4int GetVerboseLevel() const
void SetVerboseLevel(G4int val)
static G4UImanager * GetUIpointer()
void SetSuppressAbortion(G4int i)
static G4StateManager * GetStateManager()
G4GLOB_DLL std::ostream G4cout
void SetRange(const char *rs)
void SetGuidance(const char *aGuidance)
G4String DtoS(G4double a)
void SetMaxHistSize(G4int mx)
void ListCommands(const char *direc)
G4String GetCurrentValue(G4UIcommand *command)
void SetDefaultValue(const char *defVal)
G4double StoD(G4String s)
system("rm -rf dna.root")
G4String SolveAlias(const char *aCmd)
void LoopS(const char *valueList)
void SetDefaultValue(G4int defVal)
void CreateHTML(const char *dir="/")
void StoreHistory(const char *fileName="G4history.macro")
G4int ApplyCommand(const char *aCommand)
G4GLOB_DLL std::ostream G4cerr
G4int GetMaxHistSize() const