Skip to content

Commit

Permalink
Fragmentation CPUDB add MConvert.module
Browse files Browse the repository at this point in the history
example:
i-nex.gambas --conv /run/media/michal/fbd26004-de6c-43ba-
92d3-5c15e88a9eee/michal/Baazar/git-i-nex/I-Nex/i-nex/Database/intel
/run/media/michal/fbd26004-de6c-43ba-
92d3-5c15e88a9eee/michal/Baazar/git-i-nex/I-Nex/i-nex/Database/i5 "*i5*"
  • Loading branch information
eloaders committed Jul 31, 2014
1 parent 86767d7 commit d1a1bc4
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 3 deletions.
19 changes: 18 additions & 1 deletion I-Nex/i-nex/.src/FCpudb.module
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

Public Logs As New Logger
Public i As Integer
Public database As Collection
Public database As New Collection
Function _inits()
Dim buffer As String
Dim cpucache As String
Expand All @@ -43,6 +43,22 @@ Function _inits()
Logs("Use Intel Xeon CPU Database", Logger.Info)
buffer = File.Load("Database/Xeon") 'Load the database to a temporary buffer
Finfosys.Label14.Text = Replace(Finfosys.Label14.Text, "Intel", "")
'
'
Else If Finfosys.Label14.Text Like "*i3*" Then
Logs("Use Intel i3 CPU Database", Logger.Info)
buffer = File.Load("Database/i3") 'Load the database to a temporary buffer
Finfosys.Label14.Text = Replace(Finfosys.Label14.Text, "Intel", "")
Else If Finfosys.Label14.Text Like "*i5*" Then
Logs("Use Intel i5 CPU Database", Logger.Info)
buffer = File.Load("Database/i5") 'Load the database to a temporary buffer
Finfosys.Label14.Text = Replace(Finfosys.Label14.Text, "Intel", "")
Else If Finfosys.Label14.Text Like "*i7*" Then
Logs("Use Intel i7 CPU Database", Logger.Info)
buffer = File.Load("Database/i7") 'Load the database to a temporary buffer
Finfosys.Label14.Text = Replace(Finfosys.Label14.Text, "Intel", "")
'
'
Else If Finfosys.Label14.Text Like "*atom*" Then
Logs("Use Intel Atom CPU Database", Logger.Info)
buffer = File.Load("Database/atom") 'Load the database to a temporary buffer
Expand Down Expand Up @@ -92,6 +108,7 @@ Function _inits()

For z = 0 To database["DATABASE"].Count - 1
If database["DATABASE"][z]["PROCESSOR_MODEL_NAME"] Like "*" & cpucache & "*" Then
Print database["DATABASE"][z]["PROCESSOR_MODEL_NAME"]
Finfosys.PictureBox3.Name = database["DATABASE"][z]["PROCESSOR_SOCKET_IMAGE"]
Finfosys.PictureBox3.Picture = Picture["Database/Logos/" & database["DATABASE"][z]["PROCESSOR_SOCKET_IMAGE"] & ""]
Finfosys.Label103.Text = " Integrated GPU: " & database["DATABASE"][z]["PROCESSOR_INTEGRATEDGRAPHIC"]
Expand Down
23 changes: 23 additions & 0 deletions I-Nex/i-nex/.src/MConvert.module
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
' Gambas module file

Function Convert(inputS As String, OutputS As String, CPUName As String)
Dim JSON_FILE As Collection
Dim z As Float
Dim NEW_DB As Collection = [("DATABASE"): ""]
Dim BUFFF As String
Dim CPUDBINTEL As New Collection
Dim CPUDBINTELADD As New Collection
JSON_FILE = JSON.Decode(File.Load(inputS))
CPUDBINTEL = JSON.Decode(File.Load("Database/NULLD"))
For z = 0 To JSON_FILE["DATABASE"].Count - 1
If JSON_FILE["DATABASE"][z]["PROCESSOR_MODEL_NAME"] Like CPUName Then
Print JSON_FILE["DATABASE"][z]["PROCESSOR_MODEL_NAME"]
Print CPUName
Print z
CPUDBINTEL["DATABASE"].Add(JSON_FILE["DATABASE"][z])
Endif
Next

File.Save(OutputS, JSON.Encode(CPUDBINTEL))

End
8 changes: 6 additions & 2 deletions I-Nex/i-nex/.src/MStart.module
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ Public Sub Main()
"\n "
"\n Usage: env VARIABLE=\"STRING\" " & Application.name & ".gambas [Options]"
"\n Options:"
"\n --help (Chow Help)"
"\n --library (Chow library)"
"\n --help (Chow Help)"
"\n --library (Chow library)"
"\n --cpuinfo (Use cpuinfo instead of /proc)"
"\n"
"\n Env Variables:"
"\n"
Expand All @@ -49,6 +50,9 @@ Public Sub Main()
CPUINFO_FILE = Application.Args[2]
Finfosys.Show
PrintErr = False
Case "--conv"
MConvert.Convert(Application.Args[2], Application.Args[3], Application.Args[4])
PrintErr = False
Case ""
Finfosys.Show
PrintErr = False
Expand Down
4 changes: 4 additions & 0 deletions I-Nex/i-nex/Database/NULLD
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"DATABASE": [
]
}
1 change: 1 addition & 0 deletions I-Nex/i-nex/Database/i3

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions I-Nex/i-nex/Database/i5

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions I-Nex/i-nex/Database/i7

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions I-Nex/i-nex/Database/intel_Core_2_Duo

Large diffs are not rendered by default.

0 comments on commit d1a1bc4

Please sign in to comment.