Changeset 31 for trunk/Form


Ignore:
Timestamp:
Apr 30, 2016, 12:16:19 AM (9 years ago)
Author:
chronos
Message:
  • Added: TFileStreamEx experimental class to support flags O_DIRECT and O_SYNC under Linux.
Location:
trunk/Form
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Form/UFormMain.lfm

    r29 r31  
    6262        Height = 24
    6363        Top = 179
    64         Width = 101
     64        Width = 96
    6565        Caption = 'Sector size:'
    6666        ParentColor = False
     
    8686        Height = 24
    8787        Top = 208
    88         Width = 119
     88        Width = 113
    8989        Caption = 'Sector count:'
    9090        ParentColor = False
     
    102102        Height = 24
    103103        Top = 240
    104         Width = 136
     104        Width = 127
    105105        Caption = 'Current sector:'
    106106        ParentColor = False
     
    110110        Height = 24
    111111        Top = 272
    112         Width = 162
     112        Width = 154
    113113        Caption = 'Damaged sectors:'
    114114        ParentColor = False
     
    126126        Height = 24
    127127        Top = 300
    128         Width = 122
     128        Width = 115
    129129        Caption = 'Elapsed time:'
    130130        ParentColor = False
     
    142142        Height = 24
    143143        Top = 328
    144         Width = 142
     144        Width = 135
    145145        Caption = 'Estimated time:'
    146146        ParentColor = False
     
    158158        Height = 24
    159159        Top = 148
    160         Width = 160
     160        Width = 153
    161161        Caption = 'Sectors per Block:'
    162162        ParentColor = False
     
    182182        Height = 24
    183183        Top = 356
    184         Width = 94
     184        Width = 88
    185185        Caption = 'I/O speed:'
    186186        ParentColor = False
     
    190190        Height = 24
    191191        Top = 116
    192         Width = 40
     192        Width = 38
    193193        Caption = 'Size:'
    194194        ParentColor = False
     
    314314        Height = 24
    315315        Top = 16
    316         Width = 107
     316        Width = 100
    317317        Caption = 'Operations:'
    318318        ParentColor = False
  • trunk/Form/UFormMain.pas

    r29 r31  
    520520      BasePrefixMultipliers, SBytes);
    521521    LabelSectorCount.Caption := IntToStr(Project.DriveInfo.SectorCount);
    522     LabelSectorSize.Caption := IntToStr(Project.DriveInfo.SectorSize) + ' ' + SBytes;
     522    LabelSectorSize.Caption := PrefixMultiplier.Add(Project.DriveInfo.SectorSize, BasePrefixMultipliers, SBytes);
    523523  end else begin
    524524    LabelSize.Caption := '';
  • trunk/Form/UFormProject.lfm

    r13 r31  
    99  LCLVersion = '1.7'
    1010  object SpinEditSectorSize: TSpinEdit
    11     Left = 192
     11    Left = 224
    1212    Height = 34
    1313    Top = 152
    1414    Width = 101
    15     MaxValue = 100000
    16     MinValue = 1
     15    MaxValue = 63
     16    OnChange = SpinEditSectorSizeChange
    1717    TabOrder = 0
    1818    Value = 1
     
    9292    ParentColor = False
    9393  end
     94  object Label5: TLabel
     95    Left = 192
     96    Height = 24
     97    Top = 160
     98    Width = 22
     99    Caption = '2^'
     100    ParentColor = False
     101  end
     102  object Label6: TLabel
     103    Left = 341
     104    Height = 24
     105    Top = 160
     106    Width = 11
     107    Caption = '='
     108    ParentColor = False
     109  end
    94110end
  • trunk/Form/UFormProject.pas

    r15 r31  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Spin,
    9   StdCtrls, UProject;
     9  StdCtrls, UProject, Math;
    1010
    1111type
     
    2222    Label3: TLabel;
    2323    Label4: TLabel;
     24    Label5: TLabel;
     25    Label6: TLabel;
    2426    LabelSectorCount: TLabel;
    2527    SpinEditSectorSize: TSpinEdit;
     28    procedure SpinEditSectorSizeChange(Sender: TObject);
    2629  private
     30    procedure UpdateSectorSize;
    2731  public
    2832    procedure Load(Project: TProject);
     
    4246{ TFormProject }
    4347
     48procedure TFormProject.SpinEditSectorSizeChange(Sender: TObject);
     49begin
     50  UpdateSectorSize;
     51end;
     52
     53procedure TFormProject.UpdateSectorSize;
     54begin
     55  Label6.Caption := '= ' + IntToStr(Trunc(IntPower(2, SpinEditSectorSize.Value))) + ' bytes';
     56end;
     57
    4458procedure TFormProject.Load(Project: TProject);
    4559begin
    4660  Core.DriveList.LoadToStrings(ComboBoxDrive.Items);
    4761  EditName.Text := Project.Name;
    48   SpinEditSectorSize.Value := Project.DriveInfo.SectorSize;
     62  SpinEditSectorSize.Value := Trunc(Log2(Project.DriveInfo.SectorSize));
    4963  ComboBoxDrive.ItemIndex := Core.DriveList.IndexOf(Core.DriveList.FindByModel(Project.DriveInfo.Model));
     64  UpdateSectorSize;
    5065end;
    5166
     
    5368begin
    5469  Project.Name := EditName.Text;
    55   Project.DriveInfo.SectorSize := SpinEditSectorSize.Value;
     70  Project.DriveInfo.SectorSize := Trunc(IntPower(2, SpinEditSectorSize.Value));
    5671end;
    5772
Note: See TracChangeset for help on using the changeset viewer.