11#include " DesignSource.h"
22
3- #include " Debug/Debug.h"
4- #include " Beamline/Objects/Objects.h"
53#include < filesystem>
4+
5+ #include " Beamline/Objects/Objects.h"
6+ #include " Debug/Debug.h"
67namespace RAYX {
78
89std::vector<Ray> DesignSource::compile (int i) const {
910 std::vector<Ray> ray;
1011
11- if (getName () == " Point Source" ) {
12+ if (getType () == " Point Source" ) {
1213 PointSource ps (*this );
1314 ray = ps.getRays (i);
14- } else if (getName () == " Matrix Source" ) {
15+ } else if (getType () == " Matrix Source" ) {
1516 MatrixSource ms (*this );
16- ray = ms.getRays (i);
17- } else if (getName () == " Dipole Source" ) {
17+ ray = ms.getRays (i);
18+ } else if (getType () == " Dipole Source" ) {
1819 DipoleSource ds (*this );
1920 ray = ds.getRays (i);
20- } else if (getName () == " Pixel Source" ) {
21+ } else if (getType () == " Pixel Source" ) {
2122 PixelSource ps (*this );
2223 ray = ps.getRays (i);
23- } else if (getName () == " Circle Source" ) {
24+ } else if (getType () == " Circle Source" ) {
2425 CircleSource cs (*this );
2526 ray = cs.getRays (i);
26- } else if (getName () == " Simple Undulator" ) {
27+ } else if (getType () == " Simple Undulator" ) {
2728 SimpleUndulatorSource su (*this );
2829 ray = su.getRays (i);
2930 }
@@ -35,6 +36,7 @@ void DesignSource::setName(std::string s) { m_elementParameters["name"] = s; }
3536void DesignSource::setType (std::string s) { m_elementParameters[" type" ] = s; }
3637
3738std::string DesignSource::getName () const { return m_elementParameters[" name" ].as_string (); }
39+ std::string DesignSource::getType () const { return m_elementParameters[" type" ].as_string (); }
3840
3941void DesignSource::setWorldPosition (glm::dvec4 p) {
4042 m_elementParameters[" worldPosition" ] = Map ();
@@ -181,7 +183,9 @@ void DesignSource::setElectronEnergy(double value) { m_elementParameters["electr
181183double DesignSource::getElectronEnergy () const { return m_elementParameters[" electronEnergy" ].as_double (); }
182184
183185void DesignSource::setElectronEnergyOriantation (ElectronEnergyOrientation value) { m_elementParameters[" electronEnergyOriantation" ] = value; }
184- ElectronEnergyOrientation DesignSource::getElectronEnergyOrientation () const { return m_elementParameters[" electronEnergyOriantation" ].as_electronEnergyOrientation (); }
186+ ElectronEnergyOrientation DesignSource::getElectronEnergyOrientation () const {
187+ return m_elementParameters[" electronEnergyOriantation" ].as_electronEnergyOrientation ();
188+ }
185189
186190void DesignSource::setEnergySpread (double value) { m_elementParameters[" energySpread" ] = value; }
187191double DesignSource::getEnergySpread () const { return m_elementParameters[" energySpread" ].as_double (); }
0 commit comments