56 : toBeBroadcasted(tBB)
57 , messenger(theMessenger)
102 <<
"> is defined without vaild messenger.";
103 G4Exception(
"G4UIcommand::SetCommandType",
"UI2031",
109 ed <<
"G4UIcommand Warning : \n"
111 <<
" '/' is appended.";
112 G4Exception(
"G4UIcommand::SetCommandType",
"UI2032",
130 for(
G4int i_thParameter = 0; i_thParameter < n_parameterEntry;
155 if(n_parameterEntry != 0)
160 for(
G4int i_thParameter = 0; i_thParameter < n_parameterEntry;
163 if(i_thParameter > 0)
165 correctParameters.append(
" ");
167 aToken = parameterToken();
168 if(aToken.length() > 0 && aToken[0] ==
'"')
170 while(aToken.back() !=
'"' ||
171 (aToken.length() == 1 && aToken[0] ==
'"'))
173 G4String additionalToken = parameterToken();
174 if(additionalToken.empty())
179 aToken += additionalToken;
182 else if(i_thParameter == n_parameterEntry - 1 &&
183 parameter[i_thParameter]->GetParameterType() ==
's')
186 while(!((anotherToken = parameterToken()).
empty()))
188 G4int idxs = anotherToken.find(
"#");
189 if(idxs ==
G4int(std::string::npos))
192 aToken += anotherToken;
197 aToken += anotherToken.substr(0, idxs);
207 if(aToken.empty() || aToken ==
"!")
209 if(
parameter[i_thParameter]->IsOmittable())
211 if(
parameter[i_thParameter]->GetCurrentAsDefault())
215 for(
G4int ii = 0; ii < i_thParameter; ++ii)
220 while(parVal.back() !=
'"')
223 if(additionalToken.empty())
228 parVal += additionalToken;
233 if(aCVToken[0] ==
'"')
235 while(aCVToken.back() !=
'"')
238 if(additionalToken.empty())
243 aCVToken += additionalToken;
246 correctParameters.append(aCVToken);
250 correctParameters.append(
251 parameter[i_thParameter]->GetDefaultValue());
263 return stat + i_thParameter;
264 correctParameters.append(aToken);
350 for(
G4int i = 0; i < nState; ++i)
382 for(i = 0; i < UTbl.size(); ++i)
384 if(UTbl[i]->GetName() == unitCategory)
389 G4cerr <<
"Unit category <" << unitCategory <<
"> is not defined."
394 retStr = UCnt[0]->GetSymbol();
395 G4int je = UCnt.size();
396 for(
G4int j = 1; j < je; ++j)
399 retStr += UCnt[j]->GetSymbol();
401 for(
G4int k = 0; k < je; ++k)
404 retStr += UCnt[k]->GetName();
420 G4cout <<
" ---- available only in worker thread" <<
G4endl;
424 for(
G4int i_thGuidance = 0; i_thGuidance < n_guidanceEntry; ++i_thGuidance)
433 if(n_parameterEntry > 0)
435 for(
G4int i_thParameter = 0; i_thParameter < n_parameterEntry;
456 std::ostringstream os;
465 std::ostringstream os;
474 std::ostringstream os;
477 os << std::setprecision(17) << doubleValue;
489 const char* unitName)
494 std::ostringstream os;
497 os << std::setprecision(17) << doubleValue / uv <<
" " << unitName;
501 os << doubleValue / uv <<
" " << unitName;
510 std::ostringstream os;
513 os << std::setprecision(17) << vec.
x() <<
" " << vec.
y() <<
" " << vec.
z();
517 os << vec.
x() <<
" " << vec.
y() <<
" " << vec.
z();
529 std::ostringstream os;
532 os << std::setprecision(17) << vec.
x() / uv <<
" " << vec.
y() / uv <<
" "
533 << vec.
z() / uv <<
" " << unitName;
537 os << vec.
x() / uv <<
" " << vec.
y() / uv <<
" " << vec.
z() / uv <<
" "
549 if(v ==
"Y" || v ==
"YES" || v ==
"1" || v ==
"T" || v ==
"TRUE")
560 std::istringstream is(st);
569 std::istringstream is(st);
578 std::istringstream is(st);
589 std::istringstream is(st);
602 std::istringstream is(st);
603 is >> vx >> vy >> vz;
614 std::istringstream is(st);
615 is >> vx >> vy >> vz >> unts;
642 std::istringstream is(t);
643 for(
unsigned i = 0; i <
parameter.size(); ++i)
646 type = toupper(
parameter[i]->GetParameterType());
652 G4cerr << aNewValue <<
": double value expected." <<
G4endl;
657 if(
IsInt(aNewValue, 10) == 0)
664 if(
IsInt(aNewValue, 20) == 0)
666 G4cerr << aNewValue <<
": long int expected." <<
G4endl;
674 if(aNewValue ==
"Y" || aNewValue ==
"N" || aNewValue ==
"YES" ||
675 aNewValue ==
"NO" || aNewValue ==
"1" || aNewValue ==
"0" ||
676 aNewValue ==
"T" || aNewValue ==
"F" || aNewValue ==
"TRUE" ||
677 aNewValue ==
"FALSE")
693 if(*p ==
'+' || *p ==
'-')
697 if(isdigit((
G4int)(*p)))
699 while(isdigit((
G4int)(*p)))
706 if(length > maxDigits)
729 if(
IsInt(str, maxExplength = 7))
746 while(isdigit((
G4int)(*p)))
763 if(*p ==
'e' || *p ==
'E')
767 while(isdigit((
G4int)(*p)))
773 if(*p ==
'e' || *p ==
'E')
788 while(isdigit((
G4int)(*p)))
794 if(*p ==
'e' || *p ==
'E')
803 while(isdigit((
G4int)(*p)))
809 if(*p ==
'e' || *p ==
'E')
816 while(isdigit((
G4int)(*p)))
822 if(*p ==
'e' || *p ==
'E')
829 if(*p ==
'e' || *p ==
'E')
833 while(isdigit((
G4int)(*p)))
839 if(*p ==
'e' || *p ==
'E')
854 std::istringstream is(t);
855 for(
unsigned i = 0; i <
parameter.size(); ++i)
857 type = toupper(
parameter[i]->GetParameterType());
886 G4cerr <<
"Illegal Expression in parameter range." <<
G4endl;
917 G4cerr <<
"Parameter range: illegal type at '||'" <<
G4endl;
927 G4cerr <<
"Parameter range: illegal type at '||'" <<
G4endl;
937 result.
I += (p.
L != 0
L);
941 result.
I += (p.
D != 0.0);
962 G4cerr <<
"Parameter range: illegal type at '&&'" <<
G4endl;
972 G4cerr <<
"Parameter range: illegal type at '&&'" <<
G4endl;
982 result.
I *= (p.
L != 0
L);
986 result.
I *= (p.
D != 0.0);
1013 result.
I =
Eval2(arg1, operat, arg2);
1016 G4cerr <<
" return code of Eval2(): " << result.
I <<
G4endl;
1023 G4cerr <<
"Parameter range: error at EqualityExpression" <<
G4endl;
1046 result.
I =
Eval2(arg1, operat, arg2);
1049 G4cerr <<
" return code of Eval2(): " << result.
I <<
G4endl;
1069 G4cerr <<
"Parameter range: operator " << (char)
token <<
" is not supported."
1082 G4cerr <<
"Parameter range: operator " << (char)
token <<
" is not supported."
1123 G4cerr <<
"Parameter range error: "
1124 <<
"operator '!' is not supported (sorry)." <<
G4endl;
1193 newValtype = toupper(
parameter[i]->GetParameterType());
1206 char newValtype2 = toupper(
parameter[iii]->GetParameterType());
1207 if(newValtype2 ==
'I')
1211 else if(newValtype2 ==
'L')
1213 G4cerr <<
"Warning : Integer is compared with long int : "
1217 else if(newValtype2 ==
'D')
1219 G4cerr <<
"Warning : Integer is compared with double : "
1243 char newValtype2 = toupper(
parameter[iii]->GetParameterType());
1244 if(newValtype2 ==
'I')
1248 if(newValtype2 ==
'L')
1252 else if(newValtype2 ==
'D')
1254 G4cerr <<
"Warning : Long int is compared with double : "
1284 char newValtype2 = toupper(
parameter[iii]->GetParameterType());
1285 if(newValtype2 ==
'I')
1289 else if(newValtype2 ==
'L')
1293 else if(newValtype2 ==
'D')
1306 newValtype = toupper(
parameter[i]->GetParameterType());
1355 result = (arg1 > arg2);
1359 result = (arg1 >= arg2);
1363 result = (arg1 < arg2);
1367 result = (arg1 <= arg2);
1371 result = (arg1 == arg2);
1375 result = (arg1 != arg2);
1379 G4cerr <<
"Parameter range: error at CompareInt" <<
G4endl;
1383 G4cerr <<
"CompareInt " << arg1 <<
" " << opr << arg2 <<
" result: " << result
1397 result = (arg1 > arg2);
1401 result = (arg1 >= arg2);
1405 result = (arg1 < arg2);
1409 result = (arg1 <= arg2);
1413 result = (arg1 == arg2);
1417 result = (arg1 != arg2);
1421 G4cerr <<
"Parameter range: error at CompareInt" <<
G4endl;
1425 G4cerr <<
"CompareInt " << arg1 <<
" " << opr << arg2 <<
" result: " << result
1439 result = (arg1 > arg2);
1443 result = (arg1 >= arg2);
1447 result = (arg1 < arg2);
1451 result = (arg1 <= arg2);
1455 result = (arg1 == arg2);
1459 result = (arg1 != arg2);
1463 G4cerr <<
"Parameter range: error at CompareDouble" <<
G4endl;
1467 G4cerr <<
"CompareDouble " << arg1 <<
" " << opr <<
" " << arg2
1468 <<
" result: " << result <<
G4endl;
1487 G4cerr <<
"parameter name:" << nam <<
" not found." <<
G4endl;
1495 for(
unsigned i = 0; i <
parameter.size(); ++i)
1511 while((c =
G4UIpGetc()) ==
' ' || c ==
'\t' || c ==
'\n')
1516 if(isdigit(c) || c ==
'.')
1520 buf += (
unsigned char)c;
1522 }
while(c ==
'.' || isdigit(c) || c ==
'e' || c ==
'E' || c ==
'+' ||
1525 const char* t = buf;
1526 std::istringstream is(t);
1527 if(
IsInt(buf.data(), 20))
1543 if(isalpha(c) || c ==
'_')
1547 buf += (
unsigned char) c;
1548 }
while((c =
G4UIpGetc()) != EOF && (isalnum(c) || c ==
'_'));
1557 G4cerr << buf <<
" is not a parameter name." <<
G4endl;
G4double D(G4double temp)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
static constexpr double L
CLHEP::Hep3Vector G4ThreeVector
std::vector< G4UnitDefinition * > G4UnitsContainer
std::vector< G4UnitsCategory * > G4UnitsTable
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
const G4ApplicationState & GetCurrentState() const
static G4StateManager * GetStateManager()
void G4UIcommandCommonConstructorCode(const char *theCommandPath)
G4int TypeCheck(const char *t)
yystype MultiplicativeExpression(void)
unsigned IndexOf(const char *)
G4int CompareDouble(G4double arg1, G4int op, G4double arg2)
static G4ThreeVector ConvertTo3Vector(const char *st)
static G4String CategoryOf(const char *unitName)
yystype EqualityExpression(void)
static G4double ValueOf(const char *unitName)
unsigned IsParameter(const char *)
yystype AdditiveExpression(void)
G4int Follow(G4int expect, G4int ifyes, G4int ifno)
void SetCommandType(CommandType)
std::vector< G4ApplicationState > availabelStateList
yystype PrimaryExpression(void)
static G4long ConvertToLongInt(const char *st)
virtual G4int DoIt(G4String parameterList)
std::vector< G4UIparameter * > parameter
G4bool operator==(const G4UIcommand &right) const
static G4String ConvertToString(G4bool boolVal)
const G4String & GetCommandPath() const
G4int IsDouble(const char *str)
yystype LogicalANDExpression(void)
G4int G4UIpUngetc(G4int c)
yystype RelationalExpression(void)
G4int CompareInt(G4int arg1, G4int op, G4int arg2)
G4int CheckNewValue(const char *newValue)
static G4int ConvertToInt(const char *st)
static G4String UnitsList(const char *unitCategory)
G4UImessenger * messenger
yystype LogicalORExpression(void)
G4int IsInt(const char *str, short maxLength)
G4int ExpectExponent(const char *str)
static G4bool ConvertToBool(const char *st)
yystype UnaryExpression(void)
static G4double ConvertToDouble(const char *st)
G4int CompareLong(G4long arg1, G4int op, G4long arg2)
static G4double ConvertToDimensionedDouble(const char *st)
std::vector< G4String > commandGuidance
G4int RangeCheck(const char *t)
void AvailableForStates(G4ApplicationState s1)
G4bool operator!=(const G4UIcommand &right) const
std::vector< yystype > newVal
static G4ThreeVector ConvertToDimensioned3Vector(const char *st)
G4String GetCurrentValue()
G4int Eval2(yystype arg1, G4int op, yystype arg2)
static G4bool DoublePrecisionStr()
static G4UImanager * GetMasterUIpointer()
void AddNewCommand(G4UIcommand *newCommand)
void RemoveCommand(G4UIcommand *aCommand)
static G4UImanager * GetUIpointer()
virtual G4String GetCurrentValue(G4UIcommand *command)
G4bool CommandsShouldBeInMaster() const
virtual void SetNewValue(G4UIcommand *command, G4String newValue)
static G4double GetValueOf(const G4String &)
static G4String GetCategory(const G4String &)
static G4UnitsTable & GetUnitsTable()
void to_upper(G4String &str)
Convert string to uppercase.
G4String to_upper_copy(G4String str)
Return uppercase copy of string.
G4ProcessVectorTypeIndex typ