1 | #ifndef ABSTRACTELEMENTDEFINITION_SEEN |
---|
2 | #define ABSTRACTELEMENTDEFINITION_SEEN |
---|
3 | |
---|
4 | #include <cstdlib> |
---|
5 | #include <fstream> |
---|
6 | #include <string> |
---|
7 | |
---|
8 | #include "nomdElements.h" |
---|
9 | //#include "nomDeLogiciel.h" |
---|
10 | //#include "trivaluedBool.h" |
---|
11 | #include "abstractSoftware.h" |
---|
12 | /* #include "softwareGenerator.h" */ |
---|
13 | /* #include "softwareParmela.h" */ |
---|
14 | /* #include "softwareTest.h" */ |
---|
15 | /* #include "softwareTransport.h" */ |
---|
16 | |
---|
17 | #include "UAP/UAPNode.hpp" |
---|
18 | |
---|
19 | using namespace std; |
---|
20 | |
---|
21 | class abstractElement |
---|
22 | { |
---|
23 | |
---|
24 | protected : |
---|
25 | |
---|
26 | int nbParam_; |
---|
27 | string* parametersString_; |
---|
28 | double phaseStepMax_; |
---|
29 | |
---|
30 | double defaultLength_; |
---|
31 | double defaultAperture_; |
---|
32 | string defaultSpecificName_; |
---|
33 | |
---|
34 | string specificName_; |
---|
35 | nomdElements elementName_; |
---|
36 | |
---|
37 | double lenghtElem_; // cm |
---|
38 | double aperture_; // cm |
---|
39 | |
---|
40 | double stepmaxcm_; |
---|
41 | // bool curvedTrajectory_; |
---|
42 | |
---|
43 | void setDefaultValues(); |
---|
44 | void setDefaults(); |
---|
45 | |
---|
46 | public : |
---|
47 | |
---|
48 | abstractElement(); |
---|
49 | abstractElement(string lab); |
---|
50 | virtual ~abstractElement(); |
---|
51 | |
---|
52 | void setParameters(double ll,double aper); |
---|
53 | void setLabel(string lab); |
---|
54 | string getLabel() const; |
---|
55 | nomdElements getNomdElement() const; |
---|
56 | |
---|
57 | double getLenghtOfElement() const; |
---|
58 | int getNbParams() const; |
---|
59 | |
---|
60 | virtual void setPhaseStep(double); |
---|
61 | virtual double getInitialKineticEnergy() const; |
---|
62 | |
---|
63 | virtual void setParametersString(string* param) = 0; |
---|
64 | virtual string* getParametersString() const = 0; |
---|
65 | virtual string FileOutputFlow() const = 0; |
---|
66 | virtual vector< pair<string, vector<string> > > parametersToSoftware () const =0; |
---|
67 | virtual void FileInput(ifstream& ifs) = 0; |
---|
68 | virtual string print() = 0; |
---|
69 | |
---|
70 | virtual void InputRep(UAPNode* root) = 0; |
---|
71 | |
---|
72 | /* Return the abstractSofware associated with this element |
---|
73 | */ |
---|
74 | inline abstractSoftware* getAbstractSoftware() { |
---|
75 | return abstractSoftware_; |
---|
76 | } |
---|
77 | |
---|
78 | /* Set the software to this element |
---|
79 | @param abstractSoftware a pointer to the abstract software |
---|
80 | */ |
---|
81 | inline void setSoftware(abstractSoftware* prog) { |
---|
82 | abstractSoftware_ = prog; |
---|
83 | } |
---|
84 | |
---|
85 | private : |
---|
86 | |
---|
87 | abstractSoftware *abstractSoftware_; |
---|
88 | |
---|
89 | }; |
---|
90 | #endif |
---|