Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 264 → Rev 265

/DUBwise/trunk/j2me/src/DUBwiseCanvas.java
132,8 → 132,9
// int local_max=-1;
 
int y_off=0;
int spacer=0;
int spacer1=0;
int spacer_small=0;
int spacer_medium=0;
int spacer_large=0;
 
int[] motor_test = {0,0,0,0};
1060,14 → 1061,16
 
 
 
Font f1 = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_MEDIUM);
Font f2 = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_SMALL);
Font font_medium = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_MEDIUM);
Font font_small = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_SMALL);
Font font_large = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_BOLD, Font.SIZE_LARGE);
 
spacer=(f1.getHeight());
spacer1=(f2.getHeight());
spacer_medium=(font_medium.getHeight());
spacer_small=(font_small.getHeight());
spacer_large=(font_large.getHeight());
 
//default Font
g.setFont(f1);
g.setFont(font_medium);
 
 
//draw background
1166,7 → 1169,7
// g.drawString(""+mk.SenderOkay() ,symbol_left,y_off,Graphics.TOP | Graphics.LEFT);
 
//symbol_left+= g.getFont().stringWidth("8")+symbol_spacer; //,0,(symbols_img.getWidth()/10)+2;
//symbol_left+= g.getFont().stringWidth("8")+symbol_spacer_medium; //,0,(symbols_img.getWidth()/10)+2;
 
 
 
1219,8 → 1222,26
else
nick_pixels_x=((int)Math.sqrt(-mk.AngleRoll()*mk.AngleNick())*(canvas_width/2))/(900);
while (horizon_roll_pixels!=0)
 
if (horizon_roll_pixels_>0)
 
{
 
g.fillTriangle(0,horizon_middle+horizon_roll_pixels,canvas_width,horizon_middle+horizon_roll_pixels,canvas_width,horizon_middle-horizon_roll_pixels);
g.fillRect(0,horizon_middle+horizon_roll_pixels_,canvas_width,canvas_height-(horizon_middle+horizon_roll_pixels_));
}
else
{
g.fillTriangle(0,horizon_middle+horizon_roll_pixels,0,horizon_middle-horizon_roll_pixels,canvas_width,horizon_middle-horizon_roll_pixels);
g.fillRect(0,horizon_middle-horizon_roll_pixels_,canvas_width,canvas_height-(horizon_middle-horizon_roll_pixels_));
}
 
 
 
/* while (horizon_roll_pixels!=0)
{
if (horizon_roll_pixels_>0)
{
1235,14 → 1256,14
// g.drawLine(0,horizon_middle-horizon_roll_pixels_,canvas_width,horizon_middle-horizon_roll_pixels);
horizon_roll_pixels+=(horizon_roll_pixels<0)?1:-1; // go to 0
 
/*g.drawLine(0,horizon_middle-horizon_roll_pixels,canvas_width,horizon_middle+horizon_roll_pixels);
if (horizon_roll_pixels<0)
g.drawLine(0,horizon_middle-horizon_roll_pixels_,canvas_width,horizon_middle-horizon_roll_pixels);
else
g.drawLine(0,horizon_middle+horizon_roll_pixels,canvas_width,horizon_middle+horizon_roll_pixels_);
//g.drawLine(0,horizon_middle-horizon_roll_pixels,canvas_width,horizon_middle+horizon_roll_pixels);
//if (horizon_roll_pixels<0)
// g.drawLine(0,horizon_middle-horizon_roll_pixels_,canvas_width,horizon_middle-horizon_roll_pixels);
// else
// g.drawLine(0,horizon_middle+horizon_roll_pixels,canvas_width,horizon_middle+horizon_roll_pixels_);
horizon_roll_pixels+=(horizon_roll_pixels<0)?1:-1; // go to 0
*/
// horizon_roll_pixels+=(horizon_roll_pixels<0)?1:-1; // go to 0
 
}
 
if (horizon_roll_pixels_>0)
1258,10 → 1279,23
g.fillRect(0,horizon_middle-horizon_roll_pixels_,canvas_width,canvas_height-(horizon_middle-horizon_roll_pixels_));
}
 
