[Gcblue-commits] gcb_wx/src/database tcDatabaseObject.cpp,1.8,1.9 tcGenericDBObject.cpp,1.6,1.7 tcLa
Status: Alpha
Brought to you by:
ddcforge
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5617/src/database Modified Files: tcDatabaseObject.cpp tcGenericDBObject.cpp tcLauncherDBObject.cpp tcMissileDBObject.cpp tcRadarDBObject.cpp tcSensorDBObject.cpp Log Message: Code to write database to xml Index: tcSensorDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcSensorDBObject.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcSensorDBObject.cpp 28 Mar 2004 23:12:28 -0000 1.4 --- tcSensorDBObject.cpp 30 Mar 2004 01:15:21 -0000 1.5 *************** *** 29,35 **** #include "math_constants.h" #include "randfn.h" - //#include "AError.h" #include "CsvTranslator.h" ! using namespace std; --- 29,34 ---- #include "math_constants.h" #include "randfn.h" #include "CsvTranslator.h" ! #include "common/tinyxml.h" using namespace std; *************** *** 95,107 **** if (load) return; // write only for now wxASSERT(node); ! /* ! node->SetAttribute("DBCLASS", mzClass.mz); ! node->SetAttribute("MODELTYPE", int(mnModelType)); ! node->SetAttribute("FUNCTYPE", int(mnType)); ! node->SetAttribute("IMAGE", mzImageFileName.mz); ! node->SetAttribute("3DMODEL", mz3DModelFileName.mz); ! TiXmlNode* descriptionNode = node->InsertEndChild(TiXmlElement("DESCRIPTION")); ! descriptionNode->InsertEndChild(TiXmlText(mzDescription)); ! */ tcDatabaseObject::SerializeXml(node, load); } --- 94,105 ---- if (load) return; // write only for now wxASSERT(node); ! ! TiXmlElement* localNode = node->InsertEndChild(TiXmlElement("sensor"))->ToElement(); ! ! localNode->SetAttribute("maxRange_km" ,mfMaxRange_km); ! localNode->SetAttribute("refRange_km", mfRefRange_km); ! localNode->SetAttribute("fieldOfView_deg", mfFieldOfView_deg); ! localNode->SetAttribute("scanPeriod_s", mfScanPeriod_s); ! tcDatabaseObject::SerializeXml(node, load); } Index: tcRadarDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcRadarDBObject.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcRadarDBObject.cpp 28 Mar 2004 23:12:28 -0000 1.8 --- tcRadarDBObject.cpp 30 Mar 2004 01:15:21 -0000 1.9 *************** *** 29,35 **** #include "math_constants.h" #include "randfn.h" - //#include "AError.h" #include "CsvTranslator.h" ! using namespace std; --- 29,34 ---- #include "math_constants.h" #include "randfn.h" #include "CsvTranslator.h" ! #include "common/tinyxml.h" using namespace std; *************** *** 143,155 **** if (load) return; // write only for now wxASSERT(node); ! /* ! node->SetAttribute("DBCLASS", mzClass.mz); ! node->SetAttribute("MODELTYPE", int(mnModelType)); ! node->SetAttribute("FUNCTYPE", int(mnType)); ! node->SetAttribute("IMAGE", mzImageFileName.mz); ! node->SetAttribute("3DMODEL", mz3DModelFileName.mz); ! TiXmlNode* descriptionNode = node->InsertEndChild(TiXmlElement("DESCRIPTION")); ! descriptionNode->InsertEndChild(TiXmlText(mzDescription)); ! */ tcSensorDBObject::SerializeXml(node, load); } --- 142,157 ---- if (load) return; // write only for now wxASSERT(node); ! ! TiXmlElement* localNode = node->InsertEndChild(TiXmlElement("radar"))->ToElement(); ! ! localNode->SetAttribute("minRange_km", mfMinRange_km); ! localNode->SetAttribute("erp", mfERP_dBW); ! localNode->SetAttribute("minRangeRate_mps", mfMinRangeRate_mps); ! localNode->SetAttribute("maxFireControlTracks", (int)maxFireControlTracks); ! localNode->SetAttribute("isSemiactive", (int)isSemiactive); ! localNode->SetAttribute("isCommandReceiver", (int)isCommandReceiver); ! localNode->SetAttribute("detectsSurface", (int)mbDetectsSurface); ! localNode->SetAttribute("detectsAir", (int)mbDetectsAir); ! tcSensorDBObject::SerializeXml(node, load); } Index: tcMissileDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcMissileDBObject.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcMissileDBObject.cpp 28 Mar 2004 23:12:28 -0000 1.6 --- tcMissileDBObject.cpp 30 Mar 2004 01:15:21 -0000 1.7 *************** *** 30,37 **** #include "math_constants.h" #include "randfn.h" - //#include "AError.h" #include "CsvTranslator.h" #include "tcDatabase.h" ! using namespace std; --- 30,36 ---- #include "math_constants.h" #include "randfn.h" #include "CsvTranslator.h" #include "tcDatabase.h" ! #include "common/tinyxml.h" using namespace std; *************** *** 261,273 **** if (load) return; // write only for now wxASSERT(node); ! /* ! node->SetAttribute("DBCLASS", mzClass.mz); ! node->SetAttribute("MODELTYPE", int(mnModelType)); ! node->SetAttribute("FUNCTYPE", int(mnType)); ! node->SetAttribute("IMAGE", mzImageFileName.mz); ! node->SetAttribute("3DMODEL", mz3DModelFileName.mz); ! TiXmlNode* descriptionNode = node->InsertEndChild(TiXmlElement("DESCRIPTION")); ! descriptionNode->InsertEndChild(TiXmlText(mzDescription)); ! */ tcDatabaseObject::SerializeXml(node, load); } --- 260,298 ---- if (load) return; // write only for now wxASSERT(node); ! ! TiXmlElement* localNode = node->InsertEndChild(TiXmlElement("missile"))->ToElement(); ! ! localNode->SetAttribute("mass_kg", mfMass_kg); ! localNode->SetAttribute("dragArea_sm", mfDragArea_sm); ! localNode->SetAttribute("gmax", mfGmax); ! localNode->SetAttribute("maxTurnRate_degps", mfMaxTurnRate_degps); ! localNode->SetAttribute("cdpsub", mfCdpsub); ! localNode->SetAttribute("cdptran", mfCdptran); ! localNode->SetAttribute("cdpsup", mfCdpsup); ! localNode->SetAttribute("mcm", mfMcm); ! localNode->SetAttribute("msupm", mfMsupm); ! localNode->SetAttribute("kdi", mfKdi); ! localNode->SetAttribute("boostThrust_N", mfBoostThrust_N); ! localNode->SetAttribute("boostTime_s", mfBoostTime_s); ! localNode->SetAttribute("sustThrust_N", mfSustThrust_N); ! localNode->SetAttribute("sustTime_s", mfSustTime_s); ! localNode->SetAttribute("damage", mfDamage); ! localNode->SetAttribute("damageType", (int)meDamageType); ! localNode->SetAttribute("rcs_dbsm", mfRcs_dbsm); ! localNode->SetAttribute("range_km", mfRange_km); ! localNode->SetAttribute("shutdownSpeed_mps", mfShutdownSpeed_mps); ! localNode->SetAttribute("primarySensor", maSensorClass[0].mz); ! localNode->SetAttribute("secondarySensor", maSensorClass[1].mz); ! ! for(unsigned int i=0;(i<mnNumSegments)&&(i<MAX_MISSILE_FLIGHT_SEGMENTS);i++) ! { ! TiXmlElement* childNode = node->InsertEndChild(TiXmlElement("segment"))->ToElement(); ! ! childNode->SetAttribute("range", maFlightProfile[i].mfRange_km); ! childNode->SetAttribute("alt", maFlightProfile[i].mfAltitude_m); ! childNode->SetAttribute("altMode", (int)maFlightProfile[i].meAltitudeMode); ! childNode->SetAttribute("guidanceMode", (int)maFlightProfile[i].meGuidanceMode); ! } ! tcDatabaseObject::SerializeXml(node, load); } Index: tcLauncherDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcLauncherDBObject.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcLauncherDBObject.cpp 28 Mar 2004 23:12:28 -0000 1.5 --- tcLauncherDBObject.cpp 30 Mar 2004 01:15:21 -0000 1.6 *************** *** 32,36 **** //#include "AError.h" #include "CsvTranslator.h" ! using namespace std; --- 32,36 ---- //#include "AError.h" #include "CsvTranslator.h" ! #include "common/tinyxml.h" using namespace std; *************** *** 128,140 **** if (load) return; // write only for now wxASSERT(node); ! /* ! node->SetAttribute("DBCLASS", mzClass.mz); ! node->SetAttribute("MODELTYPE", int(mnModelType)); ! node->SetAttribute("FUNCTYPE", int(mnType)); ! node->SetAttribute("IMAGE", mzImageFileName.mz); ! node->SetAttribute("3DMODEL", mz3DModelFileName.mz); ! TiXmlNode* descriptionNode = node->InsertEndChild(TiXmlElement("DESCRIPTION")); ! descriptionNode->InsertEndChild(TiXmlText(mzDescription)); ! */ tcDatabaseObject::SerializeXml(node, load); } --- 128,146 ---- if (load) return; // write only for now wxASSERT(node); ! ! TiXmlElement* localNode = node->InsertEndChild(TiXmlElement("launcher"))->ToElement(); ! ! localNode->SetAttribute("capacity", (int)mnCapacity); ! localNode->SetAttribute("childClass", mzChildClass.mz); ! localNode->SetAttribute("fcSensorClass", fireControlSensorClass); ! ! for(unsigned int i=0;(i<mnConfigurations)&&(i<MAX_LAUNCHER_CONFIGURATIONS);i++) ! { ! TiXmlElement* childNode = node->InsertEndChild(TiXmlElement("config"))->ToElement(); ! childNode->SetAttribute("capacity", (int)maCapacity[i]); ! childNode->SetAttribute("childClass", maChildClass[i].mz); ! } ! ! tcDatabaseObject::SerializeXml(node, load); } Index: tcDatabaseObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcDatabaseObject.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcDatabaseObject.cpp 28 Mar 2004 23:12:28 -0000 1.8 --- tcDatabaseObject.cpp 30 Mar 2004 01:15:21 -0000 1.9 *************** *** 226,231 **** node->SetAttribute("funcType", int(mnType)); node->SetAttribute("image", mzImageFileName.mz); ! node->SetAttribute("3DModel", mz3DModelFileName.mz); ! TiXmlNode* descriptionNode = node->InsertEndChild(TiXmlElement("DESCRIPTION")); descriptionNode->InsertEndChild(TiXmlText(mzDescription)); } --- 226,231 ---- node->SetAttribute("funcType", int(mnType)); node->SetAttribute("image", mzImageFileName.mz); ! node->SetAttribute("model3D", mz3DModelFileName.mz); ! TiXmlNode* descriptionNode = node->InsertEndChild(TiXmlElement("notes")); descriptionNode->InsertEndChild(TiXmlText(mzDescription)); } Index: tcGenericDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcGenericDBObject.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcGenericDBObject.cpp 28 Mar 2004 23:12:28 -0000 1.6 --- tcGenericDBObject.cpp 30 Mar 2004 01:15:21 -0000 1.7 *************** *** 302,314 **** if (load) return; // write only for now wxASSERT(node); - /* - node->SetAttribute("DBCLASS", mzClass.mz); - node->SetAttribute("MODELTYPE", int(mnModelType)); - node->SetAttribute("FUNCTYPE", int(mnType)); - node->SetAttribute("IMAGE", mzImageFileName.mz); - node->SetAttribute("3DMODEL", mz3DModelFileName.mz); - TiXmlNode* descriptionNode = node->InsertEndChild(TiXmlElement("DESCRIPTION")); - descriptionNode->InsertEndChild(TiXmlText(mzDescription)); - */ TiXmlElement* localNode = node->InsertEndChild(TiXmlElement("generic"))->ToElement(); --- 302,305 ---- |