crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/Visualization/CIRegisterVisualization.cs
changeset 0 818e61de6cd1
equal deleted inserted replaced
-1:000000000000 0:818e61de6cd1
       
     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 using System;
       
    18 using System.Text;
       
    19 using System.Collections.Generic;
       
    20 using CrashItemLib.Crash;
       
    21 using CrashItemLib.Crash.Base;
       
    22 using CrashItemLib.Crash.Registers;
       
    23 using CrashItemLib.Crash.Registers.Visualization.Bits;
       
    24 using CrashItemLib.Crash.Registers.Visualization.Utilities;
       
    25 
       
    26 namespace CrashItemLib.Crash.Registers.Visualization
       
    27 {
       
    28     public class CIRegisterVisualization : CIElement
       
    29 	{
       
    30 		#region Constructors
       
    31         public CIRegisterVisualization( CIRegister aRegister, ICIRegisterVisualizerVisitor aVisitor, string aDescription )
       
    32             : base( aRegister.Container, aRegister )
       
    33         {
       
    34             iVisitor = aVisitor;
       
    35             iRegister = aRegister;
       
    36             iDescription = aDescription;
       
    37         }
       
    38 		#endregion
       
    39 
       
    40         #region API
       
    41         public void Refresh()
       
    42         {
       
    43             iVisitor.Build( this );
       
    44         }
       
    45         #endregion
       
    46 
       
    47         #region Properties
       
    48         public override string Name
       
    49         {
       
    50             get { return Description; }
       
    51             set { }
       
    52         }
       
    53 
       
    54         public string Description
       
    55         {
       
    56             get { return iDescription; }
       
    57         }
       
    58 
       
    59         public string Binary
       
    60         {
       
    61             get { return VisUtilities.ToBinary( Value ); }
       
    62         }
       
    63 
       
    64         public CIRegister Register
       
    65         {
       
    66             get { return iRegister; }
       
    67         }
       
    68 
       
    69         public int Size
       
    70         {
       
    71             get { return KRegisterSizeInBits; }
       
    72         }
       
    73 
       
    74         public uint Value
       
    75         {
       
    76             get { return Register.Value; }
       
    77         }
       
    78         #endregion
       
    79 
       
    80         #region Internal methods
       
    81         #endregion
       
    82 
       
    83         #region Internal constants
       
    84         private const int KRegisterSizeInBits = 32;
       
    85         #endregion
       
    86 
       
    87         #region From System.Object
       
    88         public override string ToString()
       
    89         {
       
    90             return iRegister.ToString();
       
    91         }
       
    92         #endregion
       
    93 
       
    94         #region Data members
       
    95         private readonly CIRegister iRegister;
       
    96         private readonly ICIRegisterVisualizerVisitor iVisitor;
       
    97         private readonly string iDescription;
       
    98         #endregion
       
    99     }
       
   100 }