VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCigiConnection.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2017 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 
9 
10 #pragma once
11 
16 
19 
20 #include <matrix/vlVector.h>
21 #include <vlutil/vlPerformanceStats.h>
23 
24 class CigiViewCtrlV3;
25 class CigiIGSession;
26 class CigiBasePacket;
27 
28 namespace makVrv
29 {
30  class DtDe; // for the creator class
31  class DtCigiConnectionInitializer;
32  class DtCigiNetworkIO;
33  class DtAgentManagerInterface;
34  class DtCigiEntityVisualizer;
35  class DtCoordinateSystem;
36  class DtSharedSettingsManager;
37  class DtVirtualBaseClass;
38  class DtCigiIgControlProcessor;
39  class DtHatHotResponder;
40  class DtLosResponder;
41  class DtCigiLosBasicResponse;
42  class DtCigiLosExtendedResponse;
43 
50  {
51  public:
52  enum DtIgMode
53  {
54  ResetStandby = 0,
55  Operate = 1,
56  Debug = 2
57  };
58 
60 
62  virtual ~DtCigiConnection();
63 
65  virtual void init();
66 
68  virtual bool tick();
69 
71  virtual bool connect();
72 
74  virtual bool disconnect();
75 
82  virtual void restart();
83 
85  virtual void setConnectionInitializer(const DtCigiConnectionInitializer& init);
86 
88  virtual int cigiMinorVersion() const;
89 
91  virtual void sendCigiMessages();
92 
94  virtual void setCoordinateSystem(const std::string& name,
95  const std::string& params);
96 
98  virtual DtCoordinateSystem& coordinateSystem();
99 
101 
102  virtual const DtCigiEntityVisualizer& entityManager() const;
103  virtual DtCigiEntityVisualizer& entityManager();
105 
107 
108  virtual const DtCigiIgControlProcessor& igControlProcessor() const;
109  virtual DtCigiIgControlProcessor& igControlProcessor();
111 
113 
114  virtual const DtCigiNetworkIO& networkIO() const;
115  virtual DtCigiNetworkIO& networkIO();
117 
119  virtual const makArchives::DtCigiSettingsRecord& cigiSettings() const;
120 
122  virtual void setLastHostFrameNumber(unsigned int frameNumber);
123 
125  virtual unsigned int lastHostFrameNumber() const;
126 
128  inline bool useSynchronousMode() const
129  {
130  return myUseSynchronousMode;
131  }
132 
134  virtual void setIgMode(DtIgMode mode);
135 
137  inline DtIgMode igMode() const
138  {
139  return myMode;
140  }
141 
143  virtual void setDatabaseNumber(int number);
144 
146  virtual int databaseNumber() const;
147 
150  virtual void setLoadingDatabase();
151 
154  virtual void setDatabaseLoaded();
155 
157  virtual void setExtrapolationEnabled(bool enabled);
158 
160  virtual bool extrapolationEnabled() const;
161 
163  virtual void setTimestampValid(bool valid);
164 
166  virtual bool timestampValid() const;
167 
169  virtual void setLastTimestamp(unsigned int timestamp);
170 
172  virtual unsigned int lastTimestamp() const;
173 
175  virtual void sendHatHotResponse(double height, unsigned int hotId, bool hat,
176  unsigned int lastFrame, bool valid);
177 
179  virtual void sendLosBasicResponse(DtCigiLosBasicResponse* losResponse);
180 
182  virtual void sendLosExtendedResponse(DtCigiLosExtendedResponse* losResponse);
183 
188  virtual void sendUserPacket( CigiBasePacket* packet );
189 
191 
192  virtual const DtHatHotResponder& hatHotResponder() const;
193  virtual DtHatHotResponder& hatHotResponder();
195 
197 
198  virtual const DtLosResponder& losResponder() const;
199  virtual DtLosResponder& losResponder();
201 
203  virtual unsigned int currentIgFrame() const;
204 
206  virtual DtComponentSignaler& componentSignaler();
207 
209 
210 
211  virtual CigiIGSession& session();
212  virtual const CigiIGSession& session() const;
214 
216  bool cigiSessionExists() const;
217 
219  virtual bool registerUserPacket(CigiBasePacket *packet,
220  unsigned int packetId, bool hostSend, bool igSend);
221 
223  virtual bool useThreadFlag() const;
224 
226  virtual void queueDriverFunction(boost::function<void ()> func);
227 
231  virtual void queueConnectionFunction(boost::function<void ()> func);
232 
235  virtual DtCigiDriver& cigiDriver();
236 
238 
239 
245  virtual void startOverloadTimer();
246 
248  virtual void stopOverloadTimer();
249 
251  virtual bool overloaded();
252 
255  virtual void setWarnOnOverload( bool b );
256 
258  virtual bool warnOnOverload() const;
259 
263  virtual void setDropMessagesOnOverload( bool b );
264 
266  virtual bool dropMessagesOnOverload() const;
267 
270  virtual double hostFrequency() const;
272 
274  boost::signal<void (DtViewStateProcessor::ObserverAction&)>
276 
278  boost::signal<void (int, DtUniqueID)> signal_alphaChanged;
279 
281  boost::signal<void (int, DtCigiViewController::DtViewDefinitionAction) >
283 
285  boost::signal<void (int, DtCigiViewController::DtViewControlAction)>
287 
289  boost::signal<void (int, int, int, int, int)> signal_timeSet;
290 
293  boost::signal<void (bool)> signal_ephemerisEnableSet;
294 
296  boost::signal<void (const std::string&)> signal_loadDatabase;
297 
299  boost::signal<void ()> signal_connected;
300 
302  boost::signal<void ()> signal_toBeDisconnected;
303 
305  boost::signal<void ()> signal_coordinateSystemChanged;
306 
308  boost::signal<void (bool)> signal_deadReckoningAllowedChanged;
309 
311  boost::signal<void ()> signal_preTick;
312 
314  boost::signal<void ()> signal_postTick;
315 
316  protected:
319  DtAgentManagerInterface& sceneInterface,
320  DtSharedSettingsManager& settingsManager,
321  DtCigiDriver& driver);
322 
324  virtual void on_viewControlReceived(const CigiViewCtrlV3& viewControl);
325 
326  protected:
327  typedef std::map<std::string,DtVirtualBaseClass*> InstanceMap;
328 
341 
342  unsigned int myIgFrame;
343  unsigned int myLastHostFrameNumber;
350  unsigned int myLastTimestamp;
352 
353  DtTimedSection myOverloadTimer;
357  };
358 
362  {
363  public:
366 
368  virtual ~DtCigiConnectionCreator();
369 
371  static DtCigiConnectionCreator& instance( DtDe& de );
372 
374  virtual DtCigiConnection* create(const DtCigiConnectionInitializer& init,
375  DtAgentManagerInterface& sceneInterface,
376  DtSharedSettingsManager& settingsManager,
377  DtCigiDriver& driver) const;
378  };
379 }

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)