コード例 #1
0
ファイル: CardEventRecord.cs プロジェクト: ruslan81/FIS
 public CardEventRecord(byte[] value)
 {
     eventType                = new EventFaultType(value[0]);
     eventBeginTime           = new TimeReal(ConvertionClass.arrayCopy(value, 1, 4));
     eventEndTime             = new TimeReal(ConvertionClass.arrayCopy(value, 5, 4));
     eventVehicleRegistration = new VehicleRegistrationIdentification(ConvertionClass.arrayCopy(value, 9, 15));
 }
コード例 #2
0
 public WorkshopCardHolderIdentification(byte[] value)
 {
     workshopName                = new Name(ConvertionClass.arrayCopy(value, 0, 36));
     workshopAddress             = new Address(ConvertionClass.arrayCopy(value, 36, 36));
     cardHolderName              = new HolderName(ConvertionClass.arrayCopy(value, 72, 72));
     cardHolderPreferredLanguage = new Language(ConvertionClass.arrayCopy(value, 144, 2));
 }
コード例 #3
0
 public ControlCardHolderIdentification(byte[] value)
 {
     controlBodyName             = new Name(ConvertionClass.arrayCopy(value, 0, 36));
     controlBodyAddress          = new Address(ConvertionClass.arrayCopy(value, 36, 36));
     cardHolderName              = new HolderName(ConvertionClass.arrayCopy(value, 72, 72));
     cardHolderPreferredLanguage = new Language(ConvertionClass.arrayCopy(value, 144, 2));
 }
コード例 #4
0
 public CertificateRequestID(byte[] value)
 {
     requestSerialNumber = ConvertionClass.convertIntoUnsigned4ByteInt(ConvertionClass.arrayCopy(value, 0, 4));
     requestMonthYear    = ConvertionClass.arrayCopy(value, 4, 2);
     crIdentifier        = value[6];
     manufacturerCode    = new ManufacturerCode(value[7]);
 }
コード例 #5
0
ファイル: ExtendedSerialNumber.cs プロジェクト: ruslan81/FIS
 public ExtendedSerialNumber(byte[] value)
 {
     serialNumber     = ConvertionClass.convertIntoUnsigned4ByteInt(ConvertionClass.arrayCopy(value, 0, 4));
     monthYear        = ConvertionClass.convertBCDStringIntoString(ConvertionClass.arrayCopy(value, 4, 2));
     type             = value[6];
     manufacturerCode = new ManufacturerCode(value[7]);
 }
コード例 #6
0
 public VuTimeAdjustmentRecord(byte[] value)
 {
     oldTimeValue       = new TimeReal(ConvertionClass.arrayCopy(value, 0, 4));
     newTimeValue       = new TimeReal(ConvertionClass.arrayCopy(value, 4, 4));
     workshopName       = new Name(ConvertionClass.arrayCopy(value, 8, 36));
     workshopAddress    = new Address(ConvertionClass.arrayCopy(value, 44, 36));
     workshopCardNumber = new FullCardNumber(ConvertionClass.arrayCopy(value, 80, 18));
 }
コード例 #7
0
 public VuControlActivityRecord(byte[] value)
 {
     controlType             = new ControlType(value[0]);
     controlTime             = new TimeReal(ConvertionClass.arrayCopy(value, 1, 4));
     controlCardNumber       = new FullCardNumber(ConvertionClass.arrayCopy(value, 5, 18));
     downloadPeriodBeginTime = new TimeReal(ConvertionClass.arrayCopy(value, 23, 4));
     downloadPeriodEndTime   = new TimeReal(ConvertionClass.arrayCopy(value, 27, 4));
 }
コード例 #8
0
 public PlaceRecord(byte[] record)
 {
     entryTime = new TimeReal(ConvertionClass.arrayCopy(record, 0, 4));
     entryTypeDailyWorkPeriod = new EntryTypeDailyWorkPeriod(record[4]);
     dailyWorkPeriodCountry   = new NationNumeric(record[5]);
     dailyWorkPeriodRegion    = new RegionNumeric(record[6]);
     vehicleOdometerValue     = new OdometerShort(ConvertionClass.arrayCopy(record, 7, 3));
 }
