add some more gps status information

git-svn-id: http://www.neo1973-germany.de/svn@171 46df4e5c-bc4e-4628-a0fc-830ba316316d
This commit is contained in:
fgau 2008-09-23 04:57:24 +00:00
parent e0864bdd30
commit 6005068e07
3 changed files with 32 additions and 13 deletions

View file

@ -12,10 +12,10 @@ data {
item: "version" "prototype"; item: "version" "prototype";
item: "name" "epydial_blackwhite"; item: "name" "epydial_blackwhite";
} }
/*
images { images {
image: "bg.png" COMP; image: "bg.png" COMP;
}*/ }
color_classes { color_classes {
color_class { color_class {
@ -38,6 +38,20 @@ color_classes {
} }
} }
styles {
style {
name: "textblock_style";
base: "font=sans.bold font_size=20 align=left valign=top color=#fff wrap=word";
tag: "h1" "+ font_size=28";
tag: "/h1" "- \n";
tag: "p" "+";
tag: "/p" "- \n";
tag: "em" "+ style=underline underline_color=#000A underline2_color=#0005";
tag: "/em" "-";
tag: "br" "\n";
}
}
#define BUTTON(button_number, rel1x, rel1y, rel2x, rel2y, button_caption) \ #define BUTTON(button_number, rel1x, rel1y, rel2x, rel2y, button_caption) \
part { \ part { \
name: "button_"button_number; \ name: "button_"button_number; \
@ -113,11 +127,12 @@ collections {
parts { parts {
part { part {
name: "background"; name: "background";
type: RECT; type: IMAGE;
description { description {
color_class: "black"; state: "default" 0;
rel1 { relative: 0 0; offset: 0 0; }; rel1 { relative: 0 0; offset: 0 0; };
rel2 { relative: 1 1; offset: 0 0; }; rel2 { relative: 1 1; offset: 0 0; };
image { normal: "bg.png"; };
} }
} }
part { part {
@ -138,15 +153,19 @@ collections {
} }
} }
part { part {
name: "fix_caption"; name: "gps_caption";
type: TEXT; type: TEXTBLOCK;
mouse_events: 0; mouse_events: 0;
description { description {
color_class: "button_inactive"; color_class: "button_inactive";
state: "default" 0.0; align: 0.5 0.5;
fixed: 1 1;
rel1 { relative: 0 3/20; } rel1 { relative: 0 3/20; }
rel2 { relative: 1/3 4/20; } rel2 { relative: 1 10/20; }
text { text, "fix"; font: "Sans"; size, 1; align, 0 0.5; fit, 0 1; } text {
text: "gps";
style: "textblock_style";
}
} }
} /* end fix_caption */ } /* end fix_caption */
BUTTON(11, 1/3, 58/70, 2/3, 68/70, "on"); BUTTON(11, 1/3, 58/70, 2/3, 68/70, "on");

View file

@ -67,7 +67,7 @@ class GpsStatusScreen(EdjeGroup):
def register_pyneo_callbacks(self): def register_pyneo_callbacks(self):
PyneoController.register_callback("gps_power_status", self.on_gps_power_status) PyneoController.register_callback("gps_power_status", self.on_gps_power_status)
PyneoController.register_callback("gps_fix_change", self.on_gps_fix_change) PyneoController.register_callback("gps_position_change", self.on_gps_position_change)
def on_gps_power_status(self, status): def on_gps_power_status(self, status):
if status: p_status = "on" if status: p_status = "on"
@ -75,8 +75,8 @@ class GpsStatusScreen(EdjeGroup):
print '--- gps device is ', p_status print '--- gps device is ', p_status
self.part_text_set("button_11_caption", p_status) self.part_text_set("button_11_caption", p_status)
def on_gps_fix_change(self, status): def on_gps_position_change(self, status):
self.part_text_set("fix_caption", "fix: %s"%status) self.part_text_set("gps_caption", "fix: %s<br>longitude: %s<br>latitude: %s<br>altitude: %s"%(status['fix'], status['longitude'], status['latitude'], status['altitude']))
@edje.decorators.signal_callback("gps_send", "*") @edje.decorators.signal_callback("gps_send", "*")
def on_edje_signal_dialer_status_triggered(self, emission, source): def on_edje_signal_dialer_status_triggered(self, emission, source):
@ -410,7 +410,7 @@ class PyneoController(object):
print "GPS Status: " + str(status) print "GPS Status: " + str(status)
if status.has_key('fix'): if status.has_key('fix'):
class_.notify_callbacks("gps_fix_change", status['fix']) class_.notify_callbacks("gps_position_change", status)
@classmethod @classmethod
def on_gsm_wireless_status(class_, status_map): def on_gsm_wireless_status(class_, status_map):