Subversion Repositories FlightCtrl

Rev

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

Rev 390 Rev 403
Line 1... Line 1...
1
/***************************************************************
1
/***************************************************************
2
 *
2
 *
3
 * minimal canvas to test Abstraction layer on various Phones
3
 * minimal canvas to test Abstraction layer on various Phones
4
 *                                                          
4
 *                                                          
5
 * Author:        Marcus -LiGi- Bueschleb                    
5
 * Author:        Marcus -LiGi- Bueschleb                    
6
 * Project-Start: 9/2007                                    
6
 *
7
 * Mailto:        ligi@smart4mobile.de                      
-
 
8
 * Licence:       Creative Commons / Non Commercial
-
 
9
 *                ( see README for exact terms of usage)
-
 
10
 * Big Up:        Holger&Ingo                                
7
 * see README for further Infos
-
 
8
 *
11
 ***************************************************************/
9
 ***************************************************************/
Line 12... Line 10...
12
 
10
 
13
import javax.microedition.lcdui.*;
11
import javax.microedition.lcdui.*;
Line 124... Line 122...
124
 
122
 
125
 
123
 
-
 
124
 
126
 
125
    public void paint_lcd(Graphics g,boolean bottomup)
Line 127... Line 126...
127
    public void paint_lcd(Graphics g,boolean bottomup)
126
    {
128
    {
127
 
129
        int y;
128
        int y;
Line 224... Line 223...
224
    {
223
    {
Line 225... Line 224...
225
 
224
 
226
 
225
 
-
 
226
        while(true)
-
 
227
            {
227
        while(true)
228
                try {
228
            {
229
 
Line 229... Line 230...
229
                repaint();
230
                repaint();
230
                serviceRepaints();
231
                serviceRepaints();
Line 242... Line 243...
242
                        if (motor_test_sel_all)
243
                        if (motor_test_sel_all)
243
                            for (int m=0;m<4;m++)
244
                            for (int m=0;m<4;m++)
244
                                {
245
                                {
245
                                    motor_test[m]+=act_motor_increase;
246
                                    motor_test[m]+=act_motor_increase;
246
                                    if (motor_test[m]<0)motor_test[m]=0;
247
                                    if (motor_test[m]<0)motor_test[m]=0;
-
 
248
                                    if (motor_test[m]>255)motor_test[m]=255;
247
                                }
249
                                }
248
                        else
250
                        else
249
                            {
251
                            {
250
                                motor_test[act_motor]+=act_motor_increase;
252
                                motor_test[act_motor]+=act_motor_increase;
251
                                if (motor_test[act_motor]<0)motor_test[act_motor]=0;
253
                                if (motor_test[act_motor]<0) motor_test[act_motor]=0;
-
 
254
                                if (motor_test[act_motor]>255) motor_test[act_motor]=255;
252
                            }
255
                            }
Line 253... Line 256...
253
 
256
 
254
                        mk.motor_test(motor_test);
257
                        mk.motor_test(motor_test);
Line 336... Line 339...
336
 
339
 
Line -... Line 340...
-
 
340
       
337
       
341
                       
338
                       
342
                sleeptime=1000/ 15 - (int) (System.currentTimeMillis()- loopStartTime);
339
                sleeptime=1000/ 15 - (int) (System.currentTimeMillis()- loopStartTime);
343
               
Line 340... Line 344...
340
               
344
 
341
               
345
 
342
                if (sleeptime<0)
346
                if (sleeptime<0)
343
                    sleeptime=100; // everyone has fi sleep
347
                    sleeptime=100; // everyone has fi sleep
344
               
348
               
Line -... Line 349...
-
 
349
                try { Thread.sleep(sleeptime); }
-
 
350
                catch (Exception e)
-
 
351
                    {
-
 
352
                        err="Problem Sleeping ";
-
 
353
                    }
345
                try { Thread.sleep(sleeptime); }
354
 
346
                catch (Exception e)
355
                }