コード例 #9
0
ファイル: VuCompanyLocksRecord.cs プロジェクト: ruslan81/FIS
 public VuCompanyLocksRecord(byte[] value)
 {
     lockInTime        = new TimeReal(ConvertionClass.arrayCopy(value, 0, 4));
     lockOutTime       = new TimeReal(ConvertionClass.arrayCopy(value, 4, 4));
     companyName       = new Name(ConvertionClass.arrayCopy(value, 8, 36));
     companyAddress    = new Address(ConvertionClass.arrayCopy(value, 44, 36));
     companyCardNumber = new FullCardNumber(ConvertionClass.arrayCopy(value, 80, 18));
 }
コード例 #10
0
 public CertificationAuthorityKID(byte[] value)
 {
     nationNumeric   = new NationNumeric(value[0]);
     nationAlpha     = new NationAlpha(ConvertionClass.arrayCopy(value, 1, 3));
     keySerialNumber = value[4];
     additionalInfo  = ConvertionClass.arrayCopy(value, 5, 2);
     caIdentifier    = value[7];
 }
コード例 #11
0
        public VehicleRegistrationNumber(byte[] value)
        {
            byte codePageTemp = value[0];

            byte[] vehicleRegNumberTemp = ConvertionClass.arrayCopy(value, 1, value.Length - 1);

            codePage         = ConvertionClass.convertIntoUnsigned1ByteInt(codePageTemp);
            vehicleRegNumber = ConvertionClass.arrayCopy(vehicleRegNumberTemp, 0, 13);
        }
コード例 #12
0
 public CardVehicleRecord(byte[] value)
 {
     vehicleOdometerBegin = new OdometerShort(ConvertionClass.arrayCopy(value, 0, 3));
     vehicleOdometerEnd   = new OdometerShort(ConvertionClass.arrayCopy(value, 3, 3));
     vehicleFirstUse      = new TimeReal(ConvertionClass.arrayCopy(value, 6, 4));
     vehicleLastUse       = new TimeReal(ConvertionClass.arrayCopy(value, 10, 4));
     vehicleRegistration  = new VehicleRegistrationIdentification(ConvertionClass.arrayCopy(value, 14, 15));
     vuDataBlockCounter   = new VuDataBlockCounter(ConvertionClass.arrayCopy(value, 29, 2));
 }
コード例 #13
0
ファイル: Name.cs プロジェクト: ruslan81/FIS
        public Name(byte[] value)
        {
            byte codePageTmp = value[0];

            byte[] nameTmp = ConvertionClass.arrayCopy(value, 1, value.Length - 1);

            codePage = ConvertionClass.convertIntoUnsigned1ByteInt(codePageTmp);
            setName(nameTmp);
        }
コード例 #14
0
ファイル: CardFaultRecord.cs プロジェクト: ruslan81/FIS
        public CardFaultRecord(byte[] value)
        {
            faultType = new EventFaultType(value[0]);
            long faultBeginTimeTmp = ConvertionClass.convertIntoUnsigned4ByteInt(ConvertionClass.arrayCopy(value, 1, 4));

            faultBeginTime           = new TimeReal(ConvertionClass.arrayCopy(value, 1, 4));
            faultEndTime             = new TimeReal(ConvertionClass.arrayCopy(value, 5, 4));
            faultVehicleRegistration = new VehicleRegistrationIdentification(ConvertionClass.arrayCopy(value, 9, 15));
        }
コード例 #15
0
ファイル: CardIdentification.cs プロジェクト: ruslan81/FIS
 public CardIdentification(byte[] value, short cardType)
 {
     cardIssuingMemberState   = new NationNumeric(value[0]);
     cardNumber               = new CardNumber(ConvertionClass.arrayCopy(value, 1, 16), cardType);
     cardIssuingAuthorityName = new Name(ConvertionClass.arrayCopy(value, 17, 36));
     cardIssueDate            = new TimeReal(ConvertionClass.arrayCopy(value, 53, 4));
     cardValidityBegin        = new TimeReal(ConvertionClass.arrayCopy(value, 57, 4));
     cardExpiryDate           = new TimeReal(ConvertionClass.arrayCopy(value, 61, 4));
 }
