VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 
48  {
49  public:
50  enum DtIgMode
51  {
52  ResetStandby = 0,
53  Operate = 1,
54  Debug = 2
55  };
56 
58 
60  virtual ~DtCigiConnection();
61 
63  virtual void init();
64 
66  virtual bool tick();
67 
69  virtual bool connect();
70 
72  virtual bool disconnect();
73 
80  virtual void restart();
81 
83  virtual void setConnectionInitializer(const DtCigiConnectionInitializer& init);
84 
86  virtual int cigiMinorVersion() const;
87 
89  virtual void sendCigiMessages();
90 
92  virtual void setCoordinateSystem(const std::string& name,
93  const std::string& params);
94 
96  virtual DtCoordinateSystem& coordinateSystem();
97 
99 
100  virtual const DtCigiEntityVisualizer& entityManager() const;
101  virtual DtCigiEntityVisualizer& entityManager();
103 
105 
106  virtual const DtCigiIgControlProcessor& igControlProcessor() const;
107  virtual DtCigiIgControlProcessor& igControlProcessor();
109 
111 
112  virtual const DtCigiNetworkIO& networkIO() const;
113  virtual DtCigiNetworkIO& networkIO();
115 
117  virtual const makArchives::DtCigiSettingsRecord& cigiSettings() const;
118 
120  virtual void setLastHostFrameNumber(unsigned int frameNumber);
121 
123  virtual unsigned int lastHostFrameNumber() const;
124 
126  inline bool useSynchronousMode() const
127  {
128  return myUseSynchronousMode;
129  }
130 
132  virtual void setIgMode(DtIgMode mode);
133 
135  inline DtIgMode igMode() const
136  {
137  return myMode;
138  }
139 
141  virtual void setDatabaseNumber(int number);
142 
144  virtual int databaseNumber() const;
145 
148  virtual void setLoadingDatabase();
149 
152  virtual void setDatabaseLoaded();
153 
155  virtual void setExtrapolationEnabled(bool enabled);
156 
158  virtual bool extrapolationEnabled() const;
159 
161  virtual void setTimestampValid(bool valid);
162 
164  virtual bool timestampValid() const;
165 
167  virtual void setLastTimestamp(unsigned int timestamp);
168 
170  virtual unsigned int lastTimestamp() const;
171 
173  virtual void sendHatHotResponse(double height, unsigned int hotId, bool hat,
174  unsigned int lastFrame, bool valid);
175 
177  virtual void sendLosResponse(int losId, int entityId, bool visible, double range,
178  int responseCount, int hostFrame);
179 
184  virtual void sendUserPacket( CigiBasePacket* packet );
185 
187 
188  virtual const DtHatHotResponder& hatHotResponder() const;
189  virtual DtHatHotResponder& hatHotResponder();
191 
193 
194  virtual const DtLosResponder& losResponder() const;
195  virtual DtLosResponder& losResponder();
197 
199  virtual unsigned int currentIgFrame() const;
200 
202  virtual DtComponentSignaler& componentSignaler();
203 
205 
206 
207  virtual CigiIGSession& session();
208  virtual const CigiIGSession& session() const;
210 
212  bool cigiSessionExists() const;
213 
215  virtual bool registerUserPacket(CigiBasePacket *packet,
216  unsigned int packetId, bool hostSend, bool igSend);
217 
219  virtual bool useThreadFlag() const;
220 
222  virtual void queueDriverFunction(boost::function<void ()> func);
223 
227  virtual void queueConnectionFunction(boost::function<void ()> func);
228 
231  virtual DtCigiDriver& cigiDriver();
232 
234 
235 
241  virtual void startOverloadTimer();
242 
244  virtual void stopOverloadTimer();
245 
247  virtual bool overloaded();
248 
251  virtual void setWarnOnOverload( bool b );
252 
254  virtual bool warnOnOverload() const;
255 
259  virtual void setDropMessagesOnOverload( bool b );
260 
262  virtual bool dropMessagesOnOverload() const;
263 
266  virtual double hostFrequency() const;
268 
270  boost::signal<void (DtViewStateProcessor::ObserverAction&)>
272 
274  boost::signal<void (int, DtUniqueID)> signal_alphaChanged;
275 
277  boost::signal<void (int, DtCigiViewController::DtViewDefinitionAction) >
279 
281  boost::signal<void (int, DtCigiViewController::DtViewControlAction)>
283 
285  boost::signal<void (int, int, int, int, int)> signal_timeSet;
286 
289  boost::signal<void (bool)> signal_ephemerisEnableSet;
290 
292  boost::signal<void (const std::string&)> signal_loadDatabase;
293 
295  boost::signal<void ()> signal_connected;
296 
298  boost::signal<void ()> signal_toBeDisconnected;
299 
301  boost::signal<void ()> signal_coordinateSystemChanged;
302 
304  boost::signal<void (bool)> signal_deadReckoningAllowedChanged;
305 
307  boost::signal<void ()> signal_preTick;
308 
310  boost::signal<void ()> signal_postTick;
311 
312  protected:
315  DtAgentManagerInterface& sceneInterface,
316  DtSharedSettingsManager& settingsManager,
317  DtCigiDriver& driver);
318 
320  virtual void on_viewControlReceived(const CigiViewCtrlV3& viewControl);
321 
322  protected:
323  typedef std::map<std::string,DtVirtualBaseClass*> InstanceMap;
324 
337 
338  unsigned int myIgFrame;
339  unsigned int myLastHostFrameNumber;
346  unsigned int myLastTimestamp;
348 
349  DtTimedSection myOverloadTimer;
353  };
354 
358  {
359  public:
362 
364  virtual ~DtCigiConnectionCreator();
365 
367  static DtCigiConnectionCreator& instance( DtDe& de );
368 
370  virtual DtCigiConnection* create(const DtCigiConnectionInitializer& init,
371  DtAgentManagerInterface& sceneInterface,
372  DtSharedSettingsManager& settingsManager,
373  DtCigiDriver& driver) const;
374  };
375 }

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)