Subversion Repositories Projects

Rev

Rev 135 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 135 Rev 149
Line 27... Line 27...
27
    }
27
    }
Line 28... Line 28...
28
 
28
 
Line 29... Line 29...
29
    int lcd_timeout=0; // detect if we lost packets
29
    int lcd_timeout=0; // detect if we lost packets
-
 
30
 
Line 30... Line 31...
30
 
31
    public int act_paramset=0;
31
    public int act_paramset=0;
32
    int conn_check_timeout=0;
32
 
-
 
33
    public void run()
-
 
34
    {
-
 
35
       
-
 
36
 
33
 
37
 
-
 
38
       
34
    public void run()
Line 39... Line -...
39
        // get all params
-
 
40
       
35
    {
41
        int act_debug_name=0;
36
        // get all params
Line 42... Line 37...
42
 
37
        int act_debug_name=0;
43
 
38
 
Line 44... Line 39...
44
        while(true)
39
        while(true)
45
            {
40
            {
Line -... Line 41...
-
 
41
 
-
 
42
                try { Thread.sleep(100); } // 3000
-
 
43
                catch (Exception e)  {   }
-
 
44
               
-
 
45
                if (mk.connected&&(!mk.force_disconnect))
-
 
46
                    {
-
 
47
 
-
 
48
                        if (debug_data_count_buff==mk.debug_data_count)
-
 
49
                            {
-
 
50
                                mk.debug.log("timeout:" +conn_check_timeout );         
-
 
51
                                conn_check_timeout++;
-
 
52
                                if  (conn_check_timeout==100)
-
 
53
                                    {
-
 
54
                                        mk.debug.log("disconnecting");         
-
 
55
                                        mk.close_connections(false);
-
 
56
                                        conn_check_timeout=0;
-
 
57
                                    }
46
 
58
                                debug_data_count_buff=mk.debug_data_count;
47
                try { Thread.sleep(30); } // 3000
59
                               
48
                catch (Exception e)  {   }
60
                            }
49
               
61
                        else
50
                if (mk.connected&&(!mk.force_disconnect))
62
                            conn_check_timeout=0;
51
                    {
63
 
52
 
64
 
53
                        if ( mk.version.major==-1 )
65
                        if ( mk.version.major==-1 )
54
                            {
66
                            {
Line 55... Line 67...
55
                                try { Thread.sleep(150); }
67
                                try { Thread.sleep(150); }
56
                                catch (Exception e)  {   }
68
                                catch (Exception e)  {   }
Line 57... Line 69...
57
                                mk.get_version();
69
                                mk.get_version();
58
                            }
70
                            }
59
                        else  if ((act_paramset<5)&&(mk.root.canvas.user_intent==USER_INTENT_PARAMS) &&(! mk.root.canvas.ufo_prober.is_navi()))
71
                        else  if ((act_paramset<5)&&(mk.root.canvas.user_intent==USER_INTENT_PARAMS) &&(! mk.root.canvas.ufo_prober.is_navi()))
60
                            {
72
                            {
61
                                mk.get_params(act_paramset+1);
73
                                mk.get_params(act_paramset+1);
62
                               
74
                               
Line 63... Line 75...
63
                                try { Thread.sleep(450); }
75
                                try { Thread.sleep(350); }
64
                                catch (Exception e)  {   }
76
                                catch (Exception e)  {   }
Line 65... Line 77...
65
                               
77
                               
66
                                if(mk.params.field[act_paramset]!=null)
78
                                if(mk.params.field[act_paramset]!=null)
-
 
79
                                    act_paramset++;
-
 
80
                            }
-
 
81
                        else if (( act_debug_name<32)&&(mk.root.canvas.user_intent==USER_INTENT_RAWDEBUG))
-
 
82
                            {
-
 
83
                                mk.get_debug_name(act_debug_name);
-
 
84
                               
67
                                    act_paramset++;
85
                                try { Thread.sleep(150); }
Line 110... Line 128...
110
                                    mk.get_debug_name(c);
128
                                    mk.get_debug_name(c);
111
                                    break;
129
                                    break;
112
                                }
130
                                }
113
                        */
131
                        */
Line 114... Line -...
114
 
-
 
-
 
132
 
115
                        else if ((lcd_data_count_buff!=mk.lcd_data_count)||(mk.lcd_data_count==0)||(lcd_timeout==23))
133
                        else
-
 
134
                            {
-
 
135
                                if ((lcd_data_count_buff!=mk.lcd_data_count)||(mk.lcd_data_count==0)||(lcd_timeout==23))
116
                            {
136
                                    {
117
                                lcd_timeout=0;
137
                                        lcd_timeout=0;
118
                                lcd_data_count_buff=mk.lcd_data_count;
138
                                        lcd_data_count_buff=mk.lcd_data_count;
119
                                mk.LCD.trigger_LCD();
139
                                        mk.LCD.trigger_LCD();
120
                                try { Thread.sleep(50); }
140
                                        try { Thread.sleep(50); }
121
                                catch (Exception e)  {   }
141
                                        catch (Exception e)  {   }
Line 122... Line 142...
122
                                //debug_data_count_buff=mk.debug_data_count;
142
                                        //debug_data_count_buff=mk.debug_data_count;
123
                               
143
                               
124
                            }
144
                                    }
125
                        else
145
                                else
-
 
146
                                    {
126
                            {
147
                                        lcd_timeout++;
Line 127... Line 148...
127
                                lcd_timeout++;
148
                                    }