diff options
Diffstat (limited to 'tracker-rs/ftnoir_tracker_rs.cpp')
| -rw-r--r-- | tracker-rs/ftnoir_tracker_rs.cpp | 38 |
1 files changed, 10 insertions, 28 deletions
diff --git a/tracker-rs/ftnoir_tracker_rs.cpp b/tracker-rs/ftnoir_tracker_rs.cpp index 7918b6dc..f48f58d1 100644 --- a/tracker-rs/ftnoir_tracker_rs.cpp +++ b/tracker-rs/ftnoir_tracker_rs.cpp @@ -13,6 +13,9 @@ #include <QMessageBox> #include <QProcess> #include <QStackedLayout> +#include <QDesktopServices> +#include <QUrl> +#include <QPushButton> #include <QDebug> RSTracker::RSTracker() { @@ -33,9 +36,7 @@ void RSTracker::configurePreviewFrame() mImageWidget = new ImageWidget(mPreviewFrame); mImageWidget->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); - if(mPreviewFrame->layout() != nullptr){ - delete mPreviewFrame->layout(); - } + delete mPreviewFrame->layout(); QLayout* layout = new QStackedLayout(); mPreviewFrame->setLayout(layout); @@ -83,29 +84,16 @@ void RSTracker::handleTrackingEnded(int exitCode){ showRealSenseErrorMessageBox(exitCode); } -bool RSTracker::startSdkInstallationProcess() -{ - static const QString contrib_path(OPENTRACK_BASE_PATH + OPENTRACK_CONTRIB_PATH); - - bool pStarted = QProcess::startDetached(contrib_path + "intel_rs_sdk_runtime_websetup_10.0.26.0396.exe", QStringList({ "--finstall=core,face3d","--fnone=all" })); - if(!pStarted){ - QMessageBox::warning(nullptr, - tr("Intel® RealSense™ Runtime Installation"), - tr("Installation process failed to start."), - QMessageBox::Ok); - } - return pStarted; -} - void RSTracker::showRealSenseErrorMessageBox(int exitCode) { QMessageBox msgBox; msgBox.setIcon(QMessageBox::Critical); msgBox.setText("RealSense Tracking Error"); - switch(exitCode){ + switch(exitCode) + { case -101: //The implementation got an invalid handle from the RealSense SDK session/modules - msgBox.setInformativeText(tr("Couldn't initialize RealSense tracking. Please make sure SDK Runtime 2016 R2 is installed.")); + msgBox.setInformativeText(tr("Couldn't initialize RealSense tracking. Open the tracker settings dialog for links to the camera driver and the SDK.")); break; case -301: //RealSense SDK runtime execution aborted. msgBox.setInformativeText(tr("Tracking stopped after the RealSense SDK Runtime execution has aborted.")); @@ -117,12 +105,8 @@ void RSTracker::showRealSenseErrorMessageBox(int exitCode) msgBox.setInformativeText("Status code: " + QString::number(exitCode) + ".\n\nNote that you need the latest camera drivers and the SDK runtime 2016 R2 to be installed."); } - QPushButton* triggerSdkInstallation = msgBox.addButton(tr("Install Runtime"), QMessageBox::ActionRole); msgBox.addButton(QMessageBox::Ok); msgBox.exec(); - - if(msgBox.clickedButton() == triggerSdkInstallation) - startSdkInstallationProcess(); } void RSTracker::data(double *data) @@ -135,10 +119,8 @@ RSTracker::~RSTracker() { stopPreview(); - if(mImageWidget!=nullptr) - delete mImageWidget; - - if (mPreviewFrame!=nullptr && mPreviewFrame->layout()!=nullptr) + delete mImageWidget; + if (mPreviewFrame) delete mPreviewFrame->layout(); mTrackerWorkerThread.requestInterruption(); @@ -147,7 +129,7 @@ RSTracker::~RSTracker() { } QString RSTrackerMetaData::name() { - return otr_tr("Intel® RealSense™ Technology"); + return tr("Intel® RealSense™ Technology"); } QIcon RSTrackerMetaData::icon() { |
