using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Resources;
using System.Text;
using MindWorks.Nimbus;
using Ivi.Driver;

namespace Raytheon.GuidedElectronicsUnit
{
    public struct CvcwData
    {

        public CvcwData(uint regValue)
        {
            Size = (int)(regValue & (uint)BitMask.Size) >> (int)Bit.Size;
            Data3 = Convert.ToByte((regValue & (uint)BitMask.Data3) >> (int)Bit.Data3);
            Data2 = Convert.ToByte((regValue & (uint)BitMask.Data2) >> (int)Bit.Data2);
            Data1 = Convert.ToByte((regValue & (uint)BitMask.Data1) >> (int)Bit.Data1);
        }

        #region Private Members

        private enum Bit
        {
            Size = 24,
            Data3 = 16,
            Data2 = 8,
            Data1 = 0
        }

        private enum BitMask
        {
            Size = 0x0F00_0000,
            Data3 = 0x00FF_0000,
            Data2 = 0x0000_FF00,
            Data1 = 0x0000_00FF
        }

        #endregion

        public int Size { get; internal set; }

        public byte Data1 { get; internal set; }

        public byte Data2 { get; internal set; }

        public byte Data3 { get; internal set; }

    }
}