//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
# include <config.h>
#endif
-#ifdef HAVE_WINDOWS_H
+#ifdef HAVE_WINDOWS_H
# include <windows.h>
#endif
{
double a, d;
- a = current_aircraft.fdm_state->get_Latitude() * SGD_RADIANS_TO_DEGREES;
+ a = current_aircraft.fdm_state->get_Latitude() * SGD_RADIANS_TO_DEGREES;
if (a < 0.0) {
a = -a;
}
{
static char buf[32];
const struct tm *p = globals->get_time_params()->getGmt();
- sprintf( buf, "%d/%d/%4d %d:%02d:%02d",
+ sprintf( buf, "%d/%d/%4d %d:%02d:%02d",
p->tm_mon+1, p->tm_mday, 1900 + p->tm_year,
p->tm_hour, p->tm_min, p->tm_sec);
float get_long_min( void )
{
double a, d;
- a = current_aircraft.fdm_state->get_Longitude() * SGD_RADIANS_TO_DEGREES;
+ a = current_aircraft.fdm_state->get_Longitude() * SGD_RADIANS_TO_DEGREES;
if (a < 0.0) {
a = -a;
}
d = (double) ( (int) a);
- float lon_min = (a - d) * 60.0;
+ float lon_min = (a - d) * 60.0;
return lon_min;
}
static const SGPropertyNode * speedup_node = fgGetNode("/sim/speed-up");
float speed = current_aircraft.fdm_state->get_V_calibrated_kts()
- * speedup_node->getIntValue();
+ * speedup_node->getIntValue();
return speed;
}
float get_mach(void)
{
return current_aircraft.fdm_state->get_Mach_number();
-}
+}
float get_aoa( void )
{
float get_fov( void )
{
- return globals->get_current_view()->get_fov();
+ return globals->get_current_view()->get_fov();
}
float get_vfc_ratio( void )
{
double view_off = SGD_2PI - globals->get_current_view()->getHeadingOffset_deg() * SGD_DEGREES_TO_RADIANS;
double view = ( current_aircraft.fdm_state->get_Psi() + view_off)
- * SGD_RADIANS_TO_DEGREES;
-
- if(view > 360.)
+ * SGD_RADIANS_TO_DEGREES;
+
+ if (view > 360.)
view -= 360.;
- else if(view<0.)
+ else if (view<0.)
view += 360.;
-
+
return view;
}
/****************************************************************************/
char *dmshh_format(double degrees)
{
- static char buf[16];
+ static char buf[16];
int deg_part;
int min_part;
double sec_part;
-
+
if (degrees < 0)
degrees = -degrees;
double sign = 1;
int deg;
- if (dd < 0) {
- sign = -1;
- }
+ if (dd < 0)
+ sign = -1;
+
/* round for minutes expressed to three decimal places */
tempdd = fabs(dd) + (5.0E-4 / 60.0);
deg = (int)tempdd;
double sec;
double sign = 1;
- if(dd < 0) {
- sign = -1;
- }
+ if (dd < 0)
+ sign = -1;
+
/* round up for seconds expressed to one decimal place */
tempdd = fabs(dd) + (0.05 / 3600.0);
deg = (int)tempdd;
// dmshh_format(latitude),
// toDMS(latitude),
// toDM(latitude),
- fgLatLonFormat(latitude),
+ fgLatLonFormat(latitude),
latitude > 0 ? 'N' : 'S');
return buf;
}
{
static int toggle = 0;
- if ( toggle )
+ if ( toggle )
fgLatLonFormat = toDM;
else
fgLatLonFormat = toDMS;
-
+
toggle = ~toggle;
}
// If aircraft has HUD specified we will get the specs from its def
// file. For now we will depend upon hard coding in hud?
-
+
// We must insure that the existing instrument link is purged.
// This is done by deleting the links in the list.
-
+
// HI_Head is now a null pointer so we can generate a new list from the
// current aircraft.
fgHUDInit( cur_aircraft );
ac_cockpit = new fg_Cockpit();
-
+
// Have to set the LatLon display type
fgLatLonFormat = toDM;
-
+
SG_LOG( SG_COCKPIT, SG_INFO,
- " Code " << ac_cockpit->code() << " Status "
+ " Code " << ac_cockpit->code() << " Status "
<< ac_cockpit->status() );
- return true;
+ return true;
}
void fgCockpitUpdate( void ) {
SG_LOG( SG_COCKPIT, SG_DEBUG,
- "Cockpit: code " << ac_cockpit->code() << " status "
+ "Cockpit: code " << ac_cockpit->code() << " status "
<< ac_cockpit->status() );
static const SGPropertyNode * xsize_node = fgGetNode("/sim/startup/xsize");
int iwidth = xsize_node->getIntValue();
int iheight = ysize_node->getIntValue();
- // FIXME: inefficient
+ // FIXME: inefficient
if ( hud_visibility_node->getBoolValue() ) {
// This will check the global hud linked list pointer.
// If there is anything to draw it will.