summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore 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,28 +1,28 @@
/**********************************************************************
** BenchmarkInfo
**
-** A benchmark for Qt/Embedded
+** A benchmark widget for Qt/Embedded
**
** Copyright (C) 2004 Michael Lauer <mickey@vanille.de>
** Inspired by ZBench (C) 2002 Satoshi <af230533@im07.alpha-net.ne.jp>
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
**********************************************************************/
#include "benchmarkinfo.h"
/* OPIE */
#include <opie2/odebug.h>
#include <opie2/ostorageinfo.h>
#include <opie2/olistview.h>
#include <qpe/qpeapplication.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/qpedecoration_qws.h>
#include <qpe/resource.h>
@@ -42,51 +42,48 @@ using namespace Opie::Ui;
#include <qlayout.h>
#include <qpainter.h>
#include <qpushbutton.h>
#include <qtimer.h>
#include <qwhatsthis.h>
/* STD */
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#if defined (__GNUC__) && (__GNUC__ < 3)
#define round qRound
#endif
extern "C"
{
void BenchFFT( void );
double dhry_main( int );
}
#define DHRYSTONE_RUNS 20000000
#define TEST_DURATION 3
-#define BUFF_SIZE 8192
-#define FILE_SIZE 1024 * 1024 // 1Mb
-
//===========================================================================
class BenchmarkPaintWidget : public QWidget
{
public:
BenchmarkPaintWidget() : QWidget( 0, "Benchmark Paint Widget", WStyle_Customize|WStyle_StaysOnTop|WPaintUnclipped|WPaintClever )
{
resize( QApplication::desktop()->size() );
show();
p.begin( this );
};
~BenchmarkPaintWidget()
{
p.end();
hide();
};
QPainter p;
};
//===========================================================================
BenchmarkInfo::BenchmarkInfo( QWidget *parent, const char *name, int wFlags )
@@ -121,102 +118,102 @@ BenchmarkInfo::BenchmarkInfo( QWidget *parent, const char *name, int wFlags )
test_alu->setText( 1, "n/a" );
test_fpu->setText( 1, "n/a" );
test_txt->setText( 1, "n/a" );
test_gfx->setText( 1, "n/a" );
test_ram->setText( 1, "n/a" );
#ifndef QT_QWS_RAMSES
test_sd->setText( 1, "n/a" );
test_cf->setText( 1, "n/a" );
#endif
test_alu->setText( 2, "n/a" );
test_fpu->setText( 2, "n/a" );
test_txt->setText( 2, "n/a" );
test_gfx->setText( 2, "n/a" );
test_ram->setText( 2, "n/a" );
#ifndef QT_QWS_RAMSES
test_sd->setText( 2, "n/a" );
test_cf->setText( 2, "n/a" );
#endif
startButton = new QPushButton( tr( "&Start Tests!" ), this );
QWhatsThis::add( startButton, tr( "Click here to perform the selected tests." ) );
connect( startButton, SIGNAL( clicked() ), this, SLOT( run() ) );
vb->addWidget( tests, 2 );
+ QHBoxLayout* hb = new QHBoxLayout( vb );
+ hb->addWidget( startButton, 2 );
+
QFile f( QPEApplication::qpeDir() + "/share/sysinfo/results" );
if ( f.open( IO_ReadOnly ) )
{
machineCombo = new QComboBox( this );
QWhatsThis::add( machineCombo, tr( "Choose a model to compare your results with." ) );
QTextStream ts( &f );
while( !ts.eof() )
{
QString machline = ts.readLine();
odebug << "sysinfo: parsing benchmark results for '" << machline << "'" << oendl;
QString resline = ts.readLine();
machines.insert( machline, new QStringList( QStringList::split( ",", resline ) ) );
machineCombo->insertItem( machline );
}
- QHBoxLayout* hb = new QHBoxLayout( vb );
- hb->addWidget( new QLabel( tr( "Compare To:" ), this ) );
+ hb->addWidget( new QLabel( tr( "Compare:" ), this ) );
hb->addWidget( machineCombo, 2 );
connect( machineCombo, SIGNAL( activated(int) ), this, SLOT( machineActivated(int) ) );
}
-
- vb->addWidget( startButton, 2 );
}
BenchmarkInfo::~BenchmarkInfo()
{}
void BenchmarkInfo::machineActivated( int index )
{
QStringList* results = machines[ machineCombo->text( index ) ];
if ( !results )
{
odebug << "sysinfo: no results available." << oendl;
return;
}
QStringList::Iterator it = results->begin();
test_alu->setText( 2, *(it++) );
test_fpu->setText( 2, *(it++) );
test_txt->setText( 2, *(it++) );
test_gfx->setText( 2, *(it++) );
test_ram->setText( 2, *(it++) );
#ifndef QT_QWS_RAMSES
test_sd->setText( 2, *(it++) );
test_cf->setText( 2, *(it++) );
#endif
}
void BenchmarkInfo::run()
{
- startButton->setText( "> Don't touch! Running Tests! Don't touch! <" );
+ startButton->setText( "> Don't touch! <" );
qApp->processEvents();
QTime t;
if ( test_alu->isOn() )
{
int d = round( dhry_main( DHRYSTONE_RUNS ) );
test_alu->setText( 1, QString().sprintf( "%d dhrys", d ) );
test_alu->setOn( false );
}
if ( test_fpu->isOn() )
{
t.start();
BenchFFT();
test_fpu->setText( 1, QString().sprintf( "%.2f secs", t.elapsed() / 1000.0 ) );;
test_fpu->setOn( false );
}
if ( test_txt->isOn() )
{
int value = textRendering( TEST_DURATION );
test_txt->setText( 1, QString().sprintf( "%d chars/sec", value / TEST_DURATION ) );
test_txt->setOn( false );
}
@@ -375,37 +372,37 @@ void BenchmarkInfo::performFileTest( const QString& fname, OCheckListItem* item
write = time.elapsed();
}
else
{
item->setText( 1, tr( "error" ) );
return;
}
time.restart();
if ( ::system( readCommand ) == 0 )
{
read = time.elapsed();
}
else
{
item->setText( 1, tr( "error" ) );
return;
}
QFile::remove( filename );
double readSpeed = FILE_TEST_COUNT / ( read / 1000.0 );
QString readUnit = "kB/s";
if ( readSpeed > 1024 )
{
- readSpeed = readSpeed / 1024.0;
+ readSpeed /= 1024.0;
readUnit = "MB/s";
}
double writeSpeed = FILE_TEST_COUNT / ( write / 1000.0 );
QString writeUnit = "kb/s";
if ( writeSpeed > 1024 )
{
- writeSpeed = writeSpeed / 1024.0;
+ writeSpeed /= 1024.0;
writeUnit = "MB/s";
}
item->setText( 1, QString().sprintf( "%.2f %s, %.2f %s", readSpeed, readUnit.latin1(), writeSpeed, writeUnit.latin1() ) );
item->setOn( false );
}
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
@@ -8,27 +8,27 @@ HEADERS = \
modulesinfo.h \
detail.h \
contrib/dhry.h \
benchmarkinfo.h \
versioninfo.h \
sysinfo.h
SOURCES = main.cpp \
memory.cpp \
graph.cpp \
load.cpp \
storage.cpp \
processinfo.cpp \
modulesinfo.cpp \
detail.cpp \
contrib/dhry.c contrib/fft.c \
benchmarkinfo.cpp \
versioninfo.cpp \
sysinfo.cpp
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe -lopiecore2 -lopieui2
DEFINES += UNIX
TARGET = sysinfo
-VERSION = 1.1.0
+VERSION = 1.1.1
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 @@
-<Choose a model>
+<Choose model>
n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a
Sharp SL-5500
240010 dhrys,41.498 sec,88 char/sec,1786 gops/sec,50.123 kb/sec,41.7329 kb/sec,105.873 kb/sec
Sharp SL-5600
not,yet,contributed,please,mail,to,opie@handhelds.org
Sharp C-700
not,yet,contributed,please,mail,to,opie@handhelds.org
Sharp C-750
490677 dhrys,2.452 sec,437 char/sec,1396 gops/sec,132.061 kb/sec,129.752 kb/sec,n/a
Sharp C-760
not,yet,contributed,please,mail,to,opie@handhelds.org
Sharp C-860
not,yet,contributed,please,mail,to,opie@handhelds.org
HP iPAQ 36xx
not,yet,contributed,please,mail,to,opie@handhelds.org
HP iPAQ 37xx
not,yet,contributed,please,mail,to,opie@handhelds.org
HP iPAQ 38xx
234880 dhrys,42.37 sec,418 char/sec,1788 gops/sec,51.6911 kb/sec,31.1029 kb/sec,untested
HP iPAQ 54xx
not,yet,contributed,please,mail,to,opie@handhelds.org
HP iPAQ 55xx
not,yet,contributed,please,mail,to,opie@handhelds.org
HP Jornada 5x0
not,yet,contributed,please,mail,to,opie@handhelds.org
M&N Ramses
not,yet,contributed,please,mail,to,opie@handhelds.org
SIEMENS SIMpad
not,yet,contributed,please,mail,to,opie@handhelds.org
+MASTERIA Beagle
+not,yet,contributed,please,mail,to,opie@handhelds.org