Rev 449 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
227 | KeyOz | 1 | /*************************************************************************** |
2 | * Copyright (C) 2008 by Manuel Schrape * |
||
3 | * manuel.schrape@gmx.de * |
||
4 | * * |
||
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 * |
||
7 | * the Free Software Foundation; either version 2 of the License. * |
||
8 | * * |
||
9 | * This program is distributed in the hope that it will be useful, * |
||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||
12 | * GNU General Public License for more details. * |
||
13 | * * |
||
14 | * You should have received a copy of the GNU General Public License * |
||
15 | * along with this program; if not, write to the * |
||
16 | * Free Software Foundation, Inc., * |
||
17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||
18 | ***************************************************************************/ |
||
19 | |||
20 | #include "ToolBox.h" |
||
440 | Brean | 21 | #include "../libMK/Parser.h" |
227 | KeyOz | 22 | |
391 | Brean | 23 | /** |
24 | * specific data for QT |
||
25 | */ |
||
227 | KeyOz | 26 | |
391 | Brean | 27 | //FIXME: search for something else than sleep |
28 | void ToolBox::wait(int Time) |
||
227 | KeyOz | 29 | { |
30 | #ifndef _WIN32_ |
||
31 | usleep(Time); |
||
32 | #else |
||
440 | Brean | 33 | //TODO: implement sleep for win_32 |
391 | Brean | 34 | //(or kick this function completely) |
227 | KeyOz | 35 | // sleep(Time); |
36 | #endif |
||
37 | } |
||
38 | |||
397 | Brean | 39 | /* |
314 | KeyOz | 40 | QString ToolBox::get_Float(long Wert, int Count) |
227 | KeyOz | 41 | { |
314 | KeyOz | 42 | QString Temp, s_Wert; |
227 | KeyOz | 43 | |
314 | KeyOz | 44 | s_Wert = QString("%1").arg(Wert); |
45 | |||
46 | Temp = s_Wert.left(s_Wert.length() - Count) + QString(".") + s_Wert.right(Count); |
||
47 | |||
227 | KeyOz | 48 | return Temp; |
397 | Brean | 49 | }*/ |
227 | KeyOz | 50 | |
51 | // Datensatz nach QString |
||
450 | Brean | 52 | QString ToolBox::dataToQString(char * data, int start, int end) |
227 | KeyOz | 53 | { |
450 | Brean | 54 | return QString(Parser::dataToString(data, start, end).c_str()); |
227 | KeyOz | 55 | } |
56 | |||
57 | // Alle Icons |
||
58 | QIcon ToolBox::Icon(int ID) |
||
59 | { |
||
60 | QIcon Icons[5] ; |
||
61 | 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[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 | return Icons[ID]; |
||
66 | } |