VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
textIf.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2021 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
8 #include <vlutil/vlUtil.h>
9 #include <vlpi/simulationAddress.h>
10 
11 //This class provides a text interface for controlling VR-Forces's aerodrome stuff over the network.
12 //This interface currently supports the following actions:
13 //
14 //1. set [ lights | arrestorGear | runwayCondition ]
15 // set a VR-Forces object attribute
16 
17 //2. get [ lights | allLights | arrestorGear | allArrestorGear | runwayCondition ]
18 // get the corresponding value of a VR-Forces entity
19 
20 //3. list [aerodromes | runways]
21 // print the list of all aerodromes/runways in the simulation
22 
23 //4. print [object]
24 // print all relevant aerodrome information about a runway/aerodrome
25 
26 //5. printAll
27 // print all relevant aerodrome informations in the simulation
28 
29 //6. quit
30 // quit the application
31 
33 class DtSimMessage;
35 
36 class DtTextInterface
37 {
38 public:
39 
40  //constructor
41  DtTextInterface(DtVrfRemoteController* controller/*, DtReflectedAerodromeObjectsManager* manager*/);
42 
43  //destructor
44  virtual ~DtTextInterface();
45 
46  //Process entered text
47  void readStdin();
48 
49  //Set/Get time to quit
50  virtual void setTimeToQuit(bool yesNo);
51  virtual bool timeToQuit() const;
52 
53  //Get remote vrf controller pointer
54  virtual DtVrfRemoteController* controller() const;
55 
56  static void scenarioStatusCallback(DtSimMessage* msg, void* usr);
57 
58 public:
59 
60  //Functions for parsing command strings
61  virtual void setLights(char* str);
62  virtual void setAllLights(char* str);
63  virtual void setArrestorGear(char* str);
64  virtual void setRunwayCondition(char* str);
65 
66  virtual void getLights(char* str);
67  virtual void getAllLights(char* str);
68  virtual void getArrestorGear(char* str);
69  virtual void getAllArrestorGear(char* str);
70  virtual void getRunwayCondition(char* str);
71 
72  virtual void listAerodromes();
73  virtual void listRunways(char* str);
74 
75  virtual void printSpeciticObjectDatas(char* str);
76  virtual void printAllDatas();
77 
78 public:
79 
80  //-------------------------------------------------------
81  //Text callback functions
82  //-------------------------------------------------------
83 
84  //Called in response to "set"
85  static void setCmd(char* s, DtTextInterface* a);
86 
87  //Called in response to "get"
88  static void getCmd(char* s, DtTextInterface* a);
89 
90  //Called in response to "quit" or "q"
91  static void quitCmd(char* s, DtTextInterface* a);
92 
93  //Called in response to "help" or "?" or "h"
94  static void helpCmd(char* s, DtTextInterface* a);
95 
96  //Called in response to "list"
97  static void listCmd(char* s, DtTextInterface* a);
98 
99  //Called in response to "print"
100  static void printCmd(char* s, DtTextInterface* a);
101 
102  //Called in response to "printAll"
103  static void printAllCmd(char* s, DtTextInterface* a);
104 
105 public:
106 
107  //callback on the creation of control objects
108  static void controlObjectAddedCallback(DtReflectedControlObject*, void* usr);
110 
111 protected:
112 
113  //Present commmand line interface.
114  void prompt();
115 
116  //Parse user input, call corresponding function
117  void processCmd(char *buff);
118 
119 protected :
120 
121  //method useful to look for a control object from its name
122  //such methods already exists in the uuidNetworkManager(), but,in case if the entity has been renamed, it looks on all control objects in the simulation
123  virtual DtReflectedControlObject* lookupVrfControlObjectByName(const std::string& markingText);
124 
125 protected:
126 
127  bool myTimeToQuit;
129 
130 private:
131  int kbInterest;
132 };
static void listCmd(char *s, DtTextInterface *a)
virtual void listAerodromes()
virtual void getLights(char *str)
virtual void printSpeciticObjectDatas(char *str)
static void getCmd(char *s, DtTextInterface *a)
Definition: textIf.h:65
virtual void listRunways(char *str)
virtual DtReflectedControlObject * lookupVrfControlObjectByName(const std::string &markingText)
virtual void printAllDatas()
void processCmd(char *buff)
virtual void setLights(char *str)
int kbInterest
Definition: textIf.h:271
bool myTimeToQuit
Definition: textIf.h:263
DtVrfRemoteController * myController
Definition: textIf.h:264
virtual void setRunwayCondition(char *str)
The main class for the remote control interface to VR-Forces.
Definition: vrfRemoteController.h:204
virtual void setArrestorGear(char *str)
static void quitCmd(char *s, DtTextInterface *a)
File: simMsg.h.
Definition: simMessage.h:35
virtual void getAllArrestorGear(char *str)
DtTextInterface(DtVrfRemoteController *controller)
static void scenarioStatusCallback(DtSimMessage *msg, void *usr)
virtual DtVrfRemoteController * controller() const
virtual void processControlObjectAdded(DtReflectedControlObject *)
virtual void setAllLights(char *str)
virtual ~DtTextInterface()
virtual void getAllLights(char *str)
static void printCmd(char *s, DtTextInterface *a)
virtual bool timeToQuit() const
static void setCmd(char *s, DtTextInterface *a)
static void controlObjectAddedCallback(DtReflectedControlObject *, void *usr)
static void printAllCmd(char *s, DtTextInterface *a)
virtual void getRunwayCondition(char *str)
static void helpCmd(char *s, DtTextInterface *a)
Definition: reflectedControlObject.h:26
virtual void getArrestorGear(char *str)
virtual void setTimeToQuit(bool yesNo)

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)