Import Geant4 10.6.0.beta source tree
This commit is contained in:
@@ -16,22 +16,31 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
12 April, 2019 M. Asai (intercoms-V10-04-06)
|
||||
17 April, 2019 M. Asai (intercoms-V10-05-05)
|
||||
- Following UI commands now return proper return code when they are
|
||||
not successful. Addressing to bug report #2159.
|
||||
- /control/execute
|
||||
- /control/loop
|
||||
- /control/foreach
|
||||
- /control/shell
|
||||
- /control/getEnv
|
||||
|
||||
12 April, 2019 M. Asai (intercoms-V10-05-04)
|
||||
- Fix comments in this History file and G4UIparameter.hh.
|
||||
|
||||
29 March, 2019 M. Asai (intercoms-V10-04-05)
|
||||
29 March, 2019 M. Asai (intercoms-V10-05-03)
|
||||
- G4UIcommand::RangeCheck() : fixing a misbehavior caused in case
|
||||
string-type parameter comes prior to numeric-type parameters.
|
||||
|
||||
13 March, 2019 M. Asai
|
||||
13 March, 2019 M. Asai (intercoms-V10-05-02)
|
||||
- Introducing G4UIparameter::SetDefaultUnit() method that simplifies
|
||||
the definition of a unit parameter.
|
||||
|
||||
11 March, 2019 G. Cosmo
|
||||
11 March, 2019 G. Cosmo (intercoms-V10-05-01)
|
||||
- Fixed typos in printouts in G4LocalThreadCoutMessenger,
|
||||
G4UImanager and G4UIcontrolMessenger.
|
||||
|
||||
31 January, 2019 I. Hrivnacova
|
||||
31 January, 2019 I. Hrivnacova (intercoms-V10-05-00)
|
||||
- Merged GitHub PR #4: all Boolean operators now return G4bool.
|
||||
|
||||
23 July, 2018 M. Asai (intercoms-V10-04-04)
|
||||
|
||||
@@ -170,17 +170,17 @@ class G4UImanager : public G4VStateDependent
|
||||
|
||||
public: // with description
|
||||
G4String GetCurrentStringValue(const char * aCommand,
|
||||
G4int parameterNumber=1, G4bool reGet=true);
|
||||
G4int parameterNumber=1, G4bool reGet=true);
|
||||
G4int GetCurrentIntValue(const char * aCommand,
|
||||
G4int parameterNumber=1, G4bool reGet=true);
|
||||
G4int parameterNumber=1, G4bool reGet=true);
|
||||
G4double GetCurrentDoubleValue(const char * aCommand,
|
||||
G4int parameterNumber=1, G4bool reGet=true);
|
||||
G4int parameterNumber=1, G4bool reGet=true);
|
||||
G4String GetCurrentStringValue(const char * aCommand,
|
||||
const char * aParameterName, G4bool reGet=true);
|
||||
const char * aParameterName, G4bool reGet=true);
|
||||
G4int GetCurrentIntValue(const char * aCommand,
|
||||
const char * aParameterName, G4bool reGet=true);
|
||||
const char * aParameterName, G4bool reGet=true);
|
||||
G4double GetCurrentDoubleValue(const char * aCommand,
|
||||
const char * aParameterName, G4bool reGet=true);
|
||||
const char * aParameterName, G4bool reGet=true);
|
||||
// These six methods returns the current value of a parameter of the
|
||||
// given command. For the first three methods, the ordering number of
|
||||
// the parameter (1 is the first parameter) can be given, whereas,
|
||||
@@ -300,6 +300,13 @@ class G4UImanager : public G4VStateDependent
|
||||
public:
|
||||
static void UseDoublePrecisionStr(G4bool val);
|
||||
static G4bool DoublePrecisionStr();
|
||||
|
||||
private:
|
||||
G4int lastRC;
|
||||
public:
|
||||
G4int GetLastReturnCode() const
|
||||
{ return lastRC; }
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -64,8 +64,10 @@ class G4UIsession : public G4coutDestination
|
||||
protected:
|
||||
G4ICOMS_DLL static G4int inSession;
|
||||
G4int ifBatch;
|
||||
G4int lastRC;
|
||||
public:
|
||||
static G4int InSession() { return inSession; }
|
||||
G4int GetLastReturnCode() const { return lastRC; }
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -75,6 +75,7 @@ G4UIbatch::G4UIbatch(const char* fileName, G4UIsession* prevSession)
|
||||
G4cerr << "ERROR: Can not open a macro file <"
|
||||
<< fileName << ">. Set macro path with \"/control/macroPath\" if needed."
|
||||
<< G4endl;
|
||||
lastRC = fParameterUnreadable;
|
||||
} else {
|
||||
isOpened= true;
|
||||
}
|
||||
@@ -215,6 +216,7 @@ G4UIsession * G4UIbatch::SessionStart()
|
||||
G4int rc= ExecCommand(newCommand);
|
||||
if(rc != fCommandSucceeded) {
|
||||
G4cerr << G4endl << "***** Batch is interrupted!! *****" << G4endl;
|
||||
lastRC = rc;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -374,7 +374,14 @@ void G4UIcontrolMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
|
||||
}
|
||||
if(command==ExecuteCommand)
|
||||
{
|
||||
command->ResetFailure();
|
||||
UI-> ExecuteMacroFile(UI-> FindMacroPath(newValue));
|
||||
if(UI->GetLastReturnCode() != 0)
|
||||
{
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Command aborted (" << UI->GetLastReturnCode() << ")";
|
||||
command->CommandFailed(UI->GetLastReturnCode(),ed);
|
||||
}
|
||||
}
|
||||
if(command==suppressAbortionCommand)
|
||||
{
|
||||
@@ -414,6 +421,7 @@ void G4UIcontrolMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
|
||||
}
|
||||
if(command==getEnvCmd)
|
||||
{
|
||||
command->ResetFailure();
|
||||
if(getenv(newValue))
|
||||
{
|
||||
G4String st = "/control/alias ";
|
||||
@@ -423,7 +431,11 @@ void G4UIcontrolMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
|
||||
UI->ApplyCommand(st);
|
||||
}
|
||||
else
|
||||
{ G4cerr << "<" << newValue << "> is not defined as a shell variable. Command ignored." << G4endl; }
|
||||
{
|
||||
G4ExceptionDescription ed;
|
||||
ed << "<" << newValue << "> is not defined as a shell variable. Command ignored.";
|
||||
command->CommandFailed(ed);
|
||||
}
|
||||
}
|
||||
if(command==getValCmd)
|
||||
{
|
||||
@@ -451,16 +463,36 @@ void G4UIcontrolMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
|
||||
{ G4cout << UI->SolveAlias(newValue) << G4endl; }
|
||||
if(command==shellCommand)
|
||||
{
|
||||
command->ResetFailure();
|
||||
int rc = system(newValue);
|
||||
if ( rc < 0 ) {}
|
||||
if ( rc < 0 )
|
||||
{
|
||||
G4ExceptionDescription ed;
|
||||
ed << "<" << newValue << "> is not a valid shell command. Command ignored.";
|
||||
command->CommandFailed(ed);
|
||||
}
|
||||
}
|
||||
if(command==loopCommand)
|
||||
{
|
||||
command->ResetFailure();
|
||||
UI->LoopS(newValue);
|
||||
if(UI->GetLastReturnCode() != 0)
|
||||
{
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Command aborted (" << UI->GetLastReturnCode() << ")";
|
||||
command->CommandFailed(UI->GetLastReturnCode(),ed);
|
||||
}
|
||||
}
|
||||
if(command==foreachCommand)
|
||||
{
|
||||
command->ResetFailure();
|
||||
UI->ForeachS(newValue);
|
||||
if(UI->GetLastReturnCode() != 0)
|
||||
{
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Command aborted (" << UI->GetLastReturnCode() << ")";
|
||||
command->CommandFailed(UI->GetLastReturnCode(),ed);
|
||||
}
|
||||
}
|
||||
if(command==HTMLCommand)
|
||||
{
|
||||
|
||||
@@ -90,7 +90,7 @@ G4UImanager::G4UImanager()
|
||||
UImessenger(0), UnitsMessenger(0), CoutMessenger(0),
|
||||
isMaster(false),bridges(0),
|
||||
ignoreCmdNotFound(false), stackCommandsForBroadcast(false),
|
||||
threadID(-1), threadCout(0)
|
||||
threadID(-1), threadCout(0), lastRC(0)
|
||||
{
|
||||
savedCommand = 0;
|
||||
treeTop = new G4UIcommandTree("/");
|
||||
@@ -312,7 +312,9 @@ void G4UImanager::ExecuteMacroFile(const char * fileName)
|
||||
{
|
||||
G4UIsession* batchSession = new G4UIbatch(fileName,session);
|
||||
session = batchSession;
|
||||
lastRC = 0;
|
||||
G4UIsession* previousSession = session->SessionStart();
|
||||
lastRC = session->GetLastReturnCode();
|
||||
delete session;
|
||||
session = previousSession;
|
||||
}
|
||||
@@ -403,6 +405,14 @@ void G4UImanager::Foreach(const char * macroFile,const char * variableName,
|
||||
vl += cd;
|
||||
SetAlias(vl);
|
||||
ExecuteMacroFile(FindMacroPath(macroFile));
|
||||
if(lastRC!=0)
|
||||
{
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Loop aborted due to a command execution error - "
|
||||
<< "error code " << lastRC;
|
||||
G4Exception("G4UImanager::Foreach","UIMAN0201",JustWarning,ed);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,12 +31,12 @@
|
||||
#include "G4UIsession.hh"
|
||||
|
||||
G4int G4UIsession::inSession = 0;
|
||||
G4UIsession::G4UIsession() : ifBatch(0)
|
||||
G4UIsession::G4UIsession() : ifBatch(0) , lastRC(0)
|
||||
{
|
||||
inSession++;
|
||||
}
|
||||
|
||||
G4UIsession::G4UIsession(G4int iBatch) : ifBatch(iBatch)
|
||||
G4UIsession::G4UIsession(G4int iBatch) : ifBatch(iBatch) , lastRC(0)
|
||||
{;}
|
||||
|
||||
G4UIsession::~G4UIsession()
|
||||
|
||||
Reference in New Issue
Block a user