Changeset 29
- Timestamp:
- Apr 7, 2016, 11:08:31 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Form/UFormMain.lfm
r27 r29 283 283 item 284 284 Caption = 'Name' 285 Width = 100285 Width = 200 286 286 end 287 287 item 288 288 Caption = 'Time start' 289 Width = 1 00289 Width = 150 290 290 end 291 291 item 292 292 Caption = 'Time end' 293 Width = 1 00293 Width = 150 294 294 end 295 295 item -
trunk/Form/UFormMain.pas
r28 r29 176 176 LoadConfig; 177 177 Core.PersistentForm1.Load(Self); 178 if (LastOpenedList1.Items.Count > 0) then178 if (LastOpenedList1.Items.Count > 0) and FileExists(LastOpenedList1.Items[0]) then 179 179 ProjectOpen(LastOpenedList1.Items[0]) 180 180 else begin … … 195 195 with Core.Project do 196 196 if (Item.Index >= 0) and (Item.Index < Scans.Count) then 197 with TDriveScan(Scans[ Item.Index]) do begin197 with TDriveScan(Scans[Scans.Count - 1 - Item.Index]) do begin 198 198 Item.Caption := GetName; 199 Item.Data := TDriveScan(Scans[ Item.Index]);199 Item.Data := TDriveScan(Scans[Scans.Count - 1 - Item.Index]); 200 200 Item.SubItems.Add(DateTimeToStr(TimeStart)); 201 201 Item.SubItems.Add(DateTimeToStr(TimeEnd)); -
trunk/Form/UFormOperation.lfm
r22 r29 37 37 'Write test' 38 38 ) 39 OnChange = ComboBoxRunModeChange 39 40 Style = csDropDownList 40 41 TabOrder = 2 … … 42 43 end 43 44 object Label9: TLabel 44 Left = 28545 Left = 16 45 46 Height = 24 46 Top = 2 347 Width = 1 2148 Caption = ' Datapattern:'47 Top = 200 48 Width = 172 49 Caption = 'Write byte pattern:' 49 50 ParentColor = False 50 51 end 51 52 object EditPattern: TEdit 52 Left = 43953 Left = 232 53 54 Height = 34 54 Top = 1 655 Top = 192 55 56 Width = 80 56 57 TabOrder = 3 … … 93 94 ParentColor = False 94 95 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 95 105 end -
trunk/Form/UFormOperation.pas
r22 r29 16 16 ButtonOk: TButton; 17 17 ButtonCancel: TButton; 18 CheckBoxRandomPattern: TCheckBox; 18 19 ComboBoxRunMode: TComboBox; 19 20 EditPattern: TEdit; … … 23 24 SpinEditFirstSector: TSpinEdit; 24 25 SpinEditLastSector: TSpinEdit; 26 procedure CheckBoxRandomPatternChange(Sender: TObject); 27 procedure ComboBoxRunModeChange(Sender: TObject); 25 28 procedure SpinEditFirstSectorChange(Sender: TObject); 26 29 procedure SpinEditLastSectorChange(Sender: TObject); 27 30 private 28 31 procedure UpdateMaxValues; 32 procedure UpdateWritePattern; 29 33 public 30 34 procedure Load(DriveScan: TDriveScanProfile); … … 46 50 end; 47 51 52 procedure TFormOperation.ComboBoxRunModeChange(Sender: TObject); 53 begin 54 UpdateWritePattern; 55 end; 56 57 procedure TFormOperation.CheckBoxRandomPatternChange(Sender: TObject); 58 begin 59 UpdateWritePattern; 60 end; 61 48 62 procedure TFormOperation.SpinEditLastSectorChange(Sender: TObject); 49 63 begin … … 57 71 end; 58 72 73 procedure TFormOperation.UpdateWritePattern; 74 begin 75 CheckBoxRandomPattern.Enabled := (ComboBoxRunMode.ItemIndex = Integer(rmWrite)); 76 EditPattern.Enabled := not CheckBoxRandomPattern.Checked and (ComboBoxRunMode.ItemIndex = Integer(rmWrite)); 77 end; 78 59 79 procedure TFormOperation.Load(DriveScan: TDriveScanProfile); 60 80 begin 81 CheckBoxRandomPattern.Checked := DriveScan.WritePatternRandom; 82 UpdateWritePattern; 61 83 ComboBoxRunMode.ItemIndex := Integer(DriveScan.Mode); 62 84 EditPattern.Text := '$' + IntToHex(DriveScan.WritePattern, 2); … … 73 95 DriveScan.SectorStart := SpinEditFirstSector.Value; 74 96 DriveScan.SectorEnd := SpinEditLastSector.Value; 97 DriveScan.WritePatternRandom := CheckBoxRandomPattern.Checked; 75 98 end; 76 99 -
trunk/UDriveScan.pas
r27 r29 35 35 Mode: TRunMode; 36 36 WritePattern: Byte; 37 WritePatternRandom: Boolean; 37 38 procedure LoadFromDriveInfo(DriveInfo: TDriveInfo); 38 39 end; … … 91 92 Mode: TRunMode; 92 93 WritePattern: Byte; 94 WritePatternRandom: Boolean; 93 95 SectorSize: Integer; 94 96 SectorStart: Integer; … … 292 294 RealSize: Integer; 293 295 Buffer: array of Byte; 296 I: Integer; 294 297 begin 295 298 try … … 303 306 try 304 307 SetLength(Buffer, SectorSize); 305 if Mode = rmWrite then 306 FillChar(Buffer[0], Length(Buffer), WritePattern); 308 if Mode = rmWrite then begin 309 if not WritePatternRandom then 310 FillChar(Buffer[0], Length(Buffer), WritePattern) 311 else for I := 0 to Length(Buffer) - 1 do 312 Buffer[I] := Random(256); 313 end; 307 314 while FSectorCurrent < SectorEnd do begin 308 315 try … … 370 377 if Mode = rmNone then Result := 'None' 371 378 else if Mode = rmRead then Result := 'Read' 372 else if Mode = rmWrite then Result := 'Write pattern $' + IntToHex(WritePattern, 2) 373 else Result := ''; 379 else if Mode = rmWrite then begin 380 if WritePatternRandom then Result := 'Write pattern random' 381 else Result := 'Write pattern $' + IntToHex(WritePattern, 2); 382 end else Result := ''; 374 383 end; 375 384 … … 391 400 Mode := Profile.Mode; 392 401 WritePattern := Profile.WritePattern; 402 WritePatternRandom := Profile.WritePatternRandom; 393 403 end; 394 404 … … 428 438 WriteInteger(Node, 'RunMode', Integer(Mode)); 429 439 WriteInteger(Node, 'WritePattern', WritePattern); 440 WriteBoolean(Node, 'WritePatternRandom', WritePatternRandom); 430 441 WriteString(Node, 'DriveName', DriveName); 431 442 WriteDateTime(Node, 'TimeStart', TimeStart); … … 469 480 Mode := TRunMode(ReadInteger(Node, 'RunMode', 0)); 470 481 WritePattern := ReadInteger(Node, 'WritePattern', 0); 482 WritePatternRandom := ReadBoolean(Node, 'WritePatternRandom', False); 471 483 DriveName := ReadString(Node, 'DriveName', ''); 472 484 TimeStart := ReadDateTime(Node, 'TimeStart', 0);
Note:
See TracChangeset
for help on using the changeset viewer.