VR-Vantage 3.1 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ciChannel.h
Go to the documentation of this file.
1 
2 // Copyright JRM Enterprises, Inc. 2004 - 2012
3 // All rights reserved.
4 //
5 // This code is the intellectual property of JRM Enterprises, Inc.
6 // It may not be used or released as source or compiled binary form
7 // without the prior written consent of JRM Enterprises, Inc.
8 //
9 // Original Author: Michael Ortalano
10 // Date: Oct 2004
11 //
12 //
13 //
14 //
16 
17 #if !defined(AFX_CICHANNEL_H__DE81EF86_CAA9_471E_AE7A_9087CD4CB282__INCLUDED_)
18 #define AFX_CICHANNEL_H__DE81EF86_CAA9_471E_AE7A_9087CD4CB282__INCLUDED_
19 
20 #if _MSC_VER > 1000
21 #pragma once
22 #endif // _MSC_VER > 1000
23 
24 #include "ciApi.h"
25 #include "clXML.h"
26 #include <stdio.h>
27 #include <string.h>
28 #include <iostream>
29 #include <fstream>
30 #include <memory.h>
31 #include <malloc.h>
32 #include <assert.h>
33 #include "clXMLNode.h"
39 {
40 public: // enumerations
41 
42 
43 public: // contructors, destructors and assignment operators
44 
46  // ciChannel
51  ciChannel();
52 
54  // ciChannel
62 
64  // ~ciChannel
69  virtual ~ciChannel();
70 
72  // operator =
80  ciChannel operator =(ciChannel &obj);
81 
83  // operator []
90  ciChannel &operator [] (int idx);
91 
92 public: // methods
93 
95  // Add
104  bool add(ciChannel channel);
105 
107  // Insert
117  bool insert(ciChannel channel, int placeBeforeIdx);
118 
120  // Remove
128  bool remove(int channelIdx);
129 
131  // Print
139  void print();
140 
142  // archive
151  bool archive(std::ofstream &outf);
152 
154  // serialize
162  int serialize(char *filepath);
163 
164  //
165  // loadXML
166  //
167  // \par Description:
168  // Loads attributes from an XML node
169  //
170  // \param clXMLNode* childNode
171  // \return bool
172  //
173  bool loadXML(clXMLNode* childNode);
174 
175  //
176  // parseXML
177  //
178  // \par Description:
179  // Parses an XML document for specific tags
180  //
181  // \param clXML xmlDocument
182  // \return bool
183  //
184  bool parseXML(clXML& xmlDocument);
185 
187  //loadXMLNode
194  bool loadXMLNode(std::string tag, char *nodeString);
196  //loadXMLNode
203  bool loadXMLNode(std::string tag, bool *nodeBool);
205  //loadXMLNode
212  bool loadXMLNode(std::string tag, int *nodeBool);
214  //loadXMLNode
221  bool loadXMLNode(std::string tag, double *nodeBool);
222 
223  //
224  // saveXML
225  //
226  // \par Description:
227  // Saves XML nodes to an XML document
228  //
229  // \param clXML* xmlDocument
230  //
231  void saveXML(clXML* xmlDocument);
232 
234  //serializeCheck
240  int serializeCheck(char *filepath);
241 
243  // setIndex
250  void setIndex(int index)
251  {
252  if(!m_channelList) return;
253  m_channelList[0].index = index;
254  }
255 
257  // getIndex
264  int getIndex()
265  {
266  if(!m_channelList) return(0);
267  return m_channelList[0].index;
268  }
269 
271  // getNumChannels
278  int getNumChannels() {return m_nChannels;}
280  //setNumChannels
285  void setNumChannels(int count) {m_nChannels = count;}
286 
288  // Getters and Setters
289 
291  // GetName
298  char *getName(int index=0);
299 
300 
302  // SetName
310  void setName(const char *name, int index=0);
311 
312  char *getIp(int index=0);
313  void setIp(char *ipAddr, int index=0);
314 
315  int getSocket(int index=0);
316  void setSocket(int socket, int index=0);
317 
318  int getPortChannel(int index=0);
319  void setPortChannel(int socket, int index=0);
320 
321  char *getDIUIp(int index=0);
322  void setDIUIp(char *ipAddr, int index=0);
323 
324  int getDIUPort(int index=0);
325  void setDIUPort(int socket, int index=0);
326 
327  char *getFGUIp(int index=0);
328  void setFGUIp(char *ipAddr, int index=0);
329 
330  int getFGUPort(int index=0);
331  void setFGUPort(int port, int index=0);
332 
333  int getEntity(int index=0);
334  void setEntity(int entity, int index=0);
335 
336  int getSensor(int index=0);
337  void setSensor(int sensor, int index=0);
338 
339  int getViewportX(int index=0);
340  void setViewportX(int x, int index=0);
341 
342  int getViewportY(int index=0);
343  void setViewportY(int y, int index=0);
344 
345  int getViewportWidth(int index=0);
346  void setViewportWidth(int width, int index=0);
347 
348  int getViewportHeight(int index=0);
349  void setViewportHeight(int width, int index=0);
350 
351  int getWindowX(int index=0);
352  void setWindowX(int x, int index=0);
353 
354  int getWindowY(int index=0);
355  void setWindowY(int y, int index=0);
356 
357  int getWindowWidth(int index=0);
358  void setWindowWidth(int width, int index=0);
359 
360  int getWindowHeight(int index=0);
361  void setWindowHeight(int width, int index=0);
362 
363  int getDisplay(int index=0);
364  void setDisplay(int display, int index=0);
365 
366  int getDisplayWidth(int index=0);
367  void setDisplayWidth(int display, int index=0);
368 
369  int getDisplayHeight(int index=0);
370  void setDisplayHeight(int display, int index=0);
371 
372  int getDisplayRate(int index=0);
373  void setDisplayRate(int display, int index=0);
374 
375  int getRestoreDisplayWidth(int index=0);
376  void setRestoreDisplayWidth(int display, int index=0);
377 
378  int getRestoreDisplayHeight(int index=0);
379  void setRestoreDisplayHeight(int display, int index=0);
380 
381  int getRestoreDisplayRate(int index=0);
382  void setRestoreDisplayRate(int display, int index=0);
383 
384  int getDisplayState(int index=0);
385  void setDisplayState(int display, int index=0);
386 
387  char *getDIUCommand(int index=0);
388  void setDIUCommand(char *cmd, int index=0);
389 
390  char *getSGUCommand(int index=0);
391  void setSGUCommand(char *cmd, int index=0);
392 
393  char *getFGUCommand(int index=0);
394  void setFGUCommand(char *cmd, int index=0);
395 
396  char *getTrackfile(int index=0);
397  void setTrackfile(char *cmd, int index=0);
398 
399  int getRTSCCommunicationEnable(int index=0);
400  void setRTSCCommunicationEnable(int enable, int index=0);
401 
402  int getConnectionType(int index=0);
403  void setConnectionType(int type, int index=0);
404 
405  int getAsyncUpdateEnable(int index=0);
406  void setAsyncUpdateEnable(int enable, int index=0);
407 
408  double getAsyncUpdateTime(int index=0);
409  void setAsyncUpdateTime(double time, int index=0);
410 
411  char *getClientIPAddress(int index=0);
412  void setClientIPAddress(char *ip, int index=0);
413 
414  int getClientPort(int index=0);
415  void setClientPort(int port, int index=0);
416 
417 protected: // methods
418 
419 private: // methods
420 
421 private: // variables
422 
424  // structChannelData
438  {
439  int index;
440  char channelName[128];
442  char ip[128];
443  int port;
445  char DIUip[128];
446  int DIUport;
447  char FGUip[128];
448  int FGUport;
449  int sensorID;
450  int entityID;
455  int windowX;
456  int windowY;
459  int display;
467  char diuCommand[1024];
468  char sguCommand[1024];
469  char fguCommand[1024];
470  char trackfile[1024];
475  char ipAddress[64];
477  } *m_channelList;
482  // ciChannel *m_ciChannelList; /*!< contiguous array of active ciChannel objects */
483 
484 };
485 
486 #endif // !defined(AFX_CICHANNEL_H__DE81EF86_CAA9_471E_AE7A_9087CD4CB282__INCLUDED_)


Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)