|
|
|
@ -45,6 +45,7 @@ deviceNodeCamera::deviceNodeCamera(uint32_t NodeID) : |
|
|
|
// m_pLog = basicLogCollection::getInstance();
|
|
|
|
m_pBEH = basicEventHeap::getInstance(); |
|
|
|
m_bSkeepPositioningWait = true; |
|
|
|
m_bNoMoveDoneReport = false; |
|
|
|
m_bNoAbsPositionning = false; |
|
|
|
m_bCameraOnHomePosition = false; |
|
|
|
m_tTimeTSeconds = 0; |
|
|
|
@ -77,6 +78,7 @@ deviceNodeCamera::deviceNodeCamera(DBC_NODE_DATA * Data) : |
|
|
|
// m_pLog = basicLogCollection::getInstance();
|
|
|
|
m_pBEH = basicEventHeap::getInstance(); |
|
|
|
m_bSkeepPositioningWait = true; |
|
|
|
m_bNoMoveDoneReport = false; |
|
|
|
m_bNoAbsPositionning = false; |
|
|
|
m_bCameraOnHomePosition = false; |
|
|
|
m_tTimeTSeconds = 0; |
|
|
|
@ -578,6 +580,7 @@ bool deviceNodeCamera::create() |
|
|
|
load_presets(); |
|
|
|
|
|
|
|
mojoKernel * tKRNL = mojoKernel::getInstance(); |
|
|
|
m_bNoMoveDoneReport = false; |
|
|
|
if (tKRNL) |
|
|
|
{ |
|
|
|
m_bSkeepPositioningWait = ((tKRNL->getMediaMode() & EVE_OUTPUT_VIDEO) == EVE_OUTPUT_VIDEO); |
|
|
|
@ -1342,6 +1345,7 @@ void deviceNodeCamera::m_fThreadProc(void) |
|
|
|
load_presets(); |
|
|
|
|
|
|
|
mojoKernel * tKRNL = mojoKernel::getInstance(); |
|
|
|
m_bNoMoveDoneReport = false; |
|
|
|
if (tKRNL) |
|
|
|
{ |
|
|
|
m_bSkeepPositioningWait = ((tKRNL->getMediaMode() & EVE_OUTPUT_VIDEO) == EVE_OUTPUT_VIDEO); |
|
|
|
@ -1740,45 +1744,9 @@ void deviceNodeCamera::m_fThreadProc(void) |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
// Waiting Movement finish
|
|
|
|
if (m_bSkeepPositioningWait) |
|
|
|
{ |
|
|
|
#ifdef DEBUG_EXTRA
|
|
|
|
LOG("INSTANT BCAST CAM ONPOS"); |
|
|
|
#endif
|
|
|
|
// Send Capture event
|
|
|
|
#ifndef NO_CAMERA_FUSION_ENGINE
|
|
|
|
DBC_SNAPSHOT_DATA * tData = fusion_translate_ROI(m_pCurrentROI); |
|
|
|
#else
|
|
|
|
DBC_SNAPSHOT_DATA * tData = NULL; |
|
|
|
#endif
|
|
|
|
if (tData != NULL) |
|
|
|
{ |
|
|
|
if (m_pBEH) |
|
|
|
{ |
|
|
|
EVENT_CONTAINER * tEVT = createBasicEvent(m_sNodeData.node_id, EVT_CLASS_CAMERA_CTRL, EVT_CAMERA_ON_POSITION, NULL, NULL, tData); |
|
|
|
if (tEVT) |
|
|
|
{ |
|
|
|
m_pBEH->broadcast(tEVT); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
//free(tData);
|
|
|
|
delete(tData); |
|
|
|
}; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
//free(tData);
|
|
|
|
delete(tData); |
|
|
|
}; |
|
|
|
}; |
|
|
|
setWM(CAM_WS_READY); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
setWM(CAM_WS_WAIT_ONPOS); |
|
|
|
}; |
|
|
|
// EVT_CAMERA_ON_POSITION is sent from CAM_WS_WAIT_ONPOS once the move is done
|
|
|
|
// (before, with video output it was sent right after the command).
|
|
|
|
setWM(CAM_WS_WAIT_ONPOS); |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
@ -1806,16 +1774,19 @@ void deviceNodeCamera::m_fThreadProc(void) |
|
|
|
#ifdef DEBUG_EXTRA
|
|
|
|
LOG("Start Waiting Cam On Position!"); |
|
|
|
#endif
|
|
|
|
if (! m_bSkeepPositioningWait) |
|
|
|
// Target-driven ABS / preset move: EVT_CAMERA_ON_POSITION only after the move is done.
|
|
|
|
// Protocols that cannot report the end of a move get a fixed wait.
|
|
|
|
if (! m_bNoMoveDoneReport) |
|
|
|
{ |
|
|
|
if (! m_pProtocol->waitMoveIsDone()) |
|
|
|
{ |
|
|
|
m_bSkeepPositioningWait = true; |
|
|
|
LOG("Protocol cannot report the end of a move -> fixed wait"); |
|
|
|
m_bNoMoveDoneReport = true; |
|
|
|
} |
|
|
|
}; |
|
|
|
if (m_bSkeepPositioningWait) |
|
|
|
if (m_bNoMoveDoneReport) |
|
|
|
{ |
|
|
|
SLEEP(3000); |
|
|
|
SLEEP(CAM_MOVE_FIXED_WAIT_MS); |
|
|
|
} |
|
|
|
#ifdef DEBUG_EXTRA
|
|
|
|
LOG("Done Waiting Cam On Position!"); |
|
|
|
|