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 | |
parent | e89709a801e7874bc02c66848c638c6a0ccc85c1 (diff) |
api: add status check for modules
Diffstat (limited to 'tracker-hatire')
-rw-r--r-- | tracker-hatire/ftnoir_tracker_hat.cpp | 20 | ||||
-rw-r--r-- | tracker-hatire/ftnoir_tracker_hat.h | 2 |
2 files changed, 11 insertions, 11 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() diff --git a/tracker-hatire/ftnoir_tracker_hat.h b/tracker-hatire/ftnoir_tracker_hat.h index fa8b8448..45b3f250 100644 --- a/tracker-hatire/ftnoir_tracker_hat.h +++ b/tracker-hatire/ftnoir_tracker_hat.h @@ -22,7 +22,7 @@ public: hatire(); ~hatire(); - void start_tracker(QFrame*); + module_status start_tracker(QFrame*); void data(double *data); //void center(); //bool notifyZeroed(); |