VR-Forces 4.7 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
examples
radarWarnRx
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
8
#include "
vrfobjcore/simComponent.h
"
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
20
class
DtEntityListOutputPort
;
21
class
DtRadarWarningReceiverDescriptor
;
22
23
class
DtSimpleRadarWarningReceiver
:
public
DtSimComponent
24
{
25
public
:
26
//constructor
27
DtSimpleRadarWarningReceiver
(
const
DtString
&
name
,
DtVrfObject
* owner,
28
DtSimManager
*
simManager
,
DtComponentDescriptor
* desc = NULL,
29
DtReaderWriterRegistry
* parentRegistry = 0);
30
31
//destructor
32
virtual
~DtSimpleRadarWarningReceiver
();
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.
72
DtSimpleRadarWarningReceiver
();
73
74
//copy constructor, not implemented
75
DtSimpleRadarWarningReceiver
(
const
DtSimpleRadarWarningReceiver
& orig);
76
77
//assignment operator, not implemented
78
DtSimpleRadarWarningReceiver
&
operator=
(
79
const
DtSimpleRadarWarningReceiver
& orig);
80
81
protected
:
82
83
//Port used to communicate the list of detected emitter systems to
84
//other components.
85
DtEntityListOutputPort
*
myEmitterListPort
;
86
87
//The id of the entity this receiver is mounted on.
88
DtGlobalObjectDesignator
myGlobalId
;
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.
93
const
DtRadarWarningReceiverDescriptor
*
myDescriptor
;
94
};
Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (
www.mak.com
)