- Timestamp:
- Mar 29, 2016, 10:52:51 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 98 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CoolDisk.lpi
r3 r4 64 64 </local> 65 65 </RunParams> 66 <RequiredPackages Count=" 2">66 <RequiredPackages Count="4"> 67 67 <Item1> 68 <PackageName Value="tachartlazaruspkg"/> 68 <PackageName Value="TemplateGenerics"/> 69 <DefaultFilename Value="Packages/TemplateGenerics/TemplateGenerics.lpk" Prefer="True"/> 69 70 </Item1> 70 71 <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> 71 79 <PackageName Value="LCL"/> 72 </Item 2>80 </Item4> 73 81 </RequiredPackages> 74 82 <Units Count="8"> -
trunk/CoolDisk.lpr
r3 r4 9 9 Interfaces, // this includes the LCL widgetset 10 10 Forms, tachartlazaruspkg, UFormMain, UFormBenchmark, UFormProject, UProject, 11 UConfig, UBlockMap, UDriveScan 11 UConfig, UBlockMap, UDriveScan, Common, TemplateGenerics 12 12 { you can add units after this }; 13 13 -
trunk/UFormMain.lfm
r3 r4 1 1 object FormMain: TFormMain 2 Left = 2152 Left = 301 3 3 Height = 941 4 Top = 794 Top = 361 5 5 Width = 1703 6 6 Caption = 'CoolDisk' … … 44 44 object Label1: TLabel 45 45 Left = 15 46 Height = 2 246 Height = 24 47 47 Top = 675 48 Width = 9148 Width = 101 49 49 Caption = 'Sector size:' 50 50 ParentColor = False … … 52 52 object LabelBlockSize: TLabel 53 53 Left = 256 54 Height = 2 254 Height = 24 55 55 Top = 675 56 56 Width = 10 … … 60 60 object LabelBlockCount: TLabel 61 61 Left = 256 62 Height = 2 262 Height = 24 63 63 Top = 704 64 64 Width = 10 … … 68 68 object Label2: TLabel 69 69 Left = 16 70 Height = 2 270 Height = 24 71 71 Top = 704 72 Width = 1 0572 Width = 119 73 73 Caption = 'Sector count:' 74 74 ParentColor = False … … 76 76 object LabelBlockCurrent: TLabel 77 77 Left = 256 78 Height = 2 278 Height = 24 79 79 Top = 736 80 80 Width = 10 … … 84 84 object Label3: TLabel 85 85 Left = 16 86 Height = 2 286 Height = 24 87 87 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 88 112 Width = 122 89 Caption = 'Current sector:'90 ParentColor = False91 end92 object Label4: TLabel93 Left = 1794 Height = 2295 Top = 76896 Width = 14797 Caption = 'Damaged sectors:'98 ParentColor = False99 end100 object LabelBlockDamaged: TLabel101 Left = 256102 Height = 22103 Top = 764104 Width = 10105 Caption = ' '106 ParentColor = False107 end108 object Label5: TLabel109 Left = 16110 Height = 22111 Top = 796112 Width = 112113 113 Caption = 'Elapsed time:' 114 114 ParentColor = False … … 116 116 object LabelElapsedTime: TLabel 117 117 Left = 256 118 Height = 2 2118 Height = 24 119 119 Top = 792 120 120 Width = 10 … … 124 124 object Label6: TLabel 125 125 Left = 17 126 Height = 2 2126 Height = 24 127 127 Top = 824 128 Width = 1 29128 Width = 142 129 129 Caption = 'Estimated time:' 130 130 ParentColor = False … … 132 132 object LabelEstimatedTime: TLabel 133 133 Left = 257 134 Height = 2 2134 Height = 24 135 135 Top = 820 136 136 Width = 10 … … 140 140 object Label7: TLabel 141 141 Left = 17 142 Height = 2 2142 Height = 24 143 143 Top = 644 144 Width = 1 44144 Width = 160 145 145 Caption = 'Sectors per Block:' 146 146 ParentColor = False … … 148 148 object LabelSectorPerBlock: TLabel 149 149 Left = 256 150 Height = 2 2150 Height = 24 151 151 Top = 640 152 152 Width = 10 … … 156 156 object LabelIOSpeed: TLabel 157 157 Left = 256 158 Height = 2 2158 Height = 24 159 159 Top = 848 160 160 Width = 10 … … 164 164 object Label8: TLabel 165 165 Left = 16 166 Height = 2 2166 Height = 24 167 167 Top = 852 168 Width = 86168 Width = 94 169 169 Caption = 'I/O speed:' 170 170 ParentColor = False … … 196 196 object EditDrive: TEdit 197 197 Left = 16 198 Height = 3 2198 Height = 34 199 199 Top = 8 200 200 Width = 448 … … 203 203 object ComboBoxRunMode: TComboBox 204 204 Left = 17 205 Height = 3 2205 Height = 34 206 206 Top = 88 207 207 Width = 247 … … 218 218 object Label9: TLabel 219 219 Left = 286 220 Height = 2 2220 Height = 24 221 221 Top = 95 222 Width = 1 08222 Width = 121 223 223 Caption = 'Data pattern:' 224 224 ParentColor = False … … 226 226 object EditPattern: TEdit 227 227 Left = 440 228 Height = 3 2228 Height = 34 229 229 Top = 88 230 230 Width = 80 … … 234 234 object Label10: TLabel 235 235 Left = 16 236 Height = 2 2236 Height = 24 237 237 Top = 612 238 Width = 36238 Width = 40 239 239 Caption = 'Size:' 240 240 ParentColor = False … … 242 242 object LabelSize: TLabel 243 243 Left = 256 244 Height = 2 2244 Height = 24 245 245 Top = 608 246 246 Width = 10 -
trunk/UFormMain.pas
r3 r4 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 9 Menus, ComCtrls, ExtCtrls, ActnList, dateutils, syncobjs, UProject, 10 UDriveScan ;10 UDriveScan, UPrefixMultiplier; 11 11 12 12 type … … 61 61 procedure Timer1Timer(Sender: TObject); 62 62 private 63 PrefixMultiplier: TPrefixMultiplier; 63 64 LastBlockPos: Integer; 64 65 ScanThread: TScanThread; … … 101 102 procedure TFormMain.FormCreate(Sender: TObject); 102 103 begin 104 PrefixMultiplier := TPrefixMultiplier.Create; 103 105 DriveScan := TDriveScan.Create; 104 106 DriveScan.OnChange := DriveScanChange; … … 107 109 ScanThread.Form := Self; 108 110 Project := TProject.Create; 109 EditDrive.Text := '/dev/sd a';111 EditDrive.Text := '/dev/sdb'; 110 112 end; 111 113 … … 156 158 FreeAndNil(ScanThread); 157 159 FreeAndNil(DriveScan); 160 FreeAndNil(PrefixMultiplier); 158 161 end; 159 162 … … 178 181 Picture.Bitmap.EndUpdate; 179 182 end; 180 LabelSize.Caption := IntToStr(DriveScan.BlockMap.SectorCount * DriveScan.SectorSize) + ' bytes'; 183 LabelSize.Caption := PrefixMultiplier.Add(DriveScan.BlockMap.SectorCount * DriveScan.SectorSize, 184 BasePrefixMultipliers, 'bytes'); 181 185 LabelSectorPerBlock.Caption := IntToStr(DriveScan.BlockMap.SectorPerBlock); 182 186 LabelBlockSize.Caption := IntToStr(DriveScan.SectorSize) + ' bytes'; … … 195 199 LabelEstimatedTime.Caption := TimeToStr((Now - DriveScan.TimeStart) / 196 200 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'); 199 203 LastBlockPos := DriveScan.SectorCurrent; 200 204 end else begin
Note:
See TracChangeset
for help on using the changeset viewer.