Skip to content

Commit

Permalink
Update thermal_zone.module
Browse files Browse the repository at this point in the history
Fix bug for locate lspci, swapon in openSUSE. Using which $exec to detect where is located
  • Loading branch information
eloaders committed Jan 2, 2013
1 parent 32667da commit e825149
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 38 deletions.
7 changes: 7 additions & 0 deletions src/i-nex/.directory
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
[Desktop Entry]
Icon=./.icon.png

[Dolphin]
Timestamp=2013,1,2,16,15,27
Version=3

[Settings]
HiddenFilesShown=true
2 changes: 2 additions & 0 deletions src/i-nex/.hidden/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* Wed Jan 02 2013 eloaders <eloaders@yahoo.com> 0.5.1

* Sat Jan 28 2012 eloaders <eloaders@yahoo.com> 0.4.0

* Sat Oct 22 2011 eloaders <eloaders@yahoo.com> 0.2.4
Expand Down
7 changes: 5 additions & 2 deletions src/i-nex/.project
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ Vendor=i-nex
Address=eloaders@yahoo.com
Url=http://code.google.com/p/lft/
License=General Public Licence
PackageName=i-nex-0.4.0
PackageName=i-nex-0.5.1
Packager=1
Systems=ubuntu
Systems=suse
Menus=suse:"Settings/Hardware Settings"
Categories=suse:"HardwareSettings;Settings"
Groups=suse:"Development"
Menus=ubuntu:"Applications/System/Hardware"
Categories=ubuntu:"System"
Groups=ubuntu:"gnome"
12 changes: 6 additions & 6 deletions src/i-nex/.settings
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ SearchString=True

[OpenFile]
File[1]=".src/Finfosys.form"
Active=2
File[2]=".src/Finfosys.class:193.35"
File[2]=".src/Finfosys.class:197.37"
File[3]=".src/Global.class:11.61"
File[4]=".src/About.form"
File[5]=".src/About.class:83.22"
File[6]=".src/battery.module:70.77"
File[7]=".src/Disk_Drives.module:89.85"
File[7]=".src/Disk_Drives.module:100.31"
File[8]=".src/ScreenShot.form"
File[9]=".src/ScreenShot.class:12.65"
File[10]=".src/ScreenShotM.module:7.0"
Expand All @@ -38,10 +37,11 @@ File[13]=".src/Reportm.module:4.15"
File[14]=".src/FReport_Gen.form"
File[15]=".src/FReport_Gen.class:28.0"
File[16]=".src/Start_App_Args.form"
File[17]=".src/Start_App_Args.class:38.13"
File[18]=".src/ChkPrm.module:6.21"
File[17]=".src/Start_App_Args.class:2.0"
File[18]=".src/ChkPrm.module:13.0"
File[19]=".src/BIOS_microcode_update_recommended.module:2.19"
File[20]=".src/thermal_zone.module:20.54"
Active=20
File[20]=".src/thermal_zone.module:53.2"
File[21]=".src/FModules.form"
File[22]=".src/FModules.class:4.30"
File[23]=".src/Input_Devices.module:8.1"
Expand Down
9 changes: 9 additions & 0 deletions src/i-nex/.src/ChkPrm.module
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,13 @@ Public Function ChkExec(executable As String) As Boolean
If Process.LastValue Then Return False
Return True

End

Public Function ChkExecDir(executable As String) As String

Dim installdir As String
Shell "which " & executable & "" Wait To installdir
installdir = Replace(Replace(installdir, " ", ""), "\n", "")
Return installdir

End
2 changes: 1 addition & 1 deletion src/i-nex/.src/Disk_Drives.module
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Public Sub get_informations()
Shell "cat /sys/block/" & Finfosys.ComboBox4.Text & "/queue/read_ahead_kb" Wait To read_ahead_kb
Shell "cat /sys/block/" & Finfosys.ComboBox4.Text & "/queue/scheduler" Wait To scheduler
Shell "cat /sys/block/" & Finfosys.ComboBox4.Text & "/" & Finfosys.ComboBox3.Text & "/size" Wait To real_size
Shell "swapon -s | sed -n '2p' | awk {'print $1'} | cut -d '/' -f 3" Wait To check_swap
Shell "" & ChkPrm.ChkExecDir("swapon") & " -s | sed -n '2p' | awk {'print $1'} | cut -d '/' -f 3" Wait To check_swap
Shell "df | grep '" & Finfosys.ComboBox3.Text & "' | awk {'print $5'} | sed -n '1p'" Wait To used
Debug "Get informations of Drives Done"
Debug "Replace new line to Null"
Expand Down
4 changes: 2 additions & 2 deletions src/i-nex/.src/Finfosys.class
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ Public Sub grafika()
Dim opengl_vendor_string, opengl_renderer_string, opengl_version_string As String

