[Gcblue-commits] gcb_wx/include/database tcTorpedoDBObject.h,NONE,1.1
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-12-05 02:58:34
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22179/include/database Added Files: tcTorpedoDBObject.h Log Message: Sonar work, passive sonar, torpedoes --- NEW FILE: tcTorpedoDBObject.h --- /** ** @file tcTorpedoDBObject.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 */ #ifndef _TORPEDODBOBJECT_H_ #define _TORPEDODBOBJECT_H_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "tcWeaponDBObject.h" #include <vector> class TiXmlElement; namespace Database { class tcSqlReader; /** * */ class tcTorpedoDBObject : public tcWeaponDBObject { public: enum {MAX_TORPEDO_SEGMENTS = 4}; /** * Determines guidance type that is used flight segment. */ enum TorpedoGuidanceMode { GM_COMMAND = 0, ///< command guidance GM_NAV = 1, ///< inertial GM_SENSOR = 2 ///< use primary sensor }; /** * Info that controls torpedo behavior for segment. */ struct tsTorpedoSegment { float range_km; ///< min range for this segment float depth_m; ///< depth for segment float thrust; /// relative thrust for segment, 0-1.0 TorpedoGuidanceMode meGuidanceMode; ///< guidance mode }; // model parameters float mass_kg; ///< mass before launch, fuel assumed 0 kg float dragArea_sm; ///< area for parasitic drag float maxTurnRate_degps; ///< max turn rate float maxDepth_m; ///< maximum depth float maxThrust_N; ///< max thrust [N] float fuel_kg; float fuelRate_kgps; ///< fuel rate at max thrust float maxSpeed_kts; float acceleration_ktsps; ///< for simple model only float mfRange_km; ///< [km] nominal range // sensor info std::string sonarClass; /// flight profile, array of flight segment info std::vector<tsTorpedoSegment> defaultProfile; ///< default maneuver profile /// calculated parameters float maxTurnRate_radps; ///< CALCULATED float fuelRate_kgpktps; ///< [kg / kt / s] CALCULATED virtual const char* GetClassName() {return "Torpedo";} ///< returns class name of database object bool IsLeaf() const; ///< returns true if db obj is a leaf obj virtual void PrintToFile(tcFile& file); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); virtual void SerializeXml(TiXmlElement* node, bool load); ///< XML serialization static void AddSqlColumns(std::string& columnString); void ReadSql(tcSqlReader& entry); void WriteSql(std::string& valueString); tcTorpedoDBObject(); tcTorpedoDBObject(tcTorpedoDBObject& obj); ///< copy constructor virtual ~tcTorpedoDBObject(); private: void CalculateParams(); }; } #endif |