示例#1
0
        public VehiclesUsed(byte[] data)
        {
            Items = new List <VehiclesUsedItem>();

            for (int i = 0; i <= (data.Length / 0x1f) - 1; i++)
            {
                if (string.Compare(Strings.Trim(BinaryHelper.ToISOString(BinaryHelper.SubByte(data, (0x1f * i) + 0x10, 14))), "") != 0)
                {
                    VehiclesUsedItem item = new VehiclesUsedItem
                    {
                        OdometerBegin = BinaryHelper.BytesToLong(BinaryHelper.SubByte(data, (0x1f * i) + 1, 3)),
                        OdometerEnd   = BinaryHelper.BytesToLong(BinaryHelper.SubByte(data, (0x1f * i) + 4, 3))
                    };

                    if (item.OdometerEnd == BinaryHelper.BytesToLong(new byte[] { 0xff, 0xff, 0xff }))
                    {
                        item.OdometerEnd = null;
                    }

                    item.FirstUse = BinaryHelper.ToDate(BinaryHelper.SubByte(data, (0x1f * i) + 7, 4));
                    item.LastUse  = BinaryHelper.ToDate(BinaryHelper.SubByte(data, (0x1f * i) + 11, 4));

                    if (item.LastUse == BinaryHelper.ToDate(new byte[] { 0xff, 0xff, 0xff, 0xff }))
                    {
                        item.LastUse = null;
                    }

                    item.RegistrationNation = LookupTableHelper.GetLookupItem <NationLookupTable>(BinaryHelper.BytesToHexString(BinaryHelper.SubByte(data, (0x1f * i) + 15, 1)));
                    item.RegistrationNumber = BinaryHelper.ToISOString(BinaryHelper.SubByte(data, (0x1f * i) + 0x10, 14));
                    item.VUDataBlockCounter = BinaryHelper.BCDToString(BinaryHelper.SubByte(data, (0x1f * i) + 30, 2));

                    Items.Add(item);
                }
            }
        }
示例#2
0
        public FaultsData(byte[] data)
        {
            Items = new List <FaultsDataItem>();

            for (int i = 0; i <= (data.Length / 0x18) - 1; i++)
            {
                if (BinaryHelper.BytesToLong(BinaryHelper.SubByte(data, (0x18 * i) + 1, 1)) != 0L)
                {
                    FaultsDataItem item = new FaultsDataItem
                    {
                        Type      = LookupTableHelper.GetLookupItem <EventFaultTypeLookupTable>(BinaryHelper.BytesToHexString(BinaryHelper.SubByte(data, (0x18 * i) + 1, 1))),
                        BeginTime = BinaryHelper.ToDate(BinaryHelper.SubByte(data, (0x18 * i) + 2, 4))
                    };

                    if (item.BeginTime == BinaryHelper.ToDate(new byte[] { 0, 0, 0, 0 }))
                    {
                        item.BeginTime = null;
                    }

                    item.EndTime = BinaryHelper.ToDate(BinaryHelper.SubByte(data, (0x18 * i) + 6, 4));
                    item.VehicleRegistrationNation = LookupTableHelper.GetLookupItem <NationLookupTable>(BinaryHelper.BytesToHexString(BinaryHelper.SubByte(data, (0x18 * i) + 10, 1)));
                    item.VehicleRegistrationNumber = BinaryHelper.ToISOString(BinaryHelper.SubByte(data, (0x18 * i) + 11, 14));

                    Items.Add(item);
                }
            }
        }
        public ControlActivityData(byte[] data)
        {
            string left = "";

            int num = (int)BinaryHelper.BytesToLong(BinaryHelper.SubByte(data, 1, 1));

            if (num == 0)
            {
                left = "No Activity";
            }
            else
            {
                if ((num & 0x10) == 0x10)
                {
                    left = left + "Card Downloaded";
                }
                if ((num & 0x20) == 0x20)
                {
                    left = left + Conversions.ToString(Interaction.IIf(Operators.CompareString(left, "", false) > 0, ", ", "")) + "VU Downloaded";
                }
                if ((num & 0x40) == 0x40)
                {
                    left = left + Conversions.ToString(Interaction.IIf(Operators.CompareString(left, "", false) > 0, ", ", "")) + "Printing Done";
                }
                if ((num & 0x80) == 0x80)
                {
                    left = left + Conversions.ToString(Interaction.IIf(Operators.CompareString(left, "", false) > 0, ", ", "")) + "Display Used";
                }
            }

            ControlType = left;
            ControlTime = BinaryHelper.ToDate(BinaryHelper.SubByte(data, 2, 4));

            CardType = LookupTableHelper.GetLookupItem <EquipmentTypeLookupTable>(BinaryHelper.BytesToLong(BinaryHelper.SubByte(data, 6, 1)).ToString());
            CardIssuingMemberState    = LookupTableHelper.GetLookupItem <NationLookupTable>(BinaryHelper.BytesToHexString(BinaryHelper.SubByte(data, 7, 1)));
            CardNumber                = BinaryHelper.ToISOString(BinaryHelper.SubByte(data, 8, 0x10));
            VehicleRegistrationNation = LookupTableHelper.GetLookupItem <NationLookupTable>(BinaryHelper.BytesToHexString(BinaryHelper.SubByte(data, 0x18, 1)));
            VehicleRegistrationNumber = BinaryHelper.ToISOString(BinaryHelper.SubByte(data, 0x19, 14));

            DateTime?downloadPeriodBegin = BinaryHelper.ToDate(BinaryHelper.SubByte(data, 0x27, 4));

            if (downloadPeriodBegin == BinaryHelper.ToDate(new byte[] { 0, 0, 0, 0 }))
            {
                downloadPeriodBegin = null;
            }
            ControlDownloadPeriodBegin = downloadPeriodBegin;

            DateTime?downloadPeriodEnd = BinaryHelper.ToDate(BinaryHelper.SubByte(data, 0x2b, 4));

            if (downloadPeriodEnd == BinaryHelper.ToDate(new byte[] { 0, 0, 0, 0 }))
            {
                downloadPeriodEnd = null;
            }
            ControlDownloadPeriodEnd = downloadPeriodEnd;
        }
