Import Geant4 11.0.1 source tree
This commit is contained in:
@@ -16,6 +16,11 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
14 December, 2021 M. Asai (intercoms-V10-07-15)
|
||||
- Check and set proper argument types for each individual argument when
|
||||
G4GenericMessenger::DeclareMethod() is used. Addressing to the Bugzilla
|
||||
report #2420.
|
||||
|
||||
26 October, 2021 M. Asai (intercoms-V10-07-14)
|
||||
- G4UIcommandTree, G4UIdirectory, G4GenericMessenger
|
||||
- Improve output HTML file layout (L.Garnier)
|
||||
|
||||
@@ -128,10 +128,13 @@ class G4GenericMessenger : public G4UImessenger
|
||||
return SetUnit(u, UnitDefault);
|
||||
}
|
||||
Command& SetParameterName(const G4String&, G4bool, G4bool = false);
|
||||
Command& SetParameterName(G4int pIdx, const G4String&, G4bool, G4bool = false);
|
||||
Command& SetParameterName(const G4String&, const G4String&, const G4String&,
|
||||
G4bool, G4bool = false);
|
||||
Command& SetDefaultValue(const G4String&);
|
||||
Command& SetDefaultValue(G4int pIdx, const G4String&);
|
||||
Command& SetCandidates(const G4String&);
|
||||
Command& SetCandidates(G4int pIdx, const G4String&);
|
||||
Command& SetToBeBroadcasted(G4bool s0)
|
||||
{
|
||||
command->SetToBeBroadcasted(s0);
|
||||
|
||||
@@ -152,7 +152,22 @@ G4GenericMessenger::Command& G4GenericMessenger::DeclareMethod(
|
||||
cmd->SetGuidance(doc);
|
||||
for(std::size_t i = 0; i < fun.NArg(); ++i)
|
||||
{
|
||||
cmd->SetParameter(new G4UIparameter("arg", 's', false));
|
||||
G4String argNam = "arg" + ItoS(i);
|
||||
char ptype = 's';
|
||||
auto& tInfo = fun.ArgType(i);
|
||||
if(tInfo == typeid(int) || tInfo == typeid(long) ||
|
||||
tInfo == typeid(unsigned int) ||
|
||||
tInfo == typeid(unsigned long))
|
||||
{ ptype = 'i'; }
|
||||
else if(tInfo == typeid(float) || tInfo == typeid(double))
|
||||
{ ptype = 'd'; }
|
||||
else if(tInfo == typeid(bool))
|
||||
{ ptype = 'b'; }
|
||||
else if(tInfo == typeid(G4String))
|
||||
{ ptype = 's'; }
|
||||
else
|
||||
{ ptype = 's'; }
|
||||
cmd->SetParameter(new G4UIparameter(argNam, ptype, false));
|
||||
}
|
||||
return methods[name] = Method(fun, object, cmd);
|
||||
}
|
||||
@@ -323,8 +338,21 @@ G4GenericMessenger::Command& G4GenericMessenger::Command::SetUnit(
|
||||
|
||||
G4GenericMessenger::Command& G4GenericMessenger::Command::SetParameterName(
|
||||
const G4String& name, G4bool omittable, G4bool currentAsDefault)
|
||||
{
|
||||
return SetParameterName(0,name,omittable,currentAsDefault);
|
||||
}
|
||||
|
||||
G4GenericMessenger::Command& G4GenericMessenger::Command::SetParameterName(
|
||||
G4int pIdx,
|
||||
const G4String& name, G4bool omittable, G4bool currentAsDefault)
|
||||
{
|
||||
G4UIparameter* theParam = command->GetParameter(0);
|
||||
if(pIdx < 0 || pIdx >= (G4int)(command->GetParameterEntries()))
|
||||
{
|
||||
G4cerr << "Invalid parameter index : " << pIdx << "\nMethod ignored."
|
||||
<< G4endl;
|
||||
return *this;
|
||||
}
|
||||
G4UIparameter* theParam = command->GetParameter(pIdx);
|
||||
theParam->SetParameterName(name);
|
||||
theParam->SetOmittable(omittable);
|
||||
theParam->SetCurrentAsDefault(currentAsDefault);
|
||||
@@ -359,7 +387,19 @@ G4GenericMessenger::Command& G4GenericMessenger::Command::SetParameterName(
|
||||
G4GenericMessenger::Command& G4GenericMessenger::Command::SetCandidates(
|
||||
const G4String& candList)
|
||||
{
|
||||
G4UIparameter* theParam = command->GetParameter(0);
|
||||
return SetCandidates(0,candList);
|
||||
}
|
||||
|
||||
G4GenericMessenger::Command& G4GenericMessenger::Command::SetCandidates(
|
||||
G4int pIdx, const G4String& candList)
|
||||
{
|
||||
if(pIdx < 0 || pIdx >= (G4int)(command->GetParameterEntries()))
|
||||
{
|
||||
G4cerr << "Invalid parameter index : " << pIdx << "\nMethod ignored."
|
||||
<< G4endl;
|
||||
return *this;
|
||||
}
|
||||
G4UIparameter* theParam = command->GetParameter(pIdx);
|
||||
theParam->SetParameterCandidates(candList);
|
||||
return *this;
|
||||
}
|
||||
@@ -367,7 +407,19 @@ G4GenericMessenger::Command& G4GenericMessenger::Command::SetCandidates(
|
||||
G4GenericMessenger::Command& G4GenericMessenger::Command::SetDefaultValue(
|
||||
const G4String& defVal)
|
||||
{
|
||||
G4UIparameter* theParam = command->GetParameter(0);
|
||||
return SetDefaultValue(0,defVal);
|
||||
}
|
||||
|
||||
G4GenericMessenger::Command& G4GenericMessenger::Command::SetDefaultValue(
|
||||
G4int pIdx, const G4String& defVal)
|
||||
{
|
||||
if(pIdx < 0 || pIdx >= (G4int)(command->GetParameterEntries()))
|
||||
{
|
||||
G4cerr << "Invalid parameter index : " << pIdx << "\nMethod ignored."
|
||||
<< G4endl;
|
||||
return *this;
|
||||
}
|
||||
G4UIparameter* theParam = command->GetParameter(pIdx);
|
||||
theParam->SetDefaultValue(defVal);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user