]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIBase.cxx
ignore resets for now because every z/Z key press would trigger a call to NOAA. We...
[flightgear.git] / src / AIModel / AIBase.cxx
index e5d63821501fe4bcf28abf4c121d246c15d3dcb9..0ee8c8d9528d2df793cdb3a7c2d53fd7763dfa96 100644 (file)
@@ -86,13 +86,19 @@ bool FGAIBase::init() {
 
    tgt_roll = tgt_pitch = tgt_yaw = tgt_vs = vs = roll = pitch = 0.0;
    setDie(false);
+
+   return true;
 }
 
 void FGAIBase::bind() {
    props->tie("velocities/airspeed-kt",  SGRawValuePointer<double>(&speed));
-   props->tie("velocities/vertical-speed-fps", SGRawValuePointer<double>(&vs));
+   props->tie("velocities/vertical-speed-fps",
+               SGRawValueFunctions<double>(FGAIBase::_getVS_fps,
+                                           FGAIBase::_setVS_fps));
 
-   props->tie("position/altitude-ft", SGRawValuePointer<double>(&altitude));
+   props->tie("position/altitude-ft",
+               SGRawValueFunctions<double>(FGAIBase::_getAltitude,
+                                           FGAIBase::_setAltitude));
    props->tie("position/latitude-deg",
                SGRawValueFunctions<double>(FGAIBase::_getLatitude,
                                            FGAIBase::_setLatitude));
@@ -100,9 +106,14 @@ void FGAIBase::bind() {
                SGRawValueFunctions<double>(FGAIBase::_getLongitude,
                                            FGAIBase::_setLongitude));
 
-   props->tie("orientation/pitch-deg", SGRawValuePointer<double>(&pitch));
-   props->tie("orientation/roll-deg", SGRawValuePointer<double>(&roll));
+   props->tie("orientation/pitch-deg",   SGRawValuePointer<double>(&pitch));
+   props->tie("orientation/roll-deg",    SGRawValuePointer<double>(&roll));
    props->tie("orientation/heading-deg", SGRawValuePointer<double>(&hdg));
+
+   props->tie("controls/lighting/nav-lights",
+               SGRawValueFunctions<bool>(FGAIBase::_isNight));
+   props->setBoolValue("controls/lighting/beacon", true);
+   props->setBoolValue("controls/lighting/strobe", true);
 }
 
 void FGAIBase::unbind() {
@@ -116,17 +127,7 @@ void FGAIBase::unbind() {
     props->untie("orientation/pitch-deg");
     props->untie("orientation/roll-deg");
     props->untie("orientation/heading-deg");
-}
-
 
-void FGAIBase::_setLongitude( double longitude ) {
-    _self->pos.setlon(longitude);
+    props->untie("controls/controls/lighting/nav-lights");
 }
 
-void FGAIBase::_setLatitude ( double latitude )  {
-    _self->pos.setlat(latitude);
-}
-
-double FGAIBase::_getLongitude() { return _self->pos.lon(); }
-
-double FGAIBase::_getLatitude () { return _self->pos.lat(); }