VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtLightStateController Class Reference

Detailed Description

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>

Inheritance diagram for makVre::DtLightStateController:
[legend]

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)
 
DtLightStateControlleroperator= (const DtLightStateController &orig)
 

Constructor & Destructor Documentation

◆ DtLightStateController() [1/3]

makVre::DtLightStateController::DtLightStateController ( const DtString & name,
DtLocalObject * owner,
DtSimulationServices * simManager,
DtComponentDescriptor * desc,
DtReaderWriterRegistry * parentRegistry = 0 )

Constructor.

Parameters
nameThe name of this component
ownerThe local object that owns this component
simManagerThe simulation services manager
descComponent descriptor with configuration parameters
parentRegistryOptional parent registry for reader/writer functionality

Creates a new light state controller component with the specified parameters.

Referenced by DtLightStateController(), and operator=().

◆ ~DtLightStateController()

virtual makVre::DtLightStateController::~DtLightStateController ( )
overridevirtual

Virtual destructor.

Cleans up resources used by the light state controller component.

◆ DtLightStateController() [2/3]

makVre::DtLightStateController::DtLightStateController ( )
private

Default constructor (not implemented)

Default constructor is private and not implemented to prevent creation of instances without proper initialization.

◆ DtLightStateController() [3/3]

makVre::DtLightStateController::DtLightStateController ( const DtLightStateController & orig)
private

Copy constructor (not implemented)

Copy constructor is private and not implemented to prevent copy construction.

References DtLightStateController().

Member Function Documentation

◆ type()

virtual const char * makVre::DtLightStateController::type ( ) const
overridevirtual

Gets the type identifier for this component.

Returns
String identifying the component type (DtLightStateControllerType)

Implements the DtSimComponent::type() method to return the type identifier for this component.

◆ createPortGroups()

virtual bool makVre::DtLightStateController::createPortGroups ( )
overridevirtual

Creates port groups for this component.

Returns
True if port groups were created successfully, false otherwise

Creates and initializes the input port groups used by this controller for light state control.

◆ createPorts()

virtual bool makVre::DtLightStateController::createPorts ( )
overridevirtual

Creates input and output ports for this component.

Returns
True if ports were created successfully, false otherwise

Creates and initializes all input ports used by this controller for light state control, including ports for headlights, throttle, and brake inputs.

◆ creator()

static DtSimComponent * makVre::DtLightStateController::creator ( const DtString & name,
DtLocalObject * owner,
DtSimulationServices * simManager,
DtComponentDescriptor * desc = 0,
DtReaderWriterRegistry * parentRegistry = 0 )
static

Factory method to create a new instance of this component.

Parameters
nameThe name for the new component
ownerThe local object that will own this component
simManagerThe simulation services manager
descOptional component descriptor
parentRegistryOptional parent registry for reader/writer functionality
Returns
Pointer to the newly created component

Static factory method used by the component creation system to instantiate new instances of this component type.

◆ operator=()

DtLightStateController & makVre::DtLightStateController::operator= ( const DtLightStateController & orig)
private

Assignment operator (not implemented)

Returns
Reference to this object

Assignment operator is private and not implemented to prevent assignment.

References DtLightStateController().

◆ tick()

virtual void makVre::DtLightStateController::tick ( )
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.

Member Data Documentation

◆ myStatePortGroup

DtInputPortGroup* makVre::DtLightStateController::myStatePortGroup
protected

Input port group for light state controls.

Contains all input ports related to light state control.

◆ myHeadlightPort

DtBooleanInputPort* makVre::DtLightStateController::myHeadlightPort
protected

Input port for headlight control.

When true, indicates that headlights should be turned on.

◆ myThrottlePort

DtAnalogInputPort* makVre::DtLightStateController::myThrottlePort
protected

Input port for throttle state.

Analog input representing the current throttle position, with 0.0 being idle and 1.0 being full throttle.

◆ myBrakePort

DtAnalogInputPort* makVre::DtLightStateController::myBrakePort
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.

◆ myPlatformLocalObjectFacade

DtPlatformLocalObjectFacade makVre::DtLightStateController::myPlatformLocalObjectFacade
protected

Facade for platform local object access.

Provides simplified access to platform-specific functionality of the local object, including light state control.


The documentation for this class was generated from the following file: