Skip to content

Commit

Permalink
Add GET Connected Port. Only SATA[0-9] and USB[0-9] is supported
Browse files Browse the repository at this point in the history
  • Loading branch information
eloaders committed Aug 3, 2014
1 parent 5de041d commit 788db70
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 29 deletions.
19 changes: 17 additions & 2 deletions I-Nex/i-nex/.src/Disk_Drives.module
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Public optimal_io_size As String ' optimal_io_size
Public physical_block_size As String ' physical_block_size
Public rotational As String ' rotational
Public rq_affinity As String ' rq_affinity

Public CONNECTED_PORT As String
Function _inits()
Dim Avail_HDD As Integer
Logs("Add Drives to ComboBox", Logger.Info)
Expand Down Expand Up @@ -236,7 +236,7 @@ Function CalculateSIZE(BlockSize As Float, Optional ReturnIn As Boolean) As Stri
End

Public Sub disks()
Dim i As Integer
Dim i, i2 As Integer
Dim MOUNTS_PROC As File
Dim SWAPS_PROC As File
Dim MountsLine As String
Expand Down Expand Up @@ -293,9 +293,24 @@ Public Sub disks()
Close #SWAPS_PROC
Endif


For i = 0 To Dir("/sys/block/", "sd*", gb.Directory).Count - 1
With Stat("/sys/block/" & Dir("/sys/block/", "sd*")[i])
For i2 = 0 To Split(.Link, "/").Count - 1
If Split(.Link, "/")[i2] Like "*" & Finfosys.ComboBox4.Text & "*" Then
If Split(.Link, "/")[5] Like "*host*" Then
CONNECTED_PORT = "Port:" & Space$(2) & Replace(Split(.Link, "/")[5], "host", "SATA")
Else If Split(.Link, "/")[4] Like "*usb*" Then
CONNECTED_PORT = "Port:" & Space$(2) & UCase(Split(.Link, "/")[4])
Endif
Endif
Next
End With
Next
End

Function SETNULL()
CONNECTED_PORT = Null
device_model = Null
device_vendor = Null
mount_point = Null
Expand Down
2 changes: 2 additions & 0 deletions I-Nex/i-nex/.src/Finfosys.class
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,8 @@ Label134.Text = "Rq affinity: " & Disk_Drives.rq_affinity
TextBox48.Text = Disk_Drives.mount_point
TextBox52.Text = Disk_Drives.device_uuid
TextBox53.Text = Disk_Drives.mount_widtch

Label16.Text = Disk_Drives.CONNECTED_PORT
End

