|
VR-Engage
2.2
|
DtLightStateController monitors inputs related to vehicle operation such as throttle and brake application, as well as explicit light control inputs, and uses these to manage the state of a platform's lights (headlights, brake lights, etc.). The controller provides a centralized way to control light states based on platform operation.
#include <lightStateController.h>
Public Member Functions | |
| DtLightStateController (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc, DtReaderWriterRegistry *parentRegistry=0) | |
| virtual | ~DtLightStateController () override |
| virtual const char * | type () const override |
| virtual bool | createPortGroups () override |
| virtual bool | createPorts () override |
Static Public Member Functions | |
| static DtSimComponent * | creator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
Protected Member Functions | |
| virtual void | tick () override |
Protected Attributes | |
| DtInputPortGroup * | myStatePortGroup |
| DtBooleanInputPort * | myHeadlightPort |
| DtAnalogInputPort * | myThrottlePort |
| DtAnalogInputPort * | myBrakePort |
| DtPlatformLocalObjectFacade | myPlatformLocalObjectFacade |
Private Member Functions | |
| DtLightStateController () | |
| DtLightStateController (const DtLightStateController &orig) | |
| DtLightStateController & | operator= (const DtLightStateController &orig) |
| makVre::DtLightStateController::DtLightStateController | ( | const DtString & | name, |
| DtLocalObject * | owner, | ||
| DtSimulationServices * | simManager, | ||
| DtComponentDescriptor * | desc, | ||
| DtReaderWriterRegistry * | parentRegistry = 0 ) |
Constructor.
| name | The name of this component |
| owner | The local object that owns this component |
| simManager | The simulation services manager |
| desc | Component descriptor with configuration parameters |
| parentRegistry | Optional parent registry for reader/writer functionality |
Creates a new light state controller component with the specified parameters.
Referenced by DtLightStateController(), and operator=().
|
overridevirtual |
Virtual destructor.
Cleans up resources used by the light state controller component.
|
private |
Default constructor (not implemented)
Default constructor is private and not implemented to prevent creation of instances without proper initialization.
|
private |
Copy constructor (not implemented)
Copy constructor is private and not implemented to prevent copy construction.
References DtLightStateController().
|
overridevirtual |
Gets the type identifier for this component.
Implements the DtSimComponent::type() method to return the type identifier for this component.
|
overridevirtual |
Creates port groups for this component.
Creates and initializes the input port groups used by this controller for light state control.
|
overridevirtual |
Creates input and output ports for this component.
Creates and initializes all input ports used by this controller for light state control, including ports for headlights, throttle, and brake inputs.
|
static |
Factory method to create a new instance of this component.
| name | The name for the new component |
| owner | The local object that will own this component |
| simManager | The simulation services manager |
| desc | Optional component descriptor |
| parentRegistry | Optional parent registry for reader/writer functionality |
Static factory method used by the component creation system to instantiate new instances of this component type.
|
private |
Assignment operator (not implemented)
Assignment operator is private and not implemented to prevent assignment.
References DtLightStateController().
|
overrideprotectedvirtual |
Updates the light state each simulation frame.
Processes light state control inputs and updates the platform's light states based on current headlight switch, throttle, and brake inputs.
|
protected |
Input port group for light state controls.
Contains all input ports related to light state control.
|
protected |
Input port for headlight control.
When true, indicates that headlights should be turned on.
|
protected |
Input port for throttle state.
Analog input representing the current throttle position, with 0.0 being idle and 1.0 being full throttle.
|
protected |
Input port for brake state.
Analog input representing the current brake application, with 0.0 being no braking and 1.0 being full braking.
|
protected |
Facade for platform local object access.
Provides simplified access to platform-specific functionality of the local object, including light state control.