YAN-1609 SdpConfigScanProvider implements current_scan and sends start/end_scan notifications
This MR changes the SdpConfigScanProvider
so that it better aligns with the new behaviour expected from ScanProvider
s. It now keeps the current_scan
up to date, and sends start_scan
and end_scan
notifications as appropriate. To achieve this, I've worked on the logic that takes the contents of the Execution Block in the SDP config DB, which previously was limited to purely recognising when a new Scan appeared in the system. The code is more intelligent now, also reading the corresponding Subarray entry from the Config DB to obtain the last Tango command received by the Subarray, which is then used to determine whether our scan provider should follow suit.
Note that to correctly invoke the callbacks, I moved the DB update processing logic to the main thread, while before it ran as part of the separate thread running the SDP config watcher. The watcher still runs on its own thread, but it limits itself to reading the DB entities, ensuring they are correct, and sending them through a queue to the main thread.
The tests have been greatly reworked, making (hopefully) much clearer what precise scenario is being tested. With most of the preparation work now living in a fixture and related class, there are also more tests that cover more scenarios than before.
I left out of this any work related to synchronising the CBF data stream with these obsState transitions -- this MR is big enough as it is, and I'm also late in my delivery, so better to postpone that for a new story/MR.
Tangentially related, I removed all tests using the old pre-ADR-54 AssignResources
command schema. One of the BDD tests we still have in this repo used that file, but instead of adjusting it to use the newer version I simply removed it, since its logic was already duplicated as part of the main battery of tests in the test_spead2_receiver
module. YAN-1640 has been created to remove pre-ADR-54 AssignResources command support across all of our repos.