Public Sub ComboBox5_Click()
Expand Down
61 changes: 34 additions & 27 deletions I-Nex/i-nex/.src/Finfosys.form
Original file line number Diff line number Diff line change
Expand Up @@ -1120,15 +1120,15 @@
Border = Border.Raised
}
{ !Label43 Label
Move(0,56,147,28)
Move(0,56,112,28)
#Public = True
#Translate = False
Font = Font["8"]
Padding = 3
Border = Border.Raised
}
{ !Label45 Label
Move(294,56,175,28)
Move(231,56,126,28)
#Public = True
#Translate = False
Font = Font["8"]
Expand Down Expand Up @@ -1200,7 +1200,7 @@
Border = Border.Raised
}
{ !Label133 Label
Move(147,56,147,28)
Move(112,56,119,28)
#Public = True
Font = Font["8"]
Padding = 3
Expand Down Expand Up @@ -1403,6 +1403,13 @@
Move(427,434,42,42)
Picture = Picture["AppIcons/view-refresh.png"]
}
{ Label16 Label
Move(357,56,112,28)
Font = Font["8"]
Padding = 3
Text = ("Label16")
Border = Border.Raised
}
Index = 5
Text = "System"
Picture = Picture["AppIcons/Finfosys/applications-system.png"]
Expand Down Expand Up @@ -1435,66 +1442,66 @@
Picture = Picture["icon:/16/play"]
}
{ Label4 Label
Move(7,7,294,21)
Move(0,0,154,28)
#Translate = False
Font = Font["8"]
Padding = 3
Text = "Label4"
Border = Border.Raised
}
{ Label135 Label
Move(7,28,294,21)
Move(154,0,154,28)
#Translate = False
Font = Font["8"]
Padding = 3
Text = "Label135"
Border = Border.Raised
}
{ Label137 Label
Move(238,315,224,21)
Move(238,315,231,21)
#Translate = False
Font = Font["8"]
Padding = 3
Border = Border.Raised
}
{ Label138 Label
Move(7,231,455,21)
Move(0,231,469,21)
#Translate = False
Font = Font["8"]
Padding = 3
Alignment = Align.Center
Border = Border.Raised
}
{ Label139 Label
Move(238,273,224,21)
Move(238,273,231,21)
#Translate = False
Font = Font["8"]
Padding = 3
Border = Border.Raised
}
{ Label140 Label
Move(7,273,231,21)
Move(0,273,238,21)
#Translate = False
Font = Font["8"]
Padding = 3
Border = Border.Raised
}
{ Label141 Label
Move(7,315,231,21)
Move(0,315,238,21)
#Translate = False
Font = Font["8"]
Padding = 3
Border = Border.Raised
}
{ Label142 Label
Move(7,294,231,21)
Move(0,294,238,21)
#Translate = False
Font = Font["8"]
Padding = 3
Border = Border.Raised
}
{ Label143 Label
Move(7,252,455,21)
Move(0,252,469,21)
#Translate = False
Visible = False
Font = Font["8"]
Expand All @@ -1503,7 +1510,7 @@
Border = Border.Raised
}
{ Label144 Label
Move(238,294,224,21)
Move(238,294,231,21)
#Translate = False
Font = Font["8"]
Padding = 3
Expand All @@ -1514,63 +1521,63 @@
Stretch = True
}
{ Label145 Label
Move(238,336,224,21)
Move(238,336,231,21)
#Translate = False
Font = Font["8"]
Padding = 3
Border = Border.Raised
}
{ Label37 Label
Move(7,49,294,21)
Move(0,28,308,28)
Font = Font["8"]
Padding = 3
Text = ("Label37")
Border = Border.Raised
}
{ Label60 Label
Move(7,70,294,21)
Move(0,56,308,28)
Font = Font["8"]
Padding = 3
Text = ("Label60")
Border = Border.Raised
}
{ Label61 Label
Move(7,91,294,21)
Move(0,84,308,28)
Font = Font["8"]
Padding = 3
Text = ("Label61")
Border = Border.Raised
}
{ Label62 Label
Move(7,112,294,21)
Move(0,112,308,28)
Font = Font["8"]
Padding = 3
Text = ("Label62")
Border = Border.Raised
}
{ Label63 Label
Move(7,133,294,21)
Move(0,140,308,28)
Font = Font["8"]
Padding = 3
Text = ("Label63")
Border = Border.Raised
}
{ Label147 Label
Move(7,175,294,21)
Move(0,196,308,28)
Font = Font["8"]
Padding = 3
Text = ("Label147")
Border = Border.Raised
}
{ Label148 Label
Move(7,154,294,21)
Move(0,168,308,28)
Font = Font["8"]
Padding = 3
Text = ("Label148")
Border = Border.Raised
}
{ Separator1 Separator
Move(0,217,469,14)
Move(308,217,161,14)
}
{ Separator6 Separator
Move(0,399,469,14)
Expand All @@ -1587,31 +1594,31 @@
Picture = Picture["icon:/16/copy"]
}
{ Label149 Label
Move(238,357,224,21)
Move(238,357,231,21)
Font = Font["8"]
Padding = 3
Border = Border.Raised
}
{ Label150 Label
Move(7,357,231,21)
Move(0,357,238,21)
Font = Font["8"]
Padding = 3
Border = Border.Raised
}
{ Label151 Label
Move(238,378,224,21)
Move(238,378,231,21)
Font = Font["8"]
Padding = 3
Border = Border.Raised
}
{ Label152 Label
Move(7,378,231,21)
Move(0,378,238,21)
Font = Font["8"]
Padding = 3
Border = Border.Raised
}
{ Label153 Label
Move(7,336,231,21)
Move(0,336,238,21)
Font = Font["8"]
Padding = 3
Border = Border.Raised
Expand Down

0 comments on commit 788db70

Please sign in to comment.