Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sanekgusev/LinX-old.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gusev <sanekgusev@gmail.com>2013-08-29 20:37:24 +0400
committerAlexander Gusev <sanekgusev@gmail.com>2013-08-29 20:37:24 +0400
commit9706b7a7aec12a8078f2a505bcfdcf9764608813 (patch)
treebf7e5283eaf12a6c6f05765c705e505f655d405c
parent93106d4925335989c564f17f28e13baa62401a7e (diff)
This horrible mess of a code is now on GitHub.0.6.5
It should also be compatible with latest Linpack binaries.
-rw-r--r--.gitignore5
-rw-r--r--LinX.dpr22
-rw-r--r--LinX.dproj179
-rw-r--r--LinX.dresbin0 -> 4912 bytes
-rw-r--r--LinX.ini51
-rw-r--r--LinX.resbin0 -> 16420 bytes
-rw-r--r--LinX_Icon.icobin0 -> 15086 bytes
-rw-r--r--LinX_routines.pas567
-rw-r--r--README.md7
-rw-r--r--Speedfan.ini9
-rw-r--r--Text/changelog_en.txt212
-rw-r--r--Text/changelog_ru.txt212
-rw-r--r--Text/command-line.txt13
-rw-r--r--Text/local.lngbin0 -> 13716 bytes
-rw-r--r--Text/readme_en.txt61
-rw-r--r--Text/readme_ru.txt85
-rw-r--r--UnitAbout.dfm267
-rw-r--r--UnitAbout.pas197
-rw-r--r--UnitGraph.dfm70
-rw-r--r--UnitGraph.pas318
-rw-r--r--UnitLogWatch.pas347
-rw-r--r--UnitMain.dfm519
-rw-r--r--UnitMain.pas1834
-rw-r--r--UnitSett.dfm619
-rw-r--r--UnitSett.pas338
25 files changed, 5929 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 38b6bd0..22c32a1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,4 +7,7 @@ __history
*.map
*.exe
*.dll
-bin/* \ No newline at end of file
+bin/*
+
+32-bit/*
+64-bit/* \ No newline at end of file
diff --git a/LinX.dpr b/LinX.dpr
new file mode 100644
index 0000000..8a3cc26
--- /dev/null
+++ b/LinX.dpr
@@ -0,0 +1,22 @@
+program LinX;
+
+
+
+{$R *.dres}
+
+uses
+ Forms,
+ UnitMain in 'UnitMain.pas' {FormMain},
+ UnitGraph in 'UnitGraph.pas' {FormGraph},
+ UnitSett in 'UnitSett.pas' {FormSett},
+ UnitAbout in 'UnitAbout.pas' {FormAbout},
+ UnitLogWatch in 'UnitLogWatch.pas';
+
+{$R *.res}
+
+begin
+ Application.Initialize;
+ Application.MainFormOnTaskbar := True;
+ Application.CreateForm(TFormMain, FormMain);
+ Application.Run;
+end.
diff --git a/LinX.dproj b/LinX.dproj
new file mode 100644
index 0000000..0711472
--- /dev/null
+++ b/LinX.dproj
@@ -0,0 +1,179 @@
+ <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectGuid>{64F55464-1358-4C83-B3A1-6B0EB93A58AA}</ProjectGuid>
+ <MainSource>LinX.dpr</MainSource>
+ <Config Condition="'$(Config)'==''">Debug</Config>
+ <DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
+ <ProjectVersion>13.4</ProjectVersion>
+ <Base>True</Base>
+ <AppType>Application</AppType>
+ <FrameworkType>VCL</FrameworkType>
+ <Platform Condition="'$(Platform)'==''">Win32</Platform>
+ <TargetedPlatforms>1</TargetedPlatforms>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
+ <Base_Win64>true</Base_Win64>
+ <CfgParent>Base</CfgParent>
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
+ <Base_Win32>true</Base_Win32>
+ <CfgParent>Base</CfgParent>
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
+ <Cfg_1>true</Cfg_1>
+ <CfgParent>Base</CfgParent>
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
+ <Cfg_2>true</Cfg_2>
+ <CfgParent>Base</CfgParent>
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
+ <Cfg_2_Win32>true</Cfg_2_Win32>
+ <CfgParent>Cfg_2</CfgParent>
+ <Cfg_2>true</Cfg_2>
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Base)'!=''">
+ <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
+ <VerInfo_Keys>CompanyName=Dua|ist;FileDescription=A simple Linpack GUI;FileVersion=0.6.4.0;InternalName=LinX.exe;LegalCopyright=;LegalTrademarks=;OriginalFilename=LinX.exe;ProductName=LinX - A simple Linpack GUI;ProductVersion=0.6.4.0;Comments=</VerInfo_Keys>
+ <VerInfo_Locale>1033</VerInfo_Locale>
+ <DCC_Namespace>Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace)</DCC_Namespace>
+ <VerInfo_MajorVer>0</VerInfo_MajorVer>
+ <VerInfo_MinorVer>6</VerInfo_MinorVer>
+ <VerInfo_Release>4</VerInfo_Release>
+ <DCC_OutputDRCFile>true</DCC_OutputDRCFile>
+ <DCC_UsePackage>vclx;vcl;rtl;$(DCC_UsePackage)</DCC_UsePackage>
+ <DCC_ImageBase>00400000</DCC_ImageBase>
+ <DCC_E>false</DCC_E>
+ <DCC_Platform>x86</DCC_Platform>
+ <DCC_DependencyCheckOutputName>LinX.exe</DCC_DependencyCheckOutputName>
+ <DCC_N>false</DCC_N>
+ <DCC_S>false</DCC_S>
+ <DCC_F>false</DCC_F>
+ <DCC_K>false</DCC_K>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Base_Win64)'!=''">
+ <Icon_MainIcon>LinX_Icon.ico</Icon_MainIcon>
+ <Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Base_Win32)'!=''">
+ <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
+ <Icon_MainIcon>LinX_Icon.ico</Icon_MainIcon>
+ <DCC_Namespace>System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
+ <VerInfo_Locale>1033</VerInfo_Locale>
+ <Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
+ <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Cfg_1)'!=''">
+ <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
+ <DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
+ <DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
+ <DCC_DebugInformation>false</DCC_DebugInformation>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Cfg_2)'!=''">
+ <DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
+ <VerInfo_Release>5</VerInfo_Release>
+ <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=0.6.5.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=0.6.5.0;Comments=</VerInfo_Keys>
+ </PropertyGroup>
+ <ItemGroup>
+ <DelphiCompile Include="$(MainSource)">
+ <MainSource>MainSource</MainSource>
+ </DelphiCompile>
+ <DCCReference Include="UnitMain.pas">
+ <Form>FormMain</Form>
+ </DCCReference>
+ <DCCReference Include="UnitGraph.pas">
+ <Form>FormGraph</Form>
+ </DCCReference>
+ <DCCReference Include="UnitSett.pas">
+ <Form>FormSett</Form>
+ </DCCReference>
+ <DCCReference Include="UnitAbout.pas">
+ <Form>FormAbout</Form>
+ </DCCReference>
+ <DCCReference Include="UnitLogWatch.pas"/>
+ <BuildConfiguration Include="Debug">
+ <Key>Cfg_2</Key>
+ <CfgParent>Base</CfgParent>
+ </BuildConfiguration>
+ <BuildConfiguration Include="Base">
+ <Key>Base</Key>
+ </BuildConfiguration>
+ <BuildConfiguration Include="Release">
+ <Key>Cfg_1</Key>
+ <CfgParent>Base</CfgParent>
+ </BuildConfiguration>
+ </ItemGroup>
+ <Import Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')" Project="$(BDS)\Bin\CodeGear.Delphi.Targets"/>
+ <ProjectExtensions>
+ <Borland.Personality>Delphi.Personality.12</Borland.Personality>
+ <Borland.ProjectType>VCLApplication</Borland.ProjectType>
+ <BorlandProject>
+ <Delphi.Personality>
+ <Source>
+ <Source Name="MainSource">LinX.dpr</Source>
+ </Source>
+ <Parameters/>
+ <VersionInfo>
+ <VersionInfo Name="IncludeVerInfo">True</VersionInfo>
+ <VersionInfo Name="AutoIncBuild">False</VersionInfo>
+ <VersionInfo Name="MajorVer">0</VersionInfo>
+ <VersionInfo Name="MinorVer">6</VersionInfo>
+ <VersionInfo Name="Release">4</VersionInfo>
+ <VersionInfo Name="Build">0</VersionInfo>
+ <VersionInfo Name="Debug">False</VersionInfo>
+ <VersionInfo Name="PreRelease">False</VersionInfo>
+ <VersionInfo Name="Special">False</VersionInfo>
+ <VersionInfo Name="Private">False</VersionInfo>
+ <VersionInfo Name="DLL">False</VersionInfo>
+ <VersionInfo Name="Locale">1033</VersionInfo>
+ <VersionInfo Name="CodePage">1252</VersionInfo>
+ </VersionInfo>
+ <VersionInfoKeys>
+ <VersionInfoKeys Name="CompanyName">Dua|ist</VersionInfoKeys>
+ <VersionInfoKeys Name="FileDescription">A simple Linpack GUI</VersionInfoKeys>
+ <VersionInfoKeys Name="FileVersion">0.6.4.0</VersionInfoKeys>
+ <VersionInfoKeys Name="InternalName">LinX.exe</VersionInfoKeys>
+ <VersionInfoKeys Name="LegalCopyright"/>
+ <VersionInfoKeys Name="LegalTrademarks"/>
+ <VersionInfoKeys Name="OriginalFilename">LinX.exe</VersionInfoKeys>
+ <VersionInfoKeys Name="ProductName">LinX - A simple Linpack GUI</VersionInfoKeys>
+ <VersionInfoKeys Name="ProductVersion">0.6.4.0</VersionInfoKeys>
+ <VersionInfoKeys Name="Comments"/>
+ </VersionInfoKeys>
+ <Language>
+ <Language Name="ProjectLang">$00000409</Language>
+ </Language>
+ <Excluded_Packages>
+ <Excluded_Packages Name="$(BDSBIN)\dcloffice2k160.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
+ <Excluded_Packages Name="$(BDSBIN)\dclofficexp160.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
+ </Excluded_Packages>
+ <Resource_DLL_Projects>
+ <Resource_DLL_Projects Name="Item0">Russian (Russia)*$00000419*RUS*RUS</Resource_DLL_Projects>
+ </Resource_DLL_Projects>
+ <RDP_Source_Files>
+ <RDP_Source_Files Name="Item0">UnitMain.dfm</RDP_Source_Files>
+ <RDP_Source_Files Name="Item1">UnitGraph.dfm</RDP_Source_Files>
+ <RDP_Source_Files Name="Item2">UnitSett.dfm</RDP_Source_Files>
+ <RDP_Source_Files Name="Item3">UnitAbout.dfm</RDP_Source_Files>
+ <RDP_Source_Files Name="Item4">LinX.drc</RDP_Source_Files>
+ </RDP_Source_Files>
+ </Delphi.Personality>
+ <Platforms>
+ <Platform value="Win64">False</Platform>
+ <Platform value="Win32">True</Platform>
+ </Platforms>
+ </BorlandProject>
+ <ProjectFileVersion>12</ProjectFileVersion>
+ </ProjectExtensions>
+ <Import Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')" Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj"/>
+ </Project>
diff --git a/LinX.dres b/LinX.dres
new file mode 100644
index 0000000..4f47e88
--- /dev/null
+++ b/LinX.dres
Binary files differ
diff --git a/LinX.ini b/LinX.ini
new file mode 100644
index 0000000..0bbfb70
--- /dev/null
+++ b/LinX.ini
@@ -0,0 +1,51 @@
+[Window]
+Top=0
+Left=0
+ClientHeight=275
+[Settings]
+UseAllMem=0
+StopOnError=1
+AutoSaveLog=0
+StopOnOverheat=0
+OverheatValue=75
+EnableSounds=0
+GlassEffect=0
+ShowHints=1
+TrayIcon=0
+DateTimeInFilenames=1
+EverestImport=0
+SpeedfanImport=0
+TempGraph=0
+FanGraph=0
+VcoreGraph=0
+P12VGraph=0
+[Advanced]
+MaximumSizeForLinpack32=15500
+MaxmemFromFreememOffset=5
+LastLogicalCPUs=2
+[Linpack]
+ProblemSize=2636
+TimesToRun=20
+MinutesToRun=-1
+UseOptimizedLeadingDimensions=1
+DataAlignment=4
+NumberOfThreads=2
+x64=1
+Priority=2
+[Graphs]
+TempLeft=40
+TempTop=40
+TempWidth=416
+TempHeight=169
+FanLeft=40
+FanTop=209
+FanWidth=416
+FanHeight=169
+VcoreLeft=40
+VoreTop=378
+VcoreWidth=416
+VcoreHeight=169
+12VLeft=40
+12VTop=547
+12VWidth=416
+12VHeight=169
diff --git a/LinX.res b/LinX.res
new file mode 100644
index 0000000..5ca79e0
--- /dev/null
+++ b/LinX.res
Binary files differ
diff --git a/LinX_Icon.ico b/LinX_Icon.ico
new file mode 100644
index 0000000..45a8745
--- /dev/null
+++ b/LinX_Icon.ico
Binary files differ
diff --git a/LinX_routines.pas b/LinX_routines.pas
new file mode 100644
index 0000000..dd91043
--- /dev/null
+++ b/LinX_routines.pas
@@ -0,0 +1,567 @@
+{$STRINGCHECKS OFF}
+unit LinX_routines;
+
+interface
+uses Windows;
+
+procedure CreateInputFile(FileName : string;
+ ProblemSize, LeadingDimensions : cardinal;
+ NumberOfRuns : word;
+ DataAlignment : byte;
+ Version : string;
+ x64Mode : boolean);
+
+function SetOutputString(ProblemSize, LeadingDimensions : cardinal;
+ DataAlignment : byte) : string;
+
+function SetLeadingDimensions(ProblemSize : cardinal;
+ Optimal : boolean) : cardinal;
+
+function StartLinpack(FileName : string; InputFileName : string;
+ NumberOfThreads : byte;
+ PriorityClass : byte;
+ var ProcessInformation : TProcessInformation;
+ var LogReadHandle, LogWriteHandle : THandle) : boolean;
+
+function ReadLogHeader(LogHandle, LinpackHandle, ReadComplete : THandle;
+ var stopcode : byte) : string;
+
+function ReadLogString(LogHandle, LinpackHandle, ReadComplete : THandle;
+ var OutputString : string; var stopcode : byte) : boolean;
+
+function ReadLogFooter(LogHandle, LinpackHandle, ReadComplete : THandle) : string;
+
+function IsX64Supported : boolean;
+
+function GetTempFolderPath : string;
+
+function GetMaxThreadsNumber : byte;
+
+function GetFreeMemory : word;
+
+function GetTotalMemory: word;
+
+procedure WindowScreenShot(WinHandle : HWND; Filename : string);
+
+procedure WindowFlash(Flashtype : cardinal; WinHandle : HWND;
+ Count, Timeout : cardinal);
+
+function GetCPUName : string;
+
+function SizeToMem(Size: cardinal) : cardinal;
+
+function MemToSize(Mem : cardinal) : cardinal;
+
+function GetVersion (full : boolean) : string;
+
+function CompositingEnabled: Boolean;
+
+function AddDateTimeToFilename (Filename, Extension : string; TimeToAdd : TDateTime) : string;
+
+procedure CalcMinMax(var data_arr: array of single; arrlength : integer; var min, max : real);
+
+implementation
+uses SysUtils, Graphics, PngImage, StrUtils;
+
+type TMemoryStatusEx = packed record
+ dwLength: DWORD;
+ dwMemoryLoad: DWORD;
+ ullTotalPhys: Int64;
+ ullAvailPhys: Int64;
+ ullTotalPageFile: Int64;
+ ullAvailPageFile: Int64;
+ ullTotalVirtual: Int64;
+ ullAvailVirtual: Int64;
+ ullAvailExtendedVirtual: Int64;
+ end;
+
+function GlobalMemoryStatusEx(var lpBuffer: TMemoryStatusEx): BOOL; stdcall; external kernel32;
+
+procedure CreateInputFile(FileName : string;
+ ProblemSize, LeadingDimensions : cardinal;
+ NumberOfRuns : word;
+ DataAlignment : byte;
+ Version : string;
+ x64Mode : boolean);
+var InputFile : HFile; BytesWritten : cardinal; SettingsString : ansistring;
+ Mode : byte; InfoString : string;
+const HeaderString = 'Sample Intel(R) LINPACK data file';
+ InfoStr = 'Intel(R) LINPACK %d-bit data - ';
+begin
+ InfoString := InfoStr + version;
+ InputFile := CreateFile(PChar(filename), GENERIC_WRITE, 0, nil, CREATE_ALWAYS,
+ 0, 0);
+ if InputFile <> INVALID_HANDLE_VALUE then begin
+ if x64Mode then Mode := 64
+ else Mode := 32;
+ SettingsString := Ansistring(Format(HeaderString + #13#10 + InfoString + #13#10 +
+ '1'#13#10'%d'#13#10'%d'#13#10'%d'#13#10'%d',[Mode,
+ ProblemSize, LeadingDimensions, NumberOfRuns,
+ DataAlignment]));
+ WriteFile(InputFile, Pointer(SettingsString)^, length(SettingsString),
+ BytesWritten, nil);
+ CloseHandle(InputFile);
+ end;
+end;
+
+function SetOutputString(ProblemSize, LeadingDimensions : cardinal;
+ DataAlignment : byte) : string;
+begin
+ result := Format('%d'#13'%d'#13'%d'#13,
+ [ProblemSize, LeadingDimensions, DataAlignment]);
+end;
+
+function SetLeadingDimensions(ProblemSize : cardinal; Optimal : boolean) : cardinal;
+var LeadingDimensions : cardinal;
+begin
+ LeadingDimensions := ProblemSize;
+ if Optimal then
+ if LeadingDimensions mod 8 = 0 then
+ if LeadingDimensions mod 16 = 0 then inc(LeadingDimensions, 8)
+ else
+ else
+ if odd(LeadingDimensions div 8)
+ then LeadingDimensions := (LeadingDimensions div 8 + 2) * 8
+ else LeadingDimensions := (LeadingDimensions div 8 + 1) * 8;
+ result := LeadingDimensions;
+end;
+
+function StartLinpack(FileName : string; InputFileName : string;
+ NumberOfThreads : byte;
+ PriorityClass : byte;
+ var ProcessInformation : TProcessInformation;
+ var LogReadHandle, LogWriteHandle : THandle) : boolean;
+var Startup : TStartupInfo; EnvVarString : ansistring;
+ pSD : PSECURITY_DESCRIPTOR; SecAttr: TSecurityAttributes;
+ Priority : cardinal; timesuffix : string;
+begin
+ pSD := PSECURITY_DESCRIPTOR(LocalAlloc(LPTR, SECURITY_DESCRIPTOR_MIN_LENGTH));
+ InitializeSecurityDescriptor (pSD, SECURITY_DESCRIPTOR_REVISION);
+ SetSecurityDescriptorDacl(pSD, false, nil, false);
+ //FillChar(SecAttr, SizeOf(TSecurityAttributes), #0);
+ SecAttr.nLength := SizeOf(TSecurityAttributes);
+ SecAttr.bInheritHandle := True;
+ SecAttr.lpSecurityDescriptor := pSD;
+
+ timesuffix := FormatDateTime('hhmmss', Now);
+ LogReadHandle := CreateNamedPipe(PChar('\\.\pipe\linx' + timesuffix), PIPE_ACCESS_INBOUND or
+ FILE_FLAG_OVERLAPPED, 0, 2, 1024, 1024, 0, @SecAttr);
+ LogWriteHandle := CreateFile(Pchar('\\.\pipe\linx' + timesuffix), GENERIC_WRITE,
+ 0, @SecAttr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL
+ or FILE_FLAG_NO_BUFFERING or FILE_FLAG_WRITE_THROUGH,
+ 0);
+
+ FillChar(Startup, SizeOf(Startup), #0);
+ Startup.cb := SizeOf(Startup);
+ Startup.dwFlags := STARTF_USESTDHANDLES;
+ Startup.hStdOutput := LogWriteHandle;
+
+ FillChar(ProcessInformation, SizeOf(ProcessInformation), #0);
+
+ EnvVarString := Ansistring(
+ Format('MKL_DOMAIN_NUM_THREADS=MKL_BLAS=1,MKL_ALL=%d', [NumberOfThreads]) + #0 +
+ //'MKL_DOMAIN_NUM_THREADS=MKL_BLAS=1' + #0 +
+ 'MKL_DYNAMIC=FALSE' + #0 +
+ //'MKL_NUM_THREADS=' + inttostr(NumberOfThreads) + #0 +
+ Format('OMP_NUM_THREADS=%d', [NumberOfThreads]) + #0 + #0);
+
+ //SetEnvironmentVariable(PChar('MKL_DYNAMIC'),PChar('FALSE'));
+ //SetEnvironmentVariable(PChar('OMP_NUM_THREADS'),PChar(Format('%d',[NumberOfThreads])));
+ //SetEnvironmentVariable(PChar('MKL_NUM_THREADS'),PChar(Format('%d',[NumberOfThreads])));
+ //SetEnvironmentVariable(PChar('MKL_DOMAIN_NUM_THREADS'),PChar(Format('MKL_BLAS 1, MKL_ALL %d', [NumberOfThreads])));
+ //SetEnvironmentVariable(PChar('MKL_DOMAIN_NUM_THREADS'),PChar('MKL_BLAS=1'));
+
+ case PriorityClass of
+ 0 : Priority := IDLE_PRIORITY_CLASS;
+ 1 : Priority := $00004000;
+ 2 : Priority := NORMAL_PRIORITY_CLASS;
+ 3 : Priority := $00008000;
+ 4 : Priority := HIGH_PRIORITY_CLASS;
+ 5 : Priority := REALTIME_PRIORITY_CLASS;
+ else Priority := NORMAL_PRIORITY_CLASS;
+ end;
+ if PriorityClass > 2 then SetPriorityClass(GetCurrentProcess, Priority)
+ else SetPriorityClass(GetCurrentProcess, NORMAL_PRIORITY_CLASS);
+
+ result := CreateProcess(nil, PChar(FileName + ' ' + InputFileName), @SecAttr,
+ @SecAttr, true, CREATE_NO_WINDOW or Priority, PAnsiChar(EnvVarString){nil}, nil, Startup,
+ ProcessInformation);
+ LocalFree(HLOCAL(pSD));
+end;
+
+function ReadLogHeader(LogHandle, LinpackHandle, ReadComplete : THandle;
+ var stopcode : byte) : string;
+const BufferSize = 1024;
+var Buffer : PAnsiChar; BytesRead, TotalBytes, ExitCode : cardinal;
+ tmpstr : string;
+ norunspos : integer; normpos : integer;
+begin
+ Buffer := AllocMem(BufferSize + 1);
+ TotalBytes := 0;
+ BytesRead := 0;
+ tmpstr := '';
+ while (WaitForSingleObject(LinpackHandle, 0) <> WAIT_OBJECT_0) do begin
+ ReadFile(LogHandle, Buffer[TotalBytes], 1, BytesRead, nil);
+ inc(TotalBytes, BytesRead);
+ tmpstr := string(Buffer);
+ if TotalBytes >= BufferSize then begin
+ Break;
+ end;
+ norunspos := pos('No runs', tmpstr);
+ if (norunspos <> 0) and (PosEx(#10, tmpstr, norunspos) <> 0) then
+ Break;
+ normpos := pos('(norm)', tmpstr);
+ if (normpos <> 0) and (PosEx(#10, tmpstr, normpos) <> 0) then
+ Break;
+ end;
+ if WaitForSingleObject(LinpackHandle, 0) = WAIT_OBJECT_0 then begin
+ GetExitCodeProcess(LinpackHandle, ExitCode);
+ stopcode := ExitCode;
+ if (stopcode <> 2) and (stopcode <> 6) then stopcode := 0;
+ end
+ else stopcode := 1;
+ result := tmpstr;
+ Freemem(Buffer);
+end;
+
+function ReadLogString(LogHandle, LinpackHandle, ReadComplete : THandle;
+ var OutputString : string; var stopcode : byte) : boolean;
+const BufferSize = 81;
+var Buffer : PAnsiChar; BytesRead, TotalBytes : cardinal;
+ Overlap : TOverlapped;
+ HandleArr : array[0..1] of THandle;
+ ExitCode : cardinal;
+begin
+ result := true;
+ Buffer := AllocMem(BufferSize + 1);
+ FillChar(Overlap, Sizeof(TOverlapped), #0);
+ Overlap.hEvent := ReadComplete;
+ HandleArr[0] := ReadComplete;
+ HandleArr[1] := LinpackHandle;
+ TotalBytes := 0;
+ BytesRead := 0;
+ OutputString := '';
+ while pos(#10, OutputString) = 0 do begin
+ if not ReadFile(LogHandle, Buffer[TotalBytes], 1, BytesRead, @Overlap) then begin
+ if (GetLastError = ERROR_IO_PENDING) then begin
+ if WaitForMultipleObjects(2, @HandleArr, false, INFINITE) <> WAIT_OBJECT_0 then begin
+ CancelIO(LogHandle);
+ GetExitCodeProcess(LinpackHandle, ExitCode);
+ stopcode := ExitCode;
+ result := false;
+ Break;
+ end
+ else begin
+ inc(TotalBytes, 1);
+ OutputString := String(Buffer);
+ if TotalBytes >= BufferSize then begin
+ Break;
+ end;
+ end;
+ end
+ else begin
+ stopcode := 1;
+ CancelIO(LogHandle);
+ Result := false;
+ Break;
+ end;
+ end
+ else begin
+ inc(TotalBytes, BytesRead);
+ OutputString := String(Buffer);
+ if TotalBytes >= BufferSize then begin
+ Break;
+ end;
+ end;
+ end;
+ FreeMem(Buffer);
+end;
+
+function ReadLogFooter(LogHandle, LinpackHandle, ReadComplete : THandle) : string;
+const BufferSize = 1024;
+var Buffer : PAnsiChar; BytesRead, TotalBytes : cardinal;
+ Overlap : TOverlapped;
+ HandleArr : array[0..1] of THandle;
+begin
+ Buffer := AllocMem(BufferSize + 1);
+ FillChar(Overlap, Sizeof(TOverlapped), #0);
+ Overlap.hEvent := ReadComplete;
+ HandleArr[0] := ReadComplete;
+ HandleArr[1] := LinpackHandle;
+ TotalBytes := 0;
+ BytesRead := 0;
+ result := '';
+ while true do begin
+ if not ReadFile(LogHandle, Buffer[TotalBytes], 1, BytesRead, @Overlap) then begin
+ if (GetLastError = ERROR_IO_PENDING) then begin
+ if WaitForMultipleObjects(2, @HandleArr, false, INFINITE) <> WAIT_OBJECT_0 then begin
+ CancelIO(LogHandle);
+ Break;
+ end
+ else begin
+ inc(TotalBytes, 1);
+ result := String(Buffer);
+ if TotalBytes >= BufferSize then begin
+ Break;
+ end;
+ end;
+ end
+ else begin
+ CancelIO(LogHandle);
+ Break;
+ end;
+ end
+ else begin
+ inc(TotalBytes, BytesRead);
+ result := String(Buffer);
+ if TotalBytes >= BufferSize then begin
+ Break;
+ end;
+ end;
+ end;
+ FreeMem(Buffer);
+end;
+
+function IsX64Supported : boolean;
+var IsWow64Process : function(Handle: THandle; var Res: BOOL): BOOL; stdcall;
+ IsWow64Result: BOOL;
+begin
+ result := false;
+ IsWow64Process := GetProcAddress(GetModuleHandle('kernel32'), 'IsWow64Process');
+ if Assigned(IsWow64Process) and IsWow64Process(GetCurrentProcess, IsWow64Result)
+ then result := IsWow64Result;
+end;
+
+function GetTempFolderPath : string;
+var lng: DWORD; thePath: string;
+begin
+ SetLength(thePath, MAX_PATH);
+ lng := GetTempPath(MAX_PATH, PChar(thePath));
+ SetLength(thePath, lng);
+ result := thePath;
+end;
+
+function GetMaxThreadsNumber : byte;
+begin
+ result := strtointdef(GetEnvironmentVariable('NUMBER_OF_PROCESSORS'), 1);
+end;
+
+function GetFreeMemory : word;
+var MemoryStatusEx : TMemorystatusEx;
+begin
+ MemoryStatusEx.dwLength := SizeOf(MemoryStatusEx);
+ GlobalMemoryStatusEx(MemoryStatusEx);
+ result := MemoryStatusEx.ullAvailPhys div 1048576;
+end;
+
+function GetTotalMemory: word;
+var MemoryStatusEx : TMemorystatusEx;
+begin
+ MemoryStatusEx.dwLength := SizeOf(MemoryStatusEx);
+ GlobalMemoryStatusEx(MemoryStatusEx);
+ result := MemoryStatusEx.ullTotalPhys div 1048576;
+end;
+
+procedure WindowScreenShot(WinHandle : HWND; filename : string);
+var DC : HDC; r : TRect; destBitmap : TBitmap; destPNG : TPNGImage;
+begin
+ dc := GetWindowDC(GetDesktopWindow);
+ GetWindowRect(WinHandle,r) ;
+ destBitmap := TBitmap.Create;
+ destPNG := TPNGImage.Create;
+ try
+ destBitmap.Width := r.Right - r.Left;
+ destBitmap.Height := r.Bottom - r.Top;
+ BitBlt(destBitmap.Canvas.Handle, 0, 0, destBitmap.Width, destBitmap.Height,
+ DC, r.Left, r.Top, SRCCOPY);
+ destPNG.assign(destBitmap);
+ destPNG.SaveToFile(filename);
+ finally
+ ReleaseDC(GetDesktopWindow, DC) ;
+ destBitmap.FreeImage;
+ Freeandnil(destBitmap);
+ destPNG.Free;
+ end;
+end;
+
+function GetCPUBrandString : string;
+ function CPUIDAvail : boolean; assembler;
+ {Tests whether the CPUID instruction is available}
+ asm
+ pushfd // get flags into ax
+ pop eax // save a copy on the stack
+ mov edx,eax
+ xor eax, 0200000h // flip bit 21
+ push eax // load new value into flags
+ popfd // get them back
+ pushfd
+ pop eax
+ xor eax,edx
+ and eax, 0200000h // clear all but bit 21
+ shr eax, 21
+ end;
+
+var s:array[0..48] of ansichar;
+begin
+ fillchar(s,sizeof(s),0);
+ if CPUIDAvail then begin
+ asm
+ //save regs
+ push ebx
+ push ecx
+ push edx
+ //check if necessary extended CPUID calls are
+ //supported, if not return null string
+ mov eax,080000000h
+ CPUID
+ cmp eax,080000004h
+ jb @@endbrandstr
+ //get first name part
+ mov eax,080000002h
+ CPUID
+ mov longword(s[0]),eax
+ mov longword(s[4]),ebx
+ mov longword(s[8]),ecx
+ mov longword(s[12]),edx
+ //get second name part
+ mov eax,080000003h
+ CPUID
+ mov longword(s[16]),eax
+ mov longword(s[20]),ebx
+ mov longword(s[24]),ecx
+ mov longword(s[28]),edx
+ //get third name part
+ mov eax,080000004h
+ CPUID
+ mov longword(s[32]),eax
+ mov longword(s[36]),ebx
+ mov longword(s[40]),ecx
+ mov longword(s[44]),edx
+ @@endbrandstr:
+ //restore regs
+ pop edx
+ pop ecx
+ pop ebx
+ end;
+ result:=string(s);
+ end
+ else result := '';
+end;
+
+function GetCPUName : string;
+var s : string;
+begin
+ s := GetCPUBrandString;
+ if s <> '' then begin
+ s := stringreplace(s,' ','',[rfReplaceAll]);
+ s := stringreplace(s,'CPU','',[rfIgnoreCase]);
+ s := stringreplace(s,'Processor','',[rfIgnoreCase]);
+ s := stringreplace(s,'(R)','®',[rfReplaceAll,rfIgnoreCase]);
+ s := stringreplace(s,'(TM)','™',[rfReplaceAll,rfIgnoreCase]);
+ s := stringreplace(s,' ',' ',[rfReplaceAll]);
+ if pos('@',s) <> 0 then delete(s,pos('@',s),10);
+ result := trimright(s);
+ end
+ else result := s;
+end;
+
+procedure WindowFlash(Flashtype : cardinal; WinHandle : HWND;
+ Count, Timeout : cardinal);
+var
+ FWinfo: TFlashWInfo;
+begin
+ FWinfo.cbSize := SizeOf(TFlashWInfo);
+ FWinfo.hwnd := WinHandle; // Handle of Window to flash
+ FWinfo.dwflags := Flashtype;//FLASHW_ALL;
+ SystemParametersInfo(SPI_GETFOREGROUNDFLASHCOUNT, 0,
+ @FWinfo.uCount, 0); //number of times to flash (get from Windows)
+ FWinfo.dwtimeout := Timeout; // speed in ms, 0 default blink cursor rate
+ FlashWindowEx(FWinfo); // make it flash!
+end;
+
+function SizeToMem(Size: cardinal) : cardinal;
+begin
+ result := trunc(((size + 15 + 80) * (size + 2.5)) / 131072) + 2;
+end;
+
+function MemToSize(Mem : cardinal) : cardinal;
+begin
+ result := trunc(- 48.75 + sqrt(2376.5625 + (mem - 1) * 131072 - 59.375));
+end;
+
+function GetVersion (full : boolean) : string;
+var VerInfoSize: DWORD;
+ VerInfo: Pointer;
+ VerValueSize: DWORD;
+ VerValue: PVSFixedFileInfo;
+ Dummy: DWORD;
+begin
+ VerInfoSize := GetFileVersionInfoSize(PChar(ParamStr(0)), Dummy);
+ GetMem(VerInfo, VerInfoSize);
+ GetFileVersionInfo(PChar(ParamStr(0)), 0, VerInfoSize, VerInfo);
+ VerQueryValue(VerInfo, '\', Pointer(VerValue), VerValueSize);
+ with VerValue^ do begin
+ Result := Format('%d.%d.%d',[dwFileVersionMS shr 16,
+ dwFileVersionMS and $FFFF, dwFileVersionLS shr 16]);
+ if full then Result := Result + Format('.%d',[dwFileVersionLS and $FFFF]);
+ end;
+ FreeMem(VerInfo, VerInfoSize);
+end;
+
+function CompositingEnabled: Boolean;
+const
+ dwmapi = 'dwmapi.dll';
+ DwmIsCompositionEnabledSig = 'DwmIsCompositionEnabled';
+var
+ DLLHandle: THandle;
+ DwmIsCompositionEnabledProc: function(pfEnabled: PBoolean): HRESULT; stdcall;
+ Enabled: Boolean;
+begin
+ Result := False;
+ if Win32MajorVersion >= 6 then
+ begin
+ DLLHandle := LoadLibrary(dwmapi);
+
+ if DLLHandle <> 0 then
+ begin
+ @DwmIsCompositionEnabledProc := GetProcAddress(DLLHandle,
+ DwmIsCompositionEnabledSig);
+
+ if (@DwmIsCompositionEnabledProc <> nil) then
+ begin
+ DwmIsCompositionEnabledProc(@Enabled);
+ Result := Enabled;
+ end;
+
+ FreeLibrary(DLLHandle);
+ end;
+ end;
+end;
+
+function AddDateTimeToFilename (Filename, Extension : string; TimeToAdd : TDateTime) : string;
+var DS, TS : char;
+begin
+ DS := DateSeparator;
+ TS := TimeSeparator;
+ DateSeparator := '-';
+ TimeSeparator := '-';
+ result := Filename + FormatDateTime(' ddddd tt', TimeToAdd) + '.' + Extension;
+ TimeSeparator := TS;
+ DateSeparator := DS;
+end;
+
+procedure CalcMinMax(var data_arr: array of single; arrlength : integer; var min, max : real);
+var i : integer; tmpmin, tmpmax : real;
+begin
+ tmpmin := 10000;
+ tmpmax := -10000;
+ for i := 0 to arrlength do begin
+ if data_arr[i] < tmpmin then tmpmin := data_arr[i]
+ else
+ if data_arr[i] > tmpmax then tmpmax := data_arr[i];
+ end;
+ min := tmpmin;
+ max := tmpmax;
+end;
+
+end.
diff --git a/README.md b/README.md
index ed94d50..b580e0b 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,7 @@
-LinX-old
+LinX
========
-LinX
+This is the old LinX — a Windows GUI for Intel Linpack.
+You probably don't want to see the code — it is as ugly as it ever gets. It's also written in Delphi.
+
+N. B. in case you do go forth and see the code: All of this was written by a student me. My coding habits have somewhat (drastically) improved since that time. \ No newline at end of file
diff --git a/Speedfan.ini b/Speedfan.ini
new file mode 100644
index 0000000..97e45da
--- /dev/null
+++ b/Speedfan.ini
@@ -0,0 +1,9 @@
+[Speedfan]
+CPU_temp_num=0
+CPU_core0_num=0
+CPU_core1_num=0
+CPU_core2_num=0
+CPU_core3_num=0
+CPU_fan_num=0
+CPU_vcore_num=0
+12V_volt_num=0
diff --git a/Text/changelog_en.txt b/Text/changelog_en.txt
new file mode 100644
index 0000000..f5c718e
--- /dev/null
+++ b/Text/changelog_en.txt
@@ -0,0 +1,212 @@
+LinX 0.6.5
+
+- hopefully works with latest Linpack binaries
+
+LinX 0.6.4
+
+- added an option to run tests for a specified period of time. Use the drop-down list to set minutes or times to run tests
+- small UI redesign/enhancements
+- graph windows now correctly save their positions on program close
+- fixed a somewhat rare bug leading to false LinX errors when CPU usage was high
+- added new command-line options, fixed found bugs in older ones (run LinX.exe -help to view the list of command-line options)
+- added seconds to filenames to prevent overwriting
+
+LinX 0.6.3
+
+- removed the easter egg and added an option to extend glass for Windows Vista and Windows 7 users with Aero on
+- changed (raised) upper limit for 32-bit Linpack to 15500
+- graph selection is now saved
+- monitoring data (minimum and maximum values for each monitor) is now appended to the end of text log if graphs were enabled during testing
+- fixed a possible bug when LinX would stop responding if Linpack quits due to lack of memory
+- fixed a possible bug when running more than one instance of LinX simultaneously
+- fixed a possible bug in graphs that would lead to an error message if Everest or Speedfan was shut down during testing
+- fixed a bug with progressbar not visible on Classic theme
+
+
+LinX 0.6.2
+
+- threading and communication with Linpack improved as an attempt to fix the varying GFlops issue
+- current directory is now set to LinX' .exe directory on program start to prevent getting fake "Some Linpack files missing" messages
+- screenshots of main window can now be made even with Seetings or About windows open
+
+
+LinX 0.6.1
+
+- Linpack files updated to version 10.2
+- main algorithm rewritten, might improve performance a bit
+- fixed an issue with inconsistent GFlops values in some cases
+- hotkeys for Start and Stop buttons added: Enter and Escape keys respectively
+
+
+LinX 0.6.0
+
+- added setting to change Linpack's priority
+- removed restriction to maximium number of threads (formerly equal to the logical CPUs number)
+- tweaked (rebased) the libiomp5md.dll for a higher possible Problem size of 32-bit Linpack
+- added setting to add date/time to saved files (logs & screenshots), on by default
+- changed progressbar to look the same on all OSes and consume less resources
+- main menu changes/simplifications
+- command-line keys added (experimental), for the list of available parameters launch LinX.exe /?
+- some interface changes and optimizations
+- easter-egg added
+
+
+LinX 0.5.9.1
+
+- removed the restriction of maximum 999 runs
+- fixed a bug when displaying results of very small tests (Problem Size<1000)
+- samll optimizations
+
+
+LinX 0.5.9
+
+- elapsed/remaining time is now synchronized to Windows time
+- lots of inner bug fixes and optimizations
+- cosmetic interface changes
+
+
+LinX 0.5.8.2
+
+- LinX now works correctly when launched from CD/DVD disc
+- improved GUI look when scaling is enabled
+- minor enhancements
+
+
+LinX 0.5.8
+
+- now it is not necessary to run a test for current settings to be saved
+- added saving of the settings at the start of testing to prevent loosing them in case of BSOD or hang
+- added an option to save Linpack's log during testing, after every completed test (decreases performance a bit when selected)
+- graphs can now be shown during testing in real-time
+- improvements and enhancements to graph windows, graph window positions and sizes are now saved on exit
+- About and Information windows are now joined
+- small fixes/improvements
+
+
+LinX 0.5.7
+
+- slight UI redesign: some options moved to the Settings window
+- added a better About window
+
+
+LinX 0.5.6
+
+- interface fixes and enhancements, Linpack mode and number of threads are now displayed in statusbar
+- CPU name is noe displayed in statusbar
+- Linpack mode is now mentioned in text log too
+
+
+LinX 0.5.5
+
+- improved threading control. 2 Linpack processes are created no more to load all "cores" on HT processors
+- added tray icon option. When enabled, LinX will be minimized to tray
+- small interface fixes
+
+
+LinX 0.5.4:
+
+- HyperThreading support added
+- thread control added. You can now set the number of threads Linpack will create and thus control the number of physical cores that will be stressed. This setting is located in the Settings window (who'd have thought? )
+- Settings window with all existing and a couple of new settings added. No need to edit the ini-file manually now
+- main menu redesigned
+- lots of minor bugs found and fixed
+- performance optimized a little bit more
+- graphs have now customizable top and bottom limits
+- changed the icon a bit
+
+
+LinX 0.5.3:
+
+- the temporary log file is no more created during testing, performance increased a little
+- the v10.1 Linpack executables are now AMD compatible too
+- log interface redesigned
+- All mem ("All") button added. When in pressed state LinX will always use the current maximum available memory
+- localization support via the "local.lng" file added
+
+
+LinX 0.5.2:
+
+- Linpack executables updated to version 10.1 (for Intel CPUs only; for AMD users there's still Linpack 10.0 with no CPU restrictions, just rename and replace the linpack_xeon32.exe_amd and linpack_xeon64.exe_amd)
+- added Speedfan support. LinX can now import such data as CPU temperature, vcore, fan speed and +12V voltage from Speedfan. Fill in the values in the Speedfan.ini file in LinX' folder for this to work (see readme for more details)
+- some interface enhancements/fixes
+- consumed memory calculation is slightly improved
+- LinX now uses ini-files (LinX.ini and Speedfan.ini) to store its settings in. Those who like tweaking things may now override default values for the amount of memory to leave for OS in Max mem mode and maximum Problem size for Linpack32
+- the Leading Dimensions value is now adjusted for maximum performance instead of being equal to Problem Size value. This can be disabled via the UseOptimizedLeadingDimensions=0 key in the LinX.ini
+
+
+LinX 0.5.1:
+
+- LinX can now create, display and save as PNG graphs for CPU temp, CPU fan speed, vcore and +12V voltage based on Everest data. Graphs are shown in separate windows, can be resized and made semi-transparent
+- the green status field now flashes in all time modes (elapsed, remaining & finish time)
+- you can now make screenshot of LinX's window by pressing the F5 key. The screenshot will be saved as LinX.png in program's folder. Pressing F5 in graph windows will save the corresponding graph (not the whole window) as PNG image
+
+
+LinX 0.5.0
+
+- added Everest support. LinX can now display CPU temperature from Everest. The displayed temperature is the temperature of the hottest core; if a CPU doesn't have core sensors then a temperature from an external sensor is displayed. For this to work you'll need to have Everest running in background with "Enable shared memory" option checked (in Everest "File -> Preferences -> External Applications"; you might also want to set update frequency to 1 sec for external applications and adjust Tjmax value)
+- added an option to stop testing if CPU temp exceeds the desired temp (see above)
+- LinX now correctly reads values from damaged lininput file
+- and saves most of its settings on exit
+
+
+LinX 0.4.9
+
+- LinX' window is now vertically resizeable for better log visibility
+- fixed a program error that occured when an error was detected on last run
+- "Always on top" mode added (double click window's caption to toggle)
+- LinX now saves window size on exit
+- when "Enable sounds" checkbox is checked sound will be played on successfull completion of all tests too
+- interface fixes/improvements
+
+
+LinX 0.4.8
+
+- once again rewritten that "polling" algorithm. LinX' window can now be safely moved during testing
+
+
+LinX 0.4.7
+
+- Linpack "polling" algorithm rewritten, resulting in noticeable performance increase. Only one temporary file is used during testing now
+- maximum Problem Size for 32-bit Linpack corrected
+- added Residual (norm) power check (to detect some errors after 1st pass)
+- samll interface fixes
+
+
+LinX 0.4.6
+
+- thanks to Right again 64-bit Linpack now works with AMD processors
+- improved algorithm for retrieving total/available memory. Now LinX correctly determines free memory on 32-bit OSes with more than 2 GB of RAM and on 64-bit OSes with more than 4 GB of RAM
+- added ~2 GB maximum memory limit for 32-bit Linpack (due to Linpack's inner restriction)
+- added sound notification on error
+
+
+LinX 0.4.5
+
+- thanks to Right from forums.overclockers.ru 32-bit Linpack now works on AMD processors too
+- Linpack starting routine modified, works correctly on Windows Vista x64 now
+- .bat-file is no more generated to launch Linpack
+- progressbar added
+- additional indication of completed/total tests added in statusbar
+
+
+LinX 0.4.3
+
+- time display mode can now be changed during testing: single click - toggle elapsed/remaining/estimated finish time, double click - disable time displaying completely
+- Linpack performance improved
+
+
+LinX 0.4.2
+
+- fixed sometimes wrong displayed minimum time/maximum performance
+- minimum time is now displayed in minutes and seconds
+- stopping on error is now optional
+- small interface sixes
+
+
+LinX 0.4.1
+
+- added prompt on program exit when testing is in progress
+- added completed/total tests indication in window's caption
+- added window position saving on exit
+- fixed a bug with errors in log when number of test runs was higher than 255
+- small interface fixes \ No newline at end of file
diff --git a/Text/changelog_ru.txt b/Text/changelog_ru.txt
new file mode 100644
index 0000000..d500059
--- /dev/null
+++ b/Text/changelog_ru.txt
@@ -0,0 +1,212 @@
+LinX 0.6.5
+
+- хочется верить, что работает с последней версией Linpack
+
+LinX 0.6.4
+
+- добавлена возможность запустить тестирование на заданный временной интервал и новое выпадающее меню для переключения между двумя режимами (разы/минуты)
+- небольшие изменения/улучшения пользовательского интерфейса
+- окна графиков теперь корректно сохраняют свои позиции при выходе из программы
+- исправлен не очень частый баг с ошибками LinX при сильной загрузке процессора
+- добавлены новые параметры командной строки, исправлены найденные ошибки в старых (LinX.exe -help для вывода доступных параметров)
+- добавлены секунды в имена файлов для избежания переименования
+
+
+LinX 0.6.3
+
+- убрана пасхалка и добавлена опция включения эффекта стекла на ОС Windows Vista и Windows 7 с включенным Aero
+- изменён (увеличен) верхний предел для 32-битного Linpack до 15500
+- выбранные графики теперь сохраняются при выходе
+- данные мониторинга (минимальное и максимальное значения для каждого монитора) теперь записываются в конец текстового отчёта, если соответствующие графики были включены во время тестирования
+- исправлен баг, при котором LinX мог перестать отвечать на запросы, если Linpack завершался из-за нехватки памяти
+- исправлен возможный баг при одновременном запуске сразу нескольких копий LinX
+- исправлен возможный баг в графиках, могущий привести к сообщению об ошибке, если Everest или Speedfan были выключены во время тестирования
+- исправлен баг с невидимым прогрессбаром в классической теме
+
+
+LinX 0.6.2
+
+- улучшено управление потоками и взаимодействие с Linpack, чтобы исправить проблему с меняющимися Гигафлопсами
+- текущая папка теперь явно соответствует папке с программой, чтобы избежать ложных ошибок «Файлы Linpack не найдены»
+- скриншоты главного окна теперь можно делать и с открытыми окнами настроек и информации о программе
+
+
+LinX 0.6.1
+
+- файлы Linpack обновлены до версии 10.2
+- модифицирован главный алгоритм, возможно, улучшится производительность
+- исправлена ошибка с непостоянными значениями Гигафлопс
+- добавлены горячие клавиши для кнопок Тест и Стоп, Enter и Escape соответственно
+
+
+LinX 0.6.0
+
+- добавлена возможность изменения приоритета процесса Linpack
+- cнято ограничение на максимальное число потоков, создаваемых Linpack
+- изменён файл libiomp5mp.dll для бОльшего максимального объёма задачи 32-битного Linpack
+- добавлена возможность добавлять время/дату к именам сохраняемых файлов, включена по умолчанию
+- изменена индикация процесса тестирования (одинакова на всех ОС и менее требовательна к ресурсам)
+- различные изменения/упрощения в главном меню программы
+- добавлены ключи командной строки (экспериментально), список ключей: LinX.exe /?
+- небольшие изменения в интерфейсе и оптимизации
+- добавлена маленькая пасхалка не для всех
+
+LinX 0.5.9.1
+
+- снято ограничение на максимум 999 проходов теста
+- исправлен баг с отображением результатов небольших тестов (Объем задачи < 1000)
+- небольшие оптимизации
+
+LinX 0.5.9
+
+- улучшено отображение времени (синхронизируется с временем Windows для избежания накопления погрешности)
+- множество испрвлений и оптимизаций
+- косметичекие улучшения в интерфейсе
+
+LinX 0.5.8.2
+
+- теперь программа корректно работает при запуске с CD/DVD-дисков
+- улучшено отображение интерфейса для режимов с масштабированием
+- мелкие исправления
+
+LinX 0.5.8
+
+- для сохранения настроек тестирования теперь необязательно проходить тест на этих настройках
+- добавлено сохранение настроек при старте теста (для их сохранеия в случае зависания или BSOD'a)
+- добавлена возможность автосохранения отчета Linpack в течение тестирования (слегка снижает производительность)
+- графики теперь строятся и во время тестирования
+- улучшено отображение графиков, добавлено сохранение позиций и размеров графиков на экране
+- обновлено окошко «О программе»
+- исправлены мелкие ошибки
+
+LinX 0.5.7
+
+- небольшое изменение интерфейса: часть настроек перемещена в окно Параметры
+- улучшено окно О программе
+
+LinX 0.5.6
+
+- изменения, исправления и улучшения в интерфейсе: теперь в статусной строке отображается число потоков и режим (x32/x64) Linpack'а
+- добавлено отображение модели процессора в статусной строке
+- режим Linpack'а теперь также указывается в текстовом отчете
+
+LinX 0.5.5.2
+
+- подкорректирован (уменьшен) верхний предел для 32-битного Linpack'а для ОС Windows Vista и Windows 7
+- исправлено незначительное падение производительности Linpack'а в предыдущей версии
+- исправлено иногда неверное определение нестабильности 64-битным Linpack'ом (несовпадающие колонки Residual) на системах с Core i7 с большими объемами памяти
+
+LinX 0.5.5
+
+- улучшено управление потоками. 2 процесса Linpack'а более не запускаются для нагрузки всех ядер на процессорах с HyperThreading
+- добавлена возможность включить значок в трее и сворачивать программу в трей
+- небольшие улучшения в интерфейсе
+
+LinX 0.5.4
+
+- реализована поддержка HyperThreading. Теперь, если процессор поддерживает эту технологию, будут запущены 2 процесса Linpack'а, нагружающие все (логические и физические) ядра. Для этого есть соответствующий пункт в окне Параметры
+- добавлена поддержка управления потоками Linpack'а. Теперь возможно запустить Линпак с меньшим количеством потоков, чем максимальное. Число потоков можно задавать в выпадающем меню при клике правой кнопкой мыши по кнопке Тест и в окне Параметры
+- дополнено и улучшено главное меню программы
+- добавлено диалоговое окно расширенных настроек
+- исправлено много мелких ошибкок
+- еще немного улучшено быстродействие программы
+- графики теперь имеют редактируемые верхние и нижние пределы
+
+LinX 0.5.3
+
+- во время тестирования более не создается временный лог-файл для записи результатов, Гигафлопс будет немного, но больше
+- файлы Линпака 10.1 теперь, вполне возможно, работают на всех процессорах
+- обновлен интерфейс
+- добавлена поддержка локализаций. За локализованный интерфейс отвечает файл local.lng, сторонники английского интерфейса могут его удалить, полиглоты могут придумать свой
+- добавлена кнопка для постоянного использования всей доступной памяти
+
+LinX 0.5.2
+
+- обновлены исполняемые файлы Linpack'а до версии 10.1 (только для процессоров Intel). Спасибо камарду sashar2 за найденные и выложенные библиотеки libiomp5md.dll, необходимые для работы этой версии Linpack'а. Владельцы процессоров AMD могут использовать файлы Linpack 10.0 с поддержкой всех процессоров (linpack_xeon32.exe_amd и linpack_xeon64.exe_amd), переименовав их в соответсвенно linpack_xeon32.exe и linpack_xeon64.exe и заменив исходные файлы
+- добавлена поддержка импорта значений температуры процессора, напряжений ядра и +12 в и скорости вращения процессорного вентилятора из Speedfan'а. Для этого необходимо в меню "Импорт данных" выбрать соответствующий пункт, а также внести в файл Speedfan.ini значения порядковых номеров соответствующих температур/напряжений/скоростей из программы Speedfan
+- при включенном импортировании данных из Everest'а или Speedfan'а в строке состояния помимо текущей и максимальной температуры теперь также отображается текущее значение напряжения ядра процессора и (если данные берутся из Everest'а) его частота
+- LinX теперь хранит все свои настройки, а также настройки Linpack'а в конфигурационном файле LinX.ini в папке с программой
+- теперь для значения Leading Dimensions Linpack'а по умолчанию выбирается ближайшее большее (или равное), чем Объем задачи, значение, кратное 8 и не кратное 16 (позволяет добиться максимальной производительности по заверениям разработчиков). Эту возможность можно отключить с помощью ключа UseOptimizedLeadingDimensions=0 в конфигурационном файле
+
+LinX 0.5.1.4
+
+- исправлены ошибки, связанные с импортом данных из Everest'а и с построением и отображением графиков
+
+LinX 0.5.1
+
+- добавлена возможность построения графиков по окончании тестирования по данным из Everest'а. Графики отображаются в отдельных окошках с поддержкой изменения размера и полупрозрачности (по движению колёсика мыши)
+- поле индикации теперь мигает во всех режимах отображения времени
+- добавлена возможность сохранить скриншот программы в формате PNG по нажатию клавиши F5. Скриншот сохраняется в папке с программой как LinX.png. Нажатие F5 в окнах с графиками сохранит сами графики также в формате PNG в папку с программой
+
+LinX 0.5.0
+
+- добавлена поддержка импорта температуры ЦП из Everest'а. Для ее включения необходимо отметить пункт меню "Everest -> Импортировать данные", а в самом Everest'е отметить опцию "Использовать совместную память" (в Everest'е - "Файл -> Настройки... -> Внешние приложения"). Отображаемая температура - температура самого горячего из ядер ЦП; если в процессоре отсутствуют термодатчики в ядре, используется температура с внешнего датчика на материнской плате
+- добавлена возможность прекратить тестирование при превышении температурой процессора заданного значения
+- исправлен баг с "замерзанием" прошедшего времени при смене режима отображения времени до окончания первого теста
+- предположительно исправлено некорректное чтение настроек из поврежденного файла lininput
+- LinX теперь запоминает большинство настроек при выходе
+
+LinX 0.4.9.1
+
+- слегка изменен интерфейс
+- исправлен баг, приводивший к сообщению о завершении Linpack'а по окончании тестирования в некоторых ситуациях
+
+LinX 0.4.9
+
+- добавлена возможность растягивания окна вниз (для большей удобочитаемости лога)
+- незначительные исправления и изменения в интерфейсе
+- предположительно исправлена ошибка с последующим завершением программы, возникавшая при обнаружении ошибки на последнем тесте
+- добавлен режим "Поверх всех окон", для его включения/выключения необходимо дважды кликнуть по заголовку окна
+- добавлено сохранение размеров окна при выходе
+- при выборе пункта "Включить звуковую индикацию" звук будет проигрываться и при успешном завершении теста (однократно)
+- вновь добавлено мерцание статусной строки для индикации активности (отключается вместе с отключением отображения времени по двойному клику по статусной строке)
+
+LinX 0.4.8
+
+- вновь переписан алгоритм опроса Linpack'а. Теперь LinX можно безболезненно перетаскивать во время тестирования
+
+LinX 0.4.7
+
+- переписан алгоритм "опроса" Linpack'а. Теперь LinX использует всего один временный файл. Производительность практически на уровне оригинального Линпака
+- подкорректировано максимальное значение матрицы/используемой памяти для 32-битного Linpack'а по совету камрада Megagad
+- добавлена проверка отрицательности степени Residual(norm) для первого теста
+- мелкие (в т.ч. грамматические:) фиксы в интерфейсе
+
+LinX 0.4.6
+
+- теперь, вновь благодаря камраду Right, и 64-битный Linpack в архиве с программой работает на любых ЦП (в т.ч. и AMD); 64-битные обладатели процессоров AMD, дружно скажите ему спасибо!
+- изменен алгоритм получения максимальной доступной физической памяти. Теперь LinX корректно определяет доступную физическую память на 32-битных ОС с более чем 2ГБ ОЗУ и на 64-битных ОС с более чем 4 ГБ ОЗУ
+- добавлено ограничение в 2 ГБ на максимальный объем оперативной памяти, выделяемой для 32-битного Linpack'а (внутреннее ограничение самого Linpack'а)
+- добавлена опция звуковой нотификации при ошибке
+- добавлена поддержка Unicode (вроде:)
+
+LinX 0.4.5
+
+- теперь благодаря камраду Right 32-битный Linpack в архиве с программой работает на любых ЦП (в т.ч. и AMD); обладатели процессоров AMD, дружно скажите ему спасибо!
+- изменен способ запуска Linpack'а. Теперь программа корректно работает в Windows Vista x64
+- для запуска Linpack'а более не создается временный .bat-файл
+- добавлен прогрессбар для наглядности степени выполнения тестов (его, как и весь подсчет времени, можно отключить двойным кликом по полоске состояния во время тестирования)
+- добавлена дополнительная индикация пройденных тестов в нижнем левом углу окошка
+
+LinX 0.4.3
+
+- добавлена возможность смены режима отображения времени во время тестирования (клик по статусбару - переключение между прошедшим временем/оставшимся временем/временем окончания расчетов, двойной клик - отключение индикации времени)
+- слегка увеличена производительность Линпака
+
+
+LinX 0.4.2
+
+- исправлено иногда неверное отображение минимального времени/пиковой производительности
+- оставшееся время теперь отображается на кнопке Тест
+- минимальное время итерации теперь рассчитывается в минутах/секундах
+- добавлена возможность отключить остановку теста при ошибке
+- мелкие фиксы в интерфейсе
+
+
+LinX 0.4.1
+
+- добавлен запрос на подтверждение выхода при попытке выйти из программы во время тестирования
+- добавлена индикация пройденных тестов и расчет оставшегося времени в заголовке окна
+- добавлено запоминание позиции окна на экране при выходе
+- исправлен досадный баг с ошибками в выводе лога при количестве итераций > 255
+- совершенно не заметные фиксы в интерфейсе \ No newline at end of file
diff --git a/Text/command-line.txt b/Text/command-line.txt
new file mode 100644
index 0000000..0ea83b6
--- /dev/null
+++ b/Text/command-line.txt
@@ -0,0 +1,13 @@
+help ? h ;overrides everything
+autostart a
+problemsizexxxxx psxxxxx ;overrides mxxxx
+memoryxxxx mxxxx ;overrides psxxxxx
+nxxx
+maxmemory mm ; overrrides psxxxxx & mxxx
+minimized m ;overrides t
+;trayonly t ;overrides m
+
+32 ;overrides 64
+64 ;overrrides 32
+thxx
+prx \ No newline at end of file
diff --git a/Text/local.lng b/Text/local.lng
new file mode 100644
index 0000000..6212374
--- /dev/null
+++ b/Text/local.lng
Binary files differ
diff --git a/Text/readme_en.txt b/Text/readme_en.txt
new file mode 100644
index 0000000..bcad234
--- /dev/null
+++ b/Text/readme_en.txt
@@ -0,0 +1,61 @@
+LinX - a simple GUI for Intel Linpack Benchmark.
+
+The main point of Linpack is to solve systems of linear equations of the given size (Problem Size). It is designed as a benchark to test the performance of a system in GFlops - billions of floating point operation per second. But being highly optimized it is also the most stressful CPU testing program to date and is a great tool in determining stability/instability of a CPU, outperforming other CPU testing software at least time-wise. One and the same system of equations is solved repeatedly; if all results match each other - the CPU is stable, otherwise the instability is obvious, since the same equations system cannot produce different solutions.
+
+A brief overview of LinX' functionality and interface:
+
+File -> Save Screenshot menu item. Saves main window's screenshot into program folder in a PNG format.
+
+File -> Save Text Log menu item. During or after testing saves a text log with testing results into program folder.
+
+File > Exit menu item. Exits the program. (Who'd had thought?)
+
+Settings menu item. Opens a window with Linpack's and LinX's additional settings.
+
+Settings window:
+ Main Linpack Settings:
+ -testing mode (32-bit/64-bit). By default is set to OS type;
+ -Linpack rocess priority. Setting this value higher than Normal is not recommended;
+ -number of threads Linpack creates. By default is set to the number of logical processors (including HyperThreading-cores);
+ -data alignment. 4 KiB by default, equal to the page size in Windows OS;
+ -optimal Leading Dimensions. The Leading Dimensions value will be set to the nearest odd multiple of 8 higher than or equal to the Problem Size value (supposed to produce better performance)
+
+ Advanced settings. These are to be changed only if you have problems getting Linpack to work.
+ -maximum Problem Size for 32-bit Linpack. Lower if on higher Problem Size/memory values Linpack reports not enough memory
+ -amound of RAM that will be left for OS when using the All memory option. Can be increased to increase OS responsiveness.
+
+ LinX settings:
+ -auto-stop testing when an error is detected
+ -auto-save log file during testing (as in Linpack, lowers performance a bit)
+ -enable sounds upon success/fail
+ -tray icon and the ability to minimize LinX to tray area to save some taskbar space
+ -add current date/time or date/time of testing start to screenshot and log files respectively
+ -disable context hints
+
+ External Applications Import:
+ -monitoring data source (None, Everest, Speedfan):
+
+Allows LinX to receive some data like core temperatures, CPU voltage, frequency, CPU fan RPM and +12 V voltage from either Everest or Speedfan. The temperature of the hottest core as well as CPU voltage and frequency (when importing data from Everest) are displayed in status bar during testing, other values are used to create graphs. To import data from Everest go in Everest to File -> Preferences... -> External Applicatons and check the Enable shared memory checkbox. For Speedfan you need to first fill in the values in the "Speedfan.ini" file in LinX directory. These values are numbers of temperatures/voltages/fan speeds as they are displayed in Speedfan, from top to bottom starting with 1. For example, if core0 temperature in Speedfan is listed 5th from top set in the INI file CPU_core0_num=5 and so on.
+Note that Everest or Speedfan should be running with LinX for all this to work.
+
+ -stop the testing once the desired temperature is reached. If LinX is getting data from Everest or Speedfan testing will stop when the temperature reaches this threshold to prevent CPU from overheating.
+
+Graphs -> Create menu item. Allows you to choose which graphs to create during testing: you can choose from CPU temperature, CPU fan speed, CPU vcore and +12V voltage values. To display the graphs use the Graphs -> Display menu item. Graph windows can be resized in real-time, graphs can be saved by double-clicking on them in the corresponding window.
+
+ ? menu item. Opens a window with some info about the program and a very short version of this file.
+
+Problem Size & Memory to use fields. The first one is the amount of equations to solve, the second - the corresponding amount of memory that will be allocated by Linpack for this Problem size. You can either set the Problem size and the amount of memory to be used will be calculated automatically or vice versa. There is also an All [memory] button available to use all free physical memory. The effectiveness of finding errors as well as the amount of stress to the processor increase with increased memory usage/Problem size.
+1 MiB = 1024 KiB = 1024^2 bytes
+
+Times to run. This is how many times the test will be run. Once again, the more the better. To consider a CPU fully stable you should set this to at least 50-100, for quick testing lower values are acceptable.
+
+Start & Stop buttons. Used to start and stop the testing process respectively.
+
+Status field/progressbar. Displays the amount of available memory before testing, the elapsed/remaining/finish time during testing (these can be switched by clicking on the field or even turned completely off by double-clicking if you need another 100th of GFlops) and the result (success or fail) with the time spent on testing after testing.
+
+Bottom status bar. Displays some useful information like the current test # and the total number of tests, maximum performance in GFlops so far, testing mode (32-bit or 64-bit), current number of threads, and with Everest or Speedfan data - CPU temp, voltage and frequency. There's also table(default LinX view)/log(Linpack) toggle button available after the testing has finished.
+
+Double-clicking the main window will make it stay on top.
+List of available command-line keys: LinX.exe /?
+
+If you made it this far you're very patient. I hope you enjoyed reading this ReadMe as much as I did writing it. Thanks for reading! \ No newline at end of file
diff --git a/Text/readme_ru.txt b/Text/readme_ru.txt
new file mode 100644
index 0000000..c2feac5
--- /dev/null
+++ b/Text/readme_ru.txt
@@ -0,0 +1,85 @@
+LinX — простой интерфейс к бенчмарку Intel® Linpack.
+
+Суть программы — расчёт систем линейных уравнений. Одна и та же система считается многократно, а результаты тестирования сравниваются друг с другом; если все результаты равны - ошибок нет и система стабильна, в противном случае налицо нестабильность. Благодаря высокой эффективности и оптимизированности программного кода Linpack весьма сильно нагружает (и нагревает) центральный процессор; в связи с этим ошибки процессора при тестировании Linpack проявляются быстрее, чем при тестировании другими аналогичными программами.
+
+Пункт меню «Файл -> Сохранить скриншот». Сохраняет скриншот окна в формате PNG в папке с программой.
+
+Пункт меню «Файл -> Сохранить отчёт». Во время или по окончании тестирования сохраняет текстовый отчёт с результатами тестирования в папке с программой.
+
+Пункт меню «Файл -> Выход». Завершает работу программы. Как это ни странно.
+
+Пункт меню «Настройки». Открывает окно с дополнительными настраиваемыми параметрами Linpack и LinX.
+
+Окно «Настройки»:
+ Основные настройки Linpack:
+ -режим тестирования или разрядность (32-бит/64-бит). По умолчанию установлена равной разрядности ОС;
+ -приоритет процесса Linpack. Устанавливать это значение выше нормального не рекомендуется;
+ -число потоков, создаваемых Linpack. По умолчанию равно числу логических процессоров в системе, HyperThreading-ядра учитываются;
+ -выравнивание данных. По умолчанию равно 4 КиБ - стандартный размер страницы в ОС Windows;
+ -оптимальные Leading Dimensions. Значение Leading Dimensions будет выбираться не равным объёму задачи, а несколько больше : равным ближайшему кратному 8, но не кратному 16 числу.
+
+ Дополнительные настройки. Их рекомендуется изменять только при возникновении каких-либо проблем.
+ -максимальный объём задачи для 32-битного Linpack. Уменьшите, если при больших объёмах памяти/объемах задачи 32-битный Linpack завершается с сообщением о нехватке памяти
+ -объём ОЗУ, оставляемый для ОС при выборе для тестирования всей памяти. Можно увеличить при возникновении проблем или для увеличения „отзывчивости“ системы во время тестирования
+
+ Настройки LinX:
+ -автоматическая остановка тестирования при обнаружении ошибки
+ -автосохранение отчёта во время тестирования (как классический Linpack, несколько уменьшается производительность)
+ -звуковое сопровождение окончания тестирования с помощью стандартных звуков ОС
+ -значок в системном трее и возможность свернуть LinX в трей для экономии места на панели задач
+ -добавление к именам скриншотов и отчётов текущих даты/времени или даты/времени начала тестирования соответственно
+ -отключение всплывающих подсказок (вдруг мешают?)
+
+ Импорт данных из сторонних приложений:
+ -выбор источника данных (Выкл., Everest или SpeedFan):
+
+Everest.Позволяет отслеживать текущую и максимальную за время тестирования температуру процессора, а также текущие значения напряжения ядра и частоты ЦП на основании данных из Everest. Для этого необходимо запустить Everest с включенной опцией «Использовать совместную память» (в Everest — «Файл -> Настройки... -> Внешние приложения») и отметить соответсвующие значения для записи в общую память.
+
+Speedfan.Позволяет импортировать значения тепературы и напряжения ядра ЦП из Speedfan. Предварительно необходимо в файле Speedfan.ini указать порядковые номера соответствующих температур/напряжений/скоростей как они отображаются в Speedfan (сверху вниз, начиная с 1), т.е. если значение Core0 температуры первого ядра процессора в Speedfan в столбце температур отображается 5м сверху, то в пункте CPU_core0_num файла Speedfan.ini следует выставить значение 5, и т.д.
+
+Выкл. Внешние данные для мониторинга отсутствуют. (по умолчанию)
+
+ -остановка тестирования при достижении определённой температуры. Если LinX получает данные о температуре процессора, при достижении указанной температуры тест прекратится, чтобы избежать перегрева ЦП
+
+Пункт меню «Графики -> Строить». Активен только если LinX получает данные из Everest или Speedfan. Позволяет выбрать, какие графики строить во время тестирования. Доступны температура ЦП, вентилятор ЦП (скорость вращения), напряжение ядра ЦП и напряжение +12 В.
+
+Пункт меню «Графики -> Отобразить». Активен, если был выбран хотя бы один график. Отображает выбранные графики в отдельных окнах во время или после тестирования с возможностью изменения размера и полупрозрачности. Графики можно сохранить в папку с программой двойным кликом в соответствующем окне.
+
+Пункт меню « ? ». Вызывает окно с информацией о программе и краткой версией данного опуса.
+
+Пункт «Объём задачи». Определяет количество решаемых линейных уравнений (размер матрицы) и напрямую влияет на сложность и длительность тестов. Можно выбрать размер из списка или ввести свой.
+
+Пункт «Объём памяти». Показывает количество памяти, необходимое для тестирования с заданным объёмом задачи в МиБ (мебибайтах), он автоматически изменяется при изменении ОЗ. Вместо объёма задачи можно сразу указать размер используемой при тестировании памяти, ОЗ при этом соответственно изменится.
+1 МиБ = 1024 КиБ = 1024^2 байт.
+
+Кнопка «Вся [память]». Если нажата - все время будет использоваться вся свободная физическая память.
+
+Пункт «Число раз». Определяет, сколько раз будет выполнен расчёт. Чем больше это значение - тем лучше.
+
+Кнопка «Тест». Запускает тестирование с выбранными выше параметрами. Вот так вот.
+
+Статусное поле/прогрессбар. Перед тестированием отображает количество свободной физической памяти. Во время тестирования в зависимости от режима:
+ - показывет прошедшее с запуска время (чч:мм:сс);
+ - показывает расчетное время до завершения (чч:мм:сс);
+ - показывает примерные дату/время окончания тестирования.
+Для переключения между режимами во время тестирования нужно кликнуть по полю; двойной клик отключит индикацию времени и смену цвета (в угоду чуть большей производительности).
+По окончании тестирования в статусном поле выводится результат (были ошибки или нет) и затраченное на тестирование время.
+Клик правой кнопкой мыши по статусному полю выведет меню с некоторыми настройками.
+
+Кнопка «Стоп». Останавливает тестирование в любой момент. Да-да.
+
+Нижняя статусная строка. Содержит информацию о тестировании, как то:
+ - завершено тестов/всего тестов;
+ - режим тестирования (32-бит или 64-бит);
+ - число потоков;
+ - максимальная производительность за время тестирование (в ГФлопс — количество миллиардов операций с плавающей запятой в секунду);
+ - модель ЦП (cpuid);
+или
+ - если включен импорт данных мониторинга из Everest или Speedfan - текущую и максимальную температуру процессора за время тестирования, текущие значения напряжения ядра и (только при импорте данных из Everest) частоты ЦП;
+ - кнопка переключения между таблицей и классическим отчётом Linpack (по окончании тестирования).
+
+Напоследок:
+Двойной клик по главному окну программы включит режим «Поверх всех окон».
+Список доступных ключей командной строки: LinX.exe /?
+
+Если Вы дочитали до этого места, Вы действительно очень терпеливы. Надеюсь, чтение этого ридми доставило Вам столько же удовольствия, как и мне его написание. Благодарю за внимание. \ No newline at end of file
diff --git a/UnitAbout.dfm b/UnitAbout.dfm
new file mode 100644
index 0000000..fca0f48
--- /dev/null
+++ b/UnitAbout.dfm
@@ -0,0 +1,267 @@
+object FormAbout: TFormAbout
+ Left = 0
+ Top = 0
+ BorderStyle = bsToolWindow
+ Caption = 'About LinX'
+ ClientHeight = 250
+ ClientWidth = 350
+ Color = clBtnFace
+ ParentFont = True
+ GlassFrame.SheetOfGlass = True
+ KeyPreview = True
+ OldCreateOrder = False
+ Position = poMainFormCenter
+ ShowHint = True
+ OnCreate = FormCreate
+ OnKeyDown = FormKeyDown
+ PixelsPerInch = 96
+ TextHeight = 13
+ object LabelFacts: TLabel
+ Left = 5
+ Top = 140
+ Width = 340
+ Height = 105
+ Alignment = taCenter
+ AutoSize = False
+ Transparent = True
+ Visible = False
+ WordWrap = True
+ end
+ object LabelInfo: TLabel
+ Left = 5
+ Top = 37
+ Width = 340
+ Height = 90
+ Alignment = taCenter
+ AutoSize = False
+ Transparent = True
+ Visible = False
+ WordWrap = True
+ end
+ object LabelDiscl: TLabel
+ Left = 5
+ Top = 137
+ Width = 90
+ Height = 51
+ Alignment = taCenter
+ AutoSize = False
+ Caption = 'This software is provided '#171'as-is'#187'. Use it at your own risk.'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ Transparent = True
+ WordWrap = True
+ end
+ object LabelEMail: TLabel
+ Left = 105
+ Top = 135
+ Width = 32
+ Height = 13
+ Caption = 'E-Mail:'
+ Transparent = True
+ end
+ object LabelOversLink: TLabel
+ Left = 105
+ Top = 175
+ Width = 232
+ Height = 13
+ Hint = 'http://forums.overclockers.ru/viewtopic.php?t=272642'
+ Caption = #1056#1091#1089#1089#1082#1072#1103' '#1074#1077#1090#1082#1072' '#1086#1073#1089#1091#1078#1076#1077#1085#1080#1103' '#1085#1072' Overclockers.ru'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = 8866336
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = [fsUnderline]
+ ParentFont = False
+ Transparent = True
+ OnClick = LabelOversLinkClick
+ OnMouseEnter = LabelsMouseEnter
+ OnMouseLeave = LabelsMouseLeave
+ end
+ object LabelXSLink: TLabel
+ Left = 105
+ Top = 155
+ Width = 229
+ Height = 13
+ Hint = 'http://www.xtremesystems.org/forums/showthread.php?t=201670'
+ Caption = 'English discussion thread at XtremeSystems.org'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = 8866336
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = [fsUnderline]
+ ParentFont = False
+ Transparent = True
+ OnClick = LabelXSLinkClick
+ OnMouseEnter = LabelsMouseEnter
+ OnMouseLeave = LabelsMouseLeave
+ end
+ object LabelLin: TLabel
+ Left = 5
+ Top = 41
+ Width = 60
+ Height = 90
+ Hint = 'LinX'
+ Alignment = taCenter
+ AutoSize = False
+ Caption = 'Lin'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = 10773812
+ Font.Height = -45
+ Font.Name = 'Arial'
+ Font.Style = []
+ ParentFont = False
+ Layout = tlCenter
+ end
+ object LabelX: TLabel
+ Left = 65
+ Top = 41
+ Width = 29
+ Height = 90
+ Hint = 'LinX'
+ Alignment = taCenter
+ AutoSize = False
+ Caption = 'X'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = 31221
+ Font.Height = -45
+ Font.Name = 'Arial'
+ Font.Style = []
+ ParentFont = False
+ Layout = tlCenter
+ end
+ object LabelThanks1: TLabel
+ Left = 5
+ Top = 200
+ Width = 321
+ Height = 13
+ Caption =
+ 'Special thanks to Right from Overclockers.ru for AMD compatibili' +
+ 'ty.'
+ Transparent = True
+ end
+ object LabelThanks2: TLabel
+ Left = 5
+ Top = 215
+ Width = 340
+ Height = 30
+ AutoSize = False
+ Caption =
+ 'Thanks to everybody who helps improve LinX for their suggestions' +
+ ' and bug reports, and especially to my friends, SqeptiQ, Winkle ' +
+ 'and YaK.'
+ Transparent = True
+ WordWrap = True
+ end
+ object LabelIntel1: TLabel
+ Left = 105
+ Top = 55
+ Width = 167
+ Height = 13
+ Caption = 'Uses Intel'#174' Math Kernel Library '#8212
+ Transparent = True
+ end
+ object LabelIntel2: TLabel
+ Left = 105
+ Top = 70
+ Width = 155
+ Height = 13
+ Caption = 'Copyright '#169' Intel'#174' Corporation'
+ Transparent = True
+ end
+ object LabelLinpackLink: TLabel
+ Left = 278
+ Top = 54
+ Width = 35
+ Height = 13
+ Hint = 'http://www.intel.com/cd/software/products/asmo-na/eng/266857.htm'
+ Caption = 'Linpack'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = 8866336
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = [fsUnderline]
+ ParentFont = False
+ Transparent = True
+ OnClick = LabelLinpackLinkClick
+ OnMouseEnter = LabelsMouseEnter
+ OnMouseLeave = LabelsMouseLeave
+ end
+ object LabelMe: TLabel
+ Left = 105
+ Top = 35
+ Width = 191
+ Height = 13
+ Caption = 'Author: Alexander Gusev a.k.a. Dua|ist'
+ Transparent = True
+ end
+ object LabelPNG: TLabel
+ Left = 105
+ Top = 90
+ Width = 222
+ Height = 13
+ Caption = 'Uses PNG Delphi Component by Gustavo Daud'
+ Transparent = True
+ end
+ object SpeedButtonInfo: TSpeedButton
+ Left = 5
+ Top = 5
+ Width = 75
+ Height = 25
+ GroupIndex = 1
+ Caption = 'Info'
+ OnClick = SpeedButtonInfoClick
+ end
+ object SpeedButtonAbout: TSpeedButton
+ Left = 80
+ Top = 5
+ Width = 75
+ Height = 25
+ GroupIndex = 1
+ Caption = 'About'
+ OnClick = SpeedButtonAboutClick
+ end
+ object SpeedButtonReadMe: TSpeedButton
+ Left = 165
+ Top = 5
+ Width = 75
+ Height = 25
+ Caption = 'ReadMe'#8230
+ OnClick = SpeedButtonReadMeClick
+ end
+ object LabelVersion: TLabel
+ Left = 245
+ Top = 12
+ Width = 100
+ Height = 13
+ Alignment = taRightJustify
+ AutoSize = False
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clGrayText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ Transparent = True
+ end
+ object EditEMailLink: TEdit
+ Left = 140
+ Top = 132
+ Width = 130
+ Height = 21
+ Alignment = taCenter
+ Color = clBtnFace
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ ReadOnly = True
+ TabOrder = 0
+ Text = 'sanekgusev@gmail.com'
+ end
+end
diff --git a/UnitAbout.pas b/UnitAbout.pas
new file mode 100644
index 0000000..c3ac2ae
--- /dev/null
+++ b/UnitAbout.pas
@@ -0,0 +1,197 @@
+{$STRINGCHECKS OFF}
+unit UnitAbout;
+
+interface
+
+uses
+ Windows, SysUtils, Classes, {Graphics,} Controls, Forms, StdCtrls, ShellAPI,
+ PNGImage, IniFiles, Buttons;
+
+type
+ TFormAbout = class(TForm)
+ LabelXSLink: TLabel;
+ LabelOversLink: TLabel;
+ LabelEMail: TLabel;
+ LabelMe: TLabel;
+ LabelIntel1: TLabel;
+ LabelLinpackLink: TLabel;
+ LabelIntel2: TLabel;
+ LabelPNG: TLabel;
+ LabelThanks2: TLabel;
+ LabelDiscl: TLabel;
+ LabelThanks1: TLabel;
+ LabelInfo: TLabel;
+ LabelLin: TLabel;
+ LabelX: TLabel;
+ LabelFacts: TLabel;
+ SpeedButtonInfo: TSpeedButton;
+ SpeedButtonAbout: TSpeedButton;
+ SpeedButtonReadMe: TSpeedButton;
+ LabelVersion: TLabel;
+ EditEMailLink: TEdit;
+ procedure LabelsMouseEnter(Sender: TObject);
+ procedure LabelsMouseLeave(Sender: TObject);
+ procedure LabelOversLinkClick(Sender: TObject);
+ procedure LabelXSLinkClick(Sender: TObject);
+ procedure LabelLinpackLinkClick(Sender: TObject);
+ procedure LabelUPXLinkClick(Sender: TObject);
+ procedure FormCreate(Sender: TObject);
+ procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
+ procedure SpeedButtonInfoClick(Sender: TObject);
+ procedure SpeedButtonAboutClick(Sender: TObject);
+ procedure SpeedButtonReadMeClick(Sender: TObject);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ end;
+
+var
+ FormAbout: TFormAbout;
+
+implementation
+
+uses UnitMain, LinX_routines;
+
+{$R *.dfm}
+
+procedure TFormAbout.FormCreate(Sender: TObject);
+ procedure localize;
+ var localizationfile : tinifile; str_about : string;
+ begin
+ With localizationfile do begin
+ localizationfile := tinifile.Create(ExtractFilePath(Application.EXEName) +
+ localizationfile_name);
+ str_about := readstring('AboutWindow','About', SpeedButtonAbout.Caption);
+ SpeedButtonAbout.Caption := str_about;
+ Caption := str_about + ' ' + progname;
+ SpeedButtonInfo.Caption := readstring('AboutWindow','Info', SpeedButtonInfo.Caption);
+ LabelVersion.Caption := ' v' + GetVersion(true);
+
+ if readstring('Info','1','') <> ''
+ then LabelInfo.Caption :=readstring('Info','1','') + #13#10 + readstring('Info','2','') +
+ #13#10 + readstring('Info','3','') + #13#10 +
+ readstring('Info','4','')
+ else LabelInfo.Caption :=
+ 'LinX is a simple interface for Intel Linpack benchmark.' + #13#10 +
+ 'It checks stability of the system and can detect hardware errors.' + #13#10 +
+ 'It is recommended to use with temperature monitoring software to avoid possible CPU overheat.' + #13#10 +
+ 'For high-TDP CPUs (quad-cores) it is advisable to monitor VRM temperature as well.';
+
+ if readstring('Facts','1','') <> ''
+ then LabelFacts.Caption:=readstring('Facts','1','') + #13#10 + readstring('Facts','2','') +
+ #13#10 + readstring('Facts','3','') + #13#10 +
+ readstring('Facts','4','') + #13#10 + readstring('Facts','5','')
+ + #13#10 + readstring('Facts','6','') + #13#10 +
+ readstring('Facts','7','')
+ else LabelFacts.Caption:=
+ 'Most interface elements have their context hints.' + #13#10 +
+ 'Double-clicking main window''s caption will make it stay on top.' + #13#10 +
+ 'Right mouse click on progressbar will open a menu with some settings.' + #13#10 +
+ 'Clicking progressbar during testing will toggle different time modes.' + #13#10 +
+ 'Graphs will only work if Everest or Speedfan import is active.' + #13#10 +
+ 'Graph windows can be resized, graphs can be saved with double-click.' + #13#10 +
+ 'List of supported command-line switches: LinX.exe /help.';
+
+ free;
+ end;
+ end;
+
+var I : integer;
+begin
+ localize;
+ SpeedButtonReadMe.Enabled := fileexists('readme.txt');
+ if glass and (Win32MajorVersion >= 6) and CompositingEnabled then begin
+ DoubleBuffered := true;
+ GlassFrame.Enabled := true;
+ for I := 0 to ControlCount - 1 do
+ if (Controls[i] is TLabel) then begin
+ (Controls[i] as TLabel).GlowSize := 8;
+ if ((Controls[i] as TLabel).AutoSize = false) and
+ ((Controls[i] as TLabel).Layout = tlCenter)
+ then (Controls[i] as TLabel).Top := (Controls[i] as TLabel).Top + 8;
+ end;
+ end;
+ SpeedButtonInfo.Down := true;
+ SpeedButtonInfo.Click;
+end;
+
+procedure TFormAbout.LabelUPXLinkClick(Sender: TObject);
+begin
+ ShellExecute(Handle, 'open', 'http://upx.sourceforge.net', nil, nil, 1);
+end;
+
+procedure TFormAbout.LabelXSLinkClick(Sender: TObject);
+begin
+ ShellExecute(Handle, 'open',
+ 'http://www.xtremesystems.org/forums/showthread.php?t=201670',
+ nil, nil, 1);
+end;
+
+procedure TFormAbout.SpeedButtonAboutClick(Sender: TObject);
+var I : integer;
+begin
+ if SpeedButtonAbout.Down then begin
+ for I := 0 to ControlCount - 1 do
+ if (Controls[i] is TLabel) then
+ (Controls[i] as TLabel).Visible := not (((Controls[i] as TLabel).Name = 'LabelInfo') or
+ ((Controls[i] as TLabel).Name = 'LabelFacts')) or
+ ((Controls[i] as TLabel).Name = 'LabelVersion');
+ EditEMailLink.Visible := true;
+ end;
+end;
+
+procedure TFormAbout.SpeedButtonInfoClick(Sender: TObject);
+var I : integer;
+begin
+ if SpeedButtonInfo.Down then begin
+ for I := 0 to ControlCount - 1 do
+ if (Controls[i] is TLabel) then
+ (Controls[i] as TLabel).Visible := ((Controls[i] as TLabel).Name = 'LabelInfo') or
+ ((Controls[i] as TLabel).Name = 'LabelFacts') or
+ ((Controls[i] as TLabel).Name = 'LabelVersion');
+ EditEMailLink.Visible := false;
+ end;
+end;
+
+procedure TFormAbout.SpeedButtonReadMeClick(Sender: TObject);
+begin
+ ShellExecute(Handle, 'open', 'readme.txt', nil, nil, 1);
+end;
+
+procedure TFormAbout.LabelOversLinkClick(Sender: TObject);
+begin
+ ShellExecute(Handle, 'open',
+ 'http://forums.overclockers.ru/viewtopic.php?t=272642', nil, nil,
+ 1);
+end;
+
+procedure TFormAbout.LabelsMouseEnter(Sender: TObject);
+begin
+ (sender as Tlabel).Font.Color := TangoOrange3;
+end;
+
+procedure TFormAbout.LabelsMouseLeave(Sender: TObject);
+begin
+ (sender as Tlabel).Font.Color := TangoBlue3;
+end;
+
+procedure TFormAbout.FormKeyDown(Sender: TObject; var Key: Word;
+ Shift: TShiftState);
+var filename : string;
+begin
+ if Key = VK_F5 then begin
+ if datetimeinnames then filename := AddDateTimeToFilename(progname, 'png', Now)
+ else filename := progname + '.png';
+ WindowScreenshot(FormMain.Handle, filename);
+ end;
+end;
+
+procedure TFormAbout.LabelLinpackLinkClick(Sender: TObject);
+begin
+ ShellExecute(Handle, 'open',
+ 'http://software.intel.com/en-us/articles/intel-math-kernel-library-linpack-download/',
+ nil, nil, 1);
+end;
+
+end.
diff --git a/UnitGraph.dfm b/UnitGraph.dfm
new file mode 100644
index 0000000..3983a45
--- /dev/null
+++ b/UnitGraph.dfm
@@ -0,0 +1,70 @@
+object FormGraph: TFormGraph
+ Left = 0
+ Top = 0
+ AlphaBlend = True
+ BorderStyle = bsSizeToolWin
+ Caption = 'Graph'
+ ClientHeight = 200
+ ClientWidth = 400
+ Color = clWindow
+ TransparentColorValue = clWindowText
+ Constraints.MinHeight = 100
+ Constraints.MinWidth = 200
+ DoubleBuffered = True
+ ParentFont = True
+ GlassFrame.SheetOfGlass = True
+ KeyPreview = True
+ OldCreateOrder = False
+ Scaled = False
+ OnClose = FormClose
+ OnCreate = FormCreate
+ OnDblClick = FormDblClick
+ OnKeyPress = FormKeyPress
+ OnMouseDown = FormMouseDown
+ OnMouseWheelDown = FormMouseWheelDown
+ OnMouseWheelUp = FormMouseWheelUp
+ OnPaint = FormPaint
+ OnResize = FormResize
+ DesignSize = (
+ 400
+ 200)
+ PixelsPerInch = 96
+ TextHeight = 13
+ object EditMax: TEdit
+ Left = 5
+ Top = 11
+ Width = 30
+ Height = 21
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clBlue
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ MaxLength = 5
+ ParentFont = False
+ TabOrder = 0
+ Visible = False
+ OnChange = EditMaxChange
+ OnExit = EditMaxExit
+ OnKeyPress = EditMaxKeyPress
+ end
+ object EditMin: TEdit
+ Left = 5
+ Top = 176
+ Width = 30
+ Height = 21
+ Anchors = [akLeft, akBottom]
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clBlue
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ MaxLength = 5
+ ParentFont = False
+ TabOrder = 1
+ Visible = False
+ OnChange = EditMinChange
+ OnExit = EditMaxExit
+ OnKeyPress = EditMaxKeyPress
+ end
+end
diff --git a/UnitGraph.pas b/UnitGraph.pas
new file mode 100644
index 0000000..3814c7e
--- /dev/null
+++ b/UnitGraph.pas
@@ -0,0 +1,318 @@
+{$STRINGCHECKS OFF}
+unit UnitGraph;
+
+interface
+
+uses
+ Windows, {Messages,} SysUtils, {Variants,} Classes, Graphics, Controls, Forms,
+ {Dialogs,} PNGImage, StdCtrls, Buttons;
+
+type
+ TFormGraph = class(TForm)
+ EditMax: TEdit;
+ EditMin: TEdit;
+ procedure FormMouseWheelDown(Sender: TObject; Shift: TShiftState;
+ MousePos: TPoint; var Handled: Boolean);
+ procedure FormMouseWheelUp(Sender: TObject; Shift: TShiftState;
+ MousePos: TPoint; var Handled: Boolean);
+ procedure FormPaint(Sender: TObject);
+ procedure EditMinChange(Sender: TObject);
+ procedure EditMaxChange(Sender: TObject);
+ procedure EditMaxKeyPress(Sender: TObject; var Key: Char);
+ procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
+ Shift: TShiftState; X, Y: Integer);
+ procedure EditMaxExit(Sender: TObject);
+ procedure FormKeyPress(Sender: TObject; var Key: Char);
+ procedure FormClose(Sender: TObject; var Action: TCloseAction);
+ procedure FormCreate(Sender: TObject);
+ procedure FormDblClick(Sender: TObject);
+ procedure FormResize(Sender: TObject);
+ private
+ { Private declarations }
+ var min, max : real;
+ public
+ { Public declarations }
+ end;
+
+var
+ FormTemps: TFormGraph;
+ FormFans: TFormGraph;
+ FormVcores: TFormGraph;
+ FormP12Vs: TFormGraph;
+
+implementation
+
+uses UnitMain, LinX_routines;
+
+{$R *.dfm}
+
+procedure PaintGraph(buf : TFormGraph; font, grid, graph : TColor;
+ var data_arr : Dataarray; arrlength : integer;
+ gridx : integer; gridy : real;
+ var des_min, des_max : real;
+ var graph_capt, meas_unit : string);
+const xoffset = 35; yoffset = 15; topoffset = 20; rightoffset = 5;
+var i, w, h : word; dy, dx, min, max : real;
+ time_st : string;
+begin
+// if (data_arr <> nil) and (arrlength > 0) then begin
+ w := buf.ClientWidth;
+ h := buf.ClientHeight;
+ {min := 100000;
+ max := -128;}
+ min := des_min;
+ max := des_max;
+ {for i := 0 to arrlength do begin
+ if data_arr[i] < min then min := data_arr[i]
+ else
+ if data_arr[i] > max then max := data_arr[i];
+ end;
+
+ des_min := min;
+ des_max := max;}
+
+ while (arrlength div gridx) > 5 do begin
+ gridx := gridx * 2;
+ if gridx = 960 then gridx := 900;
+ end;
+ {if des_min < min then min := des_min
+ else des_min := min;
+ if des_max > max then max := des_max
+ else des_max := max;}
+ if ((max - min) / gridy) > 10 then gridy := (max - min) / 10;
+ {if (max = min) then begin
+ max := min + gridy;
+ min := min - gridy;
+ end;}
+
+ dy := (h - yoffset - topoffset) / (max - min);
+ dx := (w - xoffset - rightoffset) / arrlength;
+
+ if buf.Canvas.Pen.Mode = pmNotXor then begin
+ buf.Canvas.Brush.Color := clBlack;
+ buf.Canvas.Brush.Style := bsClear;
+ buf.Canvas.Font.Color := font;
+ buf.Canvas.Font.Color := clGray;
+ buf.Canvas.Pen.Color := grid xor $00FFFFFF;
+ end
+ else begin
+ buf.Canvas.Pen.Color := grid;
+ buf.Canvas.Font.Color := font;
+ end;
+ buf.Canvas.Pen.Style := psDot;
+
+ for I := 0 to (arrlength div gridx) do begin
+ buf.Canvas.MoveTo(round(i * dx * gridx) + xoffset, topoffset);
+ buf.Canvas.LineTo(round(i * dx * gridx) + xoffset, h - yoffset);
+ if i * gridx < 60 then time_st := inttostr(i * gridx) + str_s
+ else
+ if i * gridx < 3600 then time_st := floattostr(i * gridx / 60) + str_m
+ else time_st := floattostr(i * gridx / 3600) + str_h;
+ buf.Canvas.TextOut(round(i * dx * gridx) + xoffset, h - yoffset,
+ time_st);
+ end;
+ buf.Canvas.MoveTo(w - 1 - rightoffset, topoffset);
+ buf.Canvas.LineTo(w - 1 - rightoffset, h - yoffset);
+
+ for i := 0 to round((max - min) / gridy) do begin
+ buf.Canvas.MoveTo(xoffset, h - round(i * dy * gridy) - 1 - yoffset);
+ buf.Canvas.LineTo(w - rightoffset, h - round(i * dy * gridy) - 1 - yoffset);
+ buf.Canvas.TextOut(5,
+ h - round(i * dy * gridy) - 1 - yoffset - buf.Canvas.Font.Size,
+ floattostrf(min + i * gridy, ffgeneral, 4,2));
+ end;
+
+ buf.Canvas.TextOut(xoffset, topoffset - 15, meas_unit);
+ buf.Canvas.TextOut(xoffset + (w - xoffset - rightoffset) div 2
+ - length(graph_capt) * (buf.Canvas.Font.Size - 1) div 2, 0, graph_capt);
+
+ if buf.Canvas.Pen.Mode = pmNotXor then begin
+ buf.Canvas.Pen.Color := graph xor $00FFFFFF;
+ end
+ else buf.Canvas.Pen.Color := graph;
+ buf.Canvas.Pen.Style := psSolid;
+ buf.Canvas.MoveTo(xoffset,
+ round((- data_arr[0] + min) * dy) + h - yoffset - 1);
+ for I := 1 to arrlength do
+ buf.Canvas.LineTo(round(i * dx) + xoffset,
+ round((- data_arr[i] + min) * dy) + h - yoffset - 1);
+// end;
+end;
+
+procedure TFormGraph.EditMaxChange(Sender: TObject);
+begin
+ max := strtofloatdef(EditMax.Text, max);
+ FormPaint(EditMax.Parent);
+end;
+
+procedure TFormGraph.EditMaxExit(Sender: TObject);
+begin
+ (Sender as TEdit).Hide;
+end;
+
+procedure TFormGraph.EditMaxKeyPress(Sender: TObject; var Key: Char);
+begin
+ if key=#13 then (Sender as TEdit).Hide;
+end;
+
+procedure TFormGraph.EditMinChange(Sender: TObject);
+begin
+ min := strtofloatdef(EditMin.Text, min);
+ FormPaint(EditMax.Parent);
+end;
+
+procedure TFormGraph.FormClose(Sender: TObject; var Action: TCloseAction);
+begin
+ if (Sender.Equals(FormTemps)) then begin
+ GraphWindows[1].Left := FormTemps.Left;
+ GraphWindows[1].Top := FormTemps.Top;
+ GraphWindows[1].Right := FormTemps.Left + FormTemps.Width;
+ GraphWindows[1].Bottom := FormTemps.Top + FormTemps.Height;
+ FormTemps := nil;
+ end
+ else
+ if (Sender.Equals(FormFans)) then begin
+ GraphWindows[2].Left := FormFans.Left;
+ GraphWindows[2].Top := FormFans.Top;
+ GraphWindows[2].Right := FormFans.Left + FormFans.Width;
+ GraphWindows[2].Bottom := FormFans.Top + FormFans.Height;
+ FormFans := nil;
+ end
+ else
+ if (Sender.Equals(FormVcores)) then begin
+ GraphWindows[3].Left := FormVcores.Left;
+ GraphWindows[3].Top := FormVcores.Top;
+ GraphWindows[3].Right := FormVcores.Left + FormVcores.Width;
+ GraphWindows[3].Bottom := FormVcores.Top + FormVcores.Height;
+ FormVcores := nil;
+ end
+ else begin
+ GraphWindows[4].Left := FormP12Vs.Left;
+ GraphWindows[4].Top := FormP12Vs.Top;
+ GraphWindows[4].Right := FormP12Vs.Left + FormP12Vs.Width;
+ GraphWindows[4].Bottom := FormP12Vs.Top + FormP12Vs.Height;
+ FormP12Vs := nil;
+ end;
+ Action := caFree;
+end;
+
+procedure TFormGraph.FormCreate(Sender: TObject);
+begin
+ if glass and (Win32MajorVersion >= 6) and CompositingEnabled then begin
+ GlassFrame.Enabled := true;
+ Canvas.Pen.Mode := pmNotXor;
+ end;
+end;
+
+procedure TFormGraph.FormDblClick(Sender: TObject);
+var png : TPNGImage; filename : string; buf : TBitmap;
+begin
+ png := TPNGImage.Create;
+ buf := TBitmap.Create;
+ buf.Width := (Sender as TFormGraph).ClientWidth;
+ buf.Height := (Sender as TFormGraph).ClientHeight;
+ BitBlt(buf.Canvas.Handle, 0, 0, buf.Width, buf.Height,
+ (Sender as TFormGraph).Canvas.Handle, 0, 0, SRCCOPY);
+ png.Assign(buf);
+ if (Sender.Equals(FormTemps)) then filename := temps_file_name
+ else
+ if (Sender.Equals(FormFans)) then filename := fans_file_name
+ else
+ if (Sender.Equals(FormVcores)) then filename := vcores_file_name
+ else filename := p12vs_file_name;
+ if datetimeinnames then filename := AddDateTimeToFilename(filename, 'png', Now)
+ else filename := filename + '.png';
+ png.SaveToFile(filename);
+ png.Free;
+ buf.Free;
+end;
+
+procedure TFormGraph.FormKeyPress(Sender: TObject; var Key: Char);
+begin
+ if not charinset(key, ['0'..'9',#8,#13,DecimalSeparator]) then key := #0;
+end;
+
+procedure TFormGraph.FormMouseDown(Sender: TObject; Button: TMouseButton;
+ Shift: TShiftState; X, Y: Integer);
+begin
+ if (x > EditMax.Left) and (x < EditMax.Left + EditMax.Width)
+ and (y > EditMax.Top) and (y < EditMax.Top + EditMax.Height) then begin
+ EditMax.Text := floattostrf(max,ffgeneral,5,2);
+ EditMax.Show;
+ EditMax.SetFocus;
+ end
+ else
+ if (x > EditMin.Left) and (x < EditMin.Left + EditMin.Width)
+ and (y > EditMin.Top) and (y < EditMin.Top + EditMin.Height) then begin
+ EditMin.Text := floattostrf(min,ffgeneral,5,2);
+ EditMin.Show;
+ EditMin.SetFocus;
+ end;
+end;
+
+procedure TFormGraph.FormMouseWheelDown(Sender: TObject; Shift: TShiftState;
+ MousePos: TPoint; var Handled: Boolean);
+begin
+ if AlphaBlendValue >= 135
+ then AlphaBlendValue := AlphaBlendValue - 10;
+end;
+
+procedure TFormGraph.FormMouseWheelUp(Sender: TObject; Shift: TShiftState;
+ MousePos: TPoint; var Handled: Boolean);
+begin
+ if AlphaBlendValue <= 245
+ then AlphaBlendValue := AlphaBlendValue + 10;
+end;
+
+procedure TFormGraph.FormPaint(Sender: TObject);
+var adjmin, adjmax : real; arrlen : integer;
+begin
+ Canvas.Brush.Style := bsClear;
+ Canvas.FillRect(Rect(0, 0, ClientWidth, ClientHeight));
+ if (Sender.Equals(FormTemps)) and (temps <> nil) and (run_time > 0) then begin
+ arrlen := length(temps);
+ if run_time < arrlen then arrlen := run_time;
+ calcminmax(temps, arrlen, adjmin, adjmax);
+ if (adjmin < min) or (min = 0) then min := trunc(adjmin / 5) * 5;
+ if (adjmax > max) or (max = 0) then max := trunc(adjmax / 5 + 1) * 5;
+ Paintgraph((Sender as TFormGraph), TangoGray6, TangoGray2, TangoRed3, temps, arrlen, 30, 1,
+ min, max, str_temps_capt, str_celsius);
+ end
+ else
+ if (Sender.Equals(FormFans)) and (fans <> nil) and (run_time > 0) then begin
+ arrlen := length(fans);
+ if run_time < arrlen then arrlen := run_time;
+ calcminmax(fans, arrlen, adjmin, adjmax);
+ if (adjmin < min) or (min = 0) then min := trunc(adjmin / 100) * 100;
+ if (adjmax > max) or (max = 0) then max := trunc(adjmax / 100 + 1) * 100;
+ Paintgraph((Sender as TFormGraph), TangoGray6, TangoGray2, TangoBlue3, fans, arrlen, 30, 10,
+ min, max, str_fans_capt, str_rpm);
+ end
+ else
+ if (Sender.Equals(FormVcores)) and (vcores <> nil) and (run_time > 0) then begin
+ arrlen := length(vcores);
+ if run_time < arrlen then arrlen := run_time;
+ calcminmax(vcores, arrlen, adjmin, adjmax);
+ if (adjmin < min) or (min = 0) then min := trunc(adjmin*20) / 20;
+ if (adjmax > max) or (max = 0) then max := trunc(adjmax*20 + 1) / 20;
+ Paintgraph((Sender as TFormGraph), TangoGray6, TangoGray2, TangoGreen3, vcores, arrlen,
+ 30, 0.01, min, max, str_vcores_capt, str_volts);
+ end
+ else
+ if (Sender.Equals(FormP12Vs)) and (p12vs <> nil) and (run_time > 0) then begin
+ arrlen := length(p12vs);
+ if run_time < arrlen then arrlen := run_time;
+ calcminmax(p12vs, arrlen, adjmin, adjmax);
+ if (adjmin < min) or (min = 0) then min := trunc(adjmin*10) / 10;
+ if (adjmax > max) or (max = 0) then max := trunc(adjmax*10 + 1) / 10;
+ Paintgraph((Sender as TFormGraph), TangoGray6, TangoGray2, TangoYellow3, p12vs, arrlen, 30,
+ 0.01, min, max, str_p12vs_capt, str_volts);
+ end;
+end;
+
+procedure TFormGraph.FormResize(Sender: TObject);
+begin
+ Repaint;
+end;
+
+end.
diff --git a/UnitLogWatch.pas b/UnitLogWatch.pas
new file mode 100644
index 0000000..134fd02
--- /dev/null
+++ b/UnitLogWatch.pas
@@ -0,0 +1,347 @@
+{$STRINGCHECKS OFF}
+unit UnitLogWatch;
+
+interface
+
+uses
+ Classes, Windows, SysUtils, Graphics, Forms, ExtCtrls, MMSystem;
+
+type
+ TLogWatchThread = class(TThread)
+ private
+ { Private declarations }
+ s : string;
+ flops_st, res_norm_st : string;
+ flops, max_flops : single;
+ stopcode : byte;
+ curr : word;
+ procedure UpdateMainForm;
+ procedure UnhideProgressbar;
+ procedure FullProgressbar;
+ procedure StopExecution;
+ protected
+ procedure Execute; override;
+ end;
+
+ function AppendMonitoringData : string;
+
+implementation
+
+uses UnitMain, LinX_routines;
+
+{ Important: Methods and properties of objects in visual components can only be
+ used in a method called using Synchronize, for example,
+
+ Synchronize(UpdateCaption);
+
+ and UpdateCaption could look like,
+
+ procedure TLogWatchThread.UpdateCaption;
+ begin
+ Form1.Caption := 'Updated in a thread';
+ end; }
+
+{ TLogWatchThread }
+
+procedure TLogWatchThread.UpdateMainForm;
+var runs_st : string;
+begin
+ with FormMain do begin
+ ListViewTable.Items.BeginUpdate;
+ with ListViewTable.Items.Add do begin
+ Caption := inttostr(curr);
+ SubItems.Text := str_PS_LDnum_align + trimright(copy(s, 22, 7)) +
+ #13 + flops_st + #13 + copy(s, 42, 13) +
+ #13 + res_norm_st;
+ MakeVisible(false);
+
+ if flops > max_flops then begin
+ Selected := true;
+ max_flops := flops;
+ Statusbar.Panels[3].Text := flops_st + ' ' + str_flops + ' ' + str_peak;
+ end;
+ end;
+ ListViewTable.Items.EndUpdate;
+
+ if NumberOfMinutes <> -1 then runs_st := format('%d/∞', [curr])
+ else runs_st := format('%d/%d', [curr, NumberOfRuns]);
+ Statusbar.Panels[0].Text := runs_st;
+ if simplecaption then Caption := test_win_capt + ' - ' + version
+ else Caption := test_win_capt + ' (' + runs_st + ') - ' + version;
+ end;
+end;
+
+procedure TLogWatchThread.UnhideProgressbar;
+begin
+ With FormMain do begin
+ ShapeBar.Width := 0;
+ ShapeBar.Visible := true;
+ end;
+end;
+
+procedure TLogWatchThread.FullProgressbar;
+begin
+ With FormMain do
+ ShapeBar.Width := ShapeBar.Constraints.MaxWidth;
+end;
+
+procedure TLogWatchThread.StopExecution;
+var tmpstr : string;
+
+ function TimeToString(Time : TDateTime) : string;
+ var Hour, Minute, Second : byte; totalseconds : cardinal;
+ begin
+ totalseconds := round(Time * 86400);
+ Hour := totalseconds div 3600;
+ Minute := (totalseconds mod 3600) div 60;
+ Second := totalseconds mod 60;
+ if Hour = 0 then
+ if Minute > 0 then result := format('%d ' + str_m + ' %d ' + str_s, [Minute,Second])
+ else result := format('%d ' + str_s, [Second])
+ else
+ result := format('%d ' + str_h + ' %d ' + str_m + ' %d ' + str_s, [Hour,Minute,Second]);
+ end;
+
+begin
+ With FormMain do begin
+ SpeedButtonStop.Enabled := false;
+ if not SpeedButtonAllMem.Down then begin
+ ComboBoxPS.Enabled := true;
+ ComboBoxMem.Enabled := true;
+ end;
+ ComboBoxRuns.Enabled := true;
+ ComboBoxTimesMinutes.Enabled := true;
+ SpeedButtonStart.Enabled := true;
+ SpeedButtonAllMem.Enabled := true;
+ LabelStatus.Hint := memo_hint1;
+ time_show_mode := 6;
+ Statusbar.Panels[5].Text := str_log;
+
+ case stopcode of //a story with many endings
+ 0 : begin
+ ShapeBar.Brush.Color := TangoGray2;
+ ShapeBar.Pen.Color := TangoGray3;
+ //ShapeBase.Brush.Color := TangoGray1;
+ LabelStatus.Caption := msg_lin_error;
+ if not Visible then begin
+ Trayicon.BalloonHint := msg_lin_error;
+ Trayicon.BalloonFlags := bfWarning;
+ TrayIcon.ShowBalloonHint;
+ end;
+ Trayicon.Hint := version;
+ TrayIcon.Icon := Tray1;
+ Caption := version + ' - ' + idle_win_capt;
+ end;
+ 1 : begin
+ tmpstr := str_done + ' ' + TimeToString(Now - StartTime);
+ ShapeBar.Brush.Color := TangoBlue1;
+ ShapeBar.Pen.Color := TangoBlue3;
+ LabelStatus.Caption := tmpstr;
+ if not Visible then begin
+ Trayicon.BalloonHint := tmpstr;
+ Trayicon.BalloonTitle := done_win_capt;
+ Trayicon.BalloonFlags := bfInfo;
+ TrayIcon.ShowBalloonHint;
+ end;
+ Trayicon.Hint := done_win_capt + ' - ' + version;
+ Trayicon.Icon := Application.Icon;
+ Caption := done_win_capt + ' - ' + version;
+ if sounds then PlaySound('SystemExclamation', 0, SND_ALIAS or SND_ASYNC);
+ end;
+ 2 : begin
+ ShapeBar.Brush.Color := TangoYellow1;
+ ShapeBar.Pen.Color := TangoYellow3;
+ LabelStatus.Caption := str_stop + ' ' + TimeToString(Now - StartTime);
+ TrayIcon.Icon := Tray3;
+ Trayicon.Hint := stop_win_capt + ' - ' + version;
+ Caption := stop_win_capt + ' - ' + version;
+ end;
+ 3 : begin
+ tmpstr := str_err + ' ' + TimeToString(Now - StartTime) + '!';
+ ShapeBar.Brush.Color := TangoRed1;
+ ShapeBar.Pen.Color := TangoRed3;
+ LabelStatus.Caption := tmpstr;
+ if not Visible then begin
+ Trayicon.BalloonHint := tmpstr;
+ Trayicon.BalloonTitle := err_win_capt;
+ Trayicon.BalloonFlags := bfError;
+ TrayIcon.ShowBalloonHint;
+ end;
+ Trayicon.Hint := err_win_capt + ' - ' + version;
+ TrayIcon.Icon := Tray2;
+ Caption := err_win_capt + ' - ' + version;
+ WindowFlash(FLASHW_TRAY, Handle, 3, 250);
+ if sounds then time_show_mode := 5;
+ end;
+ 4 : begin
+ tmpstr := str_done_err + ' ' + TimeToString(Now - StartTime) + '!';
+ ShapeBar.Brush.Color := TangoRed1;
+ ShapeBar.Pen.Color := TangoRed3;
+ LabelStatus.Caption := tmpstr;
+ if not Visible then begin
+ Trayicon.BalloonHint := tmpstr;
+ Trayicon.BalloonTitle := done_win_capt;
+ Trayicon.BalloonFlags := bfError;
+ TrayIcon.ShowBalloonHint;
+ end;
+ Trayicon.Hint := done_win_capt + ' - ' + version;
+ TrayIcon.Icon := Tray2;
+ Caption := done_win_capt + ' - ' + version;
+ WindowFlash(FLASHW_TRAY, Handle, 3, 250);
+ if sounds then PlaySound('LowBatteryAlarm', 0, SND_ALIAS or SND_ASYNC);
+ end;
+ 5 : begin
+ tmpstr := str_done + ' ' + TimeToString(Now - StartTime);
+ ShapeBar.Brush.Color := TangoViolet1;
+ ShapeBar.Pen.Color := TangoViolet3;
+ LabelStatus.Caption := tmpstr;
+ if not Visible then begin
+ Trayicon.BalloonHint := tmpstr;
+ Trayicon.BalloonTitle := done_win_capt;
+ Trayicon.BalloonFlags := bfInfo;
+ TrayIcon.ShowBalloonHint;
+ end;
+ Trayicon.Hint := done_win_capt + ' - ' + version;
+ Trayicon.Icon := Application.Icon;
+ Caption := done_win_capt + ' - ' + version;
+ if sounds then PlaySound('SystemExclamation', 0, SND_ALIAS or SND_ASYNC);
+ end;
+ 6 : begin
+ tmpstr := str_hot + ' ' + TimeToString(Now - StartTime);
+ ShapeBar.Brush.Color := TangoYellow1;
+ ShapeBar.Pen.Color := TangoYellow3;
+ LabelStatus.Caption := tmpstr;
+ if not Visible then begin
+ Trayicon.BalloonHint := tmpstr;
+ Trayicon.BalloonTitle := hot_win_capt;
+ Trayicon.BalloonFlags := bfWarning;
+ TrayIcon.ShowBalloonHint;
+ end;
+ Trayicon.Hint := hot_win_capt + ' - ' + version;
+ TrayIcon.Icon := Tray3;
+ Caption := hot_win_capt+ ' - ' + version;
+ if sounds then time_show_mode := 5;
+ end;
+ end;
+
+ if glass then begin
+ ShapeBar.Pen.Color := ShapeBar.Brush.Color xor $00FFFFFF;
+ ShapeBar.Brush.Style := bsClear;
+ ShapeBase.Pen.Mode := pmWhite;
+ end;
+ end;
+end;
+
+function AppendMonitoringData : string;
+var tmpstr : string; tmpmin, tmpmax : real; arrlen : integer;
+begin
+ if (temps <> nil) or (fans <> nil) or (vcores <> nil) or (p12vs <> nil)
+ then begin
+ tmpstr := #13#10#13#10 + 'Monitoring data:' + #13#10;
+ arrlen := run_time;
+ if temps <> nil then begin
+ if length(temps) < arrlen then arrlen := length(temps);
+ CalcMinMax(temps, arrlen, tmpmin, tmpmax);
+ tmpstr := tmpstr + #13#10 + Format('CPU Temperature Min: %d C Max %d C', [round(tmpmin), round(tmpmax)]);
+ end;
+ if fans <> nil then begin
+ if length(fans) < arrlen then arrlen := length(fans);
+ CalcMinMax(fans, arrlen, tmpmin, tmpmax);
+ tmpstr := tmpstr + #13#10 + Format('CPU Fan Speed Min: %d RPM Max %d RPM', [round(tmpmin), round(tmpmax)]);
+ end;
+ if vcores <> nil then begin
+ if length(vcores) < arrlen then arrlen := length(vcores);
+ CalcMinMax(vcores, arrlen, tmpmin, tmpmax);
+ tmpstr := tmpstr + #13#10 + Format('CPU Vcore Min: %f V Max %f V', [tmpmin, tmpmax]);
+ end;
+ if p12vs <> nil then begin
+ if length(p12vs) < arrlen then arrlen := length(p12vs);
+ CalcMinMax(p12vs, arrlen, tmpmin, tmpmax);
+ tmpstr := tmpstr + #13#10 + Format('+12V Voltage Min: %f V Max %f V', [tmpmin, tmpmax]);
+ end;
+ result := tmpstr;
+ end;
+end;
+
+
+procedure TLogWatchThread.Execute;
+var PipeReadEvent, LinpackPipeRead, LinpackPipeWrite : THandle; lin_exe : string;
+var res_str : string;
+begin
+ { Place thread code here }
+ //FreeOnTerminate := true;
+ stopcode := 1;
+ curr := 0;
+ max_flops := 0;
+ s := '';
+ PipeReadEvent := CreateEvent(nil, true, false, nil);
+
+ if x64mode then lin_exe := lin64exe_name
+ else lin_exe := lin32exe_name;
+ StartLinpack(lin_exe, inputfile_name, NumberOfThreads, lin_priority,
+ LinpackProcessInfo, LinpackPipeRead, LinpackPipeWrite);
+
+ SetThreadPriority(Handle, THREAD_PRIORITY_IDLE);
+ if Win32MajorVersion > 5 then SetThreadPriority(Handle, $00010000);
+ LinpackLog := LinpackLog + ReadLogHeader(LinpackPipeRead,
+ LinpackProcessInfo.hProcess, PipeReadEvent, stopcode);
+ DeleteFile(inputfile_name);
+
+ while (curr < NumberOfRuns) and (stopcode = 1)
+ and ReadLogString(LinpackPipeRead, LinpackProcessInfo.hProcess,
+ PipeReadEvent, s, stopcode)
+ do begin
+
+ inc(curr);
+
+ LinpackLog := LinpackLog + s;
+ if autosavelog then SaveLogFile;
+
+ flops_st := trimright(copy(s, 33, 8));
+ flops := strtofloatdef(flops_st, 0);
+ res_norm_st := copy(s, 56, 13);
+
+ if NumberOfMinutes <> -1 then total_time := NumberOfMinutes * 60
+ else total_time := round((Now - StartTime) / curr * NumberOfRuns * 86400);
+
+ Synchronize(UpdateMainForm);
+
+ if curr = 1 then begin
+ Synchronize(UnhideProgressbar);
+ end;
+ res_str := copy(s, 72, 4);
+ if pos(res_str, 'pass') = 0 then
+ if stoponerror then stopcode := 3
+ else was_error := true;
+
+ end;
+
+ case stopcode of
+ 1 : begin
+ LinpackLog := LinpackLog + ReadLogFooter(LinpackPipeRead, LinpackProcessInfo.hProcess,
+ PipeReadEvent);
+ Synchronize(FullProgressbar);
+ if was_error then stopcode := 4;
+ WaitForSingleObject(LinpackProcessInfo.hProcess, INFINITE);
+ end;
+ 3 : TerminateProcess(LinpackProcessInfo.hProcess, 3);
+ end;
+ if stopcode > 6 then stopcode := 0;
+
+ LinpackLog := LinpackLog + AppendMonitoringData;
+ if autosavelog then SaveLogFile;
+
+ CloseHandle(PipeReadEvent);
+
+ DisconnectNamedPipe(LinpackPipeRead);
+ CloseHandle(LinpackPipeWrite);
+ CloseHandle(LinpackPipeRead);
+
+ CloseHandle(LinpackProcessInfo.hThread);
+ CloseHandle(LinpackProcessInfo.hProcess);
+
+ if Win32MajorVersion > 5 then SetThreadPriority(Handle, $00020000);
+ Synchronize(StopExecution);
+end;
+
+end.
diff --git a/UnitMain.dfm b/UnitMain.dfm
new file mode 100644
index 0000000..688e531
--- /dev/null
+++ b/UnitMain.dfm
@@ -0,0 +1,519 @@
+object FormMain: TFormMain
+ Left = 0
+ Top = 0
+ ActiveControl = ListViewTable
+ BorderIcons = [biSystemMenu, biMinimize]
+ Caption = 'LinX - Simply Linpack'
+ ClientHeight = 275
+ ClientWidth = 520
+ Color = clBtnFace
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ KeyPreview = True
+ Menu = MainMenu
+ OldCreateOrder = False
+ Position = poDesigned
+ Scaled = False
+ ShowHint = True
+ OnClose = FormClose
+ OnCreate = FormCreate
+ OnDestroy = FormDestroy
+ OnKeyPress = FormKeyPress
+ DesignSize = (
+ 520
+ 275)
+ PixelsPerInch = 96
+ TextHeight = 13
+ object LabelMem: TLabel
+ Left = 170
+ Top = 8
+ Width = 69
+ Height = 13
+ Hint = 'Amount of memory to be used'
+ Anchors = [akTop]
+ Caption = 'Memory (MiB):'
+ Transparent = True
+ end
+ object LabelRuns: TLabel
+ Left = 380
+ Top = 8
+ Width = 23
+ Height = 13
+ Hint =
+ 'Testing will stop either after the specified number of times or ' +
+ 'after a specified time interval '
+ Anchors = [akTop, akRight]
+ Caption = 'Run:'
+ Transparent = True
+ end
+ object LabelPS: TLabel
+ Left = 5
+ Top = 8
+ Width = 63
+ Height = 13
+ Hint =
+ 'Affects calculations'#39' complexity and duration (set higher values' +
+ ' for more stress)'
+ Caption = 'Problem size:'
+ Transparent = True
+ end
+ object SpeedButtonAllMem: TSpeedButton
+ Left = 300
+ Top = 4
+ Width = 30
+ Height = 23
+ Hint = 'Click to always use all available memory (maximum stress)'
+ AllowAllUp = True
+ Anchors = [akTop]
+ GroupIndex = 1
+ Caption = 'All'
+ Flat = True
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ Layout = blGlyphTop
+ Margin = 3
+ ParentFont = False
+ OnClick = SpeedButtonAllMemClick
+ end
+ object SpeedButtonStart: TSpeedButton
+ Left = 5
+ Top = 30
+ Width = 75
+ Height = 25
+ Hint = 'Starts the testing process (Enter)'
+ Caption = 'Start'
+ OnClick = SpeedButtonStartClick
+ end
+ object SpeedButtonStop: TSpeedButton
+ Left = 440
+ Top = 30
+ Width = 75
+ Height = 25
+ Hint = 'Stops the testing immediately (Esc)'
+ Anchors = [akTop, akRight]
+ Caption = 'Stop'
+ Enabled = False
+ OnClick = SpeedButtonStopClick
+ ExplicitLeft = 435
+ end
+ object ShapeBase: TShape
+ Left = 85
+ Top = 31
+ Width = 350
+ Height = 23
+ Anchors = [akLeft, akTop, akRight]
+ Brush.Color = 15527662
+ Pen.Color = clBtnShadow
+ Shape = stRoundRect
+ ExplicitWidth = 345
+ end
+ object ShapeBar: TShape
+ Left = 87
+ Top = 33
+ Width = 346
+ Height = 19
+ Anchors = [akLeft, akTop, akRight]
+ Brush.Color = 13621203
+ Pen.Color = 11976122
+ ExplicitWidth = 341
+ end
+ object LabelStatus: TLabel
+ Left = 85
+ Top = 36
+ Width = 350
+ Height = 18
+ Alignment = taCenter
+ Anchors = [akLeft, akTop, akRight]
+ AutoSize = False
+ PopupMenu = PopupMenuSettings
+ Transparent = True
+ OnClick = Panel1Click
+ OnDblClick = Panel1DblClick
+ ExplicitWidth = 345
+ end
+ object StatusBar: TStatusBar
+ Left = 0
+ Top = 255
+ Width = 520
+ Height = 20
+ DoubleBuffered = True
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ Panels = <
+ item
+ Alignment = taCenter
+ Width = 55
+ end
+ item
+ Alignment = taCenter
+ Width = 45
+ end
+ item
+ Alignment = taCenter
+ Width = 60
+ end
+ item
+ Alignment = taCenter
+ Width = 110
+ end
+ item
+ Alignment = taCenter
+ Width = 210
+ end
+ item
+ Alignment = taCenter
+ Width = 35
+ end>
+ ParentDoubleBuffered = False
+ SizeGrip = False
+ UseSystemFont = False
+ OnClick = StatusBarClick
+ end
+ object ComboBoxPS: TComboBox
+ Left = 74
+ Top = 5
+ Width = 60
+ Height = 21
+ Hint = 'Select a value from drop-down list or key in directly'
+ AutoComplete = False
+ BevelEdges = []
+ BevelInner = bvNone
+ BevelOuter = bvNone
+ DoubleBuffered = False
+ ItemHeight = 13
+ MaxLength = 5
+ ParentDoubleBuffered = False
+ TabOrder = 0
+ Text = '10000'
+ OnChange = ComboBoxPSChange
+ OnCloseUp = ComboBoxPSCloseUp
+ end
+ object MemoLog: TMemo
+ Left = 5
+ Top = 60
+ Width = 510
+ Height = 190
+ Cursor = crArrow
+ Margins.Left = 0
+ Margins.Top = 0
+ Margins.Right = 0
+ Margins.Bottom = 0
+ Anchors = [akLeft, akTop, akRight, akBottom]
+ DoubleBuffered = True
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Courier New'
+ Font.Style = []
+ ParentDoubleBuffered = False
+ ParentFont = False
+ ReadOnly = True
+ ScrollBars = ssVertical
+ TabOrder = 4
+ Visible = False
+ WordWrap = False
+ end
+ object ComboBoxMem: TComboBox
+ Left = 245
+ Top = 5
+ Width = 55
+ Height = 21
+ Hint = 'Select a value from drop-down list or key in directly '
+ AutoComplete = False
+ BevelEdges = []
+ BevelInner = bvNone
+ BevelOuter = bvNone
+ Anchors = [akTop]
+ DoubleBuffered = False
+ ItemHeight = 13
+ MaxLength = 5
+ ParentDoubleBuffered = False
+ TabOrder = 1
+ Text = '1024'
+ OnChange = ComboBoxMemChange
+ OnCloseUp = ComboBoxMemCloseUp
+ end
+ object ComboBoxRuns: TComboBox
+ Left = 405
+ Top = 5
+ Width = 50
+ Height = 21
+ Hint = 'Select a value from drop-down list or key in directly'
+ AutoComplete = False
+ BevelEdges = []
+ BevelInner = bvNone
+ BevelOuter = bvNone
+ Anchors = [akTop, akRight]
+ DoubleBuffered = False
+ ItemHeight = 13
+ ItemIndex = 2
+ MaxLength = 5
+ ParentDoubleBuffered = False
+ TabOrder = 2
+ Text = '10'
+ OnChange = ComboBoxRunsChange
+ OnCloseUp = ComboBoxRunsChange
+ Items.Strings = (
+ '3'
+ '5'
+ '10'
+ '15'
+ '20'
+ '25'
+ '50'
+ '75'
+ '100'
+ '150'
+ '200'
+ '250'
+ '300'
+ '500')
+ end
+ object ListViewTable: TListView
+ Left = 0
+ Top = 61
+ Width = 520
+ Height = 194
+ Anchors = [akLeft, akTop, akRight, akBottom]
+ BevelInner = bvNone
+ BorderStyle = bsNone
+ Columns = <
+ item
+ Caption = '#'
+ MaxWidth = 30
+ MinWidth = 30
+ Width = 30
+ end
+ item
+ Alignment = taCenter
+ Caption = 'Size'
+ MaxWidth = 50
+ MinWidth = 50
+ end
+ item
+ Alignment = taCenter
+ Caption = 'LDA'
+ MaxWidth = 50
+ MinWidth = 50
+ end
+ item
+ Alignment = taCenter
+ Caption = 'Align'
+ MaxWidth = 40
+ MinWidth = 40
+ Width = 40
+ end
+ item
+ Alignment = taCenter
+ Caption = 'Time'
+ MaxWidth = 65
+ MinWidth = 65
+ Width = 65
+ end
+ item
+ Alignment = taCenter
+ Caption = 'GFlops'
+ MaxWidth = 70
+ MinWidth = 70
+ Width = 70
+ end
+ item
+ Alignment = taCenter
+ Caption = 'Residual'
+ MaxWidth = 95
+ MinWidth = 95
+ Width = 95
+ end
+ item
+ Alignment = taCenter
+ Caption = 'Residual (norm.)'
+ MaxWidth = 98
+ MinWidth = 98
+ Width = 98
+ end>
+ DoubleBuffered = True
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ GridLines = True
+ HideSelection = False
+ ReadOnly = True
+ RowSelect = True
+ ParentDoubleBuffered = False
+ ParentFont = False
+ TabOrder = 3
+ TabStop = False
+ ViewStyle = vsReport
+ end
+ object ComboBoxTimesMinutes: TComboBox
+ Left = 460
+ Top = 5
+ Width = 55
+ Height = 21
+ BevelEdges = []
+ BevelInner = bvNone
+ BevelOuter = bvNone
+ Style = csDropDownList
+ Anchors = [akTop, akRight]
+ DoubleBuffered = False
+ ItemHeight = 13
+ ItemIndex = 0
+ ParentDoubleBuffered = False
+ TabOrder = 6
+ Text = 'times'
+ OnChange = ComboBoxRunsChange
+ OnKeyPress = ComboBoxTimesMinutesKeyPress
+ Items.Strings = (
+ 'times'
+ 'minutes')
+ end
+ object TimerMain: TTimer
+ Enabled = False
+ Interval = 985
+ OnTimer = TimerMainTimer
+ Left = 12
+ Top = 209
+ end
+ object MainMenu: TMainMenu
+ Left = 403
+ Top = 27
+ object MIFile: TMenuItem
+ Caption = '&File'
+ object MIScreenshot: TMenuItem
+ Caption = 'Save Screenshot'
+ ShortCut = 116
+ OnClick = MIScreenshotClick
+ end
+ object MILog: TMenuItem
+ Caption = 'Save Text Log'
+ Enabled = False
+ ShortCut = 117
+ OnClick = MILogClick
+ end
+ object MISep1: TMenuItem
+ Caption = '-'
+ end
+ object MIExit: TMenuItem
+ Caption = 'Exit'
+ OnClick = MIExitClick
+ end
+ end
+ object MISettings: TMenuItem
+ Caption = '&Settings'
+ ImageIndex = 1
+ ShortCut = 113
+ OnClick = MISettingsClick
+ end
+ object MIGraphs: TMenuItem
+ Caption = '&Graphs'
+ Enabled = False
+ OnClick = MIDisplayClick
+ end
+ object MIAbout: TMenuItem
+ Caption = '?'#160
+ ShortCut = 112
+ OnClick = MIAboutClick
+ end
+ end
+ object TrayIcon: TTrayIcon
+ AnimateInterval = 0
+ PopupMenu = PopupMenuTray
+ OnDblClick = TMMinimizeClick
+ Left = 475
+ Top = 209
+ end
+ object PopupMenuTray: TPopupMenu
+ OnPopup = PopupMenuTrayPopup
+ Left = 408
+ Top = 209
+ object TMMinimize: TMenuItem
+ Caption = 'Minimize'
+ Default = True
+ OnClick = TMMinimizeClick
+ end
+ object TMSep1: TMenuItem
+ Caption = '-'
+ end
+ object TMStart: TMenuItem
+ Caption = 'Start'
+ OnClick = TMStartClick
+ end
+ object TMStop: TMenuItem
+ Caption = 'Stop'
+ Enabled = False
+ OnClick = TMStopClick
+ end
+ object TMSep2: TMenuItem
+ Caption = '-'
+ end
+ object TMExit: TMenuItem
+ Caption = 'Exit'
+ OnClick = MIExitClick
+ end
+ end
+ object PopupMenuSettings: TPopupMenu
+ OnPopup = PopupMenuSettingsPopup
+ Left = 320
+ Top = 30
+ object SMFullSettings: TMenuItem
+ Caption = 'All Settings'#8230
+ OnClick = MISettingsClick
+ end
+ object SMSep4: TMenuItem
+ Caption = '-'
+ end
+ object SM32: TMenuItem
+ AutoCheck = True
+ Caption = '32-bit'
+ RadioItem = True
+ OnClick = SM32Click
+ end
+ object SM64: TMenuItem
+ AutoCheck = True
+ Caption = '64-bit'
+ RadioItem = True
+ OnClick = SM32Click
+ end
+ object SMSep1: TMenuItem
+ Caption = '-'
+ end
+ object SMThreads: TMenuItem
+ Caption = 'Threads'
+ OnClick = SMThreadsClick
+ end
+ object SMSep2: TMenuItem
+ Caption = '-'
+ end
+ object SMStopOnError: TMenuItem
+ AutoCheck = True
+ Caption = 'Stop On Error'
+ OnClick = SMStopOnErrorClick
+ end
+ object SMSavelog: TMenuItem
+ AutoCheck = True
+ Caption = 'Auto-save Log'
+ OnClick = SMSavelogClick
+ end
+ object SMSounds: TMenuItem
+ AutoCheck = True
+ Caption = 'Sounds'
+ OnClick = SMSoundsClick
+ end
+ object SMTrayIcon: TMenuItem
+ AutoCheck = True
+ Caption = 'Tray Icon'
+ OnClick = SMTrayIconClick
+ end
+ end
+end
diff --git a/UnitMain.pas b/UnitMain.pas
new file mode 100644
index 0000000..375aeb3
--- /dev/null
+++ b/UnitMain.pas
@@ -0,0 +1,1834 @@
+{$STRINGCHECKS OFF}
+unit UnitMain;
+
+interface
+
+uses
+ Windows, Messages, SysUtils, {Variants,} Classes, Graphics, Controls, Forms,
+ {Dialogs,} StdCtrls, Menus, ExtCtrls, ComCtrls, MMSystem, IniFiles,
+ Buttons, UnitLogWatch;
+
+type
+ TFormMain = class(TForm)
+ ComboBoxPS: TComboBox;
+ ComboBoxRuns: TComboBox;
+ MemoLog: TMemo;
+ LabelPS: TLabel;
+ LabelRuns: TLabel;
+ ComboBoxMem: TComboBox;
+ LabelMem: TLabel;
+ TimerMain: TTimer;
+ MainMenu: TMainMenu;
+ MIAbout: TMenuItem;
+ StatusBar: TStatusBar;
+ MIGraphs: TMenuItem;
+ ListViewTable: TListView;
+ SpeedButtonAllMem: TSpeedButton;
+ MIFile: TMenuItem;
+ MIScreenshot: TMenuItem;
+ MILog: TMenuItem;
+ MISettings: TMenuItem;
+ TrayIcon: TTrayIcon;
+ PopupMenuTray: TPopupMenu;
+ TMMinimize: TMenuItem;
+ TMStart: TMenuItem;
+ TMStop: TMenuItem;
+ TMExit: TMenuItem;
+ TMSep1: TMenuItem;
+ TMSep2: TMenuItem;
+ PopupMenuSettings: TPopupMenu;
+ SM32: TMenuItem;
+ SM64: TMenuItem;
+ SMSep1: TMenuItem;
+ SMStopOnError: TMenuItem;
+ SMSounds: TMenuItem;
+ SMTrayIcon: TMenuItem;
+ MISep1: TMenuItem;
+ MIExit: TMenuItem;
+ SMSavelog: TMenuItem;
+ ShapeBase: TShape;
+ SpeedButtonStart: TSpeedButton;
+ SpeedButtonStop: TSpeedButton;
+ SMThreads: TMenuItem;
+ SMSep2: TMenuItem;
+ ShapeBar: TShape;
+ LabelStatus: TLabel;
+ ComboBoxTimesMinutes: TComboBox;
+ SMFullSettings: TMenuItem;
+ SMSep4: TMenuItem;
+ procedure FormKeyPress(Sender: TObject; var Key: Char);
+ procedure Panel1DblClick(Sender: TObject);
+ procedure Panel1Click(Sender: TObject);
+ procedure MIAboutClick(Sender: TObject);
+ procedure ComboBoxRunsChange(Sender: TObject);
+ procedure FormClose(Sender: TObject; var Action: TCloseAction);
+ procedure SpeedButtonStopClick(Sender: TObject);
+ procedure TimerMainTimer(Sender: TObject);
+ procedure ComboBoxMemChange(Sender: TObject);
+ procedure ComboBoxPSChange(Sender: TObject);
+ procedure FormCreate(Sender: TObject);
+ procedure SpeedButtonStartClick(Sender: TObject);
+ procedure MIDisplayClick(Sender: TObject);
+ procedure SpeedButtonAllMemClick(Sender: TObject);
+ procedure MIScreenshotClick(Sender: TObject);
+ procedure MILogClick(Sender: TObject);
+ procedure th1Click(Sender: TObject);
+ procedure MISettingsClick(Sender: TObject);
+ procedure TMMinimizeClick(Sender: TObject);
+ procedure ComboBoxMemCloseUp(Sender: TObject);
+ procedure ComboBoxPSCloseUp(Sender: TObject);
+ procedure SMThreadsClick(Sender: TObject);
+ procedure PopupMenuSettingsPopup(Sender: TObject);
+ procedure SM32Click(Sender: TObject);
+ procedure SMStopOnErrorClick(Sender: TObject);
+ procedure SMSavelogClick(Sender: TObject);
+ procedure SMSoundsClick(Sender: TObject);
+ procedure SMTrayIconClick(Sender: TObject);
+ procedure MIExitClick(Sender: TObject);
+ procedure FormResize(Sender: TObject);
+ procedure StatusBarClick(Sender: TObject);
+ procedure TMStartClick(Sender: TObject);
+ procedure PopupMenuTrayPopup(Sender: TObject);
+ procedure TMStopClick(Sender: TObject);
+ procedure FormDestroy(Sender: TObject);
+ procedure OnMinimize(Sender : TObject);
+
+ procedure PSandMem(IsSourceSize : boolean; var PS: integer; showmsg: boolean);
+ procedure ShowFreeMemory;
+ procedure ShowEstimatedTime;
+ procedure ShowElapsedTime;
+ procedure ShowFinishTime;
+ procedure ToggleTableLog;
+ procedure ToggleGlass(enable : boolean);
+ procedure ComboBoxTimesMinutesKeyPress(Sender: TObject; var Key: Char);
+ private
+ { Private declarations }
+ procedure WMNCLBUTTONDBLCLK(var msg: TMessage); message WM_NCLBUTTONDBLCLK;
+ public
+ { Public declarations }
+ end;
+
+ dataarray = array of single;
+
+ function Monitoring(b_everest, b_speedfan, b_temps, b_fans, b_vcores, b_p12vs,
+ b_testing : boolean; var infostr : string) : boolean;
+ function SetWinHeight(curr_count : integer; total_count : integer;
+ def_items_count, min_items_count,row_height : byte;
+ def_win_height : integer) : integer;
+ procedure SaveSettingsToINI;
+ procedure SaveLogFile;
+ function GetThreadsString(threads : byte) : string;
+
+const
+ inputfile_name = 'lininput';
+ temps_file_name = 'CPU Temp';
+ fans_file_name = 'CPU Fan speed';
+ vcores_file_name = 'CPU Vcore';
+ p12vs_file_name = '+12V';
+ SFinifile_name = 'Speedfan.ini';
+ maininifile_name = 'LinX.ini';
+ localizationfile_name = 'local.lng';
+
+ TangoGreen1 = $34e28a;
+ TangoGreen2 = $16d273;
+ TangoGreen3 = $069a4e;
+
+ TangoBlue1 = $cf9f72;
+ //TangoBlue2 = $a46534;
+ TangoBlue3 = $874a20;
+
+ TangoRed1 = $2929ef;
+ //TangoRed2 = $0000cc;
+ TangoRed3 = $0000a4;
+
+ TangoGray1 = $eceeee;
+ TangoGray2 = $cfd7d3;
+ TangoGray3 = $b6bdba;
+ TangoGray6 = $36342e;
+
+ TangoYellow1 = $4fe9fc;
+ //TangoYellow2 = $00d4ed;
+ TangoYellow3 = $00a0c4;
+
+ TangoOrange1 = $3EAFFC;
+ //TangoOrange2 = $0079F5;
+ TangoOrange3 = $005CCE;
+
+ TangoViolet1 = $A87FAD;
+ //TangoViolet2 = $7B5075;
+ TangoViolet3 = $66355C;
+
+ progname = 'LinX';
+
+ //Where OS matters...
+ Lin32XP = 16134;
+ Lin32Vista = 15500;
+
+ MinProblemSize = 500;
+ DefProblemSize = 10000;
+ DefNumberOfRuns = 20;
+ DefNumberOfMinutes = 30;
+
+var
+ FormMain: TFormMain;
+ LogWatch : TLogWatchThread;
+ version : string;
+ sound_time : integer;
+ StartTime : TDateTime; total_time : integer; run_time : integer;
+ x64, was_error : boolean; glass: boolean = false; everest_imp : boolean = false; speedfan_imp : boolean = false;
+ LinpackLog : string;
+ time_show_mode : byte = 4;
+ LinpackProcessInfo : TProcessInformation;
+ win_height : smallint; //Hello, thick vista borders!
+ table_line_height : byte;
+ temps, fans, vcores, p12vs : dataarray;
+ buildtemps : boolean = false; buildfans : boolean = false;
+ buildvcores : boolean = false; buildp12vs : boolean = false;
+ max_temp : byte = 0;
+ SFsettings : array[0..7] of byte;
+ total_mem : integer;
+ ProblemSize : integer = DefProblemSize; tmpProblemSize : integer;
+ NumberOfRuns : integer = DefNumberOfRuns;
+ NumberOfMinutes : integer = -1;
+
+ lin32exe_name : string = 'linpack_xeon32.exe';
+ lin64exe_name : string = 'linpack_xeon64.exe';
+
+ GraphWindows : array[1..4] of TRect;
+
+ maxsize_lin32 : integer = Lin32XP;
+ maxmem_offset : byte = 5;
+ dataalign : byte = 4;
+ useoptld : boolean = true;
+ NumberOfThreads : byte = 0;
+ NumberOfCPUs : byte = 0;
+ x64mode : boolean = false;
+ lin_priority : byte = 2;
+ stoponerror : boolean = true;
+ autosavelog : boolean = false;
+ sounds : boolean = false;
+ datetimeinnames : boolean = true;
+ stoponoverheat : boolean = false;
+ stop_temp : byte = 75;
+ simplecaption : boolean = false;
+
+ Tray0, Tray1, Tray2, Tray3 : TIcon;
+
+ str_CPUName : string;
+ str_PS_LDnum_align : string;
+
+ { Here they go, the strings! }
+
+ idle_win_capt : string = 'Simply Linpack';
+ test_win_capt : string = 'Testing';
+ err_win_capt : string = 'Error';
+ hot_win_capt : string = 'CPU Overheat';
+ done_win_capt : string = 'Finished';
+ stop_win_capt : string = 'Stopped';
+
+ str_temps_capt : string = 'CPU Temperature';
+ str_fans_capt : string = 'CPU Fan Speed';
+ str_vcores_capt : string = 'CPU Core Voltage';
+ str_p12vs_capt : string = '+12 V Voltage';
+
+ msg_nomem : string = 'Not enough physical memory! Values corrected.';
+ msg_noexe : string = 'Some of the Linpack files are missing. LinX will quit now.';
+ msg_lin_error : string = 'Linpack has stopped unexpectedly (not enough memory?). Press the "Log >" button for details';
+ msg_exit_prompt : string = 'Testing in progress! Shutdown Linpack and quit anyway?';
+ msg_mem2048 : string = 'Cannot allocate more than 2 GB of memory due to Linpack32 limitation. Values corrected.';
+
+ str_stop : string = 'Stopped on demand after';
+ str_done : string = 'Finished without errors in';
+ str_err : string = 'Stopped upon error after';
+ str_hot : string = 'Stopped upon overheat after';
+ str_done_err : string = 'Finished with errors in';
+ str_freemem : string = 'Physical memory available:';
+ str_CPU : string = 'CPU:'; str_peak : string = 'peak';
+ str_mib : string = 'MiB'; str_flops : string = 'GFlops';
+ str_32 : string = '32-bit'; str_64 : string = '64-bit';
+ str_h : string = 'h'; str_m : string = 'm'; str_s : string = 's';
+ str_grad : string = '°'; str_volts : string = 'V'; str_mhz : string = 'MHz';
+ str_sep : string = '|'; str_log : string = 'Log ›'; str_table : string = '‹ Table';
+ str_rpm : string = 'RPM'; str_celsius : string = '°C';
+ str_wait : string = 'Please wait…';
+ str_finish_time : string = 'Estimated finish time:';
+ str_elapsed : string = 'Elapsed';
+ str_remaining : string = 'Remaining';
+ str_thread : string = 'thread'; str_threads : string = 'threads';
+ str_threadsalt : string = 'threads';
+ str_custom : string = 'Custom';
+ str_tray_hide : string = 'Minimize'; str_tray_restore : string = 'Restore';
+
+ memo_hint1 : string = 'Double click - show free memory';
+ memo_hint2 : string = 'Click - cycle time view modes, double click - disable time';
+ memo_hint3 : string = 'Right mouse click - settings menu';
+
+ msg_comline : string = 'All command-line parameters start with a „-“ or a „/“,' + #13#10 +
+ 'e. g. /help or -help. X is any decimal digit.' + #13#10 + #13#10 +
+ 'Supported command-line switches:' + #13#10 + #13#10 +
+ '?, h, help - displays this message;' + #13#10 +
+ 'psXXXXX - sets the desired Problem size value;' + #13#10 +
+ 'mXXXX - sets the desired Memory to use value in MiB;' + #13#10 +
+ 'nXXX - sets the desired Number of runs value;' + #13#10 +
+ 'tXXX - sets the desired Time to run (in minutes) value;' + #13#10 +
+ 'mm, maxmemory - enable using all available memory;' + #13#10 +
+ '64 - use 64-bit Linpack (ignored on 32-bit OS);' + #13#10 +
+ '32 - use 32-bit Linpack (ignored on 32-bit OS);' + #13#10 +
+ 'm, minimized - start minimized;' + #13#10 +
+ 'a, autostart - testing will start immediately.' + #13#10 + #13#10 +
+ 'Any combination of the above switches is acceptable,' + #13#10 +
+ 'however, some switches will override others.';
+ msg_comline_capt : string = 'LinX command-line switches';
+
+implementation
+
+uses UnitGraph, UnitSett, UnitAbout, LinX_routines;
+
+{$R *.dfm}
+
+procedure TFormMain.WMNCLBUTTONDBLCLK(var msg: TMessage);
+begin
+ if msg.wParam = HTCAPTION then
+ if FormStyle <> fsStayOnTop then FormStyle := fsStayOnTop
+ else FormStyle := fsNormal;
+ inherited;
+end;
+
+procedure TFormMain.MIAboutClick(Sender: TObject);
+begin
+ FormAbout := TFormAbout.Create(Self);
+ with FormAbout do
+ try
+ ShowModal;
+ finally
+ FreeandNil(FormAbout);
+ end;
+end;
+
+procedure TFormMain.SpeedButtonStopClick(Sender: TObject);
+begin
+ TerminateProcess(LinpackProcessInfo.hProcess, 2);
+end;
+
+procedure TFormMain.SpeedButtonStartClick(Sender: TObject);
+var LeadingDimensions : integer;
+begin
+ was_error := false;
+ sound_time := 0;
+ max_temp := 0;
+ LinpackLog := '';
+ run_time := 0;
+ total_time := 1;
+ StartTime := Now;
+ time_show_mode := 1;
+
+ temps := nil;
+ fans := nil;
+ vcores := nil;
+ p12vs := nil;
+
+ PSandMem(true, ProblemSize, false);
+
+ ListviewTable.Clear;
+ if not listviewTable.Visible then ToggleTableLog;
+ SpeedButtonStop.Enabled := true;
+ SpeedButtonStart.Enabled := false;
+ SpeedButtonAllMem.Enabled := false;
+ MILog.Enabled := true;
+ ComboBoxPS.Enabled := false;
+ ComboBoxRuns.Enabled := false;
+ ComboBoxMem.Enabled := false;
+ ComboBoxTimesMinutes.Enabled := false;
+ LabelStatus.Hint := memo_hint2;
+ Statusbar.Panels[0].Text := '';
+ if x64mode then Statusbar.Panels[1].Text := str_64
+ else Statusbar.Panels[1].Text := str_32;
+ Statusbar.Panels[2].Text := GetThreadsString(NumberOfThreads);
+ Statusbar.Panels[3].Text := '';
+ Statusbar.Panels[5].Text := '';
+ ShapeBar.Pen.Color := TangoGreen3;
+ ShapeBar.Visible := false;
+ if stoponerror then ShapeBar.Brush.Color := TangoGreen1
+ else ShapeBar.Brush.Color := TangoGray2;
+ Caption := test_win_capt + ' - ' + version;
+ TrayIcon.Icon := Tray0;
+
+ LeadingDimensions := SetLeadingDimensions(ProblemSize, UseOptLD);
+
+ CreateInputFile(inputfile_name, ProblemSize,
+ LeadingDimensions, NumberOfRuns, DataAlign, Version, x64Mode);
+
+ str_PS_LDnum_align := SetOutputString(ProblemSize, LeadingDimensions, DataAlign);
+
+ SaveSettingsToINI;
+
+ LogWatch := TLogWatchThread.Create(true);
+ LogWatch.FreeOnTerminate := true;
+ LogWatch.Resume;
+ ShowElapsedTime;
+end;
+
+procedure TFormMain.ToggleTableLog;
+begin
+ if ListViewTable.Visible then begin
+ Statusbar.Panels[5].Text := str_table;
+ ListViewTable.Visible := false;
+ MemoLog.Text := LinpackLog;
+ MemoLog.SelStart := 0;
+ Constraints.MaxHeight := win_height - 10 * table_line_height + MemoLog.Lines.Count * 14 - 10;
+ if Top + Constraints.MaxHeight < Screen.Height - 40
+ then Height := Constraints.MaxHeight;
+ ShapeBar.Constraints.MaxWidth := ShapeBar.Constraints.MaxWidth + 50;
+ Constraints.MaxWidth := Constraints.MaxWidth + 50; //50 was enough =)
+ Constraints.MinWidth := Constraints.MaxWidth;
+ MemoLog.Visible := true;
+ MemoLog.SetFocus;
+ end
+ else begin
+ Statusbar.Panels[5].Text := str_log;
+ MemoLog.Visible := false;
+ Constraints.MinWidth := Constraints.MaxWidth - 50;
+ Constraints.MaxWidth := Constraints.MaxWidth - 50;
+ ShapeBar.Constraints.MaxWidth := ShapeBar.Constraints.MaxWidth - 50;
+ Constraints.MaxHeight := SetWinHeight(ListViewTable.Items.Count,
+ NumberOfRuns,10,5,table_line_height,win_height);
+ ListViewTable.Visible := true;
+ end;
+end;
+
+procedure TFormMain.ComboBoxPSChange(Sender: TObject);
+begin
+ PSandMem(true, ProblemSize, true);
+end;
+
+procedure TFormMain.ComboBoxPSCloseUp(Sender: TObject);
+begin
+ PSandMem(true, ProblemSize, false);
+end;
+
+procedure TFormMain.ComboBoxRunsChange(Sender: TObject);
+var number : integer;
+begin
+ number := strtointdef(ComboBoxRuns.Text, 0);
+ ComboboxRuns.Text := inttostr(number);
+ if number = 0 then SpeedButtonStart.Enabled := false
+ else
+ if (ProblemSize >= MinProblemSize) and (time_show_mode > 3) then SpeedButtonStart.Enabled := true;
+ if ComboBoxTimesMinutes.ItemIndex = 0 then begin
+ if ListViewTable.Visible
+ then Constraints.MaxHeight := SetWinHeight(ListViewTable.Items.Count,
+ number,10,5,table_line_height,
+ win_height);
+ NumberOfRuns := number;
+ NumberOfMinutes := -1;
+ end
+ else begin
+ if ListViewTable.Visible
+ then Constraints.MaxHeight := 0;
+ NumberOfMinutes := number;
+ NumberOfRuns := high(integer);
+ end;
+end;
+
+procedure TFormMain.MIExitClick(Sender: TObject);
+begin
+ Close;
+end;
+
+procedure TFormMain.ComboBoxTimesMinutesKeyPress(Sender: TObject; var Key: Char);
+begin
+ Key := #0;
+end;
+
+procedure TFormMain.ComboBoxMemChange(Sender: TObject);
+begin
+ PSandMem(false, ProblemSize, true);
+end;
+
+procedure TFormMain.ComboBoxMemCloseUp(Sender: TObject);
+begin
+ PSandMem(false, ProblemSize, false);
+end;
+
+procedure TFormMain.FormClose(Sender: TObject; var Action: TCloseAction);
+begin
+ if time_show_mode < 4 then begin
+ if MessageBox(Handle, PChar(msg_exit_prompt), PChar(version),
+ MB_YESNO or MB_ICONQUESTION) = IDYES
+ then TerminateProcess(LinpackProcessInfo.hProcess, 2)
+ else Action := caNone;
+ end;
+end;
+
+procedure TFormMain.FormCreate(Sender: TObject);
+var maininifile, SFinifile, localizationfile : tinifile;
+ ok32, ok64 : boolean; h : integer; EXEDirectory : string;
+
+ procedure FillComboboxMem(var CB : TCombobox; TotalMemory : integer);
+ var CurValue, Increment : integer; I : byte;
+ begin
+ Increment := 16;
+ CurValue := 16;
+ i := 0;
+ while CurValue <= TotalMemory do begin
+ CB.Items.Append(Inttostr(CurValue));
+ if CurValue <= 256 then Increment := CurValue
+ else
+ if CurValue >= 2048 then begin
+ if (i mod 4 = 0) then inc(Increment, Increment);
+ inc(i);
+ end;
+ inc(CurValue, Increment);
+ end;
+ end;
+
+ procedure FillComboboxSize(var CB : TCombobox; TotalMemory : integer);
+ var MaxProblemSize : integer; i : byte;
+ begin
+ MaxProblemSize := memtosize(TotalMemory);
+ for I := 1 to (MaxProblemSize div 1000) do
+ CB.Items.Append(Inttostr(i*1000));
+ end;
+
+ procedure FillPopupMenu(var Menu : TMenuItem; Num : byte);
+ var Item : TMenuItem; i : byte;
+ begin
+ for I := 0 to Num - 1 do begin
+ item := Tmenuitem.Create(Menu);
+ item.Caption := GetThreadsString(i + 1);
+ item.RadioItem := true;
+ item.AutoCheck := true;
+ item.OnClick := th1Click;
+ Menu.Insert(Menu.Count, item);
+ end;
+ item := Tmenuitem.Create(Menu);
+ item.Caption := str_custom;
+ item.RadioItem := true;
+ item.Enabled := false;
+ item.Visible := false;
+ Menu.Insert(Menu.Count, item);
+ end;
+
+ procedure localize;
+ begin
+ With localizationfile do begin
+ localizationfile := tinifile.Create(EXEDirectory +
+ localizationfile_name);
+ LabelPS.Caption:=readstring('Interface','ProblemSize',LabelPS.Caption);
+ LabelMem.Caption:=readstring('Interface','MemoryToUse',LabelMem.Caption);
+ SpeedButtonAllMem.Caption:=readstring('Interface','AllMem',SpeedButtonAllMem.Caption);
+ LabelRuns.Caption:=readstring('Interface','NumberOfTimes',LabelRuns.Caption);
+ ComboboxTimesMinutes.Items.Strings[0] := readstring('Interface','Times',ComboboxTimesMinutes.Items.Strings[0]);
+ ComboboxTimesMinutes.Items.Strings[1] := readstring('Interface','Minutes',ComboboxTimesMinutes.Items.Strings[1]);
+ ComboboxTimesMinutes.ItemIndex := 0;
+ SpeedButtonStart.Caption:=readstring('Interface','Start',SpeedButtonStart.Caption);
+ SpeedButtonStop.Caption:=readstring('Interface','Stop',SpeedButtonStop.Caption);
+
+ LabelPS.Hint:=readstring('Hints','ProblemSize',LabelPS.Hint);
+ ComboBoxPS.Hint:=readstring('Hints','ComboboxHint',ComboBoxPS.Hint);
+ ComboBoxMem.Hint := ComboBoxPS.Hint;
+ ComboBoxRuns.Hint := ComboBoxPS.Hint;
+ LabelMem.Hint:=readstring('Hints','MemoryToUse',LabelMem.Hint);
+ SpeedButtonAllMem.Hint:=readstring('Hints','AllMem',SpeedButtonAllMem.Hint);
+ LabelRuns.Hint:=readstring('Hints','NumberOfTimes',LabelRuns.Hint);
+ SpeedButtonStart.Hint:=readstring('Hints','Start',SpeedButtonStart.Hint);
+ SpeedButtonStop.Hint:=readstring('Hints','Stop',SpeedButtonStop.Hint);
+ memo_hint1:=readstring('Hints','StatusPanel1',memo_hint1);
+ memo_hint2:=readstring('Hints','StatusPanel2',memo_hint2);
+ memo_hint3:=readstring('Hints','StatusPanel3',memo_hint3);
+
+ MIFile.Caption:=readstring('MainMenu','File',MIFile.Caption);
+ MIScreenshot.Caption:=readstring('MainMenu','SaveScreenshot',
+ MIScreenshot.Caption);
+ MILog.Caption:=readstring('MainMenu','SaveTextLog',
+ MILog.Caption);
+ MIExit.Caption := readstring('MainMenu','Exit',
+ MIExit.Caption);
+ MISettings.Caption:=readstring('MainMenu','Settings',MISettings.Caption);
+
+ MIGraphs.Caption:=readstring('MainMenu','Graphs',MIGraphs.Caption);
+
+ idle_win_capt:= {version + ' - ' +} readstring('WindowCaptions','Idle',idle_win_capt);
+ test_win_capt:= readstring('WindowCaptions','Test',test_win_capt){ + ' - ' + version};
+ err_win_capt:= readstring('WindowCaptions','Error',err_win_capt) {+ ' - ' + version};
+ hot_win_capt:= readstring('WindowCaptions','Overheat',hot_win_capt) {+ ' - ' + version};
+ done_win_capt:= readstring('WindowCaptions','Done',done_win_capt) {+ ' - ' + version};
+ stop_win_capt:= readstring('WindowCaptions','Stop',stop_win_capt) {+ ' - ' + version};
+
+ str_temps_capt:=readstring('GraphCaptions','Temp',str_temps_capt);
+ str_fans_capt:=readstring('GraphCaptions','Fan',str_fans_capt);
+ str_vcores_capt:=readstring('GraphCaptions','VCore',str_vcores_capt);
+ str_p12vs_capt:=readstring('GraphCaptions','12V',str_p12vs_capt);
+
+ msg_noexe:=readstring('Messages','NoEXE',msg_noexe);
+ msg_nomem:=readstring('Messages','NoMem',msg_nomem);
+ msg_mem2048:=readstring('Messages','Lin32Lim',msg_mem2048);
+ msg_exit_prompt:=readstring('Messages','ExitConfirm',msg_exit_prompt);
+
+ if readstring('CommandLine','1','') <> ''
+ then msg_comline:=readstring('CommandLine','1','') + #13#10 +
+ readstring('CommandLine','2','') + #13#10 + #13#10 +
+ readstring('CommandLine','3','') + #13#10 + #13#10 +
+ readstring('CommandLine','4','') + #13#10 +
+ readstring('CommandLine','5','') + #13#10 +
+ readstring('CommandLine','6','') + #13#10 +
+ readstring('CommandLine','7','') + #13#10 +
+ readstring('CommandLine','8','') + #13#10 +
+ readstring('CommandLine','9','') + #13#10 +
+ readstring('CommandLine','10','') + #13#10 +
+ readstring('CommandLine','11','') + #13#10 +
+ readstring('CommandLine','12','') + #13#10 +
+ readstring('CommandLine','13','') + #13#10 + #13#10 +
+ readstring('CommandLine','14','') + #13#10 +
+ readstring('CommandLine','15','');
+ msg_comline_capt := readstring('CommandLine','Caption',msg_comline_capt);
+
+ str_freemem:=readstring('StatusPanel','Idle',str_freemem);
+ str_stop:=readstring('StatusPanel','Stop',str_stop);
+ str_done:=readstring('StatusPanel','Done',str_done);
+ str_done_err:=readstring('StatusPanel','DoneWError',str_done_err);
+ str_err:=readstring('StatusPanel','Error',str_err);
+ str_hot:=readstring('StatusPanel','Overheat',str_hot);
+ msg_lin_error:=readstring('StatusPanel','LinStopped',msg_lin_error);
+ str_elapsed:=readstring('StatusPanel','Elapsed',str_elapsed);
+ str_remaining:=readstring('StatusPanel','Remaining',str_remaining);
+ str_finish_time:=readstring('StatusPanel','FinishTime',str_finish_time);
+ str_wait:=readstring('StatusPanel','Wait',str_wait);
+
+ ListViewTable.Columns[0].Caption:=readstring('OutputTable','Number',ListViewTable.Columns[0].Caption);
+ ListViewTable.Columns[1].Caption:=readstring('OutputTable','Size',ListViewTable.Columns[1].Caption);
+ ListViewTable.Columns[2].Caption:=readstring('OutputTable','LDA',ListViewTable.Columns[2].Caption);
+ ListViewTable.Columns[3].Caption:=readstring('OutputTable','Align',ListViewTable.Columns[3].Caption);
+ ListViewTable.Columns[4].Caption:=readstring('OutputTable','Time',ListViewTable.Columns[4].Caption);
+ ListViewTable.Columns[5].Caption:=readstring('OutputTable','GFlops',ListViewTable.Columns[5].Caption);
+ ListViewTable.Columns[6].Caption:=readstring('OutputTable','Residual',ListViewTable.Columns[6].Caption);
+ ListViewTable.Columns[7].Caption:=readstring('OutputTable','Residual(norm)',ListViewTable.Columns[7].Caption);
+
+ str_cpu:=readstring('Statusbar','CPU',str_cpu);
+ str_peak:=readstring('Statusbar','Peak',str_peak);
+ str_sep:=readstring('Statusbar','Separator',str_sep);
+ str_log:=readstring('Statusbar','Log',str_log);
+ str_table:=readstring('Statusbar','Table',str_table);
+
+ str_mib := readstring('MeasUnits','MiB',str_mib);
+ str_flops:=readstring('MeasUnits','GFlops',str_flops);
+ str_32 := readstring('MeasUnits','32',str_32);
+ str_64 := readstring('MeasUnits','64',str_64);
+ SM32.Caption := str_32;
+ SM64.Caption := str_64;
+ str_h:=readstring('MeasUnits','h',str_h);
+ str_m:=readstring('MeasUnits','m',str_m);
+ str_s:=readstring('MeasUnits','s',str_s);
+ str_grad:=readstring('MeasUnits','Grad',str_grad);
+ str_celsius:=readstring('MeasUnits','Celsius',str_celsius);
+ str_volts:=readstring('MeasUnits','Volt',str_volts);
+ str_mhz:=readstring('MeasUnits','MHz',str_mhz);
+ str_rpm:=readstring('MeasUnits','RPM',str_rpm);
+
+ str_tray_hide := readstring('TrayMenu','Minimize',str_tray_hide);
+ str_tray_restore := readstring('TrayMenu','Restore',str_tray_restore);
+ TMExit.Caption := readstring('TrayMenu','Exit',TMExit.Caption);
+ TMStart.Caption := SpeedButtonStart.Caption;
+ TMStop.Caption := SpeedButtonStop.Caption;
+
+ SMFullSettings.Caption := readstring('SettingsMenu','AllSettings',SMFullSettings.Caption);
+ str_thread := readstring('SettingsMenu','Thread',str_thread);
+ str_threads := readstring('SettingsMenu','Threads',str_threads);
+ str_threadsalt := readstring('SettingsMenu','ThreadsAlt',str_threadsalt);
+ SMThreads.Caption := readstring('SettingsMenu','ThreadsCaption', SMThreads.Caption);
+ str_custom := readstring('SettingsMenu','Custom',str_custom);
+ SMStopOnError.Caption := readstring('SettingsMenu','StopOnError',SMStopOnError.Caption);
+ SMSaveLog.Caption := readstring('SettingsMenu','AutoSaveLog',SMSaveLog.Caption);
+ SMSounds.Caption := readstring('SettingsMenu','Sounds',SMSounds.Caption);
+ SMTrayIcon.Caption := readstring('SettingsMenu','TrayIcon',SMTrayIcon.Caption);
+
+ free;
+ end;
+ end;
+
+ procedure ParseCommandLine;
+ var i : integer; helpshown, autostart, allmem : boolean; s : string;
+ begin
+ i := 1;
+ helpshown := false;
+ autostart := false;
+ allmem := SpeedButtonAllMem.Down;
+ tmpProblemSize := ProblemSize;
+ while (i <= ParamCount) and ((ParamStr(i)[1] = '-') or (ParamStr(i)[1] = '/'))
+ do begin
+ s := ParamStr(i);
+ delete(s, 1, 1);
+ if ((s = 'help') or (s = 'h') or (s = '?')) and not helpshown then begin
+ helpshown := true;
+ MessageBox(Handle, Pchar(msg_comline), Pchar(msg_comline_capt), MB_OK or MB_ICONINFORMATION);
+ end
+ else
+ if (s = 'mm') or (s = 'maxmemory') then allmem := true
+ else
+ if (s = 'm') or (s = 'minimized') and not TrayIcon.Visible
+ then TMMinimize.Click
+ else
+ if pos('ps', s) = 1 then begin
+ delete(s, 1, 2);
+ tmpProblemSize := strtointdef(s, ProblemSize);
+ allmem := false;
+ end
+ else
+ if pos('m', s) = 1 then begin
+ delete(s, 1, 1);
+ tmpProblemSize := memtosize(strtointdef(s, sizetomem(ProblemSize)));
+ allmem := false;
+ end
+ else
+ if pos('n', s) = 1 then begin
+ delete(s, 1, 1);
+ NumberOfRuns := strtointdef(s, NumberOfRuns);
+ NumberOfMinutes := -1;
+ end
+ else
+ if pos('t', s) = 1 then begin
+ delete(s, 1, 1);
+ NumberOfRuns := high(integer);
+ NumberOfMinutes := strtointdef(s, DefNumberOfMinutes);
+ end
+ else
+ if (s = 'a') or (s = 'autostart') then autostart := true
+ else
+ if (s = '64') and x64 then x64mode := true
+ else
+ if (s = '32') and x64 then x64mode := false
+ else
+ if s = 'simpletitle' then begin
+ version := progname;
+ simplecaption := true;
+ Caption := version + ' - ' + idle_win_capt;
+ end;
+ inc(i);
+ end;
+ if (NumberOfMinutes = -1) then begin
+ ComboboxRuns.Text := inttostr(NumberOfRuns);
+ ComboBoxTimesMinutes.ItemIndex := 0;
+ end
+ else begin
+ ComboboxRuns.Text := inttostr(NumberOfMinutes);
+ ComboBoxTimesMinutes.ItemIndex := 1;
+ end;
+ SpeedButtonAllMem.Down := allmem;
+ SpeedbuttonAllMem.Click;
+ if autostart then SpeedButtonStart.Click;
+ end;
+
+begin
+ version := progname + ' ' + GetVersion(false);
+
+ EXEDirectory := ExtractFilePath(Application.ExeName);
+ SetCurrentDir(EXEDirectory);
+
+ localize;
+ Caption := version + ' - ' + idle_win_capt;
+
+ if not fileexists(EXEDirectory + lin32exe_name) then begin
+ lin32exe_name := EXEDirectory + '32-bit/' + lin32exe_name;
+ ok32 := fileexists(lin32exe_name);
+ end
+ else begin
+ lin32exe_name := EXEDirectory + lin32exe_name;
+ ok32 := true;
+ end;
+ if not fileexists(EXEDirectory + lin64exe_name) then begin
+ lin64exe_name := EXEDirectory + '64-bit/' + lin64exe_name;
+ ok64 := fileexists(lin64exe_name);
+ end
+ else begin
+ lin64exe_name := EXEDirectory + lin64exe_name;
+ ok64 := true;
+ end;
+
+ x64 := IsX64Supported;
+
+ if ok32 or (ok64 and x64) then begin
+
+ if x64 then
+ if not ok32 then begin
+ x64mode := true;
+ x64 := false;
+ end
+ else
+ if not ok64 then x64 := false;
+
+ if Screen.PixelsPerInch <> PixelsPerInch then begin
+ ScaleBy(Screen.PixelsPerInch, PixelsPerInch);
+ end;
+
+ if Win32MajorVersion > 5 then begin
+ ClientHeight := 275;
+ Constraints.MinHeight := Height - 85;
+ table_line_height := 17;
+ end
+ else begin
+ ClientHeight := 241;
+ Constraints.MinHeight := Height - 70;
+ table_line_height := 14;
+ end;
+ win_height := Height;
+
+ ClientWidth := 515;
+ Constraints.MaxWidth := Width;
+ Constraints.MinWidth := Width;
+
+ ComboBoxPS.Left := LabelPS.Left + labelPS.Width + 5;
+ LabelMem.Left := ComboBoxMem.Left - LabelMem.Width - 5;
+ LabelRuns.Left := ComboBoxRuns.Left - LabelRuns.Width - 5;
+ ShapeBar.Constraints.MaxWidth := ShapeBase.Width - 4;
+
+ total_mem := GetTotalMemory;
+ FillComboboxMem(ComboboxMem, total_mem);
+ FillComboboxSize(ComboboxPS,total_mem);
+
+ //FillChar(SA, SizeOf(TSecurityAttributes), #0);
+ //SA.nLength := SizeOf(TSecurityAttributes);
+ //SA.bInheritHandle := True;
+
+ //LinpackPipeRead := CreateNamedPipe('\\.\pipe\linx', PIPE_ACCESS_INBOUND or
+ // FILE_FLAG_OVERLAPPED, 0, 2, 1024, 1024, 0, @SA);
+ //LinpackPipeWrite := CreateFile('\\.\pipe\linx', {GENERIC_READ or} GENERIC_WRITE,
+ // {FILE_SHARE_READ or FILE_SHARE_WRITE}0, @SA, OPEN_EXISTING,
+ // FILE_ATTRIBUTE_NORMAL{ or FILE_FLAG_OVERLAPPED}, 0);
+
+ LabelStatus.Hint := memo_hint3;
+ Application.Title := version;
+ Application.OnMinimize := OnMinimize;
+
+ Tray0 := TIcon.Create;
+ Tray0.Handle := LoadIcon(HInstance, 'Tray0');
+ Tray1 := TIcon.Create;
+ Tray1.Handle := LoadIcon(HInstance, 'Tray1');
+ Tray2 := TIcon.Create;
+ Tray2.Handle := LoadIcon(HInstance, 'Tray2');
+ Tray3 := TIcon.Create;
+ Tray3.Handle := LoadIcon(HInstance, 'Tray3');
+
+ TrayIcon.Icon := Tray1;
+ TrayIcon.Hint := version;
+ str_CPUName := GetCPUName;
+ Statusbar.Panels[4].Text := str_CPUName;
+ Decimalseparator := '.'; //Kiss EConvertError good-bye!
+
+ NumberOfCPUs := GetMaxThreadsNumber;
+ FillPopupMenu(SMThreads,NumberOfCPUs);
+
+ if Getdrivetype(Pchar(ExtractFileDrive(Application.EXEName))) = DRIVE_CDROM
+ then SetCurrentDir(GetTempFolderPath);
+
+ With maininifile do begin
+ maininifile := Tinifile.Create(GetCurrentDir + '\' + maininifile_name);
+ ClientHeight := readinteger('Window','ClientHeight',ClientHeight);
+ Top := readinteger('Window','Top',Top);
+ if Top < 0 then Top := 0
+ else
+ if Top > Screen.Height - Height then Top := Screen.Height - Height;
+ Left := readinteger('Window','Left',Left);
+ if Left < 0 then Left := 0
+ else
+ if Left > Screen.Width - Width then Left := Screen.Width - Width;
+
+ SpeedButtonAllMem.Down := readbool('Settings','UseAllMem',SpeedButtonAllMem.Down);
+ stoponerror := readbool('Settings','StopOnError',stoponerror);
+ autosavelog := readbool('Settings','AutoSaveLog',autosavelog);
+ stop_temp := readinteger('Settings','OverheatValue',stop_temp);
+ sounds := readbool('Settings','EnableSounds',sounds);
+ datetimeinnames := readbool('Settings','DateTimeInFilenames',datetimeinnames);
+ ShowHint:= readbool('Settings','ShowHints',ShowHint);
+ Trayicon.Visible := readbool('Settings','TrayIcon',Trayicon.Visible);
+ speedfan_imp := readbool('Settings','SpeedfanImport',speedfan_imp);
+ everest_imp := readbool('Settings','EverestImport',everest_imp);
+ if speedfan_imp or everest_imp then begin
+ stoponoverheat := readbool('Settings','StopOnOverheat',stoponoverheat);
+ end;
+ buildtemps := readbool('Settings', 'TempGraph', buildtemps);
+ buildfans := readbool('Settings', 'FanGraph', buildfans);
+ buildvcores := readbool('Settings', 'VcoreGraph', buildvcores);
+ buildp12vs := readbool('Settings', 'P12VGraph', buildp12vs);
+
+ if Win32MajorVersion >= 6 then begin
+ maxsize_lin32 := Lin32Vista;
+ glass := readbool('Settings','GlassEffect', glass);
+ if CompositingEnabled then begin
+ if glass then ToggleGlass(true);
+ end
+ else glass := false;
+ end;
+
+ maxsize_lin32 := readinteger('Advanced','MaximumSizeForLinpack32',maxsize_lin32);
+ maxmem_offset := readinteger('Advanced','MaxmemFromFreememOffset',maxmem_offset);
+
+ if x64 then x64mode := readbool('Linpack','x64',true);
+ lin_priority := readinteger('Linpack','Priority',lin_priority);
+ if lin_priority > 5 then lin_priority := 2;
+
+ if NumberOfCPUs = readinteger('Advanced','LastLogicalCPUs',NumberOfCPUs)
+ then begin
+ NumberOfThreads := readinteger('Linpack','NumberOfThreads',NumberOfCPUs);
+ if NumberOfThreads < 1 then NumberOfThreads := NumberOfCPUs;
+ end
+ else NumberOfThreads := NumberOfCPUs;
+
+ ProblemSize := readinteger('Linpack','ProblemSize',ProblemSize);
+ if (ProblemSize > 99999) or (ProblemSize < MinProblemSize) then ProblemSize := DefProblemSize;
+ //ComboBoxPS.Text := inttostr(ProblemSize);
+
+ NumberOfMinutes := readinteger('Linpack','MinutesToRun',NumberOfMinutes);
+ if NumberOfMinutes <> -1 then begin
+ ComboBoxTimesMinutes.ItemIndex := 1;
+ if NumberOfMinutes < 1 then NumberOfMinutes := DefNumberOfMinutes;
+ NumberOfRuns := High(integer);
+ ComboBoxRuns.Text := inttostr(NumberOfMinutes);
+ end
+ else begin
+ NumberOfRuns := readinteger('Linpack','TimesToRun',NumberOfRuns);
+ if NumberOfRuns < 1 then NumberOfRuns := DefNumberOfRuns;
+ ComboBoxRuns.Text := inttostr(NumberOfRuns);
+ end;
+ useoptld := readbool('Linpack','UseOptimizedLeadingDimensions',useoptld);
+ dataalign := readinteger('Linpack','DataAlignment',dataalign);
+ if dataalign > 64 then dataalign := 4;
+
+ h := (screen.Height - 80) div 4;
+ GraphWindows[1].Left := readinteger('Graphs','TempLeft', 40);
+ GraphWindows[1].Top := readinteger('Graphs','TempTop', 40);
+ GraphWindows[1].Right := readinteger('Graphs','TempWidth', 416) +
+ GraphWindows[1].Left;
+ GraphWindows[1].Bottom := readinteger('Graphs','TempHeight', h) +
+ GraphWindows[1].Top;
+
+ GraphWindows[2].Left := readinteger('Graphs','FanLeft', 40);
+ GraphWindows[2].Top := readinteger('Graphs','FanTop', GraphWindows[1].Bottom);
+ GraphWindows[2].Right := readinteger('Graphs','FanWidth', 416) +
+ GraphWindows[2].Left;
+ GraphWindows[2].Bottom := readinteger('Graphs','FanHeight', h) +
+ GraphWindows[2].Top;
+
+ GraphWindows[3].Left := readinteger('Graphs','VcoreLeft', 40);
+ GraphWindows[3].Top := readinteger('Graphs','VcoreTop', GraphWindows[2].Bottom);
+ GraphWindows[3].Right := readinteger('Graphs','VcoreWidth', 416) +
+ GraphWindows[3].Left;
+ GraphWindows[3].Bottom := readinteger('Graphs','VcoreHeight', h) +
+ GraphWindows[3].Top;
+
+ GraphWindows[4].Left := readinteger('Graphs','12VLeft', 40);
+ GraphWindows[4].Top := readinteger('Graphs','12VTop', GraphWindows[3].Bottom);
+ GraphWindows[4].Right := readinteger('Graphs','12VWidth', 416) +
+ GraphWindows[4].Left;
+ GraphWindows[4].Bottom := readinteger('Graphs','12VHeight', h) +
+ GraphWindows[4].Top;
+
+ Free;
+ end;
+
+ if fileexists(GetCurrentDir + '\' + SFinifile_name) then with SFinifile do begin
+ SFinifile := Tinifile.Create(GetCurrentDir + '\' + SFinifile_name);
+ SFsettings[0] := ReadInteger('Speedfan','CPU_temp_num',0);
+ SFsettings[1] := ReadInteger('Speedfan','CPU_core0_num',0);
+ SFsettings[2] := ReadInteger('Speedfan','CPU_core1_num',0);
+ SFsettings[3] := ReadInteger('Speedfan','CPU_core2_num',0);
+ SFsettings[4] := ReadInteger('Speedfan','CPU_core3_num',0);
+ SFsettings[5] := ReadInteger('Speedfan','CPU_fan_num',0);
+ SFsettings[6] := ReadInteger('Speedfan','CPU_vcore_num',0);
+ SFsettings[7] := ReadInteger('Speedfan','12V_volt_num',0);
+ Free;
+ end;
+
+ ComboboxRunsChange(Sender);
+ //if SpeedButtonAllMem.Down then SpeedButtonAllMem.Click
+ //else PSandMem(true, ProblemSize, false);
+ ParseCommandLine;
+ TimerMain.Enabled := true;
+ ShowFreeMemory;
+ end
+ else begin
+ MessageBox(Handle, Pchar(msg_noexe),Pchar(progname),MB_OK or MB_ICONSTOP);
+ Application.Terminate;
+ end;
+end;
+
+procedure TFormMain.FormDestroy(Sender: TObject);
+var SFinifile : Tinifile;
+begin
+ if not fileexists(GetCurrentDir + '\' + SFinifile_name) then begin
+ SFinifile := tinifile.Create(GetCurrentDir + '\' + SFinifile_name);
+ try
+ SFinifile.WriteInteger('Speedfan','CPU_temp_num',SFsettings[0]);
+ SFinifile.WriteInteger('Speedfan','CPU_core0_num',SFsettings[1]);
+ SFinifile.WriteInteger('Speedfan','CPU_core1_num',SFsettings[2]);
+ SFinifile.WriteInteger('Speedfan','CPU_core2_num',SFsettings[3]);
+ SFinifile.WriteInteger('Speedfan','CPU_core3_num',SFsettings[4]);
+ SFinifile.WriteInteger('Speedfan','CPU_fan_num',SFsettings[5]);
+ SFinifile.WriteInteger('Speedfan','CPU_vcore_num',SFsettings[6]);
+ SFinifile.WriteInteger('Speedfan','12V_volt_num',SFsettings[7]);
+ finally
+ SFinifile.Free;
+ end;
+ end;
+
+ if Assigned(FormTemps) then FormTemps.Close;
+ if Assigned(FormFans) then FormFans.Close;
+ if Assigned(FormVcores) then FormVcores.Close;
+ if Assigned(FormP12Vs) then FormP12Vs.Close;
+
+ SaveSettingsToINI;
+ Tray0.Free;
+ Tray1.Free;
+ Tray2.Free;
+ Tray3.Free;
+end;
+
+procedure TFormMain.FormKeyPress(Sender: TObject; var Key: Char);
+begin
+ case Key of
+ '0'..'9', #8 : begin end;
+ #27 : begin
+ if SpeedButtonStop.Enabled then SpeedButtonStop.Click;
+ Key := #0;
+ end;
+ #13 : begin
+ if SpeedButtonStart.Enabled then SpeedButtonStart.Click;
+ Key := #0;
+ end
+ else Key := #0;
+ end;
+end;
+
+procedure TFormMain.FormResize(Sender: TObject);
+begin
+ GlassFrame.Bottom := ClientHeight;
+end;
+
+procedure TFormMain.TimerMainTimer(Sender: TObject);
+var tmpstr : string;
+
+ procedure flashpanelontimer;
+ begin
+ ShapeBar.Width := run_time * ShapeBar.Constraints.MaxWidth div total_time;
+ if glass then begin
+ if ShapeBar.Pen.Color <> TangoGreen2 xor $00ffffff
+ then begin
+ ShapeBar.Pen.Color := TangoGreen2 xor $00ffffff;
+ ShapeBase.Pen.Mode := pmNotXor;
+ end
+ else begin
+ ShapeBase.Pen.Mode := pmWhite;
+ if was_error then ShapeBar.Pen.Color := TangoOrange1 xor $00ffffff
+ else
+ if stoponerror then ShapeBar.Pen.Color := TangoGreen1 xor $00ffffff
+ else ShapeBar.Pen.Color := TangoYellow1 xor $00ffffff;
+ end;
+ end
+ else
+ if ShapeBar.Brush.Color <> TangoGreen2 then begin
+ ShapeBar.Brush.Color := TangoGreen2;
+ ShapeBar.Pen.Color := TangoGreen3;
+ ShapeBase.Brush.Color := TangoGray2;
+ end
+ else begin
+ ShapeBase.Brush.Color := TangoGray1;
+ if was_error then begin
+ ShapeBar.Brush.Color := TangoOrange1;
+ ShapeBar.Pen.Color := TangoOrange3;
+ end
+ else
+ if stoponerror then ShapeBar.Brush.Color := TangoGreen1
+ else begin
+ ShapeBar.Brush.Color := TangoYellow1;
+ ShapeBar.Pen.Color := TangoYellow3;
+ end;
+ end;
+ end;
+
+ procedure increasetimecounter;
+ begin
+ if run_time mod 60 = 0 then begin
+ if run_time div 60 = NumberOfMinutes
+ then TerminateProcess(LinpackProcessInfo.hProcess, 5);
+ run_time := round((Now - StartTime) * 86400);
+ end
+ else inc(run_time);
+ end;
+
+begin
+ if speedfan_imp or everest_imp then
+ if Monitoring(everest_imp,speedfan_imp, buildtemps, buildfans, buildvcores,
+ buildp12vs, (time_show_mode < 4), tmpstr) then begin
+ MIGraphs.Enabled := buildtemps or buildfans or buildvcores or buildp12vs;
+ if stoponoverheat and (max_temp > stop_temp) then TerminateProcess(LinpackProcessInfo.hProcess, 6);
+ Statusbar.Panels[4].Text := tmpstr;
+ if time_show_mode < 4 then begin //strange part I must admit
+ if Assigned(FormTemps) and buildtemps then FormTemps.Repaint;
+ if Assigned(FormFans) and buildfans then FormFans.Repaint;
+ if Assigned(FormVcores) and buildvcores then FormVcores.Repaint;
+ if Assigned(FormP12Vs) and buildp12vs then FormP12Vs.Repaint;
+ end;
+ end
+ else begin
+ stoponoverheat := false;
+ Statusbar.Panels[4].Text := str_CPUName;
+ MIGraphs.Enabled := false;
+ max_temp := 0;
+ end;
+
+ case time_show_mode of
+ 0 : increasetimecounter;
+ 1 : begin
+ increasetimecounter;
+ flashpanelontimer;
+ ShowElapsedTime;
+ end;
+ 2 : begin
+ increasetimecounter;
+ flashpanelontimer;
+ ShowEstimatedTime;
+ end;
+ 3 : begin
+ increasetimecounter;
+ flashpanelontimer;
+ ShowFinishTime;
+ end;
+ 4 : ShowFreeMemory;
+ 5 : begin
+ if sound_time mod 3 = 0
+ then PlaySound('LowBatteryAlarm', 0, SND_ALIAS or SND_ASYNC); //what a trick!
+ inc(sound_time);
+ end;
+ end;
+end;
+
+
+procedure TFormMain.MIDisplayClick(Sender: TObject);
+var dummystr : string;
+begin
+ if (everest_imp or speedfan_imp) and Monitoring(everest_imp,
+ speedfan_imp, buildtemps, buildfans, buildvcores, buildp12vs,
+ (time_show_mode < 4), dummystr) then begin
+
+ if buildtemps and not Assigned(FormTemps) then begin
+ FormTemps := TFormGraph.Create(FormMain);
+ with FormTemps do begin
+ Caption := str_temps_capt;
+ Width := GraphWindows[1].Right - GraphWindows[1].Left;
+ Height := GraphWindows[1].Bottom - GraphWindows[1].Top;
+ Left := GraphWindows[1].Left;
+ Top := GraphWindows[1].Top;
+ Show;
+ end;
+ end;
+ if buildfans and not Assigned(FormFans) then begin
+ FormFans := TFormGraph.Create(FormMain);
+ with FormFans do begin
+ Caption := str_fans_capt;
+ Width := GraphWindows[2].Right - GraphWindows[2].Left;
+ Height := GraphWindows[2].Bottom - GraphWindows[2].Top;
+ Left := GraphWindows[2].Left;
+ Top := GraphWindows[2].Top;
+ Show;
+ end;
+ end;
+ if buildvcores and not Assigned(FormVcores) then begin
+ FormVcores := TFormGraph.Create(FormMain);
+ with FormVcores do begin
+ Caption := str_vcores_capt;
+ Width := GraphWindows[3].Right - GraphWindows[3].Left;
+ Height := GraphWindows[3].Bottom - GraphWindows[3].Top;
+ Left := GraphWindows[3].Left;
+ Top := GraphWindows[3].Top;
+ Show;
+ end;
+ end;
+ if buildp12vs and not Assigned(FormP12Vs) then begin
+ FormP12Vs := TFormGraph.Create(FormMain);
+ with FormP12Vs do begin
+ Caption := str_p12vs_capt;
+ Width := GraphWindows[4].Right - GraphWindows[4].Left;
+ Height := GraphWindows[4].Bottom - GraphWindows[4].Top;
+ Left := GraphWindows[4].Left;
+ Top := GraphWindows[4].Top;
+ Show;
+ end;
+ end;
+ SetFocus;
+ end;
+end;
+
+procedure TFormMain.th1Click(Sender: TObject);
+begin
+ NumberOfThreads := SMThreads.IndexOf(sender as tmenuitem) + 1;
+end;
+
+procedure TFormMain.Panel1Click(Sender: TObject);
+begin
+ case time_show_mode of
+ 1 : begin
+ time_show_mode := 2;
+ ShowEstimatedTime;
+ end;
+ 2 : begin
+ time_show_mode := 3;
+ ShowFinishTime;
+ end;
+ 3 : begin
+ time_show_mode := 1;
+ ShowElapsedTime;
+ end;
+ end;
+end;
+
+procedure TFormMain.Panel1DblClick(Sender: TObject);
+begin
+ case time_show_mode of
+ 0: begin
+ time_show_mode := 1;
+ run_time := 0;
+ ShowElapsedTime;
+ end;
+ 1 .. 3 : begin
+ time_show_mode := 0;
+ ShapeBar.Width := 0;
+ LabelStatus.Caption := '';
+ Trayicon.Hint := version;
+ end;
+ 4 : SMFullSettings.Click;
+ 5 .. 6 : begin
+ Time_show_mode := 4;
+ Trayicon.Hint := version;
+ TrayIcon.Icon := Tray1;
+ LabelStatus.Hint := memo_hint3;
+ Caption := version + ' - ' + idle_win_capt;
+ if glass then
+ ShapeBar.Pen.Color := TangoGray2 xor $00FFFFFF
+ else begin
+ ShapeBar.Brush.Color := TangoGray2;
+ ShapeBar.Pen.Color := TangoGray3;
+ ShapeBase.Brush.Color := TangoGray1;
+ end;
+ ShowFreeMemory;
+ end;
+ end;
+end;
+
+procedure TFormMain.SMThreadsClick(Sender: TObject);
+begin
+ if NumberOfThreads <= NumberOfCPUs then begin
+ SMThreads.Items[SMThreads.Count - 1].Visible := false;
+ SMThreads.Items[NumberOfThreads - 1].Checked := true;
+ end
+ else begin
+ SMThreads.Items[SMThreads.Count - 1].Visible := true;
+ SMThreads.Items[SMThreads.Count - 1].Checked := true;
+ end;
+end;
+
+procedure TFormMain.PopupMenuSettingsPopup(Sender: TObject);
+begin
+ if x64mode then begin
+ SM64.Checked := true;
+ SM32.Enabled := x64;
+ end
+ else begin
+ SM32.Checked := true;
+ SM64.Enabled := x64;
+ end;
+ SMStopOnError.Checked := stoponerror;
+ SMSaveLog.Checked := autosavelog;
+ SMSounds.Checked := sounds;
+ SMTrayIcon.Checked := Trayicon.Visible;
+ SMFullSettings.Default := (time_show_mode = 4);
+end;
+
+procedure TFormMain.PopupMenuTrayPopup(Sender: TObject);
+begin
+ if Visible then TMMinimize.Caption := str_tray_hide
+ else TMMinimize.Caption := str_tray_restore;
+ TMStart.Enabled := SpeedButtonStart.Enabled;
+ TMStop.Enabled := SpeedButtonStop.Enabled;
+end;
+
+function Monitoring(b_everest, b_speedfan, b_temps, b_fans, b_vcores, b_p12vs,
+ b_testing : boolean; var infostr : string) : boolean;
+type TSharedMem = packed record
+ version:word;
+ flags :word;
+ MemSize:integer;
+ handle :THandle;
+ NumTemps:word;
+ NumFans :word;
+ NumVolts:word;
+ temps:array[0..31] of integer;
+ fans :array[0..31] of integer;
+ volts:array[0..31] of integer;
+ end;
+ PSharedmem = ^TSharedmem;
+const buf_size = 4096; SF_sharedmem_size = sizeof(TSharedmem);
+var buf : PAnsiChar; tm : byte; i,j : byte; value, v12, vcore: single; fan : integer;
+ id_cpu, tempstr, status_str : string; SFdata : TSharedMem; //SFdataP : PSharedMem;
+
+ Function ExtApp_SharedMem_ReadBuffer(sharedmem_name : pchar; bu: Pointer; bu_size:integer):Boolean;
+ Var mappedData : PansiChar; th : THandle;
+ Begin
+ Result:=False;
+ th:=OpenFileMapping(FILE_MAP_READ,False,sharedmem_name);
+ If th<>INVALID_HANDLE_VALUE Then begin
+ mappedData:=MapViewOfFile(th,FILE_MAP_READ,0,0,0);
+ If mappedData<>Nil Then begin
+ StrLCopy(bu,mappedData,bu_size);
+ If UnmapViewOfFile(mappedData) Then Result:=True;
+ end;
+ CloseHandle(th);
+ end;
+ end;
+
+ function SF_ReadSharedmem (sharedmem_name : pchar; var res : TSharedmem) : boolean;
+ Var mappedData : PSharedmem; th : THandle;
+ begin
+ Result:=False;
+ th:=OpenFileMapping(FILE_MAP_READ,False,sharedmem_name);
+ If th<>INVALID_HANDLE_VALUE Then begin
+ mappedData:=MapViewOfFile(th,FILE_MAP_READ,0,0,SF_sharedmem_size);
+ If mappedData<>Nil Then begin
+ res := mappeddata^;
+ If UnmapViewOfFile(mappedData) Then Result:=True;
+ end;
+ CloseHandle(th);
+ end;
+ end;
+
+ function xmltoval(inputst : string; id : string; var value : single) : boolean;
+ var p,beg,ttl : integer; errcode : integer;
+ begin
+ value := 0;
+ p := pos(id,inputst);
+ if p <> 0 then begin
+ inputst := copy(inputst,p, 128);
+ beg := pos('<v',inputst) + 7;
+ ttl := pos('</v',inputst) - beg;
+ val(copy(inputst,beg,ttl),value,errcode);
+ result := (errcode = 0);
+ end
+ else result := false;
+ end;
+
+begin
+ tm := 0;
+ vcore := 0;
+ fan := 0;
+ v12 := 0;
+ result := false;
+ if b_everest then begin
+ Buf := AllocMem(buf_size + 1);
+ if (ExtApp_SharedMem_ReadBuffer(PChar('EVEREST_SensorValues'),buf,buf_size))
+ then begin
+ result := true;
+
+ tempstr := string(buf);
+
+ for i := 1 to 2 do begin
+ j := 1;
+ id_cpu := format('TCC-%d-%d',[i, j]);
+ while xmltoval(tempstr,id_cpu,value) do begin
+ if value > tm then tm := round(value);
+ inc(j);
+ id_cpu := format('TCC-%d-%d',[i, j]);
+ end;
+ end;
+ if (tm = 0) and (xmltoval(tempstr,'TCPU',value)) then tm := round(value);
+ if tm > max_temp then max_temp := tm;
+
+ status_str := str_CPU;
+ if tm > 0
+ then status_str := format(status_str + ' %d' + str_grad + ' ' + str_sep +
+ ' %d' + str_grad + ' max', [tm, max_temp]);
+ if (xmltoval(tempstr,'VCPU',vcore))
+ then status_str := status_str + ' ' + str_sep + ' ' +
+ floattostrf(vcore,fffixed,4,3) + ' ' + str_volts;
+ if (xmltoval(tempstr,'SCPUCLK',value))
+ then status_str := format(status_str + ' ' + str_sep + ' %d ' + str_mhz,
+ [trunc(value)]);
+
+ if status_str <> str_CPU then infostr := status_str;
+
+ xmltoval(tempstr,'VP12V',v12);
+ xmltoval(tempstr,'FCPU',value);
+ fan := round(value);
+ end;
+ FreeMem(Buf);
+ end
+ else
+ if b_speedfan then begin
+ if ((SFsettings[0] > 0) or (SFsettings[1] > 0) or (SFsettings[2] > 0) or
+ (SFsettings[3] > 0) or (SFsettings[4] > 0) or (SFsettings[5] > 0) or
+ (SFsettings[6] > 0) or (SFsettings[7] > 0)) and
+ SF_readsharedmem(PChar('SFSharedMemory_ALM'),SFdata)
+ then begin
+
+ result := true;
+
+ for I := 1 to 4 do
+ if (SFsettings[i] > 0) and (SFsettings[i] - 1 <= SFdata.NumTemps - 1) and
+ (SFdata.temps[SFsettings[i] - 1] > tm)
+ then tm := SFdata.temps[SFsettings[i] - 1] div 100;
+ if (tm = 0) and (SFsettings[0] > 0) and (SFsettings[0] - 1 <= SFdata.NumTemps - 1)
+ then tm := SFdata.temps[SFsettings[0] - 1] div 100;
+ if tm > max_temp then max_temp := tm;
+
+ status_str := str_CPU;
+ if tm > 0
+ then status_str := format(status_str + ' %d' + str_grad + ' ' + str_sep +
+ ' %d' + str_grad + ' max', [tm, max_temp]);
+ if (SFsettings[6] > 0) and (SFsettings[6] - 1 <= SFdata.NumVolts - 1)
+ then begin
+ vcore := SFdata.volts[SFsettings[6] - 1] / 100;
+ status_str := status_str + ' ' + str_sep + ' ' +
+ floattostrf(vcore,fffixed,3,2) + ' ' + str_volts;
+ end;
+ if status_str <> str_CPU then infostr := status_str;
+
+ if (SFsettings[7] > 0) and (SFsettings[7] - 1 <= SFdata.NumVolts - 1)
+ then v12 := SFdata.volts[SFsettings[7] - 1] / 100;
+ if (SFsettings[5] > 0) and (SFsettings[5] - 1 <= SFdata.NumFans - 1)
+ then fan := SFdata.fans[SFsettings[5] - 1];
+ end;
+ end;
+ if b_testing and result then begin
+ if b_temps and (tm <> 0) then begin
+ if length(temps) - 30 < run_time then setlength(temps, length(temps) + 30);
+ temps[run_time] := tm;
+ temps[run_time + 1] := tm;
+ end;
+ if b_fans and (fan > 0) then begin
+ if length(fans) - 30 < run_time then setlength(fans, length(fans) + 30);
+ fans[run_time] := fan;
+ fans[run_time + 1] := fan;
+ end;
+ if b_vcores and (vcore > 0) then begin
+ if length(vcores) - 30 < run_time then setlength(vcores, length(vcores) + 30);
+ vcores[run_time] := vcore;
+ vcores[run_time + 1] := vcore;
+ end;
+ if b_p12vs and (v12 > 0) then begin
+ if length(p12vs) - 30 < run_time then setlength(p12vs, length(p12vs) + 30);
+ p12vs[run_time] := v12;
+ p12vs[run_time + 1] := v12;
+ end;
+ end;
+end;
+
+procedure TFormMain.MIScreenshotClick(Sender: TObject);
+var filename : string;
+begin
+ if datetimeinnames then filename := AddDateTimeToFilename(progname, 'png', Now)
+ else filename := progname + '.png';
+ WindowScreenShot(Handle, filename);
+end;
+
+procedure TFormMain.MILogClick(Sender: TObject);
+begin
+ SaveLogFile;
+end;
+
+procedure TFormMain.SpeedButtonAllMemClick(Sender: TObject);
+begin
+ ComboBoxMem.Enabled := not SpeedButtonAllMem.Down;
+ ComboBoxPS.Enabled := ComboBoxMem.Enabled;
+ if SpeedButtonAllMem.Down then begin
+ tmpProblemSize := ProblemSize;
+ ComboBoxMem.Text := inttostr(GetFreeMemory - maxmem_offset);
+ PSandMem(false, ProblemSize, false);
+ end
+ else begin
+ ComboBoxPS.Text := inttostr(tmpProblemSize);
+ PSandMem(true, ProblemSize, false);
+ end;
+end;
+
+procedure TFormMain.StatusBarClick(Sender: TObject);
+begin
+ if (Statusbar.ScreenToClient(Mouse.CursorPos).X > 480) and
+ (time_show_mode > 3) and (LinpackLog <> '') then ToggleTableLog;
+end;
+
+function SetWinHeight(curr_count : integer; total_count : integer;
+ def_items_count, min_items_count,
+ row_height : byte; def_win_height : integer) : integer;
+begin
+ if (curr_count > def_items_count) and (curr_count > total_count) then
+ result := def_win_height - row_height *
+ (def_items_count - min_items_count) + (curr_count - def_items_count +
+ min_items_count) * row_height
+ else
+ if (total_count > def_items_count) then
+ result := def_win_height - row_height *
+ (def_items_count - min_items_count) + (total_count - def_items_count +
+ min_items_count) * row_height
+ else result := def_win_height;
+end;
+
+procedure TFormMain.SM32Click(Sender: TObject);
+begin
+ (Sender as TMenuitem).Checked := true;
+ x64mode := SM64.Checked;
+end;
+
+procedure TFormMain.SMStopOnErrorClick(Sender: TObject);
+begin
+ stoponerror := SMStopOnError.Checked;
+end;
+
+procedure TFormMain.SMSavelogClick(Sender: TObject);
+begin
+ autosavelog := SMSaveLog.Checked;
+end;
+
+procedure TFormMain.SMSoundsClick(Sender: TObject);
+begin
+ sounds := SMSounds.Checked;
+end;
+
+procedure TFormMain.SMTrayIconClick(Sender: TObject);
+begin
+ TrayIcon.Visible := SMTrayIcon.Checked;
+end;
+
+procedure TFormMain.MISettingsClick(Sender: TObject);
+var tmpglass : boolean;
+begin
+ tmpglass := glass;
+ FormSett := TFormSett.Create(self);
+ with FormSett do
+ try
+ ShowModal;
+ finally
+ FreeAndNil(FormSett);
+ end;
+ if not (everest_imp or speedfan_imp) then begin
+ Statusbar.Panels[4].Text := str_CPUName;
+ MIGraphs.Enabled := false;
+ end;
+ if glass <> tmpglass then ToggleGlass(glass);
+end;
+
+procedure TFormMain.TMMinimizeClick(Sender: TObject);
+begin
+ if FormMain.Visible then Application.Minimize
+ else begin
+ Application.Restore;
+ If WindowState = wsMinimized then WindowState := wsNormal;
+ Visible := True;
+ Application.BringToFront;
+ end;
+end;
+
+procedure TFormMain.TMStartClick(Sender: TObject);
+begin
+ if SpeedButtonStart.Enabled then SpeedButtonStart.Click;
+end;
+
+procedure TFormMain.TMStopClick(Sender: TObject);
+begin
+ if SpeedButtonStop.Enabled then SpeedButtonStop.Click;
+end;
+
+procedure TFormMain.PSandMem(IsSourceSize : boolean; var PS: integer; showmsg: boolean);
+var mem, maxmem, size : integer;
+
+ procedure addandnotify(var msg : string);
+ begin
+ MessageBox(Handle, Pchar(msg),Pchar(version),MB_OK or
+ MB_ICONEXCLAMATION);
+ if IsSourceSize then begin
+ ComboBoxPS.AddItem(inttostr(size),ComboBoxPS);
+ ComboBoxPS.ItemIndex := ComboBoxPS.Items.Count - 1;
+ ComboBoxPS.Items.Delete(ComboBoxPS.Items.Count - 2);
+ end
+ else begin
+ ComboBoxMem.AddItem(inttostr(mem),ComboBoxMem);
+ ComboBoxMem.ItemIndex := ComboBoxMem.Items.Count - 1;
+ ComboBoxMem.Items.Delete(ComboBoxMem.Items.Count - 2);
+ end;
+ end;
+
+begin
+ mem := 0;
+ size := 0;
+ if IsSourceSize then size := strtointdef(ComboboxPS.Text, 0)
+ else mem := strtointdef(ComboBoxMem.Text, 0);
+ if (size <> 0) or (mem <> 0) then begin
+ if IsSourceSize then begin
+ Mem := sizetomem(size);
+ if showmsg then ComboBoxMem.Text := inttostr(Mem)
+ end
+ else begin
+ size := memtosize(mem);
+ if showmsg then ComboBoxPS.Text := inttostr(size);
+ end;
+ maxmem := GetFreeMemory - maxmem_offset;
+ if mem > maxmem then begin
+ mem := maxmem;
+ size := memtosize(mem);
+ if (not x64mode) and (size > maxsize_lin32) then begin
+ size := maxsize_lin32;
+ Mem := sizetomem(size);
+ if showmsg then addandnotify(msg_mem2048);
+ end
+ else
+ if showmsg then addandnotify(msg_nomem);
+ end
+ else
+ if (not x64mode) and (size > maxsize_lin32) then begin
+ size := maxsize_lin32;
+ Mem := sizetomem(size);
+ if showmsg then addandnotify(msg_mem2048);
+ end;
+ end;
+ PS := size;
+ ComboBoxMem.Text := inttostr(Mem);
+ ComboBoxPS.Text := inttostr(size);
+ if size < MinProblemSize then SpeedButtonStart.Enabled := false
+ else
+ if (NumberOfRuns > 0) and (time_show_mode > 3) then SpeedButtonStart.Enabled := true;
+end;
+
+procedure SaveSettingsToINI;
+var maininifile : tinifile;
+begin
+ with maininifile do begin
+ maininifile := tinifile.Create(GetCurrentDir + '\' + maininifile_name);
+ try
+ writeinteger('Window','Top',FormMain.Top);
+ writeinteger('Window','Left',FormMain.Left);
+ writeinteger('Window','ClientHeight',FormMain.ClientHeight);
+ writebool('Settings','UseAllMem',FormMain.SpeedButtonAllMem.Down);
+ writebool('Settings','StopOnError',stoponerror);
+ writebool('Settings','AutoSaveLog', autosavelog);
+ writebool('Settings','StopOnOverheat',stoponoverheat);
+ writeinteger('Settings','OverheatValue',stop_temp);
+ writebool('Settings','EnableSounds',sounds);
+ writebool('Settings', 'GlassEffect', glass);
+ writebool('Settings','ShowHints',FormMain.ShowHint);
+ writebool('Settings','TrayIcon',FormMain.Trayicon.Visible);
+ writebool('Settings','DateTimeInFilenames',datetimeinnames);
+ writebool('Settings','EverestImport',everest_imp);
+ writebool('Settings','SpeedfanImport',speedfan_imp);
+ writebool('Settings', 'TempGraph', buildtemps);
+ writebool('Settings', 'FanGraph', buildfans);
+ writebool('Settings', 'VcoreGraph', buildvcores);
+ writebool('Settings', 'P12VGraph', buildp12vs);
+
+ writeinteger('Advanced','MaximumSizeForLinpack32',maxsize_lin32);
+ writeinteger('Advanced','MaxmemFromFreememOffset',maxmem_offset);
+ writeinteger('Advanced','LastLogicalCPUs',NumberOfCPUs);
+
+ writeinteger('Linpack','ProblemSize',ProblemSize);
+ writeinteger('Linpack','TimesToRun',NumberOfRuns);
+ writeinteger('Linpack','MinutesToRun',NumberOfMinutes);
+ writebool('Linpack','UseOptimizedLeadingDimensions',useoptld);
+ writeinteger('Linpack','DataAlignment',dataalign);
+ writeinteger('Linpack','NumberOfThreads',NumberOfThreads);
+ writebool('Linpack','x64',x64mode);
+ writeinteger('Linpack','Priority',lin_priority);
+
+ writeinteger('Graphs','TempLeft', GraphWindows[1].Left);
+ writeinteger('Graphs','TempTop', GraphWindows[1].Top);
+ writeinteger('Graphs','TempWidth', GraphWindows[1].Right -
+ GraphWindows[1].Left);
+ writeinteger('Graphs','TempHeight', GraphWindows[1].Bottom -
+ GraphWindows[1].Top);
+
+ writeinteger('Graphs','FanLeft', GraphWindows[2].Left);
+ writeinteger('Graphs','FanTop', GraphWindows[2].Top);
+ writeinteger('Graphs','FanWidth', GraphWindows[2].Right -
+ GraphWindows[2].Left);
+ writeinteger('Graphs','FanHeight', GraphWindows[2].Bottom -
+ GraphWindows[2].Top);
+
+ writeinteger('Graphs','VcoreLeft', GraphWindows[3].Left);
+ writeinteger('Graphs','VoreTop', GraphWindows[3].Top);
+ writeinteger('Graphs','VcoreWidth', GraphWindows[3].Right -
+ GraphWindows[3].Left);
+ writeinteger('Graphs','VcoreHeight', GraphWindows[3].Bottom -
+ GraphWindows[3].Top);
+
+ writeinteger('Graphs','12VLeft', GraphWindows[4].Left);
+ writeinteger('Graphs','12VTop', GraphWindows[4].Top);
+ writeinteger('Graphs','12VWidth', GraphWindows[4].Right -
+ GraphWindows[4].Left);
+ writeinteger('Graphs','12VHeight', GraphWindows[4].Bottom -
+ GraphWindows[4].Top);
+ free;
+ except
+ free;
+ end;
+ end;
+end;
+
+procedure TFormMain.ShowFreeMemory;
+var freemem : integer;
+begin
+ freemem := GetFreeMemory;
+ ShapeBar.Width := freemem * (ShapeBase.Width - 4) div total_mem;
+ LabelStatus.Caption := format(str_freemem + ' %d ' + str_mib, [freemem]);
+end;
+
+procedure TFormMain.ShowElapsedTime;
+var timestr : string;
+begin
+ timestr := str_elapsed + Format(' %d:%.2d:%.2d', [run_time div 3600,
+ (run_time mod 3600) div 60, run_time mod 60]);
+ LabelStatus.Caption := timestr;
+ if TrayIcon.Visible then Trayicon.Hint := timestr + ' - ' + version;
+end;
+
+procedure TFormMain.ShowEstimatedTime;
+var timestr : string;
+begin
+ if ShapeBar.Visible then begin
+ timestr := str_remaining + Format(' %d:%.2d:%.2d', [(total_time - run_time) div 3600,
+ ((total_time - run_time) mod 3600) div 60, (total_time - run_time) mod 60]);
+ if TrayIcon.Visible then Trayicon.Hint := timestr + ' - ' + version;
+ end
+ else begin
+ timestr := str_wait;
+ if TrayIcon.Visible then Trayicon.Hint := version;
+ end;
+ LabelStatus.Caption := timestr;
+end;
+
+procedure TFormMain.ShowFinishTime;
+var timestr : string;
+begin
+ if ShapeBar.Visible then begin
+ timestr := str_finish_time + FormatDateTime(' dddd, t', StartTime + total_time / 86400);
+ if TrayIcon.Visible then Trayicon.Hint := timestr + ' - ' + version;
+ end
+ else begin
+ timestr := str_wait;
+ if TrayIcon.Visible then Trayicon.Hint := version;
+ end;
+ LabelStatus.Caption := timestr;
+end;
+
+procedure SaveLogFile;
+var filename : string;
+begin
+ if datetimeinnames then filename := AddDateTimeToFilename(progname, 'log', StartTime)
+ else filename := progname + '.log';
+ with TFileStream.Create(filename, fmCreate) do
+ try
+ Write(Pointer(LinpackLog)^, Length(LinpackLog) * Sizeof(LinpackLog[1]));
+ finally
+ Free;
+ end;
+end;
+
+function GetThreadsString(threads : byte) : string;
+begin
+ if (threads mod 10 = 1) and (threads <> 11) then result := format('%d ' + str_thread, [threads])
+ else
+ if (threads mod 10 < 5) and (threads >= 22) then result := format('%d ' + str_threads, [threads])
+ else result := format('%d ' + str_threadsalt, [threads]);
+end;
+
+procedure TFormMain.ToggleGlass(enable : boolean);
+begin
+ if enable and CompositingEnabled then begin
+ DoubleBuffered := true;
+ GlassFrame.Enabled := true;
+ SpeedButtonAllMem.Flat := false;
+ Glassframe.Bottom := ClientHeight;
+ ListViewTable.Columns.BeginUpdate;
+ ListViewTable.Columns.EndUpdate;
+ LabelPS.GlowSize := 8;
+ LabelMem.GlowSize := 8;
+ LabelRuns.GlowSize := 8;
+ LabelStatus.GlowSize := 8;
+ ShapeBase.Brush.Style := bsClear;
+ ShapeBase.Pen.Mode := pmWhite;
+ ShapeBar.Top := ShapeBar.Top + 1;
+ ShapeBar.Left := ShapeBar.Left + 1;
+ ShapeBar.Height := ShapeBar.Height - 2;
+ ShapeBar.Width := ShapeBar.Width - 2;
+ ShapeBar.Constraints.MaxWidth := ShapeBar.Constraints.MaxWidth - 2;
+ ShapeBar.Pen.Color := ShapeBar.Brush.Color xor $00ffffff;
+ ShapeBar.Brush.Style := bsClear;
+ ShapeBar.Pen.Mode := pmNotXor;
+ ShapeBar.Pen.Width := 11;
+ SpeedButtonAllMem.Layout := blGlyphLeft;
+ SpeedButtonStart.Left := SpeedButtonStart.Left - 5;
+ SpeedButtonStart.Width := SpeedButtonStart.Width + 5;
+ SpeedButtonStop.Width := SpeedButtonStop.Width + 5;
+ LabelPS.Left := LabelPS.Left - 3;
+ ComboboxPS.Left := ComboboxPS.Left - 3;
+ LabelRuns.Left := LabelRuns.Left + 4;
+ ComboboxRuns.Left := ComboboxRuns.Left + 4;
+ ComboboxTimesMinutes.Left := ComboboxTimesMinutes.Left + 4;
+ ComboboxTimesMinutes.Style := csDropDown;
+ OnResize := FormResize;
+ end
+ else begin
+ DoubleBuffered := false;
+ GlassFrame.Enabled := false;
+ SpeedButtonAllMem.Flat := true;
+ Glassframe.Bottom := 0;
+ LabelPS.GlowSize := 0;
+ LabelMem.GlowSize := 0;
+ LabelRuns.GlowSize := 0;
+ LabelStatus.GlowSize := 0;
+ ShapeBase.Brush.Style := bsSolid;
+ ShapeBase.Pen.Mode := pmCopy;
+ ShapeBar.Top := ShapeBar.Top - 1;
+ ShapeBar.Left := ShapeBar.Left - 1;
+ ShapeBar.Height := ShapeBar.Height + 2;
+ ShapeBar.Constraints.MaxWidth := ShapeBar.Constraints.MaxWidth + 2;
+ ShapeBar.Width := ShapeBar.Width + 2;
+ ShapeBar.Brush.Style := bsSolid;
+ ShapeBar.Brush.Color := ShapeBar.Pen.Color xor $00ffffff;
+ ShapeBar.Pen.Mode := pmCopy;
+ ShapeBar.Pen.Width := 1;
+ SpeedButtonAllMem.Layout := blGlyphTop;
+ SpeedButtonStart.Left := SpeedButtonStart.Left + 5;
+ SpeedButtonStart.Width := SpeedButtonStart.Width - 5;
+ SpeedButtonStop.Width := SpeedButtonStop.Width - 5;
+ LabelPS.Left := LabelPS.Left + 3;
+ ComboboxPS.Left := ComboboxPS.Left + 3;
+ LabelRuns.Left := LabelRuns.Left - 4;
+ ComboboxRuns.Left := ComboboxRuns.Left - 4;
+ ComboboxTimesMinutes.Left := ComboboxTimesMinutes.Left - 4;
+ ComboboxTimesMinutes.Style := csDropDownList;
+ OnResize := nil;
+ if time_show_mode = 4 then begin
+ ShapeBar.Pen.Color := TangoGray3;
+ ShapeBase.Brush.Color := TangoGray1;
+ end;
+ end;
+ ComboboxPS.Repaint;
+ ComboboxMem.Repaint;
+ ComboboxRuns.Repaint;
+ ComboboxTimesMinutes.Repaint;
+end;
+
+{procedure TFormMain.ToggleMenu(enable : boolean);
+begin
+ if enable then begin
+ Menu := MainMenu;
+ GlassFrame.SheetOfGlass := false;
+ if glass then OnResize := FormResize;
+ end
+ else begin
+ Menu := nil;
+ if glass then GlassFrame.SheetOfGlass := true;
+ OnResize := nil;
+ end;
+end;}
+
+procedure TFormMain.OnMinimize(Sender : TObject);
+begin
+ if TrayIcon.Visible then Visible := false;
+end;
+
+end.
diff --git a/UnitSett.dfm b/UnitSett.dfm
new file mode 100644
index 0000000..d3049a5
--- /dev/null
+++ b/UnitSett.dfm
@@ -0,0 +1,619 @@
+object FormSett: TFormSett
+ Left = 0
+ Top = 0
+ BorderStyle = bsToolWindow
+ Caption = 'Settings'
+ ClientHeight = 275
+ ClientWidth = 395
+ Color = clBtnFace
+ ParentFont = True
+ KeyPreview = True
+ OldCreateOrder = False
+ Position = poMainFormCenter
+ ShowHint = True
+ OnCreate = FormCreate
+ OnKeyDown = FormKeyDown
+ OnKeyPress = FormKeyPress
+ PixelsPerInch = 96
+ TextHeight = 13
+ object ButtonOK: TSpeedButton
+ Left = 120
+ Top = 245
+ Width = 75
+ Height = 25
+ Hint = 'Enter'
+ Caption = 'OK'
+ OnClick = ButtonOKClick
+ end
+ object ButtonCancel: TSpeedButton
+ Left = 200
+ Top = 245
+ Width = 75
+ Height = 25
+ Hint = 'Esc'
+ Caption = 'Cancel'
+ OnClick = ButtonCancelClick
+ end
+ object PanelLinpack: TPanel
+ Left = 5
+ Top = 5
+ Width = 190
+ Height = 165
+ BevelKind = bkFlat
+ BevelOuter = bvNone
+ Caption = 'Linpack'
+ FullRepaint = False
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clGrayText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ TabOrder = 0
+ VerticalAlignment = taAlignTop
+ object Label1: TLabel
+ Left = 5
+ Top = 43
+ Width = 94
+ Height = 13
+ Hint =
+ 'Here you can change the number of threads Linpack creates. This ' +
+ 'is also the number of cores that will be used'
+ Caption = 'Number of threads:'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ end
+ object Label2: TLabel
+ Left = 5
+ Top = 93
+ Width = 102
+ Height = 13
+ Hint =
+ 'Arrays of data during execution of Linpack will be aligned to th' +
+ 'is value. 4 is optimal, 0 means no alignment'
+ Caption = 'Data Alignment (KiB):'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ end
+ object Label5: TLabel
+ Left = 5
+ Top = 21
+ Width = 30
+ Height = 13
+ Hint =
+ '64-bit Linpack is more stressful than 32-bit one and has no memo' +
+ 'ry limitations. Consider using it when on a 64-bit OS'
+ Caption = 'Mode:'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ end
+ object Label6: TLabel
+ Left = 5
+ Top = 68
+ Width = 64
+ Height = 13
+ Hint =
+ 'Linpack'#39's priority level. Lowering this value will make the syst' +
+ 'em more '#8222'responsive'#8220' during testing. Values higher than Normal a' +
+ 're not recommended'
+ Caption = 'Priority class:'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ end
+ object Label3: TLabel
+ Left = 5
+ Top = 118
+ Width = 137
+ Height = 13
+ Hint =
+ 'This is the maximum Problem Size suitable for 32-bit Linpack (fo' +
+ 'und empirically). Change it only if you have problems starting L' +
+ 'inpack'
+ Caption = 'Linpack32 max Problem Size:'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ end
+ object Label4: TLabel
+ Left = 5
+ Top = 143
+ Width = 103
+ Height = 13
+ Hint =
+ 'This is how much physical memory will be left for OS'#39' needs when' +
+ ' using all available memory. Don'#39't set this too low'
+ Caption = 'Memory for OS (MiB):'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ end
+ object CBPriority: TComboBox
+ Left = 70
+ Top = 65
+ Width = 115
+ Height = 21
+ Style = csDropDownList
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ItemHeight = 13
+ ItemIndex = 2
+ ParentFont = False
+ TabOrder = 4
+ Text = 'Normal'
+ Items.Strings = (
+ 'Idle'
+ 'Below normal'
+ 'Normal'
+ 'Above normal'
+ 'High'
+ 'Real-time')
+ end
+ object EditThreads: TEdit
+ Left = 150
+ Top = 40
+ Width = 19
+ Height = 21
+ Alignment = taCenter
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ MaxLength = 3
+ NumbersOnly = True
+ ParentFont = False
+ TabOrder = 2
+ Text = '1'
+ end
+ object EditDA: TEdit
+ Left = 150
+ Top = 90
+ Width = 19
+ Height = 21
+ Alignment = taCenter
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ MaxLength = 2
+ NumbersOnly = True
+ ParentFont = False
+ TabOrder = 5
+ Text = '4'
+ end
+ object RB32: TRadioButton
+ Left = 70
+ Top = 20
+ Width = 50
+ Height = 15
+ Caption = '32-bit'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clGrayText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ TabOrder = 0
+ end
+ object RB64: TRadioButton
+ Left = 135
+ Top = 20
+ Width = 50
+ Height = 15
+ Caption = '64-bit'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clGrayText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ TabOrder = 1
+ end
+ object UpDownThreads: TUpDown
+ Left = 169
+ Top = 40
+ Width = 16
+ Height = 21
+ Associate = EditThreads
+ Min = 1
+ Max = 255
+ Position = 1
+ TabOrder = 3
+ end
+ object UpDownDA: TUpDown
+ Left = 169
+ Top = 90
+ Width = 16
+ Height = 21
+ Associate = EditDA
+ Max = 64
+ Position = 4
+ TabOrder = 6
+ end
+ object EditLin32Max: TEdit
+ Left = 145
+ Top = 115
+ Width = 40
+ Height = 21
+ Alignment = taCenter
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ MaxLength = 5
+ NumbersOnly = True
+ ParentFont = False
+ TabOrder = 7
+ end
+ object EditMemForOS: TEdit
+ Left = 145
+ Top = 140
+ Width = 40
+ Height = 21
+ Alignment = taCenter
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ MaxLength = 3
+ NumbersOnly = True
+ ParentFont = False
+ TabOrder = 8
+ end
+ end
+ object PanelLinX: TPanel
+ Left = 200
+ Top = 5
+ Width = 190
+ Height = 165
+ BevelKind = bkFlat
+ BevelOuter = bvNone
+ Caption = 'LinX'
+ FullRepaint = False
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clGrayText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ TabOrder = 1
+ VerticalAlignment = taAlignTop
+ object CheckBoxGlass: TCheckBox
+ Left = 5
+ Top = 120
+ Width = 180
+ Height = 15
+ Hint =
+ 'When checked, Aero glass will be extended to windows'#39' client are' +
+ 'a'
+ Caption = 'Extend glass (Aero only)'
+ Checked = True
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ State = cbChecked
+ TabOrder = 5
+ end
+ object CheckBoxIcon: TCheckBox
+ Left = 5
+ Top = 80
+ Width = 180
+ Height = 15
+ Hint =
+ 'When checked, tray icon will be displayed and LinX will be minim' +
+ 'ized to tray'
+ Caption = 'Tray icon'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ TabOrder = 3
+ end
+ object CheckBoxSounds: TCheckBox
+ Left = 5
+ Top = 60
+ Width = 180
+ Height = 15
+ Hint =
+ 'When checked, LinX will play corresponding sounds upon error/suc' +
+ 'cessful pass'
+ Caption = 'Sounds'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ TabOrder = 2
+ end
+ object CheckBoxStop: TCheckBox
+ Left = 5
+ Top = 20
+ Width = 180
+ Height = 15
+ Hint =
+ 'When checked, testing will stop once an error is detected (recom' +
+ 'mended)'
+ Caption = 'Stop on error'
+ Checked = True
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ State = cbChecked
+ TabOrder = 0
+ end
+ object CheckBoxLog: TCheckBox
+ Left = 5
+ Top = 40
+ Width = 180
+ Height = 15
+ Hint =
+ 'When checked, LinX will automatically save output log after ever' +
+ 'y single test'
+ Caption = 'Auto-save log'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ TabOrder = 1
+ end
+ object CheckBoxFilenames: TCheckBox
+ Left = 5
+ Top = 100
+ Width = 180
+ Height = 15
+ Hint =
+ 'When checked, all screenshots and logs will have date and time a' +
+ 'ppended to their filenames'
+ Caption = 'Date/time in filenames'
+ Checked = True
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ State = cbChecked
+ TabOrder = 4
+ end
+ object CheckBoxShowHints: TCheckBox
+ Left = 5
+ Top = 140
+ Width = 180
+ Height = 15
+ Hint = 'When checked, show pop-up hints, just like this one'
+ Caption = 'Show hints'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ TabOrder = 6
+ end
+ end
+ object PanelExtApps: TPanel
+ Left = 5
+ Top = 175
+ Width = 385
+ Height = 65
+ BevelKind = bkFlat
+ BevelOuter = bvNone
+ Caption = 'External Applications And Graphs'
+ FullRepaint = False
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clGrayText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ TabOrder = 2
+ VerticalAlignment = taAlignTop
+ object LabelGraphs: TLabel
+ Left = 5
+ Top = 45
+ Width = 38
+ Height = 13
+ Hint = 'Select, what graphs to create during testing'
+ Caption = 'Graphs:'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ end
+ object CheckBoxTemp: TCheckBox
+ Left = 200
+ Top = 20
+ Width = 140
+ Height = 15
+ Hint =
+ 'When checked, testing will stop if CPU temp exceeds the specifie' +
+ 'd one'
+ Caption = 'Maximum allowed T ('#176'C):'
+ Enabled = False
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ TabOrder = 3
+ end
+ object EditTemp: TEdit
+ Left = 340
+ Top = 18
+ Width = 24
+ Height = 21
+ Alignment = taCenter
+ Enabled = False
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ MaxLength = 3
+ NumbersOnly = True
+ ParentFont = False
+ TabOrder = 4
+ Text = '75'
+ end
+ object RBEverest: TRadioButton
+ Left = 60
+ Top = 20
+ Width = 65
+ Height = 15
+ Caption = 'Everest'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ TabOrder = 1
+ OnClick = RBEverestClick
+ end
+ object RBNone: TRadioButton
+ Left = 5
+ Top = 20
+ Width = 55
+ Height = 15
+ Caption = 'None'
+ Checked = True
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ TabOrder = 0
+ TabStop = True
+ OnClick = RBNoneClick
+ end
+ object RBSpeedfan: TRadioButton
+ Left = 125
+ Top = 20
+ Width = 65
+ Height = 15
+ Caption = 'Speedfan'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ TabOrder = 2
+ OnClick = RBEverestClick
+ end
+ object UpDownTemp: TUpDown
+ Left = 364
+ Top = 18
+ Width = 16
+ Height = 21
+ Associate = EditTemp
+ Enabled = False
+ Max = 125
+ Position = 75
+ TabOrder = 5
+ end
+ object CheckBoxCPUTemp: TCheckBox
+ Left = 60
+ Top = 45
+ Width = 85
+ Height = 15
+ Caption = 'CPU Temp'
+ Enabled = False
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ TabOrder = 6
+ end
+ object CheckBoxCPUFan: TCheckBox
+ Left = 150
+ Top = 45
+ Width = 85
+ Height = 15
+ Caption = 'CPU Fan'
+ Enabled = False
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ TabOrder = 7
+ end
+ object CheckBoxCPUVcore: TCheckBox
+ Left = 240
+ Top = 45
+ Width = 85
+ Height = 15
+ Caption = 'CPU Vcore'
+ Enabled = False
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ TabOrder = 8
+ end
+ object CheckBox12V: TCheckBox
+ Left = 330
+ Top = 45
+ Width = 50
+ Height = 15
+ Caption = '+12 V'
+ Enabled = False
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ TabOrder = 9
+ end
+ end
+end
diff --git a/UnitSett.pas b/UnitSett.pas
new file mode 100644
index 0000000..1074a3c
--- /dev/null
+++ b/UnitSett.pas
@@ -0,0 +1,338 @@
+{$STRINGCHECKS OFF}
+unit UnitSett;
+
+interface
+
+uses
+ Windows, {Messages,} SysUtils, {Variants,} Classes, {Graphics,} Controls, Forms,
+ {Dialogs,} StdCtrls, Spin, ComCtrls, IniFiles, Buttons, ExtCtrls;
+
+type
+ TFormSett = class(TForm)
+ Label1: TLabel;
+ Label2: TLabel;
+ Label3: TLabel;
+ EditLin32Max: TEdit;
+ Label4: TLabel;
+ EditMemForOS: TEdit;
+ CheckBoxGlass: TCheckBox;
+ CheckBoxIcon: TCheckBox;
+ CheckBoxSounds: TCheckBox;
+ Label5: TLabel;
+ RB32: TRadioButton;
+ RB64: TRadioButton;
+ CheckBoxStop: TCheckBox;
+ CheckBoxTemp: TCheckBox;
+ EditThreads: TEdit;
+ UpDownThreads: TUpDown;
+ UpDownDA: TUpDown;
+ EditDA: TEdit;
+ EditTemp: TEdit;
+ UpDownTemp: TUpDown;
+ CheckBoxLog: TCheckBox;
+ RBNone: TRadioButton;
+ RBEverest: TRadioButton;
+ RBSpeedfan: TRadioButton;
+ CBPriority: TComboBox;
+ Label6: TLabel;
+ CheckBoxFilenames: TCheckBox;
+ ButtonOK: TSpeedButton;
+ ButtonCancel: TSpeedButton;
+ PanelLinpack: TPanel;
+ PanelLinX: TPanel;
+ CheckBoxShowHints: TCheckBox;
+ PanelExtApps: TPanel;
+ LabelGraphs: TLabel;
+ CheckBoxCPUTemp: TCheckBox;
+ CheckBoxCPUFan: TCheckBox;
+ CheckBoxCPUVcore: TCheckBox;
+ CheckBox12V: TCheckBox;
+ procedure ButtonOKClick(Sender: TObject);
+ procedure ButtonCancelClick(Sender: TObject);
+ procedure FormCreate(Sender: TObject);
+ procedure RBNoneClick(Sender: TObject);
+ procedure RBEverestClick(Sender: TObject);
+ procedure FormKeyPress(Sender: TObject; var Key: Char);
+ procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ end;
+
+var
+ FormSett: TFormSett;
+
+implementation
+
+uses UnitMain, LinX_routines;
+
+{$R *.dfm}
+
+procedure TFormSett.ButtonOKClick(Sender: TObject);
+begin
+ NumberOfThreads := UpdownThreads.Position;
+
+ maxsize_lin32 := strtointdef(EditLin32Max.Text, maxsize_lin32);
+ maxmem_offset := strtointdef(EditMemForOS.Text, maxmem_offset);
+
+ lin_priority := CBPriority.ItemIndex;
+ dataalign := UpdownDA.Position;
+ x64mode := RB64.Checked;
+ stoponerror := checkboxStop.Checked;
+ autosavelog := checkboxLog.Checked;
+ sounds := checkboxSounds.Checked;
+ datetimeinnames := CheckboxFilenames.Checked;
+ FormMain.TrayIcon.Visible := checkboxIcon.Checked;
+ glass := checkboxGlass.Checked;
+ FormMain.ShowHint := CheckBoxShowHints.Checked;
+
+ stoponoverheat := checkboxTemp.Checked;
+ if not stoponoverheat then stop_temp := 0;
+
+ stop_temp := UpdownTemp.Position;
+
+ speedfan_imp := RBSpeedfan.Checked;
+ everest_imp := RBEverest.Checked;
+
+ buildtemps := CheckBoxCPUTemp.Checked;
+ buildfans := CheckBoxCPUFan.Checked;
+ buildvcores := CheckBoxCPUVcore.Checked;
+ buildp12vs := CheckBox12V.Checked;
+
+ Close;
+end;
+
+procedure TFormSett.ButtonCancelClick(Sender: TObject);
+begin
+ Close;
+end;
+
+procedure TFormSett.FormCreate(Sender: TObject);
+
+ procedure localize;
+ var localizationfile : tinifile;
+ begin
+ With localizationfile do begin
+ localizationfile := tinifile.Create(ExtractFilePath(Application.EXEName) +
+ localizationfile_name);
+
+ Caption := readstring('SettingsWindow','Caption',Caption);
+ Label5.Caption := readstring('SettingsWindow','Mode',
+ Label5.Caption);
+ Label5.Hint := readstring('SettingsWindow','ModeHint',
+ Label5.Hint);
+ RB32.Caption := readstring('MeasUnits','32',RB32.Caption);
+ RB64.Caption := readstring('MeasUnits','64',RB64.Caption);
+ Label1.Caption := readstring('SettingsWindow','NumberOfThreads',
+ Label1.Caption);
+ Label1.Hint := readstring('SettingsWindow','NumberOfThreadsHint',
+ Label1.Hint);
+ Label6.Caption := readstring('SettingsWindow','PriorityClass',
+ Label6.Caption);
+ Label6.Hint := readstring('SettingsWindow','PriorityClassHint',
+ Label6.Hint);
+ CBPriority.Items[0] := readstring('SettingsWindow','Idle',
+ CBPriority.Items[0]);
+ CBPriority.Items[1] := readstring('SettingsWindow','BelowNormal',
+ CBPriority.Items[1]);
+ CBPriority.Items[2] := readstring('SettingsWindow','Normal',
+ CBPriority.Items[2]);
+ CBPriority.Items[3] := readstring('SettingsWindow','AboveNormal',
+ CBPriority.Items[3]);
+ CBPriority.Items[4] := readstring('SettingsWindow','High',
+ CBPriority.Items[4]);
+ CBPriority.Items[5] := readstring('SettingsWindow','Realtime',
+ CBPriority.Items[5]);
+ Label2.Caption := readstring('SettingsWindow','DataAlignment',
+ Label2.Caption);
+ Label2.Hint := readstring('SettingsWindow','DataAlignmentHint',
+ Label2.Hint);
+ Label3.Caption := readstring('SettingsWindow','Lin32MaxProblemSize',
+ Label3.Caption);
+ Label3.Hint := readstring('SettingsWindow','Lin32MaxProblemSizeHint',
+ Label3.Hint);
+ Label4.Caption := readstring('SettingsWindow','MemoryToLeave',
+ Label4.Caption);
+ Label4.Hint := readstring('SettingsWindow','MemoryToLeaveHint',
+ Label4.Hint);
+ CheckboxGlass.Caption := readstring('SettingsWindow','ExtendGlass',
+ CheckboxGlass.Caption);
+ CheckboxGlass.Hint := readstring('SettingsWindow','ExtendGlassHint',
+ CheckboxGlass.Hint);
+ CheckboxStop.Caption := readstring('SettingsWindow','StopOnError',
+ CheckboxStop.Caption);
+ CheckboxStop.Hint := readstring('SettingsWindow','StopOnErrorHint',
+ CheckboxStop.Hint);
+ CheckboxLog.Caption := readstring('SettingsWindow','AutoSaveLog',
+ CheckboxLog.Caption);
+ CheckboxLog.Hint := readstring('SettingsWindow','AutoSaveLogHint',
+ CheckboxLog.Hint);
+ CheckboxSounds.Caption := readstring('SettingsWindow','Sounds',
+ CheckboxSounds.Caption);
+ CheckboxSounds.Hint := readstring('SettingsWindow','SoundsHint',
+ CheckboxSounds.Hint);
+ CheckboxIcon.Caption := readstring('SettingsWindow','TrayIcon',
+ CheckboxIcon.Caption);
+ CheckboxIcon.Hint := readstring('SettingsWindow','TrayIconHint',
+ CheckboxIcon.Hint);
+ CheckBoxShowHints.Caption := readstring('SettingsWindow','ShowHints',
+ CheckBoxShowHints.Caption);
+ CheckBoxShowHints.Hint := readstring('SettingsWindow','ShowHintsHint',
+ CheckBoxShowHints.Hint);
+ CheckboxFilenames.Caption := readstring('SettingsWindow','Filenames',
+ CheckboxFilenames.Caption);
+ CheckboxFilenames.Hint := readstring('SettingsWindow','FilenamesHint',
+ CheckboxFilenames.Hint);
+
+ PanelExtApps.Caption := readstring('SettingsWindow','ExtAppsBox',
+ PanelExtApps.Caption);
+ CheckboxTemp.Caption := readstring('SettingsWindow','MaxTemp',
+ CheckboxTemp.Caption);
+ CheckboxTemp.Hint := readstring('SettingsWindow','MaxTempHint',
+ CheckboxTemp.Hint);
+ RBNone.Caption := readstring('SettingsWindow','None',
+ RBNone.Caption);
+ LabelGraphs.Caption := readstring('SettingsWindow','Graphs',
+ LabelGraphs.Caption);
+ LabelGraphs.Hint := readstring('SettingsWindow','GraphsHint',
+ LabelGraphs.Hint);
+ CheckBoxCPUTemp.Caption := readstring('SettingsWindow','CPUTemp',
+ CheckBoxCPUTemp.Caption);
+ CheckBoxCPUFan.Caption := readstring('SettingsWindow','CPUFan',
+ CheckBoxCPUFan.Caption);
+ CheckBoxCPUVcore.Caption := readstring('SettingsWindow','CPUVcore',
+ CheckBoxCPUVcore.Caption);
+
+ ButtonOK.Caption := readstring('SettingsWindow','ButtonOK',
+ ButtonOK.Caption);
+ ButtonCancel.Caption := readstring('SettingsWindow','ButtonCancel',
+ ButtonCancel.Caption);
+ free;
+ end;
+ end;
+
+begin
+ if fileexists(localizationfile_name) then localize;
+ CBPriority.Left := Label6.Left + Label6.Width + 5;
+ CBPriority.Width := PanelLinpack.Width - CBPriority.Left - 5;
+
+ if glass and (Win32MajorVersion >= 6) and CompositingEnabled then begin
+ DoubleBuffered := true;
+ PanelLinpack.BevelKind := bkNone;
+ PanelLinpack.BevelOuter := bvRaised;
+ PanelLinX.BevelKind := bkNone;
+ PanelLinX.BevelOuter := bvRaised;
+ PanelExtApps.BevelKind := bkNone;
+ PanelExtApps.BevelOuter := bvRaised;
+ PanelLinpack.Left := PanelLinpack.Left - 5;
+ PanelLinpack.Top := PanelLinpack.Top - 5;
+ PanelLinX.Left := PanelLinX.Left - 5;
+ PanelLinX.Top := PanelLinX.Top - 5;
+ PanelExtApps.Top := PanelExtApps.Top - 5;
+ PanelExtApps.Left := PanelExtApps.Left - 5;
+ ButtonOK.Top := ButtonOK.Top - 5;
+ ButtonOK.Left := ButtonOK.Left - 5;
+ ButtonCancel.Top := ButtonCancel.Top - 5;
+ ButtonCancel.Left := ButtonCancel.Left - 5;
+ ClientWidth := ClientWidth - 10;
+ ClientHeight := ClientHeight - 10;
+ GlassFrame.Enabled := true;
+ GlassFrame.SheetOfGlass := true;
+ end;
+
+ UpDownThreads.Position := NumberOfThreads;
+ UpDownDA.Position := dataalign;
+
+ if x64mode then begin
+ RB64.Checked := true;
+ RB32.Enabled := x64;
+ end
+ else begin
+ RB32.Checked := true;
+ RB64.Enabled := x64;
+ end;
+
+ CBPriority.ItemIndex := lin_priority;
+
+ EditLin32Max.Text := inttostr(maxsize_lin32);
+ EditMemForOS.Text := inttostr(maxmem_offset);
+
+ checkboxStop.Checked := stoponerror;
+ checkboxLog.Checked := autosavelog;
+ checkboxSounds.Checked := sounds;
+ CheckboxIcon.Checked := FormMain.TrayIcon.Visible;
+ CheckboxFilenames.Checked := datetimeinnames;
+ CheckboxGlass.Enabled := (Win32MajorVersion >= 6) and CompositingEnabled;
+ CheckboxGlass.Checked := glass;
+ ShowHint := FormMain.ShowHint;
+ CheckBoxShowHints.Checked := ShowHint;
+
+ RBEverest.Checked := everest_imp;
+ RBSpeedfan.Checked := speedfan_imp;
+ checkboxTemp.Checked := stoponoverheat;
+
+ UpDownTemp.Position := stop_temp;
+
+ CheckBoxCPUTemp.Checked := buildtemps;
+ CheckBoxCPUFan.Checked := buildfans;
+ CheckBoxCPUVcore.Checked := buildvcores;
+ CheckBox12V.Checked := buildp12vs;
+end;
+
+procedure TFormSett.FormKeyDown(Sender: TObject; var Key: Word;
+ Shift: TShiftState);
+var filename : string;
+begin
+ if Key = VK_F5 then begin
+ if datetimeinnames then filename := AddDateTimeToFilename(progname, 'png', Now)
+ else filename := progname + '.png';
+ WindowScreenshot(FormMain.Handle, filename);
+ end;
+end;
+
+procedure TFormSett.FormKeyPress(Sender: TObject; var Key: Char);
+begin
+ case Key of
+ '0'..'9', #8 : begin end;
+ #27 : begin
+ ButtonCancel.Click;
+ Key := #0;
+ end;
+ #13 : begin
+ ButtonOK.Click;
+ Key := #0;
+ end
+ else Key := #0;
+ end;
+end;
+
+procedure TFormSett.RBEverestClick(Sender: TObject);
+begin
+ CheckBoxTemp.Enabled := true;
+ EditTemp.Enabled := true;
+ UpDownTemp.Enabled := true;
+
+ CheckBoxCPUTemp.Enabled := true;
+ CheckBoxCPUFan.Enabled := true;
+ CheckBoxCPUVcore.Enabled := true;
+ CheckBox12V.Enabled := true;
+
+ PanelExtApps.Refresh;
+end;
+
+procedure TFormSett.RBNoneClick(Sender: TObject);
+begin
+ CheckBoxTemp.Enabled := false;
+ EditTemp.Enabled := false;
+ UpDownTemp.Enabled := false;
+
+ CheckBoxCPUTemp.Enabled := false;
+ CheckBoxCPUFan.Enabled := false;
+ CheckBoxCPUVcore.Enabled := false;
+ CheckBox12V.Enabled := false;
+
+ PanelExtApps.Refresh;
+end;
+
+end.