Skip to content

Commit

Permalink
Some minor cleaning up.
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Oct 21, 2019
1 parent f68b136 commit 3d34c95
Show file tree
Hide file tree
Showing 13 changed files with 114 additions and 154 deletions.
9 changes: 3 additions & 6 deletions src/main.cpp
Expand Up @@ -295,11 +295,9 @@ int main(int pArgC, char *pArgV[])
res = 0;
}

// Keep track of our application file and directory paths (in case we need
// to restart OpenCOR)
// Keep track of our application file (in case we need to restart OpenCOR)

QString appFilePath = OpenCOR::GuiApplication::applicationFilePath();
QString appDirPath = OpenCOR::GuiApplication::applicationDirPath();

// Delete our main window

Expand Down Expand Up @@ -345,10 +343,9 @@ int main(int pArgC, char *pArgV[])
QSettings().clear();
}

// Restart OpenCOR, but without providing any of the arguments that were
// originally passed to us since we want to reset everything
// Restart OpenCOR

QProcess::startDetached(appFilePath, QStringList(), appDirPath);
QProcess::startDetached(appFilePath);
}

// We are done running the GUI version of OpenCOR, so leave
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/datastoreinterface.cpp
Expand Up @@ -84,7 +84,7 @@ void DataStoreVariableRun::addValue()
{
// Set the value of the variable at the given position

Q_ASSERT((mSize < mCapacity) && mValue);
Q_ASSERT((mSize < mCapacity) && (mValue != nullptr));

mValues[mSize] = *mValue;

Expand Down
41 changes: 22 additions & 19 deletions src/plugins/datastoreinterface.h
Expand Up @@ -75,33 +75,34 @@ class DataStoreVariable : public QObject
static bool compare(DataStoreVariable *pVariable1,
DataStoreVariable *pVariable2);

bool isVisible() const;

int runsCount() const;

bool addRun(quint64 pCapacity);
void keepRuns(int pRunsCount);

int type() const;
void setType(int pType);

QString uri() const;
void setUri(const QString &pUri);

QString label() const;
void setLabel(const QString &pLabel);

QString unit() const;
void setUnit(const QString &pUnit);

quint64 size(int pRun = -1) const;

void addValue();
void addValue(double pValue, int pRun = -1);

double value(quint64 pPosition, int pRun = -1) const;
double * values(int pRun = -1) const;

public slots:
bool isVisible() const;

int runsCount() const;

QString uri() const;
QString label() const;
QString unit() const;

quint64 size(int pRun = -1) const;

double value(quint64 pPosition, int pRun = -1) const;

private:
int mType = -1;
QString mUri;
Expand Down Expand Up @@ -225,15 +226,8 @@ class DataStore : public QObject
explicit DataStore(const QString &pUri = QString());
~DataStore() override;

QString uri() const;

int runsCount() const;

bool addRun(quint64 pCapacity);

quint64 size(int pRun = -1) const;

DataStoreVariable * voi() const;
DataStoreVariables variables();
DataStoreVariables voiAndVariables();

Expand All @@ -245,6 +239,15 @@ class DataStore : public QObject

void addValues(double pVoiValue);

public slots:
QString uri() const;

int runsCount() const;

quint64 size(int pRun = -1) const;

OpenCOR::DataStore::DataStoreVariable * voi() const;

private:
QString mUri;

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/pluginmanager.cpp
Expand Up @@ -137,7 +137,7 @@ PluginManager::PluginManager(bool pGuiMode) :
}

// We now have all our needed and wanted plugins with our needed plugins
// nicely sorted based on their dependencies with one another. So, retrieve
// nicely sorted based on their dependencies with one another, so retrieve
// their file name

QStringList plugins = neededPlugins+wantedPlugins;
Expand Down
Expand Up @@ -353,6 +353,9 @@ class SimulationExperimentViewSimulationWidget : public Core::Widget
void importDone(DataStore::DataStoreImporter *pDataStoreImporter);
void exportDone(DataStore::DataStoreExporter *pDataStoreExporter);

public slots:
void clearSimulationResults();

private slots:
void runPauseResumeSimulation();
void stopSimulation();
Expand All @@ -363,7 +366,6 @@ private slots:
void removeAllGraphPanels();
void resetStateModelParameters();
void resetAllModelParameters();
void clearSimulationResults();
void sedmlExportSedmlFile();
void sedmlExportCombineArchive();
void preferences();
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/support/CellMLSupport/src/cellmlfile.cpp
Expand Up @@ -1130,7 +1130,7 @@ bool CellmlFile::exportTo(const QString &pFileName,
// provided

if (pFileName.isEmpty()) {
std::wcout << QString::fromStdWString(codeExporter->generateCode(mModel)).trimmed().toStdWString() << std::endl;
std::cout << QString::fromStdWString(codeExporter->generateCode(mModel)).trimmed().toStdString() << std::endl;
} else if (!Core::writeFile(pFileName, QString::fromStdWString(codeExporter->generateCode(mModel)))) {
mIssues << CellmlFileIssue(CellmlFileIssue::Type::Error,
tr("the output file could not be saved"));
Expand Down
Expand Up @@ -773,7 +773,7 @@ bool CellmlFileCellml10Exporter::saveModel(iface::cellml_api::Model *pModel,
domDocument.setContent(QString::fromStdWString(pModel->serialisedText()));

if (pFileName.isEmpty()) {
std::wcout << QString(Core::serialiseDomDocument(domDocument)).toStdWString() << std::endl;
std::cout << QString(Core::serialiseDomDocument(domDocument)).toStdString() << std::endl;

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/support/SimulationSupport/src/simulation.cpp
Expand Up @@ -415,7 +415,7 @@ void SimulationData::addNlaSolverProperty(const QString &pName,
mNlaSolverProperties.insert(pName, pValue);

// Reset our parameter values, if required
// Note: to only recompute our 'computed constants' and 'variables' is
// Note: to recompute only our 'computed constants' and 'variables' is
// not sufficient since some constants may also need to be
// reinitialised...

Expand Down

0 comments on commit 3d34c95

Please sign in to comment.