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.");
59 loopCommand =
new G4UIcommand(
"/control/loop",
this);
60 loopCommand->
SetGuidance(
"Execute a macro file more than once.");
61 loopCommand->
SetGuidance(
"Loop counter can be used as an aliased variable.");
74 foreachCommand =
new G4UIcommand(
"/control/foreach",
this);
75 foreachCommand->
SetGuidance(
"Execute a macro file more than once.");
76 foreachCommand->
SetGuidance(
"Loop counter can be used as an aliased variable.");
77 foreachCommand->
SetGuidance(
"Values must be separated by a space.");
86 suppressAbortionCommand->
SetGuidance(
"Suppress the program abortion caused by G4Exception.");
87 suppressAbortionCommand->
SetGuidance(
"Suppression level = 0 : no suppression");
88 suppressAbortionCommand->
SetGuidance(
" = 1 : suppress during EventProc state");
89 suppressAbortionCommand->
SetGuidance(
" = 2 : full suppression, i.e. no abortion by G4Exception");
90 suppressAbortionCommand->
SetGuidance(
"When abortion is suppressed, you will get error messages issued by G4Exception,");
91 suppressAbortionCommand->
SetGuidance(
"and there is NO guarantee for the correct result after the G4Exception error message.");
93 suppressAbortionCommand->
SetRange(
"level >= 0 && level <= 2");
97 verboseCommand->
SetGuidance(
"Applied command will also be shown on screen.");
98 verboseCommand->
SetGuidance(
"This command is useful with MACRO file.");
100 verboseCommand->
SetGuidance(
" 1 : only the valid commands are shown.");
101 verboseCommand->
SetGuidance(
" 2 : comment lines are also shown (default).");
103 verboseCommand->
SetRange(
"switch >= 0 && switch <=2");
107 historyCommand->
SetGuidance(
"Store command history to a file.");
108 historyCommand->
SetGuidance(
"Defaul file name is G4history.macro.");
112 stopStoreHistoryCommand
114 stopStoreHistoryCommand->
SetGuidance(
"Stop saving history file.");
116 aliasCommand =
new G4UIcommand(
"/control/alias",
this);
118 aliasCommand->
SetGuidance(
"String can be aliased by this command.");
119 aliasCommand->
SetGuidance(
"The string may contain one or more spaces,");
120 aliasCommand->
SetGuidance(
"the string must be enclosed by double quotes (\").");
121 aliasCommand->
SetGuidance(
"To use an alias, enclose the alias name with");
122 aliasCommand->
SetGuidance(
"parenthis \"{\" and \"}\".");
136 getEnvCmd->
SetGuidance(
"Get a shell environment variable and define it as an alias.");
139 echoCmd->
SetGuidance(
"Display the aliased value.");
142 shellCommand->
SetGuidance(
"Execute a (Unix) SHELL command.");
145 ManualCommand->
SetGuidance(
"Display all of sub-directories and commands.");
146 ManualCommand->
SetGuidance(
"Directory path should be given by FULL-PATH.");
151 HTMLCommand->
SetGuidance(
"Generate HTML files for all of sub-directories and commands.");
152 HTMLCommand->
SetGuidance(
"Directory path should be given by FULL-PATH.");
157 maxStoredHistCommand->
SetGuidance(
"Set maximum number of stored UI commands.");
162 ifCommand->
SetGuidance(
"Execute a macro file if the expression is true.");
163 ifCommand->
SetGuidance(
" Syntax : <double> <comp> <double> <macro_file>");
175 addCommand->
SetGuidance(
"Define a new alias as the sum of two values.");
176 addCommand->
SetGuidance(
" Syntax : <new_alias> <value1> <value2>");
177 addCommand->
SetGuidance(
" <new_alias> may be an already existing alias. If it is the case,");
178 addCommand->
SetGuidance(
" aliased value is alternated.");
186 subtractCommand =
new G4UIcommand(
"/control/subtract",
this);
187 subtractCommand->
SetGuidance(
"Define a new alias as the subtraction of two values.");
188 subtractCommand->
SetGuidance(
" Syntax : <new_alias> <value1> <value2>");
189 subtractCommand->
SetGuidance(
" <new_alias> may be an already existing alias. If it is the case,");
190 subtractCommand->
SetGuidance(
" aliased value is alternated.");
198 multiplyCommand =
new G4UIcommand(
"/control/multiply",
this);
199 multiplyCommand->
SetGuidance(
"Define a new alias as the multiplification of two values.");
200 multiplyCommand->
SetGuidance(
" Syntax : <new_alias> <value1> <value2>");
201 multiplyCommand->
SetGuidance(
" <new_alias> may be an already existing alias. If it is the case,");
202 multiplyCommand->
SetGuidance(
" aliased value is alternated.");
210 divideCommand =
new G4UIcommand(
"/control/divide",
this);
211 divideCommand->
SetGuidance(
"Define a new alias as the division of two values.");
212 divideCommand->
SetGuidance(
" Syntax : <new_alias> <value1> <value2>");
213 divideCommand->
SetGuidance(
" <new_alias> may be an already existing alias. If it is the case,");
214 divideCommand->
SetGuidance(
" aliased value is alternated.");
223 remainderCommand =
new G4UIcommand(
"/control/remainder",
this);
224 remainderCommand->
SetGuidance(
"Define a new alias as the remainder of two values.");
225 remainderCommand->
SetGuidance(
" Syntax : <new_alias> <value1> <value2>");
226 remainderCommand->
SetGuidance(
" <new_alias> may be an already existing alias. If it is the case,");
227 remainderCommand->
SetGuidance(
" aliased value is alternated.");
240 delete macroPathCommand;
241 delete ExecuteCommand;
242 delete suppressAbortionCommand;
243 delete verboseCommand;
244 delete historyCommand;
245 delete stopStoreHistoryCommand;
246 delete ManualCommand;
248 delete unaliasCommand;
249 delete listAliasCommand;
254 delete foreachCommand;
256 delete maxStoredHistCommand;
259 delete subtractCommand;
260 delete multiplyCommand;
261 delete divideCommand;
262 delete remainderCommand;
264 delete controlDirectory;
271 if( command == macroPathCommand) {
272 UI-> SetMacroSearchPath(newValue);
273 UI-> ParseMacroSearchPath();
275 if(command==ExecuteCommand)
277 UI-> ExecuteMacroFile(UI-> FindMacroPath(newValue));
279 if(command==suppressAbortionCommand)
283 if(command==verboseCommand)
287 if(command==historyCommand)
291 if(command==stopStoreHistoryCommand)
295 if(command==ManualCommand)
299 if(command==aliasCommand)
303 if(command==unaliasCommand)
307 if(command==listAliasCommand)
311 if(command==getEnvCmd)
318 st += getenv(newValue);
322 {
G4cerr <<
"<" << newValue <<
"> is not defined as a shell variable. Command ignored." <<
G4endl; }
326 if(command==shellCommand)
330 if(command==loopCommand)
334 if(command==foreachCommand)
338 if(command==HTMLCommand)
342 if(command==maxStoredHistCommand)
346 if(command==ifCommand)
354 if(comp==
">") x = (l>r);
355 else if(comp==
">=") x = (l>=r);
356 else if(comp==
"<") x = (l<r);
357 else if(comp==
"<=") x = (l<=r);
358 else if(comp==
"==") x = (l==r);
359 else if(comp==
"!=") x = (l!=r);
362 if(command==addCommand)
374 if(command==subtractCommand)
386 if(command==multiplyCommand)
398 if(command==divideCommand)
410 if(command==remainderCommand)
429 if( command == macroPathCommand ) {
430 currentValue = UI-> GetMacroSearchPath();
432 if(command==verboseCommand)
436 if(command==suppressAbortionCommand)
440 if(command==maxStoredHistCommand)
G4DLLIMPORT std::ostream G4cerr
G4DLLIMPORT std::ostream G4cout
void SetSuppressAbortion(G4int i)
static G4StateManager * GetStateManager()
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(const char *defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4int GetNewIntValue(const char *paramString)
void SetDefaultValue(G4int defVal)
static G4String ConvertToString(G4bool boolVal)
void SetParameter(G4UIparameter *const newParameter)
void SetGuidance(const char *aGuidance)
void SetRange(const char *rs)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
void ForeachS(const char *valueList)
G4int ApplyCommand(const char *aCommand)
void CreateHTML(const char *dir="/")
void LoopS(const char *valueList)
void StoreHistory(const char *fileName="G4history.macro")
void ListCommands(const char *direc)
void ExecuteMacroFile(const char *fileName)
void SetMaxHistSize(G4int mx)
G4int GetVerboseLevel() const
void SetAlias(const char *aliasLine)
void RemoveAlias(const char *aliasName)
G4String SolveAlias(const char *aCmd)
static G4UImanager * GetUIpointer()
G4int GetMaxHistSize() const
void SetVerboseLevel(G4int val)
G4String DtoS(G4double a)
G4double StoD(G4String s)
void SetDefaultValue(const char *theDefaultValue)
void SetParameterRange(const char *theRange)
void SetParameterCandidates(const char *theString)