VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
simpleRadarWarnRx.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 #include <vl/globalObjectDesignator.h>
10 
11 //class DtSimpleRadarWarningReceiver:
12 //
13 //Instances of DtSimpleRadarWarningReceiver are an example of a simple radar
14 //warning reciever. For the purposes of example this receiver determines
15 //that it has detected a remote radar if a given remote emitter system
16 //is located within a given distance from the entity configured with the
17 //reciever. The list of radar emitters sensed this tick is generated as
18 //output.
19 
22 
24 {
25 public:
26  //constructor
29  DtReaderWriterRegistry * parentRegistry = 0);
30 
31  //destructor
33 
34  //Calls createRelfectedEmitterList() and createEmitterListPort().
35  virtual bool init();
36 
37  //Called by init(). Creates the VR-Link list of all reflected emitter
38  //objects in the simulation.
39  virtual bool createReflectedEmitterList();
40 
41  //This returns a string that uniquely identifies this type of component.
42  //(must be unique with respect to the component types defined in compTypes.h
43  //as well as any additional user-defined components). Returns the string
44  //"simple-radar-warning-receiver".
45  virtual const char* type() const;
46 
47  //This is the entity we're detecting for. We override because we
48  //want to grab and cache the global object designator.
49  virtual void setEntity(DtVrfObject * entity);
50 
51  //Detects emitters and places them on our port.
52  virtual void tick();
53 
54  //Returns the list of emitters we've detected.
55  virtual DtEntityListOutputPort* emitterListPort() const;
56 
57  //Returns a newly created instance of this class. We need to provide
58  //this function so that we can register this class with the component
59  //factory.
60  static DtSimComponent * creator(const DtString & name, DtVrfObject* owner,
61  DtSimManager * simManager, DtComponentDescriptor* desc,
62  DtReaderWriterRegistry * parentRegistry);
63 
64 protected:
65 
66  //Overridden to create myEmitterListPort
67  virtual bool createPorts();
68 
69 protected:
70  //Default constructor; should not be called. Here because the compiler
71  //will generate an unprotected one otherwise.
73 
74  //copy constructor, not implemented
76 
77  //assignment operator, not implemented
79  const DtSimpleRadarWarningReceiver& orig);
80 
81 protected:
82 
83  //Port used to communicate the list of detected emitter systems to
84  //other components.
86 
87  //The id of the entity this receiver is mounted on.
89 
90  //Pointer to the descriptor that holds the initialization parameters for this component.
91  //This pointer is const because all instances of this component share a single
92  //descriptor instance, so they should not be writing data back to it.
94 };
Definition: radarWarningReceiverDesc.h:20
DtEntityListOutputPort * myEmitterListPort
Definition: simpleRadarWarnRx.h:85
DtVrfObject * entity()
Gets the entity.
Definition: simComponent.h:400
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
DtSimpleRadarWarningReceiver & operator=(const DtSimpleRadarWarningReceiver &orig)
DtSimManager * simManager()
Gets the sim manager.
Definition: simComponent.h:408
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:42
virtual bool init()
Calls createPorts and createPortGroups Initializes myLastTickSimTime.
Definition: readerWriterRegistry.h:39
virtual bool createPorts()
Called by init.
virtual void setEntity(DtVrfObject *entity)
The entity&#39;s state repository is the place that actuator components make updates and other components...
static DtSimComponent * creator(const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc, DtReaderWriterRegistry *parentRegistry)
Definition: simpleRadarWarnRx.h:23
Instances of DtEntityListOutputPort are output ports through which data producers can send a list of ...
Definition: entListIOPort.h:43
virtual DtEntityListOutputPort * emitterListPort() const
virtual const char * type() const
Returns a string identifies the class type of component.
virtual bool createReflectedEmitterList()
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
const DtRadarWarningReceiverDescriptor * myDescriptor
Definition: simpleRadarWarnRx.h:93
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:102
virtual void tick()
This gives the thread of control to the component.
DtGlobalObjectDesignator myGlobalId
Definition: simpleRadarWarnRx.h:88
virtual DtSymbolString name() const
Accessor for name of this readable/writable object.

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)