1
0
Fork 0

Output control positions to properties

This commit is contained in:
tony 2002-02-26 22:27:42 +00:00
parent 8f1d2f7bc9
commit 998c2a9325
2 changed files with 26 additions and 1 deletions

View file

@ -150,8 +150,20 @@ FGJSBsim::FGJSBsim( double dt )
stall_warning = fgGetNode("/sim/aero/alarms/stall-warning",true);
stall_warning->setDoubleValue(0);
}
elevator_pos=fgGetNode("/surface-positions/elevator-pos-deg",true);
left_aileron_pos=fgGetNode("/surface-positions/left-aileron-pos-deg",true);
right_aileron_pos=fgGetNode("/surface-positions/right-aileron-pos-deg",true);
rudder_pos=fgGetNode("/surface-positions/rudder-pos-deg",true);
flap_pos=fgGetNode("/surface-positions/flap-pos-deg",true);
elevator_pos->setDoubleValue(0);
left_aileron_pos->setDoubleValue(0);
right_aileron_pos->setDoubleValue(0);
rudder_pos->setDoubleValue(0);
flap_pos->setDoubleValue(0);
}
/******************************************************************************/
FGJSBsim::~FGJSBsim(void) {
if (fdmex != NULL) {
@ -488,6 +500,13 @@ bool FGJSBsim::copy_from_JSBsim() {
stall_warning->setDoubleValue( Aircraft->GetStallWarn() );
elevator_pos->setDoubleValue( FCS->GetDePos()*SG_RADIANS_TO_DEGREES );
left_aileron_pos->setDoubleValue( FCS->GetDaPos()*SG_RADIANS_TO_DEGREES );
right_aileron_pos->setDoubleValue( -1*FCS->GetDaPos()*SG_RADIANS_TO_DEGREES );
rudder_pos->setDoubleValue( -1*FCS->GetDrPos()*SG_RADIANS_TO_DEGREES );
flap_pos->setDoubleValue( FCS->GetDfPos() );
return true;
}

View file

@ -241,6 +241,12 @@ private:
SGPropertyNode *rudder_trim;
SGPropertyNode *stall_warning;
SGPropertyNode *elevator_pos;
SGPropertyNode *left_aileron_pos;
SGPropertyNode *right_aileron_pos;
SGPropertyNode *rudder_pos;
SGPropertyNode *flap_pos;
void init_gear(void);
void update_gear(void);