Fix manualfocusdrive based focus bug due to fix in commit de12d97ddefc
ClosedPublic

Authored by zyziuk on Jan 7 2020, 11:37 PM.

Details

Summary

Manualfocusdrive command needs to get negative numbers for inward direction.
Next step is to replace conditional logic with e.g. strategy pattern

Test Plan

Regression tests on the simulator and Canon 40D for relative focus position
Test on Nikon Z6, Nikon D 7100, Canon 40D for manualfocusdrive with iterative and polynominal algorithms.

Diff Detail

Repository
R321 KStars
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
zyziuk created this revision.Jan 7 2020, 11:37 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptJan 7 2020, 11:37 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
zyziuk requested review of this revision.Jan 7 2020, 11:37 PM
zyziuk edited the test plan for this revision. (Show Details)Jan 8 2020, 12:41 AM

I cannot test this, so I offer pedantic comments ;)

kstars/indi/indifocuser.cpp
178

This makes "steps" the opposite of its previous value. If your intent is to make an inward move result in a negative value, you should consider the sign of "steps" at some point.

185

If your observation is that the Z6 fails on steps = 1, you should test for that. Your code is stating that values - 1, 0 and +1 make the Z6 fail.

If you noticed your specific device has a deviation, you might want to create an informative flag when the property is created, instead of comparing a string everytime you move the focuser. But this is minor.

zyziuk updated this revision to Diff 73165.Jan 9 2020, 11:45 PM
zyziuk marked 2 inline comments as done.

Code refactor due to comments

Tested according to testplan, works fine. Thanks for comments.

mutlaqja accepted this revision.Jan 10 2020, 10:39 AM
This revision is now accepted and ready to land.Jan 10 2020, 10:39 AM
This revision was automatically updated to reflect the committed changes.