コード例 #16
0
ファイル: CertificateContent.cs プロジェクト: ruslan81/FIS
 public CertificateContent(byte[] value, short kidType)
 {
     certificateProfileIdentifier    = ConvertionClass.convertIntoUnsigned1ByteInt(value[0]);
     certificationAuthorityReference = new KeyIdentifier(ConvertionClass.arrayCopy(value, 1, 8), kidType);
     certificateHolderAuthorisation  = new CertificateHolderAuthorisation(ConvertionClass.arrayCopy(value, 9, 7));
     certificateEndOfValidity        = new TimeReal(ConvertionClass.arrayCopy(value, 16, 4));
     certificateHolderReference      = new KeyIdentifier(ConvertionClass.arrayCopy(value, 20, 8), kidType);
     publicKey = new PublicKey(ConvertionClass.arrayCopy(value, 28, 136));
 }
コード例 #17
0
 public CardControlActivityDataRecord(byte[] value)
 {
     controlType                = new ControlType(value[0]);
     controlTime                = new TimeReal(ConvertionClass.arrayCopy(value, 1, 4));
     controlCardNumber          = new FullCardNumber(ConvertionClass.arrayCopy(value, 5, 18));
     controlVehicleRegistration = new VehicleRegistrationIdentification(ConvertionClass.arrayCopy(value, 23, 15));
     controlDownloadPeriodBegin = new TimeReal(ConvertionClass.arrayCopy(value, 38, 4));
     controlDownloadPeriodEnd   = new TimeReal(ConvertionClass.arrayCopy(value, 42, 4));
 }
コード例 #18
0
ファイル: CardIccIdentification.cs プロジェクト: ruslan81/FIS
 public CardIccIdentification(byte[] value)
 {
     clockStop = value[0];
     cardExtendedSerialNumber = new ExtendedSerialNumber(ConvertionClass.arrayCopy(value, 1, 8));
     cardApprovalNumber       = new CardApprovalNumber(ConvertionClass.arrayCopy(value, 9, 8));
     cardPersonaliserID       = value[17];
     embedderIcAssemblerId    = ConvertionClass.arrayCopy(value, 18, 5);
     icIdentifier             = ConvertionClass.arrayCopy(value, 23, 2);
 }
コード例 #19
0
 public CompanyActivityRecord(byte[] value)
 {
     companyActivityType            = new CompanyActivityType(value[0]);
     companyActivityTime            = new TimeReal(ConvertionClass.arrayCopy(value, 1, 4));
     cardNumberInformation          = new FullCardNumber(ConvertionClass.arrayCopy(value, 5, 18));
     vehicleRegistrationInformation = new VehicleRegistrationIdentification(ConvertionClass.arrayCopy(value, 23, 15));
     downloadPeriodBegin            = new TimeReal(ConvertionClass.arrayCopy(value, 38, 4));
     downloadPeriodEnd = new TimeReal(ConvertionClass.arrayCopy(value, 42, 4));
 }
コード例 #20
0
        public Address(byte[] value)
        {
            byte codePageTmp = value[0];

            byte[] addressTemp = ConvertionClass.arrayCopy(value, 1, 35);

            codePage = codePageTmp;
            address  = addressTemp;
        }
コード例 #21
0
ファイル: CardDriverActivity.cs プロジェクト: ruslan81/FIS
        public CardDriverActivity(byte[] value, int activityStructureLength)
        {
            activityDailyRecords = new List <CardActivityDailyRecord>();

            activityPointerOldestDayRecord = ConvertionClass.convertIntoUnsigned2ByteInt(ConvertionClass.arrayCopy(value, 0, 2)); // = first CardActivityDailyRecord
            activityPointerNewestRecord    = ConvertionClass.convertIntoUnsigned2ByteInt(ConvertionClass.arrayCopy(value, 2, 2)); // = last CardActivityDailyRecord
            byte[] records     = new byte[activityStructureLength];
            int    lengthToEnd = records.Length - activityPointerOldestDayRecord;

            Array.Copy(value, 4 + activityPointerOldestDayRecord, records, 0, lengthToEnd);

            if (activityPointerOldestDayRecord != 0)
            {
                Array.Copy(value, 4, records, lengthToEnd, activityPointerOldestDayRecord);
            }
            int activityPointerLastRecordOffset;

            if (activityPointerNewestRecord >= activityPointerOldestDayRecord)
            {
                activityPointerLastRecordOffset = activityPointerNewestRecord - activityPointerOldestDayRecord;
            }
            else
            {
                activityPointerLastRecordOffset = records.Length - activityPointerOldestDayRecord + activityPointerNewestRecord;
            }

            int cardActivityDailyRecordsOffset = 0;

            int cadrActivityPreviousRecordLength = 0;
            int cadrActivityRecordLength         = 0;

            int cadrIntegrityCheckActivityPreviousRecordLength = 0;

            while (cardActivityDailyRecordsOffset <= activityPointerLastRecordOffset)
            {
                int cadrLength = ConvertionClass.convertIntoUnsigned2ByteInt(ConvertionClass.arrayCopy(records, cardActivityDailyRecordsOffset + 2, 2));

                if (cadrLength == 0)
                {
                    break;
                }

                CardActivityDailyRecord cadr = new CardActivityDailyRecord(ConvertionClass.arrayCopy(records, cardActivityDailyRecordsOffset, cadrLength));

                cadrActivityPreviousRecordLength = cadr.activityPreviousRecordLength.cardActivityLengthRange;
                cadrActivityRecordLength         = cadr.activityRecordLength.cardActivityLengthRange;

                cardActivityDailyRecordsOffset += cadrActivityRecordLength;                // next CardActivityDailyRecord

                cadrIntegrityCheckActivityPreviousRecordLength = cadrActivityRecordLength; // save record length for integrity check

                activityDailyRecords.Add(cadr);
            }

            structureSize = 2 + 2 + cardActivityDailyRecordsOffset;
        }
