//
// This file is in the Public Domain and comes with no warranty.
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <simgear/compiler.h>
#include <simgear/sg_inlines.h>
#include <iostream>
int i;
for ( i = 0; i < node->nChildren(); ++i ) {
SGPropertyNode *child = node->getChild(i);
- string cname = child->getName();
- string cval = child->getStringValue();
+ std::string cname = child->getName();
+ std::string cval = child->getStringValue();
if ( cname == "name" ) {
name = cval;
} else if ( cname == "number" ) {
void
HeadingIndicatorDG::init ()
{
- string branch;
+ std::string branch;
branch = "/instrumentation/" + name;
_heading_in_node = fgGetNode("/orientation/heading-deg", true);
HeadingIndicatorDG::bind ()
{
std::ostringstream temp;
- string branch;
+ std::string branch;
temp << num;
branch = "/instrumentation/" + name + "[" + temp.str() + "]";
HeadingIndicatorDG::unbind ()
{
std::ostringstream temp;
- string branch;
+ std::string branch;
temp << num;
branch = "/instrumentation/" + name + "[" + temp.str() + "]";
// Next, calculate time-based precession
double offset = _offset_node->getDoubleValue();
offset -= dt * (0.25 / 60.0); // 360deg/day
- SG_NORMALIZE_RANGE(offset, -360.0, 360.0);
+ offset = SGMiscd::normalizePeriodic(-360.0,360.0,offset);
_offset_node->setDoubleValue(offset);
// No magvar - set the alignment manually
_last_heading_deg = heading;
heading += offset + align + error;
- SG_NORMALIZE_RANGE(heading, 0.0, 360.0);
+ heading = SGMiscd::normalizePeriodic(0.0,360.0,heading);
_heading_out_node->setDoubleValue(heading);