stopping an acquisition in hw saving does not manage the last file
When stopping an ongoing acquisition, Lima stops the detector (ABORT command) which disarms it then it stops the hw saving. Disarm of the detector will finalize the last file and save it on the DCU storage. This can takes some amount of time and in the middle Lima has already stop the file transfer. The last file stays in the DCU storage, and a new acquisition started with the same file prefix will get transferred the file of the previous acquisition.
A first and simple solution to fix this issue consists in clearing the DCU storage before starting a new acquisition (in the prepareAcq()). That means all the remaining images saved in the last file of the previous acquisition will be lost.
A more elegant solution is to wait few seconds after the ABORT command to let the hw saving transferring the last file.