Capture module: fixes for decimal numbers in various locales, and fix for CCD selection
ClosedPublic

Authored by TallFurryMan on Sep 13 2018, 9:07 PM.

Details

Summary

Used system locale to display all numbers in Capture module.
Made sequence file XML serialization always use the C locale for portability.
Loaded whatever value is available for guide deviation, enabled or not.
Loaded whatever HFR value is if file, and reset it if invalid.
Loaded whatever refocus period is in the file, or reset it if invalid.
Loaded whatever RA value is in file for meridian flip.
Displayed proper number of decimals in the job table (based on min exposure time).
Added a warning about HFR-based autofocus serialization.
Fixes selection of current CCD when a sequence file is loaded.

Test Plan

Test plan is to be done at least in:

  • a locale that uses "." as decimal point, such as english
  • a locale that uses "," as decimal point, such as french

The differential is expected to work with variations of decimal points, but will not change how timestamps are displayed.

Load test vector "decimal_values.esq" from folder "Tests/capture" in the Capture module.

Check the exposure field box.

  • With or without the change, it will display proper decimal separator, and convert to a double value without issue.
  • Note the thousands separator is not displayed there.

Check the exposure column in the table.

  • Without the change, it will display as an integer or with "." as decimal separator.
  • With the change, decimal separator relevant to the current locale will be used.
  • Also note the thousands separator properly displaying if the locale requests it.

Execute the job, check that the messages properly display the locale-related number format.

View the test vector in a text editor, and observe the bottom left checkbox settings:

  • Check that guiding deviation is equal to the double value seen in the file, 2 digits after decimal separator.
  • Check that autofocus HFR is equal to the double value seen in the file, 3 digits after decimal separator.
  • Check that refocus periodicity is equal to the integer value seen in the file, no decimal separator.
  • Check that RA hours for meridian flip is equal to the double value seen in the file, 2 digits after decimal separator.

Change the values, checkbox states and jobs in the Capture module (don't do too much at once).
Save the resulting sequence under another name.
Check that all the resulting sequence is using C-language numbers (decimal separator ".", no thousand separator).
Diff against the original test vector, check that only actual changes went in the new sequence file.

About the bottom left checkbox settings, check that values are always loaded from the file, even if the checkbox is not enabled.
Without the change, values from a previous sequence could be retained, leading to unpredictable results.

Depending on the state of option "Save Sequence HFR to File", check that HFR is saved to the sequence and loaded from it, or reset to zero.
Observe the warning if "Save Sequence HFR to File" is disabled and HFR-based autofocus is enabled.

Finally, if you have multiple CCD cameras, prepare a sequence file for each, whatever the content.
Check that each of your sequences is properly selecting the correct CCD, and properly initializes frame information.

Diff Detail

Repository
R321 KStars
Branch
improve__support_decimal_locales (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 2972
Build 2990: arc lint + arc unit
TallFurryMan created this revision.Sep 13 2018, 9:07 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptSep 13 2018, 9:07 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
TallFurryMan requested review of this revision.Sep 13 2018, 9:07 PM

This is part of the fix for https://bugs.kde.org/show_bug.cgi?id=398405. It made sense to me to start with an UI that was close to the Scheduler in terms of behavior, and simpler at the same time.

This is probably arguable, but I took the opportunity to fix https://bugs.kde.org/show_bug.cgi?id=397562 (last line of the description, last paragraph of the test plan).
There might possibly be other parts of the code where QComboBox widgets have their index changed without properly notifying the signal.

I'll issue distinct differentials for the other tabs of Ekos, to keep the changes clear.

Can you rebase against latest master?

Yeah sure I can have a look at conflicts ;)

Can you rebase this please? also, does it fix the http://indilib.org/forum/ekos/3878-capture-settings-900-seconds-are-not-maintained.html#29570 issue reported here? exponential format when using some numbers?

Also, I can confirm that it resets to 900 if the exposure is larger than that when switching between tabs.

I noted the two points. The diff will probably fix the 1e+1 display, that's a 'g' instead of a 'f', but will not fix the 900, which is due to no proper signal/callback being fired when leaving the focus from the widget. As if changes were canceled, sort of.

mutlaqja accepted this revision.Sep 16 2018, 9:56 AM
This revision is now accepted and ready to land.Sep 16 2018, 9:56 AM

Looks like it needs to be rebased

Rebased, and adjusted float format for coherence.

This revision was automatically updated to reflect the committed changes.