class NimManager:
class parseSats(ContentHandler):
- def __init__(self, satList, satellites):
+ def __init__(self, satList, satellites, transponders):
self.isPointsElement, self.isReboundsElement = 0, 0
self.satList = satList
self.satellites = satellites
+ self.transponders = transponders
def startElement(self, name, attrs):
if (name == "sat"):
tname = attrs.get('name',"")
self.satellites[tpos] = tname
self.satList.append( (tname, tpos) )
+ self.parsedSat = int(tpos)
+ elif (name == "transponder"):
+ freq = int(attrs.get('frequency',""))
+ sr = int(attrs.get('symbol_rate',""))
+ pol = int(attrs.get('polarization',""))
+ fec = int(attrs.get('fec_inner',""))
+ if self.parsedSat in self.transponders:
+ pass
+ else:
+ self.transponders[self.parsedSat] = [ ]
+
+ self.transponders[self.parsedSat].append((0, freq, sr, pol, fec))
+
+ def getTransponders(self, pos):
+ return self.transponders[pos]
def getConfiguredSats(self):
return self.sec.getSatList()
def readSatsfromFile(self):
self.satellites = { }
+ self.transponders = { }
print "Reading satellites.xml"
parser = make_parser()
- satHandler = self.parseSats(self.satList, self.satellites)
+ satHandler = self.parseSats(self.satList, self.satellites, self.transponders)
parser.setContentHandler(satHandler)
parser.parse('/etc/tuxbox/satellites.xml')
break
nimfile.close()
return self.nimType["empty/unknown"]
-
- if slotID == 0:
- return self.nimType["DVB-S"]
- elif slotID == 1:
- return self.nimType["DVB-S"]
- else:
- return self.nimType["empty/unknown"]
def getNimName(self, slotID):
#FIXME get it from /proc
self.satList = [ ]
self.readSatsfromFile()
-
+
self.nimCount = self.getNimSocketCount()
self.nimslots = [ ]
return list
def getSatListForNim(self, slotid):
- #print "slotid:", slotid
list = []
- #print "self.satellites:", self.satList[config.Nims[slotid].diseqcA.value]
- #print "diseqcA:", config.Nims[slotid].diseqcA.value
- if (config.Nims[slotid].diseqcMode.value <= 3):
- list.append(self.satList[config.Nims[slotid].diseqcA.value])
- if (0 < config.Nims[slotid].diseqcMode.value <= 3):
- list.append(self.satList[config.Nims[slotid].diseqcB.value])
- if (config.Nims[slotid].diseqcMode.value == 3):
- list.append(self.satList[config.Nims[slotid].diseqcC.value])
- list.append(self.satList[config.Nims[slotid].diseqcD.value])
+ if (self.getNimType(slotid) != self.nimType["empty/unknown"]):
+ #print "slotid:", slotid
+
+ #print "self.satellites:", self.satList[config.Nims[slotid].diseqcA.value]
+ #print "diseqcA:", config.Nims[slotid].diseqcA.value
+ if (config.Nims[slotid].diseqcMode.value <= 3):
+ list.append(self.satList[config.Nims[slotid].diseqcA.value])
+ if (0 < config.Nims[slotid].diseqcMode.value <= 3):
+ list.append(self.satList[config.Nims[slotid].diseqcB.value])
+ if (config.Nims[slotid].diseqcMode.value == 3):
+ list.append(self.satList[config.Nims[slotid].diseqcC.value])
+ list.append(self.satList[config.Nims[slotid].diseqcD.value])
return list
#callbacks for c++ config