VR-Vantage 2.7 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ciSensor.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: Nikolai Fedoroff
10 // Date: Oct 2004
11 //
12 
13 #if !defined(_ciSensor_h_)
14 #define _ciSensor_h_
15 #include "ciApi.h"
16 
17 #include "clXML.h"
18 #include <stdio.h>
19 #include <memory.h>
20 #include <malloc.h>
21 #include <string.h>
22 #include <assert.h>
23 #include <iostream>
24 #include <fstream>
25 #include "ciOptics.h"
26 #include "ciElectronics.h"
27 #include "ciDetector.h"
28 #include "ciSenSim.h"
29 #include "clXMLNode.h"
30 
36 {
37 public: // enumerations
38 
40  {
41  DEFAULT = 0,
42  IR = 1,
43  NVG = 2,
44  RADAR = 3
45  };
46 
47 public: // methods
48 
50  // save
59  bool archive(std::ofstream &outf);
60 
62  // serialize
70  int serialize(char *filepath);
71 
72  //
73  // loadXML
74  //
75  // \par Description:
76  // Loads attributes from an XML node
77  //
78  // \param clXMLNode* childNode
79  // \return bool
80  //
81  bool loadXML(clXMLNode* childNode);
82 
83  //
84  // parseXML
85  //
86  // \par Description:
87  // Parses an XML document for specific tags
88  //
89  // \param clXML xmlDocument
90  // \return bool
91  //
92  bool parseXML(clXML& xmlDocument);
93 
95  //loadXMLNode
102  bool loadXMLNode(std::string tag, char *nodeString);
103 
105  //loadXMLNode
112  bool loadXMLNode(std::string tag, bool *nodeBool);
114  //loadXMLNode
121  bool loadXMLNode(std::string tag, int *nodeBool);
123  //loadXMLNode
130  bool loadXMLNode(std::string tag, double *nodeBool);
131 
132  //
133  // saveXML
134  //
135  // \par Description:
136  // Saves XML nodes to an XML document
137  //
138  // \param clXML* xmlDocument
139  //
140  void saveXML(clXML* xmlDocument);
141 
143  //serializeCheck
149  int serializeCheck(char *filepath);
150 
152  // add
161  virtual bool add(ciSensor sensor);
162 
164  // insert
175  virtual bool insert(ciSensor sensor, int idx = -1);
176 
178  // remove
187  virtual bool remove(int idx);
188 
190  // getName
198  char *getName(int idx = 0);
199 
201  // setName
210  void setName(const char *name, int idx = 0);
211 
213  // getType
221  int getType(int idx = 0);
222  SensorType getSensorType(int idx = 0);
223 
225  // setType
234  void setType(int type, int idx = 0);
235  void setSensorType(SensorType type, int idx = 0);
236 
238  // setBandInfo
249  void setBandInfo(double lowerBandLim, double upperBandLim, int nBands, int idx = 0);
250 
252  // setBandInfo
263  void setBandInfo(double lowerBandLim, double upperBandLim, double dx, int idx = 0);
264 
266  // getBandInfo
277  void getBandInfo(double &lowerBandLim, double &upperBandLim, int &nBands, int idx = 0);
278 
280  // getBandInfo
291  void getBandInfo(double &lowerBandLim, double &upperBandLim, double &dx, int idx = 0);
292 
294  // setFOVDegrees
304  void setFOVDegrees(double horz, double vert, int idx = 0);
305 
307  // getFOVDegrees
317  void getFOVDegrees(double &horz, double &vert, int idx = 0);
318 
320  // setFOVPixels
330  void setFOVPixels(int horz, int vert, int idx = 0);
331 
333  // getFOVPixels
343  void getFOVPixels(int &horz, int &vert, int idx = 0);
345  //getSampleScale
351  double getSampleScale(int idx = 0){return m_sensorList[idx].sampleScale;}
353  //setSampleScale
359  void setSampleScale(double scale, int idx = 0){m_sensorList[idx].sampleScale = scale;}
360 
362  // setTemperatureLimits
372  void setTemperatureLimits(double tMax, double tMin, int idx = 0);
373 
375  // getTemperatureLimits
385  void getTemperatureLimits(double &tMax, double &tMin, int idx = 0);
386 
388  // setMaxLightLevel
397  void setMaxLightLevel(double maxLightLevel, int idx = 0);
398 
400  // getMaxLightLevel
408  double getMaxLightLevel(int idx = 0);
409 
411  // setSaturationRatio
420  void setSaturationRatio(double satRatio, int idx = 0);
421 
423  // getSaturationRatio
431  double getSaturationRatio(int idx = 0);
432 
434  // getTrackfile
442  char *getTrackfile(int idx = 0);
443 
445  // setTrackfile
454  void setTrackfile(char *filename, int idx = 0);
455 
457  // setIndex
464  void setIndex(int index) {m_sensorList[0].index = index;}
465 
467  // getIndex
474  int getIndex() {return m_sensorList[0].index;}
475 
477  // getNumSensors
484  int getNumSensors() {return m_nSensors;}
486  //setNumSensors
491  void setNumSensors(int nSensors) {m_nSensors = nSensors;}
493  //setAutomaticRadience
499  void setAutomaticRadiance(bool flag, int idx = 0);
501  //setAutomaticRadience
507  bool getAutomaticRadiance(int idx = 0);
508 
510  //setDopplerColoring
516  void setDopplerColoring(bool flag, int idx = 0);
517 
519  //getDopplerColoring
525  bool getDopplerColoring(int idx = 0);
526 
528  //setDopplerSpatialEffects
534  void setDopplerSpatialEffects(bool flag, int idx = 0);
535 
537  //getDopplerSpatialEffects
543  bool getDopplerSpatialEffects(int idx = 0);
544 
546  // setGain
555  void setGain(double gain, int idx = 0);
556 
558  // getGain
566  double getGain(int idx = 0);
567 
569  // setLevel
578  void setLevel(double level, int idx = 0);
579 
581  // getLevel
589  double getLevel(int idx = 0);
590 
592  // setPemitterW
601  void setPemitterW(double PemitterW, int idx = 0);
602 
604  // getPemitterW
612  double getPemitterW(int idx = 0);
613 
615  // setTransmitterGain
624  void setTransmitterGain(double AntGain, int idx = 0);
625 
627  // getTransmitterGain
635  double getTransmitterGain(int idx = 0);
636 
638  // setReceiverGain
647  void setReceiverGain(double AntGain, int idx = 0);
648 
650  // getReceiverGain
658  double getReceiverGain(int idx = 0);
659 
661  // setGainPattern
670  void setGainPattern(int pattern, int idx = 0);
671 
673  // getGainPattern
681  int getGainPattern(int idx);
682 
683 
685  // setFCemitterHz
694  void setFCemitterHz(double FCemitterHz, int idx = 0);
695 
697  // getFCemitterHz
705  double getFCemitterHz(int idx = 0);
706 
708  // setBWemitterHz
717  void setBWemitterHz(double BWemitterHz, int idx = 0);
718 
720  // getBWemitterHz
728  double getBWemitterHz(int idx = 0);
729 
731  // setChannelResolutionHz
740  void setChannelResolutionHz(double ChannelResolutionHz, int idx = 0);
741 
743  // getChannelResolutionHz
751  double getChannelResolutionHz(int idx = 0);
752 
754  // setPulseWidth
763  void setPulseWidth(double PulseWidth, int idx = 0);
764 
766  // getPulseWidth
774  double getPulseWidth(int idx = 0);
775 
777  // setPRF
786  void setPRF(double PRF, int idx = 0);
787 
789  // getPRF
797  double getPRF(int idx = 0);
798 
800  // setNFPRF
809  void setNFPRF(double PRF, int idx = 0);
810 
812  // getNFPRF
820  double getNFPRF(int idx = 0);
821 
823  // setTPolAngle
832  void setTPolAngle(double PolAngle, int idx = 0);
833 
835  // getTPolAngle
843  double getTPolAngle(int idx = 0);
844 
846  // setRPolAngle
855  void setRPolAngle(double PolAngle, int idx = 0);
856 
858  // getRPolAngle
866  double getRPolAngle(int idx = 0);
867 
869  // setSysTempK
878  void setSysTempK(double degK, int idx = 0);
879 
881  // getSysTempK
889  double getSysTempK(int idx);
890 
892  // setBeamWidth
901  void setBeamWidth(double mrad, int idx = 0);
902 
904  // getBeamWidth
912  double getBeamWidth(int idx = 0);
913 
915  //
916  void setFRDAngularVelocity(double Yradpersec, double Pradpersec, double Rradpersec, int idx = 0);
917 
919  //
920  void getFRDAngularVelocity(double &Yradpersec, double &Pradpersec, double &Rradpersec, int idx = 0);
921 
923  //
924  void setSpotfile(char *filename, int idx = 0);
925 
927  //
928  char *getSpotfile(int idx);
929 
930 
932  // setTAprops
945  void setTAprops(double ThreshDetect, double ThreshClassify, double ThreshRecognize, double ThreshIdentify, double PersistenceTime, int idx = 0);
946 
948  // getTAprops
961  void getTAprops(double &ThreshDetect, double &ThreshClassify, double &ThreshRecognize, double &ThreshIdentify, double &PersistenceTime, int idx = 0);
962 
964  // setUseTrackfile
973  void setUseTrackfile(bool useTrackfile, int idx = 0);
974 
976  // getUseTrackfile
984  bool getUseTrackfile(int idx = 0);
985 
987  // setWorldPosition
995  void setWorldPosition(double x, double y, double z, int i = 0);
996 
998  // getWorldPosition
1006  void getWorldPosition(double& x, double& y, double& z, int i = 0);
1007 
1009  // setGeodeticPosition
1020  void setGeodeticPosition(double latitude, double longitude, double altitude, int idx = 0);
1021 
1023  // getGeodeticPosition
1034  void getGeodeticPosition(double &latitude, double &longitude, double &altitude, int idx = 0);
1035 
1037  // setNEDOrientation
1048  void setNEDOrientation(double heading, double pitch, double roll, int idx = 0);
1049 
1051  // getNEDOrientation
1062  void getNEDOrientation(double &heading, double &pitch, double &roll, int idx = 0);
1063 
1065  // setNEDLinearVelocity
1076  void setNEDLinearVelocity(double n, double e, double d, int idx = 0);
1077 
1079  // getNEDLinearVelocity
1090  void getNEDLinearVelocity(double &n, double &e, double &d, int idx = 0);
1091 
1093  // SetActive
1102  void SetActive(bool isActive, int idx = 0);
1103 
1105  // GetActive
1113  bool GetActive(int idx = 0);
1114 
1116  //setRGBColor
1121  void setRGBColor(int color, int idx = 0) { m_sensorList[idx].m_sensorRGBColor = color; }
1123  //getRGBColor
1128  int getRGBColor(int idx = 0) { return m_sensorList[idx].m_sensorRGBColor; }
1130  //setSarReprojection
1136  void setSarReprojection(bool flag, int idx = 0);
1138  //getSarReprojection
1144  bool getSarReprojection(int idx = 0);
1145 
1146 
1147  void setSarBoresightROI(double x, double y, double width, double height, int idx = 0);
1148  void getSarBoresightROI(double &x, double &y, double &width, double &height, int idx = 0);
1149  void setSarIntegrationPathlength(double length, int idx = 0);
1150  void getSarIntegrationPathlength(double &length, int idx = 0);
1151  void setSarShadowOrientationDown(bool flag, int idx = 0);
1152  bool getSarShadowOrientationDown(int idx = 0);
1153  void setIsarIntegrationTime(double time, int idx = 0);
1154  void getIsarIntegrationTime(double &time, int idx = 0);
1155 
1156  void setIntensityModulationGain(double imodGain, int idx = 0);
1157  double getIntensityModulationGain(int idx = 0);
1158 
1160  //setMtiRadarReturn
1166  void setMtiRadarReturn(bool flag, int idx = 0);
1168  //getMtiRadarReturn
1174  bool getMtiRadarReturn(int idx = 0);
1175 
1177  // getMinWedgeExtent
1184  double getMinWedgeExtent(int idx = 0) { return m_sensorList[idx].minWedgeExtent; }
1185 
1187  // setMinWedgeExtent
1195  void setMinWedgeExtent( double angle, int idx = 0 )
1196  {
1197  if( angle >= -360.0 && angle < m_sensorList[idx].maxWedgeExtent && angle < 360.0 )
1198  m_sensorList[idx].minWedgeExtent = angle;
1199  }
1200 
1202  // getMaxWedgeExtent
1209  double getMaxWedgeExtent(int idx = 0) { return m_sensorList[idx].maxWedgeExtent; }
1210 
1212  // setMaxWedgeExtent
1220  void setMaxWedgeExtent( double angle, int idx = 0 )
1221  {
1222  if( angle > -360.0 && angle > m_sensorList[idx].minWedgeExtent && angle <= 360.0 )
1223  m_sensorList[idx].maxWedgeExtent = angle;
1224  }
1225 
1226 
1227 
1229  // getDisplayRange
1237  double getDisplayRange(int idx = 0){ return m_sensorList[idx].displayRange; }
1238 
1240  // setDisplayRange
1248  void setDisplayRange( double range, int idx = 0 ){ if( range > 0.0 ) m_sensorList[idx].displayRange = range; }
1249 
1250  bool getBacksweepState( int idx = 0 ){ return m_sensorList[idx].enableBacksweep; }
1251 
1252  void enableBacksweep( bool backsweep, int idx = 0 ){ m_sensorList[idx].enableBacksweep = backsweep; }
1253 
1254  bool getOtwViewState(int idx = 0){ return m_sensorList[idx].showOtwView ;}
1255 
1256  void showOtwView( bool show, int idx = 0 ){ m_sensorList[idx].showOtwView = show; }
1257 
1258 
1259 
1261  //setSensorOptics
1267  void setSensorOptics(ciOptics optics, int idx = 0);
1269  //getSensorOptics
1275  ciOptics &getSensorOptics(int idx = 0);
1277  //setSensorElectronics
1283  void setSensorElectronics(ciElectronics electronics, int idx = 0);
1285  //getSensorElectronics
1291  ciElectronics &getSensorElectronics(int idx = 0);
1293  //setSensorDetector
1299  void setSensorDetector(ciDetector detector, int idx = 0);
1301  //getSensorDetector
1307  ciDetector &getSensorDetector(int idx = 0);
1309  //setSensorSenSim
1315  void setSensorSenSim(ciSenSim senSim, int idx = 0);
1317  //getSensorSenSim
1323  ciSenSim &getSensorSenSim(int idx = 0);
1324 
1325 
1327  // operator =
1335  ciSensor operator = (ciSensor &obj);
1336 
1338  // operator []
1345  ciSensor & operator [] (int idx);
1346 
1347  //public: // methods
1348 
1350  // ciSensor
1355  ciSensor();
1356 
1358  // ciSensor
1365  ciSensor(ciSensor &obj);
1366 
1368  // ~ciSensor
1373  virtual ~ciSensor();
1374 
1375 protected: // variables
1376 
1378  // structSensorData
1406 public:
1408  {
1409  int index;
1410  char name[128];
1411  int type;
1414  double dx;
1415  int nBands;
1416  double hFOVDeg;
1417  double vFOVDeg;
1423  double satRatio; // [unitless 1->infty] S/N Ratio at saturation for radar.
1425  char trackFilepath[512];
1426  double worldX;
1427  double worldY;
1428  double worldZ;
1429  double latitude;
1430  double longitude;
1431  double altitude;
1432  double heading;
1433  double pitch;
1434  double roll;
1435  double velN;
1436  double velE;
1437  double velD;
1438  bool isActive;
1440  double sampleScale;
1445  double PemitterW; // [W] Power of active sensor antenna
1446  double TGain; // [unitless] Directional transmitter antenna Gain
1447  double RGain; // [unitless] Directional receiver antenna Gain
1448  int GainPattern; // [0=Unity, 1=Lobe, 2=Rect] Gain Pattern of the antenna
1449  double FCemitterHz; // [Hz] Center frequency of emitter
1450  double BWemitterHz; // [Hz] Bandwidth of emitter
1451  double ChannelResolutionHz; // [Hz] Receiver Channel resolution
1452  double PulseWidth; // [s] Pulse width in seconds
1453  double PRF; // [Hz] Pulse repetition frequency (foveal)
1454  double NFPRF; // [Hz] Pulse repetition frequency (nonfoveal)
1455  double TpolAngle; // [deg] Transmittter Polarization Angle {H=0, V=90, U=45}
1456  double RpolAngle; // [deg] Receiver Polarization Angle {H=0, V=90, U=45}
1457  double SysTempK; // [degK] Radar System Temperature
1458  double BeamWidth; // [rad] Beam or spot width
1459  double velY; // [rad/s] FRD Yaw (horizontal) sensor rotation frequency
1460  double velP; // [rad/s] FRD Pitch (vertical) sensor rotation frequency
1461  double velR; // [rad/s] FRD Roll (helica) sensor rotation frequency
1462  char spotFilepath[512];
1463  double ThreshDetect; // [unitless 0-1] Detection probability
1464  double ThreshClassify; // [unitless 0-1] Classification probability
1465  double ThreshRecognize; // [unitless 0-1] Recognition probability
1466  double ThreshIdentify; // [unitless 0-1] Identification probability
1467  double PersistenceTime; // [s] TA status persistence time
1468  double Gain; // [unitless 0-1] Gain
1469  double Level; // [unitless 0-1] Level
1479 
1481 
1482  //ppi mode display params
1488 
1489 
1495  //ciDisplay display;
1496  } *m_sensorList;
1501 private: // variables
1502 
1503 };
1504 
1505 #endif // _ciSensor_h_


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