-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
120 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
' Gambas module file | ||
|
||
Private ToolButton[99] As ToolButton | ||
Private Label[99] As Label ' Dim the array of controls | ||
Private Button[99] As Button | ||
Private TextLabel[99] As TextLabel | ||
Private YESNO As Picture | ||
Public Logs As New Logger | ||
Public BUFFER As String | ||
Public DATAT As Collection | ||
Public Sub Libcpuid() | ||
Dim i As Integer | ||
|
||
Logs("Check whereis inex-cpuid and get JSON Data", Logger.Info) | ||
Exec [ChkPrm.ChkExecDir("i-nex-cpuid")] Wait To BUFFER | ||
Logs("Decode JSON Data", Logger.Info) | ||
DATAT = JSON.Decode(BUFFER) | ||
Logs("Add Values CPUID", Logger.Info) | ||
|
||
Finfosys.Label92.Text = DATAT["VENDOR_STR"] | ||
Finfosys.Label193.Text = DATAT["CPU_CODENAME"] | ||
Finfosys.Label194.Text = DATAT["BRAND_STR"] | ||
Finfosys.Label195.Text = "Cores: " & DATAT["NUM_CORES"] | ||
Finfosys.Label196.Text = "Logical CPUS: " & DATAT["NUM_LOGICAL_CPUS"] | ||
Finfosys.Label197.Text = "Total Logical CPUS: " & DATAT["TOTAL_LOGICAL_CPUS"] | ||
Finfosys.Label198.Text = "Family: " & DATAT["FAMILY"] | ||
Finfosys.Label199.Text = "Model: " & DATAT["MODEL"] | ||
Finfosys.Label200.Text = "Stepping: " & DATAT["STEPPING"] | ||
Finfosys.Label201.Text = "Ext Family: " & DATAT["EXT_FAMILY"] | ||
Finfosys.Label202.Text = "Ext Model: " & DATAT["EXT_MODEL"] | ||
Finfosys.Label203.Text = "CPU Clock: " & DATAT["CPU_CLOCK"] | ||
Finfosys.Label204.Text = "CPU Clock BY OS: " & DATAT["CPU_CLOCK_BY_OS"] | ||
Finfosys.Label205.Text = "CPU Clock BY IC: " & DATAT["CPU_CLOCK_BY_IC"] | ||
Finfosys.Label206.Text = "CPU Clock Measure: " & DATAT["CPU_CLOCK_MEASURE"] | ||
Finfosys.Label207.Text = "Mark TSC: " & DATAT["MARK_TSC"] | ||
Finfosys.Label208.Text = "Mark SYS Clock: " & DATAT["MARK_SYS_CLOCK"] | ||
Finfosys.Label209.Text = "L1 D: " & DATAT["L1_DATA_CACHE"] | ||
Finfosys.Label210.Text = "L1 I: " & DATAT["L1_INSTRUCTION_CACHE"] | ||
Finfosys.Label211.Text = "L2 Cache: " & DATAT["L2_CACHE"] | ||
Finfosys.Label212.Text = "L3 Cache: " & DATAT["L3_CACHE"] | ||
Finfosys.Label213.Text = "L1 Assoc: " & DATAT["L1_ASSOC"] | ||
Finfosys.Label214.Text = "L2 Assoc: " & DATAT["L2_ASSOC"] | ||
Finfosys.Label215.Text = "L3 Assoc: " & DATAT["L3_ASSOC"] | ||
Finfosys.Label216.Text = "L1 line: " & DATAT["L1_CACHELINE"] | ||
Finfosys.Label217.Text = "L2 line: " & DATAT["L2_CACHELINE"] | ||
Finfosys.Label218.Text = "L3 line: " & DATAT["L3_CACHELINE"] | ||
Finfosys.Label219.Text = "SSE Size: " & DATAT["SSE_SIZE"] | ||
|
||
Logs("Create Labels ToolButtons TextLabels in Finfosys.ScrollView1", Logger.Info) | ||
For i = 1 To 98 | ||
Label[i] = New Label(Finfosys.ScrollView1) | ||
ToolButton[i] = New ToolButton(Finfosys.ScrollView1) | ||
Button[i] = New Button(Finfosys.ScrollView1) As "Buttongroup" | ||
TextLabel[i] = New TextLabel(Finfosys.ScrollView1) | ||
If DATAT["Flags"][i]["VALUE"] = 1 Then | ||
YESNO = Picture["Data/check_true.png"] | ||
Else | ||
YESNO = Picture["Data/check_false.png"] | ||
Endif | ||
With Label[i] | ||
.X = 2 | ||
.Y = 310 + Int(i * 20) | ||
.Width = 440 | ||
.Height = 21 | ||
.Border = Border.Raised | ||
.Padding = 0 | ||
.Font.Size = 8 | ||
.Tooltip = DATAT["Flags"][i]["NAME"] | ||
.Text = DATAT["Flags"][i]["DESC"] | ||
If DATAT["Flags"][i]["NAME"] = "CPU_FEATURE_RESERVED" Then | ||
.Visible = False | ||
Endif | ||
End With | ||
With ToolButton[i] | ||
.X = 420 | ||
.Y = 310 + Int(i * 20) | ||
.Width = 21 | ||
.Height = 21 | ||
.Picture = YESNO | ||
.Tooltip = DATAT["Flags"][i]["VALUE"] | ||
If DATAT["Flags"][i]["NAME"] = "CPU_FEATURE_RESERVED" Then | ||
.Visible = False | ||
Endif | ||
End With | ||
With Button[i] | ||
.X = 400 | ||
.Y = 310 + Int(i * 20) | ||
.Width = 21 | ||
.Height = 21 | ||
.Font.Bold = True | ||
.Font.Size = 8 | ||
.Foreground = 6 | ||
.Tooltip = "Open Wikipedia page about this processor feature\n" & DATAT["Flags"][i]["WEBSITE"] & "" | ||
.Name = DATAT["Flags"][i]["WEBSITE"] | ||
.Visible = DATAT["Flags"][i]["HAVEWEBSITE"] | ||
.Picture = Picture["AppIcons/applications-internet.png"] | ||
End With | ||
With TextLabel[i] | ||
.X = 320 | ||
.Y = 310 + Int(i * 20) | ||
.Width = 80 | ||
.Height = 21 | ||
.Font.Bold = True | ||
.Font.Size = 8 | ||
.Foreground = 6 | ||
.Alignment = Align.Center | ||
.Text = DATAT["Flags"][i]["FEATURE"] | ||
If DATAT["Flags"][i]["NAME"] = "CPU_FEATURE_RESERVED" Then | ||
.Visible = False | ||
Endif | ||
End With | ||
Next | ||
|
||
End |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters