[datetime] Keep track of recording time trough the different processes#868
[datetime] Keep track of recording time trough the different processes#868Edouard2laire wants to merge 24 commits into
Conversation
|
Moving to draft. This will need to be adjusted once #880 is merged. |
|
Ok. It's ready for review. |
|
Sems i made a manipulation error that lead to the closure of the PR. re-openning :) |
| file_str = cell(length(sInputs), 1); | ||
| for iFile = 1:length(sInputs) | ||
| file_str{iFile} = sprintf('%s : %s', sInputs(iFile).Condition, sMetaData(iFile).F.t0); | ||
| end | ||
| ind = java_dialog('radio', 'Select the acquisition date:', 'Acquisition date', [], file_str, 1); | ||
| NewT0 = sMetaData(ind).F.t0; |
There was a problem hiding this comment.
A process call should not have interactive parts, this stops the execution of pipelines.
A decision should be taken in the case or more than one T0, either a new one or one of the existent (the one for the first file?)
| iInput = find(has_T0); | ||
| file_str = cell(length(iInput), 1); | ||
| for iFile = 1:length(iInput) | ||
| file_str{iFile} = sprintf('%s : %s', sInputs(iInput(iFile)).Condition, sOldTiming{iInput(iFile)}.T0); | ||
| end | ||
| ind = java_dialog('radio', 'Select the acquisition date:', 'Acquisition date', [], file_str, 1); | ||
| iInput = iInput(ind); | ||
| ts0 = datetime(sOldTiming{iInput}.T0, 'InputFormat', 'yyyy-MM-dd''T''HH:mm:ss.SSS'); | ||
| new_T0 = str_datetime(ts0 - duration(0,0, OffsetTime(iInput))); |
There was a problem hiding this comment.
Same as in process_combine_recordings, there should not be interactive calls
| ind = java_dialog('radio', 'Select the acquisition date:', 'Acquisition date', [], file_str, 1); | ||
| NewT0 = sMetaData(ind).F.t0; | ||
| else | ||
| NewT0 = str_datetime(datetime('now')); |
There was a problem hiding this comment.
Do we want to set a T0 even when none of the recordings to sync has it?
| ts0 = datetime(sOldTiming{iInput}.T0, 'InputFormat', 'yyyy-MM-dd''T''HH:mm:ss.SSS'); | ||
| new_T0 = str_datetime(ts0 - duration(0,0, OffsetTime(iInput))); | ||
| else | ||
| new_T0 = str_datetime(datetime('now')); |
There was a problem hiding this comment.
Same as in process_combine_recordings, do we want to set a new T0?
There was a problem hiding this comment.
I just realize this process is missing:
-
A brief description in the GUI:
- Recordings to combine must have similar times for Beginning and End
- The higher
fsamong the files will be used for the resulting file
-
A history entry indicating the files that were combined
This PR is a good moment to add those.
This makes sure all the common processes affect the date of acquisition well
Synchronize recordings
Done. I also added some information in the history about the offset between files.
Combine recordings
Note: For synchronizing and combining recordings, I had to use a user-interaction to find what is the correct date when multiple dates are present. This won't work if those two processes are called from a. script. Is there a better way to do it?