Commit a372fbf9 authored by Valentin Platzgummer's avatar Valentin Platzgummer

.wima files fixed

parent 3f817087
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
......@@ -171,41 +171,40 @@ void WimaMeasurementArea::saveToJson(QJsonObject &json) {
bool WimaMeasurementArea::loadFromJson(const QJsonObject &json,
QString &errorString) {
if (this->WimaArea::loadFromJson(json, errorString)) {
disableUpdates();
disableUpdate();
bool retVal = true;
if (!json.contains(tileHeightName) || !json[tileHeightName].isDouble()) {
errorString.append(tr("Could not load tile height!\n"));
retVal = false;
} else {
_tileHeight.setRawValue(json[tileHeightName].toDouble());
}
if (!json.contains(tileWidthName) || !json[tileWidthName].isDouble()) {
errorString.append(tr("Could not load tile width!\n"));
retVal = false;
} else {
_tileWidth.setRawValue(json[tileWidthName].toDouble());
}
if (!json.contains(minTileAreaName) || !json[minTileAreaName].isDouble()) {
errorString.append(tr("Could not load minimal tile area!\n"));
retVal = false;
} else {
_minTileAreaPercent.setRawValue(json[minTileAreaName].toDouble());
}
if (!json.contains(showTilesName) || !json[showTilesName].isBool()) {
errorString.append(tr("Could not load show tiles !\n"));
retVal = false;
}
if (retVal) {
_tileHeight.setRawValue(json[tileHeightName].toDouble());
_tileWidth.setRawValue(json[tileWidthName].toDouble());
_minTileAreaPercent.setRawValue(json[minTileAreaName].toDouble());
_showTiles.setRawValue(json[showTilesName].toBool());
enableUpdates();
doUpdate();
} else {
enableUpdates();
_showTiles.setRawValue(json[showTilesName].toBool());
}
enableUpdate();
doUpdate();
return retVal;
} else {
return false;
......@@ -348,12 +347,12 @@ void WimaMeasurementArea::storeTiles() {
<< " ms";
}
void WimaMeasurementArea::disableUpdates() {
void WimaMeasurementArea::disableUpdate() {
setState(STATE::IDLE);
this->_timer.stop();
}
void WimaMeasurementArea::enableUpdates() {
void WimaMeasurementArea::enableUpdate() {
if (this->_state == STATE::STOP) {
setState(STATE::IDLE);
}
......
......@@ -89,8 +89,8 @@ private slots:
void doUpdate();
void deferUpdate();
void storeTiles();
void disableUpdates();
void enableUpdates();
void disableUpdate();
void enableUpdate();
private:
// Member Methodes
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment