|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 #ifndef MEASURETEST_H |
|
18 #define MEASURETEST_H |
|
19 |
|
20 #include <QWidget> |
|
21 #include <HbView> |
|
22 #include <afactivities_global.h> |
|
23 #include <QList> |
|
24 |
|
25 class HbLabel; |
|
26 class QString; |
|
27 class ActivityClient; |
|
28 class QPixmap; |
|
29 class QByteArray; |
|
30 class QVariant; |
|
31 class HbComboBox; |
|
32 class QGraphicsGridLayout; |
|
33 class HbPushButton; |
|
34 class QByteArray; |
|
35 class QFile; |
|
36 class QTextStream; |
|
37 class HbCheckBox; |
|
38 class AfActivityStorage; |
|
39 class AfActivation; |
|
40 class QTimer; |
|
41 |
|
42 class MeasureTest: public HbView |
|
43 { |
|
44 |
|
45 Q_OBJECT |
|
46 |
|
47 public: |
|
48 MeasureTest(QGraphicsItem *parent = 0); |
|
49 ~MeasureTest(); |
|
50 |
|
51 private slots: |
|
52 void saveOne(); |
|
53 void saveMore(); |
|
54 void getOne(); |
|
55 void all(); |
|
56 |
|
57 void timeout(); |
|
58 void preClear(); |
|
59 void startTimer(); |
|
60 |
|
61 private: |
|
62 void Before(); |
|
63 void After(); |
|
64 void Result(); |
|
65 int average(const QList<int>& list); |
|
66 int writeResults(const QList<int>& list, int average); |
|
67 void logError(const QString& mess); |
|
68 |
|
69 bool saveBytes(int bytes); |
|
70 bool deleteActivities(); |
|
71 bool saveOneInLoop(int action); |
|
72 bool saveMoreInLoop(int action); |
|
73 bool getOneInLoop(int bytes, int action); |
|
74 |
|
75 void logResult(); |
|
76 void logResult(const QList<int>& indexes, int caseno, const QString& mess, const QString& type); |
|
77 QString middle(const QList<int>& list); |
|
78 void logSaveSummary(const QList<int>& indexes1, const QList<int>& indexes10); |
|
79 void logGetSummary(const QList<int>& get1, const QList<int>& get2 , const QList<int>& get3); |
|
80 |
|
81 void enableControls(bool enable); |
|
82 |
|
83 |
|
84 private: |
|
85 HbLabel *mResultLabel; |
|
86 HbLabel *mItemLabel; |
|
87 QString mItemMessage; |
|
88 QString mResultMessage; |
|
89 |
|
90 QGraphicsGridLayout *mLayout; |
|
91 HbPushButton *mSaveOneButton; |
|
92 HbPushButton *mSaveMoreButton; |
|
93 HbPushButton *mGetButton; |
|
94 HbPushButton *mAllButton; |
|
95 |
|
96 QByteArray *mByteArray; |
|
97 TInt64 iBefore; |
|
98 TInt64 iAfter; |
|
99 TInt64 iResult; |
|
100 |
|
101 |
|
102 QFile* mFile; |
|
103 QTextStream* mStream; |
|
104 |
|
105 AfActivityStorage* mActivityStorage; |
|
106 AfActivation* mActivation; |
|
107 QObject *mActivityManager; |
|
108 |
|
109 QList<QString> mActionsList; |
|
110 QList<QList<int> > mResultsList; |
|
111 |
|
112 QTimer* mTimer; |
|
113 int mActionCounter; |
|
114 |
|
115 }; |
|
116 |
|
117 #endif //MEASURETEST_H |