Skip to content

Commit

Permalink
Show variable aliases in Bode plot dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
robbr48 committed Nov 15, 2023
1 parent 41ddf32 commit 91166f7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
5 changes: 5 additions & 0 deletions HopsanGUI/PlotCurve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,11 @@ QString PlotCurve::getDataSmartName() const
return mData->getSmartName();
}

QString PlotCurve::getAliasName() const
{
return mData->getAliasName();
}


const SharedVectorVariableT PlotCurve::getSharedVectorVariable() const
{
Expand Down
1 change: 1 addition & 0 deletions HopsanGUI/PlotCurve.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class PlotCurve : public QObject, public QwtPlotCurve
const QString &getDataModelPath() const;
QString getDataFullName() const;
QString getDataSmartName() const;
QString getAliasName() const;
VariableSourceTypeT getDataSource() const;

bool hasCurveDataUnitScale() const;
Expand Down
22 changes: 16 additions & 6 deletions HopsanGUI/PlotTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1479,9 +1479,14 @@ void PlotTab::openCreateBodePlotDialog()
pInputGroupBoxLayout->addStretch(1);
for(int i=0; i<getNumberOfCurves(0); ++i)
{
QRadioButton *radio = new QRadioButton(getCurves(0).at(i)->getComponentName() + ", " +
getCurves(0).at(i)->getPortName() + ", " +
getCurves(0).at(i)->getDataName());
QString curveName = getCurves(0).at(i)->getComponentName() + ", " +
getCurves(0).at(i)->getPortName() + ", " +
getCurves(0).at(i)->getDataName();
QString aliasName = getCurves(0).at(i)->getAliasName();
if(!aliasName.isEmpty()) {
curveName.append(" ("+aliasName+")");
}
QRadioButton *radio = new QRadioButton(curveName);
bodeInputButtonToCurveMap.insert(radio, getCurves(0).at(i));
pInputGroupBoxLayout->addWidget(radio);
}
Expand All @@ -1492,9 +1497,14 @@ void PlotTab::openCreateBodePlotDialog()
pOutputGroupBoxLayout->addStretch(1);
for(int i=0; i<getNumberOfCurves(0); ++i)
{
QRadioButton *radio = new QRadioButton(getCurves(0).at(i)->getComponentName() + ", " +
getCurves(0).at(i)->getPortName() + ", " +
getCurves(0).at(i)->getDataName());
QString curveName = getCurves(0).at(i)->getComponentName() + ", " +
getCurves(0).at(i)->getPortName() + ", " +
getCurves(0).at(i)->getDataName();
QString aliasName = getCurves(0).at(i)->getAliasName();
if(!aliasName.isEmpty()) {
curveName.append(" ("+aliasName+")");
}
QRadioButton *radio = new QRadioButton(curveName);
bodeOutputButtonToCurveMap.insert(radio, getCurves(0).at(i));
pOutputGroupBoxLayout->addWidget(radio);
}
Expand Down

0 comments on commit 91166f7

Please sign in to comment.