Line | Hits | Source |
---|---|---|
1 | package net.sf.tourviewer.lib.ciclo; | |
2 | ||
3 | ||
4 | ||
5 | public class AABlock extends AbstractBlock { | |
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 AABlock(int[] data) { | |
21 | 566 | super(data); |
22 | ||
23 | 566 | switch (getHexH(0)) { |
24 | case 0x2E: | |
25 | 22 | this.tourType = TourType.BIKE1; |
26 | 22 | break; |
27 | case 0x3E: | |
28 | 400 | this.tourType = TourType.BIKE2; |
29 | 400 | break; |
30 | case 0x81: | |
31 | 16 | this.tourType = TourType.JOGGING; |
32 | 16 | break; |
33 | case 0x91: | |
34 | 0 | this.tourType = TourType.SKI; |
35 | 0 | break; |
36 | case 0xA1: | |
37 | 48 | this.tourType = TourType.BIKE; |
38 | 48 | break; |
39 | case 0xB1: | |
40 | 80 | this.tourType = TourType.SKI_BIKE; |
41 | 80 | break; |
42 | default: | |
43 | 0 | this.tourType = TourType.UNKNOWN; |
44 | } | |
45 | ||
46 | 566 | this.ddOffset = getHex(1); |
47 | 566 | this.timeHour = getDecH(2); |
48 | 566 | this.timeMinute = getDecL(2); |
49 | 566 | this.timeMonth = getDecH(3); |
50 | 566 | this.timeDay = getDecL(3); |
51 | 566 | this.totalDistance = getHex(4); |
52 | 566 | this.mswDistance = getHex(5); |
53 | 566 | this.initialAltitude = getHex(6); |
54 | 566 | this.initialPulse = getHex(7); |
55 | 566 | } |
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 | 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. |