That feature was implemented this way because it was centered on the procedure taking a capture. The use case was "I want to refocus every N minutes when I capture". If we move the refocus procedure to the Focus tab, the use case becomes "I want to refocus every N minutes". We then have to manage when the refocus happens exactly. You guessed it, that's exactly the same situation as the meridian flip. That probably means that both needing to focus and needing to flip will be statuses of Focus and Mount respectively, and that the actual request to do one or the other will come from Capture.
I don't think Scheduler gets much different than now in its behavior. For sure code is moved around, and the added benefit is that we try to restrict each procedure to its relevant module. The important point is that we must not center all activities in Ekos on the Scheduler. People must still be able to track the target of their choice manually, engage guiding manually, focus manually and start their manually configured capture job, without any interaction with Scheduler.
Let's try to map these thoughts to Ekos, with extensions that are mostly only brain food to see if nothing breaks (I said Scheduler doesn't get much different...):
- Capture gets a SequenceJob (CaptureStep? CaptureJob?) which has exposure/filter/temperature/... parameters all serialized into a XML file. No focus nor meridian flip. Storage path more user-friendly.
- Capture algorithm, however, checks with Focus if a refocus is required, with Mount if a flip is required (why not with Align, see below), and eventually requests executions of these before capturing. Capture only captures. But Capture also can be a event source for safety, for instance when repeatedly overexposing. Capture can also be a client of Observatory to monitor CCD temperature requirements. But Capture should probably not become the only controller of the CCD, to which other modules request frames. We need to think about multiple Capture modules here.
- Mount gets a TrackJob which has coordinates/HA-flip/limits/park-time all serialized into a XML file.
- Mount algorithm executes slews and does notify flip requirement to listeners, like it does now. Capture is responsible for executing the flip if it is running (else Scheduler probably should). If no-one is listening, then maybe the end-user is observing visually, and we should define what a dangerous positioning is. We could decide to stop tracking if the mount is able to, or to move slightly away to a safer position automatically after a delay, but not to engage a large movement without warning.
- Focus gets a FocusJob which has the usual exposure/settle/field/algorithm... parameters all serialized into a XML file, along with the interval between refocus procedures.
- Focus algorithm does its usual activity, and keeps track of the last time it executed. When the refocus delay elapses, Focus notify the focus requirement much like Mount does for flip. If we have multiple CCD, multiple Capture modules, then maybe we should have multiple Focus modules.
- Alignment gets an AlignmentJob which has the usual exposure/settle/precision... parameters all serialized into a XML file.
- Alignment algorithm does its usual activity. We could store the last time it executed in order to provide periodic realignment to unguided setups, in the same way as Focus or Mount. Alignment could automatically expose and solve when no one else is using the CCD. One improvement too for planetary imaging could be to allow sync'ing on a different target than the current observation object before blind-slewing to that object. Furthermore, we could assign Alignment the job of solving incoming frames in parallel to validate positioning during exposures. In terms of multiple modules, Alignment is 1:1 related to Mount.
- Guide gets a GuideJob which has the usual type/exposure/rate... parameters all serialized into a XML file, along with the deviation limit.
- Guide algorithm does its usual activity. When it notifies a deviation peak, Capture is responsible for suspending exposure (all Capture modules). Like Alignment, in terms of multiple modules, Guide is 1:1 related to Mount.
- Observatory gets an ObservatoryJob which has some of the parameters that were in Scheduler before. It's all brand new here.
- Scheduler gets a SchedulerJob which has the usual parameters all serialized into a XML file, plus a link to all the XJob mentioned above.
- Scheduler algorithm is then responsible for sending those XJob requests to each module in a customized order, and execute robustness monitoring to ensure all execute properly.
(I'll try to copy the points we previously agreed on in the first post of the thread)
-Eric