*/
 
g.setColor(0x254d9e);
 
g.fillArc((canvas_width-nick_size)/2- nick_pixels_x, horizon_middle-nick_size/2+ nick_pixels_y, nick_size, nick_size, 0,360);
 
 
if (mk.ufo_prober.is_navi())
{
g.setColor(0xCC2233);
g.fillArc((canvas_width-nick_size)/2- nick_pixels_x, horizon_middle-nick_size/2+ nick_pixels_y, nick_size, nick_size, -mk.gps_position.CompasHeading-45/2 +90 +mk.stats.heading_start,45);
}
 
 
 
// for (i=0;i<horizon_roll_pixels
// g.fillArc(0, 0, canvas_width, canvas_width, 0,45);
1283,24 → 1317,51
if (settings.expert_mode)
{
g.drawString("nick => " + mk.AngleNick(),0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
y_off+=spacer_medium;
 
g.drawString("roll => " + mk.AngleRoll(),0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
y_off+=spacer_medium;
}
 
 
 
for (int c=0;c<2;c++)
{
if (c==0)
g.setColor(0);
else
g.setColor(0xFFFFFF);
g.setFont(font_large);
if (mk.ufo_prober.is_navi())
g.drawString("" + mk.gps_position.GroundSpeed_str() ,10-c*3,canvas_height-5-c*3,Graphics.BOTTOM | Graphics.LEFT);
else
g.drawString("" + mk.stats.flying_time()+"s" ,10-c*3,canvas_height-5-c*3,Graphics.BOTTOM | Graphics.LEFT);
g.drawString( mk.Alt_formated() + "/"+status_voice.last_alt ,canvas_width-10-c*3,canvas_height-5-c*3,Graphics.BOTTOM | Graphics.RIGHT);
if (mk.ufo_prober.is_navi())
{
g.setFont(font_medium);
g.drawString("" + mk.stats.flying_time()+"s" ,10-c*3,canvas_height-5-spacer_large-c*3,Graphics.BOTTOM | Graphics.LEFT);
}
}
break;
 
case STATEID_DATABUFF:
g.setFont(f2);
g.setFont(font_small);
 
int lines2paint=(((canvas_height-y_off)/spacer1));
y_off=canvas_height-spacer1;
int lines2paint=(((canvas_height-y_off)/spacer_small));
y_off=canvas_height-spacer_small;
 
for (int pos_y=0;pos_y<lines2paint;pos_y++)
{
g.drawString(mk.get_buff(pos_y) ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off-=spacer1;
y_off-=spacer_small;
}
break;
 
1320,7 → 1381,7
 
case STATEID_GPSVIEW:
 
g.setFont(f2);
g.setFont(font_small);
 
g.setStrokeStyle(Graphics.SOLID);
g.setColor(0x0000ff);
1342,74 → 1403,74
g.setColor(skin_fg_color());
 
g.drawString("Used Sats: " + mk.gps_position.SatsInUse + " | Packages: " + mk.stats.navi_data_count ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
 
g.drawString("Lat: " + mk.gps_position.Latitude_str() ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
 
g.drawString("Long: " + mk.gps_position.Longitude_str() ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
 
g.drawString("Altitude: " + mk.gps_position.Altitude ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
 
g.drawString("GrSpeed: " + mk.gps_position.GroundSpeed_str() ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
 
g.drawString("Heading: " + mk.gps_position.Heading ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
 
g.drawString("CompasHeading: " + mk.gps_position.CompasHeading ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
 
g.drawString("Target-Lat: " + mk.gps_position.TargetLatitude_str() ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
g.drawString("Target-Long: " + mk.gps_position.TargetLongitude_str() ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
 
g.drawString("Target-Alt: " + mk.gps_position.TargetAltitude ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
 
 
g.drawString("Home-Lat: " + mk.gps_position.HomeLatitude_str() ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
 
g.drawString("Home-Long: " + mk.gps_position.HomeLongitude_str() ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
 
g.drawString("Home-Alt: " + mk.gps_position.HomeAltitude ,0,y_off,Graphics.TOP | Graphics.LEFT);
 
y_off+=spacer1;
y_off+=spacer_small;
g.drawString("Distance : " + mk.gps_position.Distance2Target ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
g.drawString("Angle: " + mk.gps_position.Angle2Target ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
 
g.drawString("WayPoints: " + mk.gps_position.WayPointNumber + "/" + mk.gps_position.WayPointIndex ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
y_off+=spacer_medium;
 
 
 
/*
g.drawString("" + mk.gps_position.NameWP[act_wp] ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
y_off+=spacer_medium;
 
g.drawString("Lat: " + mk.gps_position.WP_Latitude_str(act_wp) ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
y_off+=spacer_medium;
 
g.drawString("Long: " + mk.gps_position.WP_Longitude_str(act_wp) ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
y_off+=spacer_medium;
 
 
g.drawString("Distance: " + mk.gps_position.distance2wp(act_wp) ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
y_off+=spacer_medium;
 
g.drawString("Angle: " + mk.gps_position.angle2wp(act_wp) ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
y_off+=spacer_medium;
 
g.drawString("Compas Heading: " + (360+mk.debug_data.analog[26]-heading_offset)%360) + "(" +mk.debug_data.analog[26] +")" ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
y_off+=spacer_medium;
*/
 
1417,12 → 1478,12
 
case STATEID_RESET_PARAMS:
case STATEID_FLASHING:
g.setFont(f2);
g.setFont(font_small);
int msg_pos=0;
while (mk.flash_msgs[msg_pos]!=null)
{
g.drawString(mk.flash_msgs[msg_pos] ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
msg_pos++;
}
break;
1432,11 → 1493,11
if (cam_img!=null)
g.drawImage(cam_img,0,0,g.TOP | g.LEFT);
g.drawString("condition: " + cam_condition() ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
y_off+=spacer_medium;
g.drawString("width " + cam_img.getWidth(),0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
y_off+=spacer_medium;
g.drawString("height " + cam_img.getHeight(),0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
y_off+=spacer_medium;
break;
 
case STATEID_STICKVIEW:
1444,37 → 1505,37
for(int tmp_y=0;tmp_y<10;tmp_y++)
{
g.drawString(""+tmp_y+"(" + l(mk.params.stick_stringids[tmp_y]) + ")=>"+mk.stick_data.stick[tmp_y],0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
y_off+=spacer_medium;
}
break;
 
case STATEID_KEYCONTROL:
 
y_off+=spacer;
y_off+=spacer_medium;
g.drawString("UP or DOWN =>nick " + mk.extern_control[EXTERN_CONTROL_NICK],0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
y_off+=spacer_medium;
g.drawString("LEFT or RIGHT =>roll " + mk.extern_control[EXTERN_CONTROL_ROLL],0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
y_off+=spacer_medium;
g.drawString("1 or 4 =>altitude " + mk.extern_control[EXTERN_CONTROL_HIGHT],0,y_off,Graphics.TOP | Graphics.LEFT);
 
y_off+=spacer;
y_off+=spacer_medium;
g.drawString("2 or 3 =>gier " + mk.extern_control[EXTERN_CONTROL_GIER],0,y_off,Graphics.TOP | Graphics.LEFT);
 
y_off+=spacer;
y_off+=spacer_medium;
g.drawString("6 or 9 =>gas " + mk.extern_control[EXTERN_CONTROL_GAS],0,y_off,Graphics.TOP | Graphics.LEFT);
 
y_off+=spacer;
y_off+=spacer_medium;
g.drawString("* and # =>exit",0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
y_off+=spacer_medium;
/* g.drawString("* and Fire =>Start Engines",0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
y_off+=spacer_medium;
g.drawString("* and 0 =>Stop Engines",0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
y_off+=spacer_medium;
*/
g.drawString("sent:" + mk.stats.external_control_request_count +"confirm:" + mk.stats.external_control_confirm_frame_count,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
// g.drawString("bf1:"+ keycontrol_bitfield[0] ,0,y_off,Graphics.TOP | Graphics.LEFT);
//g.drawString("bf2:"+ keycontrol_bitfield[1] ,canvas_width/2,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer_medium;
// g.drawString("bfont_medium:"+ keycontrol_bitfield[0] ,0,y_off,Graphics.TOP | Graphics.LEFT);
//g.drawString("bfont_small:"+ keycontrol_bitfield[1] ,canvas_width/2,y_off,Graphics.TOP | Graphics.LEFT);
break;
 
1500,7 → 1561,7
 
//#if fileapi=="on"
case STATEID_FILEOPEN:
y_off+=spacer;
y_off+=spacer_medium;
g.drawString("act_path" + file_access.act_path() ,0,y_off,Graphics.TOP | Graphics.LEFT);
paint_menu(g);
break;
1509,9 → 1570,9
 
case STATEID_SHOWPHONEGPS:
//#if cldc11=="on"
y_off+=spacer;
y_off+=spacer_medium;
g.drawString("lat" + phone_lat ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
y_off+=spacer_medium;
g.drawString("long" + phone_long ,0,y_off,Graphics.TOP | Graphics.LEFT);
//#endif
break;
1536,16 → 1597,16
 
 
case STATEID_RAWDEBUG:
g.setFont(f2);
g.setFont(font_small);
rawdebug_off_y=0;
if ((rawdebug_cursor_y+3)*spacer1>canvas_height)
rawdebug_off_y=((rawdebug_cursor_y+3)*spacer1-canvas_height)/spacer1;
for (int i=0;i<(canvas_height/spacer1)-1;i++)
if ((rawdebug_cursor_y+3)*spacer_small>canvas_height)
rawdebug_off_y=((rawdebug_cursor_y+3)*spacer_small-canvas_height)/spacer_small;
for (int i=0;i<(canvas_height/spacer_small)-1;i++)
{
if (i+rawdebug_off_y==rawdebug_cursor_y)
{
g.setColor(0x0000CC);
g.fillRect(0,y_off,canvas_width,spacer1);
g.fillRect(0,y_off,canvas_width,spacer_small);
 
g.setColor(skin_fg_color());
 
1554,7 → 1615,7
if (i+rawdebug_off_y<32) //todo better style
g.drawString(mk.debug_data.names[i+rawdebug_off_y] + mk.debug_data.analog[i+rawdebug_off_y] ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
}
 
1564,24 → 1625,24
 
case STATEID_CONN_DETAILS:
g.setFont(f1);
g.setFont(font_medium);
g.drawString(l(STRINGID_CONN)+":",0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
g.setFont(f2);
y_off+=spacer_medium;
g.setFont(font_small);
 
g.drawString(" URL:" + mk.mk_url,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
 
g.drawString(" Name:" + mk.name,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
 
g.drawString(" "+mk.ufo_prober.extended_name()+ " (" + (mk.connected?("open"+((System.currentTimeMillis()- mk.connection_start_time)/1000)+"s"):"closed")+"):",0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
g.drawString(" Software Version:" + mk.version.version_str ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
 
g.drawString(" Protocol Version:" + mk.version.proto_str ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
g.drawString(" Slave-Addr:" + mk.slave_addr,0,y_off,Graphics.TOP | Graphics.LEFT);
 
paint_menu(g);
1590,46 → 1651,46
 
case STATEID_TRAFFIC:
g.setFont(f1);
g.setFont(font_medium);
g.drawString("Packet Traffic (over "+mk.conn_time_in_s()+"s):",0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
g.setFont(f2);
y_off+=spacer_medium;
g.setFont(font_small);
g.drawString( ">>in:"+mk.stats.bytes_in+ " bytes => " + mk.stats.bytes_in/mk.conn_time_in_s() + " bytes/s",0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
 
 
 
 
g.drawString( " debug:"+mk.stats.debug_data_count+ " LCD:" + mk.stats.lcd_data_count + " vers:" + mk.stats.version_data_count,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
g.drawString( " rc:"+mk.stats.stick_data_count+" params:"+mk.stats.params_data_count + " GPS:"+mk.stats.navi_data_count ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
g.drawString( " debug_names:" + mk.stats.debug_names_count + " angles:" + mk.stats.angle_data_count ,0,y_off,Graphics.TOP | Graphics.LEFT);
 
y_off+=spacer1;
y_off+=spacer_small;
g.drawString( " other:"+mk.stats.other_data_count,0,y_off,Graphics.TOP | Graphics.LEFT);
 
y_off+=spacer1+3;
y_off+=spacer_small+3;
g.drawString( "<<out:"+mk.stats.bytes_out + " bytes =>" + mk.stats.bytes_out/mk.conn_time_in_s() + "bytes/s", 0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
g.drawString( " LCD:" + mk.stats.lcd_data_request_count + " vers:" + mk.stats.version_data_request_count,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
g.drawString( " params:"+mk.stats.params_data_request_count +" rc:" + mk.stats.stick_data_request_count ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
 
g.drawString( " resend:"+mk.stats.resend_count ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
 
paint_menu(g);
break;
 
case STATEID_PROXY:
g.setFont(f1);
g.setFont(font_medium);
g.drawString("Host:",0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
g.setFont(f2);
y_off+=spacer_medium;
g.setFont(font_small);
g.drawString(" " + mk.proxy.url + "("+((mk.proxy.connected)?"open":"closed") +")",0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
y_off+=spacer_small;
 
 
1655,7 → 1716,7
//
g.setColor(0xe1dddd);
g.setFont(f2);
g.setFont(font_small);
// LEGEND
if (settings.graph_legend)
{
1664,16 → 1725,16
{
// g.setColor(graph_colors[d]);
// g.fillRect(0,y_off +spacer1/2-2 ,20,4);
// g.fillRect(0,y_off +spacer_small/2-2 ,20,4);
// g.setColor(skin_fg_color());
// g.drawString(graph_names[d] + mk.debug_data.analog[graph_sources[d]],23,y_off,Graphics.TOP | Graphics.LEFT);
// y_off+=spacer1;
// y_off+=spacer_small;
g.setColor(graph_colors[d]);
g.fillRect(canvas_width-20,canvas_height-spacer*(d+1)+(spacer)/2-2 ,20,4);
g.fillRect(canvas_width-20,canvas_height-spacer_medium*(d+1)+(spacer_medium)/2-2 ,20,4);
g.setColor(skin_fg_color());
g.drawString(graph_names[d] ,canvas_width-23,canvas_height-spacer*(d+1),Graphics.TOP | Graphics.RIGHT);
// y_off+=spacer1;
g.drawString(graph_names[d] ,canvas_width-23,canvas_height-spacer_medium*(d+1),Graphics.TOP | Graphics.RIGHT);
// y_off+=spacer_small;
}
 
1777,31 → 1838,31
{
g.drawString("Voltage: " + (mk.debug_data.UBatt()/10) + "," +(mk.debug_data.UBatt()%10)+"V" ,0,y_off,Graphics.TOP | Graphics.LEFT);
g.drawString("Sender: " + mk.debug_data.SenderOkay(),canvas_width/2,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
y_off+=spacer_medium;
}
 
g.drawString(mk.version.str+"(d"+mk.debug_data_count+ "l" + mk.lcd_data_count+ "v" + mk.version_data_count+"o"+mk.other_data_count+"p"+mk.params_data_count+")",0,y_off,Graphics.TOP | Graphics.LEFT);
 
y_off+=spacer;
y_off+=spacer_medium;
 
g.drawString("n:"+mk.debug_data.nick_int() + " r:"+mk.debug_data.roll_int() + " an:"+mk.debug_data.accnick() + " ar:"+mk.debug_data.accroll() ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
y_off+=spacer_medium;
g.drawString("m1:"+mk.debug_data.motor_val(0) + " m2:"+mk.debug_data.motor_val(1)+" m3:"+mk.debug_data.motor_val(2) + " m4:"+mk.debug_data.motor_val(3) ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
y_off+=spacer_medium;
if (mk.connected)
{
g.drawString("time conn:" +((System.currentTimeMillis()- mk.connection_start_time)/1000)+"s" ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
y_off+=spacer_medium;
g.drawString("time motor>15:" +(mk_stat.motor_on_time/1000) +"s" ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
y_off+=spacer_medium;
g.drawString("time motor=15:" +(mk_stat.motor_stand_time/1000) +"s" ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
y_off+=spacer_medium;
g.drawString("lcd:" + mk.LCD.act_mk_page + "/" + mk.LCD.pages + " ( wanted: " + mk.LCD.act_user_page + "state:" + mk.LCD.init_state +")" ,0,y_off,Graphics.TOP | Graphics.LEFT);
 
y_off+=spacer;
y_off+=spacer_medium;
g.drawString("lcd-key:" + mk.LCD.act_key ,0,y_off,Graphics.TOP | Graphics.LEFT);
 
}
1894,7 → 1955,7
mk.destroy_debug_buff();
mk.user_intent=USER_INTENT_NONE;
mk.set_debug_interval(100);
mk.set_gpsosd_interval(0);
mk.set_gpsosd_interval(100);
act_menu_select_bak[state]=act_menu_select;
act_menu_select=act_menu_select_bak[next_state];
 
2132,7 → 2193,7
case STATEID_HORIZON:
// mk.user_intent=USER_INTENT_GRAPH;
if (mk.ufo_prober.is_navi())
mk.set_debug_interval(10);
mk.set_debug_interval(3);
break;
 
case STATEID_GRAPH:
/DUBwise/trunk/j2me/src/DUBwiseSettings.java
41,6 → 41,10
 
public boolean do_vibra=true;
public boolean do_sound=true;
public boolean do_volts_sound=true;
public boolean do_altimeter_sound=true;
 
 
public boolean fullscreen=false;
public boolean do_scrollbg=false;
public boolean expert_mode=false;
220,10 → 224,13
}
 
if (pos==SETTINGS_POS_BITFIELD2)
do_sound=((val&1)!=0); // TODO: FIXME - extra var
do_volts_sound=((val&1)!=0);
 
if (pos==SETTINGS_POS_BITFIELD2)
if (pos==SETTINGS_POS_BITFIELD2+1)
reload_settings=((val&2)!=0);
 
if (pos==SETTINGS_POS_BITFIELD2+2)
do_altimeter_sound=((val&1)!=0);
}
 
 
252,7 → 259,7
{ STRINGID_NICK ,STRINGID_ROLL,STRINGID_GIER,STRINGID_GASINCREASE,STRINGID_HEIGHTINCREASE },
{STRINGID_BACKTOMAINMENU,STRINGID_FULLSCREEN,STRINGID_CLEAR },
{STRINGID_LEGEND,STRINGID_SCALEGRID,STRINGID_GRAPHINTERVAL},
{STRINGID_VOLTS,STRINGID_DELAYINS,STRINGID_VOLUME},
{STRINGID_VOLTS,STRINGID_DELAYINS,STRINGID_ALTIMETER,STRINGID_VOLUME},
{STRINGID_SOUND,STRINGID_VIBRA,STRINGID_REMOTECAMSTICK,STRINGID_ALWAYSRELOADPARAMS,STRINGID_EXPERTMODE}};
 
 
271,12 → 278,12
 
,13
//#endif
} , {2,3 } , {4,5,6,7,8} , {9,10,11},{SETTINGS_POS_BITFIELD1*8 +6,SETTINGS_POS_BITFIELD1*8 +7, SETTINGS_POS_GRAPHINTERVAL} ,{SETTINGS_POS_BITFIELD2*8+0,SETTINGS_POS_VOICEDELAY,SETTINGS_POS_VOICEVOLUME }, {10,11,12,SETTINGS_POS_BITFIELD2*8+1,12}};
} , {2,3 } , {4,5,6,7,8} , {9,10,11},{SETTINGS_POS_BITFIELD1*8 +6,SETTINGS_POS_BITFIELD1*8 +7, SETTINGS_POS_GRAPHINTERVAL} ,{SETTINGS_POS_BITFIELD2*8+0,SETTINGS_POS_VOICEDELAY,SETTINGS_POS_BITFIELD2*8+2,SETTINGS_POS_VOICEVOLUME }, {10,11,12,SETTINGS_POS_BITFIELD2*8+1,12}};
public int[][] _field_types={ {PARAMTYPE_CHOICE+0,PARAMTYPE_CHOICE+1,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH
//#if devicecontrol=="on"
,PARAMTYPE_BITSWITCH
//#endif
} , {PARAMTYPE_CHOICE+2,PARAMTYPE_CHOICE+3} , {PARAMTYPE_BYTE,PARAMTYPE_BYTE,PARAMTYPE_BYTE,PARAMTYPE_BYTE,PARAMTYPE_BYTE}, {PARAMTYPE_KEY,PARAMTYPE_KEY,PARAMTYPE_KEY} , {PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BYTE}, {PARAMTYPE_BITSWITCH,PARAMTYPE_BYTE,PARAMTYPE_BYTE}, {PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_STICK,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH}};
} , {PARAMTYPE_CHOICE+2,PARAMTYPE_CHOICE+3} , {PARAMTYPE_BYTE,PARAMTYPE_BYTE,PARAMTYPE_BYTE,PARAMTYPE_BYTE,PARAMTYPE_BYTE}, {PARAMTYPE_KEY,PARAMTYPE_KEY,PARAMTYPE_KEY} , {PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BYTE}, {PARAMTYPE_BITSWITCH,PARAMTYPE_BYTE,PARAMTYPE_BITSWITCH,PARAMTYPE_BYTE}, {PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_STICK,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH}};
DUBwiseCanvas canvas;
 
 
/DUBwise/trunk/j2me/src/MKStatusVoice.java
107,37 → 107,74
}
 
int info_from_debug_set=-1;
int volt_timeout=0;
 
public int last_alt=-1;
 
public void run()
{
while(true)
{
if (mk.connected&&(canvas.settings.do_sound)&&(mk.debug_data.UBatt()!=-1)&&(!mk.force_disconnect))
if (mk.connected&&(canvas.settings.do_sound)&&(mk.UBatt()!=-1)&&(!mk.force_disconnect))
{
int ubatt=mk.debug_data.UBatt();
if (info_from_debug_set!=mk.stats.debug_data_count)
{
info_from_debug_set=mk.stats.debug_data_count;
start_playing(""+(ubatt/10));
wait_for_end();
{ // only when newdata
if((ubatt%10)!=0)
if (canvas.settings.do_volts_sound&&(volt_timeout--<0))
{
start_playing("komma");
volt_timeout=delay*10;
int ubatt=mk.UBatt();
info_from_debug_set=mk.stats.debug_data_count;
start_playing(""+(ubatt/10));
wait_for_end();
start_playing(""+(ubatt%10));
if((ubatt%10)!=0)
{
start_playing("komma");
wait_for_end();
start_playing(""+(ubatt%10));
wait_for_end();
}
start_playing("volt");
wait_for_end();
}
start_playing("volt");
 
 
if (canvas.settings.do_altimeter_sound)
{
if (last_alt==-1) last_alt=mk.Alt();
int alt_diff=10;
if (last_alt>mk.Alt()+alt_diff)
{
start_playing("down");
wait_for_end();
last_alt-=alt_diff;
}
if (last_alt<mk.Alt()-alt_diff)
{
start_playing("up");
wait_for_end();
last_alt+=alt_diff;
}
}
else
last_alt=-1;
}
}
 
try {
try {
Thread.sleep(100);
/*
if (delay<1)
Thread.sleep(1000);
else
Thread.sleep(delay*1000);
*/
}
catch (Exception e) { }