Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 302 → Rev 303

/branches/ligi_j2me/src/MKWatchDog.java
1,13 → 1,10
/**********************************************************************************************************************************
* Statistics from MK-Connection ( needed for 2. Thread and Readability of Code ) *
* *
* Author: Marcus -LiGi- Bueschleb *
* Project-Start: 9/2007 *
* Version: 0.07 *
* Mailto: ligi@smart4mobile.de *
* Licence: Creative Commons / Non Commercial *
* Big Up: Holger&Ingo *
*********************************************************************************************************************************/
/**************************************
*
* Author: Marcus -LiGi- Bueschleb
* Project-Start: 9/2007
* Mailto: ligi@smart4mobile.de
*
**************************************/
 
public class MKWatchDog
implements Runnable
16,6 → 13,7
MKCommunicator mk=null;
 
int debug_data_count_buff=-123;
int lcd_data_count_buff=-123;
 
public MKWatchDog(MKCommunicator _mk)
{
27,24 → 25,28
{
while(true)
{
try { Thread.sleep(1500); }
try { Thread.sleep(1000); }
catch (Exception e) { }
if (mk.connected)
if (mk.connected&&(!mk.force_disconnect))
{
if (debug_data_count_buff==mk.debug_data_count)
mk.close_connections(false);
 
if ((lcd_data_count_buff==mk.lcd_data_count)||(mk.lcd_data_count==0))
mk.LCD.trigger_LCD();
debug_data_count_buff=mk.debug_data_count;
lcd_data_count_buff=mk.lcd_data_count;
if (mk.version.major==-1)
mk.get_version();
if (mk.lcd_data_count==0)
mk.LCD.trigger_LCD();
}
else
{
if (mk.params.field[0]==-1)
mk.get_params(1);
}
 
}
}