diff --git a/deviceservice.cpp b/deviceservice.cpp index 38ec1c7..8a99dcf 100644 --- a/deviceservice.cpp +++ b/deviceservice.cpp @@ -9,7 +9,7 @@ #define WIRING_PIN_KEY 3 //GPIO.3 #define Click_Overtime 50 #define Press_Overtime 1500 -#define DblClick_Difftime 2000 +#define DblClick_Difftime 500 DeviceService::DeviceService(QObject *parent) : QObject(parent) { @@ -103,7 +103,7 @@ quint8 DeviceService::keyDetection() //判定上次有行为,且上次行为产生时间间隔大于组合行为最长时间间隔,说明行为结束(不在判定组合行为),发送行为信号,并清空key.flag if(key.flag != None && lastFlagTime.msecsTo(QTime::currentTime()) >= DblClick_Difftime) { -// emit keyWorked(key.flag); + emit keyWorked(key.flag); qDebug() << "keyWorked = " << key.flag; key.flag = None; } @@ -156,7 +156,7 @@ quint8 DeviceService::keyDetection() lastStateTime = QTime::currentTime(); if(key.state != KEY_Up) { -// emit keyDown();//发送至mainwidget,用于记录按下时操作的患者是哪个 + emit keyDown();//发送至mainwidget,用于记录按下时操作的患者是哪个 qDebug() << "key.state = " << key.state; } } diff --git a/mainwidget.cpp b/mainwidget.cpp index d833578..500cdef 100644 --- a/mainwidget.cpp +++ b/mainwidget.cpp @@ -236,6 +236,7 @@ void MainWidget::onKeyClicked() void MainWidget::onKeyDown() { + qDebug() << "emit keyDown()"; if(m_patientEmergencyInfos.length() > 0){ keyDownPInfo = m_patientEmergencyInfos[m_patientIndex]; } @@ -243,6 +244,7 @@ void MainWidget::onKeyDown() void MainWidget::onKeyWorked(KeyFlag flag) { + qDebug() << "emit keyWork()" << flag; if(flag == Click){ m_ledTurnTimer.stop(); m_deviceService->m_ledStatus = 0;