Skip to content

Comments

Dalework#261

Closed
githubdoe wants to merge 3 commits intomasterfrom
dalework
Closed

Dalework#261
githubdoe wants to merge 3 commits intomasterfrom
dalework

Conversation

@githubdoe
Copy link
Owner

@githubdoe githubdoe commented Nov 6, 2025

I think Dalework is ready to be pulled into master.

EDIT by atsju:
This concerns #256

Igramarea.cpp
Added e hot key command to enable outline edge zoom.

MainWindow.cpp

  • Added igram downloader using the “u” hot key will downoad image from skysolve camera at it’s URL of 192.168.50.5:5000. (specialized and not configurable). Could be set into preferences but still only appropriate for getting images from Skysolve.
  • Added ‘i’ hot key igram import igram from latest file in dir x where x is set in preferences.
  • Added “s” hot key to save current wave front.

main.cpp

  • Added DPI scaling command but it did not seem to help.

Profileplot.cpp

  • Enabled context menu and added change x axis to percent, inches, or mm(default)
  • Moved percent correction command into this menu.

Simulationview.cpp

  • Corrected Gaussian Blur calculation.
  • Changed top pushbuttons for make scan film and make to checkboxes. Because then their text is not tiny like it was for when they were buttons on high DPI screens.
  • Reduced file name path to last dir on the top line.

Added startest movie function.

	Added e hot key command to enable outline edge zoom.

MainWindow.cpp
	Added igram downloader using the “u” hot key will downoad image from skysolve camera at it’s URL of 192.168.50.5:5000.  (specialized and not configurable).  Could be set into preferences  but still only appropriate for getting images from Skysolve.
	Added ‘i’ hot key igram import igram from latest file in dir x where x is set in preferences.
	Added “s” hot key to save current wave front.

main.cpp
	Added DPI scaling command but it did not seem to help.

Profileplot.cpp
	Enabled context menu and added change x axis to percent, inches, or mm(default)
	Moved percent correction command into this menu.

Simulationview.cpp
	Corrected Gaussian Blur calculation.
	Changed top pushbuttons for make scan film and make to checkboxes.  Because then their 	text is not tiny like it was for when they were buttons on high DPI screens.
	Reduced file name path to last dir on the top line.

Added startest movie function.
@atsju
Copy link
Collaborator

atsju commented Nov 7, 2025

I will compare this to the way I merged to point out things that need to be double checked.
I can also look at fixing the build but maybe it will take time (I have not much time this Weekend).

@githubdoe can you shortly describe the changes/features brought by this PR ? So we can keep track in title and description

@gr5
Copy link
Collaborator

gr5 commented Nov 7, 2025

you shortly describe

He has like a 20 or 30 line commit message. I'll go find it...

@gr5
Copy link
Collaborator

gr5 commented Nov 7, 2025

Igramarea.cpp
	Added e hot key command to enable outline edge zoom.

MainWindow.cpp
	Added igram downloader using the “u” hot key will downoad image from skysolve camera at it’s URL of 192.168.50.5:5000.  (specialized and not configurable).  Could be set into preferences  but still only appropriate for getting images from Skysolve.
	Added ‘i’ hot key igram import igram from latest file in dir x where x is set in preferences.
	Added “s” hot key to save current wave front.

main.cpp
	Added DPI scaling command but it did not seem to help.

Profileplot.cpp
	Enabled context menu and added change x axis to percent, inches, or mm(default)
	Moved percent correction command into this menu.

Simulationview.cpp
	Corrected Gaussian Blur calculation.
	Changed top pushbuttons for make scan film and make to checkboxes.  Because then their 	text is not tiny like it was for when they were buttons on high DPI screens.
	Reduced file name path to last dir on the top line.

Added startest movie function.

@atsju
Copy link
Collaborator

atsju commented Nov 7, 2025

I missed that. Thanks a lot

Copy link
Collaborator

@atsju atsju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are some things I noticed that are or could be wrong merge conflict solving.
I did not check how ui files have been merged and do not plan to do. Test will tell.

I have not reviewed actuel code yet. This is a seconds step.

How do you want to proceed ? Should I commit into Dalework to fix build and what I noticed here ? Or I do a PR targeting Dalework ?

QString txt = (zoomed)? "Restore to MainWindow" : "FullScreen";
myMenu.addAction(txt, this, &ProfilePlot::zoom);

myMenu.addAction(txt, this, SLOT(zoom()));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
myMenu.addAction(txt, this, SLOT(zoom()));
myMenu.addAction(txt, this, &ProfilePlot::zoom);

Comment on lines +122 to +125

