其实没那么复杂,看我的方法
//定时器刷新函数(定时器间隔设置成一秒)
procedure TMainFrmOpt.TimerRefresh;
var
TmpSysTime: _SYSTEMTIME;
begin
GetSystemTime(TmpSysTime)
//取得时间
if TmpSysTime.wSecond = 0 then //每一分钟显示时间
ShowTime;
if TmpSysTime.wSecond mod 3 = 1 then //每三秒刷新数据
begin
GetDevsShowData;
ShowDevicesData;
end;
with TmpSysTime do
begin
if (wHour = 6) and (wMinute = 6) and (wSecond = 6) then
MoveOverTimeData
//每天清除数据一次
if (wMinute = 6) and (wSecond = 6) then //每小时清理日志一次
ClearLogs;
end;
ShowCmmState
//每秒刷新通讯状态
end;