Exemplo n.º 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)
Exemplo n.º 2
0
	def revert(self):
		for count in range(fancontrol.getFanCount()):
#			fancontrol.getConfig(count).vlt.load()		# [iq]
			fancontrol.getConfig(count).pwm.load()
#			fancontrol.getConfig(count).vlt_standby.load()		# [iq]
			fancontrol.getConfig(count).pwm_standby.load()
		self.close()
Exemplo n.º 3
0
	def save(self):
		for count in range(fancontrol.getFanCount()):
#			fancontrol.getConfig(count).vlt.save()		# [iq]
			fancontrol.getConfig(count).pwm.save()
#			fancontrol.getConfig(count).vlt_standby.save()		# [iq]
			fancontrol.getConfig(count).pwm_standby.save()
		self.close()
Exemplo n.º 4
0
 def save(self):
     for count in range(fancontrol.getFanCount()):
         #			fancontrol.getConfig(count).vlt.save()		# [iq]
         fancontrol.getConfig(count).pwm.save()
         #			fancontrol.getConfig(count).vlt_standby.save()		# [iq]
         fancontrol.getConfig(count).pwm_standby.save()
     self.close()
Exemplo n.º 5
0
 def revert(self):
     for count in range(fancontrol.getFanCount()):
         #			fancontrol.getConfig(count).vlt.load()		# [iq]
         fancontrol.getConfig(count).pwm.load()
         #			fancontrol.getConfig(count).vlt_standby.load()		# [iq]
         fancontrol.getConfig(count).pwm_standby.load()
     self.close()
Exemplo n.º 6
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)
Exemplo n.º 7
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)
Exemplo n.º 8
0
	def createSetup(self):
		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))
			self["config"].list = self.list
			self["config"].l.setList(self.list)
Exemplo n.º 9
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)
Exemplo n.º 10
0
	def revert(self):
		for count in range(fancontrol.getFanCount()):
			if getBrandOEM() not in ('dags', 'vuplus'):
				fancontrol.getConfig(count).vlt.load()
			fancontrol.getConfig(count).pwm.load()
			if getBrandOEM() not in ('dags', 'vuplus'):
				fancontrol.getConfig(count).vlt_standby.load()
			fancontrol.getConfig(count).pwm_standby.load()
		self.close()
Exemplo n.º 11
0
 def revert(self):
     for count in range(fancontrol.getFanCount()):
         if getBrandOEM() not in ('dags', 'vuplus'):
             fancontrol.getConfig(count).vlt.load()
         fancontrol.getConfig(count).pwm.load()
         if getBrandOEM() not in ('dags', 'vuplus'):
             fancontrol.getConfig(count).vlt_standby.load()
         fancontrol.getConfig(count).pwm_standby.load()
     self.close()
Exemplo n.º 12
0
	def revert(self):
		for count in range(fancontrol.getFanCount()):
			if not getBoxType().startswith('tm') or not getBoxType().startswith('vu'):
				fancontrol.getConfig(count).vlt.load()
			fancontrol.getConfig(count).pwm.load()
			if not getBoxType().startswith('tm') or not getBoxType().startswith('vu'):
				fancontrol.getConfig(count).vlt_standby.load()
			fancontrol.getConfig(count).pwm_standby.load()
		self.close()
Exemplo n.º 13
0
 def save(self):
     for count in range(fancontrol.getFanCount()):
         if getBrandOEM() not in ("dags", "vuplus"):
             fancontrol.getConfig(count).vlt.save()
         fancontrol.getConfig(count).pwm.save()
         if getBrandOEM() not in ("dags", "vuplus"):
             fancontrol.getConfig(count).vlt_standby.save()
         fancontrol.getConfig(count).pwm_standby.save()
     self.close()
Exemplo n.º 14
0
	def revert(self):
		for count in range(fancontrol.getFanCount()):
			stb = HardwareInfo().get_device_name()
			if stb not in ('optimussos1', 'optimussos2', 'solo2'):
				fancontrol.getConfig(count).vlt.load()
			fancontrol.getConfig(count).pwm.load()
			if stb not in ('optimussos1', 'optimussos2', 'solo2'):
				fancontrol.getConfig(count).vlt_standby.load()
			fancontrol.getConfig(count).pwm_standby.load()
		self.close()
Exemplo n.º 15
0
 def revert(self):
     for count in range(fancontrol.getFanCount()):
         if not getBoxType().startswith(
                 'tm') or not getBoxType().startswith('vu'):
             fancontrol.getConfig(count).vlt.load()
         fancontrol.getConfig(count).pwm.load()
         if not getBoxType().startswith(
                 'tm') or not getBoxType().startswith('vu'):
             fancontrol.getConfig(count).vlt_standby.load()
         fancontrol.getConfig(count).pwm_standby.load()
     self.close()
Exemplo n.º 16
0
def applySettings(mode, firststart=None, modestandby=None):
    fancontrol.getConfig(0).pwm.value = mode

    if firststart:
        if config.plugins.FanControl.StandbyOff.value == "false":
            fancontrol.getConfig(0).pwm_standby.value = 255
        else:
            fancontrol.getConfig(0).pwm_standby.value = 0
    else:
        if modestandby == "false":
            fancontrol.getConfig(0).pwm_standby.value = 255
        else:
            fancontrol.getConfig(0).pwm_standby.value = 0

    fancontrol.getConfig(0).pwm.save()
    fancontrol.getConfig(0).pwm_standby.save()
Exemplo n.º 17
0
def applySettings(mode, firststart = None, modestandby = None):
	fancontrol.getConfig(0).pwm.value = mode

	if firststart:
		if config.plugins.FanControl.StandbyOff.value == "false":
			fancontrol.getConfig(0).pwm_standby.value = 255
		else:
			fancontrol.getConfig(0).pwm_standby.value = 0
	else:
		if modestandby == "false":
			fancontrol.getConfig(0).pwm_standby.value = 255
		else:
			fancontrol.getConfig(0).pwm_standby.value = 0

	fancontrol.getConfig(0).pwm.save()
	fancontrol.getConfig(0).pwm_standby.save()