added earth-registration support

This commit is contained in:
2017-03-21 21:12:52 +01:00
parent b7ee7d992a
commit d80d356dea
14 changed files with 331 additions and 3 deletions

View File

@@ -195,6 +195,21 @@ void ElementParamWidget::refresh() {
break;
}
case ParamType::DOUBLE: {
const std::string str = std::to_string(value.toDouble());
if (param.readOnly) {
lay->addWidget(new QLabel(str.c_str()),r,1);
} else {
QLineEdit* le = new QLineEdit( str.c_str() );
connect(le, &QLineEdit::textChanged, [i,elem] (const QString& str) {
const double val = str.toDouble();
elem->setParamValue(i, ParamValue(val));
});
lay->addWidget(le,r,1);
}
break;
}
case ParamType::INT: {
const std::string str = std::to_string(value.toInt());
QLineEdit* le = new QLineEdit( str.c_str() );

View File

@@ -13,6 +13,7 @@
#include "../mapview/model/MMFloorAccessPoint.h"
#include "../mapview/model/MMFloorBeacon.h"
#include "../mapview/model/MMFloorGroundTruthPoints.h"
#include "../mapview/model/MMRegistration.h"
#include "../mapview/2D/tools/ToolMeasure.h"
#include "../mapview/2D/tools/ToolSelector.h"
@@ -133,6 +134,15 @@ ToolBoxWidget::ToolBoxWidget(MapView2D* view, QWidget *parent) : QWidget(parent)
// EARTH REGISTRATION
btnEarthReg = new QPushButton(UIHelper::getIcon("registration"), "");
btnEarthReg->setMinimumSize(s,s);
lay->addWidget(btnEarthReg, r++, 0, 1,1,Qt::AlignTop);
connect(btnEarthReg, SIGNAL(clicked(bool)), this, SLOT(onNewEarthReg()));
// what to do when the main-tool is changed
connect(&view->getTools(), SIGNAL(mainToolChanged()), this, SLOT(onMainToolChanged()));
@@ -187,6 +197,8 @@ void ToolBoxWidget::setSelectedLayer(MapLayer *ml) {
btnImage->setEnabled(ml && (ml->getLayerType() == MapLayerType::FLOOR_UNDERLAYS));
btnEarthReg->setEnabled(ml && (ml->getLayerType() == MapLayerType::REGISTRATION));
}
@@ -340,6 +352,18 @@ void ToolBoxWidget::onNewGTP() {
}
void ToolBoxWidget::onNewEarthReg() {
const Point2 center = view->getScaler().getCenter();
Floorplan::EarthPosMapPos* reg = new Floorplan::EarthPosMapPos(
EarthPos(50, 10, 300), Point3(center.x, center.y, 0)
);
MMRegistration* mmreg = (MMRegistration*) curLayer;
mmreg->create(reg);
}
void ToolBoxWidget::onNewImage() {
const Point2 center = view->getScaler().getCenter();

View File

@@ -47,7 +47,9 @@ private:
QPushButton* btnBeacon;
QPushButton* btnFingerprintLocation;
QPushButton* btnPOI;
QPushButton* btnGTP;
QPushButton* btnGTP;
QPushButton* btnEarthReg;
QPushButton* btnImage;
@@ -71,6 +73,8 @@ private slots:
void onNewImage();
void onNewEarthReg();
void onMainToolChanged();