Rev 223 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
206 | ligi | 1 | /********************************************* |
2 | * |
||
3 | * class representing the DebugData Structure |
||
4 | * |
||
5 | * Author: Marcus -LiGi- Bueschleb |
||
6 | * |
||
7 | * see README for further Infos |
||
8 | * |
||
9 | ********************************************/ |
||
10 | |||
11 | package org.ligi.ufo; |
||
12 | |||
13 | public class MKDebugData |
||
14 | { |
||
15 | |||
16 | public int[] analog; |
||
17 | public String[] names; |
||
18 | public boolean[] got_name; |
||
381 | ligi | 19 | // public int motor_complete=-1; |
206 | ligi | 20 | |
21 | |||
22 | private int i; |
||
23 | |||
24 | public int motor_val(int id) { return analog[12+id]; } |
||
381 | ligi | 25 | /* public int nick_int() { return analog[0]; } |
206 | ligi | 26 | public int roll_int() { return analog[1]; } |
27 | public int accnick() { return analog[2]; } |
||
28 | public int accroll() { return analog[3]; } |
||
381 | ligi | 29 | */ |
206 | ligi | 30 | |
381 | ligi | 31 | // public int UBatt() { return analog[9]; } |
32 | // public int SenderOkay() { return analog[10]; } |
||
206 | ligi | 33 | |
34 | |||
35 | |||
36 | |||
37 | public MKDebugData() |
||
38 | { |
||
39 | names=new String[32]; |
||
40 | analog=new int[32]; |
||
41 | got_name=new boolean[32]; |
||
42 | for (i=0;i<32;i++) |
||
43 | { |
||
44 | analog[i]=-1; |
||
45 | names[i]="-#"+i+"->"; |
||
46 | got_name[i]=false; |
||
47 | } |
||
48 | |||
49 | } |
||
50 | |||
51 | public void set_names_by_mk_data(int[] in_arr) |
||
52 | { |
||
53 | int id=in_arr[0]; |
||
54 | names[id]=""; |
||
55 | for (i=0;i<16;i++) |
||
56 | { |
||
57 | if ((char)in_arr[i+1]!=' ') |
||
58 | names[id]+=(char)in_arr[i+1]; |
||
59 | got_name[id]=true; |
||
60 | } |
||
61 | names[id]+=":"; |
||
62 | } |
||
63 | |||
222 | ligi | 64 | |
206 | ligi | 65 | public void set_by_mk_data(int[] in_arr,MKVersion version) |
66 | { |
||
67 | |||
68 | for (i=0;i<32;i++) |
||
381 | ligi | 69 | analog[i]=MKHelper.parse_signed_int_2( in_arr[2+i*2], in_arr[3+i*2] ); |
206 | ligi | 70 | |
381 | ligi | 71 | // motor_complete=motor_val(0)+motor_val(1)+motor_val(2)+motor_val(3); |
206 | ligi | 72 | |
73 | |||
74 | } |
||
75 | |||
76 | |||
77 | |||
78 | } |