示例#1
0
    def __init__(self, session, args=None):
        Screen.__init__(self, session)

        templist = sensors.getSensorsList(sensors.TYPE_TEMPERATURE)
        tempcount = len(templist)
        fanlist = sensors.getSensorsList(sensors.TYPE_FAN_RPM)
        fancount = len(fanlist)

        self["red"] = StaticText(_("Cancel"))
        self["green"] = StaticText(_("OK"))
        self["yellow"] = StaticText("")
        self["blue"] = StaticText("")

        for count in range(8):
            if count < tempcount:
                id = templist[count]
                self["SensorTempText%d" % count] = StaticText(
                    sensors.getSensorName(id))
                self["SensorTemp%d" % count] = SensorSource(sensorid=id)
            else:
                self["SensorTempText%d" % count] = StaticText("")
                self["SensorTemp%d" % count] = SensorSource()

            if count < fancount:
                id = fanlist[count]
                self["SensorFanText%d" % count] = StaticText(
                    sensors.getSensorName(id))
                self["SensorFan%d" % count] = SensorSource(sensorid=id)
            else:
                self["SensorFanText%d" % count] = StaticText("")
                self["SensorFan%d" % count] = SensorSource()

        self.list = []
        for count in range(fancontrol.getFanCount()):
            self.list.append(
                getConfigListEntry(
                    _("Fan %d Voltage") % (count + 1),
                    fancontrol.getConfig(count).vlt))
            self.list.append(
                getConfigListEntry(
                    _("Fan %d PWM") % (count + 1),
                    fancontrol.getConfig(count).pwm))
            self.list.append(
                getConfigListEntry(
                    _("Standby Fan %d Voltage") % (count + 1),
                    fancontrol.getConfig(count).vlt_standby))
            self.list.append(
                getConfigListEntry(
                    _("Standby Fan %d PWM") % (count + 1),
                    fancontrol.getConfig(count).pwm_standby))

        ConfigListScreen.__init__(self, self.list, session=self.session)

        self["actions"] = ActionMap(
            ["OkCancelActions", "ColorActions"], {
                "ok": self.save,
                "cancel": self.revert,
                "red": self.revert,
                "green": self.save
            }, -1)
示例#2
0
	def __init__(self, session, args = None):
		Screen.__init__(self, session)
		Screen.setTitle(self, _("Fan Control"))

		templist = sensors.getSensorsList(sensors.TYPE_TEMPERATURE)
		tempcount = len(templist)
		fanlist = sensors.getSensorsList(sensors.TYPE_FAN_RPM)
		fancount = len(fanlist)

		stb = HardwareInfo().get_device_name()
		self["key_red"] = self["red"] = StaticText(_("Cancel"))
		self["key_green"] = self["green"] = StaticText(_("OK"))

		for count in range(8):
			if count < tempcount:
				id = templist[count]
				if stb not in ('optimussos1', 'optimussos2', 'solo2'):
					self["SensorTempText%d" % count] = StaticText(sensors.getSensorName(id))
					self["SensorTemp%d" % count] = SensorSource(sensorid = id)
				elif stb in ('optimussos1', 'optimussos2', 'solo2') and id < 1:
					self["SensorTempText%d" % count] = StaticText(sensors.getSensorName(id))
					self["SensorTemp%d" % count] = SensorSource(sensorid = id)
				else:
					self["SensorTempText%d" % count] = StaticText("")
					self["SensorTemp%d" % count] = SensorSource()
			else:
				self["SensorTempText%d" % count] = StaticText("")
				self["SensorTemp%d" % count] = SensorSource()

			if count < fancount:
				id = fanlist[count]
				self["SensorFanText%d" % count] = StaticText(sensors.getSensorName(id))
				self["SensorFan%d" % count] = SensorSource(sensorid = id)
			else:
				self["SensorFanText%d" % count] = StaticText("")
				self["SensorFan%d" % count] = SensorSource()

		self.list = []
		for count in range(fancontrol.getFanCount()):
			if stb not in ('optimussos1', 'optimussos2', 'solo2'):
				self.list.append(getConfigListEntry(_("Fan %d voltage") % (count + 1), fancontrol.getConfig(count).vlt))
			self.list.append(getConfigListEntry(_("Fan %d PWM") % (count + 1), fancontrol.getConfig(count).pwm))
			if stb not in ('optimussos1', 'optimussos2', 'solo2'):
				self.list.append(getConfigListEntry(_("Standby fan %d voltage") % (count + 1), fancontrol.getConfig(count).vlt_standby))
			self.list.append(getConfigListEntry(_("Standby fan %d PWM") % (count + 1), fancontrol.getConfig(count).pwm_standby))

		ConfigListScreen.__init__(self, self.list, session = self.session)
		#self["config"].list = self.list
		#self["config"].setList(self.list)
		self["config"].l.setSeperation(300)

		self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "MenuActions"],
		{
			"ok": self.save,
			"cancel": self.revert,
			"red": self.revert,
			"green": self.save,
			"menu": self.closeRecursive,
		}, -1)
