]> rtime.felk.cvut.cz Git - eurobot/public.git/blob - src/display-qt/ortesignals.cpp
display-qt : Some files and function were renamed (only).
[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         orte.strength = 1;
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_vidle_status_create(&orte, rcv_vidle_status_cb, this);
19         robottype_subscriber_pwr_voltage_create(&orte, rcv_pwr_voltage_cb, this);
20         robottype_subscriber_est_pos_best_create(&orte, rcv_est_pos_best_cb, this);
21         robottype_subscriber_hokuyo_scan_create(&orte, rcv_hokuyo_scan_cb, this);
22         robottype_subscriber_camera_result_create(&orte, rcv_camera_result_cb, &orte); //nebude uzito
23         robottype_subscriber_fsm_main_create(&orte, rcv_fsm_main_cb, this);
24         robottype_subscriber_fsm_act_create(&orte, rcv_fsm_act_cb, this);
25         robottype_subscriber_fsm_motion_create(&orte, rcv_fsm_motion_cb, this);
26         robottype_subscriber_robot_cmd_create(&orte, rcv_robot_cmd_cb, this);
27         robottype_subscriber_robot_switches_create(&orte, rcv_robot_swicthes_cb, this);
28 }
29
30 void OrteSignals::fsm_con(UDE_fsm_t fsm, QString state)
31 {
32         emit fsm_sig(fsm, state);
33 }
34
35 void OrteSignals::status_con(UDE_component_t c, UDE_hw_status_t s)
36 {
37         emit status_sig(c, s);
38 }
39
40 void OrteSignals::position_con(void)
41 {
42         emit position_sig(orte.est_pos_best.x, orte.est_pos_best.y, orte.est_pos_best.phi);
43 }
44
45 void OrteSignals::pwr_con(void)
46 {
47         emit pwr_sig(orte.pwr_voltage.voltage33, orte.pwr_voltage.voltage50,
48                                 orte.pwr_voltage.voltage80, orte.pwr_voltage.voltageBAT);
49 }
50
51 void OrteSignals::color_con(char color)
52 {
53         emit color_sig(color);
54 }