| Line | Hits | Source |
|---|---|---|
| 1 | package net.sf.tourviewer.ciclo; | |
| 2 | ||
| 3 | ||
| 4 | ||
| 5 | public class AARecord extends AbstractRecord { | |
| 6 | ||
| 7 | enum TourType { BIKE2, BIKE1, JOGGING, SKI, BIKE, SKI_BIKE, UNKNOWN }; | |
| 8 | ||
| 9 | private TourType tourType; | |
| 10 | private int ddOffset; | |
| 11 | private int timeHour; | |
| 12 | private int timeMinute; | |
| 13 | private int timeMonth; | |
| 14 | private int timeDay; | |
| 15 | private int totalDistance; | |
| 16 | private int mswDistance; | |
| 17 | private int initialAltitude; | |
| 18 | private int initialPulse; | |
| 19 | ||
| 20 | public AARecord(int[] data) { | |
| 21 | 0 | super(data); |
| 22 | ||
| 23 | 0 | switch (getHexH(0)) { |
| 24 | case 0x2E: | |
| 25 | 0 | this.tourType = TourType.BIKE1; |
| 26 | 0 | break; |
| 27 | case 0x3E: | |
| 28 | 0 | this.tourType = TourType.BIKE2; |
| 29 | 0 | break; |
| 30 | case 0x81: | |
| 31 | 0 | this.tourType = TourType.JOGGING; |
| 32 | 0 | break; |
| 33 | case 0x91: | |
| 34 | 0 | this.tourType = TourType.SKI; |
| 35 | 0 | break; |
| 36 | case 0xA1: | |
| 37 | 0 | this.tourType = TourType.BIKE; |
| 38 | 0 | break; |
| 39 | case 0xB1: | |
| 40 | 0 | this.tourType = TourType.SKI_BIKE; |
| 41 | 0 | break; |
| 42 | default: | |
| 43 | 0 | this.tourType = TourType.UNKNOWN; |
| 44 | } | |
| 45 | ||
| 46 | 0 | this.ddOffset = getHex(1); |
| 47 | 0 | this.timeHour = getDecH(2); |
| 48 | 0 | this.timeMinute = getDecL(2); |
| 49 | 0 | this.timeMonth = getDecH(3); |
| 50 | 0 | this.timeDay = getDecL(3); |
| 51 | 0 | this.totalDistance = getHex(4); |
| 52 | 0 | this.mswDistance = getHex(5); |
| 53 | 0 | this.initialAltitude = getHex(6); |
| 54 | 0 | this.initialPulse = getHex(7); |
| 55 | 0 | } |
| 56 | ||
| 57 | @Override | |
| 58 | public String toString() | |
| 59 | { | |
| 60 | 0 | StringBuffer sb = new StringBuffer(); |
| 61 | 0 | sb.append(getDataString()); |
| 62 | 0 | sb.append(String.format(" [(AA) Type=%s,DDOffset=%d,Time=%02d-%02d %02d:%02d,TotalDist=%d,MSWDist=%d,InitialAlt=%d,InitalPulse=%d]", |
| 63 | 0 | tourType, ddOffset, timeMonth, timeDay, timeHour, timeMinute, totalDistance, mswDistance, initialAltitude, initialPulse)); |
| 64 | 0 | return sb.toString(); |
| 65 | } | |
| 66 | ||
| 67 | ||
| 68 | public int getDdOffset() | |
| 69 | { | |
| 70 | 0 | return ddOffset; |
| 71 | } | |
| 72 | ||
| 73 | ||
| 74 | public int getInitialAltitude() | |
| 75 | { | |
| 76 | 0 | return initialAltitude; |
| 77 | } | |
| 78 | ||
| 79 | ||
| 80 | public int getInitialPulse() | |
| 81 | { | |
| 82 | 0 | return initialPulse; |
| 83 | } | |
| 84 | ||
| 85 | ||
| 86 | public int getMswDistance() | |
| 87 | { | |
| 88 | 0 | return mswDistance; |
| 89 | } | |
| 90 | ||
| 91 | ||
| 92 | public int getTimeDay() | |
| 93 | { | |
| 94 | 0 | return timeDay; |
| 95 | } | |
| 96 | ||
| 97 | ||
| 98 | public int getTimeHour() | |
| 99 | { | |
| 100 | 0 | return timeHour; |
| 101 | } | |
| 102 | ||
| 103 | ||
| 104 | public int getTimeMinute() | |
| 105 | { | |
| 106 | 0 | return timeMinute; |
| 107 | } | |
| 108 | ||
| 109 | ||
| 110 | public int getTimeMonth() | |
| 111 | { | |
| 112 | 0 | return timeMonth; |
| 113 | } | |
| 114 | ||
| 115 | ||
| 116 | public int getTotalDistance() | |
| 117 | { | |
| 118 | 0 | return totalDistance; |
| 119 | } | |
| 120 | ||
| 121 | ||
| 122 | public TourType getTourType() | |
| 123 | { | |
| 124 | 0 | return tourType; |
| 125 | } | |
| 126 | ||
| 127 | } |
|
this report was generated by version 1.0.5 of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |