VR-Forces Development_Version 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) 2016 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 
75  virtual void setConnectionInitializer(const DtCigiConnectionInitializer& init);
76 
78  virtual int cigiMinorVersion() const;
79 
81  virtual void sendCigiMessages();
82 
84  virtual void setCoordinateSystem(const std::string& name,
85  const std::string& params);
86 
88  virtual DtCoordinateSystem& coordinateSystem();
89 
91 
92  virtual const DtCigiEntityVisualizer& entityManager() const;
93  virtual DtCigiEntityVisualizer& entityManager();
95 
97 
98  virtual const DtCigiIgControlProcessor& igControlProcessor() const;
99  virtual DtCigiIgControlProcessor& igControlProcessor();
101 
103 
104  virtual const DtCigiNetworkIO& networkIO() const;
105  virtual DtCigiNetworkIO& networkIO();
107 
109  virtual const makArchives::DtCigiSettingsRecord& cigiSettings() const;
110 
112  virtual void setLastHostFrameNumber(unsigned int frameNumber);
113 
115  virtual unsigned int lastHostFrameNumber() const;
116 
118  inline bool useSynchronousMode() const
119  {
120  return myUseSynchronousMode;
121  }
122 
124  virtual void setIgMode(DtIgMode mode);
125 
127  inline DtIgMode igMode() const
128  {
129  return myMode;
130  }
131 
133  virtual void setDatabaseNumber(int number);
134 
136  virtual int databaseNumber() const;
137 
140  virtual void setLoadingDatabase();
141 
144  virtual void setDatabaseLoaded();
145 
147  virtual void setExtrapolationEnabled(bool enabled);
148 
150  virtual bool extrapolationEnabled() const;
151 
153  virtual void setTimestampValid(bool valid);
154 
156  virtual bool timestampValid() const;
157 
159  virtual void setLastTimestamp(unsigned int timestamp);
160 
162  virtual unsigned int lastTimestamp() const;
163 
165  virtual void sendHatHotResponse(double height, unsigned int hotId, bool hat,
166  unsigned int lastFrame, bool valid);
167 
169  virtual void sendLosResponse(int losId, int entityId, bool visible, double range,
170  int responseCount, int hostFrame);
171 
176  virtual void sendUserPacket( CigiBasePacket* packet );
177 
179  virtual const DtHatHotResponder& hatHotResponder() const;
180  virtual DtHatHotResponder& hatHotResponder();
181 
183  virtual const DtLosResponder& losResponder() const;
184  virtual DtLosResponder& losResponder();
185 
187  virtual unsigned int currentIgFrame() const;
188 
190  virtual DtComponentSignaler& componentSignaler();
191 
193 
194 
195  virtual CigiIGSession& session();
196  virtual const CigiIGSession& session() const;
198 
200  bool cigiSessionExists() const;
201 
203  virtual bool registerUserPacket(CigiBasePacket *packet,
204  unsigned int packetId, bool hostSend, bool igSend);
205 
207  virtual bool useThreadFlag() const;
208 
210  virtual void queueDriverFunction(boost::function<void ()> func);
211 
215  virtual void queueConnectionFunction(boost::function<void ()> func);
216 
218 
219 
225  virtual void startOverloadTimer();
226 
228  virtual void stopOverloadTimer();
229 
231  virtual bool overloaded();
232 
235  virtual void setWarnOnOverload( bool b );
236 
238  virtual bool warnOnOverload() const;
239 
243  virtual void setDropMessagesOnOverload( bool b );
244 
246  virtual bool dropMessagesOnOverload() const;
247 
248  virtual double hostFrequency() const;
250 
252  boost::signal<void (DtViewStateProcessor::ObserverAction&)>
254 
256  boost::signal<void (int, DtUniqueID)> signal_alphaChanged;
257 
259  boost::signal<void (int, DtCigiViewController::DtViewDefinitionAction) >
261 
263  boost::signal<void (int, DtCigiViewController::DtViewControlAction)>
265 
267  boost::signal<void (int, int, int, int, int)> signal_timeSet;
268 
271  boost::signal<void (bool)> signal_ephemerisEnableSet;
272 
274  boost::signal<void (const std::string&)> signal_loadDatabase;
275 
277  boost::signal<void ()> signal_connected;
278 
280  boost::signal<void ()> signal_toBeDisconnected;
281 
283  boost::signal<void ()> signal_coordinateSystemChanged;
284 
285  boost::signal<void (bool)> signal_deadReckoningAllowedChanged;
286 
287  protected:
290  DtAgentManagerInterface& sceneInterface,
291  DtSharedSettingsManager& settingsManager,
292  DtCigiDriver& driver);
293 
295  virtual void on_viewControlReceived(const CigiViewCtrlV3& viewControl);
296 
297  protected:
298  typedef std::map<std::string,DtVirtualBaseClass*> InstanceMap;
299 
312 
313  unsigned int myIgFrame;
314  unsigned int myLastHostFrameNumber;
321  unsigned int myLastTimestamp;
323 
324  DtTimedSection myOverloadTimer;
328  };
329 
333  {
334  public:
337 
339  virtual ~DtCigiConnectionCreator();
340 
342  static DtCigiConnectionCreator& instance( DtDe& de );
343 
345  virtual DtCigiConnection* create(const DtCigiConnectionInitializer& init,
346  DtAgentManagerInterface& sceneInterface,
347  DtSharedSettingsManager& settingsManager,
348  DtCigiDriver& driver) const;
349  };
350 }

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)