示例#3
0
	def __init__(self, session, args = None):
		Screen.__init__(self, session)
		Screen.setTitle(self, _("Fan Control"))

		templist = sensors.getSensorsList(sensors.TYPE_TEMPERATURE)
		tempcount = len(templist)
		fanlist = sensors.getSensorsList(sensors.TYPE_FAN_RPM)
		fancount = len(fanlist)

		self["key_red"] = self["red"] = StaticText(_("Cancel"))
		self["key_green"] = self["green"] = StaticText(_("OK"))

		for count in range(8):
			if count < tempcount:
				id = templist[count]
				if getBrandOEM() not in ('dags', 'vuplus'):
					self["SensorTempText%d" % count] = StaticText(sensors.getSensorName(id))
					self["SensorTemp%d" % count] = SensorSource(sensorid = id)
				elif getBrandOEM() in ('dags', 'vuplus') and id < 1:
					self["SensorTempText%d" % count] = StaticText(sensors.getSensorName(id))
					self["SensorTemp%d" % count] = SensorSource(sensorid = id)
				else:
					self["SensorTempText%d" % count] = StaticText("")
					self["SensorTemp%d" % count] = SensorSource()
			else:
				self["SensorTempText%d" % count] = StaticText("")
				self["SensorTemp%d" % count] = SensorSource()

			if count < fancount:
				id = fanlist[count]
				self["SensorFanText%d" % count] = StaticText(sensors.getSensorName(id))
				self["SensorFan%d" % count] = SensorSource(sensorid = id)
			else:
				self["SensorFanText%d" % count] = StaticText("")
				self["SensorFan%d" % count] = SensorSource()

		self.list = []
		for count in range(fancontrol.getFanCount()):
			if getBrandOEM() not in ('dags', 'vuplus'):
				self.list.append(getConfigListEntry(_("Fan %d voltage") % (count + 1), fancontrol.getConfig(count).vlt))
			self.list.append(getConfigListEntry(_("Fan %d PWM") % (count + 1), fancontrol.getConfig(count).pwm))
			if getBrandOEM() not in ('dags', 'vuplus'):
				self.list.append(getConfigListEntry(_("Standby fan %d voltage") % (count + 1), fancontrol.getConfig(count).vlt_standby))
			self.list.append(getConfigListEntry(_("Standby fan %d PWM") % (count + 1), fancontrol.getConfig(count).pwm_standby))

		ConfigListScreen.__init__(self, self.list, session = self.session)
		#self["config"].list = self.list
		#self["config"].setList(self.list)
		self["config"].l.setSeperation(300)

		self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "MenuActions"],
		{
			"ok": self.save,
			"cancel": self.revert,
			"red": self.revert,
			"green": self.save,
			"menu": self.closeRecursive,
		}, -1)
