diff --git a/SAS/Scheduler/src/Controller.cpp b/SAS/Scheduler/src/Controller.cpp index 5993c92f8105dbb6182719d466fc6ae5a6284e76..c93933922fd711175296f3c6b10eb8e0a12c511b 100644 --- a/SAS/Scheduler/src/Controller.cpp +++ b/SAS/Scheduler/src/Controller.cpp @@ -1191,11 +1191,19 @@ bool Controller::updateProjects(void) { void Controller::saveSettings(void) { QString filename = gui->fileDialog(tr("Save Settings"), "set", tr("Settings files (*.set)"),1); if (!filename.isEmpty()) { - itsDataHandler->saveSettings(filename); - //set status string - std::string statStr = "Settings saved to file "; - statStr += filename.toStdString(); - gui->setStatusText(statStr.c_str()); + if (itsDataHandler->saveSettings(filename)) + { + //set status string + std::string statStr = "Settings saved to file "; + statStr += filename.toStdString(); + gui->setStatusText(statStr.c_str()); + } + else { + //set status string + std::string statStr = "Failed to save settings to file "; + statStr += filename.toStdString(); + gui->setStatusText(statStr.c_str()); + } } } diff --git a/SAS/Scheduler/src/DataHandler.cpp b/SAS/Scheduler/src/DataHandler.cpp index bbd0d5908b9f9141ce1e18e3d86fe354bb9f1df0..195d4bfe844d69d1d86ef397911c2a325801ef5d 100644 --- a/SAS/Scheduler/src/DataHandler.cpp +++ b/SAS/Scheduler/src/DataHandler.cpp @@ -521,18 +521,20 @@ bool DataHandler::saveProgramPreferences(void) { bool DataHandler::saveSettings(const QString &filename) const { - QFile file(QDir::currentPath() + filename); + QFile file(filename); if (file.open(QIODevice::WriteOnly)) { QDataStream out(&file); out << (unsigned)FILE_WRITE_VERSION; out << Controller::theSchedulerSettings; file.close(); - debugInfo("ss","Wrote settings to file: ", filename.toStdString().c_str()); + debugInfo("ss","Wrote settings to file: ", (filename.toStdString().c_str())); return true; } - else - return false; + else { + debugInfo("ss","Failed to write to file: ", (filename.toStdString().c_str())); + return false; + } } bool DataHandler::loadSettings(const QString &filename) { diff --git a/SAS/Scheduler/src/GraphicResourceScene.cpp b/SAS/Scheduler/src/GraphicResourceScene.cpp index bdbb1c34557f0c16bddfc7d005073e4e553dc35c..be65553f2c9c84bd9a010ca93202ad02e79a3b26 100644 --- a/SAS/Scheduler/src/GraphicResourceScene.cpp +++ b/SAS/Scheduler/src/GraphicResourceScene.cpp @@ -225,13 +225,15 @@ void GraphicResourceScene::updateStationTimeLines() { GraphicStationTaskLine *stationTimeLine = new GraphicStationTaskLine(this, it->second, StationLineYPos); addItem(stationTimeLine); // create station label - QGraphicsSimpleTextItem *stationName = new QGraphicsSimpleTextItem(it->first.c_str(), 0); + QGraphicsSimpleTextItem *stationName = new QGraphicsSimpleTextItem(it->first.c_str(), NULL); + this->addItem(stationName); stationName->setPos(labelXpos, StationLineYPos-2); stationName->setFont(QFont("Liberation Sans", 9, QFont::Bold)); stationName->setZValue(10); const QPointF &sp(stationName->pos()); QRectF r(sp.x()-2, sp.y()-2, 9*(it->first.length()-1)+4, 13); - QGraphicsRectItem * rect = new QGraphicsRectItem(r, 0); + QGraphicsRectItem * rect = new QGraphicsRectItem(r, NULL); + this->addItem(rect); rect->setZValue(9); rect->setPen(QPen(Qt::NoPen)); rect->setBrush(QColor(255,255,255,160)); diff --git a/SAS/Scheduler/src/SASConnection.cpp b/SAS/Scheduler/src/SASConnection.cpp index a1a2a39dbd71659073322f2913287b778ab870c4..c33f4dd27294a16c114070092199953ebeedfdd6 100644 --- a/SAS/Scheduler/src/SASConnection.cpp +++ b/SAS/Scheduler/src/SASConnection.cpp @@ -2556,16 +2556,17 @@ bool SASConnection::saveStationSettings(int treeID, const StationTask &task, con } // nr of dataslots per RSP board (called 'nrSlotsInFrame' in SAS) // bResult &= setNodeValue(treeID, "LOFAR.ObsSW.Observation.nrSlotsInFrame", QString::number(task.getNrOfDataslotsPerRSPboard())); + //This is nonsense code as diff = NULL here, it somehow works under certain compilers because the dynamic_cast fails (obs=NULL) // TBB piggyback allowed? - const Observation *obs = dynamic_cast<const Observation *>(&task); - if (obs) { - if (diff->TBBPiggybackAllowed) - bResult &= setNodeValue(treeID, "LOFAR.ObsSW.Observation.ObservationControl.StationControl.tbbPiggybackAllowed", - (obs->getTBBPiggybackAllowed() ? "true" : "false")); - if (diff->AartfaacPiggybackAllowed) - bResult &= setNodeValue(treeID, "LOFAR.ObsSW.Observation.ObservationControl.StationControl.aartfaacPiggybackAllowed", - (obs->getAartfaacPiggybackAllowed() ? "true" : "false")); - } + //const Observation *obs = dynamic_cast<const Observation *>(&task); + //if (obs) { + // if (diff->TBBPiggybackAllowed) + // bResult &= setNodeValue(treeID, "LOFAR.ObsSW.Observation.ObservationControl.StationControl.tbbPiggybackAllowed", + // (obs->getTBBPiggybackAllowed() ? "true" : "false")); + // if (diff->AartfaacPiggybackAllowed) + // bResult &= setNodeValue(treeID, "LOFAR.ObsSW.Observation.ObservationControl.StationControl.aartfaacPiggybackAllowed", + // (obs->getAartfaacPiggybackAllowed() ? "true" : "false")); + //} } return bResult;