Rev 222 | Rev 224 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 222 | Rev 223 | ||
---|---|---|---|
Line 23... | Line 23... | ||
23 | DUBwiseFileAccess file_access; |
23 | DUBwiseFileAccess file_access; |
24 | //#endif |
24 | //#endif |
Line 25... | Line 25... | ||
25 | 25 | ||
Line -... | Line 26... | ||
- | 26 | String act_input_str=" "; |
|
- | 27 | ||
- | 28 | ||
26 | String act_input_str=" "; |
29 | // for dual use of states |
- | 30 | boolean select_paramset4edit; |
|
- | 31 | boolean ipinput4proxy; |
|
27 | 32 | ||
28 | boolean ipinput4proxy; |
33 | |
Line 29... | Line 34... | ||
29 | byte ipinput_pos=0; |
34 | byte ipinput_pos=0; |
30 | int[] act_edit_ip; |
35 | int[] act_edit_ip; |
Line 43... | Line 48... | ||
43 | public org.ligi.ufo.MKCommunicator mk=null; |
48 | public org.ligi.ufo.MKCommunicator mk=null; |
44 | // private MKStatistics mk_stat=null; |
49 | // private MKStatistics mk_stat=null; |
45 | private MKParamsEditor params_editor=null; |
50 | private MKParamsEditor params_editor=null; |
46 | private MKParamsEditor settings_editor=null; |
51 | private MKParamsEditor settings_editor=null; |
47 | public DUBwiseDebug debug=null; |
52 | public DUBwiseDebug debug=null; |
48 | public DUBwiseHelper helper=null; |
- | |
Line 49... | Line 53... | ||
49 | 53 | ||
50 | 54 | ||
51 | //#if voice_mode!="no_voice" |
55 | //#if voice_mode!="no_voice" |
Line 77... | Line 81... | ||
77 | public int[] graph_sources={0,1,2,3}; |
81 | public int[] graph_sources={0,1,2,3}; |
78 | public String[] graph_names={"nick int","roll int","nick acc","roll acc"}; |
82 | public String[] graph_names={"nick int","roll int","nick acc","roll acc"}; |
79 | public int[][] graph_data; |
83 | public int[][] graph_data; |
80 | public int graph_offset=0; |
84 | public int graph_offset=0; |
Line 81... | Line 85... | ||
81 | 85 | ||
82 | public int lcd_char_width=0; |
86 | // public int lcd_char_width=0; |
Line 83... | Line 87... | ||
83 | public int lcd_char_height=0; |
87 | public int lcd_char_height=0; |
Line 84... | Line 88... | ||
84 | 88 | ||
Line 96... | Line 100... | ||
96 | boolean quit=false; |
100 | boolean quit=false; |
Line 97... | Line 101... | ||
97 | 101 | ||
Line 98... | Line 102... | ||
98 | int bg_offset=0; |
102 | int bg_offset=0; |
99 | 103 | ||
Line 100... | Line 104... | ||
100 | // variable to hold the current state |
104 | // variable to hold the current state |
Line 101... | Line 105... | ||
101 | public byte state=-1; |
105 | public byte state=STATEID_INITIAL; |
102 | 106 | ||
Line 110... | Line 114... | ||
110 | 114 | ||
111 | 115 | ||
112 | String[] menu_items; |
116 | String[] menu_items; |
113 | byte[] menu_actions; |
- | |
- | 117 | byte[] menu_actions; |
|
114 | int act_menu_select=0; |
118 | int act_menu_select=0; |
Line 115... | Line 119... | ||
115 | 119 | int[] act_menu_select_bak; |
|
Line 231... | Line 235... | ||
231 | tmp_items[setup_pos++] ="Quit"; |
235 | tmp_items[setup_pos++] ="Quit"; |
Line 232... | Line 236... | ||
232 | 236 | ||
233 | 237 | ||
- | 238 | byte[] tmp_actions_fin=new byte[setup_pos]; |
|
- | 239 | String[] tmp_items_fin=new String[setup_pos]; |
|
- | 240 | ||
Line 234... | Line 241... | ||
234 | byte[] tmp_actions_fin=new byte[setup_pos]; |
241 | if (setup_pos<act_menu_select) |
235 | String[] tmp_items_fin=new String[setup_pos]; |
242 | act_menu_select=0; |
236 | 243 | ||
237 | for ( int tmp_p=0;tmp_p<setup_pos;tmp_p++) |
244 | for ( int tmp_p=0;tmp_p<setup_pos;tmp_p++) |
238 | { |
245 | { |
239 | tmp_actions_fin[tmp_p]=tmp_actions[tmp_p]; |
- | |
- | 246 | tmp_actions_fin[tmp_p]=tmp_actions[tmp_p]; |
|
240 | tmp_items_fin[tmp_p] =tmp_items[tmp_p]; |
247 | tmp_items_fin[tmp_p] =tmp_items[tmp_p]; |
241 | } |
248 | } |
Line 242... | Line 249... | ||
242 | act_menu_select=0; |
249 | |
Line 301... | Line 308... | ||
301 | 308 | ||
Line 302... | Line 309... | ||
302 | // int lcd_top=25; |
309 | // int lcd_top=25; |
303 | 310 | ||
304 | public void paint_lcd(Graphics g) |
- | |
305 | { |
311 | public void paint_lcd(Graphics g) |
306 | - | ||
307 | int y; |
312 | { |
308 | 313 | int y; |
|
309 | // int lcd_top= (state==STATEID_EDIT_PARAMS?0:25); |
314 | // int lcd_top= (state==STATEID_EDIT_PARAMS?0:25); |
310 | //int lcd_top= 25; |
- | |
311 | max_lines=(canvas_height-25/*lcd_top*/)/lcd_char_height; |
315 | //int lcd_top= 25; |
312 | 316 | max_lines=(canvas_height-25/*lcd_top*/)/lcd_char_height; |
|
Line 313... | Line 317... | ||
313 | int spacer_left_right=(canvas_width-(20*(lcd_img.getWidth()/222)))/2; |
317 | int spacer_left_right=(canvas_width-(20*(lcd_img.getWidth()/222)))/2; |
Line 323... | Line 327... | ||
323 | for (int pos=0;pos<20;pos++) |
327 | for (int pos=0;pos<20;pos++) |
324 | { |
328 | { |
325 | /*if (!bottomup) |
329 | /*if (!bottomup) |
326 | y=i*lcd_char_height; |
330 | y=i*lcd_char_height; |
327 | else*/ |
331 | else*/ |
328 | y=canvas_height-(display_lines-i)*lcd_char_height; |
332 | y=canvas_height-(display_lines-i)*lcd_char_height; |
Line 329... | Line 333... | ||
329 | 333 | ||
330 | g.setClip((lcd_img.getWidth()/222)*pos+spacer_left_right,y,(lcd_img.getWidth()/222),lcd_img.getHeight()); |
334 | g.setClip((lcd_img.getWidth()/222)*pos+spacer_left_right,y,(lcd_img.getWidth()/222),lcd_img.getHeight()); |
331 | g.drawImage(lcd_img,spacer_left_right+(lcd_img.getWidth()/222)*pos-((pos<lcd_lines[i+lcd_off].length()?lcd_lines[i+lcd_off].charAt(pos):' ')-' ')*(lcd_img.getWidth()/222),y,g.TOP | g.LEFT); |
- | |
332 | 335 | g.drawImage(lcd_img,spacer_left_right+(lcd_img.getWidth()/222)*pos-((pos<lcd_lines[i+lcd_off].length()?lcd_lines[i+lcd_off].charAt(pos):' ')-' ')*(lcd_img.getWidth()/222),y,g.TOP | g.LEFT); |
|
333 | } |
336 | } |
Line 334... | Line 337... | ||
334 | } |
337 | } |
335 | 338 | ||
Line 352... | Line 355... | ||
352 | case SKINID_LIGHT: |
355 | case SKINID_LIGHT: |
353 | lcd_img=Image.createImage("/lcd_blue.png"); |
356 | lcd_img=Image.createImage("/lcd_blue.png"); |
354 | if (settings.do_scrollbg) bg_img=Image.createImage("/clouds.jpg"); |
357 | if (settings.do_scrollbg) bg_img=Image.createImage("/clouds.jpg"); |
355 | break; |
358 | break; |
356 | } |
359 | } |
357 | lcd_char_width=lcd_img.getWidth()/222; |
360 | // lcd_char_width=lcd_img.getWidth()/222; |
358 | lcd_char_height=lcd_img.getHeight(); |
361 | lcd_char_height=lcd_img.getHeight(); |
359 | } |
362 | } |
Line 360... | Line 363... | ||
360 | 363 | ||
361 | catch (Exception e) |
364 | catch (Exception e) |
Line 387... | Line 390... | ||
387 | 390 | ||
388 | // construct |
391 | // construct |
389 | public DUBwiseCanvas(DUBwise _root) |
392 | public DUBwiseCanvas(DUBwise _root) |
Line -... | Line 393... | ||
- | 393 | { |
|
- | 394 | ||
- | 395 | act_menu_select_bak=new int[LAST_STATEID]; |
|
390 | { |
396 | for (int i=0;i<LAST_STATEID;i++) |
391 | 397 | act_menu_select_bak[i]=0; |
|
392 | //#if fileapi=="on" |
398 | //#if fileapi=="on" |
Line 393... | Line 399... | ||
393 | file_access=new DUBwiseFileAccess(this); |
399 | file_access=new DUBwiseFileAccess(this); |
Line 394... | Line 400... | ||
394 | //#endif |
400 | //#endif |
395 | - | ||
396 | root=_root; |
401 | |
397 | 402 | root=_root; |
|
398 | mk = new org.ligi.ufo.MKCommunicator(); |
403 | |
399 | helper = new DUBwiseHelper(); |
404 | mk = new org.ligi.ufo.MKCommunicator(); |
Line 507... | Line 512... | ||
507 | lcd_lines[0]=""+mk.error_str; |
512 | lcd_lines[0]=""+mk.error_str; |
508 | break; |
513 | break; |
Line 509... | Line 514... | ||
509 | 514 | ||
510 | case STATEID_READ_PARAMS: |
515 | case STATEID_READ_PARAMS: |
- | 516 | if (mk.watchdog.act_paramset==5) |
|
511 | if (mk.watchdog.act_paramset==5) |
517 | { |
- | 518 | chg_state(STATEID_SELECT_PARAMSET); |
|
- | 519 | select_paramset4edit=true; |
|
512 | chg_state(STATEID_SELECT_PARAMSET); |
520 | } |
513 | else |
521 | else |
514 | { |
522 | { |
515 | lcd_lines[0]="Reading Settings "; |
523 | lcd_lines[0]="Reading Settings "; |
Line 565... | Line 573... | ||
565 | if (ipinput4proxy) |
573 | if (ipinput4proxy) |
566 | act_edit_ip=settings.act_proxy_ip; |
574 | act_edit_ip=settings.act_proxy_ip; |
567 | else |
575 | else |
568 | act_edit_ip=settings.act_conn_ip; |
576 | act_edit_ip=settings.act_conn_ip; |
Line 569... | Line 577... | ||
569 | 577 | ||
Line 570... | Line 578... | ||
570 | lcd_lines[1]=helper.ip_str(act_edit_ip,true); |
578 | lcd_lines[1]=DUBwiseHelper.ip_str(act_edit_ip,true); |
571 | 579 | ||
572 | 580 | ||
Line 680... | Line 688... | ||
680 | case SKINID_LIGHT: |
688 | case SKINID_LIGHT: |
681 | return 0x000000; |
689 | return 0x000000; |
682 | } |
690 | } |
683 | } |
691 | } |
Line -... | Line 692... | ||
- | 692 | ||
- | 693 | ||
- | 694 | public int check_local_max(int val) |
|
- | 695 | { |
|
- | 696 | if ( val>local_max) |
|
- | 697 | local_max=val; |
|
- | 698 | else if (-val>local_max) |
|
- | 699 | local_max=-val; |
|
- | 700 | return val; |
|
684 | 701 | } |
|
685 | // drawing section |
702 | // drawing section |
Line 686... | Line 703... | ||
686 | public void paint(Graphics g) { |
703 | public void paint(Graphics g) { |
687 | 704 | ||
Line -... | Line 705... | ||
- | 705 | canvas_width=this.getWidth(); |
|
- | 706 | canvas_height=this.getHeight(); |
|
688 | canvas_width=this.getWidth(); |
707 | |
689 | canvas_height=this.getHeight(); |
708 | line_middle_y=canvas_height/2; |
690 | 709 | ||
691 | if (debug.showing) |
710 | if (debug.showing) |
692 | { |
711 | { |
Line 704... | Line 723... | ||
704 | 723 | ||
Line 705... | Line -... | ||
705 | - | ||
706 | - | ||
707 | try { |
- | |
708 | - | ||
709 | // !!TODO checkme |
- | |
710 | if (mk!=null) |
- | |
711 | { |
- | |
712 | line_middle_y=canvas_height/2; |
- | |
713 | if (local_max<Math.abs(mk.debug_data.nick_int())) |
- | |
714 | local_max=Math.abs(mk.debug_data.nick_int()); |
- | |
715 | if (local_max<Math.abs(mk.debug_data.roll_int())) |
- | |
716 | local_max=Math.abs(mk.debug_data.roll_int()); |
- | |
717 | if (local_max<Math.abs(mk.debug_data.accnick())) |
- | |
718 | local_max=Math.abs(mk.debug_data.accnick()); |
- | |
719 | if (local_max<Math.abs(mk.debug_data.accroll())) |
- | |
720 | local_max=Math.abs(mk.debug_data.accroll()); |
- | |
Line 721... | Line 724... | ||
721 | line_scaler= local_max/(canvas_height/2)+1; |
724 | |
722 | } |
725 | |
Line 1111... | Line 1114... | ||
1111 | g.drawString("6 or 9 =>gas " + mk.extern_control[EXTERN_CONTROL_GAS],0,y_off,Graphics.TOP | Graphics.LEFT); |
1114 | g.drawString("6 or 9 =>gas " + mk.extern_control[EXTERN_CONTROL_GAS],0,y_off,Graphics.TOP | Graphics.LEFT); |
Line 1112... | Line 1115... | ||
1112 | 1115 | ||
1113 | y_off+=spacer; |
1116 | y_off+=spacer; |
1114 | g.drawString("* and # =>exit",0,y_off,Graphics.TOP | Graphics.LEFT); |
1117 | g.drawString("* and # =>exit",0,y_off,Graphics.TOP | Graphics.LEFT); |
1115 | y_off+=spacer; |
1118 | y_off+=spacer; |
1116 | g.drawString("* and Fire =>Start Engines",0,y_off,Graphics.TOP | Graphics.LEFT); |
1119 | /* g.drawString("* and Fire =>Start Engines",0,y_off,Graphics.TOP | Graphics.LEFT); |
1117 | y_off+=spacer; |
1120 | y_off+=spacer; |
1118 | g.drawString("* and 0 =>Stop Engines",0,y_off,Graphics.TOP | Graphics.LEFT); |
1121 | g.drawString("* and 0 =>Stop Engines",0,y_off,Graphics.TOP | Graphics.LEFT); |
1119 | y_off+=spacer; |
1122 | y_off+=spacer; |
1120 | 1123 | */ |
|
1121 | g.drawString("sent:" + mk.stats.external_control_request_count +"confirm:" + mk.stats.external_control_confirm_frame_count,0,y_off,Graphics.TOP | Graphics.LEFT); |
1124 | g.drawString("sent:" + mk.stats.external_control_request_count +"confirm:" + mk.stats.external_control_confirm_frame_count,0,y_off,Graphics.TOP | Graphics.LEFT); |
1122 | y_off+=spacer; |
1125 | y_off+=spacer; |
1123 | // g.drawString("bf1:"+ keycontrol_bitfield[0] ,0,y_off,Graphics.TOP | Graphics.LEFT); |
1126 | // g.drawString("bf1:"+ keycontrol_bitfield[0] ,0,y_off,Graphics.TOP | Graphics.LEFT); |
Line 1292... | Line 1295... | ||
1292 | g.setClip(0,0,canvas_width,canvas_height); |
1295 | g.setClip(0,0,canvas_width,canvas_height); |
Line 1293... | Line 1296... | ||
1293 | 1296 | ||
1294 | g.setStrokeStyle(Graphics.DOTTED); |
1297 | g.setStrokeStyle(Graphics.DOTTED); |
Line -... | Line 1298... | ||
- | 1298 | g.setColor(0xe1dddd); |
|
- | 1299 | ||
- | 1300 | ||
1295 | g.setColor(0xe1dddd); |
1301 | |
1296 | 1302 | ||
1297 | for (int d=0;d<GRAPH_COUNT;d++) |
1303 | for (int d=0;d<GRAPH_COUNT;d++) |
1298 | { |
1304 | { |
1299 | g.setColor(graph_colors[d]); |
1305 | g.setColor(graph_colors[d]); |
Line 1322... | Line 1328... | ||
1322 | 1328 | ||
1323 | 1329 | ||
Line -... | Line 1330... | ||
- | 1330 | for (int gr=0;gr<GRAPH_COUNT;gr++) |
|
- | 1331 | { |
|
- | 1332 | ||
- | 1333 | ||
- | 1334 | // !!TODO checkme |
|
1324 | for (int gr=0;gr<GRAPH_COUNT;gr++) |
1335 | |
1325 | { |
- | |
1326 | - | ||
1327 | g.setColor(graph_colors[gr]); |
- | |
1328 | try { |
- | |
1329 | graph_data[gr][-graph_offset]=mk.debug_data.analog[graph_sources[gr]]; |
- | |
1330 | } |
- | |
Line -... | Line 1336... | ||
- | 1336 | ||
- | 1337 | ||
1331 | catch (Exception e) |
1338 | g.setColor(graph_colors[gr]); |
Line -... | Line 1339... | ||
- | 1339 | ||
Line 1332... | Line 1340... | ||
1332 | { |
1340 | graph_data[gr][-graph_offset]=check_local_max(mk.debug_data.analog[graph_sources[gr]]); |
1333 | debug.log("E!:" + e.getMessage()); |
1341 | |
1334 | 1342 | ||
Line 1346... | Line 1354... | ||
1346 | draw_graph_part(g,x,graph_data[gr][p]/line_scaler,graph_data[gr][p+1]/line_scaler); |
1354 | draw_graph_part(g,x,graph_data[gr][p]/line_scaler,graph_data[gr][p+1]/line_scaler); |
Line 1347... | Line 1355... | ||
1347 | 1355 | ||
1348 | } |
1356 | } |
Line -... | Line 1357... | ||
- | 1357 | } |
|
- | 1358 | ||
1349 | } |
1359 | |
Line 1350... | Line 1360... | ||
1350 | 1360 | ||
1351 | break; |
1361 | break; |
1352 | 1362 | ||
Line 1466... | Line 1476... | ||
1466 | 1476 | ||
1467 | public void chg_state(byte next_state) |
1477 | public void chg_state(byte next_state) |
1468 | { |
1478 | { |
1469 | settings_editor = null; |
1479 | settings_editor = null; |
1470 | params_editor = null; |
1480 | params_editor = null; |
1471 | err_img=null; |
1481 | err_img=null; |
Line 1472... | Line -... | ||
1472 | graph_data=null; |
- | |
1473 | 1482 | graph_data=null; |
|
- | 1483 | ||
1474 | 1484 | act_menu_select_bak[state]=act_menu_select; |
|
1475 | if (next_state!=state)act_menu_select=0; |
1485 | act_menu_select=act_menu_select_bak[next_state]; |
1476 | // prepare next state |
1486 | // prepare next state |
1477 | switch(next_state) |
1487 | switch(next_state) |
1478 | { |
1488 | { |
Line 1609... | Line 1619... | ||
1609 | break; |
1619 | break; |
Line 1610... | Line 1620... | ||
1610 | 1620 | ||
1611 | case STATEID_SELECT_PARAMSET: |
1621 | case STATEID_SELECT_PARAMSET: |
1612 | menu_items=new String[5]; |
1622 | menu_items=new String[5]; |
1613 | for (int i=0;i<5;i++) |
1623 | for (int i=0;i<5;i++) |
Line 1614... | Line 1624... | ||
1614 | menu_items[i]=""+i+": " + mk.params.names[i] + ((i==mk.params.active_paramset)?"*":""); |
1624 | menu_items[i]=""+(i+1)+": " + mk.params.getParamName(i) + ((i==mk.params.active_paramset)?"*":""); |
1615 | 1625 | ||
Line 1616... | Line 1626... | ||
1616 | lcd_lines=new String[5]; |
1626 | lcd_lines=new String[5]; |
Line 1670... | Line 1680... | ||
1670 | for (int d=0;d<GRAPH_COUNT;d++) |
1680 | for (int d=0;d<GRAPH_COUNT;d++) |
1671 | graph_data[d][c]=-1; |
1681 | graph_data[d][c]=-1; |
Line 1672... | Line 1682... | ||
1672 | 1682 | ||
- | 1683 | ||
1673 | 1684 | mk.user_intent=USER_INTENT_GRAPH; |
|
Line 1674... | Line 1685... | ||
1674 | mk.user_intent=USER_INTENT_GRAPH; |
1685 | local_max=1; |
1675 | break; |
1686 | break; |
Line 1888... | Line 1899... | ||
1888 | if (act_input_str.length()<=ipinput_pos) act_input_str+=" "; |
1899 | if (act_input_str.length()<=ipinput_pos) act_input_str+=" "; |
1889 | break; |
1900 | break; |
1890 | case STATEID_IPINPUT: |
1901 | case STATEID_IPINPUT: |
1891 | if ((keyCode>=KEY_NUM0)&&(keyCode<=KEY_NUM9)) |
1902 | if ((keyCode>=KEY_NUM0)&&(keyCode<=KEY_NUM9)) |
1892 | { |
1903 | { |
1893 | act_edit_ip[ipinput_pos/4]=helper.mod_decimal(act_edit_ip[ipinput_pos/4],(ipinput_pos<15?2:3)-(ipinput_pos%4),0,(keyCode-KEY_NUM0),9); |
1904 | act_edit_ip[ipinput_pos/4]=DUBwiseHelper.mod_decimal(act_edit_ip[ipinput_pos/4],(ipinput_pos<15?2:3)-(ipinput_pos%4),0,(keyCode-KEY_NUM0),9); |
Line 1894... | Line 1905... | ||
1894 | 1905 | ||
1895 | if(ipinput_pos<19) ipinput_pos++; |
1906 | if(ipinput_pos<19) ipinput_pos++; |
1896 | if ((ipinput_pos<18)&&(((ipinput_pos+1)%4)==0))ipinput_pos++; |
1907 | if ((ipinput_pos<18)&&(((ipinput_pos+1)%4)==0))ipinput_pos++; |
1897 | } |
1908 | } |
Line 1907... | Line 1918... | ||
1907 | if(ipinput_pos<19) ipinput_pos++; |
1918 | if(ipinput_pos<19) ipinput_pos++; |
1908 | if(ipinput_pos<18)if (((ipinput_pos+1)%4)==0)ipinput_pos++; |
1919 | if(ipinput_pos<18)if (((ipinput_pos+1)%4)==0)ipinput_pos++; |
1909 | break; |
1920 | break; |
Line 1910... | Line 1921... | ||
1910 | 1921 | ||
1911 | case UP: |
1922 | case UP: |
Line 1912... | Line 1923... | ||
1912 | act_edit_ip[ipinput_pos/4]=helper.mod_decimal(act_edit_ip[ipinput_pos/4],(ipinput_pos<15?2:3)-(ipinput_pos%4),1,-1,9); |
1923 | act_edit_ip[ipinput_pos/4]=DUBwiseHelper.mod_decimal(act_edit_ip[ipinput_pos/4],(ipinput_pos<15?2:3)-(ipinput_pos%4),1,-1,9); |
Line 1913... | Line 1924... | ||
1913 | 1924 | ||
1914 | break; |
1925 | break; |
Line 1915... | Line 1926... | ||
1915 | 1926 | ||
1916 | case DOWN: |
1927 | case DOWN: |
1917 | act_edit_ip[ipinput_pos/4]=helper.mod_decimal(act_edit_ip[ipinput_pos/4],(ipinput_pos<15?2:3)-(ipinput_pos%4),-1,-1,9); |
1928 | act_edit_ip[ipinput_pos/4]=DUBwiseHelper.mod_decimal(act_edit_ip[ipinput_pos/4],(ipinput_pos<15?2:3)-(ipinput_pos%4),-1,-1,9); |
1918 | 1929 | ||
1919 | 1930 | ||
1920 | case FIRE: |
1931 | case FIRE: |
1921 | if (ipinput4proxy) |
1932 | if (ipinput4proxy) |
1922 | { |
1933 | { |
1923 | settings.act_proxy_ip=act_edit_ip; |
1934 | settings.act_proxy_ip=act_edit_ip; |
1924 | mk.do_proxy("socket://"+helper.ip_str(settings.act_proxy_ip,false)); |
1935 | mk.do_proxy("socket://"+DUBwiseHelper.ip_str(settings.act_proxy_ip,false)); |
1925 | chg_state(STATEID_PROXY); |
1936 | chg_state(STATEID_PROXY); |
1926 | } |
1937 | } |
1927 | else |
1938 | else |
Line 1928... | Line 1939... | ||
1928 | { |
1939 | { |
Line 1937... | Line 1948... | ||
1937 | break; |
1948 | break; |
Line 1938... | Line 1949... | ||
1938 | 1949 | ||
1939 | case STATEID_GPSVIEW: |
1950 | case STATEID_GPSVIEW: |
1940 | if (keyCode == this.KEY_NUM0) |
1951 | if (keyCode == this.KEY_NUM0) |
1941 | mk.set_gps_target(mk.gps_position.Latitude,mk.gps_position.Longitude); |
- | |
1942 | - | ||
1943 | - | ||
1944 | 1952 | mk.set_gps_target(mk.gps_position.Latitude,mk.gps_position.Longitude); |
|
1945 | if (keyCode == this.KEY_NUM1) |
1953 | if (keyCode == this.KEY_NUM1) |
1946 | mk.gps_position.push_wp(); |
1954 | mk.gps_position.push_wp(); |
1947 | if (keyCode == this.KEY_NUM2) |
1955 | if (keyCode == this.KEY_NUM2) |
1948 | chg_state(STATEID_FILEOPEN); |
1956 | chg_state(STATEID_FILEOPEN); |
Line 2153... | Line 2161... | ||
2153 | case ACTIONID_HORIZON: |
2161 | case ACTIONID_HORIZON: |
2154 | chg_state(STATEID_HORIZON); |
2162 | chg_state(STATEID_HORIZON); |
2155 | break; |
2163 | break; |
Line 2156... | Line 2164... | ||
2156 | 2164 | ||
2157 | case ACTIONID_RENAME_PARAMS: |
2165 | case ACTIONID_RENAME_PARAMS: |
2158 | act_input_str=mk.params.names[mk.params.act_paramset]; |
2166 | act_input_str=mk.params.getParamName(mk.params.act_paramset); |
2159 | ipinput_pos=0; |
2167 | ipinput_pos=0; |
2160 | chg_state(STATEID_STRINGINPUT); |
2168 | chg_state(STATEID_STRINGINPUT); |
Line 2255... | Line 2263... | ||
2255 | chg_state(STATEID_MOTORTEST); |
2263 | chg_state(STATEID_MOTORTEST); |
2256 | break; |
2264 | break; |
Line 2257... | Line 2265... | ||
2257 | 2265 | ||
- | 2266 | ||
2258 | 2267 | case ACTIONID_EDIT_PARAMS: |
|
2259 | case ACTIONID_EDIT_PARAMS: |
2268 | select_paramset4edit=true; |
2260 | if (mk.watchdog.act_paramset<5) |
2269 | if (mk.watchdog.act_paramset<5) |
2261 | chg_state(STATEID_READ_PARAMS); |
2270 | chg_state(STATEID_READ_PARAMS); |
Line 2262... | Line 2271... | ||
2262 | else |
2271 | else |
Line -... | Line 2272... | ||
- | 2272 | chg_state(STATEID_SELECT_PARAMSET); |
|
- | 2273 | ||
- | 2274 | break; |
|
2263 | chg_state(STATEID_SELECT_PARAMSET); |
2275 | |
Line 2264... | Line 2276... | ||
2264 | 2276 | ||
2265 | break; |
2277 | case ACTIONID_WRITE_PARAM_AS: |
2266 | 2278 | select_paramset4edit=false; |
|
2267 | 2279 | chg_state(STATEID_SELECT_PARAMSET); |
|
Line 2268... | Line 2280... | ||
2268 | 2280 | break; |
|
2269 | 2281 | ||
Line 2315... | Line 2327... | ||
2315 | 2327 | ||
Line 2316... | Line 2328... | ||
2316 | break; |
2328 | break; |
2317 | 2329 | ||
2318 | case STATEID_SELECT_PARAMSET: |
2330 | case STATEID_SELECT_PARAMSET: |
- | 2331 | if ( getGameAction (keyCode)==FIRE ) |
|
2319 | if ( getGameAction (keyCode)==FIRE ) |
2332 | { |
2320 | { |
2333 | if (select_paramset4edit) |
2321 | if ( mk.params.field[act_menu_select]!=null) |
2334 | // if ( mk.params.field[act_menu_select]!=null) |
2322 | { |
2335 | { |
2323 | mk.params.act_paramset=act_menu_select; |
2336 | mk.params.act_paramset=act_menu_select; |
- | 2337 | chg_state(STATEID_EDIT_PARAMS); |
|
- | 2338 | } |
|
- | 2339 | else |
|
- | 2340 | { |
|
- | 2341 | mk.write_params(act_menu_select); |
|
2324 | chg_state(STATEID_EDIT_PARAMS); |
2342 | chg_state(STATEID_MAINMENU); |
2325 | } |
2343 | } |
2326 | } |
2344 | } |
Line 2327... | Line 2345... | ||
2327 | else menu_keypress(keyCode); |
2345 | else menu_keypress(keyCode); |