Phase 5.1: MechControlsMapper publishes its 20 control-input attributes
Reconstructed the MechControlsMapper attribute table (StickPosition..PilotArray, IDs 3-0x16 chained from Subsystem::NextAttributeID==2) + the real members (stickPosition ControlsJoystick, throttle/pedals/speed/turn Scalars, the look/ torso ControlsButtons, control/display/pilotArray ints) + AttributePointers[] + AttributeIndex (chains Subsystem::AttributeIndex). Fixed the mapper hierarchy statics in BTL4MPPR.CPP: L4/RIO/Thrustmaster ClassDerivations now chain correctly (L4 defined first for static-init order) and all use MechControlsMapper:: AttributeIndex so the mapper instance publishes the control attributes the streamed mappings bind to. Mech still constructs (33 subsystems). The post-construction crash is UNCHANGED (GetAttributePointer, attribute=0x13) -> so it's NOT the mapper; a streamed AttributeWatcher (numeric ID 19) resolves on another object via GetSimulation. Next diagnostic: which object/subsystemID the watcher targets. BT: 42 ok. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,14 @@
|
||||
# include <cstr.hpp>
|
||||
# endif
|
||||
|
||||
# if !defined(CONTROLS_HPP)
|
||||
# include <controls.hpp>
|
||||
# endif
|
||||
|
||||
# if !defined(VECTOR2D_HPP)
|
||||
# include <vector2d.hpp>
|
||||
# endif
|
||||
|
||||
//##################### Forward Class Declarations #######################
|
||||
class Mech;
|
||||
|
||||
@@ -39,7 +47,39 @@
|
||||
public:
|
||||
static Derivation ClassDerivations;
|
||||
static SharedData DefaultData;
|
||||
static MessageHandlerSet MessageHandlers;
|
||||
|
||||
static const IndexEntry AttributePointers[];
|
||||
static AttributeIndexSet AttributeIndex;
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Attribute IDs -- the control inputs the streamed mappings bind to.
|
||||
// The chain ends at Subsystem::NextAttributeID == 2.
|
||||
//
|
||||
public:
|
||||
enum {
|
||||
MechControlsMapperPadFirstAttributeID = 2,
|
||||
StickPositionAttributeID, // 3
|
||||
ThrottlePositionAttributeID, // 4
|
||||
PedalsPositionAttributeID, // 5
|
||||
ReverseThrustAttributeID, // 6
|
||||
SpeedDemandAttributeID, // 7
|
||||
TurnDemandAttributeID, // 8
|
||||
LookForwardAttributeID, // 9
|
||||
LookLeftAttributeID, // a
|
||||
LookRightAttributeID, // b
|
||||
LookBehindAttributeID, // c
|
||||
LookDownAttributeID, // d
|
||||
TorsoUpAttributeID, // e
|
||||
TorsoDownAttributeID, // f
|
||||
TorsoLeftAttributeID, // 10
|
||||
TorsoRightAttributeID, // 11
|
||||
TorsoCenterAttributeID, // 12
|
||||
ControlModeAttributeID, // 13
|
||||
DisplayModeAttributeID, // 14
|
||||
PilotArrayPageAttributeID, // 15
|
||||
PilotArrayAttributeID, // 16
|
||||
NextAttributeID
|
||||
};
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Control modes
|
||||
@@ -69,10 +109,31 @@
|
||||
TestInstance() const;
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Local Data
|
||||
// Local Data -- the published control inputs (the streamed mappings write
|
||||
// these; InterpretControls, phase 5.3, reads them to drive the mech).
|
||||
//
|
||||
protected:
|
||||
int reserved[64];
|
||||
ControlsJoystick stickPosition;
|
||||
Scalar throttlePosition;
|
||||
Scalar pedalsPosition;
|
||||
ControlsButton reverseThrust;
|
||||
Scalar speedDemand;
|
||||
Scalar turnDemand;
|
||||
ControlsButton lookForward;
|
||||
ControlsButton lookLeft;
|
||||
ControlsButton lookRight;
|
||||
ControlsButton lookBehind;
|
||||
ControlsButton lookDown;
|
||||
ControlsButton torsoUp;
|
||||
ControlsButton torsoDown;
|
||||
ControlsButton torsoLeft;
|
||||
ControlsButton torsoRight;
|
||||
ControlsButton torsoCenter;
|
||||
int controlMode;
|
||||
int displayMode;
|
||||
int pilotArrayPage;
|
||||
int pilotArray;
|
||||
int reserved[24];
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user