VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
simpleRdrWrnResp.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2017 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
9 
10 //class DtSimpleRadarWarningResponse:
11 //
12 //Instances of DtSimpleRadarWarningResponse are an example of a controller
13 //that implements a reactive behavior when a it receives sensor input that
14 //a radar has been detected. It receives a list of emitter systems (hostile
15 //radar systems). It takes the first emitter in the list and flys away to
16 //a location in the opposite direction.
17 
19 class DtUUID;
20 
22 {
23 public:
24 
25  //constructor
28  DtReaderWriterRegistry* const parentRegistry = 0);
29 
30 
31  //destructor
33 
34  //This returns a string that uniquely identifies this type of component.
35  //(must be unique with respect to the component types defined in compTypes.h
36  //as well as any additional user-defined components). Returns the string
37  //"simple-radar-warning-response".
38  virtual const char* type() const;
39 
40  //Calculate new control values.
41  virtual void tick();
42 
43  //Returns a newly created instance of this class. We need to provide
44  //this function so that we can register this class with the component
45  //factory.
46  static DtSimComponent* creator(const DtString& name, DtLocalObject* owner,
48  DtReaderWriterRegistry* parentRegistry);
49 
50 protected:
51 
52  //Called by DtSimComponent::init to create myEntityListPort used to manage
53  //multiple sensors that might provide targets to this controller.
54  virtual bool createPorts();
55 
56  //Looks up safe control point by name. If the object exists and it has
57  //a valid state repository, returns the object. Otherwise returns NULL.
59 
60  //Returns true if we are in the vicinity of the given position. To be
61  //in the vicinity of the position means that we are within 5 seconds of
62  //the given location, given our ordered speed.
63  virtual bool inVicinity(const DtVector& localPosition);
64 
65 protected:
66 
67  //default constructor
69 
70  //copy constructor, not implemented
72 
73  //assignment operator, not implemented
75 
76 protected:
77 
78  //Port though which the list of hostile emitter systems will be received.
80 
81  //true while in state of reacting to the detection of an emitter.
83 
84  //Name of the safe location (a control point) we can retreat to.
86 
87  DtVector myLocalGoal;
88 };
UUID is a unique ID wrapper class.
Definition: uuid.h:59
virtual bool createPorts() override
Overridden to create the fixed wing ports.
virtual DtSimObjectReference getControlPoint(const DtUUID &name)
DtVector myLocalGoal
Definition: simpleRdrWrnResp.h:87
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
Definition: readerWriterRegistry.h:39
DtFixedWingPilotController is a controller that models the capabilities of a fixed-wing pilot...
Definition: fixedWingPilotController.h:47
virtual void tick() override
Only gets actuator values the first time it's called. Call lookupAndCacheProcessSR(), to look up myProcessState, if it hasn't already been found.
virtual bool inVicinity(const DtVector &localPosition)
Contains class declarations for DtEntityListInputPort, DtEntityListOutputPort, and DtEntityListPortDa...
Definition: entListIOPort.h:29
static DtSimComponent * creator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc, DtReaderWriterRegistry *parentRegistry)
DtEntityListInputPort * myEmitterListPort
Definition: simpleRdrWrnResp.h:79
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:96
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:89
VRF4API_METHOD const DtSimulationServices * simManager() const
This is the deprecated API that can be used as a reference to migrate 4.X code to 5...
Definition: simComponent.h:583
DtSimpleRadarWarningResponse & operator=(const DtSimpleRadarWarningResponse &orig)
virtual ~DtSimpleRadarWarningResponse() override
Definition: simpleRdrWrnResp.h:21
bool myReactingToWarning
Definition: simpleRdrWrnResp.h:82
virtual const char * type() const override
Returns a string identifies the class type of component. Type values are defined in compTypes...
virtual DtSymbolString name() const
Accessor for name of this readable/writable object.
DtUUID mySafeControlPointName
Definition: simpleRdrWrnResp.h:85
A locally simulated VRF object.
Definition: localObject.h:98

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)