add fix or no fix
git-svn-id: http://www.neo1973-germany.de/svn@169 46df4e5c-bc4e-4628-a0fc-830ba316316d
This commit is contained in:
parent
1d4693fdcb
commit
c6fc5cc11e
1 changed files with 21 additions and 3 deletions
|
@ -67,12 +67,16 @@ 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)
|
||||||
|
|
||||||
def on_gps_power_status(self, status):
|
def on_gps_power_status(self, status):
|
||||||
if status: p_status = "on"
|
if status: p_status = "on"
|
||||||
else: p_status = "off"
|
else: p_status = "off"
|
||||||
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):
|
||||||
|
self.part_text_set("fix_caption", "fix: %s"%status)
|
||||||
|
|
||||||
@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):
|
||||||
|
@ -301,16 +305,22 @@ class PyneoController(object):
|
||||||
# No error (anymore)
|
# No error (anymore)
|
||||||
if class_._gps_timer: class_._gps_timer.stop()
|
if class_._gps_timer: class_._gps_timer.stop()
|
||||||
|
|
||||||
|
# Register our own D-Bus Gps callbacks
|
||||||
|
class_.gps.connect_to_signal("Position", class_.on_gps_position_status, dbus_interface=DIN_LOCATION)
|
||||||
|
|
||||||
class_.notify_callbacks("gps_power_status", class_.gps.GetPower(APP_TITLE, dbus_interface=DIN_POWERED))
|
class_.notify_callbacks("gps_power_status", class_.gps.GetPower(APP_TITLE, dbus_interface=DIN_POWERED))
|
||||||
|
|
||||||
|
status = class_.gps.GetPosition(dbus_interface=DIN_LOCATION)
|
||||||
|
class_.on_gps_position_status(status)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def power_down_gps(class_):
|
def power_down_gps(class_):
|
||||||
class_.gps.SetPower(APP_TITLE, False, dbus_interface=DIN_POWERED)
|
class_.gps.SetPower(APP_TITLE, False, dbus_interface=DIN_POWERED)
|
||||||
class_.notify_callbacks("gps_power_status", class_.gps.GetPower(APP_TITLE, dbus_interface=DIN_POWERED))
|
class_.notify_callbacks("gps_power_status", class_.gps.GetPower(APP_TITLE, dbus_interface=DIN_POWERED))
|
||||||
|
|
||||||
@classmethod
|
# @classmethod
|
||||||
def power_status_gsm(class_):
|
# def power_status_gsm(class_):
|
||||||
return class_.gsm.GetPower(APP_TITLE, dbus_interface=DIN_POWERED)
|
# return class_.gsm.GetPower(APP_TITLE, dbus_interface=DIN_POWERED)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def power_up_gsm(class_):
|
def power_up_gsm(class_):
|
||||||
|
@ -394,6 +404,14 @@ class PyneoController(object):
|
||||||
# Remove the call from our list
|
# Remove the call from our list
|
||||||
# class_._calls.__delitem__(call_obj)
|
# class_._calls.__delitem__(call_obj)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def on_gps_position_status(class_, status_map):
|
||||||
|
status = dedbusmap(status_map)
|
||||||
|
print "GPS Status: " + str(status)
|
||||||
|
|
||||||
|
if status.has_key('fix'):
|
||||||
|
class_.notify_callbacks("gps_fix_change", status['fix'])
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def on_gsm_wireless_status(class_, status_map):
|
def on_gsm_wireless_status(class_, status_map):
|
||||||
status = dedbusmap(status_map)
|
status = dedbusmap(status_map)
|
||||||
|
|
Loading…
Reference in a new issue