connect(slopeLimitSB, SIGNAL(valueChanged(double)), this, SLOT(slopeLimit(double)));
connect(showSlopeError,SIGNAL(clicked(bool)), this, SLOT(showSlope(bool)));

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
connect(slopeLimitSB, SIGNAL(valueChanged(double)), this, SLOT(slopeLimit(double)));
connect(showSlopeError,SIGNAL(clicked(bool)), this, SLOT(showSlope(bool)));

Bad merge conflict solve. New style connect is already just after.
This suggestion needs to be committed for sure

Comment on lines +96 to +98
connect(&m_guiTimer, SIGNAL(timeout()), this, SLOT(on_MakePB_clicked()));
connect(this, SIGNAL(customContextMenuRequested(QPoint)), this,
SLOT(showContextMenu(QPoint)));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
connect(&m_guiTimer, SIGNAL(timeout()), this, SLOT(on_MakePB_clicked()));
connect(this, SIGNAL(customContextMenuRequested(QPoint)), this,
SLOT(showContextMenu(QPoint)));
connect(&m_guiTimer, &QTimer::timeout, this, &SimulationsView::on_MakePB_clicked);
connect(this, &QWidget::customContextMenuRequested, this,
&SimulationsView::showContextMenu);

this is regression from main. Unless there was an issue, we want new style as it was

Comment on lines -118 to -123
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
// keep compatibility with newer version of QWT used in QT6
customLegend->setAlignmentInCanvas(Qt::AlignLeft | Qt::AlignBottom);
#else
customLegend->setAlignment(Qt::AlignLeft | Qt::AlignBottom);
#endif
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot put suggestion on deleted code but bad merge conflict. The initial code comes from main and is working. This is the reason build fails in CI.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix however. That was not deleted by me on purpose.

Comment on lines -148 to -158

