1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-17 02:52:12 +01:00

More graphic fixes

setting to change screens
This commit is contained in:
Sambas 2012-05-26 18:37:41 +03:00
parent dfcba097f2
commit 36ea394d84
2 changed files with 20 additions and 25 deletions

View File

@ -2007,14 +2007,14 @@ void lamas(void)
for(int z=0; z<30;z++)
{
lama_loc[0][z]=rand()%(GRAPHICS_WIDTH_REAL-10);
lama_loc[1][z]=rand()%(GRAPHICS_HEIGHT_REAL-10);
lama_loc[0][z]=rand()%(GRAPHICS_RIGHT-10);
lama_loc[1][z]=rand()%(GRAPHICS_BOTTOM-10);
}
}
for(int z=0; z<30;z++)
{
sprintf(temp,"%c",0xe8+(lama_loc[0][z]%2));
write_string(temp,lama_loc[0][z],lama_loc[1][z], 0, 0, TEXT_VA_TOP, TEXT_HA_LEFT, 0, 2);
write_string(temp,APPLY_HDEADBAND(lama_loc[0][z]),APPLY_VDEADBAND(lama_loc[1][z]), 0, 0, TEXT_VA_TOP, TEXT_HA_LEFT, 0, 2);
}
}
@ -2029,18 +2029,17 @@ void updateGraphics() {
HomeLocationData home;
HomeLocationGet(&home);
if(home.Set == HOMELOCATION_SET_FALSE)
{
char temps[20]={0};
sprintf(temps,"HOME NOT SET");
//printTextFB(x,y,temp);
write_string(temps, APPLY_HDEADBAND(GRAPHICS_RIGHT/2), (GRAPHICS_BOTTOM/2), 0, 0, TEXT_VA_TOP, TEXT_HA_CENTER, 0, 3);
}
uint32_t disp = 0;
switch (disp) {
switch (OsdSettings.Screen) {
case 0: // Dave simple
{
if(home.Set == HOMELOCATION_SET_FALSE)
{
char temps[20]={0};
sprintf(temps,"HOME NOT SET");
//printTextFB(x,y,temp);
write_string(temps, APPLY_HDEADBAND(GRAPHICS_RIGHT/2), (GRAPHICS_BOTTOM/2), 0, 0, TEXT_VA_TOP, TEXT_HA_CENTER, 0, 3);
}
if(gpsData.Heading>180)
setAttitudeOsd(0,0,(int16_t)(gpsData.Heading-360));
else
@ -2061,12 +2060,9 @@ void updateGraphics() {
calcHomeArrow();
}
break;
break;
case 1:
{
if(OsdSettings.Attitude == OSDSETTINGS_ATTITUDE_ENABLED)
{
// GPS HACK
if(gpsData.Heading>180)
setAttitudeOsd(0,0,(int16_t)(gpsData.Heading-360));
@ -2098,8 +2094,7 @@ void updateGraphics() {
calcHomeArrow();
/* Draw Attitude Indicator */
//if(OsdSettings.Attitude == OSDSETTINGS_ATTITUDE_ENABLED)
if(0)
if(OsdSettings.Attitude == OSDSETTINGS_ATTITUDE_ENABLED)
{
drawAttitude(APPLY_HDEADBAND(OsdSettings.AttitudeSetup[OSDSETTINGS_ATTITUDESETUP_X]),APPLY_VDEADBAND(OsdSettings.AttitudeSetup[OSDSETTINGS_ATTITUDESETUP_Y]),attitude.Pitch,attitude.Roll,96);
}
@ -2199,13 +2194,13 @@ void updateGraphics() {
APPLY_VDEADBAND(OsdSettings.HeadingSetup[OSDSETTINGS_HEADINGSETUP_Y]), 15, 30, 7, 12, 0);
}
}
//write_filled_rectangle(draw_buffer_level,20,20,30,30,1);
//write_filled_rectangle(draw_buffer_mask,30,30,30,30,1);
//lamas();
/* Make sure every line last bit is 0 */
}
}
break;
case 3:
{
lamas();
}
break;
default:
write_vline( draw_buffer_level,0,0,GRAPHICS_HEIGHT_REAL-1,1);
write_vline( draw_buffer_mask,0,0,GRAPHICS_HEIGHT_REAL-1,1);

View File

@ -13,7 +13,7 @@
<field name="AltitudeSetup" units="" type="int16" elements="2" elementnames="X,Y" defaultvalue="2,145"/>
<field name="Heading" units="" type="enum" elements="1" options="Disabled,Enabled" defaultvalue="Enabled"/>
<field name="HeadingSetup" units="" type="int16" elements="2" elementnames="X,Y" defaultvalue="168,240"/>
<field name="Screen" units="" type="uint8" elements="1" defaultvalue="0"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="true" updatemode="onchange" period="0"/>
<telemetryflight acked="true" updatemode="onchange" period="0"/>