1
0
Fork 0

LFSGlass was accidently ommitted from the cur_fdm_state removal process.

This commit is contained in:
James Turner 2010-06-26 18:44:58 +01:00
parent 180e524a0e
commit c04d97b259
2 changed files with 20 additions and 18 deletions

View file

@ -37,7 +37,8 @@
#include <vector> #include <vector>
#include "lfsglass.hxx" #include "lfsglass.hxx"
#include <FDM/flight.hxx> #include <FDM/flightProperties.hxx>
#include <Main/globals.hxx> #include <Main/globals.hxx>
#include <Main/fg_props.hxx> #include <Main/fg_props.hxx>
@ -127,9 +128,11 @@ bool FGLFSGlass::open() {
} }
//static void collect_data( const FGInterface *fdm, ogcFGData *data ) { //static void collect_data( const FGInterface *fdm, ogcFGData *data ) {
void FGLFSGlass::collect_data( const FGInterface *fdm, FGLFSGlassData *data ) { void FGLFSGlass::collect_data(FGLFSGlassData *data ) {
data->version_id = OGC_VERSION; data->version_id = OGC_VERSION;
FlightProperties fdm_state;
data->longitude = p_longitude->getDoubleValue(); data->longitude = p_longitude->getDoubleValue();
data->latitude = p_latitude->getDoubleValue(); data->latitude = p_latitude->getDoubleValue();
data->elevation = p_elev_node->getDoubleValue(); data->elevation = p_elev_node->getDoubleValue();
@ -143,16 +146,16 @@ void FGLFSGlass::collect_data( const FGInterface *fdm, FGLFSGlassData *data ) {
data->vvi = p_vvi->getDoubleValue(); data->vvi = p_vvi->getDoubleValue();
data->mach = p_mach->getDoubleValue(); data->mach = p_mach->getDoubleValue();
data->groundspeed = cur_fdm_state->get_V_ground_speed(); data->groundspeed = fdm_state.get_V_ground_speed();
data->v_keas = cur_fdm_state->get_V_equiv_kts(); data->v_keas = fdm_state.get_V_equiv_kts();
data->v_kcas = vel_kcas->getDoubleValue(); data->v_kcas = vel_kcas->getDoubleValue();
data->phi_dot = cur_fdm_state->get_Phi_dot(); data->phi_dot = fdm_state.get_Phi_dot();
data->theta_dot = cur_fdm_state->get_Theta_dot(); data->theta_dot = fdm_state.get_Theta_dot();
data->psi_dot = cur_fdm_state->get_Psi_dot(); data->psi_dot = fdm_state.get_Psi_dot();
data->alpha = cur_fdm_state->get_Alpha(); data->alpha = fdm_state.get_Alpha();
data->beta = p_yaw->getDoubleValue(); data->beta = p_yaw->getDoubleValue();
data->alpha_dot = p_alphadot->getDoubleValue(); data->alpha_dot = p_alphadot->getDoubleValue();
data->beta_dot = p_yaw_rate->getDoubleValue(); data->beta_dot = p_yaw_rate->getDoubleValue();
@ -271,9 +274,9 @@ void FGLFSGlass::collect_data( const FGInterface *fdm, FGLFSGlassData *data ) {
data->x_feed_valve[2] = x_feed2_node->getBoolValue(); data->x_feed_valve[2] = x_feed2_node->getBoolValue();
data->x_feed_valve[3] = x_feed3_node->getBoolValue(); data->x_feed_valve[3] = x_feed3_node->getBoolValue();
**********/ **********/
data->total_temperature = cur_fdm_state->get_Total_temperature(); data->total_temperature = fdm_state.get_Total_temperature();
data->total_pressure = cur_fdm_state->get_Total_pressure(); data->total_pressure = fdm_state.get_Total_pressure();
data->dynamic_pressure = cur_fdm_state->get_Dynamic_pressure(); data->dynamic_pressure = fdm_state.get_Dynamic_pressure();
data->static_pressure = press_node->getDoubleValue(); data->static_pressure = press_node->getDoubleValue();
data->static_temperature = temp_node->getDoubleValue(); data->static_temperature = temp_node->getDoubleValue();
@ -282,7 +285,7 @@ void FGLFSGlass::collect_data( const FGInterface *fdm, FGLFSGlassData *data ) {
data->sea_level_pressure = fgGetDouble("/environment/sea-level-pressure-inhg"); data->sea_level_pressure = fgGetDouble("/environment/sea-level-pressure-inhg");
} }
static void distribute_data( const FGLFSGlassData *data, FGInterface *chunk ) { static void distribute_data( const FGLFSGlassData *data) {
// just a place holder until the CDU is developed // just a place holder until the CDU is developed
} }
@ -293,7 +296,7 @@ bool FGLFSGlass::process() {
int length = sizeof(buf); int length = sizeof(buf);
if ( get_direction() == SG_IO_OUT ) { if ( get_direction() == SG_IO_OUT ) {
collect_data( cur_fdm_state, &buf ); collect_data(&buf );
//collect_data( &buf ); //collect_data( &buf );
if ( ! io->write( (char *)(& buf), length ) ) { if ( ! io->write( (char *)(& buf), length ) ) {
SG_LOG( SG_IO, SG_ALERT, "Error writing data." ); SG_LOG( SG_IO, SG_ALERT, "Error writing data." );
@ -303,12 +306,12 @@ bool FGLFSGlass::process() {
if ( io->get_type() == sgFileType ) { if ( io->get_type() == sgFileType ) {
if ( io->read( (char *)(& buf), length ) == length ) { if ( io->read( (char *)(& buf), length ) == length ) {
SG_LOG( SG_IO, SG_DEBUG, "Success reading data." ); SG_LOG( SG_IO, SG_DEBUG, "Success reading data." );
distribute_data( &buf, cur_fdm_state ); distribute_data( &buf);
} }
} else { } else {
while ( io->read( (char *)(& buf), length ) == length ) { while ( io->read( (char *)(& buf), length ) == length ) {
SG_LOG( SG_IO, SG_DEBUG, "Success reading data." ); SG_LOG( SG_IO, SG_DEBUG, "Success reading data." );
distribute_data( &buf, cur_fdm_state ); distribute_data( &buf);
} }
} }
} }

View file

@ -30,13 +30,12 @@
#include <string> #include <string>
#include <FDM/flight.hxx>
#include <Main/fg_props.hxx> #include <Main/fg_props.hxx>
#include "protocol.hxx" #include "protocol.hxx"
#include "lfsglass_data.hxx" #include "lfsglass_data.hxx"
class FGLFSGlass : public FGProtocol, public FGInterface { class FGLFSGlass : public FGProtocol {
FGLFSGlassData buf; FGLFSGlassData buf;
int length; int length;
@ -155,7 +154,7 @@ public:
// close the channel // close the channel
bool close(); bool close();
void collect_data( const FGInterface *fdm, FGLFSGlassData *data ); void collect_data(FGLFSGlassData *data );
}; };
#endif // _FG_LFSGlass_HXX #endif // _FG_LFSGlass_HXX