author | mickeyl <mickeyl> | 2004-09-15 12:39:17 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-09-15 12:39:17 (UTC) |
commit | 3440a45f736fbdddf787c81664e3dbb74f3e4b8b (patch) (unidiff) | |
tree | 6786fa4990a2b9c76cb3a22a68c25dc542db2de6 | |
parent | bb7cd69b07a5d6e00a29b23dc8bfebc511d34891 (diff) | |
download | opie-3440a45f736fbdddf787c81664e3dbb74f3e4b8b.zip opie-3440a45f736fbdddf787c81664e3dbb74f3e4b8b.tar.gz opie-3440a45f736fbdddf787c81664e3dbb74f3e4b8b.tar.bz2 |
minor adjustments to button layout. release 1.1.1
-rw-r--r-- | noncore/settings/sysinfo/benchmarkinfo.cpp | 19 | ||||
-rw-r--r-- | noncore/settings/sysinfo/sysinfo.pro | 2 | ||||
-rw-r--r-- | share/sysinfo/results | 4 |
3 files changed, 12 insertions, 13 deletions
diff --git a/noncore/settings/sysinfo/benchmarkinfo.cpp b/noncore/settings/sysinfo/benchmarkinfo.cpp index be7e4b6..fde032a 100644 --- a/noncore/settings/sysinfo/benchmarkinfo.cpp +++ b/noncore/settings/sysinfo/benchmarkinfo.cpp | |||
@@ -1,411 +1,408 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** BenchmarkInfo | 2 | ** BenchmarkInfo |
3 | ** | 3 | ** |
4 | ** A benchmark for Qt/Embedded | 4 | ** A benchmark widget for Qt/Embedded |
5 | ** | 5 | ** |
6 | ** Copyright (C) 2004 Michael Lauer <mickey@vanille.de> | 6 | ** Copyright (C) 2004 Michael Lauer <mickey@vanille.de> |
7 | ** Inspired by ZBench (C) 2002 Satoshi <af230533@im07.alpha-net.ne.jp> | 7 | ** Inspired by ZBench (C) 2002 Satoshi <af230533@im07.alpha-net.ne.jp> |
8 | ** | 8 | ** |
9 | ** This file may be distributed and/or modified under the terms of the | 9 | ** This file may be distributed and/or modified under the terms of the |
10 | ** GNU General Public License version 2 as published by the Free Software | 10 | ** GNU General Public License version 2 as published by the Free Software |
11 | ** Foundation and appearing in the file LICENSE.GPL included in the | 11 | ** Foundation and appearing in the file LICENSE.GPL included in the |
12 | ** packaging of this file. | 12 | ** packaging of this file. |
13 | ** | 13 | ** |
14 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 14 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
15 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 15 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
16 | ** | 16 | ** |
17 | **********************************************************************/ | 17 | **********************************************************************/ |
18 | 18 | ||
19 | #include "benchmarkinfo.h" | 19 | #include "benchmarkinfo.h" |
20 | 20 | ||
21 | /* OPIE */ | 21 | /* OPIE */ |
22 | #include <opie2/odebug.h> | 22 | #include <opie2/odebug.h> |
23 | #include <opie2/ostorageinfo.h> | 23 | #include <opie2/ostorageinfo.h> |
24 | #include <opie2/olistview.h> | 24 | #include <opie2/olistview.h> |
25 | #include <qpe/qpeapplication.h> | 25 | #include <qpe/qpeapplication.h> |
26 | #include <qpe/qcopenvelope_qws.h> | 26 | #include <qpe/qcopenvelope_qws.h> |
27 | #include <qpe/qpedecoration_qws.h> | 27 | #include <qpe/qpedecoration_qws.h> |
28 | #include <qpe/resource.h> | 28 | #include <qpe/resource.h> |
29 | #include <qpe/config.h> | 29 | #include <qpe/config.h> |
30 | using namespace Opie::Core; | 30 | using namespace Opie::Core; |
31 | using namespace Opie::Ui; | 31 | using namespace Opie::Ui; |
32 | 32 | ||
33 | /* QT */ | 33 | /* QT */ |
34 | #include <qclipboard.h> | 34 | #include <qclipboard.h> |
35 | #include <qcolor.h> | 35 | #include <qcolor.h> |
36 | #include <qcombobox.h> | 36 | #include <qcombobox.h> |
37 | #include <qdirectpainter_qws.h> | 37 | #include <qdirectpainter_qws.h> |
38 | #include <qfile.h> | 38 | #include <qfile.h> |
39 | #include <qtextstream.h> | 39 | #include <qtextstream.h> |
40 | #include <qfiledialog.h> | 40 | #include <qfiledialog.h> |
41 | #include <qlabel.h> | 41 | #include <qlabel.h> |
42 | #include <qlayout.h> | 42 | #include <qlayout.h> |
43 | #include <qpainter.h> | 43 | #include <qpainter.h> |
44 | #include <qpushbutton.h> | 44 | #include <qpushbutton.h> |
45 | #include <qtimer.h> | 45 | #include <qtimer.h> |
46 | #include <qwhatsthis.h> | 46 | #include <qwhatsthis.h> |
47 | 47 | ||
48 | /* STD */ | 48 | /* STD */ |
49 | #include <time.h> | 49 | #include <time.h> |
50 | #include <stdio.h> | 50 | #include <stdio.h> |
51 | #include <stdlib.h> | 51 | #include <stdlib.h> |
52 | #include <math.h> | 52 | #include <math.h> |
53 | #if defined (__GNUC__) && (__GNUC__ < 3) | 53 | #if defined (__GNUC__) && (__GNUC__ < 3) |
54 | #define round qRound | 54 | #define round qRound |
55 | #endif | 55 | #endif |
56 | 56 | ||
57 | extern "C" | 57 | extern "C" |
58 | { | 58 | { |
59 | void BenchFFT( void ); | 59 | void BenchFFT( void ); |
60 | double dhry_main( int ); | 60 | double dhry_main( int ); |
61 | } | 61 | } |
62 | 62 | ||
63 | #define DHRYSTONE_RUNS 20000000 | 63 | #define DHRYSTONE_RUNS 20000000 |
64 | #define TEST_DURATION 3 | 64 | #define TEST_DURATION 3 |
65 | 65 | ||
66 | #define BUFF_SIZE 8192 | ||
67 | #define FILE_SIZE 1024 * 1024 // 1Mb | ||
68 | |||
69 | //=========================================================================== | 66 | //=========================================================================== |
70 | 67 | ||
71 | class BenchmarkPaintWidget : public QWidget | 68 | class BenchmarkPaintWidget : public QWidget |
72 | { | 69 | { |
73 | public: | 70 | public: |
74 | BenchmarkPaintWidget() : QWidget( 0, "Benchmark Paint Widget", WStyle_Customize|WStyle_StaysOnTop|WPaintUnclipped|WPaintClever ) | 71 | BenchmarkPaintWidget() : QWidget( 0, "Benchmark Paint Widget", WStyle_Customize|WStyle_StaysOnTop|WPaintUnclipped|WPaintClever ) |
75 | { | 72 | { |
76 | resize( QApplication::desktop()->size() ); | 73 | resize( QApplication::desktop()->size() ); |
77 | show(); | 74 | show(); |
78 | p.begin( this ); | 75 | p.begin( this ); |
79 | }; | 76 | }; |
80 | 77 | ||
81 | ~BenchmarkPaintWidget() | 78 | ~BenchmarkPaintWidget() |
82 | { | 79 | { |
83 | p.end(); | 80 | p.end(); |
84 | hide(); | 81 | hide(); |
85 | }; | 82 | }; |
86 | 83 | ||
87 | QPainter p; | 84 | QPainter p; |
88 | }; | 85 | }; |
89 | 86 | ||
90 | //=========================================================================== | 87 | //=========================================================================== |
91 | 88 | ||
92 | BenchmarkInfo::BenchmarkInfo( QWidget *parent, const char *name, int wFlags ) | 89 | BenchmarkInfo::BenchmarkInfo( QWidget *parent, const char *name, int wFlags ) |
93 | : QWidget( parent, name, wFlags ) | 90 | : QWidget( parent, name, wFlags ) |
94 | { | 91 | { |
95 | 92 | ||
96 | setMinimumSize( 200, 150 ); | 93 | setMinimumSize( 200, 150 ); |
97 | 94 | ||
98 | QVBoxLayout* vb = new QVBoxLayout( this ); | 95 | QVBoxLayout* vb = new QVBoxLayout( this ); |
99 | vb->setSpacing( 4 ); | 96 | vb->setSpacing( 4 ); |
100 | vb->setMargin( 4 ); | 97 | vb->setMargin( 4 ); |
101 | 98 | ||
102 | tests = new OListView( this ); | 99 | tests = new OListView( this ); |
103 | QWhatsThis::add( tests->viewport(), tr( "This area shows the available tests, the results for which the tests " | 100 | QWhatsThis::add( tests->viewport(), tr( "This area shows the available tests, the results for which the tests " |
104 | "have been performed, and comparison values for one selected device. " | 101 | "have been performed, and comparison values for one selected device. " |
105 | "Use the checkboxes to define which tests you want to perform." ) ); | 102 | "Use the checkboxes to define which tests you want to perform." ) ); |
106 | tests->setMargin( 0 ); | 103 | tests->setMargin( 0 ); |
107 | tests->addColumn( tr( "Tests" ) ); | 104 | tests->addColumn( tr( "Tests" ) ); |
108 | tests->addColumn( tr( "Results" ) ); | 105 | tests->addColumn( tr( "Results" ) ); |
109 | tests->addColumn( tr( "Comparison" ) ); | 106 | tests->addColumn( tr( "Comparison" ) ); |
110 | tests->setShowSortIndicator( true ); | 107 | tests->setShowSortIndicator( true ); |
111 | 108 | ||
112 | test_alu = new OCheckListItem( tests, tr( "1. Integer Arithmetic " ), OCheckListItem::CheckBox ); | 109 | test_alu = new OCheckListItem( tests, tr( "1. Integer Arithmetic " ), OCheckListItem::CheckBox ); |
113 | test_fpu = new OCheckListItem( tests, tr( "2. Floating Point Unit " ), OCheckListItem::CheckBox ); | 110 | test_fpu = new OCheckListItem( tests, tr( "2. Floating Point Unit " ), OCheckListItem::CheckBox ); |
114 | test_txt = new OCheckListItem( tests, tr( "3. Text Rendering " ), OCheckListItem::CheckBox ); | 111 | test_txt = new OCheckListItem( tests, tr( "3. Text Rendering " ), OCheckListItem::CheckBox ); |
115 | test_gfx = new OCheckListItem( tests, tr( "4. Gfx Rendering " ), OCheckListItem::CheckBox ); | 112 | test_gfx = new OCheckListItem( tests, tr( "4. Gfx Rendering " ), OCheckListItem::CheckBox ); |
116 | test_ram = new OCheckListItem( tests, tr( "5. RAM Performance " ), OCheckListItem::CheckBox ); | 113 | test_ram = new OCheckListItem( tests, tr( "5. RAM Performance " ), OCheckListItem::CheckBox ); |
117 | #ifndef QT_QWS_RAMSES | 114 | #ifndef QT_QWS_RAMSES |
118 | test_sd = new OCheckListItem( tests, tr( "6. SD Card Performance " ), OCheckListItem::CheckBox ); | 115 | test_sd = new OCheckListItem( tests, tr( "6. SD Card Performance " ), OCheckListItem::CheckBox ); |
119 | test_cf = new OCheckListItem( tests, tr( "7. CF Card Performance " ), OCheckListItem::CheckBox ); | 116 | test_cf = new OCheckListItem( tests, tr( "7. CF Card Performance " ), OCheckListItem::CheckBox ); |
120 | #endif | 117 | #endif |
121 | test_alu->setText( 1, "n/a" ); | 118 | test_alu->setText( 1, "n/a" ); |
122 | test_fpu->setText( 1, "n/a" ); | 119 | test_fpu->setText( 1, "n/a" ); |
123 | test_txt->setText( 1, "n/a" ); | 120 | test_txt->setText( 1, "n/a" ); |
124 | test_gfx->setText( 1, "n/a" ); | 121 | test_gfx->setText( 1, "n/a" ); |
125 | test_ram->setText( 1, "n/a" ); | 122 | test_ram->setText( 1, "n/a" ); |
126 | #ifndef QT_QWS_RAMSES | 123 | #ifndef QT_QWS_RAMSES |
127 | test_sd->setText( 1, "n/a" ); | 124 | test_sd->setText( 1, "n/a" ); |
128 | test_cf->setText( 1, "n/a" ); | 125 | test_cf->setText( 1, "n/a" ); |
129 | #endif | 126 | #endif |
130 | test_alu->setText( 2, "n/a" ); | 127 | test_alu->setText( 2, "n/a" ); |
131 | test_fpu->setText( 2, "n/a" ); | 128 | test_fpu->setText( 2, "n/a" ); |
132 | test_txt->setText( 2, "n/a" ); | 129 | test_txt->setText( 2, "n/a" ); |
133 | test_gfx->setText( 2, "n/a" ); | 130 | test_gfx->setText( 2, "n/a" ); |
134 | test_ram->setText( 2, "n/a" ); | 131 | test_ram->setText( 2, "n/a" ); |
135 | #ifndef QT_QWS_RAMSES | 132 | #ifndef QT_QWS_RAMSES |
136 | test_sd->setText( 2, "n/a" ); | 133 | test_sd->setText( 2, "n/a" ); |
137 | test_cf->setText( 2, "n/a" ); | 134 | test_cf->setText( 2, "n/a" ); |
138 | #endif | 135 | #endif |
139 | 136 | ||
140 | startButton = new QPushButton( tr( "&Start Tests!" ), this ); | 137 | startButton = new QPushButton( tr( "&Start Tests!" ), this ); |
141 | QWhatsThis::add( startButton, tr( "Click here to perform the selected tests." ) ); | 138 | QWhatsThis::add( startButton, tr( "Click here to perform the selected tests." ) ); |
142 | connect( startButton, SIGNAL( clicked() ), this, SLOT( run() ) ); | 139 | connect( startButton, SIGNAL( clicked() ), this, SLOT( run() ) ); |
143 | vb->addWidget( tests, 2 ); | 140 | vb->addWidget( tests, 2 ); |
144 | 141 | ||
142 | QHBoxLayout* hb = new QHBoxLayout( vb ); | ||
143 | hb->addWidget( startButton, 2 ); | ||
144 | |||
145 | QFile f( QPEApplication::qpeDir() + "/share/sysinfo/results" ); | 145 | QFile f( QPEApplication::qpeDir() + "/share/sysinfo/results" ); |
146 | if ( f.open( IO_ReadOnly ) ) | 146 | if ( f.open( IO_ReadOnly ) ) |
147 | { | 147 | { |
148 | machineCombo = new QComboBox( this ); | 148 | machineCombo = new QComboBox( this ); |
149 | QWhatsThis::add( machineCombo, tr( "Choose a model to compare your results with." ) ); | 149 | QWhatsThis::add( machineCombo, tr( "Choose a model to compare your results with." ) ); |
150 | 150 | ||
151 | QTextStream ts( &f ); | 151 | QTextStream ts( &f ); |
152 | while( !ts.eof() ) | 152 | while( !ts.eof() ) |
153 | { | 153 | { |
154 | QString machline = ts.readLine(); | 154 | QString machline = ts.readLine(); |
155 | odebug << "sysinfo: parsing benchmark results for '" << machline << "'" << oendl; | 155 | odebug << "sysinfo: parsing benchmark results for '" << machline << "'" << oendl; |
156 | QString resline = ts.readLine(); | 156 | QString resline = ts.readLine(); |
157 | machines.insert( machline, new QStringList( QStringList::split( ",", resline ) ) ); | 157 | machines.insert( machline, new QStringList( QStringList::split( ",", resline ) ) ); |
158 | machineCombo->insertItem( machline ); | 158 | machineCombo->insertItem( machline ); |
159 | } | 159 | } |
160 | 160 | ||
161 | QHBoxLayout* hb = new QHBoxLayout( vb ); | 161 | hb->addWidget( new QLabel( tr( "Compare:" ), this ) ); |
162 | hb->addWidget( new QLabel( tr( "Compare To:" ), this ) ); | ||
163 | hb->addWidget( machineCombo, 2 ); | 162 | hb->addWidget( machineCombo, 2 ); |
164 | connect( machineCombo, SIGNAL( activated(int) ), this, SLOT( machineActivated(int) ) ); | 163 | connect( machineCombo, SIGNAL( activated(int) ), this, SLOT( machineActivated(int) ) ); |
165 | } | 164 | } |
166 | |||
167 | vb->addWidget( startButton, 2 ); | ||
168 | } | 165 | } |
169 | 166 | ||
170 | 167 | ||
171 | BenchmarkInfo::~BenchmarkInfo() | 168 | BenchmarkInfo::~BenchmarkInfo() |
172 | {} | 169 | {} |
173 | 170 | ||
174 | 171 | ||
175 | void BenchmarkInfo::machineActivated( int index ) | 172 | void BenchmarkInfo::machineActivated( int index ) |
176 | { | 173 | { |
177 | QStringList* results = machines[ machineCombo->text( index ) ]; | 174 | QStringList* results = machines[ machineCombo->text( index ) ]; |
178 | if ( !results ) | 175 | if ( !results ) |
179 | { | 176 | { |
180 | odebug << "sysinfo: no results available." << oendl; | 177 | odebug << "sysinfo: no results available." << oendl; |
181 | return; | 178 | return; |
182 | } | 179 | } |
183 | QStringList::Iterator it = results->begin(); | 180 | QStringList::Iterator it = results->begin(); |
184 | test_alu->setText( 2, *(it++) ); | 181 | test_alu->setText( 2, *(it++) ); |
185 | test_fpu->setText( 2, *(it++) ); | 182 | test_fpu->setText( 2, *(it++) ); |
186 | test_txt->setText( 2, *(it++) ); | 183 | test_txt->setText( 2, *(it++) ); |
187 | test_gfx->setText( 2, *(it++) ); | 184 | test_gfx->setText( 2, *(it++) ); |
188 | test_ram->setText( 2, *(it++) ); | 185 | test_ram->setText( 2, *(it++) ); |
189 | #ifndef QT_QWS_RAMSES | 186 | #ifndef QT_QWS_RAMSES |
190 | test_sd->setText( 2, *(it++) ); | 187 | test_sd->setText( 2, *(it++) ); |
191 | test_cf->setText( 2, *(it++) ); | 188 | test_cf->setText( 2, *(it++) ); |
192 | #endif | 189 | #endif |
193 | } | 190 | } |
194 | 191 | ||
195 | 192 | ||
196 | void BenchmarkInfo::run() | 193 | void BenchmarkInfo::run() |
197 | { | 194 | { |
198 | startButton->setText( "> Don't touch! Running Tests! Don't touch! <" ); | 195 | startButton->setText( "> Don't touch! <" ); |
199 | qApp->processEvents(); | 196 | qApp->processEvents(); |
200 | QTime t; | 197 | QTime t; |
201 | 198 | ||
202 | if ( test_alu->isOn() ) | 199 | if ( test_alu->isOn() ) |
203 | { | 200 | { |
204 | int d = round( dhry_main( DHRYSTONE_RUNS ) ); | 201 | int d = round( dhry_main( DHRYSTONE_RUNS ) ); |
205 | test_alu->setText( 1, QString().sprintf( "%d dhrys", d ) ); | 202 | test_alu->setText( 1, QString().sprintf( "%d dhrys", d ) ); |
206 | test_alu->setOn( false ); | 203 | test_alu->setOn( false ); |
207 | } | 204 | } |
208 | 205 | ||
209 | if ( test_fpu->isOn() ) | 206 | if ( test_fpu->isOn() ) |
210 | { | 207 | { |
211 | t.start(); | 208 | t.start(); |
212 | BenchFFT(); | 209 | BenchFFT(); |
213 | test_fpu->setText( 1, QString().sprintf( "%.2f secs", t.elapsed() / 1000.0 ) );; | 210 | test_fpu->setText( 1, QString().sprintf( "%.2f secs", t.elapsed() / 1000.0 ) );; |
214 | test_fpu->setOn( false ); | 211 | test_fpu->setOn( false ); |
215 | } | 212 | } |
216 | 213 | ||
217 | if ( test_txt->isOn() ) | 214 | if ( test_txt->isOn() ) |
218 | { | 215 | { |
219 | int value = textRendering( TEST_DURATION ); | 216 | int value = textRendering( TEST_DURATION ); |
220 | test_txt->setText( 1, QString().sprintf( "%d chars/sec", value / TEST_DURATION ) ); | 217 | test_txt->setText( 1, QString().sprintf( "%d chars/sec", value / TEST_DURATION ) ); |
221 | test_txt->setOn( false ); | 218 | test_txt->setOn( false ); |
222 | } | 219 | } |
223 | 220 | ||
224 | if ( test_gfx->isOn() ) | 221 | if ( test_gfx->isOn() ) |
225 | { | 222 | { |
226 | int value = gfxRendering( TEST_DURATION ); | 223 | int value = gfxRendering( TEST_DURATION ); |
227 | test_gfx->setText( 1, QString().sprintf( "%.2f gops/sec", value / 4.0 / TEST_DURATION ) ); // 4 tests | 224 | test_gfx->setText( 1, QString().sprintf( "%.2f gops/sec", value / 4.0 / TEST_DURATION ) ); // 4 tests |
228 | test_gfx->setOn( false ); | 225 | test_gfx->setOn( false ); |
229 | } | 226 | } |
230 | 227 | ||
231 | if ( test_ram->isOn() ) // /tmp is supposed to be in RAM on a PDA | 228 | if ( test_ram->isOn() ) // /tmp is supposed to be in RAM on a PDA |
232 | { | 229 | { |
233 | performFileTest( "/tmp/benchmarkFile.dat", test_ram ); | 230 | performFileTest( "/tmp/benchmarkFile.dat", test_ram ); |
234 | } | 231 | } |
235 | 232 | ||
236 | #ifndef QT_QWS_RAMSES | 233 | #ifndef QT_QWS_RAMSES |
237 | if ( test_cf->isOn() ) | 234 | if ( test_cf->isOn() ) |
238 | { | 235 | { |
239 | OStorageInfo storage; | 236 | OStorageInfo storage; |
240 | performFileTest( storage.cfPath() + "/benchmarkFile.dat", test_cf ); | 237 | performFileTest( storage.cfPath() + "/benchmarkFile.dat", test_cf ); |
241 | } | 238 | } |
242 | 239 | ||
243 | if ( test_sd->isOn() ) | 240 | if ( test_sd->isOn() ) |
244 | { | 241 | { |
245 | OStorageInfo storage; | 242 | OStorageInfo storage; |
246 | performFileTest( storage.sdPath() + "/benchmarkFile.dat", test_sd ); | 243 | performFileTest( storage.sdPath() + "/benchmarkFile.dat", test_sd ); |
247 | } | 244 | } |
248 | #endif | 245 | #endif |
249 | 246 | ||
250 | startButton->setText( tr( "&Start Tests!" ) ); | 247 | startButton->setText( tr( "&Start Tests!" ) ); |
251 | } | 248 | } |
252 | 249 | ||
253 | 250 | ||
254 | int BenchmarkInfo::textRendering( int seconds ) | 251 | int BenchmarkInfo::textRendering( int seconds ) |
255 | { | 252 | { |
256 | QTime t; | 253 | QTime t; |
257 | t.start(); | 254 | t.start(); |
258 | int stop = t.elapsed() + seconds * 1000; | 255 | int stop = t.elapsed() + seconds * 1000; |
259 | 256 | ||
260 | int rr[] = { 255, 255, 255, 0, 0, 0, 0, 128, 128 }; | 257 | int rr[] = { 255, 255, 255, 0, 0, 0, 0, 128, 128 }; |
261 | int gg[] = { 0, 255, 0, 0, 255, 255, 0, 128, 128 }; | 258 | int gg[] = { 0, 255, 0, 0, 255, 255, 0, 128, 128 }; |
262 | int bb[] = { 0, 0, 255, 0, 0, 255, 255, 128, 0 }; | 259 | int bb[] = { 0, 0, 255, 0, 0, 255, 255, 128, 0 }; |
263 | const QString text( "Opie Benchmark Test" ); | 260 | const QString text( "Opie Benchmark Test" ); |
264 | 261 | ||
265 | int w = QApplication::desktop()->width(); | 262 | int w = QApplication::desktop()->width(); |
266 | int h = QApplication::desktop()->height(); | 263 | int h = QApplication::desktop()->height(); |
267 | 264 | ||
268 | srand( time( NULL ) ); | 265 | srand( time( NULL ) ); |
269 | 266 | ||
270 | BenchmarkPaintWidget bpw; | 267 | BenchmarkPaintWidget bpw; |
271 | 268 | ||
272 | int loops = 0; | 269 | int loops = 0; |
273 | 270 | ||
274 | while ( t.elapsed() < stop ) | 271 | while ( t.elapsed() < stop ) |
275 | { | 272 | { |
276 | int k = rand() % 9; | 273 | int k = rand() % 9; |
277 | int s = rand() % 100; | 274 | int s = rand() % 100; |
278 | bpw.p.setPen( QColor( rr[ k ], gg[ k ], bb[ k ] ) ); | 275 | bpw.p.setPen( QColor( rr[ k ], gg[ k ], bb[ k ] ) ); |
279 | bpw.p.setFont( QFont( "Vera", s ) ); | 276 | bpw.p.setFont( QFont( "Vera", s ) ); |
280 | bpw.p.drawText( rand() % w, rand() % h, text, text.length() ); | 277 | bpw.p.drawText( rand() % w, rand() % h, text, text.length() ); |
281 | ++loops; | 278 | ++loops; |
282 | } | 279 | } |
283 | 280 | ||
284 | return loops * text.length(); | 281 | return loops * text.length(); |
285 | } | 282 | } |
286 | 283 | ||
287 | int BenchmarkInfo::gfxRendering( int seconds ) | 284 | int BenchmarkInfo::gfxRendering( int seconds ) |
288 | { | 285 | { |
289 | int rr[] = { 255, 255, 255, 0, 0, 0, 0, 128, 128 }; | 286 | int rr[] = { 255, 255, 255, 0, 0, 0, 0, 128, 128 }; |
290 | int gg[] = { 0, 255, 0, 0, 255, 255, 0, 128, 128 }; | 287 | int gg[] = { 0, 255, 0, 0, 255, 255, 0, 128, 128 }; |
291 | int bb[] = { 0, 0, 255, 0, 0, 255, 255, 128, 0 }; | 288 | int bb[] = { 0, 0, 255, 0, 0, 255, 255, 128, 0 }; |
292 | 289 | ||
293 | int w = QApplication::desktop()->width(); | 290 | int w = QApplication::desktop()->width(); |
294 | int h = QApplication::desktop()->height(); | 291 | int h = QApplication::desktop()->height(); |
295 | 292 | ||
296 | srand( time( NULL ) ); | 293 | srand( time( NULL ) ); |
297 | 294 | ||
298 | BenchmarkPaintWidget bpw; | 295 | BenchmarkPaintWidget bpw; |
299 | 296 | ||
300 | QTime t; | 297 | QTime t; |
301 | t.start(); | 298 | t.start(); |
302 | int stop = t.elapsed() + seconds*1000; | 299 | int stop = t.elapsed() + seconds*1000; |
303 | int loops = 0; | 300 | int loops = 0; |
304 | 301 | ||
305 | while ( t.elapsed() < stop ) | 302 | while ( t.elapsed() < stop ) |
306 | { | 303 | { |
307 | int k = rand() % 9; | 304 | int k = rand() % 9; |
308 | bpw.p.setPen( QColor( rr[ k ], gg[ k ], bb[ k ] ) ); | 305 | bpw.p.setPen( QColor( rr[ k ], gg[ k ], bb[ k ] ) ); |
309 | bpw.p.drawLine( rand()%w, rand()%h, rand()%w, rand()%h ); | 306 | bpw.p.drawLine( rand()%w, rand()%h, rand()%w, rand()%h ); |
310 | ++loops; | 307 | ++loops; |
311 | } | 308 | } |
312 | 309 | ||
313 | t.restart(); | 310 | t.restart(); |
314 | stop = t.elapsed() + seconds*1000; | 311 | stop = t.elapsed() + seconds*1000; |
315 | 312 | ||
316 | while ( t.elapsed() < stop ) | 313 | while ( t.elapsed() < stop ) |
317 | { | 314 | { |
318 | int k = rand() % 9; | 315 | int k = rand() % 9; |
319 | bpw.p.setPen( QColor( rr[ k ], gg[ k ], bb[ k ] ) ); | 316 | bpw.p.setPen( QColor( rr[ k ], gg[ k ], bb[ k ] ) ); |
320 | bpw.p.drawArc( rand()%w, rand()%h, rand()%w, rand()%h, 360 * 16, 360 * 16 ); | 317 | bpw.p.drawArc( rand()%w, rand()%h, rand()%w, rand()%h, 360 * 16, 360 * 16 ); |
321 | ++loops; | 318 | ++loops; |
322 | } | 319 | } |
323 | 320 | ||
324 | QBrush br1; | 321 | QBrush br1; |
325 | br1.setStyle( SolidPattern ); | 322 | br1.setStyle( SolidPattern ); |
326 | t.restart(); | 323 | t.restart(); |
327 | stop = t.elapsed() + seconds*1000; | 324 | stop = t.elapsed() + seconds*1000; |
328 | 325 | ||
329 | while ( t.elapsed() < stop ) | 326 | while ( t.elapsed() < stop ) |
330 | { | 327 | { |
331 | int k = rand() % 9; | 328 | int k = rand() % 9; |
332 | br1.setColor( QColor( rr[ k ], gg[ k ], bb[ k ] ) ); | 329 | br1.setColor( QColor( rr[ k ], gg[ k ], bb[ k ] ) ); |
333 | bpw.p.fillRect( rand()%w, rand()%h, rand()%w, rand()%h, br1 ); | 330 | bpw.p.fillRect( rand()%w, rand()%h, rand()%w, rand()%h, br1 ); |
334 | ++loops; | 331 | ++loops; |
335 | } | 332 | } |
336 | 333 | ||
337 | QPixmap p = Resource::loadPixmap( "sysinfo/pattern" ); | 334 | QPixmap p = Resource::loadPixmap( "sysinfo/pattern" ); |
338 | t.restart(); | 335 | t.restart(); |
339 | stop = t.elapsed() + seconds*1000; | 336 | stop = t.elapsed() + seconds*1000; |
340 | 337 | ||
341 | while ( t.elapsed() < stop ) | 338 | while ( t.elapsed() < stop ) |
342 | { | 339 | { |
343 | bpw.p.drawPixmap( rand()%w, rand()%h, p ); | 340 | bpw.p.drawPixmap( rand()%w, rand()%h, p ); |
344 | ++loops; | 341 | ++loops; |
345 | } | 342 | } |
346 | 343 | ||
347 | return loops; | 344 | return loops; |
348 | 345 | ||
349 | } | 346 | } |
350 | 347 | ||
351 | const unsigned int FILE_TEST_COUNT = 8000; | 348 | const unsigned int FILE_TEST_COUNT = 8000; |
352 | const unsigned int FILE_TEST_BLOCKSIZE = 1024; | 349 | const unsigned int FILE_TEST_BLOCKSIZE = 1024; |
353 | 350 | ||
354 | void BenchmarkInfo::performFileTest( const QString& fname, OCheckListItem* item ) | 351 | void BenchmarkInfo::performFileTest( const QString& fname, OCheckListItem* item ) |
355 | { | 352 | { |
356 | QString filename = fname == "/benchmarkFile.dat" ? QString( "/tmp/bla" ) : fname; | 353 | QString filename = fname == "/benchmarkFile.dat" ? QString( "/tmp/bla" ) : fname; |
357 | odebug << "performing file test on " << filename << oendl; | 354 | odebug << "performing file test on " << filename << oendl; |
358 | 355 | ||
359 | QString writeCommand = QString( "dd if=/dev/zero of=%1 count=%2 bs=%3 && sync" ).arg( filename ) | 356 | QString writeCommand = QString( "dd if=/dev/zero of=%1 count=%2 bs=%3 && sync" ).arg( filename ) |
360 | .arg( FILE_TEST_COUNT ) | 357 | .arg( FILE_TEST_COUNT ) |
361 | .arg( FILE_TEST_BLOCKSIZE ); | 358 | .arg( FILE_TEST_BLOCKSIZE ); |
362 | QString readCommand = QString( "dd if=%1 of=/dev/null count=%2 bs=%3").arg( filename ) | 359 | QString readCommand = QString( "dd if=%1 of=/dev/null count=%2 bs=%3").arg( filename ) |
363 | .arg( FILE_TEST_COUNT ) | 360 | .arg( FILE_TEST_COUNT ) |
364 | .arg( FILE_TEST_BLOCKSIZE ); | 361 | .arg( FILE_TEST_BLOCKSIZE ); |
365 | ::system( "sync" ); | 362 | ::system( "sync" ); |
366 | odebug << "performing file test on " << filename << oendl; | 363 | odebug << "performing file test on " << filename << oendl; |
367 | 364 | ||
368 | int write = 0; | 365 | int write = 0; |
369 | int read = 0; | 366 | int read = 0; |
370 | 367 | ||
371 | QTime time; | 368 | QTime time; |
372 | time.start(); | 369 | time.start(); |
373 | if ( ::system( writeCommand ) == 0 ) | 370 | if ( ::system( writeCommand ) == 0 ) |
374 | { | 371 | { |
375 | write = time.elapsed(); | 372 | write = time.elapsed(); |
376 | } | 373 | } |
377 | else | 374 | else |
378 | { | 375 | { |
379 | item->setText( 1, tr( "error" ) ); | 376 | item->setText( 1, tr( "error" ) ); |
380 | return; | 377 | return; |
381 | } | 378 | } |
382 | 379 | ||
383 | time.restart(); | 380 | time.restart(); |
384 | if ( ::system( readCommand ) == 0 ) | 381 | if ( ::system( readCommand ) == 0 ) |
385 | { | 382 | { |
386 | read = time.elapsed(); | 383 | read = time.elapsed(); |
387 | } | 384 | } |
388 | else | 385 | else |
389 | { | 386 | { |
390 | item->setText( 1, tr( "error" ) ); | 387 | item->setText( 1, tr( "error" ) ); |
391 | return; | 388 | return; |
392 | } | 389 | } |
393 | 390 | ||
394 | QFile::remove( filename ); | 391 | QFile::remove( filename ); |
395 | double readSpeed = FILE_TEST_COUNT / ( read / 1000.0 ); | 392 | double readSpeed = FILE_TEST_COUNT / ( read / 1000.0 ); |
396 | QString readUnit = "kB/s"; | 393 | QString readUnit = "kB/s"; |
397 | if ( readSpeed > 1024 ) | 394 | if ( readSpeed > 1024 ) |
398 | { | 395 | { |
399 | readSpeed = readSpeed / 1024.0; | 396 | readSpeed /= 1024.0; |
400 | readUnit = "MB/s"; | 397 | readUnit = "MB/s"; |
401 | } | 398 | } |
402 | double writeSpeed = FILE_TEST_COUNT / ( write / 1000.0 ); | 399 | double writeSpeed = FILE_TEST_COUNT / ( write / 1000.0 ); |
403 | QString writeUnit = "kb/s"; | 400 | QString writeUnit = "kb/s"; |
404 | if ( writeSpeed > 1024 ) | 401 | if ( writeSpeed > 1024 ) |
405 | { | 402 | { |
406 | writeSpeed = writeSpeed / 1024.0; | 403 | writeSpeed /= 1024.0; |
407 | writeUnit = "MB/s"; | 404 | writeUnit = "MB/s"; |
408 | } | 405 | } |
409 | item->setText( 1, QString().sprintf( "%.2f %s, %.2f %s", readSpeed, readUnit.latin1(), writeSpeed, writeUnit.latin1() ) ); | 406 | item->setText( 1, QString().sprintf( "%.2f %s, %.2f %s", readSpeed, readUnit.latin1(), writeSpeed, writeUnit.latin1() ) ); |
410 | item->setOn( false ); | 407 | item->setOn( false ); |
411 | } | 408 | } |
diff --git a/noncore/settings/sysinfo/sysinfo.pro b/noncore/settings/sysinfo/sysinfo.pro index 58f6eb0..dd35563 100644 --- a/noncore/settings/sysinfo/sysinfo.pro +++ b/noncore/settings/sysinfo/sysinfo.pro | |||
@@ -1,34 +1,34 @@ | |||
1 | CONFIG = qt warn_on quick-app | 1 | CONFIG = qt warn_on quick-app |
2 | HEADERS = \ | 2 | HEADERS = \ |
3 | memory.h \ | 3 | memory.h \ |
4 | graph.h \ | 4 | graph.h \ |
5 | load.h \ | 5 | load.h \ |
6 | storage.h \ | 6 | storage.h \ |
7 | processinfo.h \ | 7 | processinfo.h \ |
8 | modulesinfo.h \ | 8 | modulesinfo.h \ |
9 | detail.h \ | 9 | detail.h \ |
10 | contrib/dhry.h \ | 10 | contrib/dhry.h \ |
11 | benchmarkinfo.h \ | 11 | benchmarkinfo.h \ |
12 | versioninfo.h \ | 12 | versioninfo.h \ |
13 | sysinfo.h | 13 | sysinfo.h |
14 | SOURCES = main.cpp \ | 14 | SOURCES = main.cpp \ |
15 | memory.cpp \ | 15 | memory.cpp \ |
16 | graph.cpp \ | 16 | graph.cpp \ |
17 | load.cpp \ | 17 | load.cpp \ |
18 | storage.cpp \ | 18 | storage.cpp \ |
19 | processinfo.cpp \ | 19 | processinfo.cpp \ |
20 | modulesinfo.cpp \ | 20 | modulesinfo.cpp \ |
21 | detail.cpp \ | 21 | detail.cpp \ |
22 | contrib/dhry.c contrib/fft.c \ | 22 | contrib/dhry.c contrib/fft.c \ |
23 | benchmarkinfo.cpp \ | 23 | benchmarkinfo.cpp \ |
24 | versioninfo.cpp \ | 24 | versioninfo.cpp \ |
25 | sysinfo.cpp | 25 | sysinfo.cpp |
26 | 26 | ||
27 | INCLUDEPATH += $(OPIEDIR)/include | 27 | INCLUDEPATH += $(OPIEDIR)/include |
28 | DEPENDPATH += $(OPIEDIR)/include | 28 | DEPENDPATH += $(OPIEDIR)/include |
29 | LIBS += -lqpe -lopiecore2 -lopieui2 | 29 | LIBS += -lqpe -lopiecore2 -lopieui2 |
30 | DEFINES += UNIX | 30 | DEFINES += UNIX |
31 | TARGET = sysinfo | 31 | TARGET = sysinfo |
32 | VERSION = 1.1.0 | 32 | VERSION = 1.1.1 |
33 | 33 | ||
34 | include ( $(OPIEDIR)/include.pro ) | 34 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/share/sysinfo/results b/share/sysinfo/results index b34fc99..b53f1ea 100644 --- a/share/sysinfo/results +++ b/share/sysinfo/results | |||
@@ -1,30 +1,32 @@ | |||
1 | <Choose a model> | 1 | <Choose model> |
2 | n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a | 2 | n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a |
3 | Sharp SL-5500 | 3 | Sharp SL-5500 |
4 | 240010 dhrys,41.498 sec,88 char/sec,1786 gops/sec,50.123 kb/sec,41.7329 kb/sec,105.873 kb/sec | 4 | 240010 dhrys,41.498 sec,88 char/sec,1786 gops/sec,50.123 kb/sec,41.7329 kb/sec,105.873 kb/sec |
5 | Sharp SL-5600 | 5 | Sharp SL-5600 |
6 | not,yet,contributed,please,mail,to,opie@handhelds.org | 6 | not,yet,contributed,please,mail,to,opie@handhelds.org |
7 | Sharp C-700 | 7 | Sharp C-700 |
8 | not,yet,contributed,please,mail,to,opie@handhelds.org | 8 | not,yet,contributed,please,mail,to,opie@handhelds.org |
9 | Sharp C-750 | 9 | Sharp C-750 |
10 | 490677 dhrys,2.452 sec,437 char/sec,1396 gops/sec,132.061 kb/sec,129.752 kb/sec,n/a | 10 | 490677 dhrys,2.452 sec,437 char/sec,1396 gops/sec,132.061 kb/sec,129.752 kb/sec,n/a |
11 | Sharp C-760 | 11 | Sharp C-760 |
12 | not,yet,contributed,please,mail,to,opie@handhelds.org | 12 | not,yet,contributed,please,mail,to,opie@handhelds.org |
13 | Sharp C-860 | 13 | Sharp C-860 |
14 | not,yet,contributed,please,mail,to,opie@handhelds.org | 14 | not,yet,contributed,please,mail,to,opie@handhelds.org |
15 | HP iPAQ 36xx | 15 | HP iPAQ 36xx |
16 | not,yet,contributed,please,mail,to,opie@handhelds.org | 16 | not,yet,contributed,please,mail,to,opie@handhelds.org |
17 | HP iPAQ 37xx | 17 | HP iPAQ 37xx |
18 | not,yet,contributed,please,mail,to,opie@handhelds.org | 18 | not,yet,contributed,please,mail,to,opie@handhelds.org |
19 | HP iPAQ 38xx | 19 | HP iPAQ 38xx |
20 | 234880 dhrys,42.37 sec,418 char/sec,1788 gops/sec,51.6911 kb/sec,31.1029 kb/sec,untested | 20 | 234880 dhrys,42.37 sec,418 char/sec,1788 gops/sec,51.6911 kb/sec,31.1029 kb/sec,untested |
21 | HP iPAQ 54xx | 21 | HP iPAQ 54xx |
22 | not,yet,contributed,please,mail,to,opie@handhelds.org | 22 | not,yet,contributed,please,mail,to,opie@handhelds.org |
23 | HP iPAQ 55xx | 23 | HP iPAQ 55xx |
24 | not,yet,contributed,please,mail,to,opie@handhelds.org | 24 | not,yet,contributed,please,mail,to,opie@handhelds.org |
25 | HP Jornada 5x0 | 25 | HP Jornada 5x0 |
26 | not,yet,contributed,please,mail,to,opie@handhelds.org | 26 | not,yet,contributed,please,mail,to,opie@handhelds.org |
27 | M&N Ramses | 27 | M&N Ramses |
28 | not,yet,contributed,please,mail,to,opie@handhelds.org | 28 | not,yet,contributed,please,mail,to,opie@handhelds.org |
29 | SIEMENS SIMpad | 29 | SIEMENS SIMpad |
30 | not,yet,contributed,please,mail,to,opie@handhelds.org | 30 | not,yet,contributed,please,mail,to,opie@handhelds.org |
31 | MASTERIA Beagle | ||
32 | not,yet,contributed,please,mail,to,opie@handhelds.org | ||