Print the init log info

This commit is contained in:
dreamsourcelabTAI 2023-02-23 10:47:32 +08:00
parent cff9b43e68
commit 1aba1a4e4b
3 changed files with 13 additions and 19 deletions

View File

@ -40,7 +40,6 @@
#include <windows.h>
#endif
void usage()
{
printf(
@ -214,7 +213,6 @@ bool bHighScale = true;
//init core
if (!control->Init()){
dsv_err("%s", "init error!");
dsv_err("%s", control->GetLastError());
return 1;
}
@ -231,6 +229,8 @@ bool bHighScale = true;
w.show_doc(); //to show the dailog for open help document
ret = a.exec(); //Run the application
control->Stop();
dsv_info("Main window closed.");
}
catch (const std::exception &e)
{
@ -242,6 +242,8 @@ bool bHighScale = true;
control->UnInit(); //uninit
control->Destroy();
dsv_info("Uninit log.");
dsv_log_uninit();
return ret;

View File

@ -92,14 +92,14 @@ bool AppControl::Init()
// Initialise libsigrokdecode
if (srd_init(path) != SRD_OK)
{
m_error = "ERROR: libsigrokdecode init failed.";
dsv_err("%s", "ERROR: libsigrokdecode init failed.");
return false;
}
// Load the protocol decoders
if (srd_decoder_load_all() != SRD_OK)
{
m_error = "ERROR: load the protocol decoders failed.";
dsv_err("ERROR: load the protocol decoders failed.");
return false;
}
@ -125,11 +125,6 @@ void AppControl::UnInit()
_session->uninit();
}
const char *AppControl::GetLastError()
{
return m_error.c_str();
}
bool AppControl::TopWindowIsMaximized()
{
if (_topWindow != NULL){

View File

@ -50,8 +50,6 @@ public:
void UnInit();
const char* GetLastError();
inline pv::SigSession* GetSession(){
return _session;
}
@ -70,7 +68,6 @@ public:
std::string _open_file_name;
private:
std::string m_error;
pv::SigSession *_session;
QWidget *_topWindow;
};