Skip to content

Commit b65cbdd

Browse files
authored
Merge pull request #21 from PeeJay/streaming
Make the QtCaptureTest project more obvious/usable for all platforms
2 parents 6d008ba + 10cc5d9 commit b65cbdd

File tree

7 files changed

+30
-24
lines changed

7 files changed

+30
-24
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ java/target
55
mac/openpnp-capture.xcodeproj/xcuserdata
66
mac/openpnp-capture.xcodeproj/project.xcworkspace/xcuserdata
77
common/version.h
8-
build
8+
/build*
9+
*.pro.user

mac/QtCaptureTest/QtCaptureTest.pro renamed to QtCaptureTest/QtCaptureTest.pro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ CONFIG -= app_bundle
1616
CONFIG += console
1717

1818
# add the openpnp-capture include path
19-
INCLUDEPATH += ../../include
19+
INCLUDEPATH += ../include
2020

2121
SOURCES += main.cpp\
2222
mainwindow.cpp
@@ -25,7 +25,7 @@ HEADERS += mainwindow.h
2525

2626
FORMS += mainwindow.ui
2727

28-
LIBS += -L"../../build/" -lopenpnp-capture
28+
LIBS += -L../build/ -lopenpnp-capture
2929

3030
# add run-path relative dylib search path
3131
QMAKE_RPATHDIR += .
File renamed without changes.

mac/QtCaptureTest/mainwindow.cpp renamed to QtCaptureTest/mainwindow.cpp

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "mainwindow.h"
22
#include "ui_mainwindow.h"
3-
#include <qDebug>
3+
#include <QDebug>
44
#include <QBoxLayout>
55
#include <QPixmap>
66

@@ -139,7 +139,7 @@ void MainWindow::doFrameUpdate()
139139
}
140140
}
141141

142-
void MainWindow::changeCamera(int index)
142+
void MainWindow::changeCamera()
143143
{
144144
QVariant v = ui->cameraChooser->currentData();
145145
CustomComboBoxData data = v.value<CustomComboBoxData>();
@@ -219,11 +219,12 @@ void MainWindow::readCameraSettings()
219219
qDebug() << "Failed to get exposure value";
220220
}
221221

222-
int32_t emin,emax;
223-
if (Cap_getPropertyLimits(m_ctx, m_streamID, CAPPROPID_EXPOSURE, &emin, &emax)==CAPRESULT_OK)
222+
int32_t emin,emax,edefault;
223+
if (Cap_getPropertyLimits(m_ctx, m_streamID, CAPPROPID_EXPOSURE, &emin, &emax, &edefault)==CAPRESULT_OK)
224224
{
225225
qDebug() << "Exposure min: " << emin;
226226
qDebug() << "Exposure max: " << emax;
227+
qDebug() << "Exposure default: " << edefault;
227228
m_exposureSlider->setRange(emin, emax);
228229
}
229230
else
@@ -232,10 +233,11 @@ void MainWindow::readCameraSettings()
232233
m_exposureSlider->setRange(0, 0);
233234
}
234235

235-
if (Cap_getPropertyLimits(m_ctx, m_streamID, CAPPROPID_WHITEBALANCE, &emin, &emax)==CAPRESULT_OK)
236+
if (Cap_getPropertyLimits(m_ctx, m_streamID, CAPPROPID_WHITEBALANCE, &emin, &emax, &edefault)==CAPRESULT_OK)
236237
{
237238
qDebug() << "White balance min: " << emin;
238239
qDebug() << "White balance max: " << emax;
240+
qDebug() << "White balance default: " << edefault;
239241
m_whiteBalanceSlider->setRange(emin, emax);
240242
}
241243
else
@@ -244,10 +246,11 @@ void MainWindow::readCameraSettings()
244246
m_whiteBalanceSlider->setRange(0, 0);
245247
}
246248

247-
if (Cap_getPropertyLimits(m_ctx, m_streamID, CAPPROPID_GAIN, &emin, &emax)==CAPRESULT_OK)
249+
if (Cap_getPropertyLimits(m_ctx, m_streamID, CAPPROPID_GAIN, &emin, &emax, &edefault)==CAPRESULT_OK)
248250
{
249251
qDebug() << "Gain min: " << emin;
250252
qDebug() << "Gain max: " << emax;
253+
qDebug() << "Gain default: " << edefault;
251254
m_gainSlider->setRange(emin, emax);
252255
}
253256
else
@@ -267,21 +270,23 @@ void MainWindow::readCameraSettings()
267270
qDebug() << "Failed to get gain value";
268271
}
269272

270-
if (Cap_getPropertyLimits(m_ctx, m_streamID, CAPPROPID_CONTRAST, &emin, &emax)==CAPRESULT_OK)
273+
if (Cap_getPropertyLimits(m_ctx, m_streamID, CAPPROPID_CONTRAST, &emin, &emax, &edefault)==CAPRESULT_OK)
271274
{
272275
qDebug() << "Contrast min: " << emin;
273276
qDebug() << "Contrast max: " << emax;
277+
qDebug() << "Contrast default: " << edefault;
274278
m_contrastSlider->setRange(emin, emax);
275279
}
276280
else
277281
{
278282
m_contrastSlider->setRange(0, 0);
279283
}
280284

281-
if (Cap_getPropertyLimits(m_ctx, m_streamID, CAPPROPID_BRIGHTNESS, &emin, &emax)==CAPRESULT_OK)
285+
if (Cap_getPropertyLimits(m_ctx, m_streamID, CAPPROPID_BRIGHTNESS, &emin, &emax, &edefault)==CAPRESULT_OK)
282286
{
283287
qDebug() << "Brightness min: " << emin;
284288
qDebug() << "Brightness max: " << emax;
289+
qDebug() << "Brightness default: " << edefault;
285290
m_brightnessSlider->setRange(emin, emax);
286291
}
287292
else

mac/QtCaptureTest/mainwindow.h renamed to QtCaptureTest/mainwindow.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class MainWindow : public QMainWindow
2525

2626
public slots:
2727
void doFrameUpdate();
28-
void changeCamera(int index);
28+
void changeCamera();
2929

3030
void onAutoExposure(bool state);
3131
void onAutoWhiteBalance(bool state);
File renamed without changes.

bootstrap.bat

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@ IF ERRORLEVEL 2 GOTO NinjaBuild
1212
IF ERRORLEVEL 1 GOTO VS
1313

1414
:VS
15-
mkdir buildRelease
16-
cd buildRelease
15+
mkdir build
16+
cd build
1717
cmake -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles" ..
1818
cd ..
19-
mkdir buildDebug
20-
cd buildDebug
21-
cmake -DCMAKE_BUILD_TYPE=Debug -G "NMake Makefiles" ..
22-
cd ..
19+
::mkdir buildDebug
20+
::cd buildDebug
21+
::cmake -DCMAKE_BUILD_TYPE=Debug -G "NMake Makefiles" ..
22+
::cd ..
2323
GOTO End
2424

2525
:NinjaBuild
26-
mkdir buildRelease
27-
cd buildRelease
26+
mkdir build
27+
cd build
2828
cmake -DCMAKE_BUILD_TYPE=Release -G "Ninja" ..
2929
cd ..
30-
mkdir buildDebug
31-
cd buildDebug
32-
cmake -DCMAKE_BUILD_TYPE=Debug -G "Ninja" ..
33-
cd ..
30+
::mkdir buildDebug
31+
::cd buildDebug
32+
::cmake -DCMAKE_BUILD_TYPE=Debug -G "Ninja" ..
33+
::cd ..
3434
GOTO End
3535

3636
:End

0 commit comments

Comments
 (0)