33 #ifndef FGDISTRIBUTOR_H 34 #define FGDISTRIBUTOR_H 43 #include "FGFCSComponent.h" 44 #include "math/FGCondition.h" 45 #include "math/FGPropertyValue.h" 46 #include "math/FGRealValue.h" 52 #define ID_DISTRIBUTOR "$Id: FGDistributor.h,v 1.7 2015/03/28 14:49:02 bcoconni Exp $" 127 enum eType {eInclusive=0, eExclusive} Type;
136 if (node) PropNode = node;
141 LateBoundValue =
false;
144 if (is_number(ValString)) {
148 if (ValString[0] ==
'-') {
150 ValString.erase(0,1);
152 node = propMan->GetNode(ValString,
false);
156 LateBoundValue =
true;
166 void SetPropToValue() {
168 if (PropMan->HasNode(PropName)) {
169 PropNode = PropMan->GetNode(PropName);
171 throw(PropName+
" in distributor component is not known");
174 PropNode->setDoubleValue(Val->GetValue()*sign);
177 std::string GetPropName() {
return PropName;}
178 std::string GetValString() {
return ValString;}
180 bool GetLateBoundValue() {
return LateBoundValue;}
182 std::string PropName;
186 std::string ValString;
198 for (
unsigned int i=0; i<PropValPairs.size(); i++)
delete PropValPairs[i];
199 PropValPairs.clear();
204 void AddPropValPair(PropValPair* pvPair) {PropValPairs.push_back(pvPair);}
205 void SetPropValPairs() {
206 for (
unsigned int i=0; i<PropValPairs.size(); i++) PropValPairs[i]->SetPropToValue();
208 PropValPair* GetPropValPair(
unsigned int idx) {
return PropValPairs[idx]; }
209 size_t GetNumPropValPairs(
void) {
return PropValPairs.size();}
210 bool HasTest() {
return (Test != 0);}
211 bool GetTestResult() {
return Test->Evaluate(); }
215 std::vector <PropValPair*> PropValPairs;
218 std::vector <Case*> Cases;
220 void Debug(
int from);
~FGDistributor()
Destructor.
Represents a property value which can use late binding.
Class wrapper for property handling.
Represents various types of parameters.
Encapsulates the Flight Control System (FCS) functionality.
bool Run(void)
Executes the distributor logic.
Encapsulates a distributor for the flight control system.
Base class for JSBSim Flight Control System Components.
Encapsulates a condition, which is used in parts of JSBSim including switches.
FGDistributor(FGFCS *fcs, Element *element)
Constructor.