Browse Source

Map ROI: placeholder for a camera setting - test the point or always look at it

PTZ, preset and static camera controls: a map ROI goes through
if (1) { testFOV then act } else { act }; the condition becomes a camera
setting later (lookAt alone clamps pan/tilt/zoom to the camera's limits,
so every camera would turn to every click).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
pull/29/head
Claude 5 hours ago
parent
commit
d7911074a3
Failed to extract signature
  1. 14
      lib/App/common/deviceNodePTZCamControl.cpp
  2. 16
      lib/App/common/deviceNodePresetCamControl.cpp
  3. 16
      lib/App/common/deviceNodeStaticCamControl.cpp

14
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;
};

16
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;
};

16
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;
};

Loading…
Cancel
Save