Skip to content

Commit

Permalink
Fallback to base unit if conversion fails.
Browse files Browse the repository at this point in the history
Show the error message if we are unable to convert to display unit.
  • Loading branch information
adeas31 committed Apr 12, 2016
1 parent 47b45e5 commit efb215b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions OMEdit/OMEditGUI/OMC/OMCProxy.cpp
Expand Up @@ -2314,6 +2314,10 @@ OMCInterface::convertUnits_res OMCProxy::convertUnits(QString from, QString to)
unitConverion.mToUnit = to;
unitConverion.mConvertUnits = convertUnits_res;
mUnitConversionList.append(unitConverion);
// show error if units are not compatible
if (!convertUnits_res.unitsCompatible) {
printMessagesStringInternal();
}
return convertUnits_res;
}

Expand Down
3 changes: 3 additions & 0 deletions OMEdit/OMEditGUI/Plotting/VariablesWidget.cpp
Expand Up @@ -1086,6 +1086,9 @@ void VariablesWidget::plotVariables(const QModelIndex &index, qreal curveThickne
}
pPlotCurve->setData(pPlotCurve->getXAxisVector(), pPlotCurve->getYAxisVector(), pPlotCurve->getSize());
pPlotWindow->getPlot()->replot();
} else {
pPlotCurve->setDisplayUnit(pVariablesTreeItem->getUnit());
pPlotCurve->setTitleLocal();
}
}
if (pPlotWindow->getAutoScaleButton()->isChecked()) {
Expand Down

0 comments on commit efb215b

Please sign in to comment.