You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
2.1 KiB

4 years ago
#ifndef MAINWIDGET_H
#define MAINWIDGET_H
#include <QWidget>
#include "patientemergencyinfo.h"
#include <QTimer>
4 years ago
#include <QtWidgets>
#include "httpservice.h"
#include "websocketservice.h"
#include "deviceservice.h"
4 years ago
namespace Ui {
class MainWidget;
}
class MainWidget : public QWidget
{
Q_OBJECT
public:
explicit MainWidget(HttpService *httpService,
WebsocketService *websocketService,
DeviceService *deviceService,
QWidget *parent = 0);
4 years ago
~MainWidget();
4 years ago
void paintEvent(QPaintEvent *event);
void resizeEvent(QResizeEvent *event);
void mouseDoubleClickEvent(QMouseEvent *event);
4 years ago
void mousePressEvent(QMouseEvent *event);
void wheelEvent(QWheelEvent *event);
4 years ago
private:
HttpService *m_httpService;
WebsocketService *m_websocketService;
DeviceService *m_deviceService;
4 years ago
Ui::MainWidget *ui;
QList<PatientEmergencyInfo *> m_patientEmergencyInfos;
qint32 m_maxPatientNum,m_switchPatientInterval;
qint32 m_patientIndex;
QTimer m_countDownTimer;
QTimer m_switchPatientTimer;
4 years ago
QTimer m_ledTurnTimer;
int m_wsConnectedStatus;
QFont font1, font2, font3;
QTimer m_lableScrollTimer;
4 years ago
int m_width, m_height, m_curX, m_y;
bool isFenzhen;
PatientEmergencyInfo *keyDownPInfo;
public slots:
void updateUi();
void onWsConnectedStatusChanged(int);
void onNewPatientMergencyInfo(QString firstAidId,QString name,QString content,qint64 realCountDownInSeconds);
void onPatientMergencyStatusChanged(QString firstAidId,QString time,QString status);
void addPatientToList(PatientEmergencyInfo *);
void deletePatientFromList(QString firstAidId);
void lableScrollDisplay();
void onKeyClicked();
void onKeyDown();
void onKeyWorked(KeyFlag flag);
signals:
void statusChanged(QString firstAidId,QString status);
void complexOneKeyStart(QString idcard,QString name,QString sex,QString nation);
void sendCardInfo(QString idcard,QString name,QString sex,QString nation);
void oneKeyStart(QString idcard);
4 years ago
};
#endif // MAINWIDGET_H