Skip to content

Commit

Permalink
Add Panel to Drives. Show if HDD is SATA
Browse files Browse the repository at this point in the history
  • Loading branch information
eloaders committed Aug 6, 2014
1 parent 1f85436 commit 50c949e
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 36 deletions.
21 changes: 9 additions & 12 deletions I-Nex/i-nex/.src/Disk_Drives.module
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ Public Logical_Size As String
Public hw_sata_spd_limit As String
Public sata_spd As String
Public sata_spd_limit As String
Public SATA_PIC As Picture
'Public IS_SATA As Boolean
Public SATA_PIC As Picture
Function _inits()
Dim Avail_HDD As Integer
Logs("Add Drives to ComboBox", Logger.Info)
Expand Down Expand Up @@ -123,7 +122,6 @@ Public Sub get_informations()
Try physical_block_size = Replace(File.Load("/sys/block/" & Finfosys.ComboBox4.Text & "/queue/physical_block_size"), "\n", "")
Try read_ahead_kb = Replace(File.Load("/sys/block/" & Finfosys.ComboBox4.Text & "/queue/read_ahead_kb"), "\n", "")

'Try scheduler = Replace(File.Load("/sys/block/" & Finfosys.ComboBox4.Text & "/queue/scheduler"), "\n", "")
Try scheduler = Schedule(CString(Replace(File.Load("/sys/block/" & Finfosys.ComboBox4.Text & "/queue/scheduler"), "\n", "")))

Try rotational = Replace(File.Load("/sys/block/" & Finfosys.ComboBox4.Text & "/queue/rotational"), "\n", "")
Expand Down Expand Up @@ -160,7 +158,6 @@ Public Sub get_informations()
End

Function Schedule(sched As String) As String
Print sched
Select Case sched
Case Like "*\\[noop\\]*"
Return "noop"
Expand Down Expand Up @@ -224,16 +221,16 @@ Function CalculateLOGICAL(BlockSize As Float) As String
LOGICAL_SIZE3 = (BlockSize * 512)
If CLong(LOGICAL_SIZE0) > 0 Then
iPos = InStr(CString(LOGICAL_SIZE0), ".")
Return Left$(CString(LOGICAL_SIZE0), iPos + 1) & " GB"
Return Left$(CString(LOGICAL_SIZE0), iPos + 1) & Space$(1) & "GB"
Else If LOGICAL_SIZE1 > 0 Then
iPos = InStr(CString(LOGICAL_SIZE1), ".")
Return Left$(CString(LOGICAL_SIZE1), iPos + 1) & " MB"
Return Left$(CString(LOGICAL_SIZE1), iPos + 1) & Space$(1) & "MB"
Else If CLong(LOGICAL_SIZE2) > 0 Then
iPos = InStr(CString(LOGICAL_SIZE2), ".")
Return Left$(CString(LOGICAL_SIZE2), iPos + 1) & " KiB"
Return Left$(CString(LOGICAL_SIZE2), iPos + 1) & Space$(1) & "KiB"
Else If CLong(LOGICAL_SIZE3) > 0 Then
iPos = InStr(CString(LOGICAL_SIZE3), ".")
Return Left$(CString(LOGICAL_SIZE3), iPos + 1) & " Bytes"
Return Left$(CString(LOGICAL_SIZE3), iPos + 1) & Space$(1) & "Bytes"
Else
Return 0
Endif
Expand All @@ -256,28 +253,28 @@ Function CalculateSIZE(BlockSize As Float, Optional ReturnIn As Boolean) As Stri

iPos = InStr(CString(REAL_SIZE_GB), ".")
If ReturnIn = True Then
Return Left$(CString(REAL_SIZE_GB), iPos + 1) & " GB"
Return Left$(CString(REAL_SIZE_GB), iPos + 1) & Space$(1) & "GB"
Else
Return REAL_SIZE_BYTES
Endif
Else If CLong(REAL_SIZE_MB) > 0 Then
iPos = InStr(CString(REAL_SIZE_MB), ".")
If ReturnIn = True Then
Return Left$(CString(REAL_SIZE_MB), iPos + 1) & " MB"
Return Left$(CString(REAL_SIZE_MB), iPos + 1) & Space$(1) & "MB"
Else
Return REAL_SIZE_BYTES
Endif
Else If CLong(REAL_SIZE_KIB) > 0 Then
iPos = InStr(CString(REAL_SIZE_KIB), ".")
If ReturnIn = True Then
Return Left$(CString(REAL_SIZE_KIB), iPos + 1) & " KiB"
Return Left$(CString(REAL_SIZE_KIB), iPos + 1) & Space$(1) & "KiB"
Else
Return REAL_SIZE_BYTES
Endif
Else If CLong(REAL_SIZE_BYTES) > 0 Then
iPos = InStr(CString(REAL_SIZE_BYTES), ".")
If ReturnIn = True Then
Return Left$(CString(REAL_SIZE_BYTES), iPos + 1) & " Bytes"
Return Left$(CString(REAL_SIZE_BYTES), iPos + 1) & Space$(1) & "Bytes"
Else
Return REAL_SIZE_BYTES
Endif
Expand Down
5 changes: 5 additions & 0 deletions I-Nex/i-nex/.src/Finfosys.class
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,11 @@ Label134.Text = "Rq affinity: " & Disk_Drives.rq_affinity
Label253.Tooltip = "Maximum speed imposed by libata."

PictureBox4.Picture = Disk_Drives.SATA_PIC
If Disk_Drives.sata_spd = Null Then
Panel1.Visible = False
Else
Panel1.Visible = True
Endif
End

Public Sub ComboBox5_Click()
Expand Down
51 changes: 27 additions & 24 deletions I-Nex/i-nex/.src/Finfosys.form
Original file line number Diff line number Diff line change
Expand Up @@ -1420,30 +1420,33 @@
{ Separator2 Separator
Move(0,217,469,7)
}
{ Label251 Label
Move(161,224,231,21)
Font = Font["8"]
Padding = 3
Text = ("Label251")
Border = Border.Raised
}
{ Label252 Label
Move(161,245,231,21)
Font = Font["8"]
Padding = 3
Text = ("Label252")
Border = Border.Raised
}
{ Label253 Label
Move(161,266,231,21)
Font = Font["8"]
Padding = 3
Text = ("Label253")
Border = Border.Raised
}
{ PictureBox4 PictureBox
Move(392,224,77,63)
Stretch = True
{ Panel1 Panel
Move(161,224,308,63)
{ Label251 Label
Move(0,0,231,21)
Font = Font["8"]
Padding = 3
Text = ("Label251")
Border = Border.Raised
}
{ Label252 Label
Move(0,21,231,21)
Font = Font["8"]
Padding = 3
Text = ("Label252")
Border = Border.Raised
}
{ Label253 Label
Move(0,42,231,21)
Font = Font["8"]
Padding = 3
Text = ("Label253")
Border = Border.Raised
}
{ PictureBox4 PictureBox
Move(231,0,77,63)
Stretch = True
}
}
Index = 5
Text = "System"
Expand Down

0 comments on commit 50c949e

Please sign in to comment.