Rev 394 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 394 | Rev 397 | ||
---|---|---|---|
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 "../com/Parser.h" |
21 | #include "../com/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 | //FIXME: implement sleep for win_32 |
33 | //FIXME: 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 | QString ToolBox::get_Float(long Wert, int Count) |
40 | QString ToolBox::get_Float(long Wert, int Count) |
40 | { |
41 | { |
41 | QString Temp, s_Wert; |
42 | QString Temp, s_Wert; |
42 | 43 | ||
43 | s_Wert = QString("%1").arg(Wert); |
44 | s_Wert = QString("%1").arg(Wert); |
44 | 45 | ||
45 | 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); |
46 | 47 | ||
47 | return Temp; |
48 | return Temp; |
48 | } |
49 | }*/ |
49 | 50 | ||
50 | // Datensatz nach QString |
51 | // Datensatz nach QString |
51 | QString ToolBox::dataToQString(int Data[150], int Start, int End) |
52 | QString ToolBox::dataToQString(int Data[150], int Start, int End) |
52 | { |
53 | { |
53 | return QString(Parser::dataToString(Data, Start, End).c_str()); |
54 | return QString(Parser::dataToString(Data, Start, End).c_str()); |
54 | } |
55 | } |
55 | 56 | ||
56 | // Alle Icons |
57 | // Alle Icons |
57 | QIcon ToolBox::Icon(int ID) |
58 | QIcon ToolBox::Icon(int ID) |
58 | { |
59 | { |
59 | QIcon Icons[5] ; |
60 | QIcon Icons[5] ; |
60 | Icons[0].addPixmap(QPixmap(QString::fromUtf8(":/LED/Images/16X16/ledred.png")), QIcon::Normal, QIcon::Off); |
61 | Icons[0].addPixmap(QPixmap(QString::fromUtf8(":/LED/Images/16X16/ledred.png")), QIcon::Normal, QIcon::Off); |
61 | Icons[1].addPixmap(QPixmap(QString::fromUtf8(":/LED/Images/16X16/ledyellow.png")), QIcon::Normal, QIcon::Off); |
62 | Icons[1].addPixmap(QPixmap(QString::fromUtf8(":/LED/Images/16X16/ledyellow.png")), QIcon::Normal, QIcon::Off); |
62 | Icons[3].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); |
63 | Icons[4].addPixmap(QPixmap(QString::fromUtf8(":/LED/Images/16X16/ledoff.png")), QIcon::Normal, QIcon::Off); |
64 | Icons[4].addPixmap(QPixmap(QString::fromUtf8(":/LED/Images/16X16/ledoff.png")), QIcon::Normal, QIcon::Off); |
64 | return Icons[ID]; |
65 | return Icons[ID]; |
65 | } |
66 | } |
66 | 67 |