Skip to content

Draft: New flexible method to name filenames using `PlaceholderPath::generateFilename` to resolve issue #54

Kwon-Young Choi requested to merge kchoi/kstars:feat54/step6 into master

New flexible method to name filenames using PlaceholderPath::generateFilename

  • 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 date in ISO8601 format using the original implementation: QDateTime::currentDateTime. Separators must be converted to hyphens. WARNING: the original specification wanted to use the current KStars simulation time, which I don't know how to use
  • 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.

This method is tested using the same test data as TestPlaceholderPath::testFullNamingSequence with only the following modifications:

  • FITSDirectory column is changed into seqFilename the filesystem location of an .esq file
  • a new column format which specifies the format string containing placeholders.
  • the test data is separated into two csv files: testFlexibleNaming_data.csv and testFlexibleNamingChangeBehavior_data.csv.
    • testFlexibleNaming_data.csv contains all test case which should pass
    • testFlexibleNamingChangeBehavior_data.csv contains all test case which are expected to fail because of a change from the original generation behavior. This change is due to 3 inconsistent old generation behavior:
      • duplicated slash in path
      • leading underscore in filename
      • duplicated underscores in filename

Merge request reports

Loading