current_radiostack->get_adf_freq() );
sprintf( patla_sum, "%02X", calc_atlas_cksum(patla) );
current_radiostack->get_adf_freq() );
sprintf( patla_sum, "%02X", calc_atlas_cksum(patla) );
- FG_LOG( FG_IO, FG_DEBUG, rmc );
- FG_LOG( FG_IO, FG_DEBUG, gga );
- FG_LOG( FG_IO, FG_DEBUG, patla );
+ SG_LOG( SG_IO, SG_DEBUG, rmc );
+ SG_LOG( SG_IO, SG_DEBUG, gga );
+ SG_LOG( SG_IO, SG_DEBUG, patla );
// $GPGGA,163227,3321.173,N,11039.855,W,1,,,3333,F,,,,*0F
bool FGAtlas::parse_message() {
// $GPGGA,163227,3321.173,N,11039.855,W,1,,,3333,F,,,,*0F
bool FGAtlas::parse_message() {
string::size_type begin_line, end_line, begin, end;
begin_line = begin = 0;
string::size_type begin_line, end_line, begin, end;
begin_line = begin = 0;
while ( end_line != string::npos ) {
string line = msg.substr(begin_line, end_line - begin_line);
begin_line = end_line + 1;
while ( end_line != string::npos ) {
string line = msg.substr(begin_line, end_line - begin_line);
begin_line = end_line + 1;
double lon_deg, lon_min, lat_deg, lat_min;
double lon, lat, speed, heading, altitude;
double lon_deg, lon_min, lat_deg, lat_min;
double lon, lat, speed, heading, altitude;
speed = atof( speed_str.c_str() );
cur_fdm_state->set_V_calibrated_kts( speed );
// cur_fdm_state->set_V_ground_speed( speed );
speed = atof( speed_str.c_str() );
cur_fdm_state->set_V_calibrated_kts( speed );
// cur_fdm_state->set_V_ground_speed( speed );
cur_fdm_state->set_Euler_Angles( cur_fdm_state->get_Phi(),
cur_fdm_state->get_Theta(),
heading * SGD_DEGREES_TO_RADIANS );
cur_fdm_state->set_Euler_Angles( cur_fdm_state->get_Phi(),
cur_fdm_state->get_Theta(),
heading * SGD_DEGREES_TO_RADIANS );
} else if ( sentence == "GPGGA" ) {
// time
end = msg.find(",", begin);
} else if ( sentence == "GPGGA" ) {
// time
end = msg.find(",", begin);
- FG_LOG( FG_IO, FG_ALERT, "This shouldn't happen, but the channel "
+ SG_LOG( SG_IO, SG_ALERT, "This shouldn't happen, but the channel "
if ( get_direction() == SG_IO_OUT ) {
gen_message();
if ( ! io->write( buf, length ) ) {
if ( get_direction() == SG_IO_OUT ) {
gen_message();
if ( ! io->write( buf, length ) ) {
return false;
}
} else if ( get_direction() == SG_IO_IN ) {
if ( (length = io->readline( buf, FG_MAX_MSG_SIZE )) > 0 ) {
parse_message();
} else {
return false;
}
} else if ( get_direction() == SG_IO_IN ) {
if ( (length = io->readline( buf, FG_MAX_MSG_SIZE )) > 0 ) {
parse_message();
} else {