コード例 #22
0
ファイル: VuIdentification.cs プロジェクト: ruslan81/FIS
 public VuIdentification(byte[] value)
 {
     vuManufacturerName       = new VuManufacturerName(ConvertionClass.arrayCopy(value, 0, 36));
     vuManufacturerAddress    = new VuManufacturerAddress(ConvertionClass.arrayCopy(value, 36, 36));
     vuPartNumber             = new VuPartNumber(ConvertionClass.arrayCopy(value, 72, 16));
     vuSerialNumber           = new VuSerialNumber(ConvertionClass.arrayCopy(value, 88, 8));
     vuSoftwareIdentification = new VuSoftwareIdentification(ConvertionClass.arrayCopy(value, 96, 8));
     vuManufacturingDate      = new VuManufacturingDate(ConvertionClass.arrayCopy(value, 104, 4));
     vuApprovalNumber         = new VuApprovalNumber(ConvertionClass.arrayCopy(value, 108, 8));
 }
コード例 #23
0
        public VuDetailedSpeedBlock(byte[] value)
        {
            speedBlockBeginDate = new TimeReal(ConvertionClass.arrayCopy(value, 0, 4));
            speedsPerSecond     = new Speed[60];

            for (int i = 0; i < 60; i++)
            {
                speedsPerSecond[i] = new Speed(value[4 + i]);
            }
        }
コード例 #24
0
 public DriverCardApplicationIdentification(byte[] value)
 {
     typeOfTachographCardId  = new EquipmentType(value[0]);
     cardStructureVersion    = new CardStructureVersion(ConvertionClass.arrayCopy(value, 1, 2));
     noOfEventsPerType       = new NoOfEventsPerType(value[3]);
     noOfFaultsPerType       = new NoOfFaultsPerType(value[4]);
     activityStructureLength = new CardActivityLengthRange(ConvertionClass.arrayCopy(value, 5, 2));
     noOfCardVehicleRecords  = new NoOfCardVehicleRecords(ConvertionClass.arrayCopy(value, 7, 2));
     noOfCardPlaceRecords    = new NoOfCardPlaceRecords(value[9]);
 }
コード例 #25
0
 public VuOverSpeedingEventRecord(byte[] value)
 {
     eventType                 = new EventFaultType(value[0]);
     eventRecordPurpose        = new EventFaultRecordPurpose(value[1]);
     eventBeginTime            = new TimeReal(ConvertionClass.arrayCopy(value, 2, 4));
     eventEndTime              = new TimeReal(ConvertionClass.arrayCopy(value, 6, 4));
     maxSpeedValue             = new SpeedMax(value[10]);
     averageSpeedValue         = new SpeedAverage(value[11]);
     cardNumberDriverSlotBegin = new FullCardNumber(ConvertionClass.arrayCopy(value, 12, 18));
     similarEventsNumber       = new SimilarEventsNumber(value[30]);
 }
コード例 #26
0
ファイル: VuFaultRecord.cs プロジェクト: ruslan81/FIS
 public VuFaultRecord(byte[] value)
 {
     faultType                   = new EventFaultType(value[0]);
     faultRecordPurpose          = new EventFaultRecordPurpose(value[1]);
     faultBeginTime              = new TimeReal(ConvertionClass.arrayCopy(value, 2, 4));
     faultEndTime                = new TimeReal(ConvertionClass.arrayCopy(value, 6, 4));
     cardNumberDriverSlotBegin   = new FullCardNumber(ConvertionClass.arrayCopy(value, 10, 18));
     cardNumberCodriverSlotBegin = new FullCardNumber(ConvertionClass.arrayCopy(value, 28, 18));
     cardNumberDriverSlotEnd     = new FullCardNumber(ConvertionClass.arrayCopy(value, 46, 18));
     cardNumberCodriverSlotEnd   = new FullCardNumber(ConvertionClass.arrayCopy(value, 64, 18));
 }
コード例 #27
0
ファイル: ExtendedSerialNumber.cs プロジェクト: ruslan81/FIS
        public ExtendedSerialNumber(string value)
        {
            System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding();
            byte[] _bytes;

            _bytes = enc.GetBytes(value);

            serialNumber     = ConvertionClass.convertIntoUnsigned4ByteInt(ConvertionClass.arrayCopy(_bytes, 0, 4));
            monthYear        = ConvertionClass.convertBCDStringIntoString(ConvertionClass.arrayCopy(_bytes, 4, 2));
            type             = _bytes[6];
            manufacturerCode = new ManufacturerCode(_bytes[7]);
        }
コード例 #28
0
ファイル: VuCardIWRecord.cs プロジェクト: ruslan81/FIS
 public VuCardIWRecord(byte[] value)
 {
     cardHolderName    = new HolderName(ConvertionClass.arrayCopy(value, 0, 72));
     fullCardNumber    = new FullCardNumber(ConvertionClass.arrayCopy(value, 72, 18));
     cardExpiryDate    = new TimeReal(ConvertionClass.arrayCopy(value, 90, 4));
     cardInsertionTime = new TimeReal(ConvertionClass.arrayCopy(value, 94, 4));
     vehicleOdometerValueAtInsertion = new OdometerShort(ConvertionClass.arrayCopy(value, 98, 3));
     cardSlotNumber     = new CardSlotNumber(value[101]);
     cardWithdrawalTime = new TimeReal(ConvertionClass.arrayCopy(value, 102, 4));
     vehicleOdometerValueAtWithdrawal = new OdometerShort(ConvertionClass.arrayCopy(value, 106, 3));
     previousVehicleInfo = new PreviousVehicleInfo(ConvertionClass.arrayCopy(value, 109, 19));
     manualInputFlag     = new ManualInputFlag(value[128]);
 }
コード例 #29
0
 public KeyIdentifier(byte[] value, short kidType)
 {
     this.kidType = kidType;
     if (kidType == KIDTYPE_PK_VU_TC)
     {
         extendedSerialNumber = new ExtendedSerialNumber(ConvertionClass.arrayCopy(value, 0, 8));
     }
     else if (kidType == KIDTYPE_PK_VU)
     {
         certificateRequestID = new CertificateRequestID(ConvertionClass.arrayCopy(value, 0, 8));
     }
     else
     {
         certificationAuthorityKID = new CertificationAuthorityKID(ConvertionClass.arrayCopy(value, 0, 8));
     }
 }
コード例 #30
0
        public CardActivityDailyRecord(byte[] value)
        {
            this.activityPreviousRecordLength = new CardActivityLengthRange(ConvertionClass.arrayCopy(value, 0, 2));
            this.activityRecordLength         = new CardActivityLengthRange(ConvertionClass.arrayCopy(value, 2, 2));
            this.activityRecordDate           = new TimeReal(ConvertionClass.arrayCopy(value, 4, 4));
            this.activityDailyPresenceCounter = new DailyPresenceCounter(ConvertionClass.arrayCopy(value, 8, 2));
            this.activityDayDistance          = new Distance(ConvertionClass.arrayCopy(value, 10, 2));
            this.activityChangeInfo           = new List <ActivityChangeInfo>();

            for (int length = 12; length < activityRecordLength.cardActivityLengthRange; length += ActivityChangeInfo.structureSize)
            {
                ActivityChangeInfo aci = new ActivityChangeInfo(ConvertionClass.arrayCopy(value, length, ActivityChangeInfo.structureSize));
                activityChangeInfo.Add(aci);
            }
            structureSize = 12 + activityRecordLength.cardActivityLengthRange;
        }