def actualizeCfgLastRotorPosition(self): if eDVBSatelliteEquipmentControl.getInstance().isRotorMoving(): current_pos = eDVBSatelliteEquipmentControl.getInstance( ).getTargetOrbitalPosition() if current_pos != config.misc.lastrotorposition.value: self.LastRotorPos = config.misc.lastrotorposition.value = current_pos config.misc.lastrotorposition.save()
def configChanged(self, configElement): self.showdish = configElement.value if configElement.value == "off": self["Dishpixmap"].setConnect(lambda: False) else: self["Dishpixmap"].setConnect( eDVBSatelliteEquipmentControl.getInstance().isRotorMoving)
def __init__(self, type): Converter.__init__(self, type) self.LastRotorPos = config.misc.lastrotorposition.value config.misc.lastrotorposition.addNotifier(self.forceChanged, initial_call=False) config.misc.showrotorposition.addNotifier(self.show_hide, initial_call=False) self.sec = eDVBSatelliteEquipmentControl.getInstance() self.colors = parameters.get("RotorPositionColors", (0x0000f0f0, 0x00f0f0f0)) # tuner letter, nim_text
def updateRotorMovingState(self): moving = eDVBSatelliteEquipmentControl.getInstance().isRotorMoving() if moving: if self.cur_orbpos != INVALID_POSITION and self.cur_orbpos != config.misc.lastrotorposition.value: config.misc.lastrotorposition.value = self.cur_orbpos config.misc.lastrotorposition.save() if self.__state == self.STATE_HIDDEN: self.show()
def waitRotorMoving(self): moving = eDVBSatelliteEquipmentControl.getInstance().isRotorMoving() if moving: if not self.rotorTimer.isActive(): self.rotorTimer.start(1500, True) else: self.rotorTimer.stop() self.navcore.stopService()
def __init__(self, type): Converter.__init__(self, type) self.LastRotorPos = config.misc.lastrotorposition.value config.misc.lastrotorposition.addNotifier(self.forceChanged, initial_call=False) config.misc.showrotorposition.addNotifier(self.show_hide, initial_call=False) self.sec = eDVBSatelliteEquipmentControl.getInstance()
def destroy(self): if not self.frontend_source and not self.service_source: PerServiceBase.destroy(self) res_mgr = eDVBResourceManager.getInstance() if res_mgr: res_mgr.frontendUseMaskChanged.get().remove(self.updateTunerMask) sec = eDVBSatelliteEquipmentControl.getInstance() if sec: sec.slotRotorSatPosChanged.get().remove(self.updateSlotRotorSatPosition) Source.destroy(self)
def epgTimeout(self): if eDVBSatelliteEquipmentControl.getInstance().isRotorMoving(): # rotor is moving, timeout raised too early...check again in 5 seconds self.epgTimeoutTimer.start(5000, True) else: # epgcache-signal is not responding...maybe service/transponder is already running or cache was already updated...? step to next entry print( "[EPGRefresh] - finished channel without epg update. Reason: epgTimeout" ) epgrefreshtimer.add( EPGRefreshTimerEntry(time(), self.refresh, nocheck=True))
def updateRotorMovingState(self): moving = eDVBSatelliteEquipmentControl.getInstance().isRotorMoving() #if not moving: if moving: if self.__state == self.STATE_HIDDEN: self.show() #self.rotorTimer.start(500, True) else: if self.__state == self.STATE_SHOWN: #self.rotorTimer.stop() self.hide()
def epgTimeout(self): if eDVBSatelliteEquipmentControl.getInstance().isRotorMoving(): # rotor is moving, timeout raised too early...check again in 5 seconds self.epgTimeoutTimer.start(5000, True) else: # epgcache-signal is not responding...maybe service/transponder is already running or cache was already updated...? step to next entry print("[EPGRefresh] - finished channel without epg update. Reason: epgTimeout") epgrefreshtimer.add(EPGRefreshTimerEntry( time(), self.refresh, nocheck = True) )
def getActiveTuner(self): if not eDVBSatelliteEquipmentControl.getInstance().isRotorMoving(): service = self.source.service feinfo = service and service.frontendInfo() tuner = feinfo and feinfo.getAll(True) if tuner: num = tuner.get("tuner_number") orb_pos = tuner.get("orbital_position") if isinstance(num, int) and orb_pos: satList = nimmanager.getRotorSatListForNim(num) for sat in satList: if sat[0] == orb_pos: return num return ""
def __init__(self, service_source=None, frontend_source=None, navcore=None): self.navcore = None Source.__init__(self) if navcore: PerServiceBase.__init__(self, navcore, { iPlayableService.evTunedIn: self.updateFrontendData, iPlayableService.evEnd: self.serviceEnd }) res_mgr = eDVBResourceManager.getInstance() if res_mgr: res_mgr.frontendUseMaskChanged.get().append(self.updateTunerMask) self.service_source = service_source self.frontend_source = frontend_source self.tuner_mask = 0 sec = eDVBSatelliteEquipmentControl.getInstance() if sec: sec.slotRotorSatPosChanged.get().append(self.updateSlotRotorSatPosition) self.updateFrontendData()
def configChanged(self, configElement): self.showdish = configElement.getValue() if configElement.getValue() == "off": self["Dishpixmap"].setConnect(lambda: False) else: self["Dishpixmap"].setConnect(eDVBSatelliteEquipmentControl.getInstance().isRotorMoving)
def actualizeCfgLastRotorPosition(self): if eDVBSatelliteEquipmentControl.getInstance().isRotorMoving(): current_pos = eDVBSatelliteEquipmentControl.getInstance().getTargetOrbitalPosition() if current_pos != config.misc.lastrotorposition.value: self.LastRotorPos = config.misc.lastrotorposition.value = current_pos config.misc.lastrotorposition.save()
def getRotorMovingState(self): return eDVBSatelliteEquipmentControl.getInstance().isRotorMoving()
def createConfig(self, frontendData): defaultSat = { "orbpos": 192, "system": eDVBFrontendParametersSatellite.System_DVB_S, "frequency": 11836, "inversion": eDVBFrontendParametersSatellite.Inversion_Unknown, "symbolrate": 27500, "polarization": eDVBFrontendParametersSatellite.Polarisation_Horizontal, "fec": eDVBFrontendParametersSatellite.FEC_Auto, "fec_s2_8psk": eDVBFrontendParametersSatellite.FEC_Auto, "fec_s2_qpsk": eDVBFrontendParametersSatellite.FEC_Auto, "modulation": eDVBFrontendParametersSatellite.Modulation_QPSK } if frontendData is not None: ttype = frontendData.get("tuner_type", "UNKNOWN") if ttype == "DVB-S": defaultSat["system"] = frontendData.get( "system", eDVBFrontendParametersSatellite.System_DVB_S) defaultSat["frequency"] = frontendData.get("frequency", 0) / 1000 defaultSat["inversion"] = frontendData.get( "inversion", eDVBFrontendParametersSatellite.Inversion_Unknown) defaultSat["symbolrate"] = frontendData.get("symbol_rate", 0) / 1000 defaultSat["polarization"] = frontendData.get( "polarization", eDVBFrontendParametersSatellite.Polarisation_Horizontal) defaultSat["modulation"] = frontendData.get( "modulation", eDVBFrontendParametersSatellite.Modulation_QPSK) if defaultSat[ "system"] == eDVBFrontendParametersSatellite.System_DVB_S2: if defaultSat[ "modulation"] == eDVBFrontendParametersSatellite.Modulation_QPSK: defaultSat["fec_s2_qpsk"] = frontendData.get( "fec_inner", eDVBFrontendParametersSatellite.FEC_Auto) else: defaultSat["fec_s2_8psk"] = frontendData.get( "fec_inner", eDVBFrontendParametersSatellite.FEC_Auto) defaultSat["rolloff"] = frontendData.get( "rolloff", eDVBFrontendParametersSatellite.RollOff_alpha_0_35) defaultSat["pilot"] = frontendData.get( "pilot", eDVBFrontendParametersSatellite.Pilot_Unknown) else: defaultSat["fec"] = frontendData.get( "fec_inner", eDVBFrontendParametersSatellite.FEC_Auto) defaultSat["orbpos"] = frontendData.get("orbital_position", 0) self.scan_sat = ConfigSubsection() self.scan_clearallservices = ConfigSelection( default="no", choices=[("no", _("no")), ("yes", _("yes")), ("yes_hold_feeds", _("yes (keep feeds)"))]) self.scan_onlyfree = ConfigYesNo(default=False) self.scan_networkScan = ConfigYesNo(default=False) # self.scan_skipEmpty = ConfigYesNo(default = True) # self.scan_otherSDT = ConfigYesNo(default = False) nim_list = [] # collect all nims which are *not* set to "nothing" for n in nimmanager.nim_slots: if not n.isCompatible("DVB-S"): continue if not self.legacy: config = n.config.dvbs else: config = n.config config_mode = config.configMode.value if config_mode == "nothing": continue if config_mode == "advanced" and len( nimmanager.getSatListForNim(n.slot)) < 1: continue if config_mode in ("loopthrough", "satposdepends"): root_id = nimmanager.sec.getRoot(n.slot_id, int(config.connectedTo.value)) if n.type == nimmanager.nim_slots[ root_id].type: # check if connected from a DVB-S to DVB-S2 Nim or vice versa continue nim_list.append((str(n.slot), n.friendly_full_description)) self.scan_nims = ConfigSelection(choices=nim_list) self.scan_sat.bs_system = ConfigSelection( default=eDVBFrontendParametersSatellite.System_DVB_S2, choices=[(eDVBFrontendParametersSatellite.System_DVB_S2, _("DVB-S + DVB-S2")), (eDVBFrontendParametersSatellite.System_DVB_S, _("DVB-S only"))]) self.scan_sat.bs_accuracy = ConfigSelection(default=2, choices=[ (1, "1"), (2, "2"), (3, "3"), (4, "4"), (5, "5") ]) self.scan_sat.bs_horizontal = ConfigYesNo(default=True) self.scan_sat.bs_vertical = ConfigYesNo(default=True) self.scan_scansat = {} for sat in nimmanager.satList: #print sat[1] self.scan_scansat[sat[0]] = ConfigYesNo(default=False) sec = secClass.getInstance() self.nim_sat_frequency_range = [] self.nim_sat_band_cutoff_frequency = [] self.scan_satselection = [] for slot in nimmanager.nim_slots: slot_id = slot.slot self.nim_sat_frequency_range.append if slot.isCompatible("DVB-S"): satlist_for_slot = self.satList[slot_id] self.scan_satselection.append( getConfigSatlist(defaultSat["orbpos"], satlist_for_slot)) sat_freq_range = {} sat_band_cutoff = {} for sat in satlist_for_slot: orbpos = sat[0] sat_freq_range[orbpos] = sec.getFrequencyRangeList( slot_id, orbpos) sat_band_cutoff[orbpos] = sec.getBandCutOffFrequency( slot_id, orbpos) self.nim_sat_frequency_range.append(sat_freq_range) self.nim_sat_band_cutoff_frequency.append(sat_band_cutoff) else: self.nim_sat_frequency_range.append(None) self.nim_sat_band_cutoff_frequency.append(None) self.scan_satselection.append(None) return True
def configChanged(self, configElement): if not configElement.value: self["Dishpixmap"].setConnect(lambda: False) else: self["Dishpixmap"].setConnect(eDVBSatelliteEquipmentControl.getInstance().isRotorMoving)
def createConfig(self, frontendData): defaultSat = { "orbpos": 192, "system": eDVBFrontendParametersSatellite.System_DVB_S, "frequency": 11836, "inversion": eDVBFrontendParametersSatellite.Inversion_Unknown, "symbolrate": 27500, "polarization": eDVBFrontendParametersSatellite.Polarisation_Horizontal, "fec": eDVBFrontendParametersSatellite.FEC_Auto, "fec_s2_8psk": eDVBFrontendParametersSatellite.FEC_Auto, "fec_s2_qpsk": eDVBFrontendParametersSatellite.FEC_Auto, "modulation": eDVBFrontendParametersSatellite.Modulation_QPSK } if frontendData is not None: ttype = frontendData.get("tuner_type", "UNKNOWN") if ttype == "DVB-S": defaultSat["system"] = frontendData.get("system", eDVBFrontendParametersSatellite.System_DVB_S) defaultSat["frequency"] = frontendData.get("frequency", 0) / 1000 defaultSat["inversion"] = frontendData.get("inversion", eDVBFrontendParametersSatellite.Inversion_Unknown) defaultSat["symbolrate"] = frontendData.get("symbol_rate", 0) / 1000 defaultSat["polarization"] = frontendData.get("polarization", eDVBFrontendParametersSatellite.Polarisation_Horizontal) defaultSat["modulation"] = frontendData.get("modulation", eDVBFrontendParametersSatellite.Modulation_QPSK) if defaultSat["system"] == eDVBFrontendParametersSatellite.System_DVB_S2: if defaultSat["modulation"] == eDVBFrontendParametersSatellite.Modulation_QPSK: defaultSat["fec_s2_qpsk"] = frontendData.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto) else: defaultSat["fec_s2_8psk"] = frontendData.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto) defaultSat["rolloff"] = frontendData.get("rolloff", eDVBFrontendParametersSatellite.RollOff_alpha_0_35) defaultSat["pilot"] = frontendData.get("pilot", eDVBFrontendParametersSatellite.Pilot_Unknown) else: defaultSat["fec"] = frontendData.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto) defaultSat["orbpos"] = frontendData.get("orbital_position", 0) self.scan_sat = ConfigSubsection() self.scan_clearallservices = ConfigSelection(default = "no", choices = [("no", _("no")), ("yes", _("yes")), ("yes_hold_feeds", _("yes (keep feeds)"))]) self.scan_onlyfree = ConfigYesNo(default = False) self.scan_networkScan = ConfigYesNo(default = False) # self.scan_skipEmpty = ConfigYesNo(default = True) # self.scan_otherSDT = ConfigYesNo(default = False) nim_list = [] # collect all nims which are *not* set to "nothing" for n in nimmanager.nim_slots: if not n.isCompatible("DVB-S"): continue if not self.legacy: nimconfig = n.config.dvbs else: nimconfig = n.config config_mode = nimconfig.configMode.value if config_mode == "nothing": continue if config_mode == "advanced" and len(nimmanager.getSatListForNim(n.slot)) < 1: continue if config_mode in ("loopthrough", "satposdepends"): root_id = nimmanager.sec.getRoot(n.slot_id, int(nimconfig.connectedTo.value)) if n.type == nimmanager.nim_slots[root_id].type: # check if connected from a DVB-S to DVB-S2 Nim or vice versa continue nim_list.append((str(n.slot), n.friendly_full_description)) self.scan_nims = ConfigSelection(choices = nim_list) self.scan_sat.bs_system = ConfigSelection(default = eDVBFrontendParametersSatellite.System_DVB_S2, choices = [ (eDVBFrontendParametersSatellite.System_DVB_S2, _("DVB-S + DVB-S2")), (eDVBFrontendParametersSatellite.System_DVB_S, _("DVB-S only"))]) self.scan_sat.bs_accuracy = ConfigSelection(default = 2, choices = [ (1, "1"), (2, "2"), (3, "3"), (4, "4"), (5, "5")]) self.scan_sat.bs_horizontal = ConfigYesNo(default = True) self.scan_sat.bs_vertical = ConfigYesNo(default = True) self.scan_scansat = {} for sat in nimmanager.satList: #print sat[1] self.scan_scansat[sat[0]] = ConfigYesNo(default = False) sec = secClass.getInstance() self.nim_sat_frequency_range = [] self.nim_sat_band_cutoff_frequency = [] self.scan_satselection = [] for slot in nimmanager.nim_slots: slot_id = slot.slot self.nim_sat_frequency_range.append if slot.isCompatible("DVB-S"): satlist_for_slot = self.satList[slot_id] self.scan_satselection.append(getConfigSatlist(defaultSat["orbpos"], satlist_for_slot)) sat_freq_range = {} sat_band_cutoff = {} for sat in satlist_for_slot: orbpos = sat[0] sat_freq_range[orbpos] = sec.getFrequencyRangeList(slot_id, orbpos) sat_band_cutoff[orbpos] = sec.getBandCutOffFrequency(slot_id, orbpos) self.nim_sat_frequency_range.append(sat_freq_range) self.nim_sat_band_cutoff_frequency.append(sat_band_cutoff) else: self.nim_sat_frequency_range.append(None) self.nim_sat_band_cutoff_frequency.append(None) self.scan_satselection.append(None) return True
def configChanged(self, configElement): self.showdish = configElement.value if configElement.value == 'off': self['Dishpixmap'].setConnect(lambda : False) else: self['Dishpixmap'].setConnect(eDVBSatelliteEquipmentControl.getInstance().isRotorMoving)