added new param-editing to APs and Beacons

changed drawing for better debuging
changed layer editing
option to add and delete layers
some minor changes
This commit is contained in:
2016-11-29 21:31:20 +01:00
parent 674f79c150
commit 535e410ae9
28 changed files with 614 additions and 62 deletions

View File

@@ -7,13 +7,15 @@
#include "mapview/model/IHasName.h"
#include "mapview/model/MMFloor.h"
#include "EditFields.h"
LayerParamWidget::LayerParamWidget(QWidget *parent) : QWidget(parent) {
setMinimumSize(100, 100);
setMinimumSize(100, 50);
setMaximumWidth(250);
//setTitle("MapLayer Parameters");
QGridLayout* lay = new QGridLayout(this);
lay = new QGridLayout(this);
int r = 0;
@@ -53,35 +55,50 @@ void LayerParamWidget::setElement(MapLayer* l) {
this->curElement = l;
if (l) {
std::string info = l->getLayerName() + " (" + std::to_string(l->getNumElements()) + " elements)";
selected.info->setText(info.c_str());
} else {
selected.info->setText("-");
}
// if (l) {
// std::string info = l->getLayerName() + " (" + std::to_string(l->getNumElements()) + " elements)";
// selected.info->setText(info.c_str());
// } else {
// selected.info->setText("-");
// }
while ( QWidget* w = this->findChild<QWidget*>() ) {delete w;}
delete this->layout();
this->lay = new QGridLayout();
this->setLayout(lay);
int r = 0;
// {
// MMFloor* floor = dynamic_cast<MMFloor*>(l);
// atHeight.lbl->setVisible(floor);
// atHeight.txt->setVisible(floor);
// height.lbl->setVisible(floor);
// height.txt->setVisible(floor);
// if (floor) {
// std::string _atHeight = std::to_string(floor->getFloor().atHeight);
// atHeight.txt->setText( _atHeight.c_str() );
// std::string _height = std::to_string(floor->getFloor().height);
// height.txt->setText( _height.c_str() );
// }
// }
// // has name
// {
// IHasName* elem = dynamic_cast<IHasName*>(l);
// name.lbl->setVisible(elem);
// name.txt->setVisible(elem);
// if (elem) {name.txt->setText(elem->getName().c_str());}
// }
{
MMFloor* floor = dynamic_cast<MMFloor*>(l);
atHeight.lbl->setVisible(floor);
atHeight.txt->setVisible(floor);
height.lbl->setVisible(floor);
height.txt->setVisible(floor);
if (floor) {
std::string _atHeight = std::to_string(floor->getFloor().atHeight);
atHeight.txt->setText( _atHeight.c_str() );
std::string _height = std::to_string(floor->getFloor().height);
height.txt->setText( _height.c_str() );
IHasParams* elem = dynamic_cast<IHasParams*>(l);
if (elem) {
EditFields::get(lay, elem);
}
}
// has name
{
IHasName* elem = dynamic_cast<IHasName*>(l);
name.lbl->setVisible(elem);
name.txt->setVisible(elem);
if (elem) {name.txt->setText(elem->getName().c_str());}
}
}