⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 smart.pas

📁 检测CPU信息和硬盘温度,以及硬盘使用时间和IP地址的小软件。
💻 PAS
📖 第 1 页 / 共 2 页
字号:
    wCapabilities: USHORT;
    wReserved1:    USHORT;
    wPIOTiming:    USHORT;
    wDMATiming:    USHORT;
    wBS:           USHORT;
    wNumCurrentCyls: USHORT;
    wNumCurrentHeads: USHORT;
    wNumCurrentSectorsPerTrack: USHORT;
    ulCurrentSectorCapacity: ULONG;
    wMultSectorStuff: USHORT;
    ulTotalAddressableSectors: ULONG;
    wSingleWordDMA: USHORT;
    wMultiWordDMA: USHORT;
    bReserved: array [0..127] of Byte;
//    bReserved: string [128];
  end; {IDSECTOR}
  PIDSECTOR = ^IDSECTOR;

//---------------------------------------------------------------------
// Valid Attribute IDs
//---------------------------------------------------------------------
const
  ATTR_INVALID                 = $00;
  ATTR_READ_ERROR_RATE         = $01;
  ATTR_THROUGHPUT_PERF         = $02;
  ATTR_SPIN_UP_TIME            = $03;
  ATTR_START_STOP_COUNT        = $04;
  ATTR_REALLOC_SECTOR_COUNT    = $05;
  ATTR_READ_CHANNEL_MARGIN     = $06;
  ATTR_SEEK_ERROR_RATE         = $07;
  ATTR_SEEK_TIME_PERF          = $08;
  ATTR_POWER_ON_HRS_COUNT      = $09;
  ATTR_SPIN_RETRY_COUNT        = $0A;
  ATTR_CALIBRATION_RETRY_COUNT = $0B;
  ATTR_POWER_CYCLE_COUNT       = $0C;
  ATTR_TEMPERATURE             = $C2;
//
  ATTR_REALLOCATED_EVENT_COUNT = $C4;
  ATTR_CURR_PENDING_SECTOR     = $C5;
  ATTR_OFFLINE_UNCORRECTABLE   = $C6;
  ATTR_UDMA_CRC_ERROR_COUNT    = $C7;
  ATTR_WRITE_ERROR_COUNT       = $C8;
//
//

//---------------------------------------------------------------------
// Status Flags Values
//---------------------------------------------------------------------
const
  PRE_FAILURE_WARRANTY      = $01;
  ON_LINE_COLLECTION        = $02;
  PERFORMANCE_ATTRIBUTE     = $04;
  ERROR_RATE_ATTRIBUTE      = $08;
  EVENT_COUNT_ATTRIBUTE     = $10;
  SELF_PRESERVING_ATTRIBUTE = $20;

  NUM_ATTRIBUTE_STRUCTS     = 30;

function StatFlagsToStars (const aFlags: Byte;
                           const aSep: String = ''): String;
function AttribName (const anId: Integer): String;

implementation

function StatFlagsToStars (const aFlags: Byte;
                           const aSep: String = ''): String;
begin
  if (PRE_FAILURE_WARRANTY and aFlags) <> 0 then
    Result := '*' + aSep
  else
    Result := ' ' + aSep;

  if (ON_LINE_COLLECTION and aFlags) <> 0 then
    Result := Result + '*' + aSep
  else
    Result := Result + ' ' + aSep;

  if (PERFORMANCE_ATTRIBUTE and aFlags) <> 0 then
    Result := Result + '*' + aSep
  else
    Result := Result + ' ' + aSep;

  if (ERROR_RATE_ATTRIBUTE and aFlags) <> 0 then
    Result := Result + '*' + aSep
  else
    Result := Result + ' ' + aSep;

  if (EVENT_COUNT_ATTRIBUTE and aFlags) <> 0 then
    Result := Result + '*' + aSep
  else
    Result := Result + ' ' + aSep;

  if (SELF_PRESERVING_ATTRIBUTE and aFlags) <> 0 then
    Result := Result + '*' + aSep
  else
    Result := Result + ' ' + aSep;
end;

