summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/sysinfo/benchmarkinfo.cpp19
-rw-r--r--noncore/settings/sysinfo/sysinfo.pro2
-rw-r--r--share/sysinfo/results4
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,16 +1,16 @@
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**
@@ -54,27 +54,24 @@ using namespace Opie::Ui;
54#define round qRound 54#define round qRound
55#endif 55#endif
56 56
57extern "C" 57extern "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
71class BenchmarkPaintWidget : public QWidget 68class 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
@@ -133,47 +130,47 @@ BenchmarkInfo::BenchmarkInfo( QWidget *parent, const char *name, int wFlags )
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
171BenchmarkInfo::~BenchmarkInfo() 168BenchmarkInfo::~BenchmarkInfo()
172{} 169{}
173 170
174 171
175void BenchmarkInfo::machineActivated( int index ) 172void 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 {
@@ -186,25 +183,25 @@ void BenchmarkInfo::machineActivated( int index )
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
196void BenchmarkInfo::run() 193void 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 {
@@ -387,25 +384,25 @@ void BenchmarkInfo::performFileTest( const QString& fname, OCheckListItem* item
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
@@ -20,15 +20,15 @@ SOURCES = main.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
27INCLUDEPATH += $(OPIEDIR)/include 27INCLUDEPATH += $(OPIEDIR)/include
28DEPENDPATH += $(OPIEDIR)/include 28DEPENDPATH += $(OPIEDIR)/include
29LIBS += -lqpe -lopiecore2 -lopieui2 29LIBS += -lqpe -lopiecore2 -lopieui2
30DEFINES += UNIX 30DEFINES += UNIX
31TARGET = sysinfo 31TARGET = sysinfo
32VERSION = 1.1.0 32VERSION = 1.1.1
33 33
34include ( $(OPIEDIR)/include.pro ) 34include ( $(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,13 +1,13 @@
1<Choose a model> 1<Choose model>
2n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a 2n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a
3Sharp SL-5500 3Sharp SL-5500
4240010 dhrys,41.498 sec,88 char/sec,1786 gops/sec,50.123 kb/sec,41.7329 kb/sec,105.873 kb/sec 4240010 dhrys,41.498 sec,88 char/sec,1786 gops/sec,50.123 kb/sec,41.7329 kb/sec,105.873 kb/sec
5Sharp SL-5600 5Sharp SL-5600
6not,yet,contributed,please,mail,to,opie@handhelds.org 6not,yet,contributed,please,mail,to,opie@handhelds.org
7Sharp C-700 7Sharp C-700
8not,yet,contributed,please,mail,to,opie@handhelds.org 8not,yet,contributed,please,mail,to,opie@handhelds.org
9Sharp C-750 9Sharp C-750
10490677 dhrys,2.452 sec,437 char/sec,1396 gops/sec,132.061 kb/sec,129.752 kb/sec,n/a 10490677 dhrys,2.452 sec,437 char/sec,1396 gops/sec,132.061 kb/sec,129.752 kb/sec,n/a
11Sharp C-760 11Sharp C-760
12not,yet,contributed,please,mail,to,opie@handhelds.org 12not,yet,contributed,please,mail,to,opie@handhelds.org
13Sharp C-860 13Sharp C-860
@@ -19,12 +19,14 @@ not,yet,contributed,please,mail,to,opie@handhelds.org
19HP iPAQ 38xx 19HP iPAQ 38xx
20234880 dhrys,42.37 sec,418 char/sec,1788 gops/sec,51.6911 kb/sec,31.1029 kb/sec,untested 20234880 dhrys,42.37 sec,418 char/sec,1788 gops/sec,51.6911 kb/sec,31.1029 kb/sec,untested
21HP iPAQ 54xx 21HP iPAQ 54xx
22not,yet,contributed,please,mail,to,opie@handhelds.org 22not,yet,contributed,please,mail,to,opie@handhelds.org
23HP iPAQ 55xx 23HP iPAQ 55xx
24not,yet,contributed,please,mail,to,opie@handhelds.org 24not,yet,contributed,please,mail,to,opie@handhelds.org
25HP Jornada 5x0 25HP Jornada 5x0
26not,yet,contributed,please,mail,to,opie@handhelds.org 26not,yet,contributed,please,mail,to,opie@handhelds.org
27M&N Ramses 27M&N Ramses
28not,yet,contributed,please,mail,to,opie@handhelds.org 28not,yet,contributed,please,mail,to,opie@handhelds.org
29SIEMENS SIMpad 29SIEMENS SIMpad
30not,yet,contributed,please,mail,to,opie@handhelds.org 30not,yet,contributed,please,mail,to,opie@handhelds.org
31MASTERIA Beagle
32not,yet,contributed,please,mail,to,opie@handhelds.org