Rev 181 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 181 | Rev 208 | ||
---|---|---|---|
1 | /********************************************************************************************************************************* |
1 | /********************************************************************************************************************************* |
2 | * * |
2 | * * |
3 | * class representing the DebugData Structure * |
3 | * class representing the DebugData Structure * |
4 | * * |
4 | * * |
5 | * Author: Marcus -LiGi- Bueschleb * |
5 | * Author: Marcus -LiGi- Bueschleb * |
6 | * Project-Start: 9/2007 * |
6 | * Project-Start: 9/2007 * |
7 | 7 | ||
8 | * Mailto: ligi@smart4mobile.de * |
8 | * Mailto: ligi@smart4mobile.de * |
9 | * Licence: Creative Commons / Non Commercial * |
9 | * Licence: Creative Commons / Non Commercial * |
10 | * Big Up: Holger&Ingo * |
10 | * Big Up: Holger&Ingo * |
11 | *********************************************************************************************************************************/ |
11 | *********************************************************************************************************************************/ |
12 | 12 | ||
13 | public class MKDebugData |
13 | public class MKDebugData |
14 | 14 | ||
15 | { |
15 | { |
16 | 16 | ||
17 | int[] digital; |
17 | public int[] analog; |
18 | int zyklen; |
18 | public int motor_complete=-1; |
19 | int zeit; |
- | |
20 | int sekunden; |
- | |
- | 19 | ||
- | 20 | ||
- | 21 | private int i; |
|
- | 22 | ||
- | 23 | public int motor_val(int id) { return analog[12+id]; } |
|
21 | int[] analog; |
24 | |
22 | 25 | ||
23 | public MKDebugData() |
- | |
24 | { |
26 | public MKDebugData() |
25 | digital=new int[13]; |
- | |
26 | analog=new int[16]; |
- | |
27 | int i; |
- | |
28 | for (i=0;i<13;i++) |
- | |
29 | digital[i]=-1; |
- | |
30 | - | ||
31 | zyklen=-1; |
- | |
32 | zeit= -1; |
- | |
33 | sekunden= -1; |
27 | { |
34 | 28 | analog=new int[16]; |
|
35 | for (i=0;i<16;i++) |
29 | for (i=0;i<16;i++) |
36 | analog[i]=-1; |
30 | analog[i]=-1; |
37 | 31 | ||
38 | } |
32 | } |
39 | 33 | ||
40 | public MKDebugData(int[] in_arr) |
34 | public MKDebugData(int[] in_arr) // MKVersion |
41 | { |
- | |
42 | digital=new int[13]; |
- | |
43 | analog=new int[16]; |
- | |
44 | int i; |
- | |
45 | for (i=0;i<13;i++) |
- | |
46 | digital[i]=in_arr[i]; |
35 | { |
47 | - | ||
48 | zyklen= in_arr[13] << 8 | in_arr[14] ; |
- | |
49 | zeit= in_arr[14] << 8 | in_arr[15] ; |
36 | |
50 | sekunden= in_arr[16] ; |
37 | analog=new int[32]; |
51 | 38 | ||
52 | for (i=0;i<16;i++) |
39 | for (i=0;i<16;i++) |
53 | analog[i]=(in_arr[17+i*2]<<8) | in_arr[18+i*2]; |
40 | analog[i]=(in_arr[17+i*2]<<8) | in_arr[18+i*2]; |
- | 41 | ||
54 | 42 | motor_complete=motor_val(0)+motor_val(1)+motor_val(2)+motor_val(3); |
|
55 | } |
43 | } |
56 | 44 | ||
57 | 45 | ||
58 | } |
46 | } |
59 | 47 |