function AttribName (const anId: Integer): String;
begin
  case anId of     //翻译得不准确,不过找不到中文资料
      0: Result := 'No Attribute Here       ';
      1: Result := '数据读取错误率';
      2: Result := '吞吐量';
      3: Result := '电机启动时间';
      4: Result := '电机启动/停止次数';
      5: Result := '重定位扇区次数';
      6: Result := 'Read Channel Margin';
      7: Result := '寻道错误率';
      8: Result := '寻道时间性能';
      9: Result := '磁盘上电时间';
     10: Result := '电机起动重试次数';
     11: Result := '校正重试次数 ';
     12: Result := '电源开关次数';
     13, 201: Result := '软件读取错误率';
    192,225: Result := '电源关闭次数';
    193: Result := '磁头归位次数';
    194, 231: Result := '温度';
    195: Result := '硬件ECC恢复';
    196: Result := '重定位事件次数';
    197: Result := '当前等待扇区数';    198: Result := '无法纠正扇区数';    199: Result := 'UDMA CRC 错误数';    200: Result := '写入数据错误率';    202: Result := 'DAM错误数';    206: Result := '磁头悬浮高度';    240: Result := '磁头悬浮时间';    else      Result := '未知属性'; end;{0 00h Invalid Invalid attribute identifier1 01h 数据读取错误率   从磁盘读取原始数据的出错频率
2 02h 吞吐量 磁盘平均读写效率
3 03h 启动时间 启动旋转所需时间
4 04h Start/Stop count Number of spindle start/stop cycles
5 05h Reallocated sector count Quantity of remapped sectors
6 06h Read channel margin Reserve of channel while reading
7 07h Seek error rate Frequency of errors while positioning
8 08h Seek timer performance Average efficiency of operations while  positioning
9 09h Power-on hours count Number of hours elapsed in the power-on state
10 0Ah Spinup retry count Number of retry attempts to spin up
11 0Bh Calibration retry count Number of attempts to calibrate the device
12 0Ch Power cycle count Number of power-on events
13 0Dh Soft read error rate Frequency of ‘program’ errors while reading
from a disk
187 BBh vendor-specific vendor-specific
189 BDh vendor-specific vendor-specific
190 BEh vendor-specific vendor-specific
191 BFh G-sense error rate Fequency of mistakes as a result of impact
loads
192 C0h Power-off retract count         Number of power-off or emergency retract cycles
193 C1h Load/Unload cycle count         Number of cycles into landing zone position
194 C2h HDA temperature                 Temperature of a hard disk assembly
195 C3h Hardware ECC recovered Number of ECC on-the-fly errors
196 C4h Reallocation count Number of remapping operations
197 C5h Current pending sector count   Number of unstable sectors (waiting for
remapping)
198 C6h Offline scan uncorrectable count   Number of uncorrected errors
199 C7h UDMA CRC error rate Number of CRC errors during UDMA mode
200 C8h Write error rate Number of errors while writing to disk (or)
multi-zone error rate (or)
flying height
201 C9h Soft read error rate Number of off-track errors
202 Cah Data Address Mark errors Number of Data Address Mark (DAM) errors
(or) vendor-specific
203 CBh Run out cancel Number of ECC errors
204 CCh Soft ECC correction Number of errors corrected by software ECC
205 CDh Thermal asperity rate
(TAR)
Number of thermal asperity errors
206 CEh Flying height Height of heads above the disk surface
207 CFh Spin high current Amount of high current used to spin up the
drive
208 D0h Spin buzz Number of buzz routines to spin up the drive
209 D1h Offline seek performance Drive’s seek performance during offline
operations
220 DCh Disk shift            Shift of disk is possible as a result of strong
shock loading in the store, as a result of falling
(or) temperature
221 DDh G-sense error rate Number of errors as a result of impact loads
as detected by a shock sensor
222 DEh Loaded hours Number of hours in general operational state
223 DFh Load/unload retry count Loading on drive caused by numerous
recurrences of operations, like reading,
recording, positioning of heads, etc.
224 E0h Load friction Load on drive caused by friction in mechanical
parts of the store
225 E1h Load/Unload cycle count Total number of load cycles
226 E2h Load-in time General time for loading in a drive
227 E3h Torque amplification count Quantity efforts of the rotating moment of a
drive
228 E4h Power-off retract count Number of power-off retract events.
230 E6h GMR head amplitude Amplitude of heads trembling (GMR-head) in
running mode
231 E7h Temperature Temperature of a drive
240 F0h Head flying hours Time while head is positioning
250 FAh Read error retry rate Number of errors while reading from a disk
}end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -