Skip to content

Commit

Permalink
Merge ecf8a5b into c725de4
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Jan 9, 2019
2 parents c725de4 + ecf8a5b commit 966038d
Show file tree
Hide file tree
Showing 18 changed files with 72 additions and 55 deletions.
1 change: 1 addition & 0 deletions doc/downloads/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ var jsonData = { "versions": [
"changes": [
{ "change": "<strong>General:</strong> upgraded to Qt 5.12.0 LTS (see issue <a href=\"https://github.com/opencor/opencor/issues/1910\">#1910</a>)." },
{ "change": "<strong>COMBINE support:</strong> now recognise files that have a master attribute of \"1\" rather than \"true\" (see issue <a href=\"https://github.com/opencor/opencor/issues/1912\">#1912</a>)." },
{ "change": "<strong>Graph Panel widget:</strong> fixed a small problem with the scale range of an axis in some cases (see issue <a href=\"https://github.com/opencor/opencor/issues/1941\">#1941</a>)." },
{ "change": "<strong>CellML Text view:</strong> improved Unicode support (see issue <a href=\"https://github.com/opencor/opencor/issues/1926\">#1926</a>)." },
{ "change": "<strong>Third-party libraries:</strong> upgraded <a href=\"http://www.llvm.org/\">LLVM</a>+<a href=\"http://clang.llvm.org/\">Clang</a> to version 7.0.1 (see issue <a href=\"https://github.com/opencor/opencor/issues/1917\">#1917</a>). Upgraded <a href=\"https://www.mesa3d.org/\">Mesa</a> to version 18.2.7 (see issue <a href=\"https://github.com/opencor/opencor/issues/1918\">#1918</a>). Upgraded the <a href=\"http://computation.llnl.gov/projects/sundials\">SUNDIALS</a> library to version 4.0.1 (see issue <a href=\"https://github.com/opencor/opencor/issues/1929\">#1929</a>). Upgraded the <a href=\"http://qwt.sourceforge.net/\">Qwt</a> library to version 6.1.4 (see issue <a href=\"https://github.com/opencor/opencor/issues/1933\">#1933</a>)." }
]
Expand Down
9 changes: 9 additions & 0 deletions doc/whatIsNew.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ var jsonData = { "versions": [
}
]
},
{ "name": "Simulation",
"entries": [
{ "type": "subCategory", "name": "Simulation Experiment view",
"entries": [
{ "type": "improved", "description": "Plotting of simulations." }
]
}
]
},
{ "name": "Support",
"entries": [
{ "type": "subCategory", "name": "COMBINE support",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void CsvDataStoreExporterWorker::run()
rowData += ',';

if ( (runsIndex[j] < dataStore->size(j))
&& qIsNull(dataStore->voi()->value(runsIndex[j], j)-voiValue)) {
&& qFuzzyCompare(dataStore->voi()->value(runsIndex[j], j), voiValue)) {
rowData += QString::number(variableRun->value(runsIndex[j], j));

updateRunsIndex[j] = true;
Expand Down
20 changes: 10 additions & 10 deletions src/plugins/miscellaneous/Compiler/tests/tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ void Tests::notOperatorTests()
1.0);
QCOMPARE(reinterpret_cast<double (*)(double)>(mCompilerEngine->getFunction("function"))(mA),
0.0);
QCOMPARE(reinterpret_cast<double (*)(double)>(mCompilerEngine->getFunction("function"))(qIsNull(mA)),
QCOMPARE(reinterpret_cast<double (*)(double)>(mCompilerEngine->getFunction("function"))(qFuzzyIsNull(mA)),
1.0);
}

Expand All @@ -271,11 +271,11 @@ void Tests::orOperatorTests()
0.0);
QCOMPARE(reinterpret_cast<double (*)(double, double)>(mCompilerEngine->getFunction("function"))(mA, mB),
1.0);
QCOMPARE(reinterpret_cast<double (*)(double, double)>(mCompilerEngine->getFunction("function"))(qIsNull(mA), mB),
QCOMPARE(reinterpret_cast<double (*)(double, double)>(mCompilerEngine->getFunction("function"))(qFuzzyIsNull(mA), mB),
1.0);
QCOMPARE(reinterpret_cast<double (*)(double, double)>(mCompilerEngine->getFunction("function"))(mA, qIsNull(mB)),
QCOMPARE(reinterpret_cast<double (*)(double, double)>(mCompilerEngine->getFunction("function"))(mA, qFuzzyIsNull(mB)),
1.0);
QCOMPARE(reinterpret_cast<double (*)(double, double)>(mCompilerEngine->getFunction("function"))(qIsNull(mA), qIsNull(mB)),
QCOMPARE(reinterpret_cast<double (*)(double, double)>(mCompilerEngine->getFunction("function"))(qFuzzyIsNull(mA), qFuzzyIsNull(mB)),
0.0);
}

Expand All @@ -298,11 +298,11 @@ void Tests::xorOperatorTests()
0.0);
QCOMPARE(reinterpret_cast<double (*)(double, double)>(mCompilerEngine->getFunction("function"))(mA, mB),
0.0);
QCOMPARE(reinterpret_cast<double (*)(double, double)>(mCompilerEngine->getFunction("function"))(qIsNull(mA), mB),
QCOMPARE(reinterpret_cast<double (*)(double, double)>(mCompilerEngine->getFunction("function"))(qFuzzyIsNull(mA), mB),
1.0);
QCOMPARE(reinterpret_cast<double (*)(double, double)>(mCompilerEngine->getFunction("function"))(mA, qIsNull(mB)),
QCOMPARE(reinterpret_cast<double (*)(double, double)>(mCompilerEngine->getFunction("function"))(mA, qFuzzyIsNull(mB)),
1.0);
QCOMPARE(reinterpret_cast<double (*)(double, double)>(mCompilerEngine->getFunction("function"))(qIsNull(mA), qIsNull(mB)),
QCOMPARE(reinterpret_cast<double (*)(double, double)>(mCompilerEngine->getFunction("function"))(qFuzzyIsNull(mA), qFuzzyIsNull(mB)),
0.0);
}

Expand All @@ -325,11 +325,11 @@ void Tests::andOperatorTests()
0.0);
QCOMPARE(reinterpret_cast<double (*)(double, double)>(mCompilerEngine->getFunction("function"))(mA, mB),
1.0);
QCOMPARE(reinterpret_cast<double (*)(double, double)>(mCompilerEngine->getFunction("function"))(qIsNull(mA), mB),
QCOMPARE(reinterpret_cast<double (*)(double, double)>(mCompilerEngine->getFunction("function"))(qFuzzyIsNull(mA), mB),
0.0);
QCOMPARE(reinterpret_cast<double (*)(double, double)>(mCompilerEngine->getFunction("function"))(mA, qIsNull(mB)),
QCOMPARE(reinterpret_cast<double (*)(double, double)>(mCompilerEngine->getFunction("function"))(mA, qFuzzyIsNull(mB)),
0.0);
QCOMPARE(reinterpret_cast<double (*)(double, double)>(mCompilerEngine->getFunction("function"))(qIsNull(mA), qIsNull(mB)),
QCOMPARE(reinterpret_cast<double (*)(double, double)>(mCompilerEngine->getFunction("function"))(qFuzzyIsNull(mA), qFuzzyIsNull(mB)),
0.0);
}

Expand Down
16 changes: 8 additions & 8 deletions src/plugins/miscellaneous/Core/src/busywidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ BusyWidget::BusyWidget(QWidget *pParent, double pProgress) :

show();

if (qIsNull(pProgress+1.0))
if (qFuzzyCompare(pProgress, -1.0))
mTimer->start();
}

Expand Down Expand Up @@ -160,7 +160,7 @@ void BusyWidget::setBackgroundRoundness(double pBackgroundRoundness)
{
// Set our background roundness

if (!qIsNull(pBackgroundRoundness-mBackgroundRoundness)) {
if (!qFuzzyCompare(pBackgroundRoundness, mBackgroundRoundness)) {
mBackgroundRoundness = pBackgroundRoundness;

update();
Expand Down Expand Up @@ -249,7 +249,7 @@ void BusyWidget::setRoundness(double pRoundness)
{
// Set the roundness of our lines

if (!qIsNull(pRoundness-mRoundness)) {
if (!qFuzzyCompare(pRoundness, mRoundness)) {
mRoundness = pRoundness;

update();
Expand Down Expand Up @@ -293,7 +293,7 @@ void BusyWidget::setOpacity(double pOpacity)
{
// Set the opacity of our lines

if (!qIsNull(pOpacity-mOpacity)) {
if (!qFuzzyCompare(pOpacity, mOpacity)) {
mOpacity = pOpacity;

update();
Expand Down Expand Up @@ -337,10 +337,10 @@ void BusyWidget::setProgress(double pProgress)
{
// Set our progress and enable/disable our timer, depending on the case

if (!qIsNull(pProgress-mProgress)) {
if (!qFuzzyCompare(pProgress, mProgress)) {
mProgress = pProgress;

if (qIsNull(pProgress+1.0)) {
if (qFuzzyCompare(pProgress, -1.0)) {
mMainLine = 0;

mTimer->start();
Expand Down Expand Up @@ -412,7 +412,7 @@ void BusyWidget::paintEvent(QPaintEvent *pEvent)

// Draw ourselves and accept the event

if (qIsNull(mProgress+1.0)) {
if (qFuzzyCompare(mProgress, -1.0)) {
double lineCornerRadius = mRoundness*(mThickness >> 1);

for (int i = 0; i < mCount; ++i) {
Expand Down Expand Up @@ -442,7 +442,7 @@ void BusyWidget::paintEvent(QPaintEvent *pEvent)

painter.setBrush(mForegroundColor);

if (qIsNull(mProgress-1.0)) {
if (qFuzzyCompare(mProgress, 1.0)) {
painter.drawEllipse(QPointF(0.0, 0.0), 0.5*size, 0.5*size);
} else {
painter.drawPie(QRectF(-0.5*size, -0.5*size, size, size),
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/miscellaneous/Core/src/progressbarwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void ProgressBarWidget::setValue(double pValue)

double value = qMin(1.0, qMax(pValue, 0.0));

if (!qIsNull(value-mValue)) {
if (!qFuzzyCompare(value, mValue)) {
bool needUpdate = int(mValue*width()) != int(value*width());

mValue = value;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/miscellaneous/Core/src/usermessagewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void UserMessageWidget::setScale(double pScale)
{
// Scale ourselves, if needed

if (!qIsNull(pScale-mScale)) {
if (!qFuzzyCompare(pScale, mScale)) {
mScale = pScale;

QFont newFont = font();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1747,7 +1747,7 @@ bool SimulationExperimentViewSimulationWidget::createSedmlFile(SEDMLSupport::Sed
double endingPoint = mSimulation->data()->endingPoint();
double pointInterval = mSimulation->data()->pointInterval();
quint64 nbOfPoints = quint64(ceil((endingPoint-startingPoint)/pointInterval));
bool needOneStepTask = !qIsNull((endingPoint-startingPoint)/nbOfPoints-pointInterval);
bool needOneStepTask = !qFuzzyCompare((endingPoint-startingPoint)/nbOfPoints, pointInterval);

libsedml::SedUniformTimeCourse *sedmlUniformTimeCourse = sedmlDocument->createUniformTimeCourse();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void ForwardEulerSolver::solve(double &pVoi, double pVoiEnd) const
int stepNumber = 0;
double realStep = mStep;

while (!qIsNull(pVoi-pVoiEnd)) {
while (!qFuzzyCompare(pVoi, pVoiEnd)) {
// Check that the time step is correct

if (pVoi+realStep > pVoiEnd)
Expand All @@ -86,7 +86,7 @@ void ForwardEulerSolver::solve(double &pVoi, double pVoiEnd) const

// Advance through time

if (!qIsNull(realStep-mStep))
if (!qFuzzyCompare(realStep, mStep))
pVoi = pVoiEnd;
else
pVoi = voiStart+(++stepNumber)*mStep;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void FourthOrderRungeKuttaSolver::solve(double &pVoi, double pVoiEnd) const
double realStep = mStep;
double realHalfStep = 0.5*realStep;

while (!qIsNull(pVoi-pVoiEnd)) {
while (!qFuzzyCompare(pVoi, pVoiEnd)) {
// Check that the time step is correct

if (pVoi+realStep > pVoiEnd) {
Expand Down Expand Up @@ -157,7 +157,7 @@ void FourthOrderRungeKuttaSolver::solve(double &pVoi, double pVoiEnd) const

// Advance through time

if (!qIsNull(realStep-mStep))
if (!qFuzzyCompare(realStep, mStep))
pVoi = pVoiEnd;
else
pVoi = voiStart+(++stepNumber)*mStep;
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/solver/HeunSolver/src/heunsolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void HeunSolver::solve(double &pVoi, double pVoiEnd) const
double realStep = mStep;
double realHalfStep = 0.5*realStep;

while (!qIsNull(pVoi-pVoiEnd)) {
while (!qFuzzyCompare(pVoi, pVoiEnd)) {
// Check that the time step is correct

if (pVoi+realStep > pVoiEnd) {
Expand Down Expand Up @@ -121,7 +121,7 @@ void HeunSolver::solve(double &pVoi, double pVoiEnd) const

// Advance through time

if (!qIsNull(realStep-mStep))
if (!qFuzzyCompare(realStep, mStep))
pVoi = pVoiEnd;
else
pVoi = voiStart+(++stepNumber)*mStep;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void SecondOrderRungeKuttaSolver::solve(double &pVoi, double pVoiEnd) const
double realStep = mStep;
double realHalfStep = 0.5*realStep;

while (!qIsNull(pVoi-pVoiEnd)) {
while (!qFuzzyCompare(pVoi, pVoiEnd)) {
// Check that the time step is correct

if (pVoi+realStep > pVoiEnd) {
Expand Down Expand Up @@ -120,7 +120,7 @@ void SecondOrderRungeKuttaSolver::solve(double &pVoi, double pVoiEnd) const

// Advance through time

if (!qIsNull(realStep-mStep))
if (!qFuzzyCompare(realStep, mStep))
pVoi = pVoiEnd;
else
pVoi = voiStart+(++stepNumber)*mStep;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ void PmrWebServiceManager::closeBrowser()
// Close our temporary web browser, but only if the current page has
// finished loading otherwise try again in a bit

if (qIsNull(mWebViewer->progressBarWidget()->value()))
if (qFuzzyIsNull(mWebViewer->progressBarWidget()->value()))
mWebViewerDialog->close();
else
QTimer::singleShot(169, this, &PmrWebServiceManager::closeBrowser);
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/support/SEDMLSupport/src/sedmlfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,14 +438,14 @@ bool SedmlFile::isSupported()
double outputEndTime = uniformTimeCourse->getOutputEndTime();
int nbOfPoints = uniformTimeCourse->getNumberOfPoints();

if (!qIsNull(initialTime-outputStartTime)) {
if (!qFuzzyCompare(initialTime, outputStartTime)) {
mIssues << SedmlFileIssue(SedmlFileIssue::Information,
tr("only SED-ML files with the same values for 'initialTime' and 'outputStartTime' are supported"));

return false;
}

if (qIsNull(outputStartTime-outputEndTime)) {
if (qFuzzyCompare(outputStartTime, outputEndTime)) {
mIssues << SedmlFileIssue(SedmlFileIssue::Error,
tr("the values for 'outputStartTime' and 'outputEndTime' must be different"));

Expand Down Expand Up @@ -697,7 +697,7 @@ bool SedmlFile::isSupported()
libsedml::SedVectorRange *vectorRange = static_cast<libsedml::SedVectorRange *>(range);

if ( (vectorRange->getNumValues() == 1)
&& (qIsNull(vectorRange->getValues().front()-1.0))) {
&& (qFuzzyCompare(vectorRange->getValues().front(), 1.0))) {
// Make sure that the one/two sub-tasks have the correct
// order and retrieve their id

Expand Down
6 changes: 3 additions & 3 deletions src/plugins/support/SimulationSupport/src/simulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,13 +484,13 @@ bool SimulationData::doIsModified(bool pCheckConstants) const

if (runtime) {
for (int i = 0, iMax = runtime->statesCount(); i < iMax; ++i) {
if (!qIsNull(mStates[i]-mInitialStates[i]))
if (!qFuzzyCompare(mStates[i], mInitialStates[i]))
return true;
}

if (pCheckConstants) {
for (int i = 0, iMax = runtime->constantsCount(); i < iMax; ++i) {
if (!qIsNull(mConstants[i]-mInitialConstants[i]))
if (!qFuzzyCompare(mConstants[i], mInitialConstants[i]))
return true;
}
}
Expand Down Expand Up @@ -1091,7 +1091,7 @@ bool Simulation::simulationSettingsOk(bool pEmitSignal)
{
// Check and return whether our simulation settings are sound

if (qIsNull(mData->startingPoint()-mData->endingPoint())) {
if (qFuzzyCompare(mData->startingPoint(), mData->endingPoint())) {
if (pEmitSignal)
emit error(tr("the starting and ending points cannot have the same value"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ void SimulationWorker::run()

// Some post-processing, if needed

if (qIsNull(mCurrentPoint-endingPoint) || mStopped) {
if (qFuzzyCompare(mCurrentPoint, endingPoint) || mStopped) {
// We have reached our ending point or we have been asked to
// stop, so leave our main work loop

Expand Down

0 comments on commit 966038d

Please sign in to comment.