Diffstat (limited to 'noncore/settings/sysinfo/benchmarkinfo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/sysinfo/benchmarkinfo.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/noncore/settings/sysinfo/benchmarkinfo.cpp b/noncore/settings/sysinfo/benchmarkinfo.cpp index 62146f7..1d0b140 100644 --- a/noncore/settings/sysinfo/benchmarkinfo.cpp +++ b/noncore/settings/sysinfo/benchmarkinfo.cpp | |||
@@ -16,57 +16,59 @@ | |||
16 | ** | 16 | ** |
17 | **********************************************************************/ | 17 | **********************************************************************/ |
18 | 18 | ||
19 | /* OPIE */ | 19 | /* OPIE */ |
20 | #include <qpe/qpeapplication.h> | 20 | #include <qpe/qpeapplication.h> |
21 | #include <qpe/qcopenvelope_qws.h> | 21 | #include <qpe/qcopenvelope_qws.h> |
22 | #include <qpe/qpedecoration_qws.h> | 22 | #include <qpe/qpedecoration_qws.h> |
23 | #include <qpe/resource.h> | 23 | #include <qpe/resource.h> |
24 | #include <qpe/config.h> | 24 | #include <qpe/config.h> |
25 | 25 | ||
26 | /* QT */ | 26 | /* QT */ |
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | #include <qfiledialog.h> | 28 | #include <qfiledialog.h> |
29 | #include <qlabel.h> | 29 | #include <qlabel.h> |
30 | #include <qpainter.h> | 30 | #include <qpainter.h> |
31 | #include <qdirectpainter_qws.h> | 31 | #include <qdirectpainter_qws.h> |
32 | #include <qapplication.h> | 32 | #include <qapplication.h> |
33 | #include <qpushbutton.h> | 33 | #include <qpushbutton.h> |
34 | #include <qclipboard.h> | 34 | #include <qclipboard.h> |
35 | #include <qtimer.h> | 35 | #include <qtimer.h> |
36 | #include <qcolor.h> | 36 | #include <qcolor.h> |
37 | #include <qpushbutton.h> | 37 | #include <qpushbutton.h> |
38 | 38 | ||
39 | /* STD */ | 39 | /* STD */ |
40 | #include <stdio.h> | ||
41 | #include <time.h> | 40 | #include <time.h> |
41 | #include <stdio.h> | ||
42 | #include <stdlib.h> | 42 | #include <stdlib.h> |
43 | #include <math.h> | ||
43 | 44 | ||
44 | #include "benchmarkinfo.h" | 45 | #include "benchmarkinfo.h" |
45 | 46 | ||
46 | extern "C" | 47 | extern "C" |
47 | { | 48 | { |
48 | void BenchFFT( void ); | 49 | void BenchFFT( void ); |
50 | double dhry_main( int ); | ||
49 | } | 51 | } |
50 | 52 | ||
51 | //=========================================================================== | 53 | //=========================================================================== |
52 | 54 | ||
53 | class BenchmarkPaintWidget : public QWidget | 55 | class BenchmarkPaintWidget : public QWidget |
54 | { | 56 | { |
55 | public: | 57 | public: |
56 | BenchmarkPaintWidget() : QWidget( 0, "Benchmark Paint Widget", WStyle_Customize|WStyle_StaysOnTop|WPaintUnclipped|WPaintClever ) | 58 | BenchmarkPaintWidget() : QWidget( 0, "Benchmark Paint Widget", WStyle_Customize|WStyle_StaysOnTop|WPaintUnclipped|WPaintClever ) |
57 | { | 59 | { |
58 | resize( QApplication::desktop()->size() ); | 60 | resize( QApplication::desktop()->size() ); |
59 | show(); | 61 | show(); |
60 | p.begin( this ); | 62 | p.begin( this ); |
61 | }; | 63 | }; |
62 | 64 | ||
63 | ~BenchmarkPaintWidget() | 65 | ~BenchmarkPaintWidget() |
64 | { | 66 | { |
65 | p.end(); | 67 | p.end(); |
66 | hide(); | 68 | hide(); |
67 | }; | 69 | }; |
68 | 70 | ||
69 | QPainter p; | 71 | QPainter p; |
70 | }; | 72 | }; |
71 | 73 | ||
72 | //=========================================================================== | 74 | //=========================================================================== |
@@ -101,51 +103,50 @@ BenchmarkInfo::BenchmarkInfo( QWidget *parent, const char *name, int wFlags ) | |||
101 | test_sd->setText( 1, "n/a" ); | 103 | test_sd->setText( 1, "n/a" ); |
102 | test_cf = new QCheckListItem( tests, "7: CF Card Performance ", QCheckListItem::CheckBox ); | 104 | test_cf = new QCheckListItem( tests, "7: CF Card Performance ", QCheckListItem::CheckBox ); |
103 | test_cf->setText( 1, "n/a" ); | 105 | test_cf->setText( 1, "n/a" ); |
104 | 106 | ||
105 | startButton = new QPushButton( tr( "&Start Tests!" ), this ); | 107 | startButton = new QPushButton( tr( "&Start Tests!" ), this ); |
106 | connect( startButton, SIGNAL( clicked() ), this, SLOT( run() ) ); | 108 | connect( startButton, SIGNAL( clicked() ), this, SLOT( run() ) ); |
107 | 109 | ||
108 | vb->addWidget( tests, 2 ); | 110 | vb->addWidget( tests, 2 ); |
109 | vb->addWidget( startButton ); | 111 | vb->addWidget( startButton ); |
110 | } | 112 | } |
111 | 113 | ||
112 | 114 | ||
113 | BenchmarkInfo::~BenchmarkInfo() | 115 | BenchmarkInfo::~BenchmarkInfo() |
114 | {} | 116 | {} |
115 | 117 | ||
116 | 118 | ||
117 | void BenchmarkInfo::run() | 119 | void BenchmarkInfo::run() |
118 | { | 120 | { |
119 | startButton->setText( "> Don't touch! Running Tests! Don't touch! <" ); | 121 | startButton->setText( "> Don't touch! Running Tests! Don't touch! <" ); |
120 | qApp->processEvents(); | 122 | qApp->processEvents(); |
121 | QTime t; | 123 | QTime t; |
122 | 124 | ||
123 | if ( test_alu->isOn() ) | 125 | if ( test_alu->isOn() ) |
124 | { | 126 | { |
125 | t.start(); | 127 | int d = round( dhry_main( DHRYSTONE_RUNS ) ); |
126 | benchInteger(); | 128 | test_alu->setText( 1, QString( "%1 DHRYS" ).arg( QString::number( d ) ) ); |
127 | test_alu->setText( 1, QString( "%1 secs" ).arg( QString::number( t.elapsed() / 1000.0 ) ) ); | ||
128 | test_alu->setOn( false ); | 129 | test_alu->setOn( false ); |
129 | } | 130 | } |
130 | 131 | ||
131 | if ( test_fpu->isOn() ) | 132 | if ( test_fpu->isOn() ) |
132 | { | 133 | { |
133 | t.start(); | 134 | t.start(); |
134 | BenchFFT(); | 135 | BenchFFT(); |
135 | test_fpu->setText( 1, QString( "%1 secs" ).arg( QString::number( t.elapsed() / 1000.0 ) ) ); | 136 | test_fpu->setText( 1, QString( "%1 secs" ).arg( QString::number( t.elapsed() / 1000.0 ) ) ); |
136 | test_fpu->setOn( false ); | 137 | test_fpu->setOn( false ); |
137 | } | 138 | } |
138 | 139 | ||
139 | if ( test_txt->isOn() ) | 140 | if ( test_txt->isOn() ) |
140 | { | 141 | { |
141 | t.start(); | 142 | t.start(); |
142 | paintChar(); | 143 | paintChar(); |
143 | test_txt->setText( 1, QString( "%1 secs" ).arg( QString::number( t.elapsed() / 1000.0 ) ) ); | 144 | test_txt->setText( 1, QString( "%1 secs" ).arg( QString::number( t.elapsed() / 1000.0 ) ) ); |
144 | test_txt->setOn( false ); | 145 | test_txt->setOn( false ); |
145 | } | 146 | } |
146 | 147 | ||
147 | if ( test_gfx->isOn() ) | 148 | if ( test_gfx->isOn() ) |
148 | { | 149 | { |
149 | t.start(); | 150 | t.start(); |
150 | paintLineRect(); | 151 | paintLineRect(); |
151 | test_gfx->setText( 1, QString( "%1 secs" ).arg( QString::number( t.elapsed() / 1000.0 ) ) ); | 152 | test_gfx->setText( 1, QString( "%1 secs" ).arg( QString::number( t.elapsed() / 1000.0 ) ) ); |