[Gcblue-commits] gcb_wx/src/scriptinterface tcPlatformInterface.cpp,1.38,1.39 tcPlatformInterfaceExt
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-03-10 03:28:38
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14606/src/scriptinterface Modified Files: tcPlatformInterface.cpp tcPlatformInterfaceExtension.cpp Log Message: Index: tcPlatformInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterface.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** tcPlatformInterface.cpp 2 Mar 2005 22:28:44 -0000 1.38 --- tcPlatformInterface.cpp 10 Mar 2005 03:28:29 -0000 1.39 *************** *** 432,435 **** --- 432,439 ---- nTargetType = MISSILE_TARGET; } + else if (track.IsSub()) + { + nTargetType = SUBSURFACE_TARGET; + } else { *************** *** 446,450 **** { int bCompatible = info.mnTargetFlags & nTargetType; ! bool bInRange = info.mfRange_km <= mfTargetRange; if (bCompatible && info.mnQuantity) { --- 450,454 ---- { int bCompatible = info.mnTargetFlags & nTargetType; ! bool bInRange = mfTargetRange <= info.mfRange_km; if (bCompatible && info.mnQuantity) { *************** *** 479,483 **** { info.mnLauncher = -1; ! int nCount = GetLauncherCount(); if ((anLauncher < 0)||(anLauncher >= nCount)) --- 483,488 ---- { info.mnLauncher = -1; ! info.launcherStatus = tcLauncher::LAUNCHER_BUSY; ! int nCount = GetLauncherCount(); if ((anLauncher < 0)||(anLauncher >= nCount)) *************** *** 486,500 **** } ! const tcLauncher* const pLauncherData = mpPlatformObj->mcLauncherState.GetLauncher(anLauncher); ! wxASSERT(pLauncherData); // convert engagement sector values to degrees ! info.sectorCenter = C_180OVERPI * pLauncherData->GetSectorCenter(); ! info.sectorWidth = C_180OVERPI * pLauncherData->GetSectorWidth(); info.maxDepth_m = 0; if (tcMissileDBObject* missileDBObj = ! dynamic_cast<tcMissileDBObject*>(pLauncherData->mpChildDBObj)) { info.mfRange_km = missileDBObj->mfRange_km; --- 491,512 ---- } ! const tcLauncher* const pLauncher = mpPlatformObj->mcLauncherState.GetLauncher(anLauncher); ! wxASSERT(pLauncher); ! ! info.launcherStatus = pLauncher->GetLauncherStatus(); ! if ((info.launcherStatus == tcLauncher::LAUNCHER_BUSY) || ! (info.launcherStatus >= tcLauncher::NOT_DETECTED_FC)) ! { ! return false; ! } // convert engagement sector values to degrees ! info.sectorCenter = C_180OVERPI * pLauncher->GetSectorCenter(); ! info.sectorWidth = C_180OVERPI * pLauncher->GetSectorWidth(); info.maxDepth_m = 0; if (tcMissileDBObject* missileDBObj = ! dynamic_cast<tcMissileDBObject*>(pLauncher->mpChildDBObj)) { info.mfRange_km = missileDBObj->mfRange_km; *************** *** 502,511 **** } else if (tcBallisticDBObject* ballisticDBObj = ! dynamic_cast<tcBallisticDBObject*>(pLauncherData->mpChildDBObj)) { info.mfRange_km = 20; } else if (tcTorpedoDBObject* torpDBObj = ! dynamic_cast<tcTorpedoDBObject*>(pLauncherData->mpChildDBObj)) { info.mfRange_km = torpDBObj->mfRange_km; --- 514,523 ---- } else if (tcBallisticDBObject* ballisticDBObj = ! dynamic_cast<tcBallisticDBObject*>(pLauncher->mpChildDBObj)) { info.mfRange_km = 20; } else if (tcTorpedoDBObject* torpDBObj = ! dynamic_cast<tcTorpedoDBObject*>(pLauncher->mpChildDBObj)) { info.mfRange_km = torpDBObj->mfRange_km; *************** *** 513,530 **** } else { ! fprintf(stderr, "Error - unsupported launcher child class (%s)\n", ! pLauncherData->mpChildDBObj->GetClassName()); return false; } info.mnLauncher = anLauncher; ! info.mnQuantity = pLauncherData->mnUncommitted; ! info.mnTargetFlags = pLauncherData->mnTargetFlags; ! if (pLauncherData->meLaunchMode == DATUM_ONLY) { info.mnLaunchMode = 0; } ! else if (pLauncherData->meLaunchMode == SEEKER_TRACK) { info.mnLaunchMode = 1; --- 525,542 ---- } else { ! //fprintf(stderr, "Error - unsupported launcher child class (%s)\n", ! // pLauncher->mpChildDBObj->GetClassName()); return false; } info.mnLauncher = anLauncher; ! info.mnQuantity = pLauncher->mnUncommitted; ! info.mnTargetFlags = pLauncher->mnTargetFlags; ! if (pLauncher->meLaunchMode == DATUM_ONLY) { info.mnLaunchMode = 0; } ! else if (pLauncher->meLaunchMode == SEEKER_TRACK) { info.mnLaunchMode = 1; Index: tcPlatformInterfaceExtension.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterfaceExtension.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcPlatformInterfaceExtension.cpp 2 Mar 2005 22:28:44 -0000 1.15 --- tcPlatformInterfaceExtension.cpp 10 Mar 2005 03:28:29 -0000 1.16 *************** *** 58,61 **** --- 58,64 ---- .def("IsSurface", &tcTrack::IsSurface) .def("IsGround", &tcTrack::IsGround) + .def("IsSub", &tcTrack::IsSub) + .def("IsTorpedo", &tcTrack::IsTorpedo) + .def("IsBearingOnly", &tcTrack::IsBearingOnly) .def("IsValid", &tcTrack::IsValid) .def("Offset", &tcTrack::Offset) *************** *** 77,80 **** --- 80,86 ---- .def("IsSurface", &tcSensorMapTrack::IsSurface) .def("IsGround", &tcSensorMapTrack::IsGround) + .def("IsSub", &tcSensorMapTrack::IsSub) + .def("IsTorpedo", &tcSensorMapTrack::IsTorpedo) + .def("IsBearingOnly", &tcSensorMapTrack::IsBearingOnly) .def("IsValid", &tcSensorMapTrack::IsValid) .def("Offset", &tcSensorMapTrack::Offset) |