Changeset 29 for trunk/Form


Ignore:
Timestamp:
Apr 7, 2016, 11:08:31 PM (9 years ago)
Author:
chronos
Message:
  • Added: Random data pattern write operation.
  • Modified: Reversed list of operations so new ones are placed at top of the list.
  • Fixed: Error on openning recent file which not exists.
Location:
trunk/Form
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Form/UFormMain.lfm

    r27 r29  
    283283          item
    284284            Caption = 'Name'
    285             Width = 100
     285            Width = 200
    286286          end       
    287287          item
    288288            Caption = 'Time start'
    289             Width = 100
     289            Width = 150
    290290          end       
    291291          item
    292292            Caption = 'Time end'
    293             Width = 100
     293            Width = 150
    294294          end       
    295295          item
  • trunk/Form/UFormMain.pas

    r28 r29  
    176176  LoadConfig;
    177177  Core.PersistentForm1.Load(Self);
    178   if (LastOpenedList1.Items.Count > 0) then
     178  if (LastOpenedList1.Items.Count > 0) and FileExists(LastOpenedList1.Items[0]) then
    179179    ProjectOpen(LastOpenedList1.Items[0])
    180180  else begin
     
    195195  with Core.Project do
    196196  if (Item.Index >= 0) and (Item.Index < Scans.Count) then
    197   with TDriveScan(Scans[Item.Index]) do begin
     197  with TDriveScan(Scans[Scans.Count - 1 - Item.Index]) do begin
    198198    Item.Caption := GetName;
    199     Item.Data := TDriveScan(Scans[Item.Index]);
     199    Item.Data := TDriveScan(Scans[Scans.Count - 1 - Item.Index]);
    200200    Item.SubItems.Add(DateTimeToStr(TimeStart));
    201201    Item.SubItems.Add(DateTimeToStr(TimeEnd));
  • trunk/Form/UFormOperation.lfm

    r22 r29  
    3737      'Write test'
    3838    )
     39    OnChange = ComboBoxRunModeChange
    3940    Style = csDropDownList
    4041    TabOrder = 2
     
    4243  end
    4344  object Label9: TLabel
    44     Left = 285
     45    Left = 16
    4546    Height = 24
    46     Top = 23
    47     Width = 121
    48     Caption = 'Data pattern:'
     47    Top = 200
     48    Width = 172
     49    Caption = 'Write byte pattern:'
    4950    ParentColor = False
    5051  end
    5152  object EditPattern: TEdit
    52     Left = 439
     53    Left = 232
    5354    Height = 34
    54     Top = 16
     55    Top = 192
    5556    Width = 80
    5657    TabOrder = 3
     
    9394    ParentColor = False
    9495  end
     96  object CheckBoxRandomPattern: TCheckBox
     97    Left = 16
     98    Height = 28
     99    Top = 160
     100    Width = 174
     101    Caption = 'Random pattern'
     102    OnChange = CheckBoxRandomPatternChange
     103    TabOrder = 6
     104  end
    95105end
  • trunk/Form/UFormOperation.pas

    r22 r29  
    1616    ButtonOk: TButton;
    1717    ButtonCancel: TButton;
     18    CheckBoxRandomPattern: TCheckBox;
    1819    ComboBoxRunMode: TComboBox;
    1920    EditPattern: TEdit;
     
    2324    SpinEditFirstSector: TSpinEdit;
    2425    SpinEditLastSector: TSpinEdit;
     26    procedure CheckBoxRandomPatternChange(Sender: TObject);
     27    procedure ComboBoxRunModeChange(Sender: TObject);
    2528    procedure SpinEditFirstSectorChange(Sender: TObject);
    2629    procedure SpinEditLastSectorChange(Sender: TObject);
    2730  private
    2831    procedure UpdateMaxValues;
     32    procedure UpdateWritePattern;
    2933  public
    3034    procedure Load(DriveScan: TDriveScanProfile);
     
    4650end;
    4751
     52procedure TFormOperation.ComboBoxRunModeChange(Sender: TObject);
     53begin
     54  UpdateWritePattern;
     55end;
     56
     57procedure TFormOperation.CheckBoxRandomPatternChange(Sender: TObject);
     58begin
     59  UpdateWritePattern;
     60end;
     61
    4862procedure TFormOperation.SpinEditLastSectorChange(Sender: TObject);
    4963begin
     
    5771end;
    5872
     73procedure TFormOperation.UpdateWritePattern;
     74begin
     75  CheckBoxRandomPattern.Enabled := (ComboBoxRunMode.ItemIndex = Integer(rmWrite));
     76  EditPattern.Enabled := not CheckBoxRandomPattern.Checked and (ComboBoxRunMode.ItemIndex = Integer(rmWrite));
     77end;
     78
    5979procedure TFormOperation.Load(DriveScan: TDriveScanProfile);
    6080begin
     81  CheckBoxRandomPattern.Checked := DriveScan.WritePatternRandom;
     82  UpdateWritePattern;
    6183  ComboBoxRunMode.ItemIndex := Integer(DriveScan.Mode);
    6284  EditPattern.Text := '$' + IntToHex(DriveScan.WritePattern, 2);
     
    7395  DriveScan.SectorStart := SpinEditFirstSector.Value;
    7496  DriveScan.SectorEnd := SpinEditLastSector.Value;
     97  DriveScan.WritePatternRandom := CheckBoxRandomPattern.Checked;
    7598end;
    7699
Note: See TracChangeset for help on using the changeset viewer.