Progress bar, CMake fixes
This commit is contained in:
10
main.cpp
10
main.cpp
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user