Rev 382 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 382 | Rev 493 | ||
---|---|---|---|
Line 40... | Line 40... | ||
40 | //#if (location=="on")&&(cldc11=="on") |
40 | //#if (location=="on")&&(cldc11=="on") |
41 | ,LocationListener |
41 | ,LocationListener |
42 | //#endif |
42 | //#endif |
43 | { |
43 | { |
Line -... | Line 44... | ||
- | 44 | ||
- | 45 | //#expand public final static byte version_patch=%VERSION_PATCH%; |
|
- | 46 | //#expand public final static byte version_minor=%VERSION_MINOR%; |
|
- | 47 | //#expand public final static byte version_major=%VERSION_MAJOR%; |
|
- | 48 | ||
- | 49 | public final static String version_str="" +version_major + "." + version_minor +"" +(char)('a'+version_patch) ; |
|
44 | 50 | ||
45 | //#if (location=="on")&&(cldc11=="on") |
51 | //#if (location=="on")&&(cldc11=="on") |
46 | public void providerStateChanged(javax.microedition.location.LocationProvider p ,int i ) |
52 | public void providerStateChanged(javax.microedition.location.LocationProvider p ,int i ) |
47 | { |
53 | { |
Line 81... | Line 87... | ||
81 | // (...) |
87 | // (...) |
82 | } |
88 | } |
83 | } |
89 | } |
Line 84... | Line 90... | ||
84 | 90 | ||
85 | //#endif |
- | |
86 | //#expand public final static byte version_patch=%VERSION_PATCH%; |
- | |
87 | //#expand public final static byte version_minor=%VERSION_MINOR%; |
- | |
Line 88... | Line -... | ||
88 | //#expand public final static byte version_major=%VERSION_MAJOR%; |
- | |
Line -... | Line 91... | ||
- | 91 | //#endif |
|
Line 89... | Line 92... | ||
89 | 92 | ||
90 | public final static String version_str="" +version_major + "." + version_minor +"" +(char)('a'+version_patch) ; |
93 | |
Line 91... | Line 94... | ||
91 | 94 | // MENU Definitions |
|
Line 112... | Line 115... | ||
112 | 115 | ||
113 | //#if fileapi=="on" |
116 | //#if fileapi=="on" |
114 | DUBwiseFileAccess file_access; |
117 | DUBwiseFileAccess file_access; |
Line 115... | Line -... | ||
115 | //#endif |
- | |
116 | - | ||
117 | 118 | //#endif |
|
118 | 119 | ||
Line 119... | Line 120... | ||
119 | MixerManager mixer_manager; |
120 | MixerManager mixer_manager; |
Line 213... | Line 214... | ||
213 | 214 | ||
214 | 215 | ||
215 | private Image bg_img; |
216 | private Image bg_img; |
- | 217 | private Image lcd_img; |
|
- | 218 | private Image symbols_img; |
|
Line 216... | Line 219... | ||
216 | private Image lcd_img; |
219 | |
217 | private Image symbols_img; |
220 | private Image big_symbols_img; |
Line 273... | Line 276... | ||
273 | int y_off=0; |
276 | int y_off=0; |
274 | int spacer_small=0; |
277 | int spacer_small=0; |
275 | int spacer_medium=0; |
278 | int spacer_medium=0; |
276 | int spacer_large=0; |
279 | int spacer_large=0; |
Line 277... | Line -... | ||
277 | - | ||
278 | // int[] motor_test = {0,0,0,0}; |
- | |
279 | - | ||
280 | 280 | ||
281 | String[] menu_items; |
281 | String[] menu_items; |
282 | byte[] menu_actions; |
282 | byte[] menu_actions; |
283 | byte act_menu_select=0; |
283 | byte act_menu_select=0; |
284 | byte[] act_menu_select_bak; |
284 | byte[] act_menu_select_bak; |
Line 403... | Line 403... | ||
403 | 403 | ||
Line 404... | Line 404... | ||
404 | // mk & navi |
404 | // mk & navi |
405 | 405 | ||
406 | if ( mk.is_navi()||mk.is_mk() ) |
- | |
- | 406 | if ( mk.is_navi()||mk.is_mk() ) |
|
407 | { |
407 | { |
408 | 408 | tmp_menu_add("Big Symbols",ACTIONID_BIG_SYMBOLS); |
|
409 | tmp_menu_add(l(STRINGID_COCKPIT),ACTIONID_HORIZON); |
409 | tmp_menu_add(l(STRINGID_COCKPIT),ACTIONID_HORIZON); |
Line 1368... | Line 1368... | ||
1368 | return val; |
1368 | return val; |
1369 | } |
1369 | } |
1370 | */ |
1370 | */ |
Line -... | Line 1371... | ||
- | 1371 | ||
- | 1372 | ||
- | 1373 | public byte big_symbol_by_pos(byte pos) |
|
- | 1374 | { |
|
- | 1375 | switch(pos) |
|
- | 1376 | { |
|
- | 1377 | ||
- | 1378 | case 0: |
|
- | 1379 | if (mk.connected) |
|
- | 1380 | return (byte)((((mk.stats.bytes_in>>3)&1)==1)?2:3); |
|
- | 1381 | ||
- | 1382 | else |
|
- | 1383 | { |
|
- | 1384 | if (mk.mk_url.startsWith("btspp://")) |
|
- | 1385 | return 1; |
|
- | 1386 | else return 29; |
|
- | 1387 | ||
- | 1388 | ||
- | 1389 | } |
|
- | 1390 | ||
- | 1391 | ||
- | 1392 | case 1: |
|
- | 1393 | if (mk.SenderOkay()>0) |
|
- | 1394 | return 6; |
|
- | 1395 | else |
|
- | 1396 | return 29; |
|
- | 1397 | ||
- | 1398 | ||
- | 1399 | case 5: |
|
- | 1400 | return 4; |
|
- | 1401 | ||
- | 1402 | case 6: |
|
- | 1403 | if ( mk.UBatt()==-1) |
|
- | 1404 | return 29; |
|
- | 1405 | else |
|
- | 1406 | return (byte)(mk.UBatt()/100+10); |
|
- | 1407 | ||
- | 1408 | ||
- | 1409 | case 7: |
|
- | 1410 | if ( mk.UBatt()==-1) |
|
- | 1411 | return 29; |
|
- | 1412 | else |
|
- | 1413 | return (byte)((mk.UBatt()/10)%10+10); |
|
- | 1414 | ||
- | 1415 | case 8: |
|
- | 1416 | if ( mk.UBatt()==-1) |
|
- | 1417 | return 29; |
|
- | 1418 | else |
|
- | 1419 | return 9; |
|
- | 1420 | ||
- | 1421 | case 9: |
|
- | 1422 | if ( mk.UBatt()==-1) |
|
- | 1423 | return 29; |
|
- | 1424 | else |
|
- | 1425 | return (byte)((mk.UBatt())%10+10); |
|
- | 1426 | ||
- | 1427 | ||
- | 1428 | case 10: |
|
- | 1429 | return (byte)(((mk.stats.flying_time()/60)/10)%10+10); |
|
- | 1430 | case 11: |
|
- | 1431 | return (byte)(((mk.stats.flying_time()/60))%10+10); |
|
- | 1432 | ||
- | 1433 | case 12: |
|
- | 1434 | return 23; |
|
- | 1435 | ||
- | 1436 | case 13: |
|
- | 1437 | return (byte)(((mk.stats.flying_time()%60)/10)%10+10); |
|
- | 1438 | case 14: |
|
- | 1439 | return (byte)(((mk.stats.flying_time()%60))%10+10); |
|
- | 1440 | ||
- | 1441 | case 15: |
|
- | 1442 | return (byte)((mk.Alt()/10000)%10+10); |
|
- | 1443 | ||
- | 1444 | case 16: |
|
- | 1445 | return (byte)((mk.Alt()/1000)%10+10); |
|
- | 1446 | ||
- | 1447 | case 17: |
|
- | 1448 | return (byte)((mk.Alt()/100)%10+10); |
|
- | 1449 | case 18: |
|
- | 1450 | return (byte)((mk.Alt()/10)%10+10); |
|
- | 1451 | ||
- | 1452 | case 19: |
|
- | 1453 | return (byte)((mk.Alt())%10+10); |
|
- | 1454 | ||
- | 1455 | default: |
|
- | 1456 | return 29; |
|
- | 1457 | ||
- | 1458 | } |
|
- | 1459 | } |
|
- | 1460 | public void big_symbol_paint(Graphics g,byte x,byte y,byte tile) |
|
- | 1461 | { |
|
- | 1462 | int big_symbols_tile_width=big_symbols_img.getWidth()/10; |
|
- | 1463 | int big_symbols_tile_height=big_symbols_img.getHeight()/3; |
|
- | 1464 | ||
- | 1465 | byte tile_y=(byte)(tile/10); |
|
- | 1466 | tile%=10; |
|
- | 1467 | ||
- | 1468 | g.setClip(x*big_symbols_tile_width,y*big_symbols_tile_height,(big_symbols_tile_width),big_symbols_tile_height); |
|
Line 1371... | Line 1469... | ||
1371 | 1469 | g.drawImage(big_symbols_img,x*big_symbols_tile_width+(-tile)*(big_symbols_tile_width),(y-tile_y)*(big_symbols_tile_height), g.TOP | g.LEFT); |
|
1372 | 1470 | } |
|
1373 | 1471 | ||
1374 | public void symbol_paint(Graphics g,int x,int tile,int row) |
1472 | public void symbol_paint(Graphics g,int x,int tile,int row) |
Line 1469... | Line 1567... | ||
1469 | int symbol_left=0; |
1567 | int symbol_left=0; |
1470 | int symbol_spacer=5; |
1568 | int symbol_spacer=5; |
Line 1471... | Line 1569... | ||
1471 | 1569 | ||
1472 | 1570 | ||
1473 | 1571 | ||
Line 1474... | Line 1572... | ||
1474 | g.setClip(symbol_left,0,symbols_img_tile_width,symbols_img_tile_height);; |
1572 | // g.setClip(symbol_left,0,symbols_img_tile_width,symbols_img_tile_height);; |
1475 | if (mk.connected) |
1573 | if (mk.connected) |
Line 1753... | Line 1851... | ||
1753 | g.drawString(mk.get_buff(pos_y) ,0,y_off,Graphics.TOP | Graphics.LEFT); |
1851 | g.drawString(mk.get_buff(pos_y) ,0,y_off,Graphics.TOP | Graphics.LEFT); |
1754 | y_off-=spacer_small; |
1852 | y_off-=spacer_small; |
1755 | } |
1853 | } |
1756 | break; |
1854 | break; |
Line -... | Line 1855... | ||
- | 1855 | ||
- | 1856 | case STATEID_BIG_SYMBOLS: |
|
- | 1857 | int act_tile=0; |
|
- | 1858 | for (int sx=0;sx<5;sx++) |
|
- | 1859 | for (int sy=0;sy<4;sy++) |
|
- | 1860 | big_symbol_paint(g,(byte)sx,(byte)sy,big_symbol_by_pos((byte)(sx+sy*5) )); |
|
- | 1861 | ||
- | 1862 | ||
- | 1863 | // g.drawImage(big_symbols_img,0,0, g.TOP | g.LEFT); |
|
1757 | 1864 | break; |
|
1758 | case STATEID_SUCCESS_MSG: |
1865 | case STATEID_SUCCESS_MSG: |
1759 | case STATEID_ERROR_MSG: |
1866 | case STATEID_ERROR_MSG: |
1760 | if (err_img!=null) |
1867 | if (err_img!=null) |
1761 | { |
1868 | { |
Line 2430... | Line 2537... | ||
2430 | // graph_data=null; |
2537 | // graph_data=null; |
Line 2431... | Line 2538... | ||
2431 | 2538 | ||
2432 | act_menu_select_bak[state]=act_menu_select; |
2539 | act_menu_select_bak[state]=act_menu_select; |
Line 2433... | Line -... | ||
2433 | act_menu_select=act_menu_select_bak[next_state]; |
- | |
2434 | - | ||
2435 | - | ||
2436 | - | ||
2437 | /* |
- | |
2438 | // tasks on state exit |
- | |
2439 | switch(next_state) |
- | |
2440 | { |
- | |
2441 | case STATEID_SETTINGSMENU: |
- | |
2442 | - | ||
2443 | break; |
- | |
2444 | } |
2540 | act_menu_select=act_menu_select_bak[next_state]; |
2445 | */ |
2541 | |
Line 2446... | Line 2542... | ||
2446 | // prepare next state |
2542 | // prepare next state |
Line -... | Line 2543... | ||
- | 2543 | switch(next_state) |
|
- | 2544 | ||
- | 2545 | { |
|
2447 | switch(next_state) |
2546 | |
2448 | 2547 | case STATEID_BIG_SYMBOLS: |
|
2449 | { |
2548 | big_symbols_img=DUBwiseHelper.scaleImage(symbols_img,(this.getWidth()/5)*10); |
2450 | 2549 | break; |
|
Line 2814... | Line 2913... | ||
2814 | //#endif |
2913 | //#endif |
2815 | public void process_action(byte actionid) |
2914 | public void process_action(byte actionid) |
2816 | { |
2915 | { |
2817 | switch(actionid) |
2916 | switch(actionid) |
2818 | { |
2917 | { |
- | 2918 | case ACTIONID_BIG_SYMBOLS: |
|
- | 2919 | chg_state(STATEID_BIG_SYMBOLS); |
|
- | 2920 | break; |
|
Line 2819... | Line 2921... | ||
2819 | 2921 | ||
2820 | case ACTIONID_SELECT_MIXER: |
2922 | case ACTIONID_SELECT_MIXER: |
2821 | chg_state(STATEID_SELECT_MIXER); |
2923 | chg_state(STATEID_SELECT_MIXER); |