Today during the ISC/TCS shift the following changes to the Automation regarding TCS have been done:
TCS_MAIN:
- after a refinement about the sequence of the needed measurements, the "Dark" acquisition has been removed and the logic correspondingly reworked;
 - the logic for the automatic switch from one HWS to the other at each "successful" lock has been updated and it is now working; the caveat about its reset when the node starts or it is reloaded is still valid, as it cannot be avoided; a manual change of the starting_hws parameter and a forced LOAD does the job of forcing the switch;
 - the corner case about the directory name has been avoided by directly reading from disk the directory itself, after a little timeout to make sure that such directory actually exists;
 - using the node, though, the acquisition apparently stops after the 41st wavefront, as the last images get overwritten instead of new ones being created, and the WF generation does not progress as it cannot find the new ones; this does not happen launching the acquisition by hand; it is unclear where the issue is, as the scripts used by Metatron and by humans are not the same (the files are identical, so the difference is in the routine which cycles the measurements indefinitely), but Metatron anyway still keeps sending correctly the acquisition commands to the PyHWS server, and in fact the images are generated, but with a wrong name. To be investigated.
 
DRMI_LOCK:
- two new states now exist: KEEPING_ALIGNED_PR_SR and ALIGNED_PR_SR: this is a new path which originates from the DOWN state, and it can be used instead of the usual DOWN -> MISALIGNED_PR_SR path once the ITF goes in DOWN; this will keep the two mirrors aligned; this should NOT be done by hand, but using ITF_LOCK;
 - new states layout is attached.
 
ITF_LOCK:
- a new boolean parameter now exists, keep_aligned (section [ITF_LOCK] of the configuration file); when True, as ITF_LOCK goes to DOWN will ask DRMI_LOCK to use the new path instead of the usual one, keeping the PR and SR aligned, actually asking them to align, in sequence (SR first as usual); this should also prevent the PR mirror from self-parking due to the protection, as it will realign it almost immediately. SR is not affected by this and the state request is only for safety and consistency;
 - the same boolean also needs to drive the fact that in such case the Central Heating will NOT be re-engaged again after an unlock; for this reason, the commands for the CH have been moved from the DOWN state of DRMI_LOCK to the same state of ITF_LOCK, to steer them both from top-level with a single flag;
 - evidently, the parameter must be prepared in advance and not waiting for the unlock to happen;
 - this has not been tested yet, and for the time being people should be aware of this before trying a full lock acquisition again after using the new feature, if they need already; currently the FMODERR_TUNED state is not safe against this, and it will need to be modified to reinforce the correct MISALIGNED_PR_SR state before moving on; what was tested is instead that everything works as usual when keep_aligned = False. Ask before using this new feature and/or if the recycling mirror do not get misaligned afterwards.
 
ARMS_LOCK:
- I reduced the dither_wait time for the LOCKED_ARMS_IR state from 120 s to 90 s.