Details | 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" |
||
21 | |||
391 | Brean | 22 | /** |
23 | * specific data for QT |
||
24 | */ |
||
227 | KeyOz | 25 | |
391 | Brean | 26 | //FIXME: search for something else than sleep |
27 | void ToolBox::wait(int Time) |
||
227 | KeyOz | 28 | { |
29 | #ifndef _WIN32_ |
||
30 | usleep(Time); |
||
31 | #else |
||
391 | Brean | 32 | //FIXME: implement sleep for win_32 |
33 | //(or kick this function completely) |
||
227 | KeyOz | 34 | // sleep(Time); |
35 | #endif |
||
36 | } |
||
37 | |||
314 | KeyOz | 38 | QString ToolBox::get_Float(long Wert, int Count) |
227 | KeyOz | 39 | { |
314 | KeyOz | 40 | QString Temp, s_Wert; |
227 | KeyOz | 41 | |
314 | KeyOz | 42 | s_Wert = QString("%1").arg(Wert); |
43 | |||
44 | Temp = s_Wert.left(s_Wert.length() - Count) + QString(".") + s_Wert.right(Count); |
||
45 | |||
227 | KeyOz | 46 | return Temp; |
47 | } |
||
48 | |||
49 | // Datensatz nach QString |
||
391 | Brean | 50 | QString ToolBox::dataToQString(int Data[150], int Start, int End) |
227 | KeyOz | 51 | { |
391 | Brean | 52 | return QString(Parser::dataToString(Data, Start, End)); |
227 | KeyOz | 53 | } |
54 | |||
55 | // Alle Icons |
||
56 | QIcon ToolBox::Icon(int ID) |
||
57 | { |
||
58 | QIcon Icons[5] ; |
||
59 | Icons[0].addPixmap(QPixmap(QString::fromUtf8(":/LED/Images/16X16/ledred.png")), QIcon::Normal, QIcon::Off); |
||
60 | Icons[1].addPixmap(QPixmap(QString::fromUtf8(":/LED/Images/16X16/ledyellow.png")), QIcon::Normal, QIcon::Off); |
||
61 | Icons[3].addPixmap(QPixmap(QString::fromUtf8(":/LED/Images/16X16/ledyellow.png")), QIcon::Normal, QIcon::Off); |
||
62 | Icons[4].addPixmap(QPixmap(QString::fromUtf8(":/LED/Images/16X16/ledoff.png")), QIcon::Normal, QIcon::Off); |
||
63 | return Icons[ID]; |
||
64 | } |