Skip to content

Commit

Permalink
Cleanup current output
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmucde committed May 15, 2022
1 parent bdb7276 commit e1459ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ Github Sponsors:

v0.1.4:

* Cleanup current output
* Support OWON XDM1041 Multimeter

v0.1.3:
Expand Down
8 changes: 5 additions & 3 deletions dltmultimeter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,9 @@ void DLTMultimeter::readyRead()
}
else if(line.length()==9)
{
float current = (QString("%1%2.%3%4").arg(line[4]).arg(line[5]).arg(line[6]).arg(line[7])).toFloat() - substractCurrent;
valueMultimeter(QString("%1").arg(current),"A");
double current = (QString("%1%2.%3%4%5").arg(line[4]).arg(line[5]).arg(line[6]).arg(line[7]).arg(line[8])).toDouble() - substractCurrent;
// valueMultimeter(QString("%1").arg(current),"A");
valueMultimeter(QString::number(current, 'f', 3),"A");
valueMultimeter(QString("%1%2.%3%4").arg(line[0]).arg(line[1]).arg(line[2]).arg(line[3]),"V");
readVoltageOngoing = false;
if(!voltageCmd.isEmpty())
Expand Down Expand Up @@ -295,7 +296,8 @@ void DLTMultimeter::readyRead()
{
watchDogCounter++;
double current = line.toFloat();
valueMultimeter(QString("%1").arg(current,0,'g',3),"A");
// valueMultimeter(QString("%1").arg(current,0,'g',3),"A");
valueMultimeter(QString::number(current, 'f', 3),"A");
}

serialData.remove(0,pos+1);
Expand Down

0 comments on commit e1459ed

Please sign in to comment.