Rev 440 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 440 | Rev 442 | ||
---|---|---|---|
1 | /*************************************************************************** |
1 | /*************************************************************************** |
2 | * Copyright (C) 2008 by Manuel Schrape * |
2 | * Copyright (C) 2008 by Manuel Schrape * |
3 | * manuel.schrape@gmx.de * |
3 | * manuel.schrape@gmx.de * |
4 | * * |
4 | * * |
5 | * This program is free software; you can redistribute it and/or modify * |
5 | * This program is free software; you can redistribute it and/or modify * |
6 | * it under the terms of the GNU General Public License as published by * |
6 | * it under the terms of the GNU General Public License as published by * |
7 | * the Free Software Foundation; either version 2 of the License. * |
7 | * the Free Software Foundation; either version 2 of the License. * |
8 | * * |
8 | * * |
9 | * This program is distributed in the hope that it will be useful, * |
9 | * This program is distributed in the hope that it will be useful, * |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
12 | * GNU General Public License for more details. * |
12 | * GNU General Public License for more details. * |
13 | * * |
13 | * * |
14 | * You should have received a copy of the GNU General Public License * |
14 | * You should have received a copy of the GNU General Public License * |
15 | * along with this program; if not, write to the * |
15 | * along with this program; if not, write to the * |
16 | * Free Software Foundation, Inc., * |
16 | * Free Software Foundation, Inc., * |
17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
18 | ***************************************************************************/ |
18 | ***************************************************************************/ |
19 | #include "dlg_Motortest.h" |
19 | #include "dlg_Motortest.h" |
20 | 20 | ||
21 | dlg_Motortest::dlg_Motortest(QWidget *parent) : QDialog(parent) |
21 | dlg_Motortest::dlg_Motortest(QWidget *parent) : QDialog(parent) |
22 | { |
22 | { |
23 | setupUi(this); |
23 | setupUi(this); |
24 | connect(sl_Speed, SIGNAL(valueChanged(int)), this, SLOT(slot_Motortest(int))); |
24 | connect(sl_Speed, SIGNAL(valueChanged(int)), this, SLOT(slot_Motortest(int))); |
25 | } |
25 | } |
26 | 26 | ||
27 | void dlg_Motortest::slot_Motortest(int Wert) |
27 | void dlg_Motortest::slot_Motortest(int Wert) |
28 | { |
28 | { |
- | 29 | //TODO: use KopterData? |
|
29 | sMotor Motor; |
30 | sMotorData Motor; |
30 | 31 | ||
31 | for (int z = 0; z < 12; z++) |
32 | for (int z = 0; z < 12; z++) |
32 | { |
33 | { |
33 | Motor.Speed[z] = 0; |
34 | Motor.desired_speed[z] = 0; |
34 | } |
35 | } |
35 | 36 | ||
36 | if (cb_1->isChecked()) |
37 | if (cb_1->isChecked()) |
37 | Motor.Speed[0] = Wert; |
38 | Motor.desired_speed[0] = Wert; |
38 | if (cb_2->isChecked()) |
39 | if (cb_2->isChecked()) |
39 | Motor.Speed[1] = Wert; |
40 | Motor.desired_speed[1] = Wert; |
40 | if (cb_3->isChecked()) |
41 | if (cb_3->isChecked()) |
41 | Motor.Speed[2] = Wert; |
42 | Motor.desired_speed[2] = Wert; |
42 | if (cb_4->isChecked()) |
43 | if (cb_4->isChecked()) |
43 | Motor.Speed[3] = Wert; |
44 | Motor.desired_speed[3] = Wert; |
44 | if (cb_5->isChecked()) |
45 | if (cb_5->isChecked()) |
45 | Motor.Speed[4] = Wert; |
46 | Motor.desired_speed[4] = Wert; |
46 | if (cb_6->isChecked()) |
47 | if (cb_6->isChecked()) |
47 | Motor.Speed[5] = Wert; |
48 | Motor.desired_speed[5] = Wert; |
48 | if (cb_7->isChecked()) |
49 | if (cb_7->isChecked()) |
49 | Motor.Speed[6] = Wert; |
50 | Motor.desired_speed[6] = Wert; |
50 | if (cb_8->isChecked()) |
51 | if (cb_8->isChecked()) |
51 | Motor.Speed[7] = Wert; |
52 | Motor.desired_speed[7] = Wert; |
52 | if (cb_9->isChecked()) |
53 | if (cb_9->isChecked()) |
53 | Motor.Speed[8] = Wert; |
54 | Motor.desired_speed[8] = Wert; |
54 | if (cb_10->isChecked()) |
55 | if (cb_10->isChecked()) |
55 | Motor.Speed[9] = Wert; |
56 | Motor.desired_speed[9] = Wert; |
56 | if (cb_11->isChecked()) |
57 | if (cb_11->isChecked()) |
57 | Motor.Speed[10] = Wert; |
58 | Motor.desired_speed[10] = Wert; |
58 | if (cb_12->isChecked()) |
59 | if (cb_12->isChecked()) |
59 | Motor.Speed[11] = Wert; |
60 | Motor.desired_speed[11] = Wert; |
60 | 61 | ||
61 | emit updateMotor(Motor); |
62 | emit updateMotor(Motor); |
62 | } |
63 | } |
63 | 64 | ||
64 | dlg_Motortest::~dlg_Motortest() |
65 | dlg_Motortest::~dlg_Motortest() |
65 | { |
66 | { |
66 | } |
67 | } |
67 | 68 | ||
68 | 69 | ||
69 | 70 |