Changeset 1102:5f3549b61301 for src/mlx
- Timestamp:
- 09/16/23 11:53:25 (14 months ago)
- Branch:
- python3
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/xplane.py
r1073 r1102 2234 2234 #------------------------------------------------------------------------------ 2235 2235 2236 class FelisT154B2Model(T154Model): 2237 """Model for Felis' Tupolev Tu-154-B2 aircraft.""" 2238 @staticmethod 2239 def doesHandle(aircraft, data): 2240 """Determine if this model handler handles the aircraft with the given 2241 name.""" 2242 (tailnum, author, description, notes, icao, liveryPath) = data 2243 return aircraft.type==const.AIRCRAFT_T154 and \ 2244 author.find("Felis")!=-1 and \ 2245 description.find("Tu154B2")!=-1 2246 2247 @property 2248 def name(self): 2249 """Get the name for this aircraft model.""" 2250 return "X-Plane/Felis Tupolev Tu-154-B2" 2251 2252 def addMonitoringData(self, data, fsType): 2253 """Add the model-specific monitoring data to the given array.""" 2254 super(FelisT154B2Model, self).addMonitoringData(data, fsType) 2255 2256 self._parkingBrakeIndex = len(data) 2257 self._addDatarefWithIndexMember(data, 2258 "sim/custom/controll/parking_brake", 2259 TYPE_INT) 2260 self._cgIndex = len(data) 2261 self._addDatarefWithIndexMember(data, 2262 "sim/custom/misc/cg_pos_actual", 2263 TYPE_FLOAT) 2264 2265 def getAircraftState(self, aircraft, timestamp, data): 2266 """Get the aircraft state. 2267 2268 Get it from the parent, and then invert the pitot heat state.""" 2269 state = super(FelisT154B2Model, self).getAircraftState(aircraft, 2270 timestamp, 2271 data) 2272 2273 state.parking = data[self._parkingBrakeIndex]!=0 2274 state.cog = data[self._cgIndex]/100.0 2275 2276 return state 2277 2278 #------------------------------------------------------------------------------ 2279 2236 2280 class YK40Model(GenericAircraftModel): 2237 2281 """Generic model for the Yakovlev Yak-40 aircraft.""" … … 2279 2323 AircraftModel.registerSpecial(FJSDH8DXPModel) 2280 2324 AircraftModel.registerSpecial(FelisT154Model) 2325 AircraftModel.registerSpecial(FelisT154B2Model) 2281 2326 2282 2327 #------------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.