diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-12-03 22:23:08 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-12-04 12:19:26 +0100 |
commit | b256886a5cb9f2ae3ebda70a2045b19ed9f4233e (patch) | |
tree | 4fa1e46de224cf834a05824dc1eb86001bdb3300 /tracker-hatire/ftnoir_tracker_hat.cpp | |
parent | e89709a801e7874bc02c66848c638c6a0ccc85c1 (diff) |
api: add status check for modules
Diffstat (limited to 'tracker-hatire/ftnoir_tracker_hat.cpp')
-rw-r--r-- | tracker-hatire/ftnoir_tracker_hat.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tracker-hatire/ftnoir_tracker_hat.cpp b/tracker-hatire/ftnoir_tracker_hat.cpp index 6e1b6586..29381eaa 100644 --- a/tracker-hatire/ftnoir_tracker_hat.cpp +++ b/tracker-hatire/ftnoir_tracker_hat.cpp @@ -43,27 +43,27 @@ void hatire::get_info( int *tps ) *tps=frame_cnt; frame_cnt=0; } -void hatire::start_tracker(QFrame*) +module_status hatire::start_tracker(QFrame*) { - CptError=0; - frame_cnt=0; + CptError=0; + frame_cnt=0; t.Log("Starting Tracker"); serial_result ret = t.init_serial_port(); + t.start(); + switch (ret.code) { case result_ok: - break; + return status_ok(); case result_error: - QMessageBox::warning(0, tr("Error"), ret.error, QMessageBox::Ok,QMessageBox::NoButton); - break; + return error(ret.error); case result_open_error: - QMessageBox::warning(0, tr("Error"), tr("Unable to open ComPort: %1").arg(ret.error), QMessageBox::Ok,QMessageBox::NoButton); - break; + return error(tr("Unable to open ComPort: %1").arg(ret.error)); + default: + return error("Unknown error"); } - - t.start(); } void hatire::serial_info() |