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

deselect star when scope starts slewing while looping exposures #868

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions gear_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,9 @@ void GearDialog::OnChoiceScope(wxCommandEvent& event)
throw THROW_INFO("OnChoiceScope: m_pScope == NULL");
}

m_pScope->EnableStopGuidingWhenSlewing(pConfig->Profile.GetBoolean("/scope/StopGuidingWhenSlewing",
m_pScope->CanCheckSlewing()));

m_ascomScopeSelected = choice.Contains("ASCOM");
}
catch (const wxString& Msg)
Expand Down Expand Up @@ -1344,6 +1347,9 @@ void GearDialog::OnChoiceAuxScope(wxCommandEvent& event)
{
throw THROW_INFO("OnAuxChoiceScope: m_pAuxScope == NULL");
}

m_pAuxScope->EnableStopGuidingWhenSlewing(pConfig->Profile.GetBoolean("/scope/StopGuidingWhenSlewingAux",
m_pAuxScope->CanCheckSlewing()));
}
catch (const wxString& Msg)
{
Expand Down
15 changes: 15 additions & 0 deletions guider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,20 @@ void Guider::DisplayImage(usImage *img)
UpdateImageDisplay();
}

static void LoopingCheckSlewing(Guider *guider)
{
if (guider->CurrentPosition().IsValid() &&
pPointingSource &&
pPointingSource->IsConnected() &&
pPointingSource->IsStopGuidingWhenSlewingEnabled() &&
pPointingSource->CanCheckSlewing() &&
pPointingSource->Slewing())
{
Debug.Write(wxS("scope started slewing while looping, deselect\n"));
guider->InvalidateCurrentPosition(true);
}
}

/************* A new image is ready ************************/

void Guider::UpdateGuideState(usImage *pImage, bool bStopping)
Expand Down Expand Up @@ -1243,6 +1257,7 @@ void Guider::UpdateGuideState(usImage *pImage, bool bStopping)
case STATE_SELECTING:
case STATE_SELECTED:
EvtServer.NotifyLooping(pImage->FrameNum);
LoopingCheckSlewing(this);
break;
case STATE_CALIBRATING_PRIMARY:
case STATE_CALIBRATING_SECONDARY:
Expand Down
5 changes: 3 additions & 2 deletions guider.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,14 +274,15 @@ class Guider : public wxWindow
// their operation
private:
virtual void InvalidateLockPosition();

public:
virtual void LoadProfileSettings();

// pure virtual functions -- these MUST be overridden by a subclass
public:
virtual bool IsValidLockPosition(const PHD_Point& pt) = 0;
private:
virtual void InvalidateCurrentPosition(bool fullReset = false) = 0;

private:
virtual bool UpdateCurrentPosition(const usImage *pImage, GuiderOffset *ofs, FrameDroppedInfo *errorInfo) = 0;
virtual bool SetCurrentPosition(const usImage *pImage, const PHD_Point& position) = 0;

Expand Down
7 changes: 0 additions & 7 deletions scope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,13 +457,6 @@ Scope *Scope::Factory(const wxString& choice)
{
throw ERROR_INFO("ScopeFactory: Unknown Scope choice");
}

if (pReturn)
{
// virtual function call means we cannot do this in the Scope constructor
pReturn->EnableStopGuidingWhenSlewing(pConfig->Profile.GetBoolean("/scope/StopGuidingWhenSlewing",
pReturn->CanCheckSlewing()));
}
}
catch (const wxString& Msg)
{
Expand Down