Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
OPAL
src
Commits
4022141e
Commit
4022141e
authored
Apr 16, 2021
by
ext-calvo_p
Browse files
Resolve "Extend the list of symbolic constant"
parent
cefb9216
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
174 additions
and
198 deletions
+174
-198
src/ValueDefinitions/BoolConstant.cpp
src/ValueDefinitions/BoolConstant.cpp
+16
-18
src/ValueDefinitions/BoolConstant.h
src/ValueDefinitions/BoolConstant.h
+16
-19
src/ValueDefinitions/RealConstant.cpp
src/ValueDefinitions/RealConstant.cpp
+30
-30
src/ValueDefinitions/RealConstant.h
src/ValueDefinitions/RealConstant.h
+16
-19
src/ValueDefinitions/RealVariable.cpp
src/ValueDefinitions/RealVariable.cpp
+16
-18
src/ValueDefinitions/RealVariable.h
src/ValueDefinitions/RealVariable.h
+16
-18
src/ValueDefinitions/RealVector.cpp
src/ValueDefinitions/RealVector.cpp
+16
-18
src/ValueDefinitions/RealVector.h
src/ValueDefinitions/RealVector.h
+16
-19
src/ValueDefinitions/StringConstant.cpp
src/ValueDefinitions/StringConstant.cpp
+16
-20
src/ValueDefinitions/StringConstant.h
src/ValueDefinitions/StringConstant.h
+16
-19
No files found.
src/ValueDefinitions/BoolConstant.cpp
View file @
4022141e
// ------------------------------------------------------------------------
// $RCSfile: BoolConstant.cpp,v $
// ------------------------------------------------------------------------
// $Revision: 1.2 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class
:
BoolConstant
//
Implements a
BOOL
_
CONSTANT definition.
// Class BoolConstant
//
The
BOOL
CONSTANT definition.
//
// ------------------------------------------------------------------------
// Copyright (c) 2000 - 2021, Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved
//
// $Date: 2001/08/13 15:26:42 $
// $Author: jowett $
// This file is part of OPAL.
//
// OPAL is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// You should have received a copy of the GNU General Public License
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
// ------------------------------------------------------------------------
#include "ValueDefinitions/BoolConstant.h"
#include "Attributes/Attributes.h"
#include "Utilities/Options.h"
#include <iostream>
#include <iostream>
// Class BoolConstant
// ------------------------------------------------------------------------
BoolConstant
::
BoolConstant
()
:
ValueDefinition
(
1
,
"BOOL_CONSTANT"
,
...
...
@@ -67,4 +65,4 @@ void BoolConstant::print(std::ostream &os) const {
void
BoolConstant
::
printValue
(
std
::
ostream
&
os
)
const
{
os
<<
itsAttr
[
0
];
}
\ No newline at end of file
}
src/ValueDefinitions/BoolConstant.h
View file @
4022141e
#ifndef OPAL_BoolConstant_HH
#define OPAL_BoolConstant_HH
// ------------------------------------------------------------------------
// $RCSfile: BoolConstant.h,v $
// ------------------------------------------------------------------------
// $Revision: 1.1.1.1 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class: BoolConstant
// Class BoolConstant
// The BOOL CONSTANT definition.
//
// Copyright (c) 2000 - 2021, Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved
//
// This file is part of OPAL.
//
// ------------------------------------------------------------------------
// OPAL is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
$Date: 2000/03/27 09:33:49 $
//
$Author: Andreas Adelmann $
//
You should have received a copy of the GNU General Public License
//
along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
// ------------------------------------------------------------------------
#ifndef OPAL_BoolConstant_HH
#define OPAL_BoolConstant_HH
#include "AbstractObjects/ValueDefinition.h"
// Class BoolConstant
// ------------------------------------------------------------------------
/// The BOOL CONSTANT definition.
class
BoolConstant
:
public
ValueDefinition
{
public:
...
...
@@ -59,4 +56,4 @@ private:
BoolConstant
(
const
std
::
string
&
name
,
BoolConstant
*
parent
);
};
#endif // OPAL_BoolConstant_HH
\ No newline at end of file
#endif // OPAL_BoolConstant_HH
src/ValueDefinitions/RealConstant.cpp
View file @
4022141e
// ------------------------------------------------------------------------
// $RCSfile: RealConstant.cpp,v $
// ------------------------------------------------------------------------
// $Revision: 1.2 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class
:
RealConstant
//
Implements a
REAL
_
CONSTANT definition.
// Class RealConstant
//
The
REAL
CONSTANT definition.
//
// ------------------------------------------------------------------------
// Copyright (c) 2000 - 2021, Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved
//
// $Date: 2001/08/13 15:26:42 $
// $Author: jowett $
// This file is part of OPAL.
//
// OPAL is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// You should have received a copy of the GNU General Public License
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
// ------------------------------------------------------------------------
#include "ValueDefinitions/RealConstant.h"
#include "AbstractObjects/OpalData.h"
#include "Attributes/Attributes.h"
#include "Utilities/Options.h"
#include "Physics/Physics.h"
#include "OPALconfig.h"
#include "Physics/Physics.h"
#include "Utilities/Options.h"
#include "Utility/IpplInfo.h"
#include <cmath>
#include <iostream>
// Class RealConstant
// ------------------------------------------------------------------------
RealConstant
::
RealConstant
()
:
ValueDefinition
(
1
,
"REAL_CONSTANT"
,
...
...
@@ -44,20 +41,23 @@ RealConstant::RealConstant():
OpalData
*
opal
=
OpalData
::
getInstance
();
opal
->
create
(
new
RealConstant
(
"PI"
,
this
,
Physics
::
pi
));
opal
->
create
(
new
RealConstant
(
"TWOPI"
,
this
,
Physics
::
two_pi
));
opal
->
create
(
new
RealConstant
(
"RADDEG"
,
this
,
180.0
/
Physics
::
pi
));
opal
->
create
(
new
RealConstant
(
"DEGRAD"
,
this
,
Physics
::
pi
/
180.0
));
opal
->
create
(
new
RealConstant
(
"RADDEG"
,
this
,
Physics
::
rad2deg
));
opal
->
create
(
new
RealConstant
(
"DEGRAD"
,
this
,
Physics
::
deg2rad
));
opal
->
create
(
new
RealConstant
(
"E"
,
this
,
Physics
::
e
));
opal
->
create
(
new
RealConstant
(
"EMASS"
,
this
,
Physics
::
m_e
));
opal
->
create
(
new
RealConstant
(
"PMASS"
,
this
,
Physics
::
m_p
));
opal
->
create
(
new
RealConstant
(
"HMMASS"
,
this
,
Physics
::
m_hm
));
opal
->
create
(
new
RealConstant
(
"UMASS"
,
this
,
Physics
::
m_u
));
opal
->
create
(
new
RealConstant
(
"CMASS"
,
this
,
Physics
::
m_c
));
opal
->
create
(
new
RealConstant
(
"MMASS"
,
this
,
Physics
::
m_mu
));
opal
->
create
(
new
RealConstant
(
"DMASS"
,
this
,
Physics
::
m_d
));
opal
->
create
(
new
RealConstant
(
"XEMASS"
,
this
,
Physics
::
m_xe
));
opal
->
create
(
new
RealConstant
(
"MUMASS"
,
this
,
Physics
::
m_mu
));
opal
->
create
(
new
RealConstant
(
"EMASS"
,
this
,
Physics
::
m_e
));
opal
->
create
(
new
RealConstant
(
"PMASS"
,
this
,
Physics
::
m_p
));
opal
->
create
(
new
RealConstant
(
"HMMASS"
,
this
,
Physics
::
m_hm
));
opal
->
create
(
new
RealConstant
(
"H2PMASS"
,
this
,
Physics
::
m_h2p
));
opal
->
create
(
new
RealConstant
(
"DMASS"
,
this
,
Physics
::
m_d
));
opal
->
create
(
new
RealConstant
(
"ALPHAMASS"
,
this
,
Physics
::
m_alpha
));
opal
->
create
(
new
RealConstant
(
"CMASS"
,
this
,
Physics
::
m_c
));
opal
->
create
(
new
RealConstant
(
"XEMASS"
,
this
,
Physics
::
m_xe
));
opal
->
create
(
new
RealConstant
(
"UMASS"
,
this
,
Physics
::
m_u
));
opal
->
create
(
new
RealConstant
(
"CLIGHT"
,
this
,
Physics
::
c
));
opal
->
create
(
new
RealConstant
(
"AMU"
,
this
,
Physics
::
amu
));
opal
->
create
(
new
RealConstant
(
"OPALVERSION"
,
this
,
OPAL_VERSION_MAJOR
*
10000
+
OPAL_VERSION_MINOR
*
100
...
...
@@ -106,4 +106,4 @@ void RealConstant::print(std::ostream &os) const {
void
RealConstant
::
printValue
(
std
::
ostream
&
os
)
const
{
os
<<
itsAttr
[
0
];
}
\ No newline at end of file
}
src/ValueDefinitions/RealConstant.h
View file @
4022141e
#ifndef OPAL_RealConstant_HH
#define OPAL_RealConstant_HH
// ------------------------------------------------------------------------
// $RCSfile: RealConstant.h,v $
// ------------------------------------------------------------------------
// $Revision: 1.1.1.1 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class: RealConstant
// Class RealConstant
// The REAL CONSTANT definition.
//
// Copyright (c) 2000 - 2021, Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved
//
// This file is part of OPAL.
//
// ------------------------------------------------------------------------
// OPAL is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
$Date: 2000/03/27 09:33:49 $
//
$Author: Andreas Adelmann $
//
You should have received a copy of the GNU General Public License
//
along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
// ------------------------------------------------------------------------
#ifndef OPAL_RealConstant_HH
#define OPAL_RealConstant_HH
#include "AbstractObjects/ValueDefinition.h"
// Class RealConstant
// ------------------------------------------------------------------------
/// The REAL CONSTANT definition.
class
RealConstant
:
public
ValueDefinition
{
public:
...
...
@@ -62,4 +59,4 @@ private:
RealConstant
(
const
std
::
string
&
name
,
RealConstant
*
parent
);
};
#endif // OPAL_RealConstant_HH
\ No newline at end of file
#endif // OPAL_RealConstant_HH
src/ValueDefinitions/RealVariable.cpp
View file @
4022141e
// ------------------------------------------------------------------------
// $RCSfile: RealVariable.cpp,v $
// ------------------------------------------------------------------------
// $Revision: 1.3 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class
:
RealVariable
//
Implements a OPAL
REAL
_
VARIABLE definition.
// Class RealVariable
//
The
REAL
VARIABLE definition.
//
// ------------------------------------------------------------------------
// Copyright (c) 2000 - 2021, Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved
//
// $Date: 2001/08/13 15:26:42 $
// $Author: jowett $
// This file is part of OPAL.
//
// OPAL is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// You should have received a copy of the GNU General Public License
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
// ------------------------------------------------------------------------
#include "ValueDefinitions/RealVariable.h"
#include "AbstractObjects/OpalData.h"
#include "Attributes/Attributes.h"
#include <iostream>
#include <iostream>
// Class RealVariable
// ------------------------------------------------------------------------
RealVariable
::
RealVariable
()
:
ValueDefinition
(
1
,
"REAL_VARIABLE"
,
...
...
@@ -82,4 +80,4 @@ void RealVariable::print(std::ostream &os) const {
void
RealVariable
::
printValue
(
std
::
ostream
&
os
)
const
{
os
<<
itsAttr
[
0
];
}
\ No newline at end of file
}
src/ValueDefinitions/RealVariable.h
View file @
4022141e
#ifndef OPAL_RealVariable_HH
#define OPAL_RealVariable_HH
// ------------------------------------------------------------------------
// $RCSfile: RealVariable.h,v $
// ------------------------------------------------------------------------
// $Revision: 1.1.1.1 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class: RealVariable
// Class RealVariable
// The REAL VARIABLE definition.
//
// Copyright (c) 2000 - 2021, Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved
//
//
------------------------------------------------------------------------
//
This file is part of OPAL.
//
// $Date: 2000/03/27 09:33:49 $
// $Author: Andreas Adelmann $
// OPAL is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ------------------------------------------------------------------------
// You should have received a copy of the GNU General Public License
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
#ifndef OPAL_RealVariable_HH
#define OPAL_RealVariable_HH
#include "AbstractObjects/ValueDefinition.h"
// Class RealVariable
// ------------------------------------------------------------------------
/// The REAL VARIABLE definition.
class
RealVariable
:
public
ValueDefinition
{
...
...
@@ -61,4 +59,4 @@ private:
RealVariable
(
const
std
::
string
&
name
,
RealVariable
*
parent
);
};
#endif // OPAL_RealVariable_HH
\ No newline at end of file
#endif // OPAL_RealVariable_HH
src/ValueDefinitions/RealVector.cpp
View file @
4022141e
// ------------------------------------------------------------------------
// $RCSfile: RealVector.cpp,v $
// ------------------------------------------------------------------------
// $Revision: 1.1.1.1 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class
:
RealVector
//
Implements a OPAL
REAL
_
VECTOR definition.
// Class RealVector
//
The
REAL
VECTOR definition.
//
// ------------------------------------------------------------------------
// Copyright (c) 2000 - 2021, Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved
//
// $Date: 2000/03/27 09:33:49 $
// $Author: Andreas Adelmann $
// This file is part of OPAL.
//
// OPAL is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// You should have received a copy of the GNU General Public License
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
// ------------------------------------------------------------------------
#include "ValueDefinitions/RealVector.h"
#include "Attributes/Attributes.h"
#include "Utilities/Options.h"
#include <iostream>
#include <vector>
// Class RealVector
// ------------------------------------------------------------------------
RealVector
::
RealVector
()
:
ValueDefinition
(
1
,
"REAL_VECTOR"
,
"The
\"
REAL VECTOR
\"
statement defines a global "
...
...
@@ -70,4 +68,4 @@ void RealVector::printValue(std::ostream &os) const {
double
RealVector
::
getRealComponent
(
int
index
)
const
{
std
::
vector
<
double
>
array
=
Attributes
::
getRealArray
(
itsAttr
[
0
]);
return
array
[
index
-
1
];
}
\ No newline at end of file
}
src/ValueDefinitions/RealVector.h
View file @
4022141e
#ifndef OPAL_RealVector_HH
#define OPAL_RealVector_HH
// ------------------------------------------------------------------------
// $RCSfile: RealVector.h,v $
// ------------------------------------------------------------------------
// $Revision: 1.1.1.1 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class: RealVector
// Class RealVector
// The REAL VECTOR definition.
//
// Copyright (c) 2000 - 2021, Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved
//
// This file is part of OPAL.
//
// ------------------------------------------------------------------------
// OPAL is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
$Date: 2000/03/27 09:33:49 $
//
$Author: Andreas Adelmann $
//
You should have received a copy of the GNU General Public License
//
along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
// ------------------------------------------------------------------------
#ifndef OPAL_RealVector_HH
#define OPAL_RealVector_HH
#include "AbstractObjects/ValueDefinition.h"
// Class RealVector
// ------------------------------------------------------------------------
/// The REAL VECTOR definition.
class
RealVector
:
public
ValueDefinition
{
public:
...
...
@@ -59,4 +56,4 @@ private:
RealVector
(
const
std
::
string
&
name
,
RealVector
*
parent
);
};
#endif // OPAL_RealVector_HH
\ No newline at end of file
#endif // OPAL_RealVector_HH
src/ValueDefinitions/StringConstant.cpp
View file @
4022141e
// ------------------------------------------------------------------------
// $RCSfile: StringConstant.cpp,v $
// ------------------------------------------------------------------------
// $Revision: 1.2 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class
:
StringConstant
//
Implements a OPAL
STRING
_
CONSTANT definition.
// Class StringConstant
//
The
STRING
CONSTANT definition.
//
// ------------------------------------------------------------------------
// Copyright (c) 2000 - 2021, Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved
//
// $Date: 2001/08/13 15:26:42 $
// $Author: jowett $
// This file is part of OPAL.
//
// OPAL is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// You should have received a copy of the GNU General Public License
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
// ------------------------------------------------------------------------
#include "ValueDefinitions/StringConstant.h"
#include "AbstractObjects/OpalData.h"
#include "Attributes/Attributes.h"
#include "Utilities/Util.h"
#include <iostream>
#include <iostream>
// Class StringConstant
// ------------------------------------------------------------------------
StringConstant
::
StringConstant
()
:
ValueDefinition
(
1
,
"STRING_CONSTANT"
,
...
...
@@ -68,13 +66,11 @@ StringConstant *StringConstant::clone(const std::string &name) {
}
std
::
string
StringConstant
::
getString
()
const
{
return
Attributes
::
getString
(
itsAttr
[
0
]);
}
void
StringConstant
::
print
(
std
::
ostream
&
os
)
const
{
os
<<
"STRING "
<<
getOpalName
()
<<
'='
<<
itsAttr
[
0
]
<<
';'
;
os
<<
std
::
endl
;
...
...
@@ -82,4 +78,4 @@ void StringConstant::print(std::ostream &os) const {
void
StringConstant
::
printValue
(
std
::
ostream
&
os
)
const
{
os
<<
itsAttr
[
0
];
}
\ No newline at end of file
}
src/ValueDefinitions/StringConstant.h
View file @
4022141e
#ifndef OPAL_StringConstant_HH
#define OPAL_StringConstant_HH
// ------------------------------------------------------------------------
// $RCSfile: StringConstant.h,v $
// ------------------------------------------------------------------------
// $Revision: 1.1.1.1 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class: StringConstant
// Class StringConstant
// The STRING CONSTANT definition.
//
// Copyright (c) 2000 - 2021, Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved
//
// This file is part of OPAL.
//
// ------------------------------------------------------------------------
// OPAL is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
$Date: 2000/03/27 09:33:49 $
//
$Author: Andreas Adelmann $
//
You should have received a copy of the GNU General Public License
//
along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
// ------------------------------------------------------------------------
#ifndef OPAL_StringConstant_HH
#define OPAL_StringConstant_HH
#include "AbstractObjects/ValueDefinition.h"
// Class StringConstant
// ------------------------------------------------------------------------
/// The STRING CONSTANT definition.
class
StringConstant
:
public
ValueDefinition
{
public:
...
...
@@ -60,4 +57,4 @@ private:
StringConstant
(
const
std
::
string
&
name
,
StringConstant
*
parent
,
const
std
::
string
&
value
);
};
#endif // OPAL_StringConstant_HH
\ No newline at end of file
#endif // OPAL_StringConstant_HH
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment