示例#1
0
        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;
        }
示例#2
0
        public ActivityChangeInfo(byte[] value)
        {
            this.value = value[0] + "&&" + value[1];

            slot           = ((value[0] & SLOT_MASK) == SLOT_MASK);
            drivingStatus  = ((value[0] & DRIVINGSTATUS_MASK) == DRIVINGSTATUS_MASK);
            activityStatus = ((value[0] & ACTIVITYSTATUS_MASK) == ACTIVITYSTATUS_MASK);
            cardStatus     = ((value[0] & CARDSTATUS_MASK) == CARDSTATUS_MASK);

            activity = (byte)(value[0] & ACTIVITY_MASK);
            activity = (byte)(activity >> 3);

            byte tmp = (byte)(value[0] & TIME_UPPERBYTE_MASK);

            time = ConvertionClass.convertIntoUnsigned2ByteInt(new byte[] { tmp, (byte)(value[1] & TIME_LOWERBYTE_MASK) });
        }
示例#3
0
        public VuDetailedSpeedData(byte[] value)
        {
            vuDetailedSpeedBlocks = new List <VuDetailedSpeedBlock>();

            noOfSpeedBlocks = ConvertionClass.convertIntoUnsigned2ByteInt(ConvertionClass.arrayCopy(value, 0, 2));
            size            = 2 + noOfSpeedBlocks * VuDetailedSpeedBlock.structureSize;

            if (noOfSpeedBlocks != 0)
            {
                for (int i = 0; i < noOfSpeedBlocks; i++)
                {
                    byte[] record             = ConvertionClass.arrayCopy(value, 2 + (i * VuDetailedSpeedBlock.structureSize), VuDetailedSpeedBlock.structureSize);
                    VuDetailedSpeedBlock vdsb = new VuDetailedSpeedBlock(record);
                    vuDetailedSpeedBlocks.Add(vdsb);
                }
            }
        }
示例#4
0
        public VuSpecificConditionData(byte[] value)
        {
            specificConditionRecords = new List <SpecificConditionRecord>();

            noOfSpecificConditionRecords = ConvertionClass.convertIntoUnsigned2ByteInt(ConvertionClass.arrayCopy(value, 0, 2));
            structureSize = 2 + noOfSpecificConditionRecords * SpecificConditionRecord.structureSize;

            if (noOfSpecificConditionRecords != 0)
            {
                for (int i = 0; i < noOfSpecificConditionRecords; i++)
                {
                    byte[] record = ConvertionClass.arrayCopy(value, 2 + (i * SpecificConditionRecord.structureSize), SpecificConditionRecord.structureSize);
                    SpecificConditionRecord scr = new SpecificConditionRecord(record);
                    specificConditionRecords.Add(scr);
                }
            }
        }
示例#5
0
        public VuActivityDailyData(byte[] value, TimeReal downloadedDayDate)
        {
            activityChangeInfo = new List <ActivityChangeInfo>();

            noOfActivityChanges = ConvertionClass.convertIntoUnsigned2ByteInt(ConvertionClass.arrayCopy(value, 0, 2));
            structureSize       = 2 + noOfActivityChanges * ActivityChangeInfo.structureSize;

            if (noOfActivityChanges != 0)
            {
                for (int i = 0; i < noOfActivityChanges; i++)
                {
                    byte[]             record = ConvertionClass.arrayCopy(value, 2 + (i * ActivityChangeInfo.structureSize), ActivityChangeInfo.structureSize);
                    ActivityChangeInfo aci    = new ActivityChangeInfo(record);
                    activityChangeInfo.Add(aci);
                }
            }
        }
示例#6
0
        public VuCardIWData(byte[] value)
        {
            vuCardIWRecords = new List <VuCardIWRecord>();

            noOfIWRecords = ConvertionClass.convertIntoUnsigned2ByteInt(ConvertionClass.arrayCopy(value, 0, 2));
            structureSize = 2 + noOfIWRecords * VuCardIWRecord.structureSize;

            if (noOfIWRecords != 0)
            {
                for (int i = 0; i < noOfIWRecords; i++)
                {
                    byte[]         record = ConvertionClass.arrayCopy(value, 2 + (i * VuCardIWRecord.structureSize), VuCardIWRecord.structureSize);
                    VuCardIWRecord vciwr  = new VuCardIWRecord(record);
                    vuCardIWRecords.Add(vciwr);
                }
            }
        }
示例#7
0
        public ActivityChangeInfo(string valueString)
        {
            byte[]   byteArray = new byte[2];
            string[] strArray;

            strArray     = valueString.Split(new string[] { "&&" }, StringSplitOptions.RemoveEmptyEntries);
            byteArray[0] = Convert.ToByte(strArray[0]);
            byteArray[1] = Convert.ToByte(strArray[1]);

            this.value = valueString;

            slot           = ((byteArray[0] & SLOT_MASK) == SLOT_MASK);
            drivingStatus  = ((byteArray[0] & DRIVINGSTATUS_MASK) == DRIVINGSTATUS_MASK);
            activityStatus = ((byteArray[0] & ACTIVITYSTATUS_MASK) == ACTIVITYSTATUS_MASK);
            cardStatus     = ((byteArray[0] & CARDSTATUS_MASK) == CARDSTATUS_MASK);

            activity = (byte)(byteArray[0] & ACTIVITY_MASK);
            activity = (byte)(activity >> 3);

            byte tmp = (byte)(byteArray[0] & TIME_UPPERBYTE_MASK);

            time = ConvertionClass.convertIntoUnsigned2ByteInt(new byte[] { tmp, (byte)(byteArray[1] & TIME_LOWERBYTE_MASK) });
        }
示例#8
0
        public WorkshopCardCalibrationData(byte[] value, short noOfCalibrationRecords)
        {
            calibrationTotalNumber = ConvertionClass.convertIntoUnsigned2ByteInt(ConvertionClass.arrayCopy(value, 0, 2));
            calibrationRecords     = new List <WorkshopCardCalibrationRecord>();

            int noOfValidCalibrationRecords = 0;

            for (int i = 0; i < noOfCalibrationRecords; i += 1)
            {
                byte[] record = ConvertionClass.arrayCopy(value, 3 + (i * WorkshopCardCalibrationRecord.structureSize), WorkshopCardCalibrationRecord.structureSize);

                WorkshopCardCalibrationRecord wccr = new WorkshopCardCalibrationRecord(record);

                // only add entries with non-default values, i.e. skip empty entries
                if (wccr.calibrationPurpose.calibrationPurpose != 0)
                {
                    calibrationRecords.Add(wccr);

                    noOfValidCalibrationRecords++;
                }
            }

            structureSize = 3 + noOfValidCalibrationRecords * WorkshopCardCalibrationRecord.structureSize;
        }
示例#9
0
 public W_VehicleCharacteristicConstant(byte[] value)
 {
     this.wVehicleCharacteristicConstant = ConvertionClass.convertIntoUnsigned2ByteInt(value);
 }
示例#10
0
 public L_TyreCircumference(byte[] value)
 {
     lTyreCircumference = ConvertionClass.convertIntoUnsigned2ByteInt(value);
 }
示例#11
0
 public NoOfCardVehicleRecords(byte[] value)
 {
     this.noOfCardVehicleRecords = ConvertionClass.convertIntoUnsigned2ByteInt(value);
 }
示例#12
0
 public NoOfCompanyActivityRecords(byte[] value)
 {
     this.noOfCompanyActivityRecords = ConvertionClass.convertIntoUnsigned2ByteInt(value);
 }
示例#13
0
 public Distance(byte[] value)
 {
     distance = ConvertionClass.convertIntoUnsigned2ByteInt(value);;
 }
示例#14
0
 public override string ToString()
 {
     return(ConvertionClass.convertIntoUnsigned2ByteInt(Get_CardStructureVersion_Bytes()).ToString());
 }
示例#15
0
 public CardActivityLengthRange(byte[] value)
 {
     cardActivityLengthRange = ConvertionClass.convertIntoUnsigned2ByteInt(value);
 }
 public K_ConstantOfRecordingEquipment(byte[] value)
 {
     kConstantOfRecordingEquipment = ConvertionClass.convertIntoUnsigned2ByteInt(value);
 }
 public NoOfCalibrationsSinceDownload(byte[] value)
 {
     noOfCalibrationsSinceDownload = ConvertionClass.convertIntoUnsigned2ByteInt(value);
 }