#include <simgear/props/props.hxx>
#include <Aircraft/aircraft.hxx>
-#include <Autopilot/auto_gui.hxx>
-#include <Autopilot/newauto.hxx>
+// #include <Autopilot/auto_gui.hxx>
+#include <Autopilot/xmlauto.hxx>
#include <Cockpit/hud.hxx>
#include <Cockpit/panel.hxx>
#include <Cockpit/panel_io.hxx>
read(node);
}
-FGBinding::~FGBinding ()
-{
- delete _arg; // Delete the saved arguments
-}
-
void
FGBinding::read (const SGPropertyNode * node)
{
return;
}
- delete _arg;
_arg = new SGPropertyNode;
_setting = 0;
copyProperties(node, _arg); // FIXME: don't use whole node!!!
void
FGInput::doKey (int k, int modifiers, int x, int y)
{
+ static SGPropertyNode *heading_enabled
+ = fgGetNode("/autopilot/locks/heading", true);
+
// Sanity check.
if (k < 0 || k >= MAX_KEYS) {
SG_LOG(SG_INPUT, SG_WARN, "Key value " << k << " out of range");
// START SPECIALS
case 256+GLUT_KEY_F6: // F6 toggles Autopilot target location
- if ( globals->get_autopilot()->get_HeadingMode() !=
- FGAutopilot::FG_HEADING_WAYPOINT ) {
- globals->get_autopilot()->set_HeadingMode(
- FGAutopilot::FG_HEADING_WAYPOINT );
- globals->get_autopilot()->set_HeadingEnabled( true );
+ if ( strcmp( heading_enabled->getStringValue(),
+ "true-heading-hold" ) != 0 ) {
+ heading_enabled->setStringValue( "true-heading-hold" );
} else {
- globals->get_autopilot()->set_HeadingMode(
- FGAutopilot::FG_TC_HEADING_LOCK );
+ heading_enabled->setStringValue( "" );
}
return;
}
jsJoystick * js = new jsJoystick(i);
_joystick_bindings[i].js = js;
if (js->notWorking()) {
- SG_LOG(SG_INPUT, SG_WARN, "Joystick " << i << " not found");
+ SG_LOG(SG_INPUT, SG_DEBUG, "Joystick " << i << " not found");
continue;
} else {
bool found_js = false;
// Grab node pointers
char buf[64];
sprintf(buf, "/devices/status/mice/mouse[%d]/mode", i);
- m.mode_node = fgGetNode(buf, true);
- m.mode_node->setIntValue(0);
+ m.mode_node = fgGetNode(buf);
+ if (m.mode_node == NULL) {
+ m.mode_node = fgGetNode(buf, true);
+ m.mode_node->setIntValue(0);
+ }
for (j = 0; j < MAX_MOUSE_BUTTONS; j++) {
sprintf(buf, "/devices/status/mice/mouse[%d]/button[%d]", i, j);
m.mouse_button_nodes[j] = fgGetNode(buf, true);