77 : fcs(FCS), OnOffNode(node), Name(name)
79 ExecRate = execRate < 1 ? 1 : execRate;
81 ExecFrameCountSinceLastRun = ExecRate;
86 for (
unsigned int i=0; i<FCSComponents.size(); i++)
delete FCSComponents[i];
87 FCSComponents.clear();
94 FCSComponents.push_back(comp);
101 return FCSComponents[i];
104 log <<
"Tried to get nonexistent component\n";
110 for (
unsigned int i=0; i<FCSComponents.size(); i++)
111 FCSComponents[i]->ResetPastStates();
115 ExecFrameCountSinceLastRun = ExecRate;
122 if (OnOffNode && !OnOffNode->getBoolValue())
return;
124 if (fcs->GetDt() != 0.0) {
125 if (ExecFrameCountSinceLastRun >= ExecRate) {
126 ExecFrameCountSinceLastRun = 0;
129 ++ExecFrameCountSinceLastRun;
134 if (fcs->GetTrimStatus() || ExecFrameCountSinceLastRun >= ExecRate) {
135 for (
unsigned int i=0; i<FCSComponents.size(); i++)
136 FCSComponents[i]->Run();
145 SGConstPropertyNode_ptr OnOffNode;
149 int ExecFrameCountSinceLastRun;
void Execute()
Executes all the components in a channel.
FGFCSComponent * GetComponent(unsigned int i)
Retrieves a specific component.
FGFCSChannel(FGFCS *FCS, const std::string &name, int execRate, SGPropertyNode *node=nullptr)
Constructor.
void Reset()
Reset the components that can be reset.
void Add(FGFCSComponent *comp)
Adds a component to a channel.
std::string GetName()
Retrieves the name of the channel.
int GetRate(void) const
Get the channel rate.
~FGFCSChannel()
Destructor.
size_t GetNumComponents()
Returns the number of components in the channel.
Base class for JSBSim Flight Control System Components.
Encapsulates the Flight Control System (FCS) functionality.
A node in a property tree.
Main namespace for the JSBSim Flight Dynamics Model.
std::vector< FGFCSComponent * > FCSCompVec
Represents a <channel> in a control system definition.