VR-Engage  2.2
Loading...
Searching...
No Matches
vehicleBlinkerActuator.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2024 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file vehicleBlinkerActuator.h
7//! \ingroup vreExamples
8
9//! \brief DtVehicleBlinkerActuator; actuator that controls vehicle turn signal lights.
10#pragma once
11
12#include "vrfobjcore/actuatorComponent.h"
13#include <vrfobjcore/localObject.h>
14
15// OBJ Core
16#include <vrfobjcore/boolIOPort.h>
17
18namespace makVre
19{
21
22constexpr char DtVehicleBlinkerActuatorType[] = "vehicle-blinker-actuator";
23
24class DtVehicleBlinkerActuator : public DtActuatorComponent
25{
26public:
27 //! \copydoc DtSimComponent(const DtString&,DtLocalObject*,DtSimulationServices*,
28 //! DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)
29 DtVehicleBlinkerActuator(const DtString& name,
30 DtLocalObject* owner,
31 DtSimulationServices* simManager,
32 DtComponentDescriptor* desc = nullptr,
33 DtReaderWriterRegistry* parentRegistry = nullptr);
34
35 //! default constructor; not implemented
37
38 //! copy constructor; not implemented
40
41 //! assignment operator; not implemented
43
44 //! destructor
45 virtual ~DtVehicleBlinkerActuator() override;
46
47public:
48 virtual bool init() override;
49
50 //! \copydoc DtSimComponent::type()
51 //! \return DtVehicleBlinkerActuatorType
52 virtual const char* type() const override;
53
54 virtual void tick() override;
55
56 //! \copydoc DtSimComponent(const DtString&,DtLocalObject*,DtSimulationServices*,
57 //! DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)
58 //! \return New instance of this class.
59 static DtSimComponent* creator(const DtString& name,
60 DtLocalObject* owner,
61 DtSimulationServices* simManager,
62 DtComponentDescriptor* desc = nullptr,
63 DtReaderWriterRegistry* parentRegistry = nullptr);
64
65protected:
66 //! Overridden to create local input ports for blinker commands.
67 virtual bool createPorts() override;
68
69 //! Updates left blinker lighting state based on current property value.
71
72 //! Updates right blinker lighting state based on current property value.
74
75protected:
77
78 DtBooleanInputPort* myLeftBlinkerPort;
79 DtBooleanInputPort* myRightBlinkerPort;
80
81 DtRwBoolean* myLeftBlinkerActive;
83};
84
85} // namespace makVre
const DtVehicleBlinkerActuator & operator=(const DtVehicleBlinkerActuator &orig)=delete
assignment operator; not implemented
DtBooleanInputPort * myLeftBlinkerPort
Definition vehicleBlinkerActuator.h:78
DtRwBoolean * myRightBlinkerActive
Definition vehicleBlinkerActuator.h:82
virtual bool createPorts() override
Overridden to create local input ports for blinker commands.
DtBooleanInputPort * myRightBlinkerPort
Definition vehicleBlinkerActuator.h:79
DtVehicleBlinkerActuator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=nullptr, DtReaderWriterRegistry *parentRegistry=nullptr)
virtual bool init() override
DtVehicleBlinkerActuator(const DtVehicleBlinkerActuator &orig)=delete
copy constructor; not implemented
static DtSimComponent * creator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=nullptr, DtReaderWriterRegistry *parentRegistry=nullptr)
void updateRightBlinker()
Updates right blinker lighting state based on current property value.
void updateLeftBlinker()
Updates left blinker lighting state based on current property value.
DtRwBoolean * myLeftBlinkerActive
Definition vehicleBlinkerActuator.h:81
virtual const char * type() const override
virtual void tick() override
DtVehicleBlinkerDescriptor * myLightsDescriptor
Definition vehicleBlinkerActuator.h:76
virtual ~DtVehicleBlinkerActuator() override
destructor
DtVehicleBlinkerActuator()=delete
default constructor; not implemented
Definition vehicleBlinkerDescriptor.h:22
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
constexpr char DtVehicleBlinkerActuatorType[]
Definition vehicleBlinkerActuator.h:22