add battvolt status in dialer screen
git-svn-id: http://www.neo1973-germany.de/svn@196 46df4e5c-bc4e-4628-a0fc-830ba316316d
This commit is contained in:
parent
a86bd2c172
commit
4178cdb08e
3 changed files with 22 additions and 4 deletions
|
@ -227,11 +227,23 @@ collections {
|
||||||
description {
|
description {
|
||||||
color_class: "button_inactive";
|
color_class: "button_inactive";
|
||||||
state: "default" 0.0;
|
state: "default" 0.0;
|
||||||
rel1 { relative: 2/3 0; }
|
rel1 { relative: 1/2 0; }
|
||||||
rel2 { relative: 1 1/20; }
|
rel2 { relative: 5/6 1/20; }
|
||||||
text { text, "signal"; font: "Sans"; size, 1; align, 1 0.5; fit, 0 1; }
|
text { text, "signal"; font: "Sans"; size, 1; align, 1 0.5; fit, 0 1; }
|
||||||
}
|
}
|
||||||
} /* end signalq_text */
|
} /* end signalq_battvolt_text */
|
||||||
|
part {
|
||||||
|
name: "battvolt_text";
|
||||||
|
type: TEXT;
|
||||||
|
mouse_events: 0;
|
||||||
|
description {
|
||||||
|
color_class: "button_inactive";
|
||||||
|
state: "default" 0.0;
|
||||||
|
rel1 { relative: 5/6 0; }
|
||||||
|
rel2 { relative: 1 1/20; }
|
||||||
|
text { text, "1.41 V"; font: "Sans"; size, 1; align, 1 0.5; fit, 0 1; }
|
||||||
|
}
|
||||||
|
} /* end battvolt_text */
|
||||||
part {
|
part {
|
||||||
name: "numberdisplay_background";
|
name: "numberdisplay_background";
|
||||||
type: RECT;
|
type: RECT;
|
||||||
|
|
|
@ -27,6 +27,10 @@ class DialerScreen(EdjeGroup):
|
||||||
# PyneoController.register_callback("gsm_dialing", self.on_gsm_dialing)
|
# PyneoController.register_callback("gsm_dialing", self.on_gsm_dialing)
|
||||||
PyneoController.register_callback("gsm_operator_change", self.on_gsm_operator_change)
|
PyneoController.register_callback("gsm_operator_change", self.on_gsm_operator_change)
|
||||||
PyneoController.register_callback("gsm_signal_strength_change", self.on_gsm_signal_strength_change)
|
PyneoController.register_callback("gsm_signal_strength_change", self.on_gsm_signal_strength_change)
|
||||||
|
PyneoController.register_callback("battvolt_change", self.on_battvolt_change)
|
||||||
|
|
||||||
|
def on_battvolt_change(self, battvolt):
|
||||||
|
self.part_text_set("battvolt_text", "%s V"%str(battvolt)[:4])
|
||||||
|
|
||||||
def on_sim_key_required(self, key_type):
|
def on_sim_key_required(self, key_type):
|
||||||
print '---', 'opening keyring'
|
print '---', 'opening keyring'
|
||||||
|
@ -51,7 +55,7 @@ class DialerScreen(EdjeGroup):
|
||||||
self.part_text_set("operater_text", operator)
|
self.part_text_set("operater_text", operator)
|
||||||
|
|
||||||
def on_gsm_signal_strength_change(self, rssi):
|
def on_gsm_signal_strength_change(self, rssi):
|
||||||
self.part_text_set("signalq_text", "%s dBm"%str(rssi))
|
self.part_text_set("signalq_text", "%s dBm /"%str(rssi))
|
||||||
|
|
||||||
def display_time(self):
|
def display_time(self):
|
||||||
self.part_text_set("time_text", time.strftime("%H:%M", time.localtime()));
|
self.part_text_set("time_text", time.strftime("%H:%M", time.localtime()));
|
||||||
|
|
|
@ -335,6 +335,8 @@ class PyneoController(object):
|
||||||
def on_pwr_status(class_, status_map):
|
def on_pwr_status(class_, status_map):
|
||||||
status = dedbusmap(status_map)
|
status = dedbusmap(status_map)
|
||||||
print "POWER Status: " + str(status)
|
print "POWER Status: " + str(status)
|
||||||
|
if status.has_key('battvolt'):
|
||||||
|
class_.notify_callbacks("battvolt_change", status['battvolt'])
|
||||||
class_.notify_callbacks("pwr_status_change", status)
|
class_.notify_callbacks("pwr_status_change", status)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
Loading…
Reference in a new issue