mbsimhydraulics  4.0.0
MBSim Hydraulics Module
hydraulic_sensor.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 _HYDRAULIC_SENSOR_H_
21 #define _HYDRAULIC_SENSOR_H_
22 
23 #include "mbsimControl/sensor.h"
24 
25 namespace MBSimHydraulics {
26 
27  class HNode;
28  class HLine;
29 
31  public:
32  FlowSensor(const std::string &name="") : MBSimControl::Sensor(name), line(nullptr), lineString("") {}
33  int getSignalSize() const override { return 1; }
34  void updateSignal() override;
35  void initializeUsingXML(xercesc::DOMElement *element) override;
36  void init(InitStage stage, const MBSim::InitConfigSet &config) override;
37  void setHLine(HLine * line_) {line=line_; }
38  protected:
39  HLine * line;
40  std::string lineString;
41  };
42 
44  public:
45  PressureSensor(const std::string &name="") : MBSimControl::Sensor(name), node(nullptr), nodeString("") {}
46  int getSignalSize() const override { return 1; }
47  void updateSignal() override;
48  void initializeUsingXML(xercesc::DOMElement *element) override;
49  void init(InitStage stage, const MBSim::InitConfigSet &config) override;
50  void setHNode(HNode * node_) {node=node_; }
51  protected:
52  HNode * node;
53  std::string nodeString;
54  };
55 
57  public:
58  TemperatureSensor(const std::string &name="") : MBSimControl::Sensor(name) {}
59  int getSignalSize() const override { return 1; }
60  void init(InitStage stage, const MBSim::InitConfigSet &config) override;
61  };
62 
64  public:
65  KinematicViscositySensor(const std::string &name="") : MBSimControl::Sensor(name) {}
66  int getSignalSize() const override { return 1; }
67  void init(InitStage stage, const MBSim::InitConfigSet &config) override;
68  };
69 
70 }
71 
72 #endif /* ----- #ifndef _HYDRAULIC_SENSOR_H_ ----- */
73 
Definition: hydraulic_sensor.h:56
Definition: hline.h:40
Definition: hydraulic_sensor.h:63
std::string name
Definition: hydraulic_sensor.h:30
Definition: hnode.h:57
Definition: hydraulic_sensor.h:43