Can update options automatically, get notification of value change - #12483
Conversation
52396d1 to
2d10190
Compare
954d423 to
6730ac6
Compare
…wake from sleep when stopping
|
|
||
| options_watcher::~options_watcher() | ||
| { | ||
| _alive = false; |
There was a problem hiding this comment.
Don't need to clear _options inside a mutex any more; don't need the try-catch, either.
There was a problem hiding this comment.
Not locking before clear. try-catch needed because clear and join might throw.
There was a problem hiding this comment.
But you don't need the clear()...
There was a problem hiding this comment.
And if join() might throw, please catch it inside stop()...
There was a problem hiding this comment.
I prefer to clear explicitly, but locking is not needed.
Also found out clear has a noexcept overload. Catching join errors in stop.
There was a problem hiding this comment.
I'm sorry, I don't agree - if you clear, then a lock is necessary.
You don't need to clear.
f499e19 to
cd0b14e
Compare
| rsutils::subscription register_options_changed_callback( options_watcher::callback && cb ) override | ||
| { | ||
| throw not_implemented_exception( "Registering options value changed callback is not implemented for this sensor" ); | ||
| LOG_ERROR( "Registering options value changed callback is not implemented for this sensor" ); |
There was a problem hiding this comment.
Why? I don't think this is good...?
There was a problem hiding this comment.
If we throw then the viewer cannot play recorded files
There was a problem hiding this comment.
Reverted change. Viewer handling the exception
de5c1c8 to
45df20e
Compare
…tions setting callback.
45df20e to
08f25fb
Compare
8a431c8 to
9bbe102
Compare
Added option_updater class that handles auto query of registered options.
Added C and CPP API to register a value change notification callback .
Added Python API and unit test
Also fixed bug in cpp unit tests - on
restart_first_device_and_return_depth_sensorold device was used after HW reset instead of new device.