Continued from last week, I finally manage to automate the bitstream generation. Good news that I have also fixed the problem that causes the hanging of the web application. The hanging is mainly caused by the usage of
Wt::WApplication::instance()->deferRendering, because freezes the user interface.
Wt::WApplication::instance()->deferRendering, it does not work well, unless the widgets are clicked on. As I refer from the documentation, it seems like the application is not running normal event handling after removing the renderings, as if all events had been handled.