Use flexible method to name filenames
Currently Ekos add three checkboxes to add fields within the filename:
- Timestamp
- Filter
- Duration
It would be better to support an extended scheme where it can be represented by simple code.
Please see discussion proposals below. Placeholders must be named from this specification. Class names may be changed for more meaningful denominations if needed. We need the following separate MRs:
-
Prepare a test class TestPlaceholderPath
inTests/capture/test_placeholderpath.(cpp|h)
(copied and adapted fromTests/skyobjects/test_skypoint.(cpp|h)
) and add aTests/capture/CMakeLists.txt
configuration (copied and adapted fromTests/skyobjects/CMakeLists.txt
) adding that class as a test. Empty the test class, but keep an example of a simple test and a fixture-based test. This test class will validate the implementation inEkos::SequenceJob
as a first requirement. -
Design a new class, PlaceholderPath
, instantiated with the filesystem location of an .esq file and with a method returning a filesystem location suitable for a new frame file given an integer frame index. That method will use the KStars simulation clock singleton and the dynamic properties of an argument SchedulerJob to return the same filesystem path as currently used by Capture. In other words, copy the methods naming frame location from Capture and SchedulerJob (but keep the existing code for now). Implement tests and validate that class.
Design, implement and verify management of the following placeholders using PlaceholderPath
and the test class TestPlaceholderPath
:
-
Placeholder '%f', which converts into the name of the .esq file, without extension. -
Placeholders '%d', '%d1'..'%d9', which convert into one of the path levels leading to the .esq file. Placeholders '%d' and '%d1' convert into the folder name holding the .esq file, and placeholders '%dX' convert into folder names 'X-1' levels higher than the .esq file. -
Placeholders '%p', %p1
...%p9
, which convert into the folder path leading to the .esq file. Placeholders '%p' and '%p1' convert into the full folder path, and '%pX' placeholders remove 'X-1' folder levels from the end of the full path. -
Placeholder '%D', which converts into the current KStars simulation time in ISO8601 format. Separators must be converted to hyphens. -
Placeholders '%T', '%e', '%F', which respectively convert into the frame type ('Light', 'Bias', 'Dark', 'Flat'...), the exposure time in seconds (in minimal decimal format) and the filter name currently in use (from Filter Manager). -
Placeholder '%t', which converts into the current target prefix received by Capture. -
Placeholders '%s1'...'%s9', which convert into the current sequence identifier. Placeholder '%pX' converts into an integer number padded with zeroes on left for a total of X characters. The sequence identifier is given by Capture::checkSeqBoundary
, and is out of scope here.
Then:
-
Provide a method that returns a wildcard string from those placeholders, for Capture to be able to filter frame files already present and determine the next sequence identifier in Capture::checkSeqBoundary
. -
Remove all frame file location code from Capture and SchedulerJob and introduce the new class. -
Create a new Ekos option to hold the default frame location for all .esq files that do not provide one. Use that value when the XML field of SequenceJob
is found empty.
Edited by Eric Dejouhanet