Skip to content

Commit

Permalink
Fix parsing device value in tuner; fixes #341
Browse files Browse the repository at this point in the history
  • Loading branch information
ra3xdh committed Oct 28, 2023
1 parent f468570 commit d0b6e74
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion qucs/dialogs/tuner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ tunerElement::tunerElement(QWidget *parent, Component *component, Property *pp,
else
{//The property value contains only numbers
numValue = val.toFloat();
has_unit = false;
}
if ((unit.length() <= 1) && (!pp->Description.isEmpty()))
{//It comes with no units... so let's try to find a suitable unit
Expand Down Expand Up @@ -115,10 +116,12 @@ tunerElement::tunerElement(QWidget *parent, Component *component, Property *pp,
}
if (found) break;
}
has_unit = found;
}
else
{//The value comes with unit
if (magnitudeIndex != 5) unit = unit.mid(1);
has_unit = true;
}

//Finally, add the unit to the QStringList for adding it to the scale comboboxes later
Expand Down Expand Up @@ -270,7 +273,7 @@ void tunerElement::resetValue()
*/
void tunerElement::updateProperty()
{
prop->Value = value->text().append(tr(" ") + ValueUnitsCombobox->currentText());
prop->Value = value->text().append(ValueUnitsCombobox->currentText());
qDebug() << "Updated property: " << prop->Value;
}

Expand Down

0 comments on commit d0b6e74

Please sign in to comment.