void SimulationsView::saveImage(){
void SimulationsView::saveImage(QString fileName){
QSettings settings;
QString path = settings.value("lastPath","").toString();
QString fileName = QFileDialog::getSaveFileName(0,
if (fileName == "")
fileName = QFileDialog::getSaveFileName(0,
"File name for image to be saved", path);

saveImageNamed(fileName);
}

void SimulationsView::saveImageNamed(QString fileName){
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be reverted to main too. Regression.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix however as long as the image can be saved with the given name if supplied.


void SimulationsView::showContextMenu(QPoint pos){
// Handle global position
void SimulationsView::showContextMenu(const QPoint &pos)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
void SimulationsView::showContextMenu(const QPoint &pos)
void SimulationsView::showContextMenu(QPoint pos)

regression from main

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What ever works. It worked for me in my build.

// Create menu and insert some actions
QMenu myMenu;
myMenu.addAction("Save as image", this, &SimulationsView::saveImage); // connects to QAction::triggered(bool checked = false)
myMenu.addAction("Save as image", this, SLOT(saveImage()));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
myMenu.addAction("Save as image", this, SLOT(saveImage()));
myMenu.addAction("Save as image", this, &SimulationsView::saveImage); // connects to QAction::triggered(bool checked = false)

regression from main

#include <opencv2/imgproc.hpp>
using namespace cv;
cv::Mat make_obstructionMask(const cv::Mat &mask){
cv::Mat make_obstructionMask(cv::Mat mask){
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cv::Mat make_obstructionMask(cv::Mat mask){
cv::Mat make_obstructionMask(const cv::Mat &mask){

regression from main

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Comment on lines +85 to +87
void showContextMenu(const QPoint &pos);

void saveImage(QString fname = "");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
void showContextMenu(const QPoint &pos);
void saveImage(QString fname = "");
void showContextMenu(QPoint pos);
void saveImage();

regression from main

Copy link
Collaborator

@atsju atsju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code reviewed

<x>0</x>
<y>0</y>
<width>678</width>
<width>1078</width>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you changed this testing with your Qt5 build.
On the other hand you said Qt6 official 8.1.0 displays correctly.
This needs to be validated with CI build which is the one we distribute to end users.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine to make it "too wide". "too narrow" is more of a problem.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While trying to fix the dialog width I played with some parameters that no longer need to be changed but lost track of what changed.

profileplot.cpp \
profileplotpicker.cpp \
settingsigramimportconfig.cpp \
startestmoviedlg.cpp \
Copy link
Collaborator

@atsju atsju Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in this file need to be ported to DFTFringe_QT5.pro and DFTFringe.pro too

Comment on lines +140 to +142
QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(zoomOut()));
shortcut = new QShortcut(QKeySequence("e"), this);
QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(edgeMode()));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(zoomOut()));
shortcut = new QShortcut(QKeySequence("e"), this);
QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(edgeMode()));
QObject::connect(shortcut, &QShortcut::activated, this, &IgramArea::zoomOut);
shortcut = new QShortcut(QKeySequence("e"), this);
QObject::connect(shortcut, &QShortcut::activated, this, &IgramArea::edgeMode);


int main(int argc, char *argv[])
{
// QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

Qt6 doesn't use this https://doc.qt.io/qt-6/highdpi.html

It seems high DPI is managed much better in Qt6 (as seen in autoinvertdlg). Dale this might be a good reason to migrate

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be.

QObject::connect(shortcut, &QShortcut::activated, this, &MainWindow::importIgram);

shortcut = new QShortcut(QKeySequence(Qt::Key_U), this);
QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(load_from_url()));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(load_from_url()));
QObject::connect(shortcut, &QShortcut::activated, this, &MainWindow::load_from_url);

Comment on lines +2145 to +2148
url.setScheme("http"); // or "https" if using SSL
url.setHost("192.168.50.5"); // Replace with your IP address
url.setPort(5000); // Specify the port
url.setPath("/downloadImage");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this configurable ? If not it looks like some personal feature you don't want into official release as is.

Also it looks like this can be only called with a special shortcut. That's some easter egg at this point

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and I thought I talked about it in the commit comments. Yes view it as an easter egg. It is only good for any user who uses my skysolve camera as their camera for the Bath. I doubt there is such a user. It's code is specific to skysolves html web page.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok you did. I didn't make the link in my brain.
Why not. I recommend to add some comments in the code for futur reader to know why this function is here without digging history

double lower = -m_wf->diameter/2 - 10;
double upper = m_wf->diameter/2 + 10;
if (m_displayInches){
lower = lower /= 25.4;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lower = lower /= 25.4;
lower /= 25.4;

or

Suggested change
lower = lower /= 25.4;
lower = lower / 25.4;

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I've been doing python to long and forgot that C++ syntax. Which python does not always copy.

double upper = m_wf->diameter/2 + 10;
if (m_displayInches){
lower = lower /= 25.4;
upper = upper /= 25.4;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
upper = upper /= 25.4;
upper = upper / 25.4;

or

Suggested change
upper = upper /= 25.4;
upper /= 25.4;

Comment on lines +393 to +395
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move includes at top of file

CppCore is a reliable website with some widely accepted coding rules with great explanations.
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rs-include-order

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. That was intended but during a quick fix just added near by.

return;
int cnt = 0;
for (double wave = .1; wave < 10. ; wave+= .2){
void SimulationsView::makeFrame(double defocus, startestMovieDlg * dlg){
Copy link
Collaborator

@atsju atsju Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix indentation of function

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@gr5
Copy link
Collaborator

gr5 commented Nov 7, 2025

Dale if you look at these online, each small change - typically one or two lines of code - are shown highlighted and clear and you can click the button that says "commit suggestion" if you are okay with the change and it will get checked into this branch which is also your dalework branch (but at some point you should pull it back to your computer).

Julien, I think all the slot/signal ones can be just accepted as is because you are the slot/signal expert among the 3 of us.

Let's see what Dale says.

@githubdoe
Copy link
Owner Author

githubdoe commented Nov 7, 2025

Of all the things I hope you can merge into the master the most important are

  1. Profile plot menu.
  2. The hot keys.
  3. My fix to the blurring in the Ronchi and Foucault simulation.

I will look through all the comments as I have time. Thank you for your work.

@atsju
Copy link
Collaborator

atsju commented Nov 8, 2025

Hi,
I have some time right now. If you are OK I will try to fix the build and take into account the review comments.

If you are fine with that, please do not play/accept with my PR suggestions while I work in background. I will make this in a single commit.

@gr5
Copy link
Collaborator

gr5 commented Nov 8, 2025

please do not play/accept with my PR suggestions

Sounds good. I don't know if you have noticed but Dale's "work hours" in his local time zone appear to be typically 22:00 to 04:00. So he is unlikely to even look at your comments until long after you go to sleep. Like around 06:00 on Sunday for France time zone.

@atsju
Copy link
Collaborator

atsju commented Nov 8, 2025

I'm closing this. Please review #262 instead.

@atsju atsju closed this Nov 8, 2025
@githubdoe
Copy link
Owner Author

My work hours on DFTFringe are anywhere from 10:30 am to 3am CDT. I see comments and usually look at them. I may not have any action on them until late.

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

Successfully merging this pull request may close these issues.

3 participants