diff --git a/lib/App/common/deviceNodePTZCamControl.cpp b/lib/App/common/deviceNodePTZCamControl.cpp index 7ba23747..791eefe4 100644 --- a/lib/App/common/deviceNodePTZCamControl.cpp +++ b/lib/App/common/deviceNodePTZCamControl.cpp @@ -59,8 +59,18 @@ bool deviceNodePTZCamControl::dispatchEvent(EVENT_CONTAINER * E) case EVT_ROI_ACTIVE:{ if ( !m_bCameraAIControled ) { TARGET_DATA *tDATA = (TARGET_DATA *)E->m_pEvtData; - // a map ROI (kernel, EVT_CLASS_SYSTEM) has no preferred camera: only the cameras that can see it - if( tDATA && ( E->m_eClass != EVT_CLASS_SYSTEM || testFOV( tDATA->system_target ) ) ) lookAt(E->m_db_id, tDATA->system_target); + if( tDATA ){ + if( E->m_eClass == EVT_CLASS_SYSTEM ){ + // Map ROI (kernel): no preferred camera + if( 1 ){ // ToDo: camera setting - only when the point passes the camera's test (range, pan limits, FOV) + if( testFOV( tDATA->system_target ) ) lookAt(E->m_db_id, tDATA->system_target); + } else { // every camera turns to it (lookAt clamps pan/tilt/zoom to the camera's limits) + lookAt(E->m_db_id, tDATA->system_target); + }; + } else { + lookAt(E->m_db_id, tDATA->system_target); + }; + }; } break; }; diff --git a/lib/App/common/deviceNodePresetCamControl.cpp b/lib/App/common/deviceNodePresetCamControl.cpp index a12f35dc..faf213c2 100644 --- a/lib/App/common/deviceNodePresetCamControl.cpp +++ b/lib/App/common/deviceNodePresetCamControl.cpp @@ -60,11 +60,21 @@ bool deviceNodePresetCamControl::dispatchEvent(EVENT_CONTAINER * E) { case EVT_CLASS_SYSTEM: { - // Map ROI (kernel): the cameras that can see the point + // Map ROI (kernel): no preferred camera TARGET_DATA * tDATA = (TARGET_DATA *) E->m_pEvtData; - if (E->m_eType == EVT_ROI_ACTIVE && tDATA != NULL && testFOV(tDATA->system_target)) + if (E->m_eType == EVT_ROI_ACTIVE && tDATA != NULL) { - lookAt(E->m_db_id, tDATA->system_target); + if (1) // ToDo: camera setting - only when the point passes the camera's test (range, pan limits, FOV) + { + if (testFOV(tDATA->system_target)) + { + lookAt(E->m_db_id, tDATA->system_target); + }; + } + else // every camera acts on it + { + lookAt(E->m_db_id, tDATA->system_target); + }; }; break; }; diff --git a/lib/App/common/deviceNodeStaticCamControl.cpp b/lib/App/common/deviceNodeStaticCamControl.cpp index 690e2912..7b880986 100644 --- a/lib/App/common/deviceNodeStaticCamControl.cpp +++ b/lib/App/common/deviceNodeStaticCamControl.cpp @@ -92,11 +92,21 @@ bool deviceNodeStaticCamControl::dispatchEvent(EVENT_CONTAINER * E) { case EVT_CLASS_SYSTEM: { - // Map ROI (kernel): the cameras that can see the point + // Map ROI (kernel): no preferred camera TARGET_DATA * tDATA = (TARGET_DATA *) E->m_pEvtData; - if (E->m_eType == EVT_ROI_ACTIVE && tDATA != NULL && testFOV(tDATA->system_target)) + if (E->m_eType == EVT_ROI_ACTIVE && tDATA != NULL) { - makeSnap(E->m_db_id); + if (1) // ToDo: camera setting - only when the point passes the camera's test (range, pan limits, FOV) + { + if (testFOV(tDATA->system_target)) + { + makeSnap(E->m_db_id); + }; + } + else // every camera acts on it + { + makeSnap(E->m_db_id); + }; }; break; };