Skip to content

Commit ed69f2b

Browse files
authored
Merge pull request #311 from githubdoe/JST/averageProfileFixes
fix some compile warnings and bitwise operators
2 parents 4a5293b + cb82a26 commit ed69f2b

10 files changed

+19
-61
lines changed

autoinvertdlg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ void autoInvertDlg::enableConic(bool b) {
5656

5757
void autoInvertDlg::on_InvertWithoutAskingRb_clicked(bool checked)
5858
{
59-
59+
Q_UNUSED(checked);
6060
}
6161

autoinvertdlg.ui

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>1295</width>
10-
<height>565</height>
9+
<width>1078</width>
10+
<height>464</height>
1111
</rect>
1212
</property>
1313
<property name="sizePolicy">
@@ -25,7 +25,7 @@
2525
<property name="modal">
2626
<bool>true</bool>
2727
</property>
28-
<layout class="QVBoxLayout" name="verticalLayout_3">
28+
<layout class="QVBoxLayout" name="verticalLayout">
2929
<item>
3030
<widget class="QLabel" name="lblMain">
3131
<property name="font">
@@ -137,48 +137,6 @@
137137
</item>
138138
</layout>
139139
</item>
140-
<item>
141-
<layout class="QVBoxLayout" name="verticalLayout_2">
142-
<item>
143-
<widget class="QLabel" name="label_5">
144-
<property name="text">
145-
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:700;&quot;&gt;What to do if invertions may be detected&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
146-
</property>
147-
<property name="wordWrap">
148-
<bool>true</bool>
149-
</property>
150-
</widget>
151-
</item>
152-
<item>
153-
<layout class="QHBoxLayout" name="horizontalLayout_5">
154-
<item>
155-
<widget class="QRadioButton" name="InvertWithoutAskingRb">
156-
<property name="text">
157-
<string>Don't Ask but Invert</string>
158-
</property>
159-
</widget>
160-
</item>
161-
<item>
162-
<widget class="QRadioButton" name="AskDoNotInvertRb">
163-
<property name="text">
164-
<string>Ask but Don't Invert</string>
165-
</property>
166-
<property name="checked">
167-
<bool>true</bool>
168-
</property>
169-
</widget>
170-
</item>
171-
<item>
172-
<widget class="QRadioButton" name="DoNotAskorInvertRb">
173-
<property name="text">
174-
<string>Don't ask or invert</string>
175-
</property>
176-
</widget>
177-
</item>
178-
</layout>
179-
</item>
180-
</layout>
181-
</item>
182140
<item>
183141
<widget class="QLabel" name="label_6">
184142
<property name="text">

foucaultview.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ QImage foucaultView::generateOpticalTestImage(OpticalTestType type, wavefront* w
213213
double lpi_val = s.lpi * (s.useMM ? 25.4 : 1.0);
214214
int ppl = std::max(1, (int)((0.5 / lpi_val) / pixwidth));
215215
int start = (size / 2) - (ppl / 2);
216-
bool even = ((start / ppl) % 2 == 0) ^ s.clearCenter;
216+
bool even = ((start / ppl) % 2 == 0) != s.clearCenter;
217217
int roffset_start = ppl - (start % ppl);
218218

219219
for (int y = 0; y < size; ++y) {
@@ -298,10 +298,10 @@ void foucaultView::on_makePb_clicked()
298298
QImage foucaultImg = generateOpticalTestImage(OpticalTestType::Foucault, m_wf, settings);
299299

300300
// Store for potential saving/external access
301-
m_foucultQimage = foucaultImg;
301+
m_foucaultQimage = foucaultImg;
302302

303303
// 3. UI Painting Helper (to avoid duplicating the Painter logic)
304-
auto paintAndDisplay = [&](QLabel* label, QImage img, double offsetValue) {
304+
auto paintAndDisplay = [&](QLabel* label, const QImage& img, double offsetValue) {
305305
if (img.isNull()) return;
306306

307307
QSize s = label->size();
@@ -637,7 +637,7 @@ void foucaultView::on_scanPb_clicked()
637637
QString fvpng = QString("%1//%2.png").arg(imageDir).arg(cnt++, 6, 10, QLatin1Char('0'));
638638
qDebug() << "fn"<< fvpng;
639639
if (ui->saveOnlyFouccault->isChecked()){
640-
fv->m_foucultQimage.save(fvpng);
640+
fv->m_foucaultQimage.save(fvpng);
641641
}
642642
else {
643643
fvImage.save(fvpng);

foucaultview.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ private slots:
9292
Ui::foucaultView *ui;
9393
SurfaceManager *m_sm;
9494
QString imageDir;
95-
QImage m_foucultQimage;
95+
QImage m_foucaultQimage;
9696
QTimer m_guiTimer;
9797
int heightMultiply;
9898
double m_sag;

profileplot.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ ProfilePlot::~ProfilePlot(){
224224

225225

226226

227-
void ProfilePlot::SetYoffset(QString name, double value){
227+
void ProfilePlot::SetYoffset(const QString& name, double value){
228228
if (m_waveFrontyOffsets.contains(name)){
229229
m_waveFrontyOffsets[name] += value;
230230
}
@@ -560,7 +560,7 @@ struct RadialBin {
560560
*/
561561
std::vector<double> compute_average_radial_profile(
562562
const cv::Mat& matrix,
563-
const cv::Point& center,
563+
cv::Point center,
564564
int radius)
565565
{
566566
// Check matrix validity
@@ -721,7 +721,7 @@ qDebug() << "Populate";
721721
}
722722
qDebug() << "offsets" << m_waveFrontyOffsets<< y_offset;
723723
// if show one angle
724-
if (m_show_oneAngle or (!m_showAvg and !m_show_16_diameters & !m_show_oneAngle)){
724+
if (m_show_oneAngle or (!m_showAvg and !m_show_16_diameters and !m_show_oneAngle)){
725725

726726
cprofile->setSamples( createProfile( units,wf, true));
727727
cprofile->attach( m_plot );

profileplot.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public slots:
9696
void toggleShow16();
9797
void toggleOneAngle();
9898
void CreateWaveFrontFromAverage();
99-
void SetYoffset(QString name, double value);
99+
void SetYoffset(const QString& name, double value);
100100
//QPolygonF createZernProfile(wavefront *wf);
101101
private:
102102

ronchicomparedialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#include <QWidget>
77
#include <QGuiApplication>
88
#include <QScreen>
9-
RonchiCompareDialog::RonchiCompareDialog(const QImage& img1, const QString name1, const QImage &img2,
10-
const QString name2, QWidget* parent)
9+
RonchiCompareDialog::RonchiCompareDialog(const QImage& img1, const QString& name1, const QImage &img2,
10+
const QString& name2, QWidget* parent)
1111
: QDialog(parent), m_q1(img1), m_q2(img2)
1212
{
1313
setWindowTitle(tr("Ronchi Comparison Overlay"));

ronchicomparedialog.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ class RonchiCompareDialog : public QDialog {
1111
Q_OBJECT
1212

1313
public:
14-
explicit RonchiCompareDialog(const QImage& img1, const QString name1, const QImage &img2,
15-
const QString name2, QWidget* parent);
14+
explicit RonchiCompareDialog(const QImage& img1, const QString& name1, const QImage &img2,
15+
const QString& name2, QWidget* parent);
1616
virtual ~RonchiCompareDialog();
1717

1818
private slots:

wavefrontloaderworker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ WavefrontLoaderWorker::WavefrontLoaderWorker(QObject *parent)
99
{
1010
}
1111

12-
void WavefrontLoaderWorker::process(QStringList args, SurfaceManager* manager) {
12+
void WavefrontLoaderWorker::process(const QStringList& args, SurfaceManager* manager) {
1313
m_isCancelled = false; // Reset the flag for this run
1414
int cnt = 0;
1515

wavefrontloaderworker.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public slots:
1717
/**
1818
* @brief The main loop that processes the wavefront files.
1919
*/
20-
void process(QStringList args, SurfaceManager* manager);
20+
void process(const QStringList& args, SurfaceManager* manager);
2121

2222
/**
2323
* @brief Slot to trigger a safe exit of the loop.

0 commit comments

Comments
 (0)