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 |
|
18 #include "MemSpyViewSystemConfig.h" |
|
19 |
|
20 // System includes |
|
21 #include <hal.h> |
|
22 #include <bautils.h> |
|
23 #include <eikenv.h> |
|
24 #ifdef __EPOC32__ |
|
25 #include <e32rom.h> |
|
26 #endif |
|
27 |
|
28 // Engine includes |
|
29 #include <memspy/engine/memspyengine.h> |
|
30 #include <memspy/engine/memspyengineobjectprocess.h> |
|
31 #include <memspy/engine/memspyengineobjectthread.h> |
|
32 #include <memspy/engine/memspyengineobjectcontainer.h> |
|
33 #include <memspy/engine/memspyengineobjectthreadinfoobjects.h> |
|
34 #include <memspy/engine/memspyengineobjectthreadinfocontainer.h> |
|
35 #include <memspy/engine/memspyenginehelperprocess.h> |
|
36 #include <memspy/engine/memspyenginehelperfilesystem.h> |
|
37 |
|
38 // User includes |
|
39 #include "MemSpyUiUtils.h" |
|
40 #include "MemSpyViewMainMenu.h" |
|
41 #include "MemSpyContainerObserver.h" |
|
42 |
|
43 // Literal constants |
|
44 _LIT( KMemSpyItemValueNotKnown, "Unknown" ); |
|
45 |
|
46 |
|
47 |
|
48 CMemSpyViewSystemConfig::CMemSpyViewSystemConfig( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver ) |
|
49 : CMemSpyViewBase( aEngine, aObserver ) |
|
50 { |
|
51 } |
|
52 |
|
53 |
|
54 CMemSpyViewSystemConfig::~CMemSpyViewSystemConfig() |
|
55 { |
|
56 delete iModel; |
|
57 } |
|
58 |
|
59 |
|
60 void CMemSpyViewSystemConfig::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune ) |
|
61 { |
|
62 _LIT( KTitle, "System Configuration" ); |
|
63 SetTitleL( KTitle ); |
|
64 // |
|
65 CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune ); |
|
66 } |
|
67 |
|
68 |
|
69 void CMemSpyViewSystemConfig::RefreshL() |
|
70 { |
|
71 SetListBoxModelL(); |
|
72 CMemSpyViewBase::RefreshL(); |
|
73 } |
|
74 |
|
75 |
|
76 TMemSpyViewType CMemSpyViewSystemConfig::ViewType() const |
|
77 { |
|
78 return EMemSpyViewTypeSystemConfig; |
|
79 } |
|
80 |
|
81 |
|
82 CMemSpyViewBase* CMemSpyViewSystemConfig::PrepareParentViewL() |
|
83 { |
|
84 CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver ); |
|
85 CleanupStack::PushL( parent ); |
|
86 parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() ); |
|
87 CleanupStack::Pop( parent ); |
|
88 return parent; |
|
89 } |
|
90 |
|
91 |
|
92 CMemSpyViewBase* CMemSpyViewSystemConfig::PrepareChildViewL() |
|
93 { |
|
94 CMemSpyViewBase* child = NULL; |
|
95 return child; |
|
96 } |
|
97 |
|
98 |
|
99 void CMemSpyViewSystemConfig::SetListBoxModelL() |
|
100 { |
|
101 CDesCArrayFlat* model = new(ELeave) CDesCArrayFlat(5); |
|
102 delete iModel; |
|
103 iModel = model; |
|
104 |
|
105 TBuf<128> valueBuf; |
|
106 TInt value = 0; |
|
107 TInt value2 = 0; |
|
108 TMemSpySizeText sizeBuf; |
|
109 |
|
110 // |
|
111 _LIT(KItem1Format, "Manufacturer"); |
|
112 GetManufacturer( valueBuf ); |
|
113 AddItemL( KItem1Format, valueBuf ); |
|
114 |
|
115 // |
|
116 _LIT(KItem2Format, "Machine Uid"); |
|
117 GetMachineUid( valueBuf ); |
|
118 AddItemL( KItem2Format, valueBuf ); |
|
119 |
|
120 // |
|
121 _LIT(KItem1aFormat, "Model Uid"); |
|
122 GetHALValueAsHexL( HALData::EModel, KItem1aFormat ); |
|
123 |
|
124 // |
|
125 _LIT(KItem2aFormat, "Device Family"); |
|
126 GetDeviceFamily( valueBuf ); |
|
127 AddItemL( KItem2aFormat, valueBuf ); |
|
128 |
|
129 // |
|
130 _LIT(KItem2bFormat, "Device Family Rev."); |
|
131 GetHALValueAsNumericL( HALData::EDeviceFamilyRev, KItem2bFormat ); |
|
132 |
|
133 // |
|
134 _LIT(KItem3Format, "Hardware Rev."); |
|
135 GetHALValueAsNumericL( HALData::EManufacturerHardwareRev, KItem3Format ); |
|
136 |
|
137 // |
|
138 _LIT(KItem4Format, "Software Rev."); |
|
139 GetHALValueAsNumericL( HALData::EManufacturerSoftwareRev, KItem4Format ); |
|
140 |
|
141 // |
|
142 _LIT(KItem5Format, "Software Build"); |
|
143 GetHALValueAsNumericL( HALData::EManufacturerSoftwareBuild, KItem5Format ); |
|
144 |
|
145 // |
|
146 _LIT(KItem6Format, "CPU"); |
|
147 GetCPU( valueBuf ); |
|
148 AddItemL( KItem6Format, valueBuf ); |
|
149 |
|
150 // |
|
151 _LIT(KItem7Format, "CPU ABI"); |
|
152 GetCPUABI( valueBuf ); |
|
153 AddItemL( KItem7Format, valueBuf ); |
|
154 |
|
155 // |
|
156 _LIT(KItem8Format, "CPU Speed"); |
|
157 _LIT(KItem8Suffix, "KHz"); |
|
158 GetHALValueAsNumericL( HALData::ECPUSpeed, KItem8Format, &KItem8Suffix ); |
|
159 |
|
160 // |
|
161 _LIT(KItem8aFormat, "Floating Point Support"); |
|
162 GetHALValueAsYesNoL( HALData::EHardwareFloatingPoint, KItem8aFormat ); |
|
163 |
|
164 // |
|
165 _LIT(KItem8bFormat, "System Tick Period"); |
|
166 _LIT(KItem8bSuffix, "ms"); |
|
167 GetHALValueAsNumericL( HALData::ESystemTickPeriod, KItem8bFormat, &KItem8bSuffix ); |
|
168 |
|
169 // |
|
170 _LIT(KItem8cFormat, "Nano Tick Period"); |
|
171 _LIT(KItem8cSuffix, "us"); |
|
172 GetHALValueAsNumericL( HALData::ENanoTickPeriod, KItem8cFormat, &KItem8cSuffix ); |
|
173 |
|
174 // |
|
175 _LIT(KItem9Format, "Startup Reason"); |
|
176 GetStartupReason( valueBuf ); |
|
177 AddItemL( KItem9Format, valueBuf ); |
|
178 |
|
179 // |
|
180 _LIT(KItem10Format, "Language"); |
|
181 GetHALValueAsNumericL( HALData::ELanguageIndex, KItem10Format, NULL, 4 ); |
|
182 |
|
183 // |
|
184 _LIT(KItem10aFormat, "Locale"); |
|
185 GetHALValueAsNumericL( HALData::ELocaleLoaded, KItem10aFormat, NULL, 4 ); |
|
186 |
|
187 // |
|
188 _LIT(KItem11aFormat, "Clipboard Drive"); |
|
189 GetHALValueAsDriveLetterL( HALData::EClipboardDrive, KItem11aFormat ); |
|
190 |
|
191 // |
|
192 _LIT(KItem11bFormat, "System Drive (Hal)"); |
|
193 GetHALValueAsDriveLetterL( HALData::ESystemDrive, KItem11bFormat ); |
|
194 |
|
195 // |
|
196 _LIT(KItem11cFormat, "System Drive (F32)"); |
|
197 TDriveNumber systemDrive = CMemSpyEngineHelperFileSystem::GetSystemDrive(); |
|
198 AddItemL( systemDrive, KItem11cFormat ); |
|
199 |
|
200 // |
|
201 _LIT(KItem11dFormat, "System Drive (Bafl)"); |
|
202 value = BaflUtils::GetSystemDrive( systemDrive ); |
|
203 if ( value == KErrNone ) |
|
204 { |
|
205 AddItemL( systemDrive, KItem11dFormat ); |
|
206 } |
|
207 else |
|
208 { |
|
209 MemSpyUiUtils::GetErrorText( valueBuf, value ); |
|
210 AddItemL( KItem11dFormat, valueBuf ); |
|
211 } |
|
212 |
|
213 // |
|
214 _LIT(KItem12Format, "Display Type"); |
|
215 GetDisplayType( valueBuf ); |
|
216 AddItemL( KItem12Format, valueBuf ); |
|
217 // |
|
218 _LIT(KItem12aCaption, "Display Size"); |
|
219 _LIT(KItem12aFormat, "%d x %d"); |
|
220 value = value2 = 0; |
|
221 GetHALValue( HALData::EDisplayXPixels, value ); |
|
222 GetHALValue( HALData::EDisplayYPixels, value2 ); |
|
223 valueBuf.Format( KItem12aFormat, value, value2 ); |
|
224 AddItemL( KItem12aCaption, valueBuf ); |
|
225 |
|
226 // |
|
227 _LIT(KItem13Format, "Display Depth"); |
|
228 _LIT(KItem13Suffix, "bpp"); |
|
229 GetHALValueAsNumericL( HALData::EDisplayBitsPerPixel, KItem13Format, &KItem13Suffix ); |
|
230 |
|
231 // |
|
232 _LIT(KItem14Format, "Display Mode Count"); |
|
233 GetHALValueAsNumericL( HALData::EDisplayNumModes, KItem14Format ); |
|
234 |
|
235 // |
|
236 _LIT(KItem14aFormat, "Current Mode"); |
|
237 GetHALValueAsNumericL( HALData::EDisplayMode, KItem14aFormat ); |
|
238 |
|
239 // |
|
240 _LIT(KItem15Format, "Display Address"); |
|
241 GetHALValueAsHexL( HALData::EDisplayMemoryAddress, KItem15Format ); |
|
242 |
|
243 // |
|
244 _LIT(KItem16Format, "Screen Count"); |
|
245 GetHALValueAsNumericL( HALData::EDisplayNumberOfScreens, KItem16Format ); |
|
246 |
|
247 // |
|
248 _LIT(KItem17Format, "Eikon Def. Disp. Mode"); |
|
249 GetDisplayMode( valueBuf, static_cast<TMemSpyDisplayMode>( CEikonEnv::Static()->DefaultDisplayMode() ) ); |
|
250 AddItemL( KItem17Format, valueBuf ); |
|
251 |
|
252 // Set up list box |
|
253 CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox ); |
|
254 listbox->Model()->SetItemTextArray( model ); |
|
255 listbox->Model()->SetOwnershipType( ELbmOwnsItemArray ); |
|
256 iModel = NULL; |
|
257 } |
|
258 |
|
259 |
|
260 void CMemSpyViewSystemConfig::GetManufacturer( TDes& aBuf ) |
|
261 { |
|
262 TInt value = KErrGeneral; |
|
263 GetHALValue( HALData::EManufacturer, value ); |
|
264 // |
|
265 switch( value ) |
|
266 { |
|
267 case HALData::EManufacturer_Ericsson: |
|
268 { |
|
269 _LIT( KName, "Ericsson" ); |
|
270 aBuf.Copy( KName ); |
|
271 } |
|
272 break; |
|
273 case HALData::EManufacturer_Motorola: |
|
274 { |
|
275 _LIT( KName, "Motorola" ); |
|
276 aBuf.Copy( KName ); |
|
277 } |
|
278 break; |
|
279 case HALData::EManufacturer_Nokia: |
|
280 { |
|
281 _LIT( KName, "Nokia" ); |
|
282 aBuf.Copy( KName ); |
|
283 } |
|
284 break; |
|
285 case HALData::EManufacturer_Panasonic: |
|
286 { |
|
287 _LIT( KName, "Panasonic" ); |
|
288 aBuf.Copy( KName ); |
|
289 } |
|
290 break; |
|
291 case HALData::EManufacturer_Psion: |
|
292 { |
|
293 _LIT( KName, "Psion" ); |
|
294 aBuf.Copy( KName ); |
|
295 } |
|
296 break; |
|
297 case HALData::EManufacturer_Intel: |
|
298 { |
|
299 _LIT( KName, "Intel" ); |
|
300 aBuf.Copy( KName ); |
|
301 } |
|
302 break; |
|
303 case HALData::EManufacturer_Cogent: |
|
304 { |
|
305 _LIT( KName, "Cogent" ); |
|
306 aBuf.Copy( KName ); |
|
307 } |
|
308 break; |
|
309 case HALData::EManufacturer_Cirrus: |
|
310 { |
|
311 _LIT( KName, "Cirrus" ); |
|
312 aBuf.Copy( KName ); |
|
313 } |
|
314 break; |
|
315 case HALData::EManufacturer_Linkup: |
|
316 { |
|
317 _LIT( KName, "Linkup" ); |
|
318 aBuf.Copy( KName ); |
|
319 } |
|
320 break; |
|
321 case HALData::EManufacturer_TexasInstruments: |
|
322 { |
|
323 _LIT( KName, "Texas Instruments" ); |
|
324 aBuf.Copy( KName ); |
|
325 } |
|
326 break; |
|
327 default: |
|
328 aBuf.Copy( KMemSpyItemValueNotKnown ); |
|
329 break; |
|
330 } |
|
331 } |
|
332 |
|
333 |
|
334 void CMemSpyViewSystemConfig::GetDisplayMode( TDes& aBuf, TMemSpyDisplayMode aMode ) |
|
335 { |
|
336 switch( aMode ) |
|
337 { |
|
338 case ENone: |
|
339 { |
|
340 _LIT( KName, "ENone" ); |
|
341 aBuf.Copy( KName ); |
|
342 } |
|
343 case EGray2: |
|
344 { |
|
345 _LIT( KName, "EGray2" ); |
|
346 aBuf.Copy( KName ); |
|
347 } |
|
348 case EGray4: |
|
349 { |
|
350 _LIT( KName, "EGray4" ); |
|
351 aBuf.Copy( KName ); |
|
352 } |
|
353 case EGray16: |
|
354 { |
|
355 _LIT( KName, "EGray16" ); |
|
356 aBuf.Copy( KName ); |
|
357 } |
|
358 case EGray256: |
|
359 { |
|
360 _LIT( KName, "EGray256" ); |
|
361 aBuf.Copy( KName ); |
|
362 } |
|
363 case EColor16: |
|
364 { |
|
365 _LIT( KName, "EColor16" ); |
|
366 aBuf.Copy( KName ); |
|
367 } |
|
368 case EColor256: |
|
369 { |
|
370 _LIT( KName, "EColor256" ); |
|
371 aBuf.Copy( KName ); |
|
372 } |
|
373 case EColor64K: |
|
374 { |
|
375 _LIT( KName, "EColor64K" ); |
|
376 aBuf.Copy( KName ); |
|
377 } |
|
378 case EColor16M: |
|
379 { |
|
380 _LIT( KName, "EColor16M" ); |
|
381 aBuf.Copy( KName ); |
|
382 } |
|
383 case ERgb: |
|
384 { |
|
385 _LIT( KName, "ERgb" ); |
|
386 aBuf.Copy( KName ); |
|
387 } |
|
388 break; |
|
389 case EColor4K: |
|
390 { |
|
391 _LIT( KName, "EColor4K" ); |
|
392 aBuf.Copy( KName ); |
|
393 } |
|
394 break; |
|
395 case EColor16MU: |
|
396 { |
|
397 _LIT( KName, "EColor16MU" ); |
|
398 aBuf.Copy( KName ); |
|
399 } |
|
400 break; |
|
401 case EColor16MA: |
|
402 { |
|
403 _LIT( KName, "EColor16MA" ); |
|
404 aBuf.Copy( KName ); |
|
405 } |
|
406 break; |
|
407 case EColor16MAP: |
|
408 { |
|
409 _LIT( KName, "EColor16MAP" ); |
|
410 aBuf.Copy( KName ); |
|
411 } |
|
412 break; |
|
413 default: |
|
414 aBuf.Copy( KMemSpyItemValueNotKnown ); |
|
415 break; |
|
416 } |
|
417 } |
|
418 |
|
419 |
|
420 void CMemSpyViewSystemConfig::GetDeviceFamily( TDes& aBuf ) |
|
421 { |
|
422 TInt value = KErrGeneral; |
|
423 GetHALValue( HALData::EDeviceFamily, value ); |
|
424 // |
|
425 switch( value ) |
|
426 { |
|
427 case HALData::EDeviceFamily_Crystal: |
|
428 { |
|
429 _LIT( KName, "Crystal" ); |
|
430 aBuf.Copy( KName ); |
|
431 } |
|
432 break; |
|
433 case HALData::EDeviceFamily_Pearl: |
|
434 { |
|
435 _LIT( KName, "Pearl" ); |
|
436 aBuf.Copy( KName ); |
|
437 } |
|
438 break; |
|
439 case HALData::EDeviceFamily_Quartz: |
|
440 { |
|
441 _LIT( KName, "Quartz" ); |
|
442 aBuf.Copy( KName ); |
|
443 } |
|
444 break; |
|
445 default: |
|
446 aBuf.Copy( KMemSpyItemValueNotKnown ); |
|
447 break; |
|
448 } |
|
449 } |
|
450 |
|
451 |
|
452 void CMemSpyViewSystemConfig::GetCPU( TDes& aBuf ) |
|
453 { |
|
454 TInt value = KErrGeneral; |
|
455 GetHALValue( HALData::ECPU, value ); |
|
456 // |
|
457 switch( value ) |
|
458 { |
|
459 case HALData::ECPU_ARM: |
|
460 { |
|
461 _LIT( KName, "ARM" ); |
|
462 aBuf.Copy( KName ); |
|
463 } |
|
464 break; |
|
465 case HALData::ECPU_MCORE: |
|
466 { |
|
467 _LIT( KName, "mCORE" ); |
|
468 aBuf.Copy( KName ); |
|
469 } |
|
470 break; |
|
471 case HALData::ECPU_X86: |
|
472 { |
|
473 _LIT( KName, "X86" ); |
|
474 aBuf.Copy( KName ); |
|
475 } |
|
476 break; |
|
477 default: |
|
478 aBuf.Copy( KMemSpyItemValueNotKnown ); |
|
479 break; |
|
480 } |
|
481 } |
|
482 |
|
483 |
|
484 void CMemSpyViewSystemConfig::GetCPUABI( TDes& aBuf ) |
|
485 { |
|
486 TInt value = KErrGeneral; |
|
487 GetHALValue( HALData::ECPUABI, value ); |
|
488 // |
|
489 switch( value ) |
|
490 { |
|
491 case HALData::ECPUABI_ARM4: |
|
492 { |
|
493 _LIT( KName, "ARM4" ); |
|
494 aBuf.Copy( KName ); |
|
495 } |
|
496 break; |
|
497 case HALData::ECPUABI_ARMI: |
|
498 { |
|
499 _LIT( KName, "ARMI" ); |
|
500 aBuf.Copy( KName ); |
|
501 } |
|
502 break; |
|
503 case HALData::ECPUABI_THUMB: |
|
504 { |
|
505 _LIT( KName, "ARM4" ); |
|
506 aBuf.Copy( KName ); |
|
507 } |
|
508 break; |
|
509 case HALData::ECPUABI_MCORE: |
|
510 { |
|
511 _LIT( KName, "mCORE" ); |
|
512 aBuf.Copy( KName ); |
|
513 } |
|
514 break; |
|
515 case HALData::ECPUABI_MSVC: |
|
516 { |
|
517 _LIT( KName, "MSVC" ); |
|
518 aBuf.Copy( KName ); |
|
519 } |
|
520 break; |
|
521 case HALData::ECPUABI_ARM5T: |
|
522 { |
|
523 _LIT( KName, "ARM5T" ); |
|
524 aBuf.Copy( KName ); |
|
525 } |
|
526 break; |
|
527 case HALData::ECPUABI_X86: |
|
528 { |
|
529 _LIT( KName, "X86" ); |
|
530 aBuf.Copy( KName ); |
|
531 } |
|
532 break; |
|
533 default: |
|
534 aBuf.Copy( KMemSpyItemValueNotKnown ); |
|
535 break; |
|
536 } |
|
537 } |
|
538 |
|
539 |
|
540 void CMemSpyViewSystemConfig::GetStartupReason( TDes& aBuf ) |
|
541 { |
|
542 TInt value = KErrGeneral; |
|
543 GetHALValue( HALData::ESystemStartupReason, value ); |
|
544 // |
|
545 switch( value ) |
|
546 { |
|
547 case HALData::ESystemStartupReason_Cold: |
|
548 { |
|
549 _LIT( KName, "Cold" ); |
|
550 aBuf.Copy( KName ); |
|
551 } |
|
552 break; |
|
553 case HALData::ESystemStartupReason_Warm: |
|
554 { |
|
555 _LIT( KName, "Warm" ); |
|
556 aBuf.Copy( KName ); |
|
557 } |
|
558 break; |
|
559 case HALData::ESystemStartupReason_Fault: |
|
560 { |
|
561 _LIT( KName, "Fault" ); |
|
562 aBuf.Copy( KName ); |
|
563 } |
|
564 break; |
|
565 default: |
|
566 aBuf.Copy( KMemSpyItemValueNotKnown ); |
|
567 break; |
|
568 } |
|
569 } |
|
570 |
|
571 |
|
572 void CMemSpyViewSystemConfig::GetKeyboard( TDes& aBuf ) |
|
573 { |
|
574 _LIT(KComma, ", "); |
|
575 TInt value = KErrGeneral; |
|
576 GetHALValue( HALData::EKeyboard, value ); |
|
577 // |
|
578 aBuf.Zero(); |
|
579 if ( value & EKeyboard_Keypad ) |
|
580 { |
|
581 _LIT( KName, "Keypad" ); |
|
582 aBuf.Copy( KName ); |
|
583 } |
|
584 |
|
585 |
|
586 if ( value & EKeyboard_Full ) |
|
587 { |
|
588 if ( aBuf.Length() ) |
|
589 { |
|
590 aBuf.Append( KComma ); |
|
591 } |
|
592 |
|
593 _LIT( KName, "Full Keyboard" ); |
|
594 aBuf.Copy( KName ); |
|
595 } |
|
596 |
|
597 if ( !aBuf.Length() ) |
|
598 { |
|
599 aBuf.Copy( KMemSpyItemValueNotKnown ); |
|
600 } |
|
601 } |
|
602 |
|
603 |
|
604 void CMemSpyViewSystemConfig::GetMachineUid( TDes& aBuf ) |
|
605 { |
|
606 TInt value = KErrGeneral; |
|
607 GetHALValue( HALData::EMachineUid, value ); |
|
608 // |
|
609 switch( value ) |
|
610 { |
|
611 case HALData::EMachineUid_Series5mx: |
|
612 { |
|
613 _LIT( KName, "Series 5mx" ); |
|
614 aBuf.Copy( KName ); |
|
615 } |
|
616 break; |
|
617 case HALData::EMachineUid_Brutus: |
|
618 { |
|
619 _LIT( KName, "Brutus" ); |
|
620 aBuf.Copy( KName ); |
|
621 } |
|
622 break; |
|
623 case HALData::EMachineUid_Cogent: |
|
624 { |
|
625 _LIT( KName, "Cogent" ); |
|
626 aBuf.Copy( KName ); |
|
627 } |
|
628 break; |
|
629 case HALData::EMachineUid_Win32Emulator: |
|
630 { |
|
631 _LIT( KName, "Win32 Emulator" ); |
|
632 aBuf.Copy( KName ); |
|
633 } |
|
634 break; |
|
635 case HALData::EMachineUid_WinC: |
|
636 { |
|
637 _LIT( KName, "WINC" ); |
|
638 aBuf.Copy( KName ); |
|
639 } |
|
640 break; |
|
641 case HALData::EMachineUid_CL7211_Eval: |
|
642 { |
|
643 _LIT( KName, "CL7211" ); |
|
644 aBuf.Copy( KName ); |
|
645 } |
|
646 break; |
|
647 case HALData::EMachineUid_LinkUp: |
|
648 { |
|
649 _LIT( KName, "LinkUp" ); |
|
650 aBuf.Copy( KName ); |
|
651 } |
|
652 break; |
|
653 case HALData::EMachineUid_Assabet: |
|
654 { |
|
655 _LIT( KName, "Assabet" ); |
|
656 aBuf.Copy( KName ); |
|
657 } |
|
658 break; |
|
659 case HALData::EMachineUid_IQ80310: |
|
660 { |
|
661 _LIT( KName, "IQ80310" ); |
|
662 aBuf.Copy( KName ); |
|
663 } |
|
664 break; |
|
665 case HALData::EMachineUid_Lubbock: |
|
666 { |
|
667 _LIT( KName, "Lubbock" ); |
|
668 aBuf.Copy( KName ); |
|
669 } |
|
670 break; |
|
671 case HALData::EMachineUid_Integrator: |
|
672 { |
|
673 _LIT( KName, "Integrator" ); |
|
674 aBuf.Copy( KName ); |
|
675 } |
|
676 break; |
|
677 case HALData::EMachineUid_Helen: |
|
678 { |
|
679 _LIT( KName, "Helen" ); |
|
680 aBuf.Copy( KName ); |
|
681 } |
|
682 break; |
|
683 case HALData::EMachineUid_X86PC: |
|
684 { |
|
685 _LIT( KName, "X86PC" ); |
|
686 aBuf.Copy( KName ); |
|
687 } |
|
688 break; |
|
689 case HALData::EMachineUid_OmapH2: |
|
690 { |
|
691 _LIT( KName, "OmapH2" ); |
|
692 aBuf.Copy( KName ); |
|
693 } |
|
694 break; |
|
695 case HALData::EMachineUid_OmapH4: |
|
696 { |
|
697 _LIT( KName, "OmapH4" ); |
|
698 aBuf.Copy( KName ); |
|
699 } |
|
700 break; |
|
701 default: |
|
702 { |
|
703 _LIT( KName, "0x%08x" ); |
|
704 aBuf.Format( KName, value ); |
|
705 } |
|
706 break; |
|
707 } |
|
708 } |
|
709 |
|
710 |
|
711 void CMemSpyViewSystemConfig::GetDisplayType( TDes& aBuf ) |
|
712 { |
|
713 TInt value = KErrGeneral; |
|
714 GetHALValue( HALData::EDisplayIsMono, value ); |
|
715 // |
|
716 if ( value == 0 ) |
|
717 { |
|
718 _LIT( KName, "Colour" ); |
|
719 aBuf.Copy( KName ); |
|
720 } |
|
721 else if ( value == 1 ) |
|
722 { |
|
723 _LIT( KName, "Mono" ); |
|
724 aBuf.Copy( KName ); |
|
725 } |
|
726 else |
|
727 { |
|
728 MemSpyUiUtils::GetErrorText( aBuf, value ); |
|
729 } |
|
730 } |
|
731 |
|
732 |
|
733 TInt CMemSpyViewSystemConfig::GetHALValue( HALData::TAttribute aAttribute, TInt& aValue ) |
|
734 { |
|
735 aValue = KErrGeneral; |
|
736 const TInt error = HAL::Get( aAttribute, aValue ); |
|
737 |
|
738 #ifdef _DEBUG |
|
739 if ( error != KErrNone ) |
|
740 { |
|
741 RDebug::Printf("CMemSpyViewSystemConfig::GetHALValue() - aAttribute: %3d, error: %d, value: %d", aAttribute, error, aValue); |
|
742 } |
|
743 #endif |
|
744 |
|
745 return error; |
|
746 } |
|
747 |
|
748 |
|
749 TInt CMemSpyViewSystemConfig::GetHALValueAsNumericL( HALData::TAttribute aAttribute, const TDesC& aCaption, const TDesC* aSuffix, TInt aWidth ) |
|
750 { |
|
751 TBuf<20> valueBuf; |
|
752 TInt value = 0; |
|
753 // |
|
754 const TInt error = GetHALValue( aAttribute, value ); |
|
755 if ( error == KErrNone ) |
|
756 { |
|
757 if ( aWidth > 0 && aWidth < 12 ) |
|
758 { |
|
759 valueBuf.NumFixedWidthUC( (TUint) value, EDecimal, aWidth ); |
|
760 } |
|
761 else |
|
762 { |
|
763 valueBuf.Num( value ); |
|
764 } |
|
765 |
|
766 AddItemL( aCaption, valueBuf, aSuffix ); |
|
767 } |
|
768 else |
|
769 { |
|
770 MemSpyUiUtils::GetErrorText( valueBuf, error ); |
|
771 AddItemL( aCaption, valueBuf ); |
|
772 } |
|
773 // |
|
774 return error; |
|
775 } |
|
776 |
|
777 |
|
778 TInt CMemSpyViewSystemConfig::GetHALValueAsHexL( HALData::TAttribute aAttribute, const TDesC& aCaption, const TDesC* aSuffix ) |
|
779 { |
|
780 TBuf<20> valueBuf; |
|
781 TInt value = 0; |
|
782 // |
|
783 const TInt error = GetHALValue( aAttribute, value ); |
|
784 if ( error == KErrNone ) |
|
785 { |
|
786 MemSpyEngineUtils::FormatHex( valueBuf, value ); |
|
787 AddItemL( aCaption, valueBuf, aSuffix ); |
|
788 } |
|
789 else |
|
790 { |
|
791 MemSpyUiUtils::GetErrorText( valueBuf, error ); |
|
792 AddItemL( aCaption, valueBuf ); |
|
793 } |
|
794 // |
|
795 return error; |
|
796 } |
|
797 |
|
798 |
|
799 TInt CMemSpyViewSystemConfig::GetHALValueAsYesNoL( HALData::TAttribute aAttribute, const TDesC& aCaption, const TDesC* aSuffix ) |
|
800 { |
|
801 TBuf<20> valueBuf; |
|
802 TInt value = 0; |
|
803 // |
|
804 const TInt error = GetHALValue( aAttribute, value ); |
|
805 if ( error == KErrNone || error == KErrNotSupported ) |
|
806 { |
|
807 _LIT(KYes, "Yes"); |
|
808 _LIT(KNo, "No"); |
|
809 _LIT(KError, "Error: %d"); |
|
810 |
|
811 if ( error < KErrNone ) |
|
812 { |
|
813 valueBuf.Format( KError, error ); |
|
814 } |
|
815 else if ( value == EFalse ) |
|
816 { |
|
817 valueBuf.Copy( KNo ); |
|
818 } |
|
819 else if ( error == KErrNone ) |
|
820 { |
|
821 valueBuf.Copy( KYes ); |
|
822 } |
|
823 |
|
824 AddItemL( aCaption, valueBuf, aSuffix ); |
|
825 } |
|
826 else |
|
827 { |
|
828 MemSpyUiUtils::GetErrorText( valueBuf, error ); |
|
829 AddItemL( aCaption, valueBuf ); |
|
830 } |
|
831 // |
|
832 return error; |
|
833 } |
|
834 |
|
835 |
|
836 TInt CMemSpyViewSystemConfig::GetHALValueAsDriveLetterL( HALData::TAttribute aAttribute, const TDesC& aCaption, const TDesC* aSuffix ) |
|
837 { |
|
838 TInt value = 0; |
|
839 const TInt error = GetHALValue( aAttribute, value ); |
|
840 // |
|
841 if ( error == KErrNone && ( value >= EDriveA && value <= EDriveZ ) ) |
|
842 { |
|
843 AddItemL( (TDriveNumber) value, aCaption, aSuffix ); |
|
844 } |
|
845 else |
|
846 { |
|
847 _LIT( KItemNotSet, "Not Defined"); |
|
848 AddItemL( aCaption, KItemNotSet ); |
|
849 } |
|
850 // |
|
851 return error; |
|
852 } |
|
853 |
|
854 |
|
855 void CMemSpyViewSystemConfig::AddItemL( const TDesC& aCaption, const TDesC& aValue, const TDesC* aSuffix ) |
|
856 { |
|
857 _LIT(KItemFormat, "\t%S\t\t%S"); |
|
858 // |
|
859 TBuf<KMaxFullName> item; |
|
860 item.Format( KItemFormat, &aCaption, &aValue ); |
|
861 if ( aSuffix ) |
|
862 { |
|
863 _LIT(KSpace, " "); |
|
864 item.Append( KSpace ); |
|
865 item.Append( *aSuffix ); |
|
866 } |
|
867 // |
|
868 iModel->AppendL( item ); |
|
869 } |
|
870 |
|
871 |
|
872 void CMemSpyViewSystemConfig::AddItemL( TDriveNumber aDrive, const TDesC& aCaption, const TDesC* aSuffix ) |
|
873 { |
|
874 TBuf<20> valueBuf; |
|
875 // |
|
876 const TDriveUnit drive( aDrive ); |
|
877 valueBuf.Copy( drive.Name() ); |
|
878 // |
|
879 AddItemL( aCaption, valueBuf, aSuffix ); |
|
880 } |
|
881 |
|
882 |
|
883 |
|