From d61ffc88333e1d5c1913d8c99a81c0794de96726 Mon Sep 17 00:00:00 2001 From: Ulrich Kemloh <kemlohulrich@gmail.com> Date: Fri, 21 Nov 2014 16:09:45 +0100 Subject: [PATCH] fixed an issue when the play and record buttons were deactivated when dropping a file while in playing mode. --- src/MainWindow.cpp | 5 +---- src/SaxParser.cpp | 15 +++++++-------- src/SystemSettings.cpp | 3 ++- src/ThreadVisualisation.cpp | 2 +- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index e9eb9ea..faba01b 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -307,7 +307,6 @@ void MainWindow::slotStartPlaying() // the thread was shutdown from the reset option extern_shutdown_visual_thread = false; - if (!isPlaying) { statusBar()->showMessage(QString::fromUtf8("waiting for data")); //only start the visualisation thread if in offline modus @@ -367,7 +366,6 @@ void MainWindow::slotStartPlaying() //no matter what, the stop button should be enabled ui.BtStop->setEnabled(true); - } void MainWindow::slotStopPlaying() @@ -959,7 +957,6 @@ void MainWindow::slotControlSequence(const char * sex) void MainWindow::resetGraphicalElements() { - //restore play button QIcon icon1; icon1.addPixmap(QPixmap( @@ -994,7 +991,7 @@ void MainWindow::resetGraphicalElements() ui.action3_D->setEnabled(true); ui.action2_D->setEnabled(true); - labelRecording->setText("rec: OFF"); + labelRecording->setText("rec: off"); statusBar()->showMessage(tr("select a File")); //resetting the start/stop recording action diff --git a/src/SaxParser.cpp b/src/SaxParser.cpp index e940617..2b5d4b9 100644 --- a/src/SaxParser.cpp +++ b/src/SaxParser.cpp @@ -68,9 +68,6 @@ using namespace std; -OutputHandler* Log=NULL; - - /** * constructor * @@ -579,10 +576,6 @@ void SaxParser::clearPoints() /// provided for convenience and will be removed in the next version bool SaxParser::parseGeometryJPS(QString fileName, FacilityGeometry *geometry) { - - // if(Log) delete Log; - Log = new FileHandler(SystemSettings::getLogfile().toStdString().c_str()); - double captionsColor=0;//red if(!fileName.endsWith(".xml",Qt::CaseInsensitive)) return false; QString wd; @@ -628,7 +621,6 @@ bool SaxParser::parseGeometryJPS(QString fileName, FacilityGeometry *geometry) polygons->InsertNextCell(polygon); //plot the walls only for not stairs - const vector<Wall>& walls= sub->GetAllWalls(); for(unsigned int w=0; w<walls.size(); w++) { Point p1 = walls[w].GetPoint1(); @@ -677,6 +669,13 @@ bool SaxParser::parseGeometryJPS(QString fileName, FacilityGeometry *geometry) polygonPolyData->SetPolys(polygons); geometry->addFloor(polygonPolyData); + // Create a PolyData to represen the obstacles + //TODO: + //VTK_CREATE(vtkPolyData, polygonPolyData); + //polygonPolyData->SetPoints(points); + //polygonPolyData->SetPolys(polygons); + //geometry->addFloor(polygonPolyData); + // add the crossings const map<int, Crossing*>& crossings=building->GetAllCrossings(); diff --git a/src/SystemSettings.cpp b/src/SystemSettings.cpp index 7c5b945..65de975 100644 --- a/src/SystemSettings.cpp +++ b/src/SystemSettings.cpp @@ -84,7 +84,7 @@ QString SystemSettings::filesPrefix=""; QString SystemSettings::logfile="log.txt"; //the log file is writting by a different module -extern OutputHandler* Log; +OutputHandler* Log=NULL; SystemSettings::SystemSettings() {} @@ -382,6 +382,7 @@ void SystemSettings::CreateLogfile() } logfile = outputDir+"log_"+QDateTime::currentDateTime().toString("yyMMdd_hh_mm_").append(SystemSettings::getFilenamePrefix()).append(".txt"); + Log = new FileHandler(logfile.toStdString().c_str()); } QString &SystemSettings::getLogfile() diff --git a/src/ThreadVisualisation.cpp b/src/ThreadVisualisation.cpp index 2688d60..b3bfdfb 100644 --- a/src/ThreadVisualisation.cpp +++ b/src/ThreadVisualisation.cpp @@ -359,7 +359,7 @@ void ThreadVisualisation::run() //emit signalStatusMessage("Idle"); - emit signal_controlSequences("CONTROL_RESET"); + //emit signal_controlSequences("CONTROL_RESET"); //clear some stuffs -- GitLab