]> rtime.felk.cvut.cz Git - eurobot/public.git/blob - src/display-qt/ortesignals.cpp
Unify ORTE initialization
[eurobot/public.git] / src / display-qt / ortesignals.cpp
1 #include "ortesignals.h"
2
3
4 OrteSignals::OrteSignals()
5 {
6         createOrte();
7 }
8
9
10 void OrteSignals::createOrte()
11 {
12         memset(&orte, 0, sizeof(orte));
13         robottype_roboorte_init(&orte); //kontrola uspechu ?
14
15         //subscribers
16         robottype_subscriber_odo_data_create(&orte, rcv_odo_data_cb, this);
17         robottype_subscriber_motion_status_create(&orte, rcv_motion_status_cb, this);
18         robottype_subscriber_lift_status_create(&orte, rcv_lift_status_cb, this);
19         robottype_subscriber_jaws_status_create(&orte, rcv_jaws_status_cb, this);
20         robottype_subscriber_pwr_voltage_create(&orte, rcv_pwr_voltage_cb, this);
21         robottype_subscriber_est_pos_best_create(&orte, rcv_est_pos_best_cb, this);
22         robottype_subscriber_hokuyo_scan_create(&orte, rcv_hokuyo_scan_cb, this);
23         robottype_subscriber_camera_result_create(&orte, rcv_camera_result_cb, &orte); //nebude uzito
24         robottype_subscriber_fsm_main_create(&orte, rcv_fsm_main_cb, this);
25         robottype_subscriber_fsm_act_create(&orte, rcv_fsm_act_cb, this);
26         robottype_subscriber_fsm_motion_create(&orte, rcv_fsm_motion_cb, this);
27         robottype_subscriber_robot_cmd_create(&orte, rcv_robot_cmd_cb, this);
28         robottype_subscriber_robot_switches_create(&orte, rcv_robot_swicthes_cb, this);
29         robottype_subscriber_match_time_create(&orte, rcv_match_time_cb, this);
30 }
31
32 void OrteSignals::fsm_con(UDE_fsm_t fsm, QString state)
33 {
34         emit fsm_sig(fsm, state);
35 }
36
37 void OrteSignals::status_con(UDE_component_t c, UDE_hw_status_t s)
38 {
39         emit status_sig(c, s);
40 }
41
42 void OrteSignals::position_con(void)
43 {
44         emit position_sig(orte.est_pos_best.x, orte.est_pos_best.y, orte.est_pos_best.phi);
45 }
46
47 void OrteSignals::pwr_con(void)
48 {
49         emit pwr_sig(orte.pwr_voltage.voltage33, orte.pwr_voltage.voltage50,
50                                 orte.pwr_voltage.voltage80, orte.pwr_voltage.voltageBAT);
51 }
52
53 void OrteSignals::color_con(char color)
54 {
55         emit color_sig(color);
56 }
57
58 void OrteSignals::time_con(void)
59 {
60         emit time_sig(orte.match_time.time);
61 }