Rev 391 | Go to most recent revision | 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" |
||
394 | Brean | 21 | #include "../com/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 |
||
391 | Brean | 33 | //FIXME: implement sleep for win_32 |
34 | //(or kick this function completely) |
||
227 | KeyOz | 35 | // sleep(Time); |
36 | #endif |
||
37 | } |
||
38 | |||
314 | KeyOz | 39 | QString ToolBox::get_Float(long Wert, int Count) |
227 | KeyOz | 40 | { |
314 | KeyOz | 41 | QString Temp, s_Wert; |
227 | KeyOz | 42 | |
314 | KeyOz | 43 | s_Wert = QString("%1").arg(Wert); |
44 | |||
45 | Temp = s_Wert.left(s_Wert.length() - Count) + QString(".") + s_Wert.right(Count); |
||
46 | |||
227 | KeyOz | 47 | return Temp; |
48 | } |
||
49 | |||
50 | // Datensatz nach QString |
||
391 | Brean | 51 | QString ToolBox::dataToQString(int Data[150], int Start, int End) |
227 | KeyOz | 52 | { |
394 | Brean | 53 | return QString(Parser::dataToString(Data, Start, End).c_str()); |
227 | KeyOz | 54 | } |
55 | |||
56 | // Alle Icons |
||
57 | QIcon ToolBox::Icon(int ID) |
||
58 | { |
||
59 | QIcon Icons[5] ; |
||
60 | 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[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 | return Icons[ID]; |
||
65 | } |