Automatically update chip config during scan
We need a way to automatically update chip config, based on the results of a scan.
This feature already exists in Yarr, through function ScanHelper::writeFeConfig
(called in ScanConsoleImpl::cleanup
).
In the current state, anything that is written to feCfg
will go into the updated chip config. In principle this does not include the prescan registers, because these are applied through the GlobalFe
. However for strips, we cannot use the GlobalFe
because it overwrites all sub-registers in a register.
Because of this the devel_SR1
branch has applied a hack (!477 (closed)) which loops over Fes and writes the prescan via feCfg
. This means that prescan values are written automatically to the updated chip config, which we don't want.
We see two possible solutions to this:
- before applying the prescan, store the original register values in a list, then, at the end of the scan undo the changes relative to the prescan before calling
ScanHelper::writeFeConfig
to update the config. - create two separate
feCfg
objects afeCfg_final
andfeCfg_tmp
to be updated during the scan. The prescan values would only be applied tofeCfg_tmp
, while all other register configurations that want to be propagated through the scan would be written to bothfeCfg_final
andfeCfg_tmp
. OnlyfeCfg_final
is then used inScanHelper::writeFeConfig
.
In any case, either !477 (closed) or !598 (merged) are needed.