diff options
Diffstat (limited to 'tracker-rs/ftnoir_tracker_rs.cpp')
| -rw-r--r-- | tracker-rs/ftnoir_tracker_rs.cpp | 44 |
1 files changed, 14 insertions, 30 deletions
diff --git a/tracker-rs/ftnoir_tracker_rs.cpp b/tracker-rs/ftnoir_tracker_rs.cpp index c37c751c..f48f58d1 100644 --- a/tracker-rs/ftnoir_tracker_rs.cpp +++ b/tracker-rs/ftnoir_tracker_rs.cpp @@ -9,10 +9,13 @@ #include "ftnoir_tracker_rs_controls.h" #include "imagewidget.h" #include "api/plugin-api.hpp" -#include "opentrack-library-path.h" +#include "compat/library-path.hpp" #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); @@ -44,7 +45,7 @@ void RSTracker::configurePreviewFrame() mImageWidget->show(); } -void RSTracker::start_tracker(QFrame* previewFrame) +module_status RSTracker::start_tracker(QFrame* previewFrame) { qDebug() << "tracker_rs: starting tracker"; @@ -55,6 +56,8 @@ void RSTracker::start_tracker(QFrame* previewFrame) startPreview(); mTrackerWorkerThread.start(QThread::HighPriority); + + return status_ok(); } void RSTracker::startPreview(){ @@ -81,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("intel_rs_sdk_runtime_websetup_10.0.26.0396.exe", QStringList({ "--finstall=core,face3d","--fnone=all" }), contrib_path); - 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.")); @@ -115,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) @@ -133,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(); @@ -145,7 +129,7 @@ RSTracker::~RSTracker() { } QString RSTrackerMetaData::name() { - return QString(QCoreApplication::translate("RSTrackerMetaData", "Intel® RealSense™ Technology")); + return tr("Intel® RealSense™ Technology"); } QIcon RSTrackerMetaData::icon() { |
