Skip to content

Commit

Permalink
Progress output in dlt-commander. (#581)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Wenzel <[email protected]>
  • Loading branch information
alexmucde authored Nov 18, 2024
1 parent 674608b commit 93f6fe4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions qdlt/qdltfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,14 @@ bool QDltFile::updateIndex()
qint64 file_size = files[numFile]->infile.size();
qint64 errors_in_file = 0;

quint8 progressNextCmdOutput=10;
while(true)
{
if( (file_size>0) && ((pos*100/file_size)>=progressNextCmdOutput))
{
qDebug() << "CI:" << pos*100/file_size << "%";
progressNextCmdOutput+=10;
}

/* read buffer from file */
buf = files[numFile]->infile.read(READ_BUF_SZ);
Expand Down Expand Up @@ -438,7 +444,15 @@ bool QDltFile::updateIndexFilter()
index = 0;
}

quint8 progressNextCmdOutput=10;
for(int num=index;num<size();num++) {

if( (size()>0) && ((num*100/size())>=progressNextCmdOutput))
{
qDebug() << "CFI:" << num*100/size() << "%";
progressNextCmdOutput+=10;
}

buf = getMsg(num);
if(!buf.isEmpty()) {
msg.setMsg(buf,true,dltv2Support);
Expand Down

0 comments on commit 93f6fe4

Please sign in to comment.