示例#4
0
	def __init__(self, session, args = None):
		Screen.__init__(self, session)

		self.setTitle(_("Temperature and fan control"))

		templist = sensors.getSensorsList(sensors.TYPE_TEMPERATURE)
		tempcount = len(templist)
		fanlist = sensors.getSensorsList(sensors.TYPE_FAN_RPM)
		fancount = len(fanlist)

		self["red"] = StaticText(_("Cancel"))
		self["green"] = StaticText(_("OK"))
		self["yellow"] = StaticText("")
		self["blue"] = StaticText("")

		for count in range(8):
			if count < tempcount:
				id = templist[count]
				self["SensorTempText%d" % count] = StaticText(sensors.getSensorName(id))
				self["SensorTemp%d" % count] = SensorSource(sensorid = id)
			else:
				self["SensorTempText%d" % count] = StaticText("")
				self["SensorTemp%d" % count] = SensorSource()

			if count < fancount:
				id = fanlist[count]
				self["SensorFanText%d" % count] = StaticText(sensors.getSensorName(id))
				self["SensorFan%d" % count] = SensorSource(sensorid = id)
			else:
				self["SensorFanText%d" % count] = StaticText("")
				self["SensorFan%d" % count] = SensorSource()

		self.list = []
		for count in range(fancontrol.getFanCount()):
			self.list.append(getConfigListEntry(_("Fan %d voltage") % (count + 1), fancontrol.getConfig(count).vlt))
			self.list.append(getConfigListEntry(_("Fan %d PWM") % (count + 1), fancontrol.getConfig(count).pwm))
			self.list.append(getConfigListEntry(_("Standby fan %d voltage") % (count + 1), fancontrol.getConfig(count).vlt_standby))
			self.list.append(getConfigListEntry(_("Standby fan %d PWM") % (count + 1), fancontrol.getConfig(count).pwm_standby))

		ConfigListScreen.__init__(self, self.list, session = self.session)
		#self["config"].list = self.list
		#self["config"].setList(self.list)
		self["config"].l.setSeperation(300)
		seperation = skin.parameters.get("ConfigListSeperator", 300)
		self["config"].l.setSeperation(seperation)

		self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "MenuActions"],
		{
			"ok": self.save,
			"cancel": self.revert,
			"red": self.revert,
			"green": self.save,
			"menu": self.closeRecursive,
		}, -1)
示例#5
0
	def __init__(self, session, args = None):
		self.skin = TempFanControl.skin
		Screen.__init__(self, session)
		
		templist = sensors.getSensorsList(sensors.TYPE_TEMPERATURE)
		self.tempcount = len(templist)
		fanlist = sensors.getSensorsList(sensors.TYPE_FAN_RPM)
		self.fancount = len(fanlist)
		self.onShown.append(self.setWindowTitle)
		self.onLayoutFinish.append(self.onLayoutEnd)
		
		self["red"] = StaticText(_("Cancel"))
		self["green"] = StaticText(_("OK"))
		self["yellow"] = StaticText("")
		self["blue"] = StaticText("")	
		self["SensorText"] = StaticText(_("Sensor"))
		self["TemperatureText"] = StaticText(_("Temperature"))
		fanstr=_("Fan %d") % 1
		fanstr=fanstr.rstrip(" 1")
		self["FanText"] = StaticText(fanstr)
		self["SpeedText"] = StaticText(_("Speed"))
		
		for count in range(8):
			if count < self.tempcount:
				id = templist[count]
				self["SensorTempText%d" % count] = StaticText(sensors.getSensorName(id))
				self["SensorTemp%d" % count] = SensorSource(sensorid = id)
			else:
				self["SensorTempText%d" % count] = StaticText("")
				self["SensorTemp%d" % count] = SensorSource()
				
			if count < self.fancount:
				id = fanlist[count]
				self["SensorFanText%d" % count] = StaticText(sensors.getSensorName(id))
				self["SensorFan%d" % count] = SensorSource(sensorid = id)
			else:
				self["SensorFanText%d" % count] = StaticText("")
				self["SensorFan%d" % count] = SensorSource()
		
		# explizit check on every entry
		self.onChangedEntry = []
		self.list = []
		ConfigListScreen.__init__(self, self.list, session = self.session, on_change = self.changedEntry)
		self.createSetup()

		self["actions"] = ActionMap(["OkCancelActions", "ColorActions"],
		{
			"ok": self.save,
			"cancel": self.revert,
			"red": self.revert,
			"green": self.save,
			"yellow": self.yellowKey,
			"blue": self.blueKey
		}, -1)
