|
|
|
@ -23,6 +23,18 @@ ClockCounter::~ClockCounter()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ClockCounter::MouseClick(int cnt, QPoint point)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < cnt; i++)
|
|
|
|
|
{
|
|
|
|
|
this->setWindowTitle(QString::asprintf("软件执行计时器: 执行位于(%d, %d)的第%d次预点击", point.x(), point.y(), i));
|
|
|
|
|
SetCursorPos(point.x(), point.y());
|
|
|
|
|
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
|
|
|
|
|
Sleep(500);
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ClockCounter::StartTimer()
|
|
|
|
|
{
|
|
|
|
|
if (CountTime != 0)
|
|
|
|
@ -30,15 +42,25 @@ void ClockCounter::StartTimer()
|
|
|
|
|
ui.BtnStartTimer->setText("开始计时");
|
|
|
|
|
CountTime = -1;
|
|
|
|
|
CountCallback();
|
|
|
|
|
if(PreClickCount!=0)
|
|
|
|
|
this->setWindowTitle("软件执行计时器: 预点击指令已激活");
|
|
|
|
|
else
|
|
|
|
|
this->setWindowTitle("软件执行计时器");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (PreClickCount > 0)
|
|
|
|
|
MouseClick(PreClickCount, PreClickPosition);
|
|
|
|
|
CountTimer.start();
|
|
|
|
|
this->setWindowTitle("软件执行计时器: 正在计时");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ClockCounter::StopTimer()
|
|
|
|
|
{
|
|
|
|
|
CountTimer.stop();
|
|
|
|
|
ui.BtnStartTimer->setText("重置计时器");
|
|
|
|
|
this->setWindowTitle("软件执行计时器: 计时已停止");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ClockCounter::ShowPreClickWindow()
|
|
|
|
|