示例#4
0
 public DriverCardIdentification(byte[] data)
 {
     CardIssuingMemberState      = LookupTableHelper.GetLookupItem <NationLookupTable>(BinaryHelper.BytesToHexString(BinaryHelper.SubByte(data, 1, 1)));
     CardNumber                  = BinaryHelper.DecodeString(BinaryHelper.SubByte(data, 2, 0x10));
     CardIssuingAuthorityName    = BinaryHelper.ToISOString(BinaryHelper.SubByte(data, 0x12, 0x24));
     CardIssuedDate              = BinaryHelper.ToDate(BinaryHelper.SubByte(data, 0x36, 4));
     CardValidityBegin           = BinaryHelper.ToDate(BinaryHelper.SubByte(data, 0x3a, 4));
     CardExpiryDate              = BinaryHelper.ToDate(BinaryHelper.SubByte(data, 0x3e, 4));
     CardHolderSurname           = BinaryHelper.ToISOString(BinaryHelper.SubByte(data, 0x42, 0x24));
     CardHolderFirstNames        = BinaryHelper.ToISOString(BinaryHelper.SubByte(data, 0x66, 0x24));
     CardHolderBirthDate         = BinaryHelper.BCDToDate(BinaryHelper.SubByte(data, 0x8a, 4));
     CardHolderPreferredLanguage = BinaryHelper.DecodeString(BinaryHelper.SubByte(data, 0x8e, 2));
 }
示例#5
0
        public CurrentUsageData(byte[] data)
        {
            SessionOpenTime = BinaryHelper.ToDate(BinaryHelper.SubByte(data, 1, 4));
            if (SessionOpenTime == BinaryHelper.ToDate(new byte[] { 0, 0, 0, 0 }))
            {
                SessionOpenTime = null;
            }

            VehicleRegistrationNation = LookupTableHelper.GetLookupItem <NationLookupTable>(BinaryHelper.BytesToHexString(BinaryHelper.SubByte(data, 5, 1)));
            VehicleRegistrationNumber = BinaryHelper.ToISOString(BinaryHelper.SubByte(data, 6, 14));
            if (VehicleRegistrationNumber == BinaryHelper.ToISOString(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }))
            {
                VehicleRegistrationNumber = null;
            }
        }
