Changeset 4 for trunk


Ignore:
Timestamp:
Mar 29, 2016, 10:52:51 PM (9 years ago)
Author:
chronos
Message:
  • Modified: Show drive size and I/O speed with proper units.
Location:
trunk
Files:
98 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/CoolDisk.lpi

    r3 r4  
    6464      </local>
    6565    </RunParams>
    66     <RequiredPackages Count="2">
     66    <RequiredPackages Count="4">
    6767      <Item1>
    68         <PackageName Value="tachartlazaruspkg"/>
     68        <PackageName Value="TemplateGenerics"/>
     69        <DefaultFilename Value="Packages/TemplateGenerics/TemplateGenerics.lpk" Prefer="True"/>
    6970      </Item1>
    7071      <Item2>
     72        <PackageName Value="Common"/>
     73        <DefaultFilename Value="Packages/Common/Common.lpk" Prefer="True"/>
     74      </Item2>
     75      <Item3>
     76        <PackageName Value="tachartlazaruspkg"/>
     77      </Item3>
     78      <Item4>
    7179        <PackageName Value="LCL"/>
    72       </Item2>
     80      </Item4>
    7381    </RequiredPackages>
    7482    <Units Count="8">
  • trunk/CoolDisk.lpr

    r3 r4  
    99  Interfaces, // this includes the LCL widgetset
    1010  Forms, tachartlazaruspkg, UFormMain, UFormBenchmark, UFormProject, UProject,
    11   UConfig, UBlockMap, UDriveScan
     11  UConfig, UBlockMap, UDriveScan, Common, TemplateGenerics
    1212  { you can add units after this };
    1313
  • trunk/UFormMain.lfm

    r3 r4  
    11object FormMain: TFormMain
    2   Left = 215
     2  Left = 301
    33  Height = 941
    4   Top = 79
     4  Top = 361
    55  Width = 1703
    66  Caption = 'CoolDisk'
     
    4444  object Label1: TLabel
    4545    Left = 15
    46     Height = 22
     46    Height = 24
    4747    Top = 675
    48     Width = 91
     48    Width = 101
    4949    Caption = 'Sector size:'
    5050    ParentColor = False
     
    5252  object LabelBlockSize: TLabel
    5353    Left = 256
    54     Height = 22
     54    Height = 24
    5555    Top = 675
    5656    Width = 10
     
    6060  object LabelBlockCount: TLabel
    6161    Left = 256
    62     Height = 22
     62    Height = 24
    6363    Top = 704
    6464    Width = 10
     
    6868  object Label2: TLabel
    6969    Left = 16
    70     Height = 22
     70    Height = 24
    7171    Top = 704
    72     Width = 105
     72    Width = 119
    7373    Caption = 'Sector count:'
    7474    ParentColor = False
     
    7676  object LabelBlockCurrent: TLabel
    7777    Left = 256
    78     Height = 22
     78    Height = 24
    7979    Top = 736
    8080    Width = 10
     
    8484  object Label3: TLabel
    8585    Left = 16
    86     Height = 22
     86    Height = 24
    8787    Top = 736
     88    Width = 136
     89    Caption = 'Current sector:'
     90    ParentColor = False
     91  end
     92  object Label4: TLabel
     93    Left = 17
     94    Height = 24
     95    Top = 768
     96    Width = 162
     97    Caption = 'Damaged sectors:'
     98    ParentColor = False
     99  end
     100  object LabelBlockDamaged: TLabel
     101    Left = 256
     102    Height = 24
     103    Top = 764
     104    Width = 10
     105    Caption = '  '
     106    ParentColor = False
     107  end
     108  object Label5: TLabel
     109    Left = 16
     110    Height = 24
     111    Top = 796
    88112    Width = 122
    89     Caption = 'Current sector:'
    90     ParentColor = False
    91   end
    92   object Label4: TLabel
    93     Left = 17
    94     Height = 22
    95     Top = 768
    96     Width = 147
    97     Caption = 'Damaged sectors:'
    98     ParentColor = False
    99   end
    100   object LabelBlockDamaged: TLabel
    101     Left = 256
    102     Height = 22
    103     Top = 764
    104     Width = 10
    105     Caption = '  '
    106     ParentColor = False
    107   end
    108   object Label5: TLabel
    109     Left = 16
    110     Height = 22
    111     Top = 796
    112     Width = 112
    113113    Caption = 'Elapsed time:'
    114114    ParentColor = False
     
    116116  object LabelElapsedTime: TLabel
    117117    Left = 256
    118     Height = 22
     118    Height = 24
    119119    Top = 792
    120120    Width = 10
     
    124124  object Label6: TLabel
    125125    Left = 17
    126     Height = 22
     126    Height = 24
    127127    Top = 824
    128     Width = 129
     128    Width = 142
    129129    Caption = 'Estimated time:'
    130130    ParentColor = False
     
    132132  object LabelEstimatedTime: TLabel
    133133    Left = 257
    134     Height = 22
     134    Height = 24
    135135    Top = 820
    136136    Width = 10
     
    140140  object Label7: TLabel
    141141    Left = 17
    142     Height = 22
     142    Height = 24
    143143    Top = 644
    144     Width = 144
     144    Width = 160
    145145    Caption = 'Sectors per Block:'
    146146    ParentColor = False
     
    148148  object LabelSectorPerBlock: TLabel
    149149    Left = 256
    150     Height = 22
     150    Height = 24
    151151    Top = 640
    152152    Width = 10
     
    156156  object LabelIOSpeed: TLabel
    157157    Left = 256
    158     Height = 22
     158    Height = 24
    159159    Top = 848
    160160    Width = 10
     
    164164  object Label8: TLabel
    165165    Left = 16
    166     Height = 22
     166    Height = 24
    167167    Top = 852
    168     Width = 86
     168    Width = 94
    169169    Caption = 'I/O speed:'
    170170    ParentColor = False
     
    196196  object EditDrive: TEdit
    197197    Left = 16
    198     Height = 32
     198    Height = 34
    199199    Top = 8
    200200    Width = 448
     
    203203  object ComboBoxRunMode: TComboBox
    204204    Left = 17
    205     Height = 32
     205    Height = 34
    206206    Top = 88
    207207    Width = 247
     
    218218  object Label9: TLabel
    219219    Left = 286
    220     Height = 22
     220    Height = 24
    221221    Top = 95
    222     Width = 108
     222    Width = 121
    223223    Caption = 'Data pattern:'
    224224    ParentColor = False
     
    226226  object EditPattern: TEdit
    227227    Left = 440
    228     Height = 32
     228    Height = 34
    229229    Top = 88
    230230    Width = 80
     
    234234  object Label10: TLabel
    235235    Left = 16
    236     Height = 22
     236    Height = 24
    237237    Top = 612
    238     Width = 36
     238    Width = 40
    239239    Caption = 'Size:'
    240240    ParentColor = False
     
    242242  object LabelSize: TLabel
    243243    Left = 256
    244     Height = 22
     244    Height = 24
    245245    Top = 608
    246246    Width = 10
  • trunk/UFormMain.pas

    r3 r4  
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    99  Menus, ComCtrls, ExtCtrls, ActnList, dateutils, syncobjs, UProject,
    10   UDriveScan;
     10  UDriveScan, UPrefixMultiplier;
    1111
    1212type
     
    6161    procedure Timer1Timer(Sender: TObject);
    6262  private
     63    PrefixMultiplier: TPrefixMultiplier;
    6364    LastBlockPos: Integer;
    6465    ScanThread: TScanThread;
     
    101102procedure TFormMain.FormCreate(Sender: TObject);
    102103begin
     104  PrefixMultiplier := TPrefixMultiplier.Create;
    103105  DriveScan := TDriveScan.Create;
    104106  DriveScan.OnChange := DriveScanChange;
     
    107109  ScanThread.Form := Self;
    108110  Project := TProject.Create;
    109   EditDrive.Text := '/dev/sda';
     111  EditDrive.Text := '/dev/sdb';
    110112end;
    111113
     
    156158  FreeAndNil(ScanThread);
    157159  FreeAndNil(DriveScan);
     160  FreeAndNil(PrefixMultiplier);
    158161end;
    159162
     
    178181        Picture.Bitmap.EndUpdate;
    179182      end;
    180       LabelSize.Caption := IntToStr(DriveScan.BlockMap.SectorCount * DriveScan.SectorSize) + ' bytes';
     183      LabelSize.Caption := PrefixMultiplier.Add(DriveScan.BlockMap.SectorCount * DriveScan.SectorSize,
     184        BasePrefixMultipliers, 'bytes');
    181185      LabelSectorPerBlock.Caption := IntToStr(DriveScan.BlockMap.SectorPerBlock);
    182186      LabelBlockSize.Caption := IntToStr(DriveScan.SectorSize) + ' bytes';
     
    195199      LabelEstimatedTime.Caption := TimeToStr((Now - DriveScan.TimeStart) /
    196200        DriveScan.SectorCurrent * (DriveScan.BlockMap.SectorCount - DriveScan.SectorCurrent));
    197       LabelIOSpeed.Caption := IntToStr(Trunc((DriveScan.SectorCurrent - LastBlockPos) *
    198         DriveScan.SectorSize / (1024 * 1024) / (Timer1.Interval / 1000))) + ' MB/s';
     201      LabelIOSpeed.Caption := PrefixMultiplier.Add((DriveScan.SectorCurrent - LastBlockPos) *
     202        DriveScan.SectorSize / (Timer1.Interval / 1000), BasePrefixMultipliers, 'B/s');
    199203      LastBlockPos := DriveScan.SectorCurrent;
    200204    end else begin
Note: See TracChangeset for help on using the changeset viewer.