Rev 440 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 440 | Rev 449 | ||
---|---|---|---|
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 | 19 | ||
20 | #include "ToolBox.h" |
20 | #include "ToolBox.h" |
21 | #include "../libMK/Parser.h" |
21 | #include "../libMK/Parser.h" |
22 | 22 | ||
23 | /** |
23 | /** |
24 | * specific data for QT |
24 | * specific data for QT |
25 | */ |
25 | */ |
26 | 26 | ||
27 | //FIXME: search for something else than sleep |
27 | //FIXME: search for something else than sleep |
28 | void ToolBox::wait(int Time) |
28 | void ToolBox::wait(int Time) |
29 | { |
29 | { |
30 | #ifndef _WIN32_ |
30 | #ifndef _WIN32_ |
31 | usleep(Time); |
31 | usleep(Time); |
32 | #else |
32 | #else |
33 | //TODO: implement sleep for win_32 |
33 | //TODO: implement sleep for win_32 |
34 | //(or kick this function completely) |
34 | //(or kick this function completely) |
35 | // sleep(Time); |
35 | // sleep(Time); |
36 | #endif |
36 | #endif |
37 | } |
37 | } |
38 | 38 | ||
39 | /* |
39 | /* |
40 | QString ToolBox::get_Float(long Wert, int Count) |
40 | QString ToolBox::get_Float(long Wert, int Count) |
41 | { |
41 | { |
42 | QString Temp, s_Wert; |
42 | QString Temp, s_Wert; |
43 | 43 | ||
44 | s_Wert = QString("%1").arg(Wert); |
44 | s_Wert = QString("%1").arg(Wert); |
45 | 45 | ||
46 | Temp = s_Wert.left(s_Wert.length() - Count) + QString(".") + s_Wert.right(Count); |
46 | Temp = s_Wert.left(s_Wert.length() - Count) + QString(".") + s_Wert.right(Count); |
47 | 47 | ||
48 | return Temp; |
48 | return Temp; |
49 | }*/ |
49 | }*/ |
50 | 50 | ||
51 | // Datensatz nach QString |
51 | // Datensatz nach QString |
52 | QString ToolBox::dataToQString(int Data[150], int Start, int End) |
52 | QString ToolBox::dataToQString(char data[MAX_DATA_SIZE], int start, int end) |
53 | { |
53 | { |
- | 54 | return QString(data); |
|
54 | return QString(Parser::dataToString(Data, Start, End).c_str()); |
55 | //return QString(Parser::dataToString(data, start, end)); |
55 | } |
56 | } |
56 | 57 | ||
57 | // Alle Icons |
58 | // Alle Icons |
58 | QIcon ToolBox::Icon(int ID) |
59 | QIcon ToolBox::Icon(int ID) |
59 | { |
60 | { |
60 | QIcon Icons[5] ; |
61 | QIcon Icons[5] ; |
61 | Icons[0].addPixmap(QPixmap(QString::fromUtf8(":/LED/Images/16X16/ledred.png")), QIcon::Normal, QIcon::Off); |
62 | Icons[0].addPixmap(QPixmap(QString::fromUtf8(":/LED/Images/16X16/ledred.png")), QIcon::Normal, QIcon::Off); |
62 | Icons[1].addPixmap(QPixmap(QString::fromUtf8(":/LED/Images/16X16/ledyellow.png")), QIcon::Normal, QIcon::Off); |
63 | Icons[1].addPixmap(QPixmap(QString::fromUtf8(":/LED/Images/16X16/ledyellow.png")), QIcon::Normal, QIcon::Off); |
63 | Icons[3].addPixmap(QPixmap(QString::fromUtf8(":/LED/Images/16X16/ledyellow.png")), QIcon::Normal, QIcon::Off); |
64 | Icons[3].addPixmap(QPixmap(QString::fromUtf8(":/LED/Images/16X16/ledyellow.png")), QIcon::Normal, QIcon::Off); |
64 | Icons[4].addPixmap(QPixmap(QString::fromUtf8(":/LED/Images/16X16/ledoff.png")), QIcon::Normal, QIcon::Off); |
65 | Icons[4].addPixmap(QPixmap(QString::fromUtf8(":/LED/Images/16X16/ledoff.png")), QIcon::Normal, QIcon::Off); |
65 | return Icons[ID]; |
66 | return Icons[ID]; |
66 | } |
67 | } |
67 | 68 |