gcblue-commits Mailing List for Global Conflict Blue (Page 22)
Status: Alpha
Brought to you by:
ddcforge
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(112) |
Feb
(106) |
Mar
(88) |
Apr
(111) |
May
(53) |
Jun
(60) |
Jul
(58) |
Aug
(61) |
Sep
(45) |
Oct
(31) |
Nov
(71) |
Dec
(70) |
| 2005 |
Jan
(33) |
Feb
(57) |
Mar
(98) |
Apr
(47) |
May
(53) |
Jun
(79) |
Jul
(79) |
Aug
|
Sep
(33) |
Oct
(1) |
Nov
(20) |
Dec
(64) |
| 2006 |
Jan
(20) |
Feb
(1) |
Mar
(43) |
Apr
(11) |
May
(8) |
Jun
(23) |
Jul
|
Aug
(28) |
Sep
(58) |
Oct
(25) |
Nov
(47) |
Dec
(70) |
|
From: Dewitt C. <ddc...@us...> - 2005-07-02 16:51:47
|
Update of /cvsroot/gcblue/gcb_wx/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24188/database Modified Files: database.db Log Message: Index: database.db =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/database/database.db,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 Binary files /tmp/cvsZwqXYc and /tmp/cvs1W039z differ |
|
From: Dewitt C. <ddc...@us...> - 2005-07-02 16:51:21
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24188/src/sim Modified Files: Game.cpp tcAirObject.cpp tcFlightOpsObject.cpp tcLauncherState.cpp tcMapData.cpp tcMissileObject.cpp tcPlatformObject.cpp tcSensorTrackIterator.cpp tcSimState.cpp tcWeaponObject.cpp Log Message: Index: tcSimState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSimState.cpp,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** tcSimState.cpp 28 Jun 2005 02:51:35 -0000 1.84 --- tcSimState.cpp 2 Jul 2005 16:51:12 -0000 1.85 *************** *** 566,570 **** { float range_m = 1000.0f * target->mcKin.RangeToKmAlt(weapon->mcKin); ! if (range_m <= 80.0) { float damageFraction = GetFractionalDamage(fDamage, target); --- 566,571 ---- { float range_m = 1000.0f * target->mcKin.RangeToKmAlt(weapon->mcKin); ! float damage_range_m = 0.5f * target->GetSpan() + 25.0f; ! if (range_m <= damage_range_m) { float damageFraction = GetFractionalDamage(fDamage, target); Index: tcWeaponObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcWeaponObject.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcWeaponObject.cpp 1 Jun 2005 00:13:50 -0000 1.13 --- tcWeaponObject.cpp 2 Jul 2005 16:51:12 -0000 1.14 *************** *** 115,119 **** tcSensorMapTrack *smtrack = simState->mcSensorMap.GetSensorMapTrack(targetId, GetAlliance()); ! if (smtrack == NULL) { fprintf(stderr, "tcWeaponObject::SetIntendedTarget - targetId %d not found in sensor map" --- 115,119 ---- tcSensorMapTrack *smtrack = simState->mcSensorMap.GetSensorMapTrack(targetId, GetAlliance()); ! if (smtrack == 0) { fprintf(stderr, "tcWeaponObject::SetIntendedTarget - targetId %d not found in sensor map" Index: tcMissileObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMissileObject.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** tcMissileObject.cpp 28 Jun 2005 02:51:35 -0000 1.28 --- tcMissileObject.cpp 2 Jul 2005 16:51:12 -0000 1.29 *************** *** 491,500 **** { mfGuidanceUpdateInterval = 0.2f; ! sensor->mfCurrentScanPeriod_s = 0.2f; } else if (mfInterceptTime <= 2.0) { mfGuidanceUpdateInterval = 0.1f; ! sensor->mfCurrentScanPeriod_s = 0.1f; } --- 491,500 ---- { mfGuidanceUpdateInterval = 0.2f; ! if (sensor != 0) sensor->mfCurrentScanPeriod_s = 0.2f; } else if (mfInterceptTime <= 2.0) { mfGuidanceUpdateInterval = 0.1f; ! if (sensor != 0) sensor->mfCurrentScanPeriod_s = 0.1f; } Index: tcMapData.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMapData.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tcMapData.cpp 28 Jun 2005 02:51:35 -0000 1.21 --- tcMapData.cpp 2 Jul 2005 16:51:12 -0000 1.22 *************** *** 975,978 **** --- 975,980 ---- * point (startLon_deg, startLat_deg) * Uses newer 10 x 10 deg DEM tile system + * TODO: there is a bug with this where areas near or straddling an untiled area + * are not loaded correctly. The map shows all black in these cases. */ void tcMapData::LoadHighResB(float startLon_deg, float startLat_deg) Index: tcLauncherState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncherState.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** tcLauncherState.cpp 25 Jun 2005 22:10:36 -0000 1.33 --- tcLauncherState.cpp 2 Jul 2005 16:51:12 -0000 1.34 *************** *** 57,63 **** tcLauncherDBObject* ldata = dynamic_cast<tcLauncherDBObject*>(mpDatabase->GetObject(anKey)); ! if (ldata == NULL) { ! WTL("Error - tcLauncherState::AddFullLauncher - Not found in db"); return; } --- 57,64 ---- tcLauncherDBObject* ldata = dynamic_cast<tcLauncherDBObject*>(mpDatabase->GetObject(anKey)); ! if (ldata == 0) { ! fprintf(stderr, "Error - tcLauncherState::AddFullLauncher - Not found in db (%d)\n", ! anKey); return; } *************** *** 65,69 **** if (mnCount >= tcGenericDBObject::MAXLAUNCHERS) { ! WTL("Error - tcLauncherState::AddFullLauncher - full"); return; } --- 66,70 ---- if (mnCount >= tcGenericDBObject::MAXLAUNCHERS) { ! fprintf(stderr, "Error - tcLauncherState::AddFullLauncher - full\n"); return; } Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.136 retrieving revision 1.137 diff -C2 -d -r1.136 -r1.137 *** Game.cpp 28 Jun 2005 02:51:35 -0000 1.136 --- Game.cpp 2 Jul 2005 16:51:12 -0000 1.137 *************** *** 2026,2031 **** s = wxString::Format("Formed group %d (%d units)\n", val, hookedUnits.size()); DisplayMessage(s.c_str()); } - return; } event.Skip(); --- 2026,2031 ---- s = wxString::Format("Formed group %d (%d units)\n", val, hookedUnits.size()); DisplayMessage(s.c_str()); + return; } } event.Skip(); *************** *** 2172,2176 **** if (controlDown) { ! int xx = 0; } --- 2172,2182 ---- if (controlDown) { ! switch (nChar) ! { ! case ('r'-'a'+1): // CTRL+r ! tcSimPythonInterface::Get()->ReimportModules(); ! return; ! } ! return; } Index: tcPlatformObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPlatformObject.cpp,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** tcPlatformObject.cpp 28 Jun 2005 02:51:35 -0000 1.51 --- tcPlatformObject.cpp 2 Jul 2005 16:51:12 -0000 1.52 *************** *** 208,212 **** /** ! * adjust speed to goal speed, limited by max acceleration */ void tcPlatformObject::UpdateSpeed(float dt_s) --- 208,213 ---- /** ! * Adjust speed to goal speed, limited by max acceleration ! * Also updates fuel state (setting fuel capacity to 0 in db gives infinite fuel) */ void tcPlatformObject::UpdateSpeed(float dt_s) *************** *** 1032,1038 **** { tnPoolIndex nLauncherKey = database->GetKey(mpDBObject->maLauncherClass[nLauncher]); ! float launcherAz_deg = mpDBObject->GetLauncherAz(nLauncher); ! mcLauncherState.AddFullLauncher(nLauncherKey, C_PIOVER180*launcherAz_deg, ! mpDBObject->launcherName[nLauncher]); } --- 1033,1047 ---- { tnPoolIndex nLauncherKey = database->GetKey(mpDBObject->maLauncherClass[nLauncher]); ! if (nLauncherKey != -1) ! { ! float launcherAz_deg = mpDBObject->GetLauncherAz(nLauncher); ! mcLauncherState.AddFullLauncher(nLauncherKey, C_PIOVER180*launcherAz_deg, ! mpDBObject->launcherName[nLauncher]); ! } ! else ! { ! fprintf(stderr, "tcPlatformObject::tcPlatformObject - Launcher not in database (%s)\n", ! mpDBObject->maLauncherClass[nLauncher].mz); ! } } Index: tcSensorTrackIterator.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSensorTrackIterator.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcSensorTrackIterator.cpp 1 Jun 2005 00:13:33 -0000 1.3 --- tcSensorTrackIterator.cpp 2 Jul 2005 16:51:12 -0000 1.4 *************** *** 117,121 **** bool tcSensorTrackIterator::NotDone() { ! return (nIterated <= nSize); } --- 117,121 ---- bool tcSensorTrackIterator::NotDone() { ! return (map != 0) && (nIterated <= nSize); } Index: tcFlightOpsObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcFlightOpsObject.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcFlightOpsObject.cpp 22 Jun 2005 01:22:09 -0000 1.11 --- tcFlightOpsObject.cpp 2 Jul 2005 16:51:12 -0000 1.12 *************** *** 190,197 **** ! tcGameObject* tcFlightOpsObject::AddChildToFlightDeck(std::string className, std::string unitName, teLocation loc, unsigned int position) { ! return AddChildToFlightDeck(database->GetObject(className), unitName, loc, position); } --- 190,207 ---- ! tcGameObject* tcFlightOpsObject::AddChildToFlightDeck(const std::string& className, std::string unitName, teLocation loc, unsigned int position) { ! tcDatabaseObject* objData = database->GetObject(className); ! if (objData) ! { ! return AddChildToFlightDeck(objData, unitName, loc, position); ! } ! else ! { ! fprintf(stderr, "tcFlightOpsObject::AddChildToFlightDeck - child not in database (%s)\n", ! className.c_str()); ! return 0; ! } } Index: tcAirObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAirObject.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** tcAirObject.cpp 28 Jun 2005 02:51:35 -0000 1.25 --- tcAirObject.cpp 2 Jul 2005 16:51:12 -0000 1.26 *************** *** 187,191 **** { // check for crash ! if ((mcKin.mfAlt_m <= 0)||(mcTerrain.mfHeight_m >= mcKin.mfAlt_m)) { mfDamageLevel = 1.0f; } --- 187,192 ---- { // check for crash ! if ((mcKin.mfAlt_m <= 0) || (mcTerrain.mfHeight_m >= mcKin.mfAlt_m)) ! { mfDamageLevel = 1.0f; } |
|
From: Dewitt C. <ddc...@us...> - 2005-07-02 16:51:20
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24188/src/scriptinterface Modified Files: tcPlatformInterface.cpp tcScenarioInterface.cpp tcSimPythonInterface.cpp Log Message: Index: tcPlatformInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterface.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** tcPlatformInterface.cpp 30 Jun 2005 01:06:10 -0000 1.48 --- tcPlatformInterface.cpp 2 Jul 2005 16:51:11 -0000 1.49 *************** *** 498,501 **** --- 498,503 ---- info.maxDepth_m = 0; + bool isBomb = false; + if (tcMissileDBObject* missileDBObj = dynamic_cast<tcMissileDBObject*>(pLauncher->mpChildDBObj)) *************** *** 508,511 **** --- 510,517 ---- { info.mfRange_km = ballisticDBObj->maxRange_km; + if (ballisticDBObj->ballisticType == tcBallisticDBObject::GRAVITY_BOMB) + { + isBomb = true; + } } else if (tcTorpedoDBObject* torpDBObj = *************** *** 525,529 **** info.mnTargetFlags = pLauncher->mnTargetFlags; ! if (pLauncher->meLaunchMode == DATUM_ONLY) { info.mnLaunchMode = 0; --- 531,539 ---- info.mnTargetFlags = pLauncher->mnTargetFlags; ! if (isBomb) ! { ! info.mnLaunchMode = 2; ! } ! else if (pLauncher->meLaunchMode == DATUM_ONLY) { info.mnLaunchMode = 0; *************** *** 535,539 **** else { ! info.mnLaunchMode = 2; // other } --- 545,549 ---- else { ! info.mnLaunchMode = 3; // other } *************** *** 1225,1228 **** --- 1235,1243 ---- } + void tcPlatformInterface::SetActionText(const std::string& text) + { + mpPlatformObj->mcAI.mzActionText = text; + } + // flightport (airstrip, cv flight deck, helo pad) bool tcPlatformInterface::HasFlightPort(void) Index: tcSimPythonInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcSimPythonInterface.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** tcSimPythonInterface.cpp 25 Jun 2005 22:10:36 -0000 1.35 --- tcSimPythonInterface.cpp 2 Jul 2005 16:51:11 -0000 1.36 *************** *** 576,580 **** s += ")\n"; ! CallPython(s.c_str(),"Exception occured in ProcessCommand\n"); } --- 576,580 ---- s += ")\n"; ! CallPython(s.c_str(),"Exception occurred in ProcessCommand\n"); } *************** *** 636,640 **** if (!mpSimState->IsMultiplayerClient()) { ! CallPython(zBuff, "Exception occured in ProcessCallback\n"); } else --- 636,640 ---- if (!mpSimState->IsMultiplayerClient()) { ! CallPython(zBuff, "Exception occurred in ProcessCallback\n"); } else *************** *** 679,683 **** if (!mpSimState->IsMultiplayerClient()) { ! CallPython(zBuff, "Exception occured in ProcessCallback\n"); } else --- 679,683 ---- if (!mpSimState->IsMultiplayerClient()) { ! CallPython(zBuff, "Exception occurred in ProcessCallback\n"); } else *************** *** 693,696 **** --- 693,697 ---- } + /** * version for sending lat/lon coordinates *************** *** 723,727 **** if (!mpSimState->IsMultiplayerClient()) { ! CallPython(zBuff, "Exception occured in ProcessCallback\n"); } else --- 724,728 ---- if (!mpSimState->IsMultiplayerClient()) { ! CallPython(zBuff, "Exception occurred in ProcessCallback\n"); } else *************** *** 748,752 **** SetMenuGroup(id); ! if (mpHookedObj == NULL) { PopMode(); --- 749,753 ---- SetMenuGroup(id); ! if (mpHookedObj == 0) { PopMode(); *************** *** 766,770 **** if (!mpSimState->IsMultiplayerClient()) { ! CallPython(zBuff, "Exception occured in ProcessCallback\n"); } else --- 767,771 ---- if (!mpSimState->IsMultiplayerClient()) { ! CallPython(zBuff, "Exception occurred in ProcessCallback\n"); } else *************** *** 788,792 **** SetMenuGroup(id); ! if (mpHookedObj == NULL) { PopMode(); --- 789,793 ---- SetMenuGroup(id); ! if (mpHookedObj == 0) { PopMode(); *************** *** 801,805 **** id.size()); #endif ! CallPython(command.c_str(), "Exception occured in ProcessCallbackString\n"); } else --- 802,806 ---- id.size()); #endif ! CallPython(command.c_str(), "Exception occurred in ProcessCallbackString\n"); } else *************** *** 826,830 **** { char zBuff[128]; ! if (mpHookedObj == NULL) return; if (!mpSimState->mpUserInfo->IsOwnAlliance(mpHookedObj->GetAlliance())) return; --- 827,831 ---- { char zBuff[128]; ! if (mpHookedObj == 0) return; if (!mpSimState->mpUserInfo->IsOwnAlliance(mpHookedObj->GetAlliance())) return; *************** *** 832,836 **** ! CallPython(zBuff, "Exception occured in ProcessHotKey\n"); } --- 833,837 ---- ! CallPython(zBuff, "Exception occurred in ProcessHotKey\n"); } *************** *** 846,854 **** { char zBuff[128]; ! if (mpHookedObj == NULL) return; if (!mpSimState->mpUserInfo->IsOwnAlliance(mpHookedObj->GetAlliance())) return; sprintf(zBuff,"Menu.ProcessSecondaryHook(HookedUnitInfo,%d)\n",id); ! CallPython(zBuff,"Exception occured in ProcessSecondaryHook\n"); } --- 847,878 ---- { char zBuff[128]; ! if (mpHookedObj == 0) return; if (!mpSimState->mpUserInfo->IsOwnAlliance(mpHookedObj->GetAlliance())) return; sprintf(zBuff,"Menu.ProcessSecondaryHook(HookedUnitInfo,%d)\n",id); ! CallPython(zBuff,"Exception occurred in ProcessSecondaryHook\n"); ! } ! ! void tcSimPythonInterface::ReimportModules() ! { ! try ! { ! handle<>( PyRun_String("import AI\n" ! , Py_file_input, mpDictionary->ptr(), mpDictionary->ptr()) ); ! handle<>( PyRun_String("import Menu\n" ! , Py_file_input, mpDictionary->ptr(), mpDictionary->ptr()) ); ! handle<>( PyRun_String("print ''\nprint 'Re-imported modules'\n" ! , Py_file_input, mpDictionary->ptr(), mpDictionary->ptr()) ); ! } ! catch (error_already_set) ! { ! // handle the exception in some way ! fprintf(stderr, "tcSimPythonInterface::ReimportModules - Python error occurred during re-import\n"); ! PyErr_Print(); ! } ! catch (...) ! { ! fprintf(stderr,"tcSimPythonInterface::ReimportModules - Unknown exception occurred\n"); ! } } *************** *** 859,863 **** { fprintf(stderr,text); ! if (mpConsole == NULL) return; mpConsole->Print(text); } --- 883,887 ---- { fprintf(stderr,text); ! if (mpConsole == 0) return; mpConsole->Print(text); } *************** *** 935,939 **** tcGameObject *pGameObj = mpSimState->GetObject(anID); ! if (!pGameObj) return; if (mpSimState->mpUserInfo->IsOwnAlliance(pGameObj->GetAlliance())) { --- 959,969 ---- tcGameObject *pGameObj = mpSimState->GetObject(anID); ! if (!pGameObj) ! { ! mpHookedObj = 0; ! return; ! } ! ! if (mpSimState->mpUserInfo->IsOwnAlliance(pGameObj->GetAlliance())) { *************** *** 962,969 **** "hello.close()", Py_file_input,mpDictionary->ptr(), mpDictionary->ptr()) ); } ! catch(error_already_set) { // handle the exception in some way ! fprintf(stderr,"Exception occured in Test()\n"); PyErr_Print(); } --- 992,999 ---- "hello.close()", Py_file_input,mpDictionary->ptr(), mpDictionary->ptr()) ); } ! catch (error_already_set) { // handle the exception in some way ! fprintf(stderr,"Exception occurred in Test()\n"); PyErr_Print(); } *************** *** 1015,1024 **** catch(error_already_set) { ! fprintf(stderr,"Exception occured during SendTextToConsole\n"); PyErr_Print(); } catch(...) { ! fprintf(stderr,"Unknown exception occured during SendTextToConsole\n"); PyErr_Print(); } --- 1045,1054 ---- catch(error_already_set) { ! fprintf(stderr,"Exception occurred during SendTextToConsole\n"); PyErr_Print(); } catch(...) { ! fprintf(stderr,"Unknown exception occurred during SendTextToConsole\n"); PyErr_Print(); } *************** *** 1170,1177 **** , Py_file_input, mpDictionary->ptr(), mpDictionary->ptr()) ); } ! catch(error_already_set) { // handle the exception in some way ! fprintf(stderr,"Exception occured during import\n"); PyErr_Print(); } --- 1200,1207 ---- , Py_file_input, mpDictionary->ptr(), mpDictionary->ptr()) ); } ! catch (error_already_set) { // handle the exception in some way ! fprintf(stderr,"Exception occurred during import\n"); PyErr_Print(); } Index: tcScenarioInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcScenarioInterface.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** tcScenarioInterface.cpp 28 Jun 2005 02:51:34 -0000 1.30 --- tcScenarioInterface.cpp 2 Jul 2005 16:51:11 -0000 1.31 *************** *** 165,168 **** --- 165,169 ---- .def("GetDefaultUnit",&tcScenarioInterface::GetDefaultUnit) .def("GetRandomDatum",&tcScenarioInterface::GetRandomDatum) + .def("GetSideCode", &tcScenarioInterface::GetSideCode) .def("SetAllianceGoal",&tcScenarioInterface::SetAllianceGoal) .def("SetDateTime",&tcScenarioInterface::SetDateTime) *************** *** 170,173 **** --- 171,175 ---- .def("SetScenarioLoaded",&tcScenarioInterface::SetScenarioLoaded) .def("SetScenarioName",&tcScenarioInterface::SetScenarioName) + .def("SetSideCode", &tcScenarioInterface::SetSideCode) .def("SetStartTheater", &tcScenarioInterface::SetStartTheater) .def("SetUserAlliance",&tcScenarioInterface::SetUserAlliance) *************** *** 501,504 **** --- 503,511 ---- } + int tcScenarioInterface::GetSideCode() const + { + return sideCode; + } + void tcScenarioInterface::GetStartTheater(double& lon_deg, double& lat_deg) const { *************** *** 534,541 **** } ! void tcScenarioInterface::SetScenarioName(std::string s) { simState->SetScenarioName(s); } void tcScenarioInterface::SetStartTheater(double lon_deg, double lat_deg) --- 541,553 ---- } ! void tcScenarioInterface::SetScenarioName(const std::string& s) { simState->SetScenarioName(s); } + + void tcScenarioInterface::SetSideCode(int code) + { + sideCode = code; + } void tcScenarioInterface::SetStartTheater(double lon_deg, double lat_deg) *************** *** 799,803 **** : lon_theater_deg(0), lat_theater_deg(0), ! eventTime(0) { } --- 811,816 ---- : lon_theater_deg(0), lat_theater_deg(0), ! eventTime(0), ! sideCode(0) { } |
|
From: Dewitt C. <ddc...@us...> - 2005-07-02 16:51:20
|
Update of /cvsroot/gcblue/gcb_wx/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24188/scripts Modified Files: AI.py Menu.py UnitCommands.py Log Message: Index: AI.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/AI.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** AI.py 29 Mar 2005 00:12:25 -0000 1.21 --- AI.py 2 Jul 2005 16:51:11 -0000 1.22 *************** *** 1,3 **** --- 1,4 ---- from UnitCommands import * + import math # test AI script, these need a lot of work *************** *** 310,313 **** --- 311,443 ---- # for duration of engagement + # Adjust heading toward target, maintain altitude and speed to release point, + # release ALL bombs at release point, and then reverse course + def BombTarget(TI): + UI = TI.GetPlatformInterface() + BB = TI.GetBlackboardInterface() + + iteration = TI.GetMemoryValue(1) # will return 0 first time + if (iteration == 0): # do initialization + TI.SetMemoryText('Description', 'Head to and bomb target') + TI.SetMemoryValue(2, 1) # state: 1 - fly to release, 2 - release + + iteration = iteration + 1 + TI.SetMemoryValue(1, iteration) + + if (not GetConnControl(BB)): + return + + bomb_state = TI.GetMemoryValue(2) + if (bomb_state == 2): + DropAllBombs(UI) + UI.SetHeading(UI.GetHeading() + 160) + UI.SetActionText('') + TI.EndTask() + return + + + track_info = UI.GetTargetTrackInfo() + tgt_lat = track_info.Lat + tgt_lon = track_info.Lon + tgt_alt = UI.GetMapTerrainElevation(tgt_lon, tgt_lat) # since we're bombing a ground target (does track have same altitude value?) + + # adjust heading to target + tgt_bearing = UI.GetHeadingToDatum(tgt_lon,tgt_lat) + UI.SetHeading(tgt_bearing) + + tgt_range_m = 1000 * UI.GetRangeToTrack(track_info) # horizontal range in m + own_speed_mps = 0.51444444 * UI.GetSpeed() # get speed in m/s + own_alt_m = UI.GetAlt() + d_alt_m = own_alt_m - tgt_alt + if (d_alt_m < 0): + TI.EndTask() + return + + t_flight = math.sqrt(0.20394324 * (own_alt_m - tgt_alt)) + release_range_m = t_flight * own_speed_mps + range_left_m = tgt_range_m - release_range_m + if (range_left_m < 0): + DisplayMessage('Bomb run failed. Too close, too fast or too high') + TI.EndTask() + return + + # calculate time to release + t_release = range_left_m / own_speed_mps + if (t_release < 10): + TI.SetUpdateInterval(t_release) + TI.SetMemoryValue(2, 2) # release all bombs next update + UI.SetActionText('Away %.0f s' % t_release) + else: + TI.SetUpdateInterval(9.0) + UI.SetActionText('Bomb %.0f s' % t_release) + + + # Version that bombs a datum without requiring a target based on a sensor map track + def BombDatum(TI): + UI = TI.GetPlatformInterface() + BB = TI.GetBlackboardInterface() + + iteration = TI.GetMemoryValue(1) # will return 0 first time + if (iteration == 0): # do initialization + TI.SetMemoryText('Description', 'Head to and bomb datum') + TI.SetMemoryValue(2, 1) # state: 1 - fly to release, 2 - release + datum_lon = GetMessageParam(BB, 'DatumLongitude') + datum_lat = GetMessageParam(BB, 'DatumLatitude') + TI.SetMemoryValue(10, datum_lon) + TI.SetMemoryValue(11, datum_lat) + + iteration = iteration + 1 + TI.SetMemoryValue(1, iteration) + + if (not GetConnControl(BB)): + return + + bomb_state = TI.GetMemoryValue(2) + if (bomb_state == 2): + DropAllBombs(UI) + UI.SetHeading(UI.GetHeading() + 160) + UI.SetActionText('') + TI.EndTask() + return + + + tgt_lon = TI.GetMemoryValue(10) + tgt_lat = TI.GetMemoryValue(11) + tgt_alt = UI.GetMapTerrainElevation(tgt_lon, tgt_lat) # since we're bombing a ground target (does track have same altitude value?) + + # adjust heading to target + tgt_bearing = UI.GetHeadingToDatum(tgt_lon, tgt_lat) + UI.SetHeading(tgt_bearing) + + tgt_range_m = 1000 * UI.GetRangeToDatum(tgt_lon, tgt_lat) # horizontal range in m + own_speed_mps = 0.51444444 * UI.GetSpeed() # get speed in m/s + own_alt_m = UI.GetAlt() + d_alt_m = own_alt_m - tgt_alt + if (d_alt_m < 0): + TI.EndTask() + return + + t_flight = math.sqrt(0.20394324 * (own_alt_m - tgt_alt)) + release_range_m = t_flight * own_speed_mps + range_left_m = tgt_range_m - release_range_m + if (range_left_m < 0): + DisplayMessage('Bomb run failed. Too close, too fast or too high') + TI.EndTask() + return + + # calculate time to release + t_release = range_left_m / own_speed_mps + if (t_release < 10): + TI.SetUpdateInterval(t_release) + TI.SetMemoryValue(2, 2) # release all bombs next update + UI.SetActionText('Away %.0f s' % t_release) + else: + TI.SetUpdateInterval(9.0) + UI.SetActionText('Bomb %.0f s' % t_release) + + + + + # gets info on closest (known) enemy or unknown platform within search range *************** *** 333,337 **** ! # returns id of closest target that is in-range, engageable, not already --- 463,485 ---- ! def DropAllBombs(UI): ! UI.DisplayMessage('Dropping all bombs') ! ! track_info = UI.GetTargetTrackInfo() ! ! tgt_lat = track_info.Lat ! tgt_lon = track_info.Lon ! tgt_alt = UI.GetMapTerrainElevation(tgt_lon, tgt_lat) ! ! nLaunchers = UI.GetLauncherCount() ! ! for n in range(0, nLaunchers): ! launcher_info = UI.GetLauncherInfo(n) ! if (launcher_info.LaunchMode == 2): ! UI.SendDatumToLauncher(tgt_lon,tgt_lat,tgt_alt,n) ! UI.Launch(n, 32) ! ! ! # returns id of closest target that is in-range, engageable, not already *************** *** 903,907 **** range_km = 0.0 ! launch_mode = launcher_info.LaunchMode # 0 - datum, 1 - seeker, 2 - other if target_info.IsAir(): --- 1051,1055 ---- range_km = 0.0 ! launch_mode = launcher_info.LaunchMode # 0 - datum, 1 - seeker, 2 - bomb, 3 - other if target_info.IsAir(): *************** *** 939,943 **** return ! launch_mode = launcher_info.LaunchMode # 0 - datum, 1 - seeker, 2 - other target_info = UI.GetTargetTrackInfo() --- 1087,1091 ---- return ! launch_mode = launcher_info.LaunchMode # 0 - datum, 1 - seeker, 2 - bomb, 3 - other target_info = UI.GetTargetTrackInfo() *************** *** 959,963 **** UI.Launch(launcher, launch_qty) UI.SetActionText('Datum launch') ! else: # handoff to active seeker target_accepted = UI.HandoffTargetToLauncher(launcher) if (target_accepted): --- 1107,1111 ---- UI.Launch(launcher, launch_qty) UI.SetActionText('Datum launch') ! elif launch_mode == 1: # handoff to active seeker target_accepted = UI.HandoffTargetToLauncher(launcher) if (target_accepted): Index: UnitCommands.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/UnitCommands.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** UnitCommands.py 11 Jun 2005 21:01:44 -0000 1.18 --- UnitCommands.py 2 Jul 2005 16:51:11 -0000 1.19 *************** *** 15,18 **** --- 15,26 ---- UI.AddTask('EngageAll', 2.0) + def AddBombTargetTask(UI): + UI.AddTask('BombTarget', 3.0) + + def AddBombDatumTask(UI, lon, lat): + BB = UI.GetBlackboardInterface() + BB.Write('DatumLongitude', '%f' % lon) + BB.Write('DatumLatitude', '%f' % lat) + UI.AddTask('BombDatum', 3.0) Index: Menu.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/Menu.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Menu.py 17 May 2005 00:20:40 -0000 1.13 --- Menu.py 2 Jul 2005 16:51:11 -0000 1.14 *************** *** 181,185 **** UnitMenu.AddItemUIWithParam('%s [%d]' % (weap_name, weap_qty), 'LaunchDatum', 'Datum', n) UnitMenu.EndSubMenu() ! # "Engage target with" menu lists launchers that are effective vs. selected target target_id = UnitInfo.GetTarget() --- 181,186 ---- UnitMenu.AddItemUIWithParam('%s [%d]' % (weap_name, weap_qty), 'LaunchDatum', 'Datum', n) UnitMenu.EndSubMenu() ! UnitMenu.AddItemUI('Bomb datum', 'AddBombDatumTask', 'Datum') ! # "Engage target with" menu lists launchers that are effective vs. selected target target_id = UnitInfo.GetTarget() *************** *** 194,197 **** --- 195,199 ---- UnitMenu.AddItemWithParam('%s [%d]' % (weap_name, weap_qty), 'LaunchTarget', n) UnitMenu.EndSubMenu() + UnitMenu.AddItem('Bomb target', 'AddBombTargetTask') # "Quick engage with" allows user to click on target and then automatically launch |
|
From: Dewitt C. <ddc...@us...> - 2005-07-02 16:51:20
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24188/src/graphics Modified Files: tcCreditView.cpp Log Message: Index: tcCreditView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcCreditView.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcCreditView.cpp 6 May 2005 23:57:50 -0000 1.14 --- tcCreditView.cpp 2 Jul 2005 16:51:11 -0000 1.15 *************** *** 236,240 **** static tcString szFocus; ! // reset static variables if rewind occured if (mbDrawRewind) { --- 236,240 ---- static tcString szFocus; ! // reset static variables if rewind occurred if (mbDrawRewind) { |
|
From: Dewitt C. <ddc...@us...> - 2005-07-02 16:51:19
|
Update of /cvsroot/gcblue/gcb_wx/scenarios In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24188/scenarios Modified Files: TaiwanTest.py Log Message: Index: TaiwanTest.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scenarios/TaiwanTest.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TaiwanTest.py 30 Jun 2005 01:06:09 -0000 1.2 --- TaiwanTest.py 2 Jul 2005 16:51:09 -0000 1.3 *************** *** 2,18 **** def CreateScenario(SM): ! # using variables for these to make it easy to switch sides in single player ! alliance_a = 1 ! alliance_b = 2 SM.CreateAlliance(alliance_a, 'Taiwan ROC') SM.CreateAlliance(alliance_b, 'China PLA') - SM.SetUserAlliance(1) - SM.SetScenarioDescription('Taiwan test scenario 2') SM.SetScenarioLoaded(1) - SM.SetScenarioName('Taiwan Test') SM.SetDateTime(2005, 8, 12, 10, 0, 0) ! SM.SetStartTheater(120, 25) # (lon, lat) in degrees, negative is West or South AddOverlayGraphics(SM) --- 2,28 ---- def CreateScenario(SM): ! SM.SetUserAlliance(1) ! ! # feature to toggle side each time user selects scenario ! side_code = SM.GetSideCode() ! if (side_code == 0): ! alliance_a = 1 ! alliance_b = 2 ! SM.SetScenarioDescription('Taiwan test scenario, Taiwan ROC side') ! SM.SetScenarioName('Taiwan Test (Taiwan ROC)') ! SM.SetSideCode(1) ! else: ! alliance_a = 2 ! alliance_b = 1 ! SM.SetScenarioDescription('Taiwan test scenario, China PLA side') ! SM.SetScenarioName('Taiwan Test (China PLA)') ! SM.SetSideCode(0) SM.CreateAlliance(alliance_a, 'Taiwan ROC') SM.CreateAlliance(alliance_b, 'China PLA') SM.SetScenarioLoaded(1) SM.SetDateTime(2005, 8, 12, 10, 0, 0) ! SM.SetStartTheater(119.6, 25) # (lon, lat) in degrees, negative is West or South AddOverlayGraphics(SM) *************** *** 140,148 **** baseName = 'Longtian AB' AddAirbase(SM, baseName, 119.417, 25.583, 0, alliance_b) ! AddAircraftToBase(SM, baseName, 'Su-27', 'Laser', 8) AddDefaultChinaStores(SM, baseName) baseName = 'Fuzhou AB' ! AddAirbase(SM, baseName, 119.367, 26.0167, 0, alliance_b) AddAircraftToBase(SM, baseName, 'Su-30MKK', 'Dancer', 8) AddDefaultChinaStores(SM, baseName) --- 150,161 ---- baseName = 'Longtian AB' AddAirbase(SM, baseName, 119.417, 25.583, 0, alliance_b) ! ! AddAircraftToBase(SM, baseName, 'H-6D', 'Club', 1) ! AddAircraftToBase(SM, baseName, 'Su-27', 'Laser', 4) ! AddAircraftToBase(SM, baseName, 'H-6D', 'Bat', 3) AddDefaultChinaStores(SM, baseName) baseName = 'Fuzhou AB' ! AddAirbase(SM, baseName, 119.347, 26.0267, 0, alliance_b) AddAircraftToBase(SM, baseName, 'Su-30MKK', 'Dancer', 8) AddDefaultChinaStores(SM, baseName) *************** *** 164,168 **** baseName = 'Mei-Xian AB' ! AddAirbase(SM, baseName, 116.133, 24.25, 0, alliance_b) AddAircraftToBase(SM, baseName, 'Su-27', 'Dagger', 8) AddDefaultChinaStores(SM, baseName) --- 177,181 ---- baseName = 'Mei-Xian AB' ! AddAirbase(SM, baseName, 116.131, 24.24, 0, alliance_b) AddAircraftToBase(SM, baseName, 'Su-27', 'Dagger', 8) AddDefaultChinaStores(SM, baseName) |
|
From: Dewitt C. <ddc...@us...> - 2005-06-30 01:06:49
|
Update of /cvsroot/gcblue/gcb_wx/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31770/database Modified Files: database.db Log Message: Index: database.db =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/database/database.db,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 Binary files /tmp/cvsqQFm8m and /tmp/cvsLm7vN5 differ |
|
From: Dewitt C. <ddc...@us...> - 2005-06-30 01:06:49
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31770/include/graphics Modified Files: tc3DViewer.h Log Message: Index: tc3DViewer.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DViewer.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tc3DViewer.h 17 May 2005 00:20:39 -0000 1.8 --- tc3DViewer.h 30 Jun 2005 01:06:08 -0000 1.9 *************** *** 131,135 **** osg::Vec3 GetCameraPosition(); double GetGameTime() const {return gameTime;} ! osg::Vec3 GetObjectPosition(tcGameObject *obj); bool GetTerrainActive() const {return isTerrainActive;} bool IsActive() {return isActive;} --- 131,135 ---- osg::Vec3 GetCameraPosition(); double GetGameTime() const {return gameTime;} ! const osg::Vec3& GetHookedObjectPositionAndType(unsigned int& classification); bool GetTerrainActive() const {return isTerrainActive;} bool IsActive() {return isActive;} |
|
From: Dewitt C. <ddc...@us...> - 2005-06-30 01:06:49
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31770/include/sim Modified Files: tcLauncher.h Log Message: Index: tcLauncher.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcLauncher.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** tcLauncher.h 25 Jun 2005 22:09:47 -0000 1.20 --- tcLauncher.h 30 Jun 2005 01:06:09 -0000 1.21 *************** *** 71,75 **** NO_FIRECONTROL = 11, TOO_DEEP = 12, ///< too deep for sub launch ! DAMAGED = 13 ///< cannot operate due to damage }; ///< launcher status codes --- 71,77 ---- NO_FIRECONTROL = 11, TOO_DEEP = 12, ///< too deep for sub launch ! DAMAGED = 13, ///< cannot operate due to damage ! INVALID_TARGET = 14, ///< not effective vs. target type ! OUT_OF_RANGE = 15 ///< target is beyond 1.5 x max range }; ///< launcher status codes *************** *** 131,134 **** --- 133,137 ---- bool IsDamaged() const; bool IsLoading() const; + bool IsEffective(unsigned int targetClassification) const; void SetErrorCode(int code) {errorCode = code;} |
|
From: Dewitt C. <ddc...@us...> - 2005-06-30 01:06:49
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31770 Modified Files: GCblue.vcproj Log Message: Index: GCblue.vcproj =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/GCblue.vcproj,v retrieving revision 1.94 retrieving revision 1.95 diff -C2 -d -r1.94 -r1.95 *** GCblue.vcproj 11 Jun 2005 21:01:41 -0000 1.94 --- GCblue.vcproj 30 Jun 2005 01:05:52 -0000 1.95 *************** *** 360,363 **** --- 360,366 ---- </File> <File + RelativePath=".\src\graphics\tcPopupText.cpp"> + </File> + <File RelativePath="src\graphics\tcRadioButton.cpp"> </File> *************** *** 461,464 **** --- 464,470 ---- </File> <File + RelativePath=".\src\sim\tcCounterMeasure.cpp"> + </File> + <File RelativePath=".\src\sim\tcDemTileReader.cpp"> </File> *************** *** 606,609 **** --- 612,618 ---- </File> <File + RelativePath=".\src\database\tcCounterMeasureDBObject.cpp"> + </File> + <File RelativePath="src\database\tcDatabase.cpp"> </File> *************** *** 630,633 **** --- 639,645 ---- </File> <File + RelativePath=".\src\database\tcItemDBObject.cpp"> + </File> + <File RelativePath="src\database\tcLauncherDBObject.cpp"> </File> *************** *** 1360,1363 **** --- 1372,1378 ---- </File> <File + RelativePath=".\include\graphics\tcPopupText.h"> + </File> + <File RelativePath="include\graphics\tcRadioButton.h"> </File> *************** *** 1461,1464 **** --- 1476,1482 ---- </File> <File + RelativePath=".\include\sim\tcCounterMeasure.h"> + </File> + <File RelativePath=".\include\sim\tcDemTileReader.h"> </File> *************** *** 1612,1615 **** --- 1630,1636 ---- </File> <File + RelativePath=".\include\database\tcCounterMeasureDBObject.h"> + </File> + <File RelativePath="include\database\tcDatabase.h"> </File> *************** *** 1642,1645 **** --- 1663,1669 ---- </File> <File + RelativePath=".\include\database\tcItemDBObject.h"> + </File> + <File RelativePath="include\database\tcLauncherDBObject.h"> </File> |
|
From: Dewitt C. <ddc...@us...> - 2005-06-30 01:06:22
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31770/src/sim Modified Files: tcLauncher.cpp tcObjectControl.cpp tcStores.cpp Log Message: Index: tcLauncher.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncher.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** tcLauncher.cpp 25 Jun 2005 22:10:36 -0000 1.25 --- tcLauncher.cpp 30 Jun 2005 01:06:11 -0000 1.26 *************** *** 415,418 **** --- 415,444 ---- } + bool tcLauncher::IsEffective(unsigned int targetClassification) const + { + if ((targetClassification & PTYPE_SURFACE)&&(mnTargetFlags & SURFACE_TARGET)) + { + return true; + } + else if ((targetClassification & PTYPE_AIR)&&(mnTargetFlags & AIR_TARGET)) + { + return true; + } + else if ((targetClassification & PTYPE_MISSILE)&&(mnTargetFlags & MISSILE_TARGET)) + { + return true; + } + else if ((targetClassification & PTYPE_FIXED)&&(mnTargetFlags & LAND_TARGET)) + { + return true; + } + else if ((targetClassification & PTYPE_SUBMARINE)&&(mnTargetFlags & SUBSURFACE_TARGET)) + { + return true; + } + + return false; + } + bool tcLauncher::IsLoading() const { *************** *** 636,643 **** bool hasTarget = (mnTargetID != NULL_INDEX); if (meLaunchMode == DATUM_ONLY) // needs a datum programmed to launch { ! if ((msDatum.mfLat_rad != 0) || (msDatum.mfLon_rad != 0)) { status = LAUNCHER_READY; --- 662,676 ---- bool hasTarget = (mnTargetID != NULL_INDEX); + bool hasDatum = (msDatum.mfLat_rad != 0) || (msDatum.mfLon_rad != 0); + + if ((meLaunchMode == AUTO) && (hasDatum)) + { + status = LAUNCHER_READY; + return; + } if (meLaunchMode == DATUM_ONLY) // needs a datum programmed to launch { ! if (hasDatum) { status = LAUNCHER_READY; *************** *** 649,682 **** return; } ! else if (meLaunchMode == TARGET_ONLY) { ! if (hasTarget) ! { ! status = LAUNCHER_READY; ! } ! else ! { ! status = NO_TARGET; ! } return; } ! // will launch and either proceed unguided or autonomously search out target ! if (meLaunchMode == AUTO) { ! bool hasDatum = (msDatum.mfLat_rad != 0) || (msDatum.mfLon_rad != 0); ! if ((!hasDatum) && (!hasTarget)) ! { ! status = NO_TARGET; ! } ! else ! { ! status = LAUNCHER_READY; ! } return; } // if running as multiplayer client, seeker track can't be checked so defer checking to server if (parent->IsClientMode()) --- 682,719 ---- return; } ! ! // all modes after here require a target ! if (!hasTarget) { ! status = NO_TARGET; return; } + tcSensorMapTrack track; + if (simState->GetTrack(mnTargetID, parent->GetAlliance(), track) == false) + { + mnTargetID = -1; // target wasn't found in alliance sensor map + status = NO_TARGET; + return; + } + + // verify that launcher is effective vs target type + if (!IsEffective(track.mnClassification)) + { + status = INVALID_TARGET; // or unknown classification? + return; + } + // TODO: verify that platform is within 1.5 x database maximum range + //float range_km = parent->mcKin.RangeToKm(track); + ! if ((meLaunchMode == TARGET_ONLY) || (meLaunchMode == AUTO)) { ! status = LAUNCHER_READY; return; } + // if running as multiplayer client, seeker track can't be checked so defer checking to server if (parent->IsClientMode()) *************** *** 699,707 **** if ((meLaunchMode == FC_TRACK)||(meLaunchMode == SEEKER_TRACK)) { - if (mnTargetID == NULL_INDEX) - { - status = NO_TARGET; // needs a target - return; - } if (!fireControlSensor) { --- 736,739 ---- *************** *** 715,719 **** return; } ! if (targetObj == NULL) { status = NOT_DETECTED_FC; // target doesn't exist --- 747,752 ---- return; } ! ! if (targetObj == 0) { status = NOT_DETECTED_FC; // target doesn't exist *************** *** 739,743 **** { tcMissileDBObject *pMissileDBObj = dynamic_cast<tcMissileDBObject*>(mpChildDBObj); ! if (pMissileDBObj==NULL) { std::cerr << "GetLauncherStatus -- Error: SEEKER_TRACK guidance with non-missile" << std::endl; --- 772,776 ---- { tcMissileDBObject *pMissileDBObj = dynamic_cast<tcMissileDBObject*>(mpChildDBObj); ! if (pMissileDBObj == 0) { std::cerr << "GetLauncherStatus -- Error: SEEKER_TRACK guidance with non-missile" << std::endl; *************** *** 832,835 **** --- 865,876 ---- return "Invalid launcher"; } + else if (statusCode == INVALID_TARGET) + { + return "Ineffective vs. target"; + } + else if (statusCode == OUT_OF_RANGE) + { + return "Out of range"; + } std::cerr << "Bad launcher status code"; Index: tcObjectControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcObjectControl.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** tcObjectControl.cpp 28 Jun 2005 02:51:35 -0000 1.40 --- tcObjectControl.cpp 30 Jun 2005 01:06:11 -0000 1.41 *************** *** 1806,1812 **** symbol.mfLon_rad = (float)mpHookedGameObj->mcKin.mfLon_rad; ! float fRangeX_rad = 2.0f*pRadarSS->mpDBObj->mfRefRange_km*C_KMTORAD/ cosf((float)mpHookedGameObj->mcKin.mfLat_rad); ! float fRangeY_rad = 2.0f*pRadarSS->mpDBObj->mfRefRange_km*C_KMTORAD; symbol.mfLatExtent_rad = fRangeY_rad; symbol.mfLonExtent_rad = fRangeX_rad; --- 1806,1812 ---- symbol.mfLon_rad = (float)mpHookedGameObj->mcKin.mfLon_rad; ! float fRangeX_rad = 2.0f*pRadarSS->mpDBObj->mfMaxRange_km*C_KMTORAD/ cosf((float)mpHookedGameObj->mcKin.mfLat_rad); ! float fRangeY_rad = 2.0f*pRadarSS->mpDBObj->mfMaxRange_km*C_KMTORAD; symbol.mfLatExtent_rad = fRangeY_rad; symbol.mfLonExtent_rad = fRangeX_rad; *************** *** 1876,1880 **** { range_km = torpDBObj->mfRange_km; ! color = 0xFF4020A0; } --- 1876,1880 ---- { range_km = torpDBObj->mfRange_km; ! color = 0xFF010130; } Index: tcStores.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcStores.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcStores.cpp 22 Jun 2005 01:22:10 -0000 1.6 --- tcStores.cpp 30 Jun 2005 01:06:11 -0000 1.7 *************** *** 296,300 **** } ! stores.push_back(StoreItem(item, quantity)); return true; } --- 296,303 ---- } ! if (quantity > 0) ! { ! stores.push_back(StoreItem(item, quantity)); ! } return true; } |
|
From: Dewitt C. <ddc...@us...> - 2005-06-30 01:06:22
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31770/src/graphics Modified Files: tc3DViewer.cpp tcMapView.cpp Log Message: Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** tcMapView.cpp 28 Jun 2005 02:51:34 -0000 1.29 --- tcMapView.cpp 30 Jun 2005 01:06:10 -0000 1.30 *************** *** 664,668 **** // draw top info string based on mnGameMode, this function should go elsewhere? strange to have in map ! osg::Vec4 color(0.3, 0.3, 0.5, 1); if (mnGameMode == GAMEMODE_NORMAL) --- 664,668 ---- // draw top info string based on mnGameMode, this function should go elsewhere? strange to have in map ! osg::Vec4 color(0.1, 0.1, 0.2, 1); if (mnGameMode == GAMEMODE_NORMAL) Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DViewer.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tc3DViewer.cpp 28 Jun 2005 02:51:34 -0000 1.19 --- tc3DViewer.cpp 30 Jun 2005 01:06:10 -0000 1.20 *************** *** 985,996 **** void tc3DViewer::UpdateCamera() { ! tcGameObject *obj = simState->GetObject(hookID); ! if (!obj) return; ! ! osg::Vec3 targetPosition; ! if (lookAtTarget || moveWithTarget) ! { ! targetPosition = GetObjectPosition(obj); ! } if (moveWithTarget) { --- 985,991 ---- void tc3DViewer::UpdateCamera() { ! unsigned int objClassification; ! osg::Vec3 targetPosition = GetHookedObjectPositionAndType(objClassification); ! if (moveWithTarget) { *************** *** 1032,1036 **** const unsigned int limitMask = (~PTYPE_FIXED) & 0xFFF0; ! if ((obj->mpDBObject->mnType & limitMask) != 0) { if (cameraPosition._v[2] < -480.0) cameraPosition._v[2] = -480.0; --- 1027,1031 ---- const unsigned int limitMask = (~PTYPE_FIXED) & 0xFFF0; ! if ((objClassification & limitMask) != 0) { if (cameraPosition._v[2] < -480.0) cameraPosition._v[2] = -480.0; *************** *** 1065,1069 **** } ! bool shakeEligible = ((obj->mpDBObject->mnType & (PTYPE_AIR | PTYPE_MISSILE)) != 0) && (cameraRange < 25.0f); if (shakeAirCamera && shakeEligible) --- 1060,1064 ---- } ! bool shakeEligible = ((objClassification & (PTYPE_AIR | PTYPE_MISSILE)) != 0) && (cameraRange < 25.0f); if (shakeAirCamera && shakeEligible) *************** *** 1125,1128 **** --- 1120,1124 ---- unsigned int i = 0; + bool use3Dcheat = tcOptions::Get()->mn3DCheatMode == 3; bool isServer = simState->IsMultiplayerServer(); *************** *** 1132,1136 **** simState->maPlatformState.GetNextAssoc(poolpos,nKey,gameObj); wxASSERT(gameObj->model); // model should be created with gameObj ! if (isServer || gameObj->IsOwnAlliance()) { if (gameObj->model->GetNumParents()==0) --- 1128,1132 ---- simState->maPlatformState.GetNextAssoc(poolpos,nKey,gameObj); wxASSERT(gameObj->model); // model should be created with gameObj ! if (isServer || gameObj->IsOwnAlliance() || use3Dcheat) { if (gameObj->model->GetNumParents()==0) *************** *** 1220,1227 **** * @return object position in world coordinates. */ ! osg::Vec3 tc3DViewer::GetObjectPosition(tcGameObject* obj) { int n3DCheatMode = tcOptions::Get()->mn3DCheatMode; float x, y, z; if (n3DCheatMode == 3) --- 1216,1232 ---- * @return object position in world coordinates. */ ! const osg::Vec3& tc3DViewer::GetHookedObjectPositionAndType(unsigned int& classification) { + static osg::Vec3 lastPos(0, 0, 0); + int n3DCheatMode = tcOptions::Get()->mn3DCheatMode; + tcGameObject* obj = simState->GetObject(hookID); + if (obj == 0) + { + classification = 0; + return lastPos; + } + float x, y, z; if (n3DCheatMode == 3) *************** *** 1251,1262 **** } else ! { ! x = LonToX(obj->mcKin.mfLon_rad); ! y = LatToY(obj->mcKin.mfLat_rad); ! z = obj->mcKin.mfAlt_m; } } ! return osg::Vec3(x,y,z); } --- 1256,1268 ---- } else ! { ! x = lastPos._v[0]; ! y = lastPos._v[1]; ! z = lastPos._v[2]; } } ! lastPos.set(x, y, z); ! return lastPos; } |
|
From: Dewitt C. <ddc...@us...> - 2005-06-30 01:06:22
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31770/src/scriptinterface Modified Files: tcPlatformInterface.cpp Log Message: Index: tcPlatformInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterface.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** tcPlatformInterface.cpp 22 Jun 2005 01:22:08 -0000 1.47 --- tcPlatformInterface.cpp 30 Jun 2005 01:06:10 -0000 1.48 *************** *** 317,325 **** bool tcPlatformInterface::IsLauncherEffective(int anLauncher) { ! tcLauncherInfo info; ! if (GetLauncherInfo(info, anLauncher) == false) ! { ! return false; ! } tcSensorMapTrack track; if (GetTargetTrack(track) == false) --- 317,323 ---- bool tcPlatformInterface::IsLauncherEffective(int anLauncher) { ! tcLauncher* pLauncher = mpPlatformObj->GetLauncher(anLauncher); ! if (pLauncher == 0) return false; // bad launcher index ! tcSensorMapTrack track; if (GetTargetTrack(track) == false) *************** *** 327,351 **** return false; } ! if ((track.mnClassification & PTYPE_SURFACE)&&(info.mnTargetFlags & SURFACE_TARGET)) ! { ! return true; ! } ! if ((track.mnClassification & PTYPE_AIR)&&(info.mnTargetFlags & AIR_TARGET)) ! { ! return true; ! } ! if ((track.mnClassification & PTYPE_MISSILE)&&(info.mnTargetFlags & MISSILE_TARGET)) ! { ! return true; ! } ! if ((track.mnClassification & PTYPE_FIXED)&&(info.mnTargetFlags & LAND_TARGET)) ! { ! return true; ! } ! if ((track.mnClassification & PTYPE_SUBMARINE)&&(info.mnTargetFlags & SUBSURFACE_TARGET)) ! { ! return true; ! } ! return false; } --- 325,330 ---- return false; } ! ! return pLauncher->IsEffective(track.mnClassification); } *************** *** 493,509 **** } ! bool tcPlatformInterface::GetLauncherInfo(tcLauncherInfo& info, int anLauncher) { info.mnLauncher = -1; info.launcherStatus = tcLauncher::LAUNCHER_BUSY; ! int nCount = GetLauncherCount(); ! if ((anLauncher < 0)||(anLauncher >= nCount)) ! { ! return false; ! } ! ! tcLauncher* pLauncher = mpPlatformObj->mcLauncherState.GetLauncher(anLauncher); ! wxASSERT(pLauncher); info.launcherStatus = pLauncher->GetLauncherStatus(); --- 472,487 ---- } ! bool tcPlatformInterface::GetLauncherInfo(scriptinterface::tcLauncherInfo& info, int anLauncher) { info.mnLauncher = -1; info.launcherStatus = tcLauncher::LAUNCHER_BUSY; + ! tcLauncher* pLauncher = mpPlatformObj->GetLauncher(anLauncher); ! if (pLauncher == 0) ! { ! wxASSERT(false); ! return false; ! } info.launcherStatus = pLauncher->GetLauncherStatus(); |
|
From: Dewitt C. <ddc...@us...> - 2005-06-30 01:06:21
|
Update of /cvsroot/gcblue/gcb_wx/scenarios In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31770/scenarios Modified Files: TaiwanTest.py Log Message: Index: TaiwanTest.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scenarios/TaiwanTest.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TaiwanTest.py 22 Jun 2005 01:23:39 -0000 1.1 --- TaiwanTest.py 30 Jun 2005 01:06:09 -0000 1.2 *************** *** 12,16 **** SM.SetScenarioDescription('Taiwan test scenario 2') SM.SetScenarioLoaded(1) ! SM.SetScenarioName('Taiwan Test 2') SM.SetDateTime(2005, 8, 12, 10, 0, 0) SM.SetStartTheater(120, 25) # (lon, lat) in degrees, negative is West or South --- 12,16 ---- SM.SetScenarioDescription('Taiwan test scenario 2') SM.SetScenarioLoaded(1) ! SM.SetScenarioName('Taiwan Test') SM.SetDateTime(2005, 8, 12, 10, 0, 0) SM.SetStartTheater(120, 25) # (lon, lat) in degrees, negative is West or South *************** *** 24,86 **** ### Alliance A (Taiwan) units - AddAirbase(SM, 'Cha Shan AB', 121.617, 24.0167, 0, alliance_a) - AddAircraftToBase(SM, 'Cha Shan AB', 'F-16C', 'Tiger', 8) - AddAirbase(SM, 'Chiayi AB', 120.392778, 23.461667, 0, alliance_a) - AddAircraftToBase(SM, 'Chiayi AB', 'F-16C', 'Cougar', 8) - AddAirbase(SM, 'Ching Chuan Kang AB', 120.620556, 24.264444, 0, alliance_a) - AddAircraftToBase(SM, 'Ching Chuan Kang AB', 'F-16C', 'Skunk', 8) - AddAirbase(SM, 'Hsinchu AB', 120.939167, 24.818056, 0, alliance_a) - AddAircraftToBase(SM, 'Hsinchu AB', 'F-16C', 'Frog', 8) - AddAirbase(SM, 'Pingtung AB North', 120.477778, 22.695278, 0, alliance_a) - AddAircraftToBase(SM, 'Pingtung AB North', 'F-16C', 'Squirrel', 8) - AddAirbase(SM, 'Pingtung AB South', 120.461667, 22.672222, 0, alliance_a) - AddAircraftToBase(SM, 'Pingtung AB South', 'F-16C', 'Lion', 8) - AddAirbase(SM, 'Tainan AB', 120.205556, 22.950278, 0, alliance_a) - AddAircraftToBase(SM, 'Tainan AB', 'F-16C', 'Rabbit', 8) - AddAirbase(SM, 'Taitung AB', 121.181944, 22.793056, 0, alliance_a) - AddAircraftToBase(SM, 'Taitung AB', 'F-16C', 'Dragon', 8) ! ! ### Alliance B (China) units ! AddAirbase(SM, 'Longtian AB', 119.417, 25.583, 0, alliance_b) ! AddAircraftToBase(SM, 'Longtian AB', 'Su-27', 'Laser', 8) ! AddAirbase(SM, 'Fuzhou AB', 119.367, 26.0167, 0, alliance_b) ! AddAircraftToBase(SM, 'Fuzhou AB', 'Su-30MKK', 'Dancer', 8) ! - AddAirbase(SM, 'Chin Chiang AB', 118.583, 24.783, 0, alliance_b) - AddAircraftToBase(SM, 'Chin Chiang AB', 'Su-27', 'Thunder', 8) - AddAirbase(SM, 'Chang-Chou AB', 117.667, 24.583, 0, alliance_b) - AddAircraftToBase(SM, 'Chang-Chou AB', 'Su-27', 'Pacer', 8) ! AddAirbase(SM, 'Shantou AB', 116.75, 23.417, 0, alliance_b) ! AddAircraftToBase(SM, 'Shantou AB', 'Su-30MKK', 'Hunter', 8) ! AddAirbase(SM, 'Mei-Xian AB', 116.133, 24.25, 0, alliance_b) ! AddAircraftToBase(SM, 'Mei-Xian AB', 'Su-27', 'Dagger', 8) unit = SM.GetDefaultUnit() --- 24,170 ---- ### Alliance A (Taiwan) units + baseName = 'Cha Shan AB' + AddAirbase(SM, baseName, 121.617, 24.0167, 0, alliance_a) + AddAircraftToBase(SM, baseName, 'F-16C', 'Tiger', 8) + AddDefaultTaiwanStores(SM, baseName) + baseName = 'Chiayi AB' + AddAirbase(SM, baseName, 120.392778, 23.461667, 0, alliance_a) + AddAircraftToBase(SM, baseName, 'F-16C', 'Cougar', 8) + AddDefaultTaiwanStores(SM, baseName) + baseName = 'Ching Chuan Kang AB' + AddAirbase(SM, baseName, 120.620556, 24.264444, 0, alliance_a) + AddAircraftToBase(SM, baseName, 'F-16C', 'Skunk', 8) + AddDefaultTaiwanStores(SM, baseName) + baseName = 'Hsinchu AB' + AddAirbase(SM, baseName, 120.939167, 24.818056, 0, alliance_a) + AddAircraftToBase(SM, baseName, 'F-16C', 'Frog', 8) + AddDefaultTaiwanStores(SM, baseName) + baseName = 'Pingtung AB North' + AddAirbase(SM, baseName, 120.477778, 22.695278, 0, alliance_a) + AddAircraftToBase(SM, baseName, 'F-16C', 'Squirrel', 8) + AddDefaultTaiwanStores(SM, baseName) + baseName = 'Taitung AB' + AddAirbase(SM, baseName, 121.181944, 22.793056, 0, alliance_a) + AddAircraftToBase(SM, baseName, 'F-16C', 'Dragon', 8) + #AddAirbase(SM, 'Pingtung AB South', 120.461667, 22.672222, 0, alliance_a) + #AddAircraftToBase(SM, 'Pingtung AB South', 'F-16C', 'Lion', 8) + #AddAirbase(SM, 'Tainan AB', 120.205556, 22.950278, 0, alliance_a) + #AddAircraftToBase(SM, 'Tainan AB', 'F-16C', 'Rabbit', 8) + unit = SM.GetDefaultUnit() + unit.className = 'E2-C' + unit.unitName = 'Look-2' + unit.SetPosition(120.0, 24.0, 1500) # lon, lat, alt + unit.heading = 290 + unit.speed = 150 + unit.throttle = 0.8 + SM.AddUnitToAlliance(unit, alliance_a) + UI = SM.GetUnitInterface(unit.unitName) + if (alliance_a == 2): + UI.AddTask('Patrol', 2.0) ! unit = SM.GetDefaultUnit() ! unit.className = 'F-16C' ! unit.unitName = 'Bug-2' ! unit.SetPosition(120.0, 24.1, 5500) # lon, lat, alt ! unit.heading = 290 ! unit.speed = 450 ! unit.throttle = 0.8 ! SM.AddUnitToAlliance(unit, alliance_a) ! UI = SM.GetUnitInterface(unit.unitName) ! if (alliance_a == 2): ! UI.AddTask('Patrol', 2.0) ! unit = SM.GetDefaultUnit() ! unit.className = 'Hai Lung SS' ! unit.unitName = 'Hai Lung' ! unit.SetPosition(120.0, 24.7, -18) # lon, lat, alt ! unit.heading = 350 ! unit.speed = 3 ! SM.AddUnitToAlliance(unit, alliance_a) ! UI = SM.GetUnitInterface(unit.unitName) ! if (alliance_a == 2): ! UI.AddTask('Patrol', 2.0) + unit = SM.GetDefaultUnit() + unit.className = 'Tien Kung-II' + unit.unitName = 'Sky Bow-1' + unit.SetPosition(120.4, 23.0, 0) # lon, lat, alt + unit.heading = 0 + unit.speed = 0 + SM.AddUnitToAlliance(unit, alliance_a) + UI = SM.GetUnitInterface(unit.unitName) + if (alliance_a == 2): + UI.AddTask('Patrol', 2.0) + UI.AddTask('EngageAll', 3.0) ! unit = SM.GetDefaultUnit() ! unit.className = 'Cheng Kung FFG' ! unit.unitName = 'Cheng Kung' ! unit.SetPosition(120.1, 24.2, 0) # lon, lat, alt ! unit.heading = 300 ! unit.speed = 12 ! SM.AddUnitToAlliance(unit, alliance_a) ! SM.AddUnitToFlightDeck(unit.unitName, 'SH-60B', 'Ferret-1', 3) ! SM.AddUnitToFlightDeck(unit.unitName, 'SH-60B', 'Ferret-2', 3) ! SM.AddToUnitMagazine(unit.unitName, 'Fuel', 50000) ! SM.AddToUnitMagazine(unit.unitName, '76mm Mk-75', 300) ! SM.AddToUnitMagazine(unit.unitName, 'Mk-46 Mod5', 16) ! SM.AddToUnitMagazine(unit.unitName, 'DICASS Sonobuoy', 48) ! UI = SM.GetUnitInterface(unit.unitName) ! if (alliance_a == 2): ! UI.AddTask('Patrol', 2.0) ! UI.AddTask('EngageAll', 3.0) + ### Alliance B (China) units ! baseName = 'Longtian AB' ! AddAirbase(SM, baseName, 119.417, 25.583, 0, alliance_b) ! AddAircraftToBase(SM, baseName, 'Su-27', 'Laser', 8) ! AddDefaultChinaStores(SM, baseName) + baseName = 'Fuzhou AB' + AddAirbase(SM, baseName, 119.367, 26.0167, 0, alliance_b) + AddAircraftToBase(SM, baseName, 'Su-30MKK', 'Dancer', 8) + AddDefaultChinaStores(SM, baseName) ! baseName = 'Chin Chiang AB' ! AddAirbase(SM, baseName, 118.583, 24.783, 0, alliance_b) ! AddAircraftToBase(SM, baseName, 'Su-27', 'Thunder', 8) ! AddDefaultChinaStores(SM, baseName) ! ! baseName = 'Chang-Chou AB' ! AddAirbase(SM, baseName, 117.667, 24.583, 0, alliance_b) ! AddAircraftToBase(SM, baseName, 'Su-27', 'Pacer', 8) ! AddDefaultChinaStores(SM, baseName) ! ! baseName = 'Shantou AB' ! AddAirbase(SM, baseName, 116.75, 23.417, 0, alliance_b) ! AddAircraftToBase(SM, baseName, 'Su-30MKK', 'Hunter', 8) ! AddDefaultChinaStores(SM, baseName) ! ! baseName = 'Mei-Xian AB' ! AddAirbase(SM, baseName, 116.133, 24.25, 0, alliance_b) ! AddAircraftToBase(SM, baseName, 'Su-27', 'Dagger', 8) ! AddDefaultChinaStores(SM, baseName) unit = SM.GetDefaultUnit() *************** *** 108,111 **** --- 192,216 ---- + unit = SM.GetDefaultUnit() + unit.className = 'Sovremenny DDG' + unit.unitName = 'Hangzhou' + unit.SetPosition(120.0, 25.0, 0) # lon, lat, alt + unit.heading = 180 + unit.speed = 30 + + SM.AddUnitToAlliance(unit, alliance_b) + SM.AddUnitToFlightDeck(unit.unitName, 'Ka-27A', 'Hunter-1', 3) + SM.AddToUnitMagazine(unit.unitName, 'Fuel', 50000) + SM.AddToUnitMagazine(unit.unitName, 'AT-2M', 10) + SM.AddToUnitMagazine(unit.unitName, 'DICASS Sonobuoy', 10) + + + UI = SM.GetUnitInterface(unit.unitName) + if (alliance_b == 2): + UI.AddTask('Patrol', 2.0) + + + CreateBriefing(SM) + ### Add goals for each side AddGoals(SM, alliance_a, alliance_b) *************** *** 131,134 **** --- 236,255 ---- SM.AddUnitToFlightDeck(base_name, aircraft_class, unitName, 3) + # default stores for Taiwan airbase + def AddDefaultTaiwanStores(SM, base_name): + SM.AddToUnitMagazine(base_name, 'AGM-65D', 40) + SM.AddToUnitMagazine(base_name, 'AGM-88', 40) + SM.AddToUnitMagazine(base_name, 'AIM-9M', 40) + SM.AddToUnitMagazine(base_name, 'AIM-120C', 40) + SM.AddToUnitMagazine(base_name, 'Fuel', 100000) + + + # default stores for China airbase + def AddDefaultChinaStores(SM, base_name): + SM.AddToUnitMagazine(base_name, 'R-27R', 40) + SM.AddToUnitMagazine(base_name, 'R-73M', 40) + SM.AddToUnitMagazine(base_name, 'Fuel', 100000) + + def AddGoals(SM, side_a, side_b): *************** *** 174,182 **** # Taiwan airbases SM.OverlayText('Cha Shan AB', 121.617, 24.0167) ! SM.OverlayText('Chiayi AB', 120.392778, 23.461667) SM.OverlayText('Ching Chuan Kang AB', 120.620556, 24.264444) SM.OverlayText('Hsinchu AB', 120.939167, 24.818056) SM.OverlayText('Pingtung AB North', 120.477778, 22.695278) ! SM.OverlayText('Pingtung AB South', 120.461667, 22.672222) SM.OverlayText('Tainan AB', 120.205556, 22.950278) SM.OverlayText('Taitung AB', 121.181944, 22.793056) --- 295,303 ---- # Taiwan airbases SM.OverlayText('Cha Shan AB', 121.617, 24.0167) ! #SM.OverlayText('Chiayi AB', 120.392778, 23.461667) SM.OverlayText('Ching Chuan Kang AB', 120.620556, 24.264444) SM.OverlayText('Hsinchu AB', 120.939167, 24.818056) SM.OverlayText('Pingtung AB North', 120.477778, 22.695278) ! #SM.OverlayText('Pingtung AB South', 120.461667, 22.672222) SM.OverlayText('Tainan AB', 120.205556, 22.950278) SM.OverlayText('Taitung AB', 121.181944, 22.793056) |
|
From: Dewitt C. <ddc...@us...> - 2005-06-30 01:06:21
|
Update of /cvsroot/gcblue/gcb_wx/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31770/xml Modified Files: info_console.xml options.xml Log Message: Index: options.xml =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/xml/options.xml,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** options.xml 17 May 2005 00:20:41 -0000 1.18 --- options.xml 30 Jun 2005 01:06:12 -0000 1.19 *************** *** 1,7 **** <Options> ! <HostAddress>192.168.0.101</HostAddress> <DisplaySettings>default</DisplaySettings> ! <LastScenarioPath>GroundSAMTest.py</LastScenarioPath> ! <LastScenarioName>GroundSAMTest</LastScenarioName> <noCopyDatabase /> <noWriteXmlDatabase /> --- 1,7 ---- <Options> ! <HostAddress>192.168.0.100</HostAddress> <DisplaySettings>default</DisplaySettings> ! <LastScenarioPath>TaiwanTest.py</LastScenarioPath> ! <LastScenarioName>TaiwanTest</LastScenarioName> <noCopyDatabase /> <noWriteXmlDatabase /> *************** *** 10,13 **** --- 10,14 ---- <AutoKillAssessment /> <ShakeAirCamera /> + <ShowPythonErrors /> <UserName>Dewitt</UserName> </Options> Index: info_console.xml =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/xml/info_console.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** info_console.xml 23 Nov 2004 23:31:18 -0000 1.5 --- info_console.xml 30 Jun 2005 01:06:12 -0000 1.6 *************** *** 1,5 **** <Window> ! <TextBox TopMargin="2" BottomMargin="2" Wrap="34" DrawBorder="0" FontSize="12"/> </Window> \ No newline at end of file --- 1,5 ---- <Window> ! <TextBox TopMargin="2" BottomMargin="2" Wrap="28" DrawBorder="0" FontSize="12"/> </Window> \ No newline at end of file |
|
From: Dewitt C. <ddc...@us...> - 2005-06-28 02:51:44
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6347/src/scriptinterface Modified Files: tcScenarioInterface.cpp Log Message: Index: tcScenarioInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcScenarioInterface.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** tcScenarioInterface.cpp 22 Jun 2005 01:22:08 -0000 1.29 --- tcScenarioInterface.cpp 28 Jun 2005 02:51:34 -0000 1.30 *************** *** 798,802 **** tcScenarioInterface::tcScenarioInterface() : lon_theater_deg(0), ! lat_theater_deg(0) { } --- 798,803 ---- tcScenarioInterface::tcScenarioInterface() : lon_theater_deg(0), ! lat_theater_deg(0), ! eventTime(0) { } |
|
From: Dewitt C. <ddc...@us...> - 2005-06-28 02:51:44
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6347/src/graphics Modified Files: tc3DViewer.cpp tcGameView.cpp tcMapView.cpp tcOOBView.cpp tcPlatformGui.cpp Log Message: Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** tcMapView.cpp 22 Jun 2005 01:22:08 -0000 1.28 --- tcMapView.cpp 28 Jun 2005 02:51:34 -0000 1.29 *************** *** 664,668 **** // draw top info string based on mnGameMode, this function should go elsewhere? strange to have in map ! osg::Vec4 color(1, 1, 1, 1); if (mnGameMode == GAMEMODE_NORMAL) --- 664,668 ---- // draw top info string based on mnGameMode, this function should go elsewhere? strange to have in map ! osg::Vec4 color(0.3, 0.3, 0.5, 1); if (mnGameMode == GAMEMODE_NORMAL) *************** *** 2077,2081 **** } ! /***********************************************************************************/ long tcTacticalMapView::HookSecondary(wxPoint pscreen) { --- 2077,2083 ---- } ! /** ! * ! */ long tcTacticalMapView::HookSecondary(wxPoint pscreen) { *************** *** 2102,2110 **** } ! /***********************************************************************************/ long tcTacticalMapView::GetClosest(wxPoint pscreen) { tcMapObj *pMO; ! tcPoint geopoint = ScreenToGeo(pscreen), geopointi; float fHookDistance,fMinDistance,fDistance; long nMinID; --- 2104,2115 ---- } ! /** ! * ! */ long tcTacticalMapView::GetClosest(wxPoint pscreen) { tcMapObj *pMO; ! tcPoint geopoint = ScreenToGeo(pscreen); ! tcPoint geopointi; float fHookDistance,fMinDistance,fDistance; long nMinID; *************** *** 2117,2121 **** { pMO = &maMapObj[i]; ! if (pMO->mbExists) { geopointi.x = pMO->mfLon; --- 2122,2126 ---- { pMO = &maMapObj[i]; ! if ((pMO->mbExists) && (pMO->mnID != -1)) { geopointi.x = pMO->mfLon; *************** *** 2796,2802 **** { // center on requested location ! const float c1 = 0.5f * C_180OVERPI; ! lon_deg -= c1 * mrectTheater.Width(); ! lat_deg += c1 * mrectTheater.Height(); wxCommandEvent command(wxEVT_COMMAND_BUTTON_CLICKED, ID_SETTHEATER) ; --- 2801,2811 ---- { // center on requested location ! //const float c1 = 0.5f * C_180OVERPI; ! //lon_deg -= c1 * mrectTheater.Width(); ! //lat_deg += c1 * mrectTheater.Height(); ! ! lon_deg -= 0.5f * mpMapData->GetTheaterWidthDeg(); ! lat_deg += 0.5f * mpMapData->GetTheaterHeightDeg(); ! wxCommandEvent command(wxEVT_COMMAND_BUTTON_CLICKED, ID_SETTHEATER) ; Index: tcGameView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcGameView.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcGameView.cpp 25 Jun 2005 22:10:35 -0000 1.12 --- tcGameView.cpp 28 Jun 2005 02:51:34 -0000 1.13 *************** *** 573,577 **** } ! /******************************************************************************/ /** * add truth data to view for objects matching anAlliance --- 573,577 ---- } ! /** * add truth data to view for objects matching anAlliance Index: tcPlatformGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcPlatformGui.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcPlatformGui.cpp 22 Jun 2005 01:22:08 -0000 1.3 --- tcPlatformGui.cpp 28 Jun 2005 02:51:34 -0000 1.4 *************** *** 223,227 **** tcFlightOpsObject* tcPlatformGui::GetFlightOps() { ! return dynamic_cast<tcFlightOpsObject*>(tcSimState::Get()->GetObject(platformId)); } --- 223,234 ---- tcFlightOpsObject* tcPlatformGui::GetFlightOps() { ! if (hostId != -1) ! { ! return 0; ! } ! else ! { ! return dynamic_cast<tcFlightOpsObject*>(tcSimState::Get()->GetObject(platformId)); ! } } Index: tcOOBView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcOOBView.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcOOBView.cpp 1 Jun 2005 00:13:31 -0000 1.8 --- tcOOBView.cpp 28 Jun 2005 02:51:34 -0000 1.9 *************** *** 31,34 **** --- 31,35 ---- #include "tcSimState.h" #include "tcSound.h" + #include "tcAirfieldObject.h" #include "tcHeloObject.h" #include "tcSubObject.h" *************** *** 93,96 **** --- 94,98 ---- surfaceObj.clear(); airObj.clear(); + carrierObj.clear(); flightopsObj.clear(); heloObj.clear(); *************** *** 130,136 **** airObj.push_back(info); } ! else if (dynamic_cast<tcFlightOpsObject*>(platformObj)) { ! flightopsObj.push_back(info); } else if (dynamic_cast<tcSurfaceObject*>(platformObj)) --- 132,152 ---- airObj.push_back(info); } ! else if (tcFlightOpsObject* flightOps = dynamic_cast<tcFlightOpsObject*>(platformObj)) { ! if (dynamic_cast<tcAirfieldObject*>(platformObj)) ! { ! flightopsObj.push_back(info); ! } ! else ! { ! if (flightOps->GetFlightPort()->GetHangarCapacity() > 3) ! { ! carrierObj.push_back(info); ! } ! else ! { ! surfaceObj.push_back(info); ! } ! } } else if (dynamic_cast<tcSurfaceObject*>(platformObj)) *************** *** 292,295 **** --- 308,314 ---- y += 2*mfRowSpacing; + UpdateRectCategory(carrierObj, y, stopy); + y += 2*mfRowSpacing; + UpdateRectCategory(flightopsObj, y, stopy); } *************** *** 447,458 **** DrawCategory(heloObj, stopy); ! yheader = GetCategoryY(flightopsObj); if (yheader > 0) { color.set(0.88f, 0.88f, 0.6f, 1.0f); ! DrawTextR("* CVs and Airfields", mfXOffset, yheader - 5.0f, defaultFont.get(), color, fontSize, LEFT_BASE_LINE); } DrawCategory(flightopsObj, stopy); } --- 466,485 ---- DrawCategory(heloObj, stopy); ! yheader = GetCategoryY(carrierObj); if (yheader > 0) { color.set(0.88f, 0.88f, 0.6f, 1.0f); ! DrawTextR("* Carriers", mfXOffset, yheader - 5.0f, defaultFont.get(), color, fontSize, LEFT_BASE_LINE); } + DrawCategory(carrierObj, stopy); + yheader = GetCategoryY(flightopsObj); + if (yheader > 0) + { + color.set(0.88f, 0.88f, 0.6f, 1.0f); + DrawTextR("* Airfields", mfXOffset, yheader - 5.0f, defaultFont.get(), + color, fontSize, LEFT_BASE_LINE); + } DrawCategory(flightopsObj, stopy); } Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DViewer.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tc3DViewer.cpp 22 Jun 2005 01:22:08 -0000 1.18 --- tc3DViewer.cpp 28 Jun 2005 02:51:34 -0000 1.19 *************** *** 1162,1165 **** --- 1162,1166 ---- if (model->GetNumParents() == 0) { + model->SetupUpdate(track); worldObjects->addChild(model->GetNode().get()); } |
|
From: Dewitt C. <ddc...@us...> - 2005-06-28 02:51:44
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6347/src/database Modified Files: tcDatabase.cpp tcGenericDBObject.cpp tcRadarDBObject.cpp tcSensorDBObject.cpp tcSonarDBObject.cpp Log Message: Index: tcSonarDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcSonarDBObject.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcSonarDBObject.cpp 1 Jun 2005 00:13:29 -0000 1.3 --- tcSonarDBObject.cpp 28 Jun 2005 02:51:34 -0000 1.4 *************** *** 31,35 **** #include "database/tcSqlReader.h" #include <sstream> - //#include "tcSonar.h" #ifdef _DEBUG --- 31,34 ---- *************** *** 142,147 **** localNode->SetAttribute("SL", SL); localNode->SetAttribute("DI", DI); - localNode->SetAttribute("DT", DT); - localNode->SetAttribute("DTr", DTr); localNode->SetAttribute("minFrequency_Hz", minFrequency_Hz); localNode->SetAttribute("maxFrequency_Hz", maxFrequency_Hz); --- 141,144 ---- *************** *** 165,170 **** columnString += "SL number(4),"; columnString += "DI number(4),"; - columnString += "DT number(4),"; - columnString += "DTr number(4),"; columnString += "minFrequency_Hz number(5),"; columnString += "maxFrequency_Hz number(5),"; --- 162,165 ---- *************** *** 174,178 **** columnString += "maxScope_m number(4),"; columnString += "isWakeHoming number(1),"; - columnString += "applyScanLoss number(1),"; columnString += "bearingResolution_deg number(5),"; --- 169,172 ---- *************** *** 186,191 **** SL = entry.GetDouble("SL"); DI = entry.GetDouble("DI"); - DT = entry.GetDouble("DT"); - DTr = entry.GetDouble("DTr"); minFrequency_Hz = entry.GetDouble("minFrequency_Hz"); maxFrequency_Hz = entry.GetDouble("maxFrequency_Hz"); --- 180,183 ---- *************** *** 196,200 **** maxScope_m = entry.GetDouble("maxScope_m"); isWakeHoming = entry.GetInt("isWakeHoming") != 0; - applyScanLoss = entry.GetInt("applyScanLoss") != 0; bearingResolution_deg = entry.GetDouble("bearingResolution_deg"); --- 188,191 ---- *************** *** 212,217 **** s << SL << ","; s << DI << ","; - s << DT << ","; - s << DTr << ","; s << minFrequency_Hz << ","; s << maxFrequency_Hz << ","; --- 203,206 ---- *************** *** 222,226 **** s << maxScope_m << ","; s << (long)isWakeHoming << ","; - s << (long)applyScanLoss << ","; s << bearingResolution_deg << ","; --- 211,214 ---- *************** *** 234,239 **** SL(10), DI(3), - DT(3), - DTr(3), minFrequency_Hz(2000), maxFrequency_Hz(3000), --- 222,225 ---- *************** *** 243,247 **** maxScope_m(0), isWakeHoming(false), - applyScanLoss(false), bearingResolution_deg(5.0f) { --- 229,232 ---- *************** *** 259,264 **** SL(obj.SL), DI(obj.DI), - DT(obj.DT), - DTr(obj.DTr), minFrequency_Hz(obj.minFrequency_Hz), maxFrequency_Hz(obj.maxFrequency_Hz), --- 244,247 ---- *************** *** 268,272 **** maxScope_m(obj.maxScope_m), isWakeHoming(obj.isWakeHoming), - applyScanLoss(obj.applyScanLoss), bearingResolution_deg(obj.bearingResolution_deg) { --- 251,254 ---- Index: tcSensorDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcSensorDBObject.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcSensorDBObject.cpp 22 Jun 2005 01:22:08 -0000 1.13 --- tcSensorDBObject.cpp 28 Jun 2005 02:51:34 -0000 1.14 *************** *** 50,61 **** return 0; } ! /** ! * workaround for write serialization issue ! * @return true if db obj is a leaf obj ! */ ! bool tcSensorDBObject::IsLeaf() const ! { ! return mnClassID == DTYPE_SENSOR; ! } --- 50,62 ---- return 0; } ! ! /** ! * workaround for write serialization issue ! * @return true if db obj is a leaf obj ! */ ! bool tcSensorDBObject::IsLeaf() const ! { ! return mnClassID == DTYPE_SENSOR; ! } Index: tcRadarDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcRadarDBObject.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcRadarDBObject.cpp 1 Jun 2005 00:13:29 -0000 1.16 --- tcRadarDBObject.cpp 28 Jun 2005 02:51:34 -0000 1.17 *************** *** 80,89 **** { file.Read(&mfMaxRange_km,sizeof(mfMaxRange_km)); - file.Read(&mfMinRange_km,sizeof(mfMinRange_km)); file.Read(&mfRefRange_km,sizeof(mfRefRange_km)); file.Read(&mfERP_dBW,sizeof(mfERP_dBW)); file.Read(&mfFieldOfView_deg,sizeof(mfFieldOfView_deg)); file.Read(&mfScanPeriod_s,sizeof(mfScanPeriod_s)); - file.Read(&mfMinRangeRate_mps,sizeof(mfMinRangeRate_mps)); file.Read(&mbDetectsSurface,sizeof(mbDetectsSurface)); file.Read(&mbDetectsAir,sizeof(mbDetectsAir)); --- 80,87 ---- *************** *** 94,103 **** { file.Write(&mfMaxRange_km,sizeof(mfMaxRange_km)); - file.Write(&mfMinRange_km,sizeof(mfMinRange_km)); file.Write(&mfRefRange_km,sizeof(mfRefRange_km)); file.Write(&mfERP_dBW,sizeof(mfERP_dBW)); file.Write(&mfFieldOfView_deg,sizeof(mfFieldOfView_deg)); file.Write(&mfScanPeriod_s,sizeof(mfScanPeriod_s)); - file.Write(&mfMinRangeRate_mps,sizeof(mfMinRangeRate_mps)); file.Write(&mbDetectsSurface,sizeof(mbDetectsSurface)); file.Write(&mbDetectsAir,sizeof(mbDetectsAir)); --- 92,99 ---- *************** *** 112,118 **** if (mbLoad) { - file.Read(&mfMinRange_km,sizeof(mfMinRange_km)); file.Read(&mfERP_dBW,sizeof(mfERP_dBW)); - file.Read(&mfMinRangeRate_mps,sizeof(mfMinRangeRate_mps)); file.Read(&mbDetectsSurface,sizeof(mbDetectsSurface)); file.Read(&mbDetectsAir,sizeof(mbDetectsAir)); --- 108,112 ---- *************** *** 121,127 **** else { - file.Write(&mfMinRange_km,sizeof(mfMinRange_km)); file.Write(&mfERP_dBW,sizeof(mfERP_dBW)); - file.Write(&mfMinRangeRate_mps,sizeof(mfMinRangeRate_mps)); file.Write(&mbDetectsSurface,sizeof(mbDetectsSurface)); file.Write(&mbDetectsAir,sizeof(mbDetectsAir)); --- 115,119 ---- *************** *** 139,145 **** int val; - *csv >> mfMinRange_km; *csv >> mfERP_dBW; - *csv >> mfMinRangeRate_mps; *csv >> maxFireControlTracks; *csv >> val; isSemiactive = val != 0; --- 131,135 ---- *************** *** 151,157 **** else { - *csv << mfMinRange_km; *csv << mfERP_dBW; - *csv << mfMinRangeRate_mps; *csv << (long)maxFireControlTracks; *csv << (long)isSemiactive; --- 141,145 ---- *************** *** 176,182 **** 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); --- 164,168 ---- *************** *** 193,199 **** tcSensorDBObject::WriteCSVHeader(csv); - *csv << "MinRange_km"; *csv << "ERP_dBW"; - *csv << "MinRangeRate_mps"; *csv << "MaxFireControlTracks"; *csv << "IsSemiactive"; --- 179,183 ---- *************** *** 217,223 **** columnString += ","; - columnString += "MinRange_km number(5),"; columnString += "ERP_dBW number(3),"; - columnString += "MinRangeRate_mps number(5),"; columnString += "MaxFireControlTracks number(3),"; columnString += "IsSemiactive number(1),"; --- 201,205 ---- *************** *** 232,238 **** tcSensorDBObject::ReadSql(entry); - mfMinRange_km = entry.GetDouble("MinRange_km"); mfERP_dBW = entry.GetDouble("ERP_dBW"); - mfMinRangeRate_mps = entry.GetDouble("MinRangeRate_mps"); maxFireControlTracks = entry.GetInt("MaxFireControlTracks"); isSemiactive = entry.GetInt("IsSemiactive") != 0; --- 214,218 ---- *************** *** 252,258 **** s << ","; - s << mfMinRange_km << ","; s << mfERP_dBW << ","; - s << mfMinRangeRate_mps << ","; s << (long)maxFireControlTracks << ","; s << (long)isSemiactive << ","; --- 232,236 ---- *************** *** 271,280 **** mnClassID = DTYPE_RADAR; mfMaxRange_km = 100.0f; - mfMinRange_km = 0.1f; mfRefRange_km = 50.0f; mfERP_dBW = 100.0f; mfFieldOfView_deg = 90.0f; mfScanPeriod_s = 4.0f; - mfMinRangeRate_mps = 0.0f; mbDetectsSurface = true; mbDetectsAir = true; --- 249,256 ---- *************** *** 287,294 **** : tcSensorDBObject(obj) { ! mnClassID = DTYPE_RADAR; ! mfMinRange_km = obj.mfMinRange_km; mfERP_dBW = obj.mfERP_dBW; - mfMinRangeRate_mps = obj.mfMinRangeRate_mps; mbDetectsSurface = obj.mbDetectsSurface; mbDetectsAir = obj.mbDetectsAir; --- 263,268 ---- : tcSensorDBObject(obj) { ! mnClassID = DTYPE_RADAR; mfERP_dBW = obj.mfERP_dBW; mbDetectsSurface = obj.mbDetectsSurface; mbDetectsAir = obj.mbDetectsAir; Index: tcGenericDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcGenericDBObject.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** tcGenericDBObject.cpp 1 Jun 2005 00:13:29 -0000 1.22 --- tcGenericDBObject.cpp 28 Jun 2005 02:51:34 -0000 1.23 *************** *** 46,51 **** { ! ! tcFlightportDBObject* tcGenericDBObject::GetFlightport() --- 46,56 ---- { ! /** ! * Update calculated parameters based on database values ! */ ! void tcGenericDBObject::CalculateParams() ! { ! fuelConsumptionConstant = mfMaxSpeed_kts > 0 ? (mfFuelRate_kgps / mfMaxSpeed_kts) : 0; ! } tcFlightportDBObject* tcGenericDBObject::GetFlightport() *************** *** 62,65 **** --- 67,75 ---- } + float tcGenericDBObject::GetFuelConsumptionConstant() const + { + return fuelConsumptionConstant; + } + /** * @return relative az of launcher n or 0 for default or if error *************** *** 605,608 **** --- 615,620 ---- } + CalculateParams(); + tcSensorPlatformDBObject::ReadSql(entry); *************** *** 676,680 **** tcGenericDBObject::tcGenericDBObject() : tcDatabaseObject(), ! tcSensorPlatformDBObject() { mnClassID = DTYPE_GENERIC; --- 688,693 ---- tcGenericDBObject::tcGenericDBObject() : tcDatabaseObject(), ! tcSensorPlatformDBObject(), ! fuelConsumptionConstant(0) { mnClassID = DTYPE_GENERIC; Index: tcDatabase.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcDatabase.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** tcDatabase.cpp 22 Jun 2005 01:22:07 -0000 1.29 --- tcDatabase.cpp 28 Jun 2005 02:51:34 -0000 1.30 *************** *** 889,893 **** if (mapIter == nameToKey.end()) { ! fprintf(stderr, "Error - tcDatabase::GetObject - not found in nameToKey\n"); return 0; } --- 889,894 ---- if (mapIter == nameToKey.end()) { ! fprintf(stderr, "Error - tcDatabase::GetObject - not found in nameToKey (%s)\n", ! className.c_str()); return 0; } |
|
From: Dewitt C. <ddc...@us...> - 2005-06-28 02:51:44
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6347/src/common Modified Files: simmath.cpp Log Message: Index: simmath.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/simmath.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** simmath.cpp 22 Jun 2005 01:22:04 -0000 1.26 --- simmath.cpp 28 Jun 2005 02:51:34 -0000 1.27 *************** *** 89,107 **** } ! int AngleWithinRange(float afAngle_rad, float afAngle1_rad, float afAngle2_rad) { ! // map angles to -180 to 180, assumes angles are in [-540,540] ! if (afAngle_rad < -C_PI) afAngle_rad += C_TWOPI; ! else if (afAngle_rad >= C_PI) afAngle_rad -= C_TWOPI; ! if (afAngle1_rad < -C_PI) afAngle1_rad += C_TWOPI; ! else if (afAngle1_rad > C_PI) afAngle1_rad -= C_TWOPI; ! if (afAngle2_rad < -C_PI) afAngle2_rad += C_TWOPI; ! else if (afAngle2_rad > C_PI) afAngle2_rad -= C_TWOPI; ! // check if region is wrapped and calc result ! if (afAngle1_rad <= afAngle2_rad) { ! return ((afAngle_rad >= afAngle1_rad)&&(afAngle_rad <= afAngle2_rad)); ! } ! else { ! return ((afAngle_rad >= afAngle1_rad)||(afAngle_rad <= afAngle2_rad)); ! } } --- 89,113 ---- } ! int AngleWithinRange(float afAngle_rad, float afAngle1_rad, float afAngle2_rad) ! { ! // map angles to -180 to 180, assumes angles are in [-540,540] ! if (afAngle_rad < -C_PI) afAngle_rad += C_TWOPI; ! else if (afAngle_rad >= C_PI) afAngle_rad -= C_TWOPI; ! ! if (afAngle1_rad < -C_PI) afAngle1_rad += C_TWOPI; ! else if (afAngle1_rad > C_PI) afAngle1_rad -= C_TWOPI; ! ! if (afAngle2_rad < -C_PI) afAngle2_rad += C_TWOPI; ! else if (afAngle2_rad > C_PI) afAngle2_rad -= C_TWOPI; ! ! // check if region is wrapped and calc result ! if (afAngle1_rad <= afAngle2_rad) ! { ! return ((afAngle_rad >= afAngle1_rad)&&(afAngle_rad <= afAngle2_rad)); ! } ! else ! { ! return ((afAngle_rad >= afAngle1_rad)||(afAngle_rad <= afAngle2_rad)); ! } } |
|
From: Dewitt C. <ddc...@us...> - 2005-06-28 02:51:32
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6326/include/sim Modified Files: tcGameObject.h tcHeloObject.h tcMapData.h tcMissileObject.h tcObjectControl.h tcSensorMapTrack.h tcSensorPlatform.h tcSensorState.h tcSonar.h tcSubObject.h tcSurfaceObject.h tcTorpedoObject.h Log Message: Index: tcSubObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSubObject.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcSubObject.h 25 Jun 2005 22:09:47 -0000 1.5 --- tcSubObject.h 28 Jun 2005 02:51:20 -0000 1.6 *************** *** 57,60 **** --- 57,61 ---- bool GetPeriscopeState() const; bool GetRadarMastState() const; + virtual float GetSonarSourceLevel() const; bool IsAtPeriscopeDepth() const; bool IsSurfaced() const; Index: tcTorpedoObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcTorpedoObject.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcTorpedoObject.h 1 Jun 2005 00:13:28 -0000 1.4 --- tcTorpedoObject.h 28 Jun 2005 02:51:20 -0000 1.5 *************** *** 27,35 **** #define _TCTORPEDOOBJECT_H_ #include "tcWeaponObject.h" #include "tcGuidanceState.h" #include "tcSonar.h" - class tcUpdateStream; --- 27,35 ---- #define _TCTORPEDOOBJECT_H_ + #include "tcSensorPlatform.h" #include "tcWeaponObject.h" #include "tcGuidanceState.h" #include "tcSonar.h" class tcUpdateStream; *************** *** 44,48 **** * @see tcGameObject */ ! class tcTorpedoObject : public tcWeaponObject { public: --- 44,48 ---- * @see tcGameObject */ ! class tcTorpedoObject : public tcWeaponObject, public tcSensorPlatform { public: *************** *** 75,79 **** bool isWireActive; // true if wire is available to receive remote commands ! tcSonar seeker; float battery_kJ; ///< current battery charge --- 75,79 ---- bool isWireActive; // true if wire is available to receive remote commands ! tcSonar* seeker; float battery_kJ; ///< current battery charge *************** *** 93,96 **** --- 93,97 ---- virtual void SetSpeed(float newSpeed); virtual tcSonar* GetSensorState(); + virtual float GetSonarSourceLevel() const; virtual void DesignateTarget(long anID); virtual int GetGuidanceParameters(tsGuidanceParameters& gp); Index: tcMapData.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMapData.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcMapData.h 22 Jun 2005 01:21:27 -0000 1.11 --- tcMapData.h 28 Jun 2005 02:51:20 -0000 1.12 *************** *** 126,129 **** --- 126,131 ---- float GetTerrainHeightLowRes(float afLon_deg, float afLat_deg); void GetTheaterArea(tcGeoRect& r) {r = mrTheaterView;} + float GetTheaterHeightDeg() const; + float GetTheaterWidthDeg() const; void GetWorldArea(tcGeoRect& r) {r = mrWorldView;} void GetTheaterData(short*& rpData, unsigned& anM, unsigned& anN) Index: tcHeloObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcHeloObject.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcHeloObject.h 31 Jan 2005 01:32:36 -0000 1.2 --- tcHeloObject.h 28 Jun 2005 02:51:20 -0000 1.3 *************** *** 41,44 **** --- 41,45 ---- virtual void UpdateClimb(float dt_s); + void UpdateDestroyed(double t); virtual void UpdateSpeed(float dt_s); virtual void Update(double afStatusTime); Index: tcObjectControl.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcObjectControl.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tcObjectControl.h 25 Jun 2005 22:09:47 -0000 1.17 --- tcObjectControl.h 28 Jun 2005 02:51:20 -0000 1.18 *************** *** 46,49 **** --- 46,50 ---- class tcControl; class tcCommandQueue; + class tcPopupText; namespace osg *************** *** 166,169 **** --- 167,172 ---- const std::vector<MapSymbolInfo>& GetMapSymbols() const; void SetHookID(tnPoolIndex anID) {mnHookID=anID;} + void OnEnterWindow(wxMouseEvent& event); + void OnLeaveWindow(wxMouseEvent& event); void OnLButtonDown(wxMouseEvent& event); void OnMouseMove(wxMouseEvent& event); *************** *** 198,202 **** std::vector<tcControl*> controls; tcControl* altitudeControl; ! void AddSensorRangeCircles(); --- 201,211 ---- std::vector<tcControl*> controls; tcControl* altitudeControl; ! bool isMouseOver; ///< true if mouse is over window ! wxPoint lastMousePos; ///< last mouse position ! unsigned int lastMoveTime; ///< tcTime time of last mouse move (for timing "tooltip" popup) ! bool hintActive; ///< true to display hint text ! std::string hintText; ///< text to display for popup "tooltip" hint ! const unsigned int hintDelay; ///< time in 30Hz tics to wait to popup hint ! tcPopupText* popupHint; void AddSensorRangeCircles(); *************** *** 219,222 **** --- 228,232 ---- void SetControlGameObject(tcGameObject* obj); void UpdateControlObjects(); + void UpdateHint(); void UpdateSymbolList(); void GetObjectInfo(tcString& s, tcDatabaseObject *apDBObject, tcGameObject *apGameObject); Index: tcSensorMapTrack.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSensorMapTrack.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcSensorMapTrack.h 1 Jun 2005 00:13:28 -0000 1.2 --- tcSensorMapTrack.h 28 Jun 2005 02:51:20 -0000 1.3 *************** *** 145,150 **** tc3DModel* GetModel() const; void SetModel(tc3DModel* model_); ! const tcTrack* GetTrack() {return this;} ! bool IsNew() {return mfTimestamp == 0;} bool IsDestroyed() const; bool IsStale() const; --- 145,152 ---- tc3DModel* GetModel() const; void SetModel(tc3DModel* model_); ! const tcTrack* GetTrack() const {return this;} ! void IdentifyTrack(long id); ! bool IsIdentified() const; ! bool IsNew() const; bool IsDestroyed() const; bool IsStale() const; Index: tcGameObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGameObject.h,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** tcGameObject.h 22 Jun 2005 01:21:27 -0000 1.40 --- tcGameObject.h 28 Jun 2005 02:51:20 -0000 1.41 *************** *** 161,164 **** --- 161,165 ---- virtual void GetLauncherState(tcLauncherState*& pLauncherState) {pLauncherState = NULL;} virtual tcLauncher* GetLauncher(unsigned idx) {return 0;} + virtual float GetSonarSourceLevel() const; float GetSpan() const; float GetTerrainElevation() {return mcTerrain.mfHeight_m;} Index: tcMissileObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMissileObject.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tcMissileObject.h 22 Jun 2005 01:21:27 -0000 1.19 --- tcMissileObject.h 28 Jun 2005 02:51:20 -0000 1.20 *************** *** 29,32 **** --- 29,33 ---- #include "tcGuidanceState.h" #include "tcRadar.h" + #include "tcSensorPlatform.h" *************** *** 38,42 **** * @see tcGameObject */ ! class tcMissileObject : public tcWeaponObject { public: --- 39,43 ---- * @see tcGameObject */ ! class tcMissileObject : public tcWeaponObject, public tcSensorPlatform { public: *************** *** 55,59 **** float mfRangeToObjective_km; // for segment determination UINT mnCurrentSegment; ! tcSensorState* sensor; ///< missile seeker Aero::tsMissileKState msKState; tcMissileDBObject *mpDBObject; // pointer to valid database obj --- 56,60 ---- float mfRangeToObjective_km; // for segment determination UINT mnCurrentSegment; ! Aero::tsMissileKState msKState; tcMissileDBObject *mpDBObject; // pointer to valid database obj Index: tcSonar.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSonar.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcSonar.h 1 Jun 2005 00:13:28 -0000 1.4 --- tcSonar.h 28 Jun 2005 02:51:20 -0000 1.5 *************** *** 60,64 **** void Serialize(tcFile& file, bool mbLoad); ! bool IsPassive() const; virtual bool IsRadar() const; virtual bool IsSonar() const; --- 60,64 ---- void Serialize(tcFile& file, bool mbLoad); ! bool IsPassive() const; ///< Warning: don't confuse with !tcSensorState::IsActive() virtual bool IsRadar() const; virtual bool IsSonar() const; *************** *** 79,83 **** --- 79,85 ---- protected: bool isPassive; + float scope_m; ///< [m] scope of towed array + void UpdateScope(double t); void UpdateSeeker(double t); void UpdateSensorMapActive(double t, const tcGameObject* target, float range_km); Index: tcSensorState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSensorState.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tcSensorState.h 22 Jun 2005 01:21:27 -0000 1.19 --- tcSensorState.h 28 Jun 2005 02:51:20 -0000 1.20 *************** *** 49,52 **** --- 49,53 ---- class tcGameObject; class tcUpdateStream; + class tcSensorPlatform; /** *************** *** 58,61 **** --- 59,63 ---- short int mbActive; tcGameObject* parent; + tcSensorPlatform* sensorPlatform; ///< parent should always be a sensor plat, this is a down-cast for convenience long mnDBKey; tcSensorDBObject* mpDBObj; *************** *** 96,100 **** virtual void SetFireControlSensor(long id, unsigned char idx); void SetMountAz(float az); ! void SetParent(tcGameObject *obj) {parent = obj;} virtual void Update(double t); int UpdateScan(double afTime); --- 98,102 ---- virtual void SetFireControlSensor(long id, unsigned char idx); void SetMountAz(float az); ! void SetParent(tcGameObject* obj); virtual void Update(double t); int UpdateScan(double afTime); Index: tcSensorPlatform.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSensorPlatform.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcSensorPlatform.h 22 Jun 2005 01:21:27 -0000 1.4 --- tcSensorPlatform.h 28 Jun 2005 02:51:20 -0000 1.5 *************** *** 40,43 **** --- 40,44 ---- class tcUpdateStream; class tcGameObject; + class tcSonar; namespace database *************** *** 55,58 **** --- 56,64 ---- { public: + enum + { + RADAR_ACTIVE = 1, + ACTIVE_SONAR_ACTIVE = 2 + }; std::vector<tcSensorState*> sensorState; *************** *** 62,72 **** unsigned int GetSensorCount() const; bool HasActivatedSensor(); bool IsRadiating() const; const tcSensorState* GetSensor(unsigned idx) const; wxString GetSensorDescription(); ! tcSensorState* GetSensorMutable(unsigned idx); ! tcSensorState* GetSensorMutable(const std::string& sensorClass); ! void Init(tcSensorPlatformDBObject* obj, tcGameObject* parent); void SetSensorState(unsigned idx, bool state); --- 68,81 ---- unsigned int GetSensorCount() const; bool HasActivatedSensor(); + bool IsEnsonifying() const; bool IsRadiating() const; const tcSensorState* GetSensor(unsigned idx) const; wxString GetSensorDescription(); ! tcSensorState* GetSensorMutable(unsigned idx) const; ! tcSensorState* GetSensorMutable(const std::string& sensorClass) const; ! const tcSonar* GetStrongestActiveSonar() const; void Init(tcSensorPlatformDBObject* obj, tcGameObject* parent); + void Init(const char* databaseClass, tcGameObject* parent); + void SetActivityFlag(unsigned int flag); void SetSensorState(unsigned idx, bool state); *************** *** 92,99 **** --- 101,111 ---- tcSensorPlatform(tcSensorPlatform&); tcSensorPlatform(tcSensorPlatformDBObject* obj, tcGameObject* parent); + tcSensorPlatform(const char* databaseClass, tcGameObject* parent); virtual ~tcSensorPlatform(); protected: + unsigned int sensorActivityFlags; ///< flags for faster check of activity state of diff sensor types + void ClearActivityFlags(); }; Index: tcSurfaceObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSurfaceObject.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcSurfaceObject.h 1 Jun 2005 00:13:28 -0000 1.11 --- tcSurfaceObject.h 28 Jun 2005 02:51:20 -0000 1.12 *************** *** 1,20 **** /** ! * Copyright (C) 2003 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 --- 1,20 ---- /** ! * Copyright (C) 2003 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 *************** *** 31,71 **** namespace database { ! class tcGenericDBObject; } /** ! * Represents a platform that resides on the water's surface. ! * ! * @see tcPlatformObject ! */ class tcSurfaceObject : public tcPlatformObject { public: ! tcEngagementData mcEngagementData; ! tcGenericDBObject *mpDBObject; ! ! virtual void Clear(); ! virtual bool IsDestroyed(); ! virtual void RandInitNear(float afLon_deg, float afLat_deg); ! virtual void Update(double afStatusTime); ! virtual void UpdateEffects(); ! virtual void UpdateHeading(float dt_s); ! void PrintToFile(tcFile& file); ! void SaveToFile(tcFile& file); ! void LoadFromFile(tcFile& file); ! virtual void Serialize(tcFile& file, bool mbLoad); ! tcSurfaceObject(); ! tcSurfaceObject(tcSurfaceObject&); ! tcSurfaceObject(tcGenericDBObject *obj); ! ~tcSurfaceObject(); protected: ! virtual void ApplyRestrictions(void); ! virtual void UpdateClimb(float dt_s) {} // do nothing for surface objs ! virtual void UpdateDestroyed(double t); ! bool doneSinking; }; --- 31,73 ---- namespace database { ! class tcGenericDBObject; } /** ! * Represents a platform that resides on the water's surface. ! * ! * @see tcPlatformObject ! */ class tcSurfaceObject : public tcPlatformObject { public: ! tcEngagementData mcEngagementData; ! tcGenericDBObject *mpDBObject; ! virtual void Clear(); ! virtual float GetSonarSourceLevel() const; ! virtual bool IsDestroyed(); ! virtual void RandInitNear(float afLon_deg, float afLat_deg); ! virtual void Update(double afStatusTime); ! virtual void UpdateEffects(); ! virtual void UpdateHeading(float dt_s); ! ! void PrintToFile(tcFile& file); ! void SaveToFile(tcFile& file); ! void LoadFromFile(tcFile& file); ! virtual void Serialize(tcFile& file, bool mbLoad); ! ! tcSurfaceObject(); ! tcSurfaceObject(tcSurfaceObject&); ! tcSurfaceObject(tcGenericDBObject *obj); ! ~tcSurfaceObject(); protected: ! virtual void ApplyRestrictions(void); ! virtual void UpdateClimb(float dt_s) {} // do nothing for surface objs ! virtual void UpdateDestroyed(double t); ! bool doneSinking; }; |
|
From: Dewitt C. <ddc...@us...> - 2005-06-28 02:51:29
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6326/include/graphics Modified Files: tcOOBView.h Log Message: Index: tcOOBView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcOOBView.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcOOBView.h 1 Jun 2005 00:13:27 -0000 1.5 --- tcOOBView.h 28 Jun 2005 02:51:19 -0000 1.6 *************** *** 80,84 **** std::vector<tsOOBInfo> surfaceObj; std::vector<tsOOBInfo> airObj; ! std::vector<tsOOBInfo> flightopsObj; ///< carriers and airfields std::vector<tsOOBInfo> heloObj; std::vector<tsOOBInfo> subObj; --- 80,85 ---- std::vector<tsOOBInfo> surfaceObj; std::vector<tsOOBInfo> airObj; ! std::vector<tsOOBInfo> carrierObj; ///< carriers ! std::vector<tsOOBInfo> flightopsObj; ///< airfields std::vector<tsOOBInfo> heloObj; std::vector<tsOOBInfo> subObj; |
|
From: Dewitt C. <ddc...@us...> - 2005-06-28 02:51:29
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6326/include/database Modified Files: tcGenericDBObject.h tcRadarDBObject.h tcSonarDBObject.h Log Message: Index: tcSonarDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcSonarDBObject.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcSonarDBObject.h 1 Jun 2005 00:13:26 -0000 1.4 --- tcSonarDBObject.h 28 Jun 2005 02:51:19 -0000 1.5 *************** *** 42,48 **** public: float SL; ///< [dB] source level (active only) ! float DI; ///< [dB] receive directivity index ! float DT; ///< [dB] detectability threshold in noise ! float DTr; ///< [dB] detectability threshold with reverberation background float minFrequency_Hz; float maxFrequency_Hz; --- 42,46 ---- public: float SL; ///< [dB] source level (active only) ! float DI; ///< [dB] receive directivity index (includes processing gain) float minFrequency_Hz; float maxFrequency_Hz; *************** *** 52,56 **** float maxScope_m; ///< towed array scope or dipping sonar "scope" bool isWakeHoming; ///< wake homing vs. surface only - bool applyScanLoss; float bearingResolution_deg; --- 50,53 ---- Index: tcGenericDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcGenericDBObject.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcGenericDBObject.h 1 Jun 2005 00:13:26 -0000 1.18 --- tcGenericDBObject.h 28 Jun 2005 02:51:19 -0000 1.19 *************** *** 88,91 **** --- 88,92 ---- bool IsLeaf() const; ///< returns true if db obj is a leaf obj tcFlightportDBObject* GetFlightport(); + float GetFuelConsumptionConstant() const; float GetLauncherAz(unsigned n); tc3DPoint GetLauncherPosition(unsigned n); *************** *** 105,108 **** --- 106,113 ---- tcGenericDBObject(tcGenericDBObject& obj); ///< copy constructor virtual ~tcGenericDBObject(); + private: + float fuelConsumptionConstant; ///< = (fuel rate / max speed) + + void CalculateParams(); }; Index: tcRadarDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcRadarDBObject.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcRadarDBObject.h 1 Jun 2005 00:13:26 -0000 1.13 --- tcRadarDBObject.h 28 Jun 2005 02:51:19 -0000 1.14 *************** *** 38,44 **** { public: ! float mfMinRange_km; ///< [km] min range ! float mfERP_dBW; ///< [dBW] effective radiated power, peak ! float mfMinRangeRate_mps; ///< minimum detectable range rate unsigned int maxFireControlTracks; ///< max number of simultaneous fire control tracks bool isSemiactive; ///< set true if this is a semiactive radar --- 38,42 ---- { public: ! float mfERP_dBW; ///< [dBW] effective radiated power unsigned int maxFireControlTracks; ///< max number of simultaneous fire control tracks bool isSemiactive; ///< set true if this is a semiactive radar |
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21991/src/sim Modified Files: Game.cpp tcLauncher.cpp tcLauncherState.cpp tcObjectControl.cpp tcPlatformObject.cpp tcSensorPlatform.cpp tcSubObject.cpp Log Message: Fixed bug with crashing when too many range circles were displayed Index: tcSubObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSubObject.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcSubObject.cpp 29 Apr 2005 18:52:56 -0000 1.8 --- tcSubObject.cpp 25 Jun 2005 22:10:36 -0000 1.9 *************** *** 262,265 **** --- 262,274 ---- SetRadarMastState(false); } + else if (mcKin.mfAlt_m <= 0) // restrict speed near surface + { + float maxSpeed = (0.5f - 0.5f*invPeriscopeDepth*mcKin.mfAlt_m) * + mpDBObject->mfMaxSpeed_kts; + if (mcKin.mfSpeed_kts > maxSpeed) + { + mcKin.mfSpeed_kts = maxSpeed; + } + } else if (mcKin.mfAlt_m > 0) { *************** *** 531,534 **** --- 540,545 ---- { mnModelType = MTYPE_SUBMARINE; + invPeriscopeDepth = 1.0f / periscopeDepth_m; + SetAltitude(-100.0f); SetHeading(75.0f); *************** *** 543,550 **** maxPitch_rad(0.5), periscopeDepth_m(18), ! doneSinking(false) { - mpDBObject = obj; mnModelType = MTYPE_SUBMARINE; } --- 554,563 ---- maxPitch_rad(0.5), periscopeDepth_m(18), ! doneSinking(false), ! mpDBObject(obj) { mnModelType = MTYPE_SUBMARINE; + + invPeriscopeDepth = 1.0f / periscopeDepth_m; } Index: tcLauncherState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncherState.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** tcLauncherState.cpp 22 Jun 2005 01:22:09 -0000 1.32 --- tcLauncherState.cpp 25 Jun 2005 22:10:36 -0000 1.33 *************** *** 2,6 **** ** @file tcLauncherState.cpp */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** --- 2,6 ---- ** @file tcLauncherState.cpp */ ! /* Copyright (C) 2003-2005 Dewitt Colclough (de...@tw...) ** All rights reserved. ** *************** *** 41,54 **** #endif ! tcDatabase* tcLauncherState::mpDatabase = NULL; ! tcSimState* tcLauncherState::simState = NULL; - /* - class tcGame - { - public: - static void DisplayMessage(const char* msg); - }; - */ /** --- 41,48 ---- #endif ! tcDatabase* tcLauncherState::mpDatabase = 0; ! tcSimState* tcLauncherState::simState = 0; ! /** *************** *** 481,519 **** } - #if 0 - /** - * Load state from stream - */ - tcStream& tcLauncherState::operator<<(tcStream& buffer) - { - launchers.clear(); - - buffer >> mnCount; - for(int n = 0; n < mnCount; n++) - { - tcLauncher ldata; - ldata << buffer; - launchers.push_back(ldata); - } - - return buffer; - } - - /** - * Save state to stream - */ - tcStream& tcLauncherState::operator>>(tcStream& buffer) - { - buffer << mnCount; - for(int n = 0; n < mnCount; n++) - { - tcLauncher& ldata = launchers[n]; - ldata >> buffer; - } - - return buffer; - } - - #endif --- 475,478 ---- *************** *** 614,628 **** */ tcLauncherState::tcLauncherState() { - mnCount = 0; - launchers.clear(); - parent = NULL; } tcLauncherState::tcLauncherState(tcGameObject *parentObj) ! : parent(parentObj), mnCount(0) { - //launchers.clear(); } --- 573,585 ---- */ tcLauncherState::tcLauncherState() + : mnCount(0), + parent(0) { } tcLauncherState::tcLauncherState(tcGameObject *parentObj) ! : parent(parentObj), mnCount(0) { } *************** *** 630,634 **** * */ ! tcLauncherState::tcLauncherState(tcLauncherState& lstate) { for(unsigned i=0;i<lstate.launchers.size();i++) --- 587,592 ---- * */ ! tcLauncherState::tcLauncherState(tcLauncherState& lstate) ! : parent(0) { for(unsigned i=0;i<lstate.launchers.size();i++) *************** *** 637,641 **** } mnCount = (int)launchers.size(); - parent = NULL; } --- 595,598 ---- *************** *** 650,652 **** } ! } \ No newline at end of file --- 607,609 ---- } ! } Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.134 retrieving revision 1.135 diff -C2 -d -r1.134 -r1.135 *** Game.cpp 22 Jun 2005 01:22:09 -0000 1.134 --- Game.cpp 25 Jun 2005 22:10:36 -0000 1.135 *************** *** 1852,1855 **** --- 1852,1857 ---- tcMultiplayerInterface::Get()->Update(); + tcSimPythonInterface::Get()->Update(); + return mbQuit; } Index: tcLauncher.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncher.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** tcLauncher.cpp 22 Jun 2005 01:22:09 -0000 1.24 --- tcLauncher.cpp 25 Jun 2005 22:10:36 -0000 1.25 *************** *** 1,5 **** ! /** @file tcLauncher.cpp */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** --- 1,6 ---- ! /** ! ** @file tcLauncher.cpp */ ! /* Copyright (C) 2003-2005 Dewitt Colclough (de...@tw...) ** All rights reserved. ** *************** *** 247,262 **** * @see IsItemCompatible */ ! unsigned int tcLauncher::GetCapacityForItem(const std::string& item) const { ! unsigned nTypes = GetCompatibleCount(); ! for (unsigned k=0; k<nTypes; k++) ! { ! if (item == mpLauncherDBObj->maChildClass[k].mz) ! { ! return mpLauncherDBObj->maCapacity[k]; ! } ! } ! ! return 0; } --- 248,254 ---- * @see IsItemCompatible */ ! unsigned short tcLauncher::GetCapacityForItem(const std::string& item) const { ! return mpLauncherDBObj->GetCapacityForItem(item); } *************** *** 267,271 **** { wxASSERT(mpLauncherDBObj); ! return mpLauncherDBObj->mnConfigurations; } --- 259,263 ---- { wxASSERT(mpLauncherDBObj); ! return mpLauncherDBObj->GetNumberConfigurations(); } *************** *** 280,293 **** wxASSERT(mpLauncherDBObj); ! if (idx >= mpLauncherDBObj->mnConfigurations) { s = ""; } else { ! s = mpLauncherDBObj->maChildClass[idx].mz; } - - return s; } --- 272,284 ---- wxASSERT(mpLauncherDBObj); ! if (idx >= mpLauncherDBObj->GetNumberConfigurations()) { s = ""; + return s; } else { ! return mpLauncherDBObj->GetConfigurationClass(idx); } } *************** *** 300,304 **** unsigned int tcLauncher::GetCompatibleQuantity(unsigned int idx) const { ! if (idx >= mpLauncherDBObj->mnConfigurations) { return 0; --- 291,295 ---- unsigned int tcLauncher::GetCompatibleQuantity(unsigned int idx) const { ! if (idx >= mpLauncherDBObj->GetNumberConfigurations()) { return 0; *************** *** 306,310 **** else { ! return mpLauncherDBObj->maCapacity[idx]; } } --- 297,301 ---- else { ! return mpLauncherDBObj->GetConfigurationCapacity(idx); } } *************** *** 419,432 **** bool tcLauncher::IsItemCompatible(const std::string& item) const { ! unsigned nTypes = GetCompatibleCount(); ! for (unsigned k=0; k<nTypes; k++) ! { ! if (GetCompatibleName(k) == item) ! { ! return true; ! } ! } ! return false; } --- 410,416 ---- bool tcLauncher::IsItemCompatible(const std::string& item) const { ! unsigned short capacity = mpLauncherDBObj->GetCapacityForItem(item); ! return capacity != 0; } *************** *** 879,884 **** wxASSERT(simState); ! SetChildClass(dbObj->mzChildClass.mz); ! SetChildQuantity(capacity); } --- 863,868 ---- wxASSERT(simState); ! SetChildClass(dbObj->GetDefaultChildClass()); ! SetChildQuantity(dbObj->GetDefaultChildCapacity()); } *************** *** 887,948 **** } - - #if 0 - /** - * Load state from stream - */ - tcStream& tcLauncher::operator<<(tcStream& buffer) - { - buffer >> mbActive; - buffer >> mnDBKey; - buffer >> mnChildDBKey; - - buffer >> mfTimeToReady; - buffer >> mnCurrent; - buffer >> mnPending; - - msDatum << buffer; - - buffer >> mnTargetID; - - int temp; - buffer >> temp; - meLaunchMode = (database::teWeaponLaunchMode)temp; - - buffer >> mnTargetFlags; - buffer >> pointingAngle; - buffer >> pointingElevation; - buffer >> fireControlSensorIdx; - - return buffer; - } - - /** - * Save state to stream - */ - tcStream& tcLauncher::operator >>(tcStream& buffer) - { - buffer << mbActive; - buffer << mnDBKey; - buffer << mnChildDBKey; - - buffer << mfTimeToReady; - buffer << mnCurrent; - buffer << mnPending; - - msDatum >> buffer; - - buffer << mnTargetID; - - int temp = (int)meLaunchMode; - buffer << temp; - - buffer << mnTargetFlags; - buffer << pointingAngle; - buffer << pointingElevation; - buffer << fireControlSensorIdx; - - return buffer; - } - - #endif --- 871,872 ---- Index: tcSensorPlatform.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSensorPlatform.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcSensorPlatform.cpp 22 Jun 2005 01:22:10 -0000 1.6 --- tcSensorPlatform.cpp 25 Jun 2005 22:10:36 -0000 1.7 *************** *** 58,61 **** --- 58,62 ---- wxString tcSensorPlatform::GetSensorDescription() { + static std::string errorString = "Error"; wxString description; *************** *** 63,69 **** for (unsigned n=0; n < nSensors; n++) { const tcSensorState* sensor = GetSensor(n); ! description += wxString::Format("%s\n", ! sensor->mpDBObj->mzClass.mz); } --- 64,73 ---- for (unsigned n=0; n < nSensors; n++) { + const tcSensorState* sensor = GetSensor(n); ! ! const char* text = (sensor != 0) && (sensor->mpDBObj != 0) ? ! sensor->mpDBObj->mzClass.mz : errorString.c_str(); ! description += wxString::Format("%s\n", text); } Index: tcPlatformObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPlatformObject.cpp,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** tcPlatformObject.cpp 22 Jun 2005 01:22:09 -0000 1.49 --- tcPlatformObject.cpp 25 Jun 2005 22:10:36 -0000 1.50 *************** *** 342,345 **** --- 342,346 ---- wxString tcPlatformObject::GetLauncherDescription() { + static std::string errorString = "Error"; wxString description; *************** *** 348,355 **** { tcLauncher* launcher = GetLauncher(n); description += wxString::Format("%s, %d x %s\n", launcher->mpLauncherDBObj->mzClass.mz, launcher->mnCurrent, ! launcher->mpChildDBObj->mzClass.mz); } --- 349,360 ---- { tcLauncher* launcher = GetLauncher(n); + + const char* childClassName = (launcher->mpChildDBObj != 0) ? launcher->mpChildDBObj->mzClass.mz : + errorString.c_str(); + description += wxString::Format("%s, %d x %s\n", launcher->mpLauncherDBObj->mzClass.mz, launcher->mnCurrent, ! childClassName); } *************** *** 911,916 **** size_t nSensors = tcSensorPlatform::GetSensorCount(); ! // ! for(int nLauncher=0; nLauncher<mpDBObject->mnNumLaunchers; nLauncher++) { std::string fcSensor = --- 916,921 ---- size_t nSensors = tcSensorPlatform::GetSensorCount(); ! size_t nLaunchers = mcLauncherState.GetLauncherCount(); ! for(size_t nLauncher=0; nLauncher<nLaunchers; nLauncher++) { std::string fcSensor = Index: tcObjectControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcObjectControl.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** tcObjectControl.cpp 22 Jun 2005 01:22:09 -0000 1.38 --- tcObjectControl.cpp 25 Jun 2005 22:10:36 -0000 1.39 *************** *** 1555,1558 **** --- 1555,1563 ---- } + const std::vector<MapSymbolInfo>& tcObjectControl::GetMapSymbols() const + { + return symbolList; + } + /******************************************************************************/ void tcObjectControl::InitControls() *************** *** 1676,1680 **** void tcObjectControl::UpdateSymbolList() { ! msOCSymbolList.mnSymbols = 0; if (mpHookedGameObj == 0) --- 1681,1685 ---- void tcObjectControl::UpdateSymbolList() { ! symbolList.clear(); if (mpHookedGameObj == 0) *************** *** 1702,1743 **** } ! int nSensors = (int)platformObj->GetSensorCount(); ! int k = msOCSymbolList.mnSymbols; ! for(int i=0; i<nSensors; i++) { ! const tcSensorState* pSensorState = platformObj->GetSensor(i); const tcRadar* pRadarSS = dynamic_cast<const tcRadar*>(pSensorState); bool bActive = pSensorState->IsActive() ? true : false; if ((pRadarSS)&&(bActive)) { ! msOCSymbolList.maSymbol[k].mfLat_rad = (float)mpHookedGameObj->mcKin.mfLat_rad; ! msOCSymbolList.maSymbol[k].mfLon_rad = (float)mpHookedGameObj->mcKin.mfLon_rad; float fRangeX_rad = 2.0f*pRadarSS->mpDBObj->mfRefRange_km*C_KMTORAD/ cosf((float)mpHookedGameObj->mcKin.mfLat_rad); float fRangeY_rad = 2.0f*pRadarSS->mpDBObj->mfRefRange_km*C_KMTORAD; ! msOCSymbolList.maSymbol[k].mfLatExtent_rad = fRangeY_rad; ! msOCSymbolList.maSymbol[k].mfLonExtent_rad = fRangeX_rad; float sensorAz_deg = (mpHookedGameObj->mcKin.mfHeading_rad + pRadarSS->mountAz_rad) * C_180OVERPI; ! msOCSymbolList.maSymbol[k].mfArcCenter_deg = sensorAz_deg; // wrt North ! msOCSymbolList.maSymbol[k].mfArcLength_deg = pRadarSS->mpDBObj->mfFieldOfView_deg; ! if (msOCSymbolList.maSymbol[k].mfArcLength_deg < 360.0f) { ! msOCSymbolList.maSymbol[k].mfArcLength_deg *= 0.95f; // sector distortion issue, lat based? } bool bDetectsAir = pRadarSS->mpDBObj->mbDetectsAir; bool bDetectsPlatform = pRadarSS->mpDBObj->mbDetectsSurface; if (bDetectsAir) { ! msOCSymbolList.maSymbol[k].mnColor = bDetectsPlatform ? 0x80FFFF88 : 0x808888FF; } else { ! msOCSymbolList.maSymbol[k].mnColor = 0x8088FF88; } ! k++; } } - msOCSymbolList.mnSymbols = k; } --- 1707,1754 ---- } ! size_t nSensors = platformObj->GetSensorCount(); ! ! for(size_t n=0; n<nSensors; n++) { ! const tcSensorState* pSensorState = platformObj->GetSensor(n); const tcRadar* pRadarSS = dynamic_cast<const tcRadar*>(pSensorState); + wxASSERT(pSensorState); bool bActive = pSensorState->IsActive() ? true : false; if ((pRadarSS)&&(bActive)) { ! MapSymbolInfo symbol; ! ! symbol.mfLat_rad = (float)mpHookedGameObj->mcKin.mfLat_rad; ! symbol.mfLon_rad = (float)mpHookedGameObj->mcKin.mfLon_rad; ! float fRangeX_rad = 2.0f*pRadarSS->mpDBObj->mfRefRange_km*C_KMTORAD/ cosf((float)mpHookedGameObj->mcKin.mfLat_rad); float fRangeY_rad = 2.0f*pRadarSS->mpDBObj->mfRefRange_km*C_KMTORAD; ! symbol.mfLatExtent_rad = fRangeY_rad; ! symbol.mfLonExtent_rad = fRangeX_rad; ! float sensorAz_deg = (mpHookedGameObj->mcKin.mfHeading_rad + pRadarSS->mountAz_rad) * C_180OVERPI; ! symbol.mfArcCenter_deg = sensorAz_deg; // wrt North ! symbol.mfArcLength_deg = pRadarSS->mpDBObj->mfFieldOfView_deg; ! if (symbol.mfArcLength_deg < 360.0f) { ! symbol.mfArcLength_deg *= 0.95f; // sector distortion issue, lat based? } + bool bDetectsAir = pRadarSS->mpDBObj->mbDetectsAir; bool bDetectsPlatform = pRadarSS->mpDBObj->mbDetectsSurface; if (bDetectsAir) { ! symbol.mnColor = bDetectsPlatform ? 0x80FFFF88 : 0x808888FF; } else { ! symbol.mnColor = 0x8088FF88; } ! ! symbolList.push_back(symbol); } } } *************** *** 1751,1755 **** unsigned int nLaunchers = platformObj->GetLauncherCount(); ! int k = msOCSymbolList.mnSymbols; for(unsigned int i=0; i<nLaunchers; i++) { --- 1762,1766 ---- unsigned int nLaunchers = platformObj->GetLauncherCount(); ! for(unsigned int i=0; i<nLaunchers; i++) { *************** *** 1757,1762 **** if ((launcher->mnCurrent > 0) && !launcher->IsDamaged()) { ! msOCSymbolList.maSymbol[k].mfLat_rad = (float)mpHookedGameObj->mcKin.mfLat_rad; ! msOCSymbolList.maSymbol[k].mfLon_rad = (float)mpHookedGameObj->mcKin.mfLon_rad; float range_km = 0; --- 1768,1775 ---- if ((launcher->mnCurrent > 0) && !launcher->IsDamaged()) { ! MapSymbolInfo symbol; ! ! symbol.mfLat_rad = (float)mpHookedGameObj->mcKin.mfLat_rad; ! symbol.mfLon_rad = (float)mpHookedGameObj->mcKin.mfLon_rad; float range_km = 0; *************** *** 1773,1777 **** { range_km = ballisticDBObj->maxRange_km; ! color = 0xFFB04010; } else if (tcTorpedoDBObject* torpDBObj = --- 1786,1790 ---- { range_km = ballisticDBObj->maxRange_km; ! color = 0xFFB04010; } else if (tcTorpedoDBObject* torpDBObj = *************** *** 1787,1792 **** float fRangeY_rad = 2.0f* range_km * C_KMTORAD; ! msOCSymbolList.maSymbol[k].mfLatExtent_rad = fRangeY_rad; ! msOCSymbolList.maSymbol[k].mfLonExtent_rad = fRangeX_rad; float az_deg = C_180OVERPI * (launcher->GetSectorCenter() + --- 1800,1805 ---- float fRangeY_rad = 2.0f* range_km * C_KMTORAD; ! symbol.mfLatExtent_rad = fRangeY_rad; ! symbol.mfLonExtent_rad = fRangeX_rad; float az_deg = C_180OVERPI * (launcher->GetSectorCenter() + *************** *** 1797,1810 **** fov_deg *= 0.95f; // sector distortion issue, lat based? } ! msOCSymbolList.maSymbol[k].mfArcCenter_deg = az_deg; // wrt North ! msOCSymbolList.maSymbol[k].mfArcLength_deg = fov_deg; ! msOCSymbolList.maSymbol[k].mnColor = color; ! if (range_km > 0) k++; } } - msOCSymbolList.mnSymbols = k++; } --- 1810,1825 ---- fov_deg *= 0.95f; // sector distortion issue, lat based? } ! symbol.mfArcCenter_deg = az_deg; // wrt North ! symbol.mfArcLength_deg = fov_deg; ! symbol.mnColor = color; ! if (range_km > 0) ! { ! symbolList.push_back(symbol); ! } } } } *************** *** 1817,1837 **** const wxPoint& pos, const wxSize& size, const wxString& name) : ! tc3DWindow(parent, pos, size, name, 0) { - mnHookID = NULL_INDEX; - mnPreviousHookID = NULL_INDEX; - mpSS = tcSimState::Get(); mpCommandInterface = tcCommandQueue::Get(); - mnLaunchers = 0; - mpHookedGameObj = NULL; - mpUserInfo = NULL; - msOCSymbolList.mnSymbols = 0; - mpOptions = tcOptions::Get(); InitControls(); - } --- 1832,1848 ---- const wxPoint& pos, const wxSize& size, const wxString& name) : ! tc3DWindow(parent, pos, size, name, 0), ! mnHookID(NULL_INDEX), ! mnPreviousHookID(NULL_INDEX), ! mnLaunchers(0), ! mpHookedGameObj(0), ! mpUserInfo(0) { mpSS = tcSimState::Get(); mpCommandInterface = tcCommandQueue::Get(); mpOptions = tcOptions::Get(); InitControls(); } |
|
From: Dewitt C. <ddc...@us...> - 2005-06-25 22:10:47
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21991/src/graphics Modified Files: tcGameView.cpp tcHookInfo.cpp Log Message: Fixed bug with crashing when too many range circles were displayed Index: tcHookInfo.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcHookInfo.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcHookInfo.cpp 1 Jun 2005 00:13:30 -0000 1.11 --- tcHookInfo.cpp 25 Jun 2005 22:10:35 -0000 1.12 *************** *** 386,402 **** /*** damage ***/ ! if (pHookedObj->mfDamageLevel == 0) { strcpy(zBuff,"Damage: none"); } ! else if (pHookedObj->mfDamageLevel >= 0.5f) { color.set(1.0f, 0.4f, 0.4f, 1.0f); ! sprintf(zBuff, "Damage: %2.0f%%", 100.0f*pHookedObj->mfDamageLevel); } else { color.set(1.0f, 1.0f, 0.4f, 1.0f); ! sprintf(zBuff, "Damage: %2.0f%%", 100.0f*pHookedObj->mfDamageLevel); } s = zBuff; --- 386,405 ---- /*** damage ***/ ! float damageLevelPercent = 100.0f * pHookedObj->mfDamageLevel; ! if (damageLevelPercent > 100.0f) damageLevelPercent = 100.0f; ! ! if (damageLevelPercent == 0) { strcpy(zBuff,"Damage: none"); } ! else if (damageLevelPercent >= 50.0f) { color.set(1.0f, 0.4f, 0.4f, 1.0f); ! sprintf(zBuff, "Damage: %2.0f%%", damageLevelPercent); } else { color.set(1.0f, 1.0f, 0.4f, 1.0f); ! sprintf(zBuff, "Damage: %2.0f%%", damageLevelPercent); } s = zBuff; Index: tcGameView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcGameView.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcGameView.cpp 22 Jun 2005 01:22:08 -0000 1.11 --- tcGameView.cpp 25 Jun 2005 22:10:35 -0000 1.12 *************** *** 532,556 **** // display range indication graphics from user selection in mpObjectControl ! if (mpObjectControl != NULL) { ! tsOCSymbolList* pSymbolInfo; ! mpObjectControl->GetSymbols(pSymbolInfo); for(unsigned i=0; ! (i<pSymbolInfo->mnSymbols)&&(i<MAX_OCSYMBOLS)&&(nMapObj<MAXMAPOBJ); i++) { tcMapObj* pMO = &mpMapView->maMapObj[nMapObj++]; //*pMO = mpMapView->maMapObj[0]; pMO->mbFocus = false; pMO->mbExists = true; ! pMO->mfLat = pSymbolInfo->maSymbol[i].mfLat_rad; ! pMO->mfLon = pSymbolInfo->maSymbol[i].mfLon_rad; ! pMO->mfLatExtent = pSymbolInfo->maSymbol[i].mfLatExtent_rad; ! pMO->mfLonExtent = pSymbolInfo->maSymbol[i].mfLonExtent_rad; ! pMO->mfHeading = pSymbolInfo->maSymbol[i].mfArcCenter_deg; // fix this rad/deg double use ! pMO->mfArc_deg = pSymbolInfo->maSymbol[i].mfArcLength_deg; pMO->meSymbol = SYMBOL_PIE; pMO->mnFlags = 0; ! pMO->mnColor = pSymbolInfo->maSymbol[i].mnColor; pMO->mnID = NULL_INDEX; } --- 532,558 ---- // display range indication graphics from user selection in mpObjectControl ! if (mpObjectControl != 0) { ! const std::vector<MapSymbolInfo>& symbolList = mpObjectControl->GetMapSymbols(); ! size_t nMapSymbols = symbolList.size(); ! for(unsigned i=0; ! (i<nMapSymbols)&&(nMapObj<MAXMAPOBJ); i++) { + const MapSymbolInfo& symbol = symbolList[i]; tcMapObj* pMO = &mpMapView->maMapObj[nMapObj++]; //*pMO = mpMapView->maMapObj[0]; pMO->mbFocus = false; pMO->mbExists = true; ! pMO->mfLat = symbol.mfLat_rad; ! pMO->mfLon = symbol.mfLon_rad; ! pMO->mfLatExtent = symbol.mfLatExtent_rad; ! pMO->mfLonExtent = symbol.mfLonExtent_rad; ! pMO->mfHeading = symbol.mfArcCenter_deg; // fix this rad/deg double use ! pMO->mfArc_deg = symbol.mfArcLength_deg; pMO->meSymbol = SYMBOL_PIE; pMO->mnFlags = 0; ! pMO->mnColor = symbol.mnColor; pMO->mnID = NULL_INDEX; } |
|
From: Dewitt C. <ddc...@us...> - 2005-06-25 22:10:47
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21991/src/scriptinterface Modified Files: tcPythonInterface.cpp tcSimPythonInterface.cpp Log Message: Fixed bug with crashing when too many range circles were displayed Index: tcSimPythonInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcSimPythonInterface.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** tcSimPythonInterface.cpp 11 Jun 2005 21:01:45 -0000 1.34 --- tcSimPythonInterface.cpp 25 Jun 2005 22:10:36 -0000 1.35 *************** *** 24,30 **** #ifndef WX_PRECOMP #include "wx/wx.h" - #ifdef WIN32 - #include "wx/msw/private.h" // for MS Windows specific definitions - #endif // WIN32 #endif // WX_PRECOMP --- 24,27 ---- *************** *** 39,46 **** --- 36,47 ---- #include "tcSoundConsole.h" #include "tcDirector.h" + #include "tcMessageInterface.h" + #include "tcTime.h" + #include "ai/ScriptedTask.h" #include "ai/ScriptedTaskInterface.h" #include "common/tcStream.h" #include "common/tcObjStream.h" + #include "common/tcOptions.h" #ifdef _DEBUG *************** *** 953,957 **** } ! void tcSimPythonInterface::Test() { try { --- 954,959 ---- } ! void tcSimPythonInterface::Test() ! { try { *************** *** 968,971 **** --- 970,1042 ---- } + void tcSimPythonInterface::Update() + { + static unsigned int lastUpdate = 0; + + // limit update frequency + unsigned int t = tcTime::Get()->Get30HzCount(); + if (t - lastUpdate < 15) return; + lastUpdate = t; + + UpdateLogs(); + } + + + /** + * Update output and error text logs + * If showPythonErrors is true, then send errors to "Python" message channel in game + */ + void tcSimPythonInterface::UpdateLogs() + { + wxString errorText; + + try + { + handle<>( PyRun_String( + "outfile = file('log\\pyout.txt', 'a')\n" + "errfile = file('log\\pyerr.txt', 'a')\n" + "outfile.write(myout.getvalue())\n" + "ErrorText = myerr.getvalue()\n" + "errfile.write(ErrorText)\n" + "outfile.close()\n" + "errfile.close()\n" + "myout.truncate(0)\n" + "myerr.truncate(0)\n" + , Py_file_input, mpDictionary->ptr(), mpDictionary->ptr()) ); + + if (showPythonErrors) + { + handle<> errorTextHandle(borrowed(PyDict_GetItemString(mpDictionary->ptr(), "ErrorText"))); + str textObject(errorTextHandle); + + errorText = extract<const char*>(textObject); + } + } + catch(error_already_set) + { + fprintf(stderr,"Exception occured during SendTextToConsole\n"); + PyErr_Print(); + } + catch(...) + { + fprintf(stderr,"Unknown exception occured during SendTextToConsole\n"); + PyErr_Print(); + } + + if (errorText.size() > 0) + { + tcMessageInterface::Get()->ChannelMessage("Python", ""); + while (errorText.size() > 0) + { + wxString line = errorText.BeforeFirst('\n'); + errorText = errorText.AfterFirst('\n'); + + tcMessageInterface::Get()->ChannelMessage("Python", line.c_str()); + } + } + + + } + tcSimPythonInterface::tcSimPythonInterface() : *************** *** 974,978 **** mpHookedObj(0), overlay(0), ! isModePushed(false) { mpSimState = tcSimState::Get(); --- 1045,1050 ---- mpHookedObj(0), overlay(0), ! isModePushed(false), ! showPythonErrors(false) { mpSimState = tcSimState::Get(); *************** *** 1076,1079 **** --- 1148,1166 ---- try { + handle<>( PyRun_String("import sys\n" + "import StringIO\n" + "myout = StringIO.StringIO()\n" + "myerr = StringIO.StringIO()\n" + "sys.stdout = myout\n" + "sys.stderr = myerr\n" + "outfile = file('log\\pyout.txt', 'w')\n" + "errfile = file('log\\pyerr.txt', 'w')\n" + //"outfile.write("")\n" + //"errfile.write("")\n" + "outfile.close()\n" + "errfile.close()\n" + , Py_file_input, mpDictionary->ptr(), mpDictionary->ptr()) ); + + handle<>( PyRun_String("import AI\n" , Py_file_input, mpDictionary->ptr(), mpDictionary->ptr()) ); *************** *** 1090,1093 **** --- 1177,1185 ---- } + if (tcOptions::Get()->OptionStringExists("ShowPythonErrors")) + { + showPythonErrors = true; + } + } *************** *** 1096,1099 **** --- 1188,1200 ---- tcSimPythonInterface::~tcSimPythonInterface() { + /*** print standard error to file ***/ + handle<>( PyRun_String( + "outfile = file('log\\pyout.txt', 'a')\n" + "errfile = file('log\\pyerr.txt', 'a')\n" + "outfile.write(myout.getvalue())\n" + "errfile.write(myerr.getvalue())\n" + "outfile.close()\n" + "errfile.close()\n" + , Py_file_input, mpDictionary->ptr(), mpDictionary->ptr()) ); } Index: tcPythonInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPythonInterface.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcPythonInterface.cpp 1 Jun 2005 00:13:32 -0000 1.8 --- tcPythonInterface.cpp 25 Jun 2005 22:10:36 -0000 1.9 *************** *** 174,177 **** --- 174,178 ---- /*** redirect standard error ***/ + /* PyRun_SimpleString( "import StringIO\n" *************** *** 182,185 **** --- 183,187 ---- "sys.stderr = myerr\n" ); + */ /* create fresh dictionary */ *************** *** 189,206 **** } ! tcPythonInterface::~tcPythonInterface(void) { ! ! /*** print standard error to file ***/ ! PyRun_SimpleString( ! "outfile = file('log\\pyout.txt', 'w')\n" ! "errfile = file('log\\pyerr.txt', 'w')\n" ! "outfile.write(myout.getvalue())\n" ! "errfile.write(myerr.getvalue())\n" ! "outfile.close()\n" ! "errfile.close()\n" ! ); ! ! if (mpDictionary != NULL) {delete mpDictionary;} ! Py_Finalize(); } --- 191,208 ---- } ! tcPythonInterface::~tcPythonInterface() { ! /*** print standard error to file ***/ ! /* ! PyRun_SimpleString( ! "outfile = file('log\\pyout.txt', 'w')\n" ! "errfile = file('log\\pyerr.txt', 'w')\n" ! "outfile.write(myout.getvalue())\n" ! "errfile.write(myerr.getvalue())\n" ! "outfile.close()\n" ! "errfile.close()\n" ! ); ! */ ! if (mpDictionary != NULL) {delete mpDictionary;} ! Py_Finalize(); } |