Progress bar, CMake fixes

This commit is contained in:
Jaro
2021-08-27 13:55:00 +02:00
parent ca0fdd3428
commit 6f007afe2a
3 changed files with 12 additions and 213 deletions

View File

@@ -110,6 +110,12 @@ static void init_log(void)
fsSink->locked_backend()->auto_flush(true);
}
void showProgress(int num)
{
cout << "Downloading: (" << num << "/100) %" ;
cout.put('\r');
cout << flush;
}
int main(int argc, char* argv[])
{
@@ -235,6 +241,8 @@ int main(int argc, char* argv[])
modem.setSerialPort(&serial);
modem.setFilePath(path);
modem.setDefaultFileName(filename);
modem.receiveProgress.connect(showProgress);
modem.startReceive();
boost::this_thread::sleep(posix_time::seconds(1));
@@ -248,4 +256,4 @@ int main(int argc, char* argv[])
cout<<"Error: "<<e.what()<<endl;
return 1;
}
}
}