[Gcblue-commits] gcb_wx/include/sim tcOpticalSensor.h,NONE,1.1 tcESMSensor.h,1.5,1.6 tcGameObject.h,
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-11-06 15:14:46
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31472/include/sim Modified Files: tcESMSensor.h tcGameObject.h tcRadar.h tcSensorMap.h tcSensorState.h tcSimState.h Added Files: tcOpticalSensor.h Log Message: Added optical sensor model, fixed generic model display for sensor tracks Index: tcGameObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGameObject.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** tcGameObject.h 6 Sep 2004 01:08:03 -0000 1.25 --- tcGameObject.h 6 Nov 2004 15:13:40 -0000 1.26 *************** *** 96,100 **** tc3DModel *model; ///< 3D model UINT mnModelType; // class MTYPE_ identifier ! int mnID; tcDBString mzClass; // name of database class tnPoolIndex mnDBKey; // key of database entry --- 96,100 ---- tc3DModel *model; ///< 3D model UINT mnModelType; // class MTYPE_ identifier ! long mnID; tcDBString mzClass; // name of database class tnPoolIndex mnDBKey; // key of database entry *************** *** 147,151 **** virtual void GetLauncherState(tcLauncherState*& pLauncherState) {pLauncherState = NULL;} virtual tcLauncher* GetLauncher(unsigned idx) {return 0;} ! float GetSpan(); float GetTerrainElevation() {return mcTerrain.mfHeight_m;} virtual void Launch(tnPoolIndex& rnKey, unsigned& rnLauncher) {} --- 147,151 ---- virtual void GetLauncherState(tcLauncherState*& pLauncherState) {pLauncherState = NULL;} virtual tcLauncher* GetLauncher(unsigned idx) {return 0;} ! float GetSpan() const; float GetTerrainElevation() {return mcTerrain.mfHeight_m;} virtual void Launch(tnPoolIndex& rnKey, unsigned& rnLauncher) {} Index: tcSensorMap.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSensorMap.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcSensorMap.h 1 Nov 2004 03:17:17 -0000 1.9 --- tcSensorMap.h 6 Nov 2004 15:13:40 -0000 1.10 *************** *** 34,37 **** --- 34,43 ---- class tcUpdateStream; + namespace Database + { + class tcDatabase; + } + using Database::tcDatabase; + /** * Sensor track management code. This is older code *************** *** 54,62 **** double mfTimestamp; double mfStartTime; ///< birth time of track from report ! tnPoolIndex mnTrackID; ! tnPoolIndex mnSensorPlatformID; UINT8 mnFlags; std::vector<UINT32> maEmitter; unsigned mbClassified : 1; void Clear() { --- 60,71 ---- double mfTimestamp; double mfStartTime; ///< birth time of track from report ! long mnTrackID; ! long trackDatabaseID; ///< database id of track (usually from visual ident), -1 is unknown ! long mnSensorPlatformID; ///< id of contributing sensor UINT8 mnFlags; std::vector<UINT32> maEmitter; unsigned mbClassified : 1; + unsigned isIdentified : 1; + void Clear() { *************** *** 69,73 **** --- 78,84 ---- mnFlags=0; mbClassified = 0; + isIdentified = 0; } + bool IsIdentified() const {return isIdentified != 0;} bool IsNew() {return (mfTimestamp == 0);} }; *************** *** 95,99 **** tsEmitterInfo maEmitterInfo[MAX_EMITTERS]; int mnEmitters; ! tnPoolIndex mnDatabaseID; ///< database ID of track float matchupRating; ///< matchup rating for platforms that have targeted this track float expectedDamage; ///< rating of expected fractional damage of weapons launched at target, 0 - none, 1.0 - totally destroyed --- 106,110 ---- tsEmitterInfo maEmitterInfo[MAX_EMITTERS]; int mnEmitters; ! long mnDatabaseID; ///< database ID of track, -1 for unknown float matchupRating; ///< matchup rating for platforms that have targeted this track float expectedDamage; ///< rating of expected fractional damage of weapons launched at target, 0 - none, 1.0 - totally destroyed *************** *** 101,104 **** --- 112,117 ---- std::vector<long> intercepts; ///< vector of platform ids that are intercepting this track std::vector<long> engaged; ///< vector of weapon ids that are tracking / engaging + std::vector<long> ambiguityList; ///< vector of platform ids consistent with detected emitters + static unsigned int ambiguityListUpdates; /// called to indicate weapon launched at target *************** *** 111,114 **** --- 124,128 ---- ///< static method to set pointer to tcSimState object + static void AttachDatabase(tcDatabase* db) {database = db;} static void AttachSimState(tcSimState* ss) {simState = ss;} *************** *** 133,138 **** bool UpdateActiveReport(tcSensorReport*& rpReport, tnPoolIndex anSensorID); void UpdateClassification(UINT16 mnClassification, teAffiliation meAffiliation, ! tnPoolIndex mnDatabaseID); bool UpdateEmitter(tsEmitterInfo*& rpEmitterInfo, tnPoolIndex anEmitterID); --- 147,153 ---- bool UpdateActiveReport(tcSensorReport*& rpReport, tnPoolIndex anSensorID); + void UpdateAmbiguityList(); void UpdateClassification(UINT16 mnClassification, teAffiliation meAffiliation, ! tnPoolIndex databaseID); bool UpdateEmitter(tsEmitterInfo*& rpEmitterInfo, tnPoolIndex anEmitterID); *************** *** 158,162 **** private: ! static tcSimState *simState; }; --- 173,178 ---- private: ! static tcSimState* simState; ! static tcDatabase* database; }; Index: tcRadar.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcRadar.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcRadar.h 17 Aug 2004 02:22:56 -0000 1.8 --- tcRadar.h 6 Nov 2004 15:13:40 -0000 1.9 *************** *** 29,32 **** --- 29,37 ---- #include <vector> + namespace Database + { + class tcRadarDBObject; + } + using Database::tcRadarDBObject; /** * *************** *** 65,69 **** virtual bool CanDetectTarget(const tcGameObject* target, float& range_km); ! virtual bool InitFromDB(tcDatabase *apDatabase, tnPoolIndex anKey, float mountAzimuth_rad); // fire control methods --- 70,74 ---- virtual bool CanDetectTarget(const tcGameObject* target, float& range_km); ! virtual bool InitFromDatabase(long key); ///< initializes sensor using database data at key // fire control methods *************** *** 87,91 **** tcRadar* Clone(); tcRadar(); ! tcRadar(tcGameObject *obj); virtual ~tcRadar(); --- 92,96 ---- tcRadar* Clone(); tcRadar(); ! tcRadar(tcRadarDBObject* dbObj); virtual ~tcRadar(); Index: tcSensorState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSensorState.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcSensorState.h 17 Aug 2004 02:22:56 -0000 1.11 --- tcSensorState.h 6 Nov 2004 15:13:40 -0000 1.12 *************** *** 1,17 **** ! /** @file tcSensorState.h ! ** ! ** Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ! ** ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ! ** ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ! ** ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software --- 1,18 ---- ! /** ! ** @file tcSensorState.h ! */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ! ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ! ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ! ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software *************** *** 27,35 **** #include "tcPool.h" - #include "tcDatabase.h" - #include "tcSensorDBObject.h" #include "simmath.h" ! using namespace Database; #define SSMODE_SURVEILLANCE 1 --- 28,41 ---- #include "tcPool.h" #include "simmath.h" ! namespace Database ! { ! class tcDatabase; ! class tcSensorDBObject; ! } ! ! using Database::tcDatabase; ! using Database::tcSensorDBObject; #define SSMODE_SURVEILLANCE 1 *************** *** 53,57 **** tcGameObject *parent; tnPoolIndex mnDBKey; ! tcSensorDBObject *mpDBObj; double mfLastScan; float mfCurrentScanPeriod_s; --- 59,63 ---- tcGameObject *parent; tnPoolIndex mnDBKey; ! tcSensorDBObject* mpDBObj; double mfLastScan; float mfCurrentScanPeriod_s; *************** *** 63,70 **** float mfSensorHeight_m; ///< height of sensor relative to platform altitude ! static void AttachSimState(tcSimState *ss) {simState = ss;} bool GetActive() const {return mbActive != 0;} void GetTestArea(tcRect& region); ! virtual bool InitFromDB(tcDatabase *apDatabase, tnPoolIndex anKey, float mountAzimuth_rad); void Serialize(tcFile& file, bool mbLoad); --- 69,78 ---- float mfSensorHeight_m; ///< height of sensor relative to platform altitude ! static void AttachDatabase(tcDatabase* db) {database = db;} ! static void AttachSimState(tcSimState* ss) {simState = ss;} bool GetActive() const {return mbActive != 0;} void GetTestArea(tcRect& region); ! virtual bool InitFromDatabase(long key); ///< initializes sensor using database data at key ! bool IsHidden() const; void Serialize(tcFile& file, bool mbLoad); *************** *** 73,77 **** virtual void SetActive(bool active); ! void SetMountAz(float az) {mountAz_rad = az;} void SetParent(tcGameObject *obj) {parent = obj;} virtual void Update(double t); --- 81,85 ---- virtual void SetActive(bool active); ! void SetMountAz(float az); void SetParent(tcGameObject *obj) {parent = obj;} virtual void Update(double t); *************** *** 81,89 **** tcSensorState* Clone(); tcSensorState(); ! tcSensorState(tcGameObject *obj); virtual ~tcSensorState(); protected: ! static tcSimState *simState; }; #endif \ No newline at end of file --- 89,100 ---- tcSensorState* Clone(); tcSensorState(); ! tcSensorState(tcSensorDBObject* dbObj); virtual ~tcSensorState(); protected: ! static tcSimState* simState; ! static tcDatabase* database; ! ! bool isHidden; ///< hidden sensors are not displayed in object control view }; #endif \ No newline at end of file --- NEW FILE: tcOpticalSensor.h --- /** ** @file tcOpticalSensor.h */ /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA **/ #if _MSC_VER > 1000 #pragma once #endif #ifndef _TCOPTICALSENSOR_H_ #define _TCOPTICALSENSOR_H_ #include "tcSensorState.h" #include "tcOpticalDBObject.h" #include <vector> using Database::tcOpticalDBObject; class tcGameObject; class tcStream; class tcUpdateStream; /** * Class to model optical and IR sensors. Handles visual detections. */ class tcOpticalSensor : public tcSensorState { public: tcOpticalDBObject* mpDBObj; virtual bool CanDetectTarget(const tcGameObject* target, float& range_km); virtual bool InitFromDatabase(long key); ///< initializes sensor using database data at key void Serialize(tcFile& file, bool mbLoad); virtual void Update(double t); tcOpticalSensor& operator=(tcOpticalSensor& ss); virtual tcUpdateStream& operator<<(tcUpdateStream& stream); virtual tcUpdateStream& operator>>(tcUpdateStream& stream); tcOpticalSensor* Clone(); tcOpticalSensor(); tcOpticalSensor(tcOpticalDBObject* dbObj); virtual ~tcOpticalSensor(); protected: // bool isSemiactive; //tcRadar* GetSemiactiveIlluminator(); // add semi-active later for laser designated guidance void UpdateSeeker(double t); void UpdateSensorMap(double t, const tcGameObject* target, float range_km); void UpdateSurveillance(double t); void UpdateTrack(const tcGameObject* target, double t); /* parameters saved by CanDetectTarget so that this info is available in UpdateSensorMap ** (didn't want to modify virtual method CanDetectTarget to pass this info directly) */ long detectionCandidate; float detectionScore; }; #endif Index: tcSimState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSimState.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** tcSimState.h 6 Sep 2004 01:08:03 -0000 1.28 --- tcSimState.h 6 Nov 2004 15:13:40 -0000 1.29 *************** *** 155,158 **** --- 155,159 ---- bool IsLauncherReady(tcGameObject *apGameObj, unsigned anLauncher); bool IsLauncherReady(tnPoolIndex anKey, unsigned anLauncher); + bool IsScenarioLoaded() const; void LoadTimeFromStream(tcStream& stream); void PrintToFile(tcString); Index: tcESMSensor.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcESMSensor.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcESMSensor.h 17 Aug 2004 02:22:56 -0000 1.5 --- tcESMSensor.h 6 Nov 2004 15:13:40 -0000 1.6 *************** *** 41,47 **** { public: ! tcESMDBObject *mpDBObj; ! bool InitFromDB(tcDatabase *apDatabase, tnPoolIndex anKey, float mountAzimuth_rad); bool IsDetected(const tcRadar* emitter, float& rfAz_rad); void Serialize(tcFile& file, bool mbLoad); --- 41,47 ---- { public: ! tcESMDBObject* mpDBObj; ! virtual bool InitFromDatabase(long key); ///< initializes sensor using database data at key bool IsDetected(const tcRadar* emitter, float& rfAz_rad); void Serialize(tcFile& file, bool mbLoad); *************** *** 53,58 **** tcESMSensor* Clone(void); tcESMSensor(); ! tcESMSensor(tcGameObject *obj); virtual ~tcESMSensor(); }; #endif \ No newline at end of file --- 53,63 ---- tcESMSensor* Clone(void); tcESMSensor(); ! tcESMSensor(tcESMDBObject* dbObj); virtual ~tcESMSensor(); + protected: + + void ProcessESMDetection(tcGameObject* target, double t); + void UpdateSensorMap(const tcGameObject* target, long* emitters, unsigned int nEmitters, + float az_rad, double t); }; #endif \ No newline at end of file |