mbsimhydraulics  3.0.0
controlvalve43.h
1 /* Copyright (C) 2004-2009 MBSim Development Team
2  *
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public
5  * License as published by the Free Software Foundation; either
6  * version 2.1 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16  *
17  * Contact: markus.ms.schneider@gmail.com
18  */
19 
20 #ifndef _CONTROLVALVE43_H_
21 #define _CONTROLVALVE43_H_
22 
23 #include "mbsim/group.h"
24 #include "mbsim/utils/function.h"
25 
26 namespace MBSimControl {
27  class Signal;
28 }
29 
30 namespace MBSimHydraulics {
31 
32  class ClosableRigidLine;
33  class RigidNode;
34  class HLine;
35 
37  class Controlvalve43 : public MBSim::Group {
38  public:
39  Controlvalve43(const std::string& name);
40 
41  void init(MBSim::InitStage stage);
42  void initializeUsingXML(TiXmlElement * element);
43 
44  void setLength(double l_);
45  void setDiameter(double d_);
46  void setAlpha(double alpha_, double alphaBack_=0);
47  void setPARelativeAlphaFunction(MBSim::Function1<double, double> * relAlphaPA_) {relAlphaPA=relAlphaPA_; }
48  void setMinimalRelativeAlpha(double minRelAlpha_);
49  void setOffset(double off) {offset=off; }
50  void setRelativePositionSignal(MBSimControl::Signal * s) {position = s; }
51  void setSetValued(bool setValued=true);
52  void setPInflow(HLine * hl);
53  void setAOutflow(HLine * hl);
54  void setBOutflow(HLine * hl);
55  void setTOutflow(HLine * hl);
56  void printRelativeAlphaCharacteristikCurve(bool print=true) {pRACC=print; }
57 
58  protected:
59  ClosableRigidLine * lPA, * lPB, * lAT, * lBT;
60  RigidNode * nP, * nA, * nB, * nT;
61  double offset;
62  MBSim::Function1<double, double> * relAlphaPA;
63  MBSimControl::Signal * position;
64  MBSimControl::Signal * checkSizeSignalPA, * checkSizeSignalPB, * checkSizeSignalAT, * checkSizeSignalBT;
65 
66  private:
67  std::string positionString;
68  std::string nPInflowString, nAOutflowString, nBOutflowString, nTOutflowString;
69  bool pRACC;
70  };
71 }
72 
73 #endif /* ----- #ifndef _CONTROLVALVE43_H_ ----- */
74