[FanControl2] Fix: by typo crash possible ; some small changes
authorJörg Trahm <joergm6@online.de>
Thu, 27 Jan 2011 18:39:34 +0000 (19:39 +0100)
committerJörg Trahm <joergm6@online.de>
Thu, 27 Jan 2011 18:39:34 +0000 (19:39 +0100)
fancontrol2/CONTROL/control
fancontrol2/src/FC2webSite.py
fancontrol2/src/globals.py
fancontrol2/src/plugin.py

index f697c57..5694ffa 100644 (file)
@@ -1,6 +1,6 @@
 Package: enigma2-plugin-extensions-fancontrol2
-Version: 2.4-20110113-r5
-Description: Controlling Fan
+Version: 2.5
+Description: Temperature dependent fan control
 Architecture: mipsel
 Section: extra
 Priority: optional
index d96a8e8..53751bc 100644 (file)
@@ -9,8 +9,6 @@ from Components.config import configfile, config
 import os
 import datetime
 
-HeadLine = "Time;Temp;RPM;VLT;PWM;HDD;Status;Temp1;Temp2;Temp3;Temp4;Temp5;Temp6;Temp7;Temp8\r\n"
-
 ########################################################
 class FC2web(resource.Resource):
     
@@ -94,11 +92,18 @@ class FC2web(resource.Resource):
                html += "myIFrameName.document.body.scrollTop = myIFrameName.document.body.scrollHeight*100;\n" 
                html += "</script>\n"
 
-               html += "</form>\n"
-               html += "Version: %s\n" % Version
+               html += "<table border=\"1\" width=\"500\">\n"
+               html += "<tr>\n"
+               html += "<td>Version: %s </td>\n" % Version
+               html += "<td>Settings: %s-%s °C</td>\n" % (config.plugins.FanControl.temp.value,config.plugins.FanControl.tempmax.value)
+               html += "<td>%s-%s rpm</td>\n" % (config.plugins.FanControl.minRPM.value,config.plugins.FanControl.maxRPM.value)
+               html += "</tr>\n"
+               html += "</table>\n"
                html += "</body>\n"
                html += "</html>\n"
 
+               html += "</form>\n"
+
                return html
 
 ##########################################################
@@ -354,7 +359,7 @@ class FC2webChart(resource.Resource):
                        s = f.tell()
                        f.close()
                        if s < 150:
-                               html = "<html><body><html>Not enough Data!</body></html>"
+                               html = "<html><body><html>Not enough Data (wait 3min)!</body></html>"
                                return html
                        f = open(config.plugins.FanControl.LogPath.value + "FC2data.csv","r")
                        f.seek(s-100)
@@ -474,11 +479,11 @@ class FC2webChart(resource.Resource):
                                        R = 0
                                        S = int(DT[6])
                                        if (S & 1)>0 :
-                                               B = 4
+                                               B = 3
                                        if (S & 2)>0 :
-                                               H = 8
+                                               H = 6
                                        if (S & 4)>0 :
-                                               R = 12
+                                               R = 9
                                        html += "dT.AddPoint(\"%s; %s; %d; %d; %d\", %s, null);\n" % (DT[1].replace(",","."),DT[5],B,H,R,tmp)
                                        html += "dR.AddPoint(\"%s\", %s, null);\n" % (DT[2],tmp)
                        f.close()
index f8a5772..35c9e64 100644 (file)
@@ -1,5 +1,5 @@
 from __init__ import _
-Version = "V2.4r5"
+Version = "V2.5"
 # globale Variablen        
 ZielRPM = 0
 AktVLT = 0
index 74de3d6..847cd6c 100644 (file)
@@ -144,12 +144,13 @@ config.plugins.FanControl.ShutdownTemp = ConfigInteger(default = 65,limits = (50
 config.plugins.FanControl.AddOverheat = ConfigInteger(default = 0,limits = (0, 9))
 config.plugins.FanControl.DisableDMM = ConfigYesNo(default = False)
 config.plugins.FanControl.LogCount = ConfigInteger(default = 40,limits = (40, 999))
-config.plugins.FanControl.LogPath = ConfigText(default="/media/hdd/", fixed_size=False)
+config.plugins.FanControl.LogPath = ConfigText(default="/tmp/", fixed_size=False)
 config.plugins.FanControl.DeleteData = ConfigSelection(choices = [("0", _("no")), ("2", "2"), ("3", "3"), ("7", "7"), ("14", "14"), ("30", "30")], default="0")
 config.plugins.FanControl.EnableDataLog = ConfigYesNo(default = False)
 config.plugins.FanControl.EnableEventLog = ConfigYesNo(default = False)
 config.plugins.FanControl.CheckHDDTemp = ConfigSelection(choices = [("false", _("no")), ("true", _("yes")), ("auto", _("auto")), ("never", _("never"))], default="auto")
 config.plugins.FanControl.MonitorInExtension = ConfigYesNo(default = True)
+config.plugins.FanControl.Multi = ConfigSelection(choices = [(1, "RPM"), (2, "RPM/2")], default = 2)
 
 def GetFanRPM():
        global RPMread
@@ -160,7 +161,7 @@ def GetFanRPM():
                RPMread = 0
        else:
                RPMread += 1
-       value = int(value / 2)
+       value = int(value / config.plugins.FanControl.Multi.value)
        return value
 
 def GetBox():
@@ -505,7 +506,7 @@ class FanControl2SpezialSetup(Screen, ConfigListScreen):
                                except:
                                        f.close()
                        except IOError:
-                               FCLog("Data-Log-Error")
+                               FClog("Data-Log-Error")
 
        def restartGUI(self, answer):
                if answer is True: