Rev 82 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 82 | Rev 135 | ||
---|---|---|---|
Line 8... | Line 8... | ||
8 | * |
8 | * |
9 | * |
9 | * |
10 | **************************************/ |
10 | **************************************/ |
Line 11... | Line 11... | ||
11 | 11 | ||
12 | public class MKWatchDog |
12 | public class MKWatchDog |
13 | implements Runnable |
13 | implements Runnable,DUBwiseDefinitions |
Line 14... | Line 14... | ||
14 | { |
14 | { |
Line 15... | Line 15... | ||
15 | 15 | ||
Line 24... | Line 24... | ||
24 | 24 | ||
25 | mk=_mk; |
25 | mk=_mk; |
26 | new Thread( this ).start(); // fire up main Thread |
26 | new Thread( this ).start(); // fire up main Thread |
Line -... | Line 27... | ||
- | 27 | } |
|
- | 28 | ||
- | 29 | int lcd_timeout=0; // detect if we lost packets |
|
- | 30 | ||
27 | } |
31 | public int act_paramset=0; |
28 | 32 | ||
- | 33 | public void run() |
|
- | 34 | { |
|
- | 35 | ||
- | 36 | ||
- | 37 | ||
- | 38 | ||
- | 39 | // get all params |
|
- | 40 | ||
- | 41 | int act_debug_name=0; |
|
29 | public void run() |
42 | |
30 | { |
43 | |
- | 44 | while(true) |
|
31 | while(true) |
45 | { |
32 | { |
46 | |
Line 33... | Line 47... | ||
33 | try { Thread.sleep(3000); } |
47 | try { Thread.sleep(30); } // 3000 |
34 | catch (Exception e) { } |
48 | catch (Exception e) { } |
- | 49 | ||
- | 50 | if (mk.connected&&(!mk.force_disconnect)) |
|
- | 51 | { |
|
- | 52 | ||
- | 53 | if ( mk.version.major==-1 ) |
|
- | 54 | { |
|
- | 55 | try { Thread.sleep(150); } |
|
- | 56 | catch (Exception e) { } |
|
- | 57 | mk.get_version(); |
|
- | 58 | } |
|
- | 59 | else if ((act_paramset<5)&&(mk.root.canvas.user_intent==USER_INTENT_PARAMS) &&(! mk.root.canvas.ufo_prober.is_navi())) |
|
- | 60 | { |
|
- | 61 | mk.get_params(act_paramset+1); |
|
- | 62 | ||
- | 63 | try { Thread.sleep(450); } |
|
- | 64 | catch (Exception e) { } |
|
- | 65 | ||
- | 66 | if(mk.params.field[act_paramset]!=null) |
|
- | 67 | act_paramset++; |
|
- | 68 | } |
|
- | 69 | else if (( act_debug_name<32)&&(mk.root.canvas.user_intent==USER_INTENT_RAWDEBUG)) |
|
- | 70 | { |
|
- | 71 | mk.get_debug_name(act_debug_name); |
|
- | 72 | ||
- | 73 | try { Thread.sleep(350); } |
|
- | 74 | catch (Exception e) { } |
|
- | 75 | ||
- | 76 | ||
- | 77 | if (mk.debug_data.got_name[act_debug_name]) act_debug_name++; |
|
- | 78 | } |
|
- | 79 | ||
- | 80 | ||
- | 81 | ||
- | 82 | ||
- | 83 | ||
- | 84 | ||
- | 85 | ||
35 | 86 | /* |
|
36 | if (mk.connected&&(!mk.force_disconnect)) |
87 | |
37 | { |
88 | |
38 | if (debug_data_count_buff==mk.debug_data_count) |
89 | if (debug_data_count_buff==mk.debug_data_count) |
39 | { |
- | |
40 | // mk.close_connections(false); |
- | |
41 | } |
- | |
42 | if ((lcd_data_count_buff==mk.lcd_data_count)||(mk.lcd_data_count==0)) |
- | |
43 | mk.LCD.trigger_LCD(); |
- | |
Line 44... | Line 90... | ||
44 | 90 | { |
|
Line 45... | Line 91... | ||
45 | debug_data_count_buff=mk.debug_data_count; |
91 | // mk.close_connections(false); |
46 | lcd_data_count_buff=mk.lcd_data_count; |
92 | } |
- | 93 | ||
47 | 94 | */ |
|
48 | 95 | ||
49 | 96 | /*if (mk.version.major==-1) |
|
50 | if (mk.version.major==-1) |
97 | mk.get_version(); |
51 | mk.get_version(); |
98 | else |
52 | 99 | */ |
|
53 | for ( int cnt=0;cnt<5;cnt++) |
100 | /*for ( int cnt=0;cnt<5;cnt++) |
54 | if (mk.params.field[cnt]==null) |
101 | if (mk.params.field[cnt]==null) |
55 | { |
102 | { |
56 | mk.get_params(cnt+1); |
103 | mk.get_params(cnt+1); |
57 | break; |
104 | break; |
58 | } |
105 | }*/ |
59 | 106 | /* |
|
60 | for (int c=0;c<32;c++) |
107 | for (int c=0;c<32;c++) |
- | 108 | if (!mk.debug_data.got_name[c]) |
|
- | 109 | { |
|
- | 110 | mk.get_debug_name(c); |
|
- | 111 | break; |
|
- | 112 | } |
|
- | 113 | */ |
|
- | 114 | ||
- | 115 | else if ((lcd_data_count_buff!=mk.lcd_data_count)||(mk.lcd_data_count==0)||(lcd_timeout==23)) |
|
- | 116 | { |
|
- | 117 | lcd_timeout=0; |
|
- | 118 | lcd_data_count_buff=mk.lcd_data_count; |
|
- | 119 | mk.LCD.trigger_LCD(); |
|
- | 120 | try { Thread.sleep(50); } |
|
- | 121 | catch (Exception e) { } |
|
- | 122 | //debug_data_count_buff=mk.debug_data_count; |
|
- | 123 | ||
Line -... | Line 124... | ||
- | 124 | } |
|
Line 61... | Line 125... | ||
61 | if (!mk.debug_data.got_name[c]) |
125 | else |
Line 62... | Line 126... | ||
62 | { |
126 | { |