示例#6
0
	def initFanSensors(self):
		templist = sensors.getSensorsList(sensors.TYPE_TEMPERATURE)
		tempcount = len(templist)
		fanlist = sensors.getSensorsList(sensors.TYPE_FAN_RPM)
		fancount = len(fanlist)
		
		for count in range(8):
			if count < tempcount:
				id = templist[count]
				self["SensorTempText%d" % count] = StaticText(sensors.getSensorName(id))		
				self["SensorTemp%d" % count] = SensorSource(sensorid = id)
			else:
				self["SensorTempText%d" % count] = StaticText("")
				self["SensorTemp%d" % count] = SensorSource()
				
			if count < fancount:
				id = fanlist[count]
				self["SensorFanText%d" % count] = StaticText(sensors.getSensorName(id))		
				self["SensorFan%d" % count] = SensorSource(sensorid = id)
			else:
				self["SensorFanText%d" % count] = StaticText("")
				self["SensorFan%d" % count] = SensorSource()
 def TempMessung(self):
     maxtemp = 0
     sensotN = "No suitable sensor available ?"
     try:
         templist = sensors.getSensorsList(sensors.TYPE_TEMPERATURE)
         tempcount = len(templist)
         for count in range(tempcount):
             id = templist[count]
             tt = sensors.getSensorValue(id)
             if tt > maxtemp:
                 maxtemp = tt
                 sensotN = sensors.getSensorName(id)
                 if sensotN == "undefined":
                     sensotN = "sensor-" + str(id)
     except:
         pass
     return str(maxtemp) + "°C / " + sensotN
