author | mickeyl <mickeyl> | 2004-02-29 15:02:02 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-02-29 15:02:02 (UTC) |
commit | a731ace5bdbef2354209c655805ebac5298dc2df (patch) (unidiff) | |
tree | ff544eaff192195cba52b46f0b8e02942d143c33 | |
parent | 4cdd469ad2437fb2a09e4e7afff4feb24cd5d83d (diff) | |
download | opie-a731ace5bdbef2354209c655805ebac5298dc2df.zip opie-a731ace5bdbef2354209c655805ebac5298dc2df.tar.gz opie-a731ace5bdbef2354209c655805ebac5298dc2df.tar.bz2 |
Added a column to compare your own results with typical results
Added a combobox and a (text) data file for known results
-rw-r--r-- | noncore/settings/sysinfo/benchmarkinfo.cpp | 94 | ||||
-rw-r--r-- | noncore/settings/sysinfo/benchmarkinfo.h | 7 | ||||
-rw-r--r-- | share/sysinfo/results | 30 |
3 files changed, 109 insertions, 22 deletions
diff --git a/noncore/settings/sysinfo/benchmarkinfo.cpp b/noncore/settings/sysinfo/benchmarkinfo.cpp index 69d8229..0aeb251 100644 --- a/noncore/settings/sysinfo/benchmarkinfo.cpp +++ b/noncore/settings/sysinfo/benchmarkinfo.cpp | |||
@@ -26,15 +26,16 @@ | |||
26 | 26 | ||
27 | /* QT */ | 27 | /* QT */ |
28 | #include <qlayout.h> | 28 | #include <qclipboard.h> |
29 | #include <qcolor.h> | ||
30 | #include <qcombobox.h> | ||
31 | #include <qdirectpainter_qws.h> | ||
32 | #include <qfile.h> | ||
33 | #include <qtextstream.h> | ||
29 | #include <qfiledialog.h> | 34 | #include <qfiledialog.h> |
30 | #include <qlabel.h> | 35 | #include <qlabel.h> |
36 | #include <qlayout.h> | ||
31 | #include <qpainter.h> | 37 | #include <qpainter.h> |
32 | #include <qdirectpainter_qws.h> | ||
33 | #include <qapplication.h> | ||
34 | #include <qpushbutton.h> | 38 | #include <qpushbutton.h> |
35 | #include <qclipboard.h> | ||
36 | #include <qtimer.h> | 39 | #include <qtimer.h> |
37 | #include <qcolor.h> | ||
38 | #include <qpushbutton.h> | ||
39 | 40 | ||
40 | /* STD */ | 41 | /* STD */ |
@@ -92,29 +93,61 @@ BenchmarkInfo::BenchmarkInfo( QWidget *parent, const char *name, int wFlags ) | |||
92 | 93 | ||
93 | tests = new QListView( this ); | 94 | tests = new QListView( this ); |
94 | tests->setMargin( 1 ); | 95 | tests->setMargin( 0 ); |
95 | tests->addColumn( "Tests" ); | 96 | tests->addColumn( tr( "Tests" ) ); |
96 | tests->addColumn( "Results" ); | 97 | tests->addColumn( tr( "Results" ) ); |
98 | tests->addColumn( tr( "Comparison" ) ); | ||
97 | tests->setShowSortIndicator( true ); | 99 | tests->setShowSortIndicator( true ); |
98 | 100 | ||
99 | test_alu = new QCheckListItem( tests, "1: Integer Arithmetic ", QCheckListItem::CheckBox ); | 101 | test_alu = new QCheckListItem( tests, tr( "1. Integer Arithmetic " ), QCheckListItem::CheckBox ); |
102 | test_fpu = new QCheckListItem( tests, tr( "2. Floating Point Unit " ), QCheckListItem::CheckBox ); | ||
103 | test_txt = new QCheckListItem( tests, tr( "3. Text Rendering " ), QCheckListItem::CheckBox ); | ||
104 | test_gfx = new QCheckListItem( tests, tr( "4. Gfx Rendering " ), QCheckListItem::CheckBox ); | ||
105 | test_ram = new QCheckListItem( tests, tr( "5. RAM Performance " ), QCheckListItem::CheckBox ); | ||
106 | test_sd = new QCheckListItem( tests, tr( "6. SD Card Performance " ), QCheckListItem::CheckBox ); | ||
107 | test_cf = new QCheckListItem( tests, tr( "7. CF Card Performance " ), QCheckListItem::CheckBox ); | ||
108 | |||
100 | test_alu->setText( 1, "n/a" ); | 109 | test_alu->setText( 1, "n/a" ); |
101 | test_fpu = new QCheckListItem( tests, "2: Floating Point Unit ", QCheckListItem::CheckBox ); | 110 | test_fpu->setText( 1, "n/a" ); |
102 | test_fpu->setText( 1, "n/a" ); | ||
103 | test_txt = new QCheckListItem( tests, "3: Text Rendering ", QCheckListItem::CheckBox ); | ||
104 | test_txt->setText( 1, "n/a" ); | 111 | test_txt->setText( 1, "n/a" ); |
105 | test_gfx = new QCheckListItem( tests, "4: Gfx Rendering ", QCheckListItem::CheckBox ); | ||
106 | test_gfx->setText( 1, "n/a" ); | 112 | test_gfx->setText( 1, "n/a" ); |
107 | test_ram = new QCheckListItem( tests, "5: RAM Performance ", QCheckListItem::CheckBox ); | ||
108 | test_ram->setText( 1, "n/a" ); | 113 | test_ram->setText( 1, "n/a" ); |
109 | test_sd = new QCheckListItem( tests, "6: SD Card Performance ", QCheckListItem::CheckBox ); | ||
110 | test_sd->setText( 1, "n/a" ); | 114 | test_sd->setText( 1, "n/a" ); |
111 | test_cf = new QCheckListItem( tests, "7: CF Card Performance ", QCheckListItem::CheckBox ); | 115 | test_cf->setText( 1, "n/a" ); |
112 | test_cf->setText( 1, "n/a" ); | 116 | |
113 | 117 | test_alu->setText( 2, "n/a" ); | |
118 | test_fpu->setText( 2, "n/a" ); | ||
119 | test_txt->setText( 2, "n/a" ); | ||
120 | test_gfx->setText( 2, "n/a" ); | ||
121 | test_ram->setText( 2, "n/a" ); | ||
122 | test_sd->setText( 2, "n/a" ); | ||
123 | test_cf->setText( 2, "n/a" ); | ||
124 | |||
114 | startButton = new QPushButton( tr( "&Start Tests!" ), this ); | 125 | startButton = new QPushButton( tr( "&Start Tests!" ), this ); |
115 | connect( startButton, SIGNAL( clicked() ), this, SLOT( run() ) ); | 126 | connect( startButton, SIGNAL( clicked() ), this, SLOT( run() ) ); |
116 | 127 | ||
117 | vb->addWidget( tests, 2 ); | 128 | vb->addWidget( tests, 2 ); |
118 | vb->addWidget( startButton ); | 129 | |
130 | QFile f( QPEApplication::qpeDir() + "/share/sysinfo/results" ); | ||
131 | if ( f.open( IO_ReadOnly ) ) | ||
132 | { | ||
133 | machineCombo = new QComboBox( this ); | ||
134 | |||
135 | QTextStream ts( &f ); | ||
136 | while( !ts.eof() ) | ||
137 | { | ||
138 | QString machline = ts.readLine(); | ||
139 | qDebug( "sysinfo: parsing benchmark results for '%s'", (const char*) machline ); | ||
140 | QString resline = ts.readLine(); | ||
141 | machines.insert( machline, new QStringList( QStringList::split( ",", resline ) ) ); | ||
142 | machineCombo->insertItem( machline ); | ||
143 | } | ||
144 | |||
145 | QHBoxLayout* hb = new QHBoxLayout( vb ); | ||
146 | hb->addWidget( new QLabel( tr( "Compare To:" ), this ) ); | ||
147 | hb->addWidget( machineCombo, 2 ); | ||
148 | connect( machineCombo, SIGNAL( activated( int ) ), this, SLOT( machineActivated( int ) ) ); | ||
149 | } | ||
150 | |||
151 | vb->addWidget( startButton, 2 ); | ||
119 | } | 152 | } |
120 | 153 | ||
@@ -124,4 +157,23 @@ BenchmarkInfo::~BenchmarkInfo() | |||
124 | 157 | ||
125 | 158 | ||
159 | void BenchmarkInfo::machineActivated( int index ) | ||
160 | { | ||
161 | QStringList* results = machines[ machineCombo->text( index ) ]; | ||
162 | if ( !results ) | ||
163 | { | ||
164 | qDebug( "sysinfo: no results available." ); | ||
165 | return; | ||
166 | } | ||
167 | QStringList::Iterator it = results->begin(); | ||
168 | test_alu->setText( 2, *(it++) ); | ||
169 | test_fpu->setText( 2, *(it++) ); | ||
170 | test_txt->setText( 2, *(it++) ); | ||
171 | test_gfx->setText( 2, *(it++) ); | ||
172 | test_ram->setText( 2, *(it++) ); | ||
173 | test_sd->setText( 2, *(it++) ); | ||
174 | test_cf->setText( 2, *(it++) ); | ||
175 | } | ||
176 | |||
177 | |||
126 | void BenchmarkInfo::run() | 178 | void BenchmarkInfo::run() |
127 | { | 179 | { |
diff --git a/noncore/settings/sysinfo/benchmarkinfo.h b/noncore/settings/sysinfo/benchmarkinfo.h index 3c5ca37..d143602 100644 --- a/noncore/settings/sysinfo/benchmarkinfo.h +++ b/noncore/settings/sysinfo/benchmarkinfo.h | |||
@@ -19,6 +19,9 @@ | |||
19 | #include <qwidget.h> | 19 | #include <qwidget.h> |
20 | #include <qdialog.h> | 20 | #include <qdialog.h> |
21 | #include <qdict.h> | ||
22 | #include <qstringlist.h> | ||
21 | 23 | ||
22 | class QClipboard; | 24 | class QClipboard; |
25 | class QComboBox; | ||
23 | class QCheckListItem; | 26 | class QCheckListItem; |
24 | class QPushButton; | 27 | class QPushButton; |
@@ -49,7 +52,8 @@ public: | |||
49 | 52 | ||
50 | QClipboard* clb; | 53 | QClipboard* clb; |
51 | 54 | QComboBox* machineCombo; | |
52 | QListView* tests; | 55 | QListView* tests; |
53 | QPushButton* startButton; | 56 | QPushButton* startButton; |
57 | QDict <QStringList> machines; | ||
54 | 58 | ||
55 | int textRendering( int ); | 59 | int textRendering( int ); |
@@ -61,4 +65,5 @@ private slots: | |||
61 | bool readFile( const QString& ); | 65 | bool readFile( const QString& ); |
62 | void run(); | 66 | void run(); |
67 | void machineActivated( int ); | ||
63 | }; | 68 | }; |
64 | 69 | ||
diff --git a/share/sysinfo/results b/share/sysinfo/results new file mode 100644 index 0000000..1866da3 --- a/dev/null +++ b/share/sysinfo/results | |||
@@ -0,0 +1,30 @@ | |||
1 | <Choose a model> | ||
2 | n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a | ||
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 | ||
5 | Sharp SL-5600 | ||
6 | not,yet,contributed,please,mail,to,opie@handhelds.org | ||
7 | Sharp C-700 | ||
8 | not,yet,contributed,please,mail,to,opie@handhelds.org | ||
9 | Sharp C-750 | ||
10 | not,yet,contributed,please,mail,to,opie@handhelds.org | ||
11 | Sharp C-760 | ||
12 | not,yet,contributed,please,mail,to,opie@handhelds.org | ||
13 | Sharp C-860 | ||
14 | not,yet,contributed,please,mail,to,opie@handhelds.org | ||
15 | HP iPAQ 36xx | ||
16 | not,yet,contributed,please,mail,to,opie@handhelds.org | ||
17 | HP iPAQ 37xx | ||
18 | not,yet,contributed,please,mail,to,opie@handhelds.org | ||
19 | HP iPAQ 38xx | ||
20 | not,yet,contributed,please,mail,to,opie@handhelds.org | ||
21 | HP iPAQ 54xx | ||
22 | not,yet,contributed,please,mail,to,opie@handhelds.org | ||
23 | HP iPAQ 55xx | ||
24 | not,yet,contributed,please,mail,to,opie@handhelds.org | ||
25 | HP Jornada 5x0 | ||
26 | not,yet,contributed,please,mail,to,opie@handhelds.org | ||
27 | M&N Ramses | ||
28 | not,yet,contributed,please,mail,to,opie@handhelds.org | ||
29 | SIEMENS SIMpad | ||
30 | not,yet,contributed,please,mail,to,opie@handhelds.org | ||