Skip to content

Commit

Permalink
Add size of prim device
Browse files Browse the repository at this point in the history
Partition size: sd[a-z][0-9]
Device size: sd[a-z]
  • Loading branch information
eloaders committed Jul 30, 2014
1 parent 0e51391 commit d47dec7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
11 changes: 7 additions & 4 deletions I-Nex/i-nex/.src/Disk_Drives.module
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Public device_vendor As String
Public mount_point As String
Public device_uuid As String
Public real_size As String
Public real_size2 As Long
Public partition_size As String
Public filesystem_type As String
Public mount_widtch As String
Public device_rev As String
Expand Down Expand Up @@ -116,8 +116,8 @@ Public Sub get_informations()
Try rotational = Replace(File.Load("/sys/block/" & Finfosys.ComboBox4.Text & "/queue/rotational"), "\n", "")
Try rq_affinity = Replace(File.Load("/sys/block/" & Finfosys.ComboBox4.Text & "/queue/rq_affinity"), "\n", "")

Try real_size = CalculateSIZE(CLong(Replace(File.Load("/sys/block/" & Finfosys.ComboBox4.Text & "/" & Finfosys.ComboBox3.Text & "/size"), "\n", "")))

Try partition_size = CalculateSIZE(CLong(Replace(File.Load("/sys/block/" & Finfosys.ComboBox4.Text & "/" & Finfosys.ComboBox3.Text & "/size"), "\n", "")))
Try real_size = CalculateSIZE(CLong(Replace(File.Load("/sys/block/" & Finfosys.ComboBox4.Text & "/size"), "\n", "")))
Try max_ratio = Replace(File.Load("/sys/block/" & Finfosys.ComboBox4.Text & "/bdi/max_ratio"), "\n", "")
Try min_ratio = Replace(File.Load("/sys/block/" & Finfosys.ComboBox4.Text & "/bdi/min_ratio"), "\n", "")
Try stable_pages_required = Replace(File.Load("/sys/block/" & Finfosys.ComboBox4.Text & "/bdi/stable_pages_required"), "\n", "")
Expand All @@ -128,7 +128,7 @@ Public Sub get_informations()
disks()
End

Function CalculateSIZE(Optional BlockSize As Float) As String
Function CalculateSIZE(BlockSize As Float) As String
Dim REAL_SIZE_BYTES As Float
Dim REAL_SIZE_KIB As Float
Dim REAL_SIZE_MB As Float
Expand Down Expand Up @@ -223,5 +223,8 @@ Public Sub disks()
Endif

Try FREE_SPACE = Fix(Dfree(mount_point) / 1024 / 1024)
' Print CFloat(Dfree(mount_point) / 1024)
' Print CFloat(Dfree(mount_point) / 1024 / 1024)
' Print CFloat(Dfree(mount_point) / 1024 / 1024 / 1024)
Finfosys.Label248.Text = "Free: " & FREE_SPACE
End
3 changes: 2 additions & 1 deletion I-Nex/i-nex/.src/Finfosys.class
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,8 @@ Public Sub refreshing()

Label16.Text = "Device model: " & Disk_Drives.device_model & ""
Label17.Text = "Device vendor: " & Disk_Drives.device_vendor & ""
Label38.Text = "Device real size: " & Disk_Drives.real_size & ""
Label38.Text = "Partition size: " & Disk_Drives.partition_size & ""
Label250.Text = "Device size: " & Disk_Drives.real_size & ""
Label39.Text = "Filesystem type: " & Disk_Drives.filesystem_type & ""
Label41.Text = "Device rev: " & Disk_Drives.device_rev & ""
Label42.Text = "Max sectors: " & Disk_Drives.max_sectors & ""
Expand Down
9 changes: 7 additions & 2 deletions I-Nex/i-nex/.src/Finfosys.form
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@
Border = Border.Raised
}
{ !Label38 Label
Move(7,175,224,21)
Move(154,175,161,21)
#Public = True
#Translate = False
Font = Font["8"]
Expand Down Expand Up @@ -1397,12 +1397,17 @@
Font = Font["8"]
}
{ Label248 Label
Move(231,175,231,21)
Move(315,175,147,21)
Font = Font["8"]
Padding = 3
Text = ("Label248")
Border = Border.Raised
}
{ Label250 Label
Move(7,175,147,21)
Font = Font["8"]
Border = Border.Raised
}
Index = 5
Text = "System"
Picture = Picture["AppIcons/Finfosys/applications-system.png"]
Expand Down

0 comments on commit d47dec7

Please sign in to comment.