diff --git a/src/misc/furtherinitialize.cpp.inl b/src/misc/furtherinitialize.cpp.inl index 1a791d8189..7d17280364 100644 --- a/src/misc/furtherinitialize.cpp.inl +++ b/src/misc/furtherinitialize.cpp.inl @@ -198,6 +198,16 @@ QString Simulation::furtherInitialize() const if ( (QString::fromStdString(sedmlPlot2dPropertiesNode.getURI()) == SEDMLSupport::OpencorNamespace) && (QString::fromStdString(sedmlPlot2dPropertiesNode.getName()) == SEDMLSupport::Properties)) { +#ifdef GUI_SUPPORT + std::string versionValue = sedmlPlot2dPropertiesNode.getAttrValue(qPrintable(SEDMLSupport::Version)); + int version = SEDMLSupport::VersionValue; + + try { + version = versionValue.empty()?1:std::stoi(versionValue); + } catch (...) { + } +#endif + for (uint k = 0, kMax = sedmlPlot2dPropertiesNode.getNumChildren(); k < kMax; ++k) { libsbml::XMLNode &sedmlPlot2dPropertyNode = sedmlPlot2dPropertiesNode.getChild(k); @@ -208,7 +218,11 @@ QString Simulation::furtherInitialize() const if (sedmlPlot2dPropertyNodeName == SEDMLSupport::BackgroundColor) { graphPanelProperties[0]->setValue(sedmlPlot2dPropertyNodeValue); } else if (sedmlPlot2dPropertyNodeName == SEDMLSupport::FontSize) { - graphPanelProperties[1]->setValue(sedmlPlot2dPropertyNodeValue); + if (version == 1) { + graphPanelProperties[1]->setValue(QString::number(2*sedmlPlot2dPropertyNodeValue.toInt())); + } else { + graphPanelProperties[1]->setValue(sedmlPlot2dPropertyNodeValue); + } // Note: the below is in case we are dealing // with an old SED-ML file where we had diff --git a/src/plugins/simulation/SimulationExperimentView/src/simulationexperimentviewsimulationwidget.cpp b/src/plugins/simulation/SimulationExperimentView/src/simulationexperimentviewsimulationwidget.cpp index 4da3fd6af1..e2c034c3c9 100644 --- a/src/plugins/simulation/SimulationExperimentView/src/simulationexperimentviewsimulationwidget.cpp +++ b/src/plugins/simulation/SimulationExperimentView/src/simulationexperimentviewsimulationwidget.cpp @@ -1987,10 +1987,12 @@ bool SimulationExperimentViewSimulationWidget::createSedmlFile(SEDMLSupport::Sed // Add our properties as an annotation - sedmlPlot2d->appendAnnotation(QString(R"(<%1 xmlns="%2">)" - " %3" + sedmlPlot2d->appendAnnotation(QString(R"(<%1 %2="%3" xmlns="%4">)" + " %5" "").arg(SEDMLSupport::Properties, - SEDMLSupport::OpencorNamespace, + SEDMLSupport::Version) + .arg(SEDMLSupport::VersionValue) + .arg(SEDMLSupport::OpencorNamespace, annotation).toStdString()); // Keep track of the graph panel's graphs, if any diff --git a/src/plugins/support/SEDMLSupport/src/sedmlfile.h b/src/plugins/support/SEDMLSupport/src/sedmlfile.h index 339cfe2e1c..51d7fa201c 100644 --- a/src/plugins/support/SEDMLSupport/src/sedmlfile.h +++ b/src/plugins/support/SEDMLSupport/src/sedmlfile.h @@ -67,6 +67,8 @@ namespace SEDMLSupport { //============================================================================== static const auto OpencorNamespace = QStringLiteral("http://www.opencor.ws/"); +static const auto Version = QStringLiteral("version"); +static const auto VersionValue = 2; static const auto VariableDegree = QStringLiteral("variableDegree"); static const auto SolverProperties = QStringLiteral("solverProperties"); static const auto SolverProperty = QStringLiteral("solverProperty"); diff --git a/src/plugins/widget/GraphPanelWidget/src/graphpanelplotwidget.cpp b/src/plugins/widget/GraphPanelWidget/src/graphpanelplotwidget.cpp index 0bad96aab5..b37a5dbe9a 100644 --- a/src/plugins/widget/GraphPanelWidget/src/graphpanelplotwidget.cpp +++ b/src/plugins/widget/GraphPanelWidget/src/graphpanelplotwidget.cpp @@ -2458,10 +2458,7 @@ void GraphPanelPlotWidget::setTitle(const QString &pTitle) QwtText title = QwtText(pTitle); QFont newFont = title.font(); - newFont.setPointSize(2*fontSize()); -//---ISSUE2271--- WE WILL EVENTUALLY HAVE TO REMOVE THAT SCALING FACTOR AND, -// INSTEAD, HAVE THE MAIN FONT SIZE PROPERTY SCALED DOUBLED WHEN -// DEALING WITH AN OLD SED-ML FILE... + newFont.setPointSize(fontSize()); title.setColor(mSurroundingAreaForegroundColor); title.setFont(newFont);