Copy normalized control surface positions to property tree
This commit is contained in:
parent
1ab43c8048
commit
03b9ecf039
2 changed files with 52 additions and 20 deletions
|
@ -151,17 +151,35 @@ 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_deg=fgGetNode("/surface-positions/elevator-pos-deg",true);
|
||||
left_aileron_pos_deg
|
||||
=fgGetNode("/surface-positions/left-aileron-pos-deg",true);
|
||||
right_aileron_pos_deg
|
||||
=fgGetNode("/surface-positions/right-aileron-pos-deg",true);
|
||||
rudder_pos_deg=fgGetNode("/surface-positions/rudder-pos-deg",true);
|
||||
flap_pos_deg=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);
|
||||
flap_pos_pct=fgGetNode("/surface-positions/flap-pos-pct",true);
|
||||
elevator_pos_pct=fgGetNode("/surface-positions/elevator-pos-pct",true);
|
||||
left_aileron_pos_pct
|
||||
=fgGetNode("/surface-positions/left-aileron-pos-pct",true);
|
||||
right_aileron_pos_pct
|
||||
=fgGetNode("/surface-positions/right-aileron-pos-pct",true);
|
||||
rudder_pos_pct=fgGetNode("/surface-positions/rudder-pos-pct",true);
|
||||
|
||||
|
||||
elevator_pos_deg->setDoubleValue(0);
|
||||
left_aileron_pos_deg->setDoubleValue(0);
|
||||
right_aileron_pos_deg->setDoubleValue(0);
|
||||
rudder_pos_deg->setDoubleValue(0);
|
||||
flap_pos_deg->setDoubleValue(0);
|
||||
|
||||
elevator_pos_pct->setDoubleValue(0);
|
||||
left_aileron_pos_pct->setDoubleValue(0);
|
||||
right_aileron_pos_pct->setDoubleValue(0);
|
||||
rudder_pos_pct->setDoubleValue(0);
|
||||
flap_pos_pct->setDoubleValue(0);
|
||||
|
||||
|
||||
}
|
||||
/******************************************************************************/
|
||||
|
@ -500,11 +518,17 @@ 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() );
|
||||
elevator_pos_deg->setDoubleValue( FCS->GetDePos()*SG_RADIANS_TO_DEGREES );
|
||||
left_aileron_pos_deg->setDoubleValue( FCS->GetDaLPos()*SG_RADIANS_TO_DEGREES );
|
||||
right_aileron_pos_deg->setDoubleValue( FCS->GetDaRPos()*SG_RADIANS_TO_DEGREES );
|
||||
rudder_pos_deg->setDoubleValue( -1*FCS->GetDrPos()*SG_RADIANS_TO_DEGREES );
|
||||
flap_pos_deg->setDoubleValue( FCS->GetDfPos() );
|
||||
|
||||
elevator_pos_pct->setDoubleValue( FCS->GetDePosN() );
|
||||
left_aileron_pos_pct->setDoubleValue( FCS->GetDaLPosN() );
|
||||
right_aileron_pos_pct->setDoubleValue( FCS->GetDaRPosN() );
|
||||
rudder_pos_pct->setDoubleValue( FCS->GetDrPosN() );
|
||||
flap_pos_pct->setDoubleValue( FCS->GetDfPosN() );
|
||||
|
||||
|
||||
return true;
|
||||
|
|
|
@ -241,11 +241,19 @@ private:
|
|||
SGPropertyNode *rudder_trim;
|
||||
SGPropertyNode *stall_warning;
|
||||
|
||||
SGPropertyNode *elevator_pos;
|
||||
SGPropertyNode *left_aileron_pos;
|
||||
SGPropertyNode *right_aileron_pos;
|
||||
SGPropertyNode *rudder_pos;
|
||||
SGPropertyNode *flap_pos;
|
||||
SGPropertyNode *elevator_pos_deg;
|
||||
SGPropertyNode *left_aileron_pos_deg;
|
||||
SGPropertyNode *right_aileron_pos_deg;
|
||||
SGPropertyNode *rudder_pos_deg;
|
||||
SGPropertyNode *flap_pos_deg;
|
||||
|
||||
SGPropertyNode *elevator_pos_pct;
|
||||
SGPropertyNode *left_aileron_pos_pct;
|
||||
SGPropertyNode *right_aileron_pos_pct;
|
||||
SGPropertyNode *rudder_pos_pct;
|
||||
SGPropertyNode *flap_pos_pct;
|
||||
|
||||
SGPropertyNode *gear_pos_pct;
|
||||
|
||||
void init_gear(void);
|
||||
void update_gear(void);
|
||||
|
|
Loading…
Add table
Reference in a new issue