[Gcblue-commits] gcb_wx/include/sim Game.h,1.23,1.24 tcCreditView.h,1.3,1.4 tcLauncherState.h,1.2,1.
Status: Alpha
Brought to you by:
ddcforge
From: <ddc...@pr...> - 2004-01-31 04:50:37
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4193/include/sim Modified Files: Game.h tcCreditView.h tcLauncherState.h tcMapView.h tcMissileObject.h tcPlatformObject.h tcRadarSensorState.h tcSensorState.h tcSimState.h tcSurfaceObject.h Log Message: Index: Game.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/Game.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Game.h 20 Jan 2004 03:02:52 -0000 1.23 --- Game.h 29 Jan 2004 00:05:05 -0000 1.24 *************** *** 227,230 **** --- 227,231 ---- void ProcessTextCommand(tsCommandInfo cmd_info); void SaveScenario(char *azFilePath); + void SecondaryHook(wxCommandEvent& event); void Set3D(wxCommandEvent& event); void SetBriefingMode(wxCommandEvent& event); Index: tcCreditView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcCreditView.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcCreditView.h 30 Nov 2003 17:23:52 -0000 1.3 --- tcCreditView.h 29 Jan 2004 00:05:17 -0000 1.4 *************** *** 39,46 **** tcString mzCaption; float mfTrailSpace; ! bool mbBold; }; public: ! void AddCredit(tcString& s, float afTrailSpace, bool abBold); void AttachSound(tcSound *apSound) {mpSound=apSound;} bool Init(void); --- 39,46 ---- tcString mzCaption; float mfTrailSpace; ! int mnEffect; ///< 0 - standard text, 1 - bold, 2 - small }; public: ! void AddCredit(tcString& s, float afTrailSpace, int effect); void AttachSound(tcSound *apSound) {mpSound=apSound;} bool Init(void); *************** *** 53,60 **** virtual ~tcCreditView(void); private: ! enum {MAX_CREDITS = 64}; Gdiplus::SolidBrush *mpBrush; Gdiplus::Font *mpFont; Gdiplus::Font *mpFontLarge; Gdiplus::Pen *mpPen; tcTime mcTime; --- 53,61 ---- virtual ~tcCreditView(void); private: ! enum {MAX_CREDITS = 96}; Gdiplus::SolidBrush *mpBrush; Gdiplus::Font *mpFont; Gdiplus::Font *mpFontLarge; + Gdiplus::Font *mpFontSmall; Gdiplus::Pen *mpPen; tcTime mcTime; Index: tcLauncherState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcLauncherState.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcLauncherState.h 4 Jan 2004 22:24:52 -0000 1.2 --- tcLauncherState.h 29 Jan 2004 00:05:17 -0000 1.3 *************** *** 23,35 **** #define _TCLAUNCHERSTATE_H_ - #include "tcDatabase.h" - #include "tcGenericDBObject.h" - #include "tcLauncherDBObject.h" - #include "tcMissileDBObject.h" #include "simmath.h" #include "AError.h" using namespace Database; /** * State for individual launcher. --- 23,42 ---- #define _TCLAUNCHERSTATE_H_ #include "simmath.h" #include "AError.h" + #include <vector> + + namespace Database + { + class tcDatabase; + class tcLauncherDBObject; + class tcDatabaseObject; + enum teWeaponLaunchMode; + } using namespace Database; + class tcRadar; + /** * State for individual launcher. *************** *** 50,53 **** --- 57,61 ---- unsigned int mnPending; float pointingAngle; ///< boresight azimuth angle in radians relative nose/bow + tcRadar *fireControlSensor; ///< sensor for fire control guidance }; *************** *** 59,79 **** public: int mnCount; ! tsLData ma[tcGenericDBObject::MAXLAUNCHERS]; static tcDatabase *mpDatabase; void AddFullLauncher(tcDatabase *pDatabase, tnPoolIndex anKey, float azimuth_rad); ! int GetLauncherQuantity(unsigned anLauncher) { ! if ((int)anLauncher > mnCount) {return -1;} ! return ma[anLauncher].mnCurrent - ma[anLauncher].mnPending; ! } std::string GetLaunchMode(unsigned anLauncher); ! bool IsDatumLaunch(unsigned anLauncher) { ! if ((int)anLauncher > mnCount) {return false;} ! return ma[anLauncher].meLaunchMode == DATUM_ONLY; ! } ! bool IsSeekerLaunch(unsigned anLauncher) { ! if ((int)anLauncher > mnCount) {return false;} ! return ma[anLauncher].meLaunchMode == SEEKER_TRACK; ! } void Serialize(tcFile& file, bool abLoad); tcLauncherState(); --- 67,78 ---- public: int mnCount; ! std::vector<tsLData> launchers; ///< vector of launcher state info static tcDatabase *mpDatabase; void AddFullLauncher(tcDatabase *pDatabase, tnPoolIndex anKey, float azimuth_rad); ! int GetLauncherQuantity(unsigned anLauncher); std::string GetLaunchMode(unsigned anLauncher); ! bool IsDatumLaunch(unsigned anLauncher); ! bool IsSeekerLaunch(unsigned anLauncher); void Serialize(tcFile& file, bool abLoad); tcLauncherState(); Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMapView.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcMapView.h 5 Jan 2004 02:48:02 -0000 1.12 --- tcMapView.h 29 Jan 2004 00:05:17 -0000 1.13 *************** *** 260,263 **** --- 260,264 ---- void UpdateNavPoints(std::vector<tcPoint> *mpPoints); int Hook(wxPoint pscreen); + long HookSecondary(wxPoint pscreen); int GetClosest(wxPoint pscreen); Index: tcMissileObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMissileObject.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcMissileObject.h 8 Dec 2003 03:06:36 -0000 1.2 --- tcMissileObject.h 29 Jan 2004 00:05:17 -0000 1.3 *************** *** 47,51 **** float mfRangeToObjective_km; // for segment determination UINT mnCurrentSegment; ! tcRadarSensorState mcSensorState; tsMissileKState msKState; tcMissileDBObject *mpDBObject; // pointer to valid database obj --- 47,51 ---- float mfRangeToObjective_km; // for segment determination UINT mnCurrentSegment; ! tcRadar mcSensorState; tsMissileKState msKState; tcMissileDBObject *mpDBObject; // pointer to valid database obj *************** *** 57,61 **** virtual void SetHeading(float afNewHeading) {mfGoalHeading_rad=afNewHeading;} virtual void SetSpeed(float afNewSpeed) {mfGoalSpeed_kts=afNewSpeed;} ! virtual tcRadarSensorState* GetSensorState() {return &mcSensorState;} virtual void DesignateTarget(long anID); virtual int GetGuidanceParameters(tsGuidanceParameters& gp); --- 57,61 ---- virtual void SetHeading(float afNewHeading) {mfGoalHeading_rad=afNewHeading;} virtual void SetSpeed(float afNewSpeed) {mfGoalSpeed_kts=afNewSpeed;} ! virtual tcRadar* GetSensorState() {return &mcSensorState;} virtual void DesignateTarget(long anID); virtual int GetGuidanceParameters(tsGuidanceParameters& gp); Index: tcPlatformObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcPlatformObject.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcPlatformObject.h 8 Dec 2003 03:06:36 -0000 1.6 --- tcPlatformObject.h 29 Jan 2004 00:05:17 -0000 1.7 *************** *** 1,20 **** /* ! * Copyright (C) 2003 Dewitt "Cole" 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 ! */ #pragma once --- 1,20 ---- /* ! * Copyright (C) 2003 Dewitt "Cole" 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 ! */ #pragma once *************** *** 29,91 **** using namespace AI; /** ! * A generic moving object with sensors, launchers, and guidance. ! * ! * @see tcGameObject ! */ class tcPlatformObject : public tcGameObject { public: ! float fuel_kg; ///< current fuel ! tcLauncherState mcLauncherState; ! //tcSensorState* mapSensorState[MAXSENSORS]; ! std::vector<tcSensorState*> mapSensorState; ! //int mnSensors; ! tcGuidanceState mcGS; ! tcAIData mcAI; ! tcLaunchRequest mcLaunchRequest; ! tsGeoPoint msTargetDatum; ! tsFormationParameters msFormationParameters; ! tcGenericDBObject *mpDBObject; ! virtual void Clear(void); ! virtual void DesignateDatum(tcPoint p); ! virtual void DesignateLauncherDatum(tcPoint p, unsigned int anLauncher); ! virtual void DesignateLauncherTarget(tnPoolIndex anID, unsigned anLauncher); ! virtual void DesignateTarget(long anID) {mcAI.SetTarget(anID);} ! virtual void GetDatum(tsGeoPoint& p) {p=msTargetDatum;} ! virtual int GetLauncherQuantity(unsigned anLauncher); ! virtual void GetLauncherState(tcLauncherState*& pLauncherState) {pLauncherState=&mcLauncherState;} ! // virtual void GetSensorState(tcSensorState** aapSensorState, int& rnCount); ! // virtual void GetSensorStateRef(tcSensorState**& rapSensorState, int& rnCount); ! virtual bool HasActivatedSensor(void); ! virtual bool IsRadiating(void); ! virtual std::vector<tcSensorState*>* GetSensorStateArray(void) {return &mapSensorState;} ! virtual void Launch(tnPoolIndex& rnKey, unsigned& rnLauncher); ! virtual void RandInitNear(float afLon_deg, float afLat_deg); ! virtual void SetAltitude(float new_altitude_m) {mcGS.SetAltitude(new_altitude_m);} ! virtual void SetHeading(float afNewHeading) {mcGS.SetHeading(afNewHeading);} ! virtual void SetSpeed(float afNewSpeed); ! virtual void SetLaunch(int anLauncher, int anQuantity); ! virtual void SetFormation(tsFormationParameters asFP) {msFormationParameters=asFP;} ! virtual void UpdateKin(double afStatusTime); ! void PrintToFile(tcFile&); ! void SaveToFile(tcFile& file); ! void LoadFromFile(tcFile& file); ! virtual void Serialize(tcFile& file, bool mbLoad); ! tcPlatformObject(void); ! tcPlatformObject(tcPlatformObject&); ! tcPlatformObject(tcGenericDBObject *obj); ! virtual ~tcPlatformObject(void); protected: ! virtual void ApplyRestrictions(void); ! virtual void Move(float dt_s); ! virtual void UpdateClimb(float dt_s) {}; ! virtual void UpdateFormationGuidance(void); ! virtual void UpdateHeading(float dt_s); ! virtual void UpdateLauncherState(float dt_s); ! virtual void UpdateSpeed(float dt_s); }; \ No newline at end of file --- 29,98 ---- using namespace AI; + namespace Database + { + class tcGenericDBObject; + } + /** ! * A generic moving object with sensors, launchers, and guidance. ! * ! * @see tcGameObject ! */ class tcPlatformObject : public tcGameObject { public: ! float fuel_kg; ///< current fuel ! tcLauncherState mcLauncherState; ! //tcSensorState* mapSensorState[MAXSENSORS]; ! std::vector<tcSensorState*> mapSensorState; ! //int mnSensors; ! tcGuidanceState mcGS; ! tcAIData mcAI; ! tcLaunchRequest mcLaunchRequest; ! tsGeoPoint msTargetDatum; ! tsFormationParameters msFormationParameters; ! tcGenericDBObject *mpDBObject; ! virtual void Clear(void); ! virtual void DesignateDatum(tcPoint p); ! virtual void DesignateLauncherDatum(tcPoint p, unsigned int anLauncher); ! virtual void DesignateLauncherTarget(tnPoolIndex anID, unsigned anLauncher); ! virtual void DesignateTarget(long anID) {mcAI.SetTarget(anID);} ! virtual void GetDatum(tsGeoPoint& p) {p=msTargetDatum;} ! virtual int GetLauncherQuantity(unsigned anLauncher); ! virtual void GetLauncherState(tcLauncherState*& pLauncherState) {pLauncherState=&mcLauncherState;} ! // virtual void GetSensorState(tcSensorState** aapSensorState, int& rnCount); ! // virtual void GetSensorStateRef(tcSensorState**& rapSensorState, int& rnCount); ! virtual bool HasActivatedSensor(void); ! virtual bool IsRadiating(void); ! virtual std::vector<tcSensorState*>* GetSensorStateArray(void) {return &mapSensorState;} ! virtual void Launch(tnPoolIndex& rnKey, unsigned& rnLauncher); ! virtual void RandInitNear(float afLon_deg, float afLat_deg); ! virtual void SetAltitude(float new_altitude_m) {mcGS.SetAltitude(new_altitude_m);} ! virtual void SetHeading(float afNewHeading) {mcGS.SetHeading(afNewHeading);} ! virtual void SetSpeed(float afNewSpeed); ! virtual void SetLaunch(int anLauncher, int anQuantity); ! virtual void SetFormation(tsFormationParameters asFP) {msFormationParameters=asFP;} ! virtual void UpdateKin(double afStatusTime); ! void PrintToFile(tcFile&); ! void SaveToFile(tcFile& file); ! void LoadFromFile(tcFile& file); ! virtual void Serialize(tcFile& file, bool mbLoad); ! tcPlatformObject(void); ! tcPlatformObject(tcPlatformObject&); ! tcPlatformObject(tcGenericDBObject *obj); ! virtual ~tcPlatformObject(void); protected: ! float lastHeadingDelta; // a workaround to smooth heading rate changes ! ! virtual void ApplyRestrictions(void); ! virtual void Move(float dt_s); ! virtual void UpdateClimb(float dt_s) {}; ! virtual void UpdateFormationGuidance(void); ! virtual void UpdateHeading(float dt_s); ! virtual void UpdateLauncherState(float dt_s); ! virtual void UpdateSpeed(float dt_s); }; \ No newline at end of file Index: tcRadarSensorState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcRadarSensorState.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcRadarSensorState.h 4 Jan 2004 22:24:52 -0000 1.2 --- tcRadarSensorState.h 29 Jan 2004 00:05:17 -0000 1.3 *************** *** 20,33 **** #pragma once ! #ifndef _TCRADARSENSORSTATE_H_ ! #define _TCRADARSENSORSTATE_H_ #include "tcSensorState.h" #include "tcRadarDBObject.h" /** * */ ! typedef struct _radartargetinfo { float mfLat_rad; --- 20,34 ---- #pragma once ! #ifndef _tcRadar_H_ ! #define _tcRadar_H_ #include "tcSensorState.h" #include "tcRadarDBObject.h" + #include <vector> /** * */ ! struct tsRadarTargetInfo { float mfLat_rad; *************** *** 37,58 **** float mfSpeed_mps; float mfRCS_dbsm; ! } tsRadarTargetInfo; ! /** ! * ! */ ! class tcRadarSensorState : public tcSensorState { public: tcRadarDBObject *mpDBObj; - bool InitFromDB(tcDatabase *apDatabase, tnPoolIndex anKey, float mountAzimuth_rad); - bool IsDetected(const tsRadarTargetInfo& asRTI, float& rfRange_km); void Serialize(tcFile& file, bool mbLoad); ! tcRadarSensorState& operator=(tcRadarSensorState& ss); ! tcRadarSensorState* Clone(void); ! tcRadarSensorState(); ! virtual ~tcRadarSensorState(); }; #endif \ No newline at end of file --- 38,70 ---- float mfSpeed_mps; float mfRCS_dbsm; ! } ; ! class tcGameObject; ! ! class tcRadar : public tcSensorState { public: tcRadarDBObject *mpDBObj; + unsigned int fireControlTracks; + + virtual bool CanDetectTarget(const tcGameObject* target, float& range_km); + virtual bool InitFromDB(tcDatabase *apDatabase, tnPoolIndex anKey, float mountAzimuth_rad); + + // fire control methods + virtual bool IsTrackAvailable(const tcGameObject* target); + virtual bool RequestTrack(const tcGameObject* target); + virtual bool ReleaseTrack(); void Serialize(tcFile& file, bool mbLoad); ! tcRadar& operator=(tcRadar& ss); ! tcRadar* Clone(); ! tcRadar(); ! virtual ~tcRadar(); }; + + + + + #endif \ No newline at end of file Index: tcSensorState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSensorState.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcSensorState.h 4 Jan 2004 22:24:52 -0000 1.2 --- tcSensorState.h 29 Jan 2004 00:05:18 -0000 1.3 *************** *** 56,60 **** void GetTestArea(tcRect& region); ! bool InitFromDB(tcDatabase *apDatabase, tnPoolIndex anKey, float mountAzimuth_rad); void Serialize(tcFile& file, bool mbLoad); void UpdateCoverage(tsGeoPoint p,float az_rad); --- 56,60 ---- void GetTestArea(tcRect& region); ! virtual bool InitFromDB(tcDatabase *apDatabase, tnPoolIndex anKey, float mountAzimuth_rad); void Serialize(tcFile& file, bool mbLoad); void UpdateCoverage(tsGeoPoint p,float az_rad); Index: tcSimState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSimState.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcSimState.h 29 Dec 2003 01:10:25 -0000 1.11 --- tcSimState.h 29 Jan 2004 00:05:21 -0000 1.12 *************** *** 81,85 **** tcSimPythonInterface *mpPythonInterface; tcSensorMap mcSensorMap; ! tcRadarSensorState mcDefaultRadar; // used to test for detections before creating object double mfLastSensorUpdate; double mfLastSensorAgeOut; --- 81,85 ---- tcSimPythonInterface *mpPythonInterface; tcSensorMap mcSensorMap; ! tcRadar mcDefaultRadar; // used to test for detections before creating object double mfLastSensorUpdate; double mfLastSensorAgeOut; *************** *** 102,106 **** void AttachUserInfo(tcUserInfo *apUserInfo) {mpUserInfo=apUserInfo;} void BuildCollisionGroups(); ! bool RadarCanDetect(tnPoolIndex anSensorKey, const tsRadarTargetInfo& asRTI, tsGeoPoint asSensorLocation, float afSensorAz); void ChangeHeading(long anKey, float afNewHeading); --- 102,106 ---- void AttachUserInfo(tcUserInfo *apUserInfo) {mpUserInfo=apUserInfo;} void BuildCollisionGroups(); ! bool RadarCanDetect(tnPoolIndex anSensorKey, const tcGameObject* target, tsGeoPoint asSensorLocation, float afSensorAz); void ChangeHeading(long anKey, float afNewHeading); *************** *** 174,186 **** float GetFractionalDamage(float afDamage, tcGameObject *apGameObj); ! bool IsDetectedESM(tcESMSensorState *apESM, tcRadarSensorState *apEmitterRadar, tcGameObject *apEmitterPlatform, float& rfAz_rad); void PerformAutoEngage(tcGameObject* apGameObj, double afTime); void ProcessRadarDetection(tcGameObject *apRadarPlat,tcGameObject *apTarget, ! tcRadarSensorState *apRadarSS); void ProcessESMDetection(tcGameObject *apESMPlat,tcGameObject *apTarget, tcESMSensorState *apESMSS); ! void UpdateFireControl(tcGameObject *apGameObj, tcRadarSensorState *apRadarSS); ! void UpdateSeeker(tcGameObject *applat, tcRadarSensorState *apRadarSS); void UpdateSurveillance(tcGameObject *applat, tcSensorState *apSensorState); }; --- 174,186 ---- float GetFractionalDamage(float afDamage, tcGameObject *apGameObj); ! bool IsDetectedESM(tcESMSensorState *apESM, tcRadar *apEmitterRadar, tcGameObject *apEmitterPlatform, float& rfAz_rad); void PerformAutoEngage(tcGameObject* apGameObj, double afTime); void ProcessRadarDetection(tcGameObject *apRadarPlat,tcGameObject *apTarget, ! tcRadar *apRadarSS); void ProcessESMDetection(tcGameObject *apESMPlat,tcGameObject *apTarget, tcESMSensorState *apESMSS); ! void UpdateFireControl(tcGameObject *apGameObj, tcRadar *apRadarSS); ! void UpdateSeeker(tcGameObject *applat, tcRadar *apRadarSS); void UpdateSurveillance(tcGameObject *applat, tcSensorState *apSensorState); }; Index: tcSurfaceObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSurfaceObject.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcSurfaceObject.h 8 Dec 2003 03:06:36 -0000 1.4 --- tcSurfaceObject.h 29 Jan 2004 00:05:21 -0000 1.5 *************** *** 24,27 **** --- 24,32 ---- #include "tcPlatformObject.h" + namespace Database + { + class tcGenericDBObject; + } + /** * Represents a platform that resides on the water's surface. |