示例#6
0
        public CalibrationData(byte[] data)
        {
            Items = new List <CalibrationDataItem>();

            for (int i = 0; i <= data.Length / 0x69 - 1; i++)
            {
                if (BinaryHelper.BytesToLong(BinaryHelper.SubByte(data, (0x69 * i) + 1, 1)) != 0L)
                {
                    CalibrationDataItem item = new CalibrationDataItem
                    {
                        CalibrationPurpose             = LookupTableHelper.GetLookupItem <CalibrationPurposeLookupTable>(BinaryHelper.BytesToHexString(BinaryHelper.SubByte(data, (0x69 * i) + 1, 1))),
                        VehicleIdentificationNumber    = BinaryHelper.DecodeString(BinaryHelper.SubByte(data, (0x69 * i) + 2, 0x11)),
                        VehicleRegistrationNation      = LookupTableHelper.GetLookupItem <NationLookupTable>(BinaryHelper.BytesToHexString(BinaryHelper.SubByte(data, (0x69 * i) + 0x13, 1))),
                        VehicleRegistrationNumber      = BinaryHelper.ToISOString(BinaryHelper.SubByte(data, (0x69 * i) + 20, 14)),
                        WVehicleCharacteristicConstant = BinaryHelper.BytesToLong(BinaryHelper.SubByte(data, (0x69 * i) + 0x22, 2)),
                        KConstantOfRecordingEquipment  = BinaryHelper.BytesToLong(BinaryHelper.SubByte(data, (0x69 * i) + 0x24, 2)),
                        LTyreCircumference             = BinaryHelper.BytesToLong(BinaryHelper.SubByte(data, (0x69 * i) + 0x26, 2)),
                        TyreSize            = BinaryHelper.DecodeString(BinaryHelper.SubByte(data, (0x69 * i) + 40, 15)),
                        AuthorisedSpeed     = BinaryHelper.BytesToLong(BinaryHelper.SubByte(data, (0x69 * i) + 0x37, 1)),
                        OldOdometerValue    = BinaryHelper.BytesToLong(BinaryHelper.SubByte(data, (0x69 * i) + 0x38, 3)),
                        NewOdometerValue    = BinaryHelper.BytesToLong(BinaryHelper.SubByte(data, (0x69 * i) + 0x3b, 3)),
                        OldTimeValue        = BinaryHelper.ToDate(BinaryHelper.SubByte(data, (0x69 * i) + 0x3e, 4)),
                        NewTimeValue        = BinaryHelper.ToDate(BinaryHelper.SubByte(data, (0x69 * i) + 0x42, 4)),
                        NextCalibrationDate = BinaryHelper.ToDate(BinaryHelper.SubByte(data, (0x69 * i) + 70, 4)),
                        VUPartNumber        = BinaryHelper.DecodeString(BinaryHelper.SubByte(data, (0x69 * i) + 0x4a, 0x10)),
                        VUSerialNumber      = BinaryHelper.BytesToLong(BinaryHelper.SubByte(data, 90, 4)),
                        VUMonthYear         = BinaryHelper.BCDToString(BinaryHelper.SubByte(data, 0x5e, 2)),
                        VUType                 = LookupTableHelper.GetLookupItem <EquipmentTypeLookupTable>(BinaryHelper.BytesToLong(BinaryHelper.SubByte(data, 0x60, 1)).ToString()),
                        VUManufacturerCode     = BinaryHelper.BytesToLong(BinaryHelper.SubByte(data, 0x61, 1)),
                        SensorSerialNumber     = BinaryHelper.BytesToLong(BinaryHelper.SubByte(data, 0x62, 4)),
                        SensorMonthYear        = BinaryHelper.BCDToString(BinaryHelper.SubByte(data, 0x66, 2)),
                        SensorType             = LookupTableHelper.GetLookupItem <EquipmentTypeLookupTable>(BinaryHelper.BytesToLong(BinaryHelper.SubByte(data, 0x68, 1)).ToString()),
                        SensorManufacturerCode = BinaryHelper.BytesToLong(BinaryHelper.SubByte(data, 0x69, 1))
                    };

                    Items.Add(item);
                }
            }
        }
 public DrivingLicenseInformation(byte[] data)
 {
     IssuingAuthority = BinaryHelper.ToISOString(BinaryHelper.SubByte(data, 1, 0x24));
     IssuingNation    = LookupTableHelper.GetLookupItem <NationLookupTable>(BinaryHelper.BytesToHexString(BinaryHelper.SubByte(data, 0x25, 1)));
     Number           = BinaryHelper.DecodeString(BinaryHelper.SubByte(data, 0x26, 0x10));
 }