OpenPHDGuiding / phd2

PHD2 Guiding
https://openphdguiding.org
BSD 3-Clause "New" or "Revised" License
250 stars 114 forks source link

Star profile #1082

Closed bwdev01 closed 1 year ago

bwdev01 commented 1 year ago

I forgot about persisting the choice, meant to do that. ☹ These are all good suggestions, I’ll take care of them tomorrow. Thanks.

From: Andy Galasso @.> Sent: Saturday, June 24, 2023 10:01 PM To: OpenPHDGuiding/phd2 @.> Cc: bwdev01 @.>; Author @.> Subject: Re: [OpenPHDGuiding/phd2] Star profile (PR #1082)

@agalasso commented on this pull request.


In star_profile.cpp https://github.com/OpenPHDGuiding/phd2/pull/1082#discussion_r1241028772 :

@@ -53,6 +53,7 @@ ProfileWindow::ProfileWindow(wxWindow *parent) :

 this->visible = false;
 this->mode = 0; // 2D profile

can we make this persistent? (a bool setting in pConfig->Global)


In star_profile.cpp https://github.com/OpenPHDGuiding/phd2/pull/1082#discussion_r1241028819 :

     wxMemoryDC tmpMdc;
  • tmpMdc.SelectObject(zoomedDBmp);
  • wxString toggleMsg;
  • // Build the temp DC with one of two scaling options
  • if (!rawMode)
  • {
  • tmpMdc.SelectObject(wxBitmap(subDImg.Rescale(width, width, wxIMAGE_QUALITY_HIGH)));
  • toggleMsg = _("Click image for 'raw' view");

⬇️ Suggested change

In star_profile.cpp https://github.com/OpenPHDGuiding/phd2/pull/1082#discussion_r1241028841 :

     wxMemoryDC tmpMdc;
  • tmpMdc.SelectObject(zoomedDBmp);
  • wxString toggleMsg;
  • // Build the temp DC with one of two scaling options
  • if (!rawMode)
  • {
  • tmpMdc.SelectObject(wxBitmap(subDImg.Rescale(width, width, wxIMAGE_QUALITY_HIGH)));
  • toggleMsg = _("Click image for 'raw' view");
  • }
  • else
  • {
  • tmpMdc.SelectObject(wxBitmap(subDImg.Rescale(width, width, wxIMAGE_QUALITY_NEAREST)));
  • toggleMsg = _("Click image for 'interpolated' view");

⬇️ Suggested change

In star_profile.cpp https://github.com/OpenPHDGuiding/phd2/pull/1082#discussion_r1241030282 :

     wxMemoryDC tmpMdc;
  • tmpMdc.SelectObject(zoomedDBmp);
  • wxString toggleMsg;
  • // Build the temp DC with one of two scaling options
  • if (!rawMode)
  • {
  • tmpMdc.SelectObject(wxBitmap(subDImg.Rescale(width, width, wxIMAGE_QUALITY_HIGH)));

this is ok, but It think it will be slightly clearer to not repeat the SelectObject code in both branches of the if (the reader can more easily see that the only difference between the branches is the resize quality and the toggle message)

    wxImageResizeQuality resizeQuality;
    wxString toggleMsg;
    if (rawMode)
    {
        resizeQuality = wxIMAGE_QUALITY_NEAREST;
        toggleMsg = _("Click image for interpolated view");
    }
    else
    {
        resizeQuality = wxIMAGE_QUALITY_HIGH;
        toggleMsg = _("Click image for raw view");
    }
    wxImage subDImg = subDBmp.ConvertToImage();
    wxMemoryDC tmpMdc;
    tmpMdc.SelectObject(wxBitmap(subDImg.Rescale(width, width, resizeQuality)));

— Reply to this email directly, view it on GitHub https://github.com/OpenPHDGuiding/phd2/pull/1082#pullrequestreview-1496893481 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDHSVYYR7MUNNCS3ZVPEBTXM7AXRANCNFSM6AAAAAAZSXZJOQ . You are receiving this because you authored the thread. https://github.com/notifications/beacon/ADDHSV5RHVOENG574TD7KVTXM7AXRA5CNFSM6AAAAAAZSXZJOSWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTSZHDECS.gif Message ID: @. @.> >