Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request to correct the logic for setting m_pLaunchDarks control in profile_wizard.cpp #1271

Open
Eyeke2 opened this issue Dec 28, 2024 · 2 comments

Comments

@Eyeke2
Copy link
Contributor

Eyeke2 commented Dec 28, 2024

In the STATE_WRAPUP case block of profile_wizard.cpp, the line:
m_pLaunchDarks->SetValue(m_useCamera || m_pLaunchDarks);

appears problematic, as m_pLaunchDarks is both the target and part of the condition. This could lead to unintended behavior.
If the intended logic is to enable the control when either m_useCamera or m_launchDarks is true:
m_pLaunchDarks->SetValue(m_useCamera || m_launchDarks);

To enable the control only when both are true:
m_pLaunchDarks->SetValue(m_useCamera && m_launchDarks);

Relevant section from the STATE_WRAPUP block:

case STATE_WRAPUP:
    SetTitle(TitlePrefix + _("Finish Creating Your New Profile"));
    m_pGearGrid->Show(false);
    m_pWrapUp->Show(true);
    m_pNextBtn->SetLabel(_("Finish"));
    m_pNextBtn->SetToolTip(_("Finish creating the equipment profile"));
    m_pLaunchDarks->SetValue(m_useCamera || m_pLaunchDarks);
    m_pInstructions->SetLabel(_("Enter a name for your profile and optionally launch the process to build a dark library"));
    m_pAutoRestore->Show(m_PositionAware || m_SelectedAuxMount != _("None"));
    m_pAutoRestore->SetValue(m_autoRestore);
    SetSizerAndFit(m_pvSizer);
    break;
@Eyeke2
Copy link
Contributor Author

Eyeke2 commented Dec 28, 2024

@bwdev01 @agalasso

Eyeke2 added a commit to Eyeke2/phd2.planetary that referenced this issue Dec 28, 2024
Signed-off-by: Leo Shatz <leonid.shatz@gmail.com>
@bwdev01
Copy link
Contributor

bwdev01 commented Dec 28, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants