Changeset 22


Ignore:
Timestamp:
Apr 4, 2016, 12:24:37 AM (9 years ago)
Author:
chronos
Message:
  • Modified: Show name in operation list.
  • Fixed: Store scan run mode in project file.
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Form/UFormBenchmark.lfm

    r1 r22  
    11object FormBenchmark: TFormBenchmark
    2   Left = 867
     2  Left = 874
    33  Height = 711
    4   Top = 134
     4  Top = 372
    55  Width = 773
    66  Caption = 'Benchmark'
  • trunk/Form/UFormMain.lfm

    r21 r22  
    11object FormMain: TFormMain
    2   Left = -26
    3   Height = 925
    4   Top = 276
    5   Width = 1694
     2  Left = 433
     3  Height = 941
     4  Top = 335
     5  Width = 1703
    66  Caption = 'CoolDisk'
    7   ClientHeight = 0
    8   ClientWidth = 0
     7  ClientHeight = 909
     8  ClientWidth = 1703
    99  Menu = MainMenu1
    1010  OnClose = FormClose
     
    1313  OnDestroy = FormDestroy
    1414  OnShow = FormShow
    15   LCLVersion = '1.6.0.4'
     15  LCLVersion = '1.7'
    1616  object ToolBar1: TToolBar
    1717    Left = 0
    1818    Height = 26
    1919    Top = 0
    20     Width = 0
     20    Width = 1703
    2121    Caption = 'ToolBar1'
    2222    Images = Core.ImageList1
     
    2828    end
    2929    object ToolButton2: TToolButton
    30       Left = 1
    31       Top = 24
     30      Left = 24
     31      Top = 2
    3232      Action = AScanStop
    3333    end
    3434    object ToolButton3: TToolButton
    35       Left = 1
    36       Top = 46
     35      Left = 47
     36      Top = 2
    3737      Action = AScanContinue
    3838    end
    3939  end
    4040  object Panel1: TPanel
    41     Left = 0
    42     Height = 0
    43     Top = 0
    44     Width = 0
     41    Left = 597
     42    Height = 883
     43    Top = 26
     44    Width = 1106
    4545    Align = alClient
    4646    BevelOuter = bvNone
    47     ClientHeight = 0
    48     ClientWidth = 0
     47    ClientHeight = 883
     48    ClientWidth = 1106
    4949    TabOrder = 1
    5050    object Image1: TImage
    51       Left = 0
    52       Height = 0
    53       Top = 0
    54       Width = 0
     51      Left = 8
     52      Height = 867
     53      Top = 8
     54      Width = 1090
    5555      Align = alClient
    5656      BorderSpacing.Around = 8
     
    6060  object Panel2: TPanel
    6161    Left = 0
    62     Height = 0
    63     Top = 0
     62    Height = 883
     63    Top = 26
    6464    Width = 592
    6565    Align = alLeft
    6666    BevelOuter = bvNone
    67     ClientHeight = 0
     67    ClientHeight = 883
    6868    ClientWidth = 592
    6969    TabOrder = 2
     
    7878    object Label1: TLabel
    7979      Left = 15
    80       Height = 15
     80      Height = 24
    8181      Top = 675
    82       Width = 58
     82      Width = 101
    8383      Caption = 'Sector size:'
    8484      ParentColor = False
     
    8686    object LabelSectorSize: TLabel
    8787      Left = 256
    88       Height = 15
     88      Height = 24
    8989      Top = 675
    90       Width = 6
     90      Width = 10
    9191      Caption = '  '
    9292      ParentColor = False
     
    9494    object LabelSectorCount: TLabel
    9595      Left = 256
    96       Height = 15
     96      Height = 24
    9797      Top = 704
    98       Width = 6
     98      Width = 10
    9999      Caption = '  '
    100100      ParentColor = False
     
    102102    object Label2: TLabel
    103103      Left = 15
    104       Height = 15
     104      Height = 24
    105105      Top = 704
    106       Width = 70
     106      Width = 119
    107107      Caption = 'Sector count:'
    108108      ParentColor = False
     
    110110    object LabelBlockCurrent: TLabel
    111111      Left = 256
    112       Height = 15
     112      Height = 24
    113113      Top = 736
    114       Width = 6
     114      Width = 10
    115115      Caption = '  '
    116116      ParentColor = False
     
    118118    object Label3: TLabel
    119119      Left = 15
    120       Height = 15
     120      Height = 24
    121121      Top = 736
    122       Width = 78
     122      Width = 136
    123123      Caption = 'Current sector:'
    124124      ParentColor = False
     
    126126    object Label4: TLabel
    127127      Left = 15
    128       Height = 15
     128      Height = 24
    129129      Top = 768
    130       Width = 94
     130      Width = 162
    131131      Caption = 'Damaged sectors:'
    132132      ParentColor = False
     
    134134    object LabelBlockDamaged: TLabel
    135135      Left = 256
    136       Height = 15
     136      Height = 24
    137137      Top = 764
    138       Width = 6
     138      Width = 10
    139139      Caption = '  '
    140140      ParentColor = False
     
    142142    object Label5: TLabel
    143143      Left = 15
    144       Height = 15
     144      Height = 24
    145145      Top = 796
    146       Width = 70
     146      Width = 122
    147147      Caption = 'Elapsed time:'
    148148      ParentColor = False
     
    150150    object LabelElapsedTime: TLabel
    151151      Left = 256
    152       Height = 15
     152      Height = 24
    153153      Top = 792
    154       Width = 6
     154      Width = 10
    155155      Caption = '  '
    156156      ParentColor = False
     
    158158    object Label6: TLabel
    159159      Left = 15
    160       Height = 15
     160      Height = 24
    161161      Top = 824
    162       Width = 82
     162      Width = 142
    163163      Caption = 'Estimated time:'
    164164      ParentColor = False
     
    166166    object LabelEstimatedTime: TLabel
    167167      Left = 257
    168       Height = 15
     168      Height = 24
    169169      Top = 820
    170       Width = 6
     170      Width = 10
    171171      Caption = '  '
    172172      ParentColor = False
     
    174174    object Label7: TLabel
    175175      Left = 15
    176       Height = 15
     176      Height = 24
    177177      Top = 644
    178       Width = 93
     178      Width = 160
    179179      Caption = 'Sectors per Block:'
    180180      ParentColor = False
     
    182182    object LabelSectorPerBlock: TLabel
    183183      Left = 256
    184       Height = 15
     184      Height = 24
    185185      Top = 640
    186       Width = 6
     186      Width = 10
    187187      Caption = '  '
    188188      ParentColor = False
     
    190190    object LabelIOSpeed: TLabel
    191191      Left = 256
    192       Height = 15
     192      Height = 24
    193193      Top = 848
    194       Width = 6
     194      Width = 10
    195195      Caption = '  '
    196196      ParentColor = False
     
    198198    object Label8: TLabel
    199199      Left = 15
    200       Height = 15
     200      Height = 24
    201201      Top = 852
    202       Width = 54
     202      Width = 94
    203203      Caption = 'I/O speed:'
    204204      ParentColor = False
     
    223223    object Label10: TLabel
    224224      Left = 15
    225       Height = 15
     225      Height = 24
    226226      Top = 612
    227       Width = 23
     227      Width = 40
    228228      Caption = 'Size:'
    229229      ParentColor = False
     
    231231    object LabelSize: TLabel
    232232      Left = 256
    233       Height = 15
     233      Height = 24
    234234      Top = 608
    235       Width = 6
     235      Width = 10
    236236      Caption = '  '
    237237      ParentColor = False
     
    283283    object Label11: TLabel
    284284      Left = 17
    285       Height = 15
     285      Height = 24
    286286      Top = 141
    287       Width = 61
     287      Width = 107
    288288      Caption = 'Operations:'
    289289      ParentColor = False
     
    299299    object ComboBoxDrive: TComboBox
    300300      Left = 8
    301       Height = 23
     301      Height = 38
    302302      Top = 16
    303303      Width = 416
    304304      Anchors = [akTop, akLeft, akRight]
    305       ItemHeight = 15
     305      ItemHeight = 0
    306306      OnChange = ComboBoxDriveChange
    307307      Style = csDropDownList
     
    326326  end
    327327  object Splitter1: TSplitter
    328     Left = 0
    329     Height = 0
    330     Top = 0
     328    Left = 592
     329    Height = 883
     330    Top = 26
    331331    Width = 5
    332332  end
  • trunk/Form/UFormMain.pas

    r21 r22  
    185185  if (Item.Index >= 0) and (Item.Index < Scans.Count) then
    186186  with TDriveScan(Scans[Item.Index]) do begin
    187     Item.Caption := IntToStr(Item.Index);
     187    Item.Caption := GetName;
    188188    Item.Data := TDriveScan(Scans[Item.Index]);
    189189    Item.SubItems.Add(DateTimeToStr(TimeStart));
     
    309309  Core.Project.ScanProfile.LoadFromDriveInfo(Core.Project.DriveInfo);
    310310
     311
    311312  Redraw;
    312313  UpdateInterface;
     
    357358    Scans.Add(NewOperation);
    358359    CurrentScan := TDriveScan(Scans.Last);
     360    CurrentScan.LoadProfile(ScanProfile);
    359361    ReloadOperationList;
    360362    Redraw;
  • trunk/Form/UFormOperation.lfm

    r13 r22  
    6969    Height = 34
    7070    Top = 64
    71     Width = 138
     71    Width = 162
    7272    MaxValue = 100000
    7373    OnChange = SpinEditFirstSectorChange
     
    7979    Height = 34
    8080    Top = 104
    81     Width = 138
     81    Width = 162
    8282    MaxValue = 100000
    8383    OnChange = SpinEditLastSectorChange
  • trunk/Form/UFormOperation.pas

    r21 r22  
    6060begin
    6161  ComboBoxRunMode.ItemIndex := Integer(DriveScan.Mode);
    62   EditPattern.Text := '0x' + IntToHex(DriveScan.WritePattern, 2);
     62  EditPattern.Text := '$' + IntToHex(DriveScan.WritePattern, 2);
    6363  SpinEditLastSector.MaxValue := DriveScan.SectorCount - 1;
    6464  SpinEditFirstSector.Value := DriveScan.SectorStart;
  • trunk/UConfig.pas

    r16 r22  
    99
    1010const
    11   ConfigTest = True;
     11  ConfigTest = False;
    1212
    1313implementation
  • trunk/UDriveScan.pas

    r21 r22  
    66
    77uses
    8   Classes, SysUtils, Syncobjs, UBlockMap, Forms, DOM,
    9   UXMLUtils, Contnrs, UPhysDrive;
     8  Classes, SysUtils, Syncobjs, UBlockMap, Forms, DOM, UConfig,
     9  UXMLUtils, Contnrs;
    1010
    1111type
     
    3636    WritePattern: Byte;
    3737    procedure LoadFromDriveInfo(DriveInfo: TDriveInfo);
     38  end;
     39
     40  { TTestStream }
     41
     42  TTestStream = class(TStream)
     43  public
     44    function Read(var Buffer; Count: Longint): Longint; override;
     45    function Write(const Buffer; Count: Longint): Longint; override;
     46    function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; override;
    3847  end;
    3948
     
    6877    SectorStart: Integer;
    6978    SectorEnd: Integer;
     79    function GetName: string;
    7080    function GetElapsedTime: TDateTime;
    7181    procedure Reset;
     
    106116end;
    107117
     118{ TTestStream }
     119
     120function TTestStream.Read(var Buffer; Count: Longint): Longint;
     121begin
     122//  if Random < 0.00001 then Result := 0
     123//   else
     124     Result := Count;
     125end;
     126
     127function TTestStream.Write(const Buffer; Count: Longint): Longint;
     128begin
     129end;
     130
     131function TTestStream.Seek(const Offset: Int64; Origin: TSeekOrigin): Int64;
     132begin
     133end;
     134
    108135{ TDriveScanList }
    109136
     
    206233procedure TDriveScan.Run;
    207234var
    208   F: TFileStream;
     235  F: TStream;
    209236  RealSize: Integer;
    210237  Buffer: array of Byte;
     
    213240    Lock.Acquire;
    214241    Terminated := False;
    215     if Mode = rmRead then F := TFileStream.Create(DriveName, fmOpenRead)
    216       else if Mode = rmWrite then F := TFileStream.Create(DriveName, fmOpenReadWrite);
     242    if ConfigTest then F := TTestStream.Create
     243    else begin
     244      if Mode = rmRead then F := TFileStream.Create(DriveName, fmOpenRead)
     245        else if Mode = rmWrite then F := TFileStream.Create(DriveName, fmOpenReadWrite);
     246    end;
    217247    try
    218248      SetLength(Buffer, SectorSize);
     
    264294end;
    265295
     296function TDriveScan.GetName: string;
     297begin
     298  if Mode = rmRead then Result := 'Read'
     299  else if Mode = rmWrite then Result := 'Write pattern $' + IntToHex(WritePattern, 2)
     300  else Result := '';
     301end;
     302
    266303procedure TDriveScan.Stop;
    267304begin
     
    305342  with Node do begin
    306343    WriteInteger(Node, 'DamagedBlockCount', DamagedBlockCount);
     344    WriteInteger(Node, 'RunMode', Integer(Mode));
    307345    WriteInteger(Node, 'WritePattern', WritePattern);
    308346    WriteString(Node, 'DriveName', DriveName);
     
    327365  with Node do begin
    328366    DamagedBlockCount := ReadInteger(Node, 'DamagedBlockCount', 0);
     367    Mode := TRunMode(ReadInteger(Node, 'RunMode', 0));
    329368    WritePattern := ReadInteger(Node, 'WritePattern', 0);
    330369    DriveName := ReadString(Node, 'DriveName', '');
Note: See TracChangeset for help on using the changeset viewer.