Changeset 19
- Timestamp:
- Apr 2, 2016, 10:01:11 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Form/UFormMain.pas
r18 r19 230 230 DriveInfo.Assign(TDriveInfo(ComboBoxDrive.Items.Objects[ComboBoxDrive.ItemIndex])); 231 231 Modified := True; 232 CurrentScan.SectorCount := DriveInfo.SectorCount; 233 CurrentScan.SectorSize := DriveInfo.SectorSize; 234 CurrentScan.SectorStart := 0; 235 CurrentScan.SectorEnd := CurrentScan.SectorCount - 1; 236 CurrentScan.Reset; 232 Core.Project.ScanProfile.SectorCount := DriveInfo.SectorCount; 233 Core.Project.ScanProfile.SectorStart := 0; 234 Core.Project.ScanProfile.SectorEnd := Core.Project.ScanProfile.SectorCount - 1; 237 235 UpdateInterface; 238 236 Redraw; … … 247 245 CurrentScan.SectorCount := DriveInfo.SectorCount; 248 246 CurrentScan.SectorSize := DriveInfo.SectorSize; 247 Core.Project.ScanProfile.SectorCount := Core.Project.DriveInfo.SectorCount; 248 CurrentScan.LoadProfile(Core.Project.ScanProfile);; 249 249 CurrentScan.Reset; 250 250 CurrentScan.OnChange := DriveScanChange; … … 353 353 procedure TFormMain.AOperationOptionsExecute(Sender: TObject); 354 354 begin 355 FormOperation.Load(Core.Project.CurrentScan); 355 Core.Project.ScanProfile.SectorCount := Core.Project.DriveInfo.SectorCount; 356 FormOperation.Load(Core.Project.ScanProfile); 356 357 if FormOperation.ShowModal = mrOk then begin 357 FormOperation.Save(Core.Project. CurrentScan);358 FormOperation.Save(Core.Project.ScanProfile); 358 359 Core.Project.Modified := True; 359 360 UpdateInterface; -
trunk/Form/UFormOperation.pas
r11 r19 28 28 procedure UpdateMaxValues; 29 29 public 30 procedure Load(DriveScan: TDriveScan );31 procedure Save(DriveScan: TDriveScan );30 procedure Load(DriveScan: TDriveScanProfile); 31 procedure Save(DriveScan: TDriveScanProfile); 32 32 end; 33 33 … … 57 57 end; 58 58 59 procedure TFormOperation.Load(DriveScan: TDriveScan );59 procedure TFormOperation.Load(DriveScan: TDriveScanProfile); 60 60 begin 61 61 ComboBoxRunMode.ItemIndex := Integer(DriveScan.Mode); … … 67 67 end; 68 68 69 procedure TFormOperation.Save(DriveScan: TDriveScan );69 procedure TFormOperation.Save(DriveScan: TDriveScanProfile); 70 70 begin 71 71 DriveScan.Mode := TRunMode(ComboBoxRunMode.ItemIndex); -
trunk/UDriveScan.pas
r18 r19 25 25 procedure Execute; override; 26 26 property OnException: TExceptionEvent read FOnException write FOnException; 27 end; 28 29 TDriveScanProfile = class 30 SectorCount: Integer; 31 SectorStart: Integer; 32 SectorEnd: Integer; 33 Mode: TRunMode; 34 WritePattern: Byte; 27 35 end; 28 36 … … 61 69 procedure Start; 62 70 procedure Stop; 71 procedure LoadProfile(Profile: TDriveScanProfile); 63 72 constructor Create; 64 73 destructor Destroy; override; … … 253 262 end; 254 263 264 procedure TDriveScan.LoadProfile(Profile: TDriveScanProfile); 265 begin 266 SectorStart := Profile.SectorStart; 267 SectorEnd := Profile.SectorEnd; 268 Mode := Profile.Mode; 269 WritePattern := Profile.WritePattern; 270 end; 271 255 272 constructor TDriveScan.Create; 256 273 begin -
trunk/UProject.pas
r16 r19 24 24 Scans: TDriveScanList; 25 25 DriveInfo: TDriveInfo; 26 ScanProfile: TDriveScanProfile; 26 27 constructor Create; 27 28 destructor Destroy; override; … … 56 57 Scans := TDriveScanList.Create; 57 58 DriveInfo := TDriveInfo.Create; 59 ScanProfile := TDriveScanProfile.Create; 58 60 end; 59 61 60 62 destructor TProject.Destroy; 61 63 begin 64 FreeAndNil(ScanProfile); 62 65 FreeAndNil(DriveInfo); 63 66 FreeAndNil(Scans); … … 82 85 WriteString(RootNode, 'DrivePath', DriveInfo.Path); 83 86 WriteInt64(RootNode, 'DriveSize', DriveInfo.Size); 87 88 NewNode := OwnerDocument.CreateElement('ScanProfile'); 89 AppendChild(NewNode); 90 WriteInteger(NewNode, 'SectorStart', ScanProfile.SectorStart); 91 WriteInteger(NewNode, 'SectorEnd', ScanProfile.SectorEnd); 92 WriteInteger(NewNode, 'WritePattern', ScanProfile.WritePattern); 93 WriteInteger(NewNode, 'Mode', Integer(ScanProfile.Mode)); 84 94 85 95 NewNode := OwnerDocument.CreateElement('Scans'); … … 111 121 DriveInfo.SectorSize := ReadInteger(RootNode, 'SectorSize', 4096); 112 122 DriveInfo.SectorCount := ReadInteger(RootNode, 'SectorCount', 0); 123 ScanProfile.SectorCount := DriveInfo.SectorCount; 113 124 DriveInfo.Model := ReadString(RootNode, 'DriveName', ''); 114 125 DriveInfo.Path := ReadString(RootNode, 'DrivePath', ''); 115 126 DriveInfo.Size := ReadInt64(RootNode, 'DriveSize', 0); 127 128 NewNode := FindNode('ScanProfile'); 129 if Assigned(NewNode) then begin 130 ScanProfile.SectorStart := ReadInteger(NewNode, 'SectorStart', 0); 131 ScanProfile.SectorEnd := ReadInteger(NewNode, 'SectorEnd', ScanProfile.SectorCount - 1); 132 ScanProfile.WritePattern := ReadInteger(NewNode, 'WritePattern', 0); 133 ScanProfile.Mode := TRunMode(ReadInteger(NewNode, 'Mode', 0)); 134 end; 116 135 117 136 NewNode := FindNode('Scans');
Note:
See TracChangeset
for help on using the changeset viewer.