示例#8
0
 def getText(self):
     service = self.source.service
     info = service and service.info()
     if not info:
         return ""
     Ret_Text = ""
     if (self.type == self.SMART_INFO_H):
         xresol = info.getInfo(iServiceInformation.sVideoWidth)
         yresol = info.getInfo(iServiceInformation.sVideoHeight)
         feinfo = (service and service.frontendInfo())
         if (feinfo is not None) and (xresol > 0):
             #Ret_Text = str(xresol) + "x" + str(yresol) + "   "
             if (yresol > 580):
                 Ret_Text = "HD     "
             else:
                 Ret_Text = "SD     "
             frontendData = (feinfo and feinfo.getAll(True))
             if (frontendData is not None):
                 if ((frontendData.get("tuner_type") == "DVB-S")
                         or (frontendData.get("tuner_type") == "DVB-C")):
                     frequency = (str(
                         (frontendData.get("frequency") / 1000)) + " MHz")
                     symbolrate = (str(
                         (float(frontendData.get("symbol_rate")) /
                          float(1000000))) + " MS/s")
                     try:
                         if (frontendData.get("tuner_type") == "DVB-S"):
                             polarisation_i = frontendData.get(
                                 "polarization")
                         else:
                             polarisation_i = 0
                         fec_i = frontendData.get("fec_inner")
                         Ret_Text = Ret_Text + frequency + "  -  " + self.ar_pol[
                             polarisation_i] + "  -  " + self.ar_fec[
                                 fec_i] + "  -  " + symbolrate + "     "
                     except:
                         Ret_Text = Ret_Text + frequency + "     " + symbolrate + "     "
                     orb_pos = ""
                     if (frontendData.get("tuner_type") == "DVB-S"):
                         orbital_pos = int(frontendData["orbital_position"])
                         if orbital_pos > 1800:
                             orb_pos = str(
                                 (float(3600 - orbital_pos)) / 10.0) + "W"
                         elif orbital_pos > 0:
                             orb_pos = str(
                                 (float(orbital_pos)) / 10.0) + "E"
                     Ret_Text = Ret_Text + "Pos: " + orb_pos + "   "
                 elif (frontendData.get("tuner_type") == "DVB-T"):
                     frequency = (str(
                         (frontendData.get("frequency") / 1000)) + " MHz")
                     Ret_Text = Ret_Text + "Frequency: " + frequency
             prvd = info.getInfoString(iServiceInformation.sProvider)
             Ret_Text = self.kurz(prvd) + "     " + Ret_Text
         maxtemp = 0
         sensotN = "?"
         try:
             templist = sensors.getSensorsList(sensors.TYPE_TEMPERATURE)
             tempcount = len(templist)
             for count in range(tempcount):
                 id = templist[count]
                 tt = sensors.getSensorValue(id)
                 if tt > maxtemp:
                     maxtemp = tt
                     sensotN = sensors.getSensorName(id)
                     if sensotN == "undefined":
                         sensotN = "sensor-" + str(id)
             Ret_Text = "max. Box-Temp:  " + str(
                 maxtemp) + "°C / " + sensotN + "\n" + Ret_Text
         except:
             pass
         return Ret_Text
     return "n/a"
	def getText(self):
		service = self.source.service
		info = service and service.info()
		if not info:
			return ""	
		Ret_Text = ""
		if (self.type == self.SMART_INFO_H):
			xresol = info.getInfo(iServiceInformation.sVideoWidth)
			yresol = info.getInfo(iServiceInformation.sVideoHeight)
			feinfo = (service and service.frontendInfo())
			if (feinfo is not None) and (xresol>0):
				#Ret_Text = str(xresol) + "x" + str(yresol) + "   "
				if (yresol > 580):
					Ret_Text = "HD     "
				else:
					Ret_Text = "SD     "
				frontendData = (feinfo and feinfo.getAll(True))
				if (frontendData is not None):
					if ((frontendData.get("tuner_type") == "DVB-S") or (frontendData.get("tuner_type") == "DVB-C")):
						frequency = (str((frontendData.get("frequency") / 1000)) + " MHz")
						symbolrate = (str((float(frontendData.get("symbol_rate")) / float(1000000))) + " MS/s")
						try:
							if (frontendData.get("tuner_type") == "DVB-S"):
								polarisation_i = frontendData.get("polarization")
							else:
								polarisation_i = 0
							fec_i = frontendData.get("fec_inner")
							Ret_Text = Ret_Text + frequency + "  -  " + self.ar_pol[polarisation_i] + "  -  " + self.ar_fec[fec_i] + "  -  " + symbolrate + "     "
						except:
							Ret_Text = Ret_Text + frequency + "     " + symbolrate + "     "
						orb_pos = ""
						if (frontendData.get("tuner_type") == "DVB-S"):
							orbital_pos = int(frontendData["orbital_position"])
							if orbital_pos > 1800:
								orb_pos = str((float(3600 - orbital_pos))/10.0) + "W"
							elif orbital_pos > 0:
								orb_pos = str((float(orbital_pos))/10.0) + "E"
						Ret_Text = Ret_Text + "Pos: " + orb_pos + "   "
					elif (frontendData.get("tuner_type") == "DVB-T"):
						frequency = (str((frontendData.get("frequency") / 1000)) + " MHz")
						Ret_Text = Ret_Text + "Frequency: " + frequency
				prvd = info.getInfoString(iServiceInformation.sProvider)
				Ret_Text = self.kurz(prvd) + "     " + Ret_Text
			maxtemp = 0
			sensotN = "?"
			try:
				templist = sensors.getSensorsList(sensors.TYPE_TEMPERATURE)
				tempcount = len(templist)
				for count in range(tempcount):
					id = templist[count]
					tt = sensors.getSensorValue(id)
					if tt > maxtemp:
						maxtemp = tt
						sensotN = sensors.getSensorName(id)
						if sensotN == "undefined":
							sensotN = "sensor-"+str(id)
				Ret_Text = "max. Box-Temp:  " + str(maxtemp) + "°C / " + sensotN + "\n" + Ret_Text
			except:
				pass
			return Ret_Text
		return "n/a"