48,8 → 48,6 |
int file_list_length=0; |
//#endif |
|
|
|
String act_input_str=" "; |
|
boolean ipinput4proxy; |
60,8 → 58,6 |
int canvas_height=100; |
|
|
|
|
// public String ip_digit_zeroes(int digit) |
//{ return "" + digit/100 + "" + (digit/10)%10 + "" + (digit)%10; } |
|
150,6 → 146,130 |
String[] lcd_lines =null; |
|
|
|
// boolean expert_mode=false; |
|
public void setup_main_menu() |
{ |
byte setup_pos=0; |
byte[] tmp_actions=new byte[20]; |
String[] tmp_items=new String[20]; |
|
|
|
tmp_actions[setup_pos]=ACTIONID_SETTINGS; |
tmp_items[setup_pos++] ="Tool Settings"; |
|
|
tmp_actions[setup_pos]=ACTIONID_CONN_DETAILS; |
tmp_items[setup_pos++] ="Connection"; |
|
if (settings.expert_mode) |
{ |
tmp_actions[setup_pos]=ACTIONID_DEBUG; |
tmp_items[setup_pos++] ="Debug"; |
|
} |
|
|
|
if (mk.ufo_prober.is_mk() ) |
{ |
tmp_actions[setup_pos]=ACTIONID_MOTORTEST; |
tmp_items[setup_pos++] ="Motor Test"; |
|
tmp_actions[setup_pos]=ACTIONID_KEYCONTROL; |
tmp_items[setup_pos++] ="Key-Control"; |
|
tmp_actions[setup_pos]=ACTIONID_RCDATA; |
tmp_items[setup_pos++] ="view RC-data"; |
|
tmp_actions[setup_pos]=ACTIONID_EDIT_PARAMS; |
tmp_items[setup_pos++] ="Flight Settings"; |
} |
|
|
|
if (( mk.ufo_prober.is_navi()||mk.ufo_prober.is_mk() )) |
{ |
tmp_actions[setup_pos]=ACTIONID_LCD; |
tmp_items[setup_pos++] ="LCD"; |
} |
|
if (( mk.ufo_prober.is_mk() )) |
{ |
tmp_actions[setup_pos]=ACTIONID_GRAPH; |
tmp_items[setup_pos++] ="Graph"; |
} |
|
|
|
|
if (( mk.ufo_prober.is_navi()||mk.ufo_prober.is_mk()||mk.ufo_prober.is_mk3mag() )) |
{ |
tmp_actions[setup_pos]=ACTIONID_RAWDEBUG; |
tmp_items[setup_pos++] ="Debug Values"; |
} |
|
|
|
if ( mk.ufo_prober.is_navi()) |
{ |
tmp_actions[setup_pos]=ACTIONID_GPSDATA; |
tmp_items[setup_pos++] ="view GPS-Data"; |
|
tmp_actions[setup_pos]=ACTIONID_NC_ERRORS; |
tmp_items[setup_pos++] ="view Errors"; |
|
|
tmp_actions[setup_pos]=ACTIONID_SWITCH_FC; |
tmp_items[setup_pos++] ="switch to FC"; |
|
tmp_actions[setup_pos]=ACTIONID_SWITCH_MK3MAG; |
tmp_items[setup_pos++] ="switch to MK3MAG"; |
|
} |
|
if ((mk.ufo_prober.is_mk()||mk.ufo_prober.is_mk3mag() )) |
{ |
tmp_actions[setup_pos]=ACTIONID_SWITCH_NC; |
tmp_items[setup_pos++] ="switch to Navi"; |
} |
|
|
if ((settings.expert_mode)&& ( mk.ufo_prober.is_navi()||mk.ufo_prober.is_mk()||mk.ufo_prober.is_mk3mag()||mk.ufo_prober.is_incompatible() )) |
{ |
tmp_actions[setup_pos]=ACTIONID_FLASH; |
tmp_items[setup_pos++] ="Flash Firmware"; |
} |
|
if ((settings.expert_mode)&& ( mk.ufo_prober.is_mk() )) |
{ |
tmp_actions[setup_pos]=ACTIONID_CAM; |
tmp_items[setup_pos++] ="Remote Cam"; |
} |
|
|
|
tmp_actions[setup_pos]=ACTIONID_ABOUT; |
tmp_items[setup_pos++] ="About"; |
|
tmp_actions[setup_pos]=ACTIONID_QUIT; |
tmp_items[setup_pos++] ="Quit"; |
|
|
byte[] tmp_actions_fin=new byte[setup_pos]; |
String[] tmp_items_fin=new String[setup_pos]; |
|
for ( int tmp_p=0;tmp_p<setup_pos;tmp_p++) |
{ |
tmp_actions_fin[tmp_p]=tmp_actions[tmp_p]; |
tmp_items_fin[tmp_p] =tmp_items[tmp_p]; |
} |
setup_menu(tmp_items_fin,tmp_actions_fin); |
} |
|
|
public void setup_menu(String[] items , byte[] actions) |
{ |
menu_items=items; |
272,23 → 392,10 |
for (int c=0;c<graph_data[0].length;c++) |
for (int d=0;d<GRAPH_COUNT;d++) |
graph_data[d][c]=-1; |
/* |
nick_line_pos_data=new int[graph_data[0].length]; |
roll_line_pos_data=new int[graph_data[0].length]; |
accnick_line_pos_data=new int[graph_data[0].length]; |
accroll_line_pos_data=new int[graph_data[0].length]; |
|
for (int c=0;c<graph_data[0].length;c++) |
{ |
nick_line_pos_data[c]=-1; |
roll_line_pos_data[c]=-1; |
accnick_line_pos_data[c]=-1; |
accroll_line_pos_data[c]=-1; |
} |
*/ |
|
try { |
err_img=null; |
if (settings.do_scrollbg) err_img=Image.createImage("/preflight.jpg"); |
err_img=Image.createImage("/preflight.jpg"); |
} |
catch (Exception e) { } |
|
745,7 → 852,7 |
} |
break; |
case STATEID_NC_ERRORS: |
if (settings.do_scrollbg) |
if (err_img!=null) |
{ |
int err_img_left=(canvas_width-err_img.getWidth()/2)/2; |
int err_img_top=(canvas_height-err_img.getHeight())/2; |
1453,16 → 1560,8 |
//#endif |
|
case STATEID_MAINMENU: |
if (mk.ufo_prober.is_navi()) |
setup_menu(main_menu_items_navi,main_menu_actions_navi); |
else if (mk.ufo_prober.is_mk()) |
setup_menu(main_menu_items_mk,main_menu_actions_mk); |
else if (mk.ufo_prober.is_mk3mag()) |
setup_menu(main_menu_items_mk3mag,main_menu_actions_mk3mag); |
else if (mk.ufo_prober.is_incompatible()) |
setup_menu(main_menu_items_incompatible,main_menu_actions_incompatible); |
else // no connection |
setup_menu(main_menu_items_no_connection,main_menu_actions_no_connection); |
setup_main_menu(); |
|
break; |
|
case STATEID_SETTINGSMENU: |
1482,6 → 1581,7 |
//#if devicecontrol=="on" |
menu_items[7]+=(!settings.keep_lighton)?"Off":"On"; |
//#endif |
menu_items[8]+=(!settings.expert_mode)?" Off":" On"; |
menu_actions=settings_menu_actions; |
lcd_lines=new String[menu_items.length]; |
break; |
1964,6 → 2064,10 |
switch(menu_actions[act_menu_select]) |
{ |
|
case ACTIONID_TOGGLE_EXPERT: |
settings.expert_mode=!settings.expert_mode; |
chg_state(STATEID_SETTINGSMENU); |
break; |
case ACTIONID_RENAME_PARAMS: |
act_input_str=mk.params.names[mk.params.act_paramset]; |
ipinput_pos=0; |