From fba15fa1e8e9dacba942dd21ad3245a4a68c3be8 Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Tue, 4 Apr 2006 11:18:39 +0000 Subject: small changes --- .../SystemPlugins/PositionerSetup/plugin.py | 29 ++++++++++++++-------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py') diff --git a/lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py b/lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py index 067ef9ea..390d55a0 100644 --- a/lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py +++ b/lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py @@ -185,18 +185,25 @@ class PositionerSetup(Screen): def diseqc(self, what): res_mgr = eDVBResourceManagerPtr() - eDVBResourceManager.getInstance(res_mgr) - raw_channel = iDVBChannelPtr() - res_mgr.allocateRawChannel(raw_channel, self.feid) - frontend = raw_channel.getFrontend() - cmd = eDVBDiseqcCommand - if what == "moveWest": - cmd.setCommandString('\xe1\x31\x69\x40') - elif what == "moveEast": - cmd.setCommandString('\xe1\x31\x68\x40') + if eDVBResourceManager.getInstance(res_mgr) == 0: + raw_channel = iDVBChannelPtr() + if res_mgr.allocateRawChannel(raw_channel, self.feid) == 0: + frontend = iDVBFrontendPtr() + if raw_channel.getFrontend(frontend) == 0: + cmd = eDVBDiseqcCommand() + if what == "moveWest": + cmd.setCommandString('\xe1\x31\x69\x40') + elif what == "moveEast": + cmd.setCommandString('\xe1\x31\x68\x40') + else: + cmd.setCommandString('\xe0\x31\x60') #positioner stop + frontend.sendDiseqc(cmd) + else: + print "getFrontend failed" + else: + print "getRawChannel failed" else: - cmd.setCommandString('\xe0\x31\x60') #positioner stop - frontend.sendDiseqc(cmd) + print "getResourceManager instance failed" def updateStatus(self): if eDVBSatelliteEquipmentControl.getInstance().isRotorMoving(): -- cgit v1.2.3