From 6af60f7462461291e92fee0ff3c83886bfa458ac Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 23 May 2002 19:30:56 +0000 Subject: [PATCH] Yank the "castering" attribute and replace it with a ControlMap-enabled control that can be set via the property system. This allows implementation of the DC-3 wheel lock. --- src/FDM/YASim/ControlMap.cpp | 1 + src/FDM/YASim/ControlMap.hpp | 2 +- src/FDM/YASim/FGFDM.cpp | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/FDM/YASim/ControlMap.cpp b/src/FDM/YASim/ControlMap.cpp index 628c059a6..e5d3ba191 100644 --- a/src/FDM/YASim/ControlMap.cpp +++ b/src/FDM/YASim/ControlMap.cpp @@ -192,6 +192,7 @@ void ControlMap::applyControls(float dt) case BRAKE: ((Gear*)obj)->setBrake(lval); break; case STEER: ((Gear*)obj)->setRotation(lval); break; case EXTEND: ((Gear*)obj)->setExtension(lval); break; + case CASTERING:((Gear*)obj)->setCastering(lval != 0); break; case SLAT: ((Wing*)obj)->setSlat(lval); break; case FLAP0: ((Wing*)obj)->setFlap0(lval, rval); break; case FLAP1: ((Wing*)obj)->setFlap1(lval, rval); break; diff --git a/src/FDM/YASim/ControlMap.hpp b/src/FDM/YASim/ControlMap.hpp index cbbd46ab6..10713e675 100644 --- a/src/FDM/YASim/ControlMap.hpp +++ b/src/FDM/YASim/ControlMap.hpp @@ -13,7 +13,7 @@ public: ADVANCE, REHEAT, PROP, BRAKE, STEER, EXTEND, INCIDENCE, FLAP0, FLAP1, SLAT, SPOILER, VECTOR, - BOOST }; + BOOST, CASTERING }; enum { OPT_SPLIT = 0x01, OPT_INVERT = 0x02, diff --git a/src/FDM/YASim/FGFDM.cpp b/src/FDM/YASim/FGFDM.cpp index edd2cc231..9c911a738 100644 --- a/src/FDM/YASim/FGFDM.cpp +++ b/src/FDM/YASim/FGFDM.cpp @@ -174,8 +174,6 @@ void FGFDM::startElement(const char* name, const XMLAttributes &atts) g->setBrake(attrf(a, "skid", 0)); g->setStaticFriction(attrf(a, "sfric", 0.8)); g->setDynamicFriction(attrf(a, "dfric", 0.7)); - if(a->hasAttribute("castering")) - g->setCastering(true); _airplane.addGear(g); } else if(eq(name, "fuselage")) { float b[3]; @@ -500,6 +498,7 @@ int FGFDM::parseOutput(const char* name) if(eq(name, "FLAP1")) return ControlMap::FLAP1; if(eq(name, "SLAT")) return ControlMap::SLAT; if(eq(name, "SPOILER")) return ControlMap::SPOILER; + if(eq(name, "CASTERING")) return ControlMap::CASTERING; SG_LOG(SG_FLIGHT,SG_ALERT,"Unrecognized control type '" << name << "' in YASim aircraft description."); exit(1);