Rev 245 | Rev 255 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 245 | Rev 252 | ||
---|---|---|---|
Line 455... | Line 455... | ||
455 | long sleeptime=0; |
455 | long sleeptime=0; |
456 | // ticked thing |
456 | // ticked thing |
Line 457... | Line 457... | ||
457 | 457 | ||
Line -... | Line 458... | ||
- | 458 | frame_pos++; |
|
458 | frame_pos++; |
459 | |
459 | 460 | // handle Device Change |
|
460 | if (mk.ufo_prober.change_notify) |
461 | if (mk.ufo_prober.change_notify) |
461 | { |
462 | { |
462 | mk.ufo_prober.change_notify=false; |
463 | mk.ufo_prober.change_notify=false; |
Line 528... | Line 529... | ||
528 | 529 | ||
529 | case STATEID_ERROR_MSG: |
530 | case STATEID_ERROR_MSG: |
530 | lcd_lines[0]=""+mk.error_str; |
531 | lcd_lines[0]=""+mk.error_str; |
Line -... | Line 532... | ||
- | 532 | break; |
|
- | 533 | ||
- | 534 | ||
- | 535 | case STATEID_PARAM_MASSWRITE: |
|
- | 536 | ||
- | 537 | if (param_masswrite_write_pos==5) |
|
- | 538 | { |
|
- | 539 | nextstate=STATEID_PARAM_MENU; |
|
- | 540 | success_msg="Parameter Write OK"; |
|
- | 541 | chg_state(STATEID_SUCCESS_MSG); |
|
- | 542 | } |
|
- | 543 | else |
|
- | 544 | { |
|
- | 545 | if (param_masswrite_write_pos!=0) |
|
- | 546 | try { Thread.sleep(2000); } |
|
- | 547 | catch (Exception e) |
|
- | 548 | {debug.log("Problem Sleeping "); } |
|
- | 549 | ||
- | 550 | lcd_lines[0]="Writing Params"; |
|
- | 551 | lcd_lines[1]=DUBwiseHelper.pound_progress(param_masswrite_write_pos,5); |
|
- | 552 | ||
- | 553 | ||
- | 554 | mk.params.set_by_mk_data(params2masswrite[param_masswrite_write_pos]); |
|
- | 555 | mk.params.act_paramset=param_masswrite_write_pos; |
|
- | 556 | mk.write_params(mk.params.act_paramset); |
|
- | 557 | ||
- | 558 | param_masswrite_write_pos++; |
|
531 | break; |
559 | } |
532 | 560 | break; |
|
533 | case STATEID_READ_PARAMS: |
561 | case STATEID_READ_PARAMS: |
534 | if (mk.watchdog.act_paramset==5) |
562 | if (mk.watchdog.act_paramset==5) |
535 | { |
563 | { |
Line 565... | Line 593... | ||
565 | 593 | ||
566 | } |
594 | } |
567 | catch (Exception e) |
595 | catch (Exception e) |
568 | { } |
596 | { } |
- | 597 | // chg_state(STATEID_COPY_PARAMS); |
|
569 | // chg_state(STATEID_COPY_PARAMS); |
598 | |
570 | nextstate=STATEID_HANDLE_PARAMS; |
599 | nextstate=STATEID_PARAM_MENU; |
571 | success_msg="Parameter Copy OK"; |
600 | success_msg="Parameter Copy OK"; |
Line 572... | Line 601... | ||
572 | chg_state(STATEID_SUCCESS_MSG); |
601 | chg_state(STATEID_SUCCESS_MSG); |
573 | 602 | ||
574 | } |
603 | } |
575 | else |
- | |
576 | { |
604 | else |
- | 605 | { |
|
- | 606 | select_paramset4edit=true; |
|
577 | chg_state(STATEID_SELECT_PARAMSET); |
607 | chg_state(STATEID_SELECT_PARAMSET); |
Line 578... | Line 608... | ||
578 | select_paramset4edit=true; |
608 | |
579 | } |
609 | } |
580 | 610 | ||
581 | } |
611 | } |
582 | else |
612 | else |
- | 613 | { |
|
Line 583... | Line 614... | ||
583 | { |
614 | lcd_lines[0]="Reading Settings "; |
584 | lcd_lines[0]="Reading Settings "; |
615 | lcd_lines[1]=DUBwiseHelper.pound_progress(mk.watchdog.act_paramset,5); |
585 | lcd_lines[1]=mk.watchdog.act_paramset+"/5 |"+ (mk.watchdog.act_paramset>0?"#":"_") + (mk.watchdog.act_paramset>1?"#":"_") + (mk.watchdog.act_paramset>2?"#":"_")+ (mk.watchdog.act_paramset>3?"#":"_")+ (mk.watchdog.act_paramset>4?"#":"_") + "| "; |
616 | |
586 | 617 | ||
Line 726... | Line 757... | ||
726 | { |
757 | { |
Line 727... | Line 758... | ||
727 | 758 | ||
728 | switch (settings.act_skin) |
759 | switch (settings.act_skin) |
729 | { |
760 | { |
730 | case SKINID_DARK: |
761 | case SKINID_DARK: |
Line 731... | Line 762... | ||
731 | return 0x000000; |
762 | return BG_COLOR_SKIN_DARK; |
732 | 763 | ||
733 | default: |
764 | default: |
734 | case SKINID_LIGHT: |
765 | case SKINID_LIGHT: |
735 | return 0xFFFFFF; |
766 | return BG_COLOR_SKIN_LIGHT; |
Line 736... | Line 767... | ||
736 | } |
767 | } |
737 | } |
768 | } |
Line 738... | Line 769... | ||
738 | 769 | ||
739 | 770 | ||
740 | public int skin_fg_color() |
771 | public int skin_fg_color() |
741 | { |
772 | { |
Line 742... | Line 773... | ||
742 | 773 | ||
743 | switch (settings.act_skin) |
774 | switch (settings.act_skin) |
744 | { |
775 | { |
745 | case SKINID_DARK: |
776 | case SKINID_DARK: |
746 | return 0xFFFFFF; |
777 | return FG_COLOR_SKIN_DARK; |
Line 747... | Line 778... | ||
747 | 778 | ||
Line 778... | Line 809... | ||
778 | 809 | ||
779 | canvas_width=this.getWidth(); |
810 | canvas_width=this.getWidth(); |
Line 780... | Line -... | ||
780 | canvas_height=this.getHeight(); |
- | |
781 | 811 | canvas_height=this.getHeight(); |
|
782 | 812 | ||
783 | 813 | ||
784 | if (debug.showing) |
814 | if (debug.showing) |
785 | { |
815 | { |
Line 792... | Line 822... | ||
792 | { |
822 | { |
793 | if (settings.fullscreen) setFullScreenMode(settings.fullscreen); |
823 | if (settings.fullscreen) setFullScreenMode(settings.fullscreen); |
794 | firstrun=false; |
824 | firstrun=false; |
795 | } |
825 | } |
796 | y_off=0; |
826 | y_off=0; |
797 | - | ||
798 | 827 | ||
799 | - | ||
800 | try { |
828 | try { |
Line 801... | Line 829... | ||
801 | 829 | ||
Line 844... | Line 872... | ||
844 | int symbol_left=0; |
872 | int symbol_left=0; |
845 | int symbol_spacer=5; |
873 | int symbol_spacer=5; |
Line 846... | Line 874... | ||
846 | 874 | ||
847 | g.setClip(symbol_left,0,symbols_img_tile_width,symbols_img_tile_height);; |
875 | g.setClip(symbol_left,0,symbols_img_tile_width,symbols_img_tile_height);; |
848 | if (mk.connected) |
876 | if (mk.connected) |
Line 849... | Line 877... | ||
849 | symbol_paint(g,symbol_left,(((mk.stats.bytes_in>>3)&1)==1)?2:3,0); |
877 | symbol_paint(g,symbol_left,(((mk.stats.bytes_in>>3)&1)==1)?2:3,0); |
- | 878 | ||
- | 879 | else |
|
850 | 880 | { |
|
- | 881 | if (mk.mk_url.startsWith("btspp://")) |
|
- | 882 | symbol_paint(g,symbol_left,1,0); |
|
- | 883 | ||
851 | else |
884 | |
Line 852... | Line 885... | ||
852 | symbol_paint(g,symbol_left,1,0); |
885 | } |
Line 879... | Line 912... | ||
879 | 912 | ||
Line 880... | Line 913... | ||
880 | // g.drawString("" + (mk.UBatt()/10) + "," +(mk.UBatt()%10)+"V" , symbol_left,y_off,Graphics.TOP | Graphics.LEFT); |
913 | // g.drawString("" + (mk.UBatt()/10) + "," +(mk.UBatt()%10)+"V" , symbol_left,y_off,Graphics.TOP | Graphics.LEFT); |
881 | 914 | ||
882 | 915 | ||
883 | //symbol_left+= g.getFont().stringWidth("88,8V");//; |
916 | //symbol_left+= g.getFont().stringWidth("88,8V");//; |
884 | 917 | /* |
|
885 | symbol_paint(g,symbol_left,6,0); |
918 | symbol_paint(g,symbol_left,6,0); |
886 | symbol_left+=5*(symbols_img_tile_width)/4; |
919 | symbol_left+=5*(symbols_img_tile_width)/4; |
- | 920 | */ |
|
- | 921 | if (mk.SenderOkay()>0) |
|
- | 922 | { |
|
887 | 923 | symbol_paint(g,symbol_left,6,0); |
|
888 | if (mk.SenderOkay()!=0) |
924 | symbol_left+=5*(symbols_img_tile_width)/4; |
Line 889... | Line 925... | ||
889 | { |
925 | |
890 | symbol_paint(g,symbol_left,(mk.SenderOkay())/100,1); |
926 | /*symbol_paint(g,symbol_left,(mk.SenderOkay())/100,1); |
891 | symbol_left+=(symbols_img_tile_width); |
927 | symbol_left+=(symbols_img_tile_width); |
892 | 928 | ||
893 | symbol_paint(g,symbol_left,(mk.SenderOkay()/10)%10,1); |
929 | symbol_paint(g,symbol_left,(mk.SenderOkay()/10)%10,1); |
Line 894... | Line 930... | ||
894 | symbol_left+=(symbols_img_tile_width); |
930 | symbol_left+=(symbols_img_tile_width);*/ |
Line 895... | Line 931... | ||
895 | } |
931 | } |
Line 1253... | Line 1289... | ||
1253 | paint_menu(g); |
1289 | paint_menu(g); |
1254 | break; |
1290 | break; |
1255 | case STATEID_STRINGINPUT: |
1291 | case STATEID_STRINGINPUT: |
1256 | case STATEID_ABOUT: |
1292 | case STATEID_ABOUT: |
1257 | case STATEID_IPINPUT: |
1293 | case STATEID_IPINPUT: |
1258 | - | ||
1259 | paint_lcd(g); |
1294 | case STATEID_PARAM_MASSWRITE: |
1260 | break; |
- | |
1261 | - | ||
1262 | case STATEID_READ_PARAMS: |
1295 | case STATEID_READ_PARAMS: |
1263 | paint_lcd(g); |
- | |
1264 | break; |
- | |
1265 | - | ||
1266 | - | ||
1267 | //#if bluetooth=="on" |
1296 | //#if bluetooth=="on" |
1268 | case STATEID_SCANNING: |
1297 | case STATEID_SCANNING: |
- | 1298 | //#endif |
|
1269 | paint_lcd(g); |
1299 | paint_lcd(g); |
1270 | break; |
1300 | break; |
- | 1301 | ||
- | 1302 | ||
1271 | //#endif |
1303 | |
1272 | case STATEID_RAWDEBUG: |
1304 | case STATEID_RAWDEBUG: |
1273 | g.setFont(f2); |
1305 | g.setFont(f2); |
1274 | rawdebug_off_y=0; |
1306 | rawdebug_off_y=0; |
1275 | if ((rawdebug_cursor_y+3)*spacer1>canvas_height) |
1307 | if ((rawdebug_cursor_y+3)*spacer1>canvas_height) |
1276 | rawdebug_off_y=((rawdebug_cursor_y+3)*spacer1-canvas_height)/spacer1; |
1308 | rawdebug_off_y=((rawdebug_cursor_y+3)*spacer1-canvas_height)/spacer1; |
Line 1723... | Line 1755... | ||
1723 | mk.user_intent= USER_INTENT_EXTERNAL_CONTROL; |
1755 | mk.user_intent= USER_INTENT_EXTERNAL_CONTROL; |
1724 | keycontrol_exit=0; |
1756 | keycontrol_exit=0; |
1725 | break; |
1757 | break; |
Line -... | Line 1758... | ||
- | 1758 | ||
- | 1759 | ||
- | 1760 | case STATEID_PARAM_MASSWRITE: |
|
- | 1761 | mk.user_intent=USER_INTENT_PARAMS; |
|
- | 1762 | lcd_lines=new String[2]; |
|
- | 1763 | lcd_lines[0]=""; |
|
Line 1726... | Line 1764... | ||
1726 | 1764 | lcd_lines[1]=""; |
|
1727 | 1765 | break; |
|
1728 | 1766 | ||
1729 | case STATEID_READ_PARAMS: |
1767 | case STATEID_READ_PARAMS: |
1730 | mk.user_intent=USER_INTENT_PARAMS; |
1768 | mk.user_intent=USER_INTENT_PARAMS; |
Line 1731... | Line 1769... | ||
1731 | lcd_lines=new String[2]; |
1769 | lcd_lines=new String[2]; |
Line 1732... | Line 1770... | ||
1732 | lcd_lines[0]="Reading Settings "; |
1770 | lcd_lines[0]="Reading Settings "; |
Line 1912... | Line 1950... | ||
1912 | 1950 | ||
Line -... | Line 1951... | ||
- | 1951 | ||
- | 1952 | ||
- | 1953 | public final static String PARAM_SAVE_STORE_NAME="MKParamsV1"; |
|
- | 1954 | ||
1913 | 1955 | ||
1914 | 1956 | int[][] params2masswrite; |
|
1915 | public final static String PARAM_SAVE_STORE_NAME="MKParamsV1"; |
1957 | int param_masswrite_write_pos; |
1916 | 1958 | ||
1917 | public void process_action(byte actionid) |
1959 | public void process_action(byte actionid) |
Line 1925... | Line 1967... | ||
1925 | 1967 | ||
1926 | if (recStore.getNumRecords()==1) |
1968 | if (recStore.getNumRecords()==1) |
1927 | { |
1969 | { |
1928 | ByteArrayInputStream bin = new ByteArrayInputStream(recStore.getRecord(1)); |
1970 | ByteArrayInputStream bin = new ByteArrayInputStream(recStore.getRecord(1)); |
- | 1971 | DataInputStream din = new DataInputStream( bin ); |
|
- | 1972 | ||
- | 1973 | ||
- | 1974 | // params_version |
|
- | 1975 | if ( mk.params.params_version!=din.readInt()) |
|
- | 1976 | { |
|
- | 1977 | mk.error_str="Params Incompatible"; |
|
- | 1978 | chg_state(STATEID_ERROR_MSG); |
|
- | 1979 | break; |
|
- | 1980 | } |
|
- | 1981 | ||
- | 1982 | int p_length=din.readInt(); |
|
- | 1983 | params2masswrite=new int[5][p_length]; |
|
- | 1984 | ||
- | 1985 | for ( int p=0;p<5;p++) |
|
- | 1986 | for ( int p_pos=0;p_pos<p_length;p_pos++) |
|
- | 1987 | params2masswrite[p][p_pos]=din.readInt(); |
|
- | 1988 | ||
- | 1989 | param_masswrite_write_pos=0; |
|
1929 | DataInputStream din = new DataInputStream( bin ); |
1990 | chg_state(STATEID_PARAM_MASSWRITE); |
1930 | } |
1991 | } |
1931 | else throw(new Exception("rms err")); |
1992 | else throw(new Exception("rms err")); |
1932 | recStore.closeRecordStore(); |
1993 | recStore.closeRecordStore(); |
1933 | } |
1994 | } |
Line 2547... | Line 2608... | ||
2547 | if (act_menu_select==5) // back |
2608 | if (act_menu_select==5) // back |
2548 | { |
2609 | { |
2549 | if (select_paramset4edit) |
2610 | if (select_paramset4edit) |
2550 | chg_state(STATEID_PARAM_MENU); |
2611 | chg_state(STATEID_PARAM_MENU); |
2551 | else |
2612 | else |
2552 | chg_state(STATEID_HANDLE_PARAMS); |
2613 | chg_state(STATEID_HANDLE_PARAMS); // from save as |
Line 2553... | Line 2614... | ||
2553 | 2614 | ||
2554 | } |
2615 | } |
2555 | else |
2616 | else |
2556 | { |
2617 | { |