la_mojo cameras: send EVT_CAMERA_ON_POSITION only when the move is done #12
Merged
ClaudeAI
merged 1 commits from feature/cam-on-position-event into master 31 minutes ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'feature/cam-on-position-event'
Deleting a branch is permanent. It CANNOT be undone. Continue?
Summary
deviceNodePTZCamControl(AbsoluteMove) anddeviceNodePresetCamControl(preset for the ROI) now sendEVT_CAMERA_ON_POSITION(EVT_CLASS_CAMERA_CTRL, already defined inbasicEvent.h) only after the camera has finished moving. Both node classes use the shareddeviceNodeCamerastate machine, so the changes are there. Both move types end inCAM_WS_WAIT_ONPOS, which waits for the end of the move and then broadcasts the event.Changes
m_bSkeepPositioningWait), the event used to be broadcast right after the AbsoluteMove command, before the camera moved. AbsoluteMove now always goes throughCAM_WS_WAIT_ONPOS, like the preset path already did.m_bNoMoveDoneReport.waitMoveIsDone()returned false, meaning the protocol cannot report the end of a move.CAM_MOVE_FIXED_WAIT_MS(3 s) before the event.m_bSkeepPositioningWait, so every later AbsoluteMove broadcast the event immediately.protocolPTZ_ONVIF::goPresetforgets the last AbsoluteMove target. OtherwisewaitMoveIsDone()(from #11) could compare against an old target and end too early.Not changed (on purpose)
These still move without sending the event, since only target-driven moves are in scope:
CAM_WS_GO_HOMING_PRESET)Behaviour change on the device
CAM_WS_WAIT_ONPOSuntil an AbsoluteMove is done. Preset moves already worked this way. Snapshots taken on the event no longer show a moving picture.Testing
g++ -fsyntax-onlywith the la_mojo flags on the changed files and both control nodes. No errors, same warning count as before.EVT_CAMERA_ON_POSITIONand the snapshot come after the camera stops, with and without video output.Generated with Claude Code
https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
8e5bddcd0d.