- Timestamp:
- Apr 7, 2016, 7:01:24 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CoolDisk.lpi
r21 r28 34 34 <SyntaxMode Value="Delphi"/> 35 35 <CStyleOperator Value="False"/> 36 <AllowLabel Value="False"/> 36 37 <CPPInline Value="False"/> 37 38 </SyntaxOptions> … … 40 41 <SmartLinkUnit Value="True"/> 41 42 <Optimizations> 42 <OptimizationLevel Value=" 2"/>43 <OptimizationLevel Value="3"/> 43 44 </Optimizations> 44 45 </CodeGeneration> … … 47 48 <GenerateDebugInfo Value="False"/> 48 49 </Debugging> 50 <LinkSmart Value="True"/> 49 51 <Options> 50 52 <Win32> … … 158 160 <SyntaxOptions> 159 161 <SyntaxMode Value="Delphi"/> 162 <CStyleOperator Value="False"/> 160 163 <IncludeAssertionCode Value="True"/> 164 <AllowLabel Value="False"/> 165 <CPPInline Value="False"/> 161 166 </SyntaxOptions> 162 167 </Parsing> -
trunk/Form/UFormMain.pas
r27 r28 247 247 Model := OpenDialog1.FileName; 248 248 SectorSize := 4096; 249 SectorCount := Size div SectorSize;250 249 Core.DriveList.LoadToStrings(ComboBoxDrive.Items); 251 250 end; … … 319 318 Core.Project.DriveInfo.Assign(TDriveInfo(ComboBoxDrive.Items.Objects[ComboBoxDrive.ItemIndex])); 320 319 Core.Project.ScanProfile.LoadFromDriveInfo(Core.Project.DriveInfo); 321 322 320 323 321 Redraw; -
trunk/UPhysDrive.pas
r21 r28 6 6 7 7 uses 8 Classes, SysUtils, Contnrs, UFindFile, UCommon 8 Classes, SysUtils, Contnrs, UFindFile, UCommon, Math 9 9 {$IFDEF Windows},ActiveX,ComObj,Variants 10 10 {$ENDIF}; … … 16 16 17 17 TDriveInfo = class 18 private 19 FSectorSize: Integer; 20 FSectorCount: Int64; 21 FSize: Int64; 22 function GetSectorCount: Int64; 23 procedure SetSectorSize(AValue: Integer); 24 procedure SetSize(AValue: Int64); 25 public 18 26 Kind: TDriveKind; 19 27 Model: string; 20 Size: Int64;21 SectorCount: Int64;22 SectorSize: Integer;23 28 Path: string; 29 constructor Create; 24 30 procedure Assign(Source: TDriveInfo); 31 property SectorSize: Integer read FSectorSize write SetSectorSize; 32 property SectorCount: Int64 read GetSectorCount; 33 property Size: Int64 read FSize write SetSize; 25 34 end; 26 35 … … 42 51 UPrefixMultiplier; 43 52 53 resourcestring 54 SMinSectorSize = 'Minimum sector size is 1'; 55 44 56 { TDriveInfo } 57 58 procedure TDriveInfo.SetSectorSize(AValue: Integer); 59 begin 60 if FSectorSize = AValue then Exit; 61 if Avalue < 1 then 62 raise Exception.Create(SMinSectorSize); 63 FSectorSize := AValue; 64 FSectorCount := Ceil(FSize / FSectorSize); 65 end; 66 67 function TDriveInfo.GetSectorCount: Int64; 68 begin 69 Result := Ceil(FSize / FSectorSize); 70 end; 71 72 procedure TDriveInfo.SetSize(AValue: Int64); 73 begin 74 if FSize=AValue then Exit; 75 FSize:=AValue; 76 end; 77 78 constructor TDriveInfo.Create; 79 begin 80 FSectorSize := 1; 81 end; 45 82 46 83 procedure TDriveInfo.Assign(Source: TDriveInfo); … … 49 86 Model := Source.Model; 50 87 Size := Source.Size; 51 SectorCount := Source.SectorCount;88 FSectorCount := Source.FSectorCount; 52 89 SectorSize := Source.SectorSize; 53 90 end; … … 108 145 NewDriveInfo.Model := Trim(LoadFileToStr(List[I] + '/device/model')); 109 146 NewDriveInfo.SectorSize := StrToInt(Trim(LoadFileToStr(List[I] + '/queue/physical_block_size'))); 110 NewDriveInfo.SectorCount := StrToInt(Trim(LoadFileToStr(List[I] + '/size'))) * 512 div NewDriveInfo.SectorSize; 111 NewDriveInfo.Size := NewDriveInfo.SectorCount * NewDriveInfo.SectorSize; 147 NewDriveInfo.Size := StrToInt(Trim(LoadFileToStr(List[I] + '/size'))) * 512; 112 148 NewDriveInfo.Path := '/dev/' + ExtractFileName(List[I]); 113 149 Add(NewDriveInfo); … … 123 159 NewDriveInfo.Model := 'File'; 124 160 NewDriveInfo.SectorSize := 4096; 125 NewDriveInfo.SectorCount := 0;126 161 NewDriveInfo.Size := 0; 127 162 NewDriveInfo.Path := ''; -
trunk/UProject.pas
r19 r28 120 120 with RootNode do begin 121 121 DriveInfo.SectorSize := ReadInteger(RootNode, 'SectorSize', 4096); 122 DriveInfo.SectorCount := ReadInteger(RootNode, 'SectorCount', 0);123 122 ScanProfile.SectorCount := DriveInfo.SectorCount; 124 123 DriveInfo.Model := ReadString(RootNode, 'DriveName', '');
Note:
See TracChangeset
for help on using the changeset viewer.