2008-10-01 21:50:48 +00:00
|
|
|
#!/usr/bin/env python2.5
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
__author__ = "Soeren Apel (abraxa@dar-clan.de), Frank Gau (fgau@gau-net.de), Thomas Gstaedner (thomas (a) gstaedtner (.) net)"
|
|
|
|
__version__ = "prototype"
|
|
|
|
__copyright__ = "Copyright (c) 2008"
|
|
|
|
__license__ = "GPL3"
|
|
|
|
|
|
|
|
from epydial import *
|
|
|
|
|
|
|
|
class GsmStatusScreen(EdjeGroup):
|
|
|
|
def __init__(self, screen_manager):
|
|
|
|
EdjeGroup.__init__(self, screen_manager, GSM_STATUS_SCREEN_NAME)
|
|
|
|
|
|
|
|
def register_pyneo_callbacks(self):
|
|
|
|
PyneoController.register_callback("power_status_gsm", self.on_power_status_gsm)
|
2008-10-02 13:34:27 +00:00
|
|
|
PyneoController.register_callback("pwr_status_change", self.on_pwr_status_change)
|
|
|
|
|
|
|
|
def on_pwr_status_change(self, status):
|
2008-10-08 17:07:45 +00:00
|
|
|
self.part_text_set("pwr_caption", "battemp: %s<br>chgmode: %s<br>chgstate: %s<br>chgcur: %s<br>battvolt: %f"%(status['battemp'], status['chgmode'], status['chgstate'], status['chgcur'], status['battvolt']))
|
2008-10-01 21:50:48 +00:00
|
|
|
|
|
|
|
def on_power_status_gsm(self, status):
|
|
|
|
if status: p_status = "on"
|
|
|
|
else: p_status = "off"
|
|
|
|
print '--- gsm device is ', p_status
|
|
|
|
self.part_text_set("button_11_caption", p_status)
|
2008-10-08 17:07:45 +00:00
|
|
|
self.part_text_set("pwr_caption", "gsm device is %s"%p_status)
|
2008-10-01 21:50:48 +00:00
|
|
|
|
|
|
|
@edje.decorators.signal_callback("gsm_send", "*")
|
|
|
|
def on_edje_signal_dialer_status_triggered(self, emission, source):
|
|
|
|
status = self.part_text_get("button_11_caption")
|
|
|
|
if source == "<":
|
|
|
|
PyneoController.show_dialer_screen()
|
|
|
|
if source == "on" and status == "on": PyneoController.power_down_gsm()
|
|
|
|
elif source == "on" and status == "off":
|
|
|
|
self.first = time.time()
|
|
|
|
PyneoController.power_up_gsm()
|
|
|
|
|
|
|
|
|