If ChkPrm.chkExec("glxinfo") = True Then
Shell "lspci | grep 'VGA' | cut -d ':' -f3 | cut -d '(' -f 1" Wait To gpu
Shell "" & ChkPrm.ChkExecDir("lspci") & " | grep 'VGA' | cut -d ':' -f3 | cut -d '(' -f 1" Wait To gpu
Shell "glxinfo | grep 'OpenGL vendor string:' | sed -n '1p' | cut -d ':' -f 2" Wait To opengl_vendor_string
Shell "glxinfo | grep 'OpenGL renderer string:' | sed -n '1p' | cut -d ':' -f 2" Wait To opengl_renderer_string
Shell "glxinfo | grep 'OpenGL version string:' | sed -n '1p' | cut -d ':' -f 2" Wait To opengl_version_string
Expand Down Expand Up @@ -542,7 +542,7 @@ Public Sub Timer1_Timer()
''Refresh temp 1500/ms
dospam_uptime()
thermal_zone._inits
If thermal_zone.notsupporttemp = 0 Then
If thermal_zone.supporttemp = True Then
Label93.Text = "Temp: " & (thermal_zone.calculate / 1000) & " C"
Else
Label93.Visible = False
Expand Down
28 changes: 14 additions & 14 deletions src/i-nex/.src/Finfosys.form
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@
Move(0,0,468,420)
{ Label20 Label
Move(0,0,102,24)
Font = Font["Bold,11"]
Font = Font["Bold,8"]
Padding = 4
AutoResize = True
Text = ("Present: ")
Expand All @@ -1006,7 +1006,7 @@
}
{ Label21 Label
Move(0,30,102,24)
Font = Font["Bold,11"]
Font = Font["Bold,8"]
Padding = 4
AutoResize = True
Text = ("Design capacity: ")
Expand All @@ -1018,7 +1018,7 @@
}
{ Label22 Label
Move(0,60,102,24)
Font = Font["Bold,11"]
Font = Font["Bold,8"]
Padding = 4
AutoResize = True
Text = ("Last full capacity: ")
Expand All @@ -1030,7 +1030,7 @@
}
{ Label23 Label
Move(0,90,108,24)
Font = Font["Bold,11"]
Font = Font["Bold,8"]
Padding = 4
AutoResize = True
Text = ("Battery technology: ")
Expand All @@ -1042,7 +1042,7 @@
}
{ Label24 Label
Move(0,120,138,24)
Font = Font["Bold,11"]
Font = Font["Bold,8"]
Padding = 4
AutoResize = True
Text = ("Design voltage: ")
Expand All @@ -1054,7 +1054,7 @@
}
{ Label28 Label
Move(0,150,138,24)
Font = Font["Bold,11"]
Font = Font["Bold,8"]
Padding = 4
AutoResize = True
Text = ("Design capacity warning: ")
Expand All @@ -1066,7 +1066,7 @@
}
{ Label29 Label
Move(0,180,138,24)
Font = Font["Bold,11"]
Font = Font["Bold,8"]
Padding = 4
AutoResize = True
Text = ("Design capacity low: ")
Expand All @@ -1078,7 +1078,7 @@
}
{ Label30 Label
Move(0,210,138,24)
Font = Font["Bold,11"]
Font = Font["Bold,8"]
Padding = 4
AutoResize = True
Text = ("Cycle count: ")
Expand All @@ -1090,7 +1090,7 @@
}
{ Label31 Label
Move(0,240,138,24)
Font = Font["Bold,11"]
Font = Font["Bold,8"]
Padding = 4
AutoResize = True
Text = ("Capacity granularity 1: ")
Expand All @@ -1102,7 +1102,7 @@
}
{ Label32 Label
Move(0,270,138,24)
Font = Font["Bold,11"]
Font = Font["Bold,8"]
Padding = 4
AutoResize = True
Text = ("Capacity granularity 2: ")
Expand All @@ -1114,7 +1114,7 @@
}
{ Label33 Label
Move(0,300,138,24)
Font = Font["Bold,11"]
Font = Font["Bold,8"]
Padding = 4
AutoResize = True
Text = ("Model number: ")
Expand All @@ -1126,7 +1126,7 @@
}
{ Label34 Label
Move(0,330,138,24)
Font = Font["Bold,11"]
Font = Font["Bold,8"]
Padding = 4
AutoResize = True
Text = ("Serial number: ")
Expand All @@ -1138,7 +1138,7 @@
}
{ Label36 Label
Move(0,360,138,24)
Font = Font["Bold,11"]
Font = Font["Bold,8"]
Padding = 4
AutoResize = True
Text = ("Battery type: ")
Expand All @@ -1150,7 +1150,7 @@
}
{ Label35 Label
Move(0,390,138,24)
Font = Font["Bold,11"]
Font = Font["Bold,8"]
Padding = 4
AutoResize = True
Text = ("OEM info: ")
Expand Down
64 changes: 51 additions & 13 deletions src/i-nex/.src/thermal_zone.module
Original file line number Diff line number Diff line change
@@ -1,32 +1,70 @@
' Gambas module file

Public temp_acpi As Boolean = Exist("/sys/bus/acpi/devices/LNXTHERM:00/thermal_zone/temp")
Public temp_acpi_thm As Boolean = Exist("/proc/acpi/thermal_zone/THM0/temperature")
Public temp_hwmon As Boolean = Exist("/sys/class/hwmon/hwmon0/device/temp2_input")
Public temp_coretemp As Boolean = Exist("/sys/devices/platform/coretemp.0/temp2_input")
Public Temperature As String
Public calculate As Float
Public OK As Boolean
Public notsupporttemp As Float
Public supporttemp As Boolean = False
Public hFile As File
Public sLine As String

Public Sub _inits()

If Exist("/sys/bus/acpi/devices/LNXTHERM:00/thermal_zone/") Then
Shell "cat /sys/bus/acpi/devices/LNXTHERM:00/thermal_zone/temp" Wait To Temperature
If Temperature = Null Then
notsupporttemp = 1
If temp_acpi_thm = True Then
Shell "cat /proc/acpi/thermal_zone/THM0/temperature" Wait To Temperature
supporttemp = True
Else
notsupporttemp = 0
calculate = CFloat(Val(Temperature))
supporttemp = False
Endif

If temp_acpi = True Then
Shell "cat /sys/bus/acpi/devices/LNXTHERM:00/thermal_zone/temp" Wait To Temperature
supporttemp = True
Else
supporttemp = False
Endif

If Exist("/sys/class/hwmon/hwmon0/device/temp2_input") Then
If temp_hwmon = True Then
Shell "cat /sys/class/hwmon/hwmon0/device/temp2_input" Wait To Temperature
supporttemp = True
Else
supporttemp = False
Endif

If temp_coretemp = True Then
Shell "cat /sys/devices/platform/coretemp.0/temp2_input" Wait To Temperature
supporttemp = True
Else
supporttemp = False
Endif

If Temperature = Null Then
notsupporttemp = 1
Debug "Not found temp"
Else
notsupporttemp = 0
calculate = CFloat(Val(Temperature))
Endif
Endif

'hFile = Open "/sys/devices/platform/coretemp.0/temp2_input" For Input

'While Not Eof(hFile)
'Line Input #hFile, sLine
'Print sLine
'Wend
'calculate = Replace(Replace(Temperature, " ", ""), "\n", "")

'hwmon For New 2.6.39, 3. x linux kernels
'/sys/class/hwmon/hwmon0/temp1_input',
'/sys/devices/platform/coretemp.0/temp1_input',
'/sys/bus/acpi/devices/LNXTHERM\:00/thermal_zone/temp',
'/sys/devices/virtual/thermal/thermal_zone0/temp',
'/sys/bus/acpi/drivers/ATK0110/ATK0110:00/hwmon/hwmon0/temp1_input',
'old kernels With proc fs
'/proc/acpi/thermal_zone/THM0/temperature',
'/proc/acpi/thermal_zone/THRM/temperature',
'/proc/acpi/thermal_zone/THR0/temperature',
'/proc/acpi/thermal_zone/TZ0/temperature',
'Debian Sid / Experimental On AMD - 64
'/sys/class/hwmon/hwmon0/device/temp1_input'

End

0 comments on commit e825149

Please sign in to comment.