-
Notifications
You must be signed in to change notification settings - Fork 19
/
mainwindow.h
221 lines (201 loc) · 7.28 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#define CONCAT_NEW_NAME( Prefix, Suffix ) Prefix##Suffix
#include <QMainWindow>
#include <QMdiArea>
#include <QSignalMapper>
#include <QMap>
#include <QString>
#include <QWidget>
#include <QFrame>
#include <QCloseEvent>
#include <QTableWidget>
#include "Header/logindialog.h"
#include "Common/CommonType.h"
#include <QTimer>
#include <QLabel>
#include "Common/logicinterface.h"
#include "SerialPort/winserialport.h"
#include "Database/mysqldatabase.h"
#include <QLineEdit>
#include <QSettings>
#include <QShowEvent>
#include "Network/svrthread.h"
#include "Heartbeat/heartbeatthread.h"
#include "license/checkthread.h"
#include "qserialframe.h"
namespace Ui {
class MainWindow;
typedef QMap<QString, QWidget* > childMap;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0, Qt::WindowFlags flags = 0 );//= Qt::FramelessWindowHint );
~MainWindow();
bool AllInOneIPIO( char cCan, bool bOpen );
void SetFileCount( quint32 nCount );
void PictureRegconize( QString &strFile, int nChannel, QByteArray& byData );
void ControlChild( QCloseEvent* event, QWidget* child );
void ControlMonitor( bool bShow );
CLogicInterface* GetLogicInterface( );
void GetAppInfo( CommonDataType::AppInfoType appInfo, QString& strInfo );
void WriteLog( QString strType, QString& strContent, CommonDataType::SysLogType logType, QDateTime& dtDateTime, char cCan = 0 );
QString GetUserName( );
void GetParkName( QString& strName, char cCan, int nIndex );
CMySqlDatabase* GetMysqlDb( );
CWinSerialPort* GetSerialPort( );
bool SetCardNumber( QString& strNumber );
void SetCardControl( QLineEdit* edtCtrl );
void ControlChargeInfo( QStringList& strInfo );
QPixmap& GetPixmap( QString& strFile );
void CaptureImage( QString& strFile, int nChannel, CommonDataType::CaptureImageType capType );
void LoadCapturedImg( QString& strPath, int nChannel );
void GetInOutPixmap(QPixmap &bmpEnter, QPixmap &bmpLeave);
void UpdateStatistics( int nNumber, int nIndex );
void EmployeeCard( QString& strCardno );
bool IsEmployeeCard( QString& strCardno );
QString GetCurrentUserID( );
void SetBallotSense( bool bSense, int nChannel, QByteArray& byData );
void SendInOutImg( QString& strFile, bool bEnter, QDateTime& dtCurrent, QString& strPlate, QString& strCardNo );
void SetAlertMsg( const QString& strText );
bool ShiftDlgISVisible( );
void DisplayAlert( QStringList& lstData );
QString GetPictureName( QString strName );
private:
void GetLocalCanAddr( );
void SyncLedTime( QStringList& lstData );
void SetMaxMinSize( );
void ClearAllFiles( );
void ModiyToobar( );
void CreateChildren( );
void ControlDatabase( bool bOpen );
void ControlSerial( bool bOpen );
void CheckCenterContronller( );
void Singleton( );
void CheckResolution( );
void HideCtrl( bool bVisible = true );
void GetCardEntityInfo( );
void SyncTime( QStringList& lstData );
void StartSycnTime( );
void InitPMS( );
void ClearStatistics( QTime& time );
void SetDateTimeFormat( );
void ServerFunction( );
void ClientFunction( );
void GatherData( );
void ForwardPassRecord( QStringList& lstData );
void StartLicense( );
bool GenerateLicense( QString& strSpecialUser, QString& strSpecialPwd );
void RegisterAxCtrl( );
void StartupMgmt( );
protected:
void closeEvent( QCloseEvent* event );
void showEvent(QShowEvent *);
private:
QWidget* CreateChildWnd( CommonDataType::ChildWndType childType );
void ShowWnd( CommonDataType::ChildWndType childType );
void Login( bool bStart );
void WriteShiftLog( bool bLogin );
void Permission( );
void IconLoad( QWidget& frame );
void LoadUIImage( );
void CreateChildTime( quint64 nTime, CommonDataType::ChildWndType childType );
void ProcessCpuidRequest( QStringList& lstData );
void ProcessGateCommand( QStringList& lstData );
void ProcessMonthcardSync( QStringList& lstData );
CMySqlDatabase* pMysqlDb;
QLineEdit* edtCardNumner;
CCheckThread* pCheckThread;
private:
Ui::MainWindow *ui;
QMdiArea *pMdiArea;
QSignalMapper *pWindowMapper;
Ui::childMap* pChildMap;
CLoginDialog* pDlgLogin;
QString strUserName;
QString strUserPwd;
QTimer* pTimer;
QLabel* pLblTime;
QString strTimeText;
QString strIconPath;
CWinSerialPort *pSerialPort;
QSettings* pSettings;
CLogicInterface* pLogicInterface;
bool bSyncServer;
CSvrThread* netServer;
QString strPassRecord;
QString strParkID;
int nTransferRecord;
bool bToInternet;
bool bAlert;
QSerialFrame frmSerial;
QStringList lstCanAddr;
private slots:
#if false
void on_actStopPlateTwo_triggered();
void on_actStopPlateOne_triggered();
void on_actStartPlateTwo_triggered();
void on_actStartPlateOne_triggered();
void on_actStopVideoTwo_triggered();
void on_actStopVideoOne_triggered();
void on_actStartVideoTwo_triggered();
void on_actStartVideoOne_triggered();
#endif
void on_actRestart_triggered();
void on_actShiftLogout_hovered();
void on_actPublishLEDInfo_triggered();
void on_actSyncTime_triggered();
void on_actStartPlate_triggered( );
void on_actStopPlate_triggered( );
void on_actStartVideo_triggered( );
void on_actStopVideo_triggered( );
void on_actConnectDb_triggered();
void on_actPlateRecognizationSet_triggered();
void on_actSerialPort_triggered();
void on_actBlacklist_triggered();
void on_actDocment_triggered();
void on_actAbout_triggered();
void on_actHandheldICProcess_triggered();
void on_actPrintYearlyReport_triggered();
void on_actPrintMonthlyReport_triggered();
void on_actPrintDaylyReport_triggered();
void on_actDiscountSummaryReport_triggered();
void on_actReewalRecords_triggered();
void on_actAccess2Records_triggered();
void on_actTimeCard_triggered();
void on_actValueCard_triggered();
void on_actMonthlyCard_triggered();
void on_actSysExit_triggered();
void on_actPwdModification_triggered();
void on_actSysLog_triggered();
void on_actDBMaintenance_triggered();
void on_actTariffSetting_triggered();
void on_actRightMgm_triggered();
void on_actShiftLogout_triggered();
void on_actTollDiscountTypeSet_triggered();
void on_actBatchSetCardAccess_triggered();
void on_actSysSetting_triggered();
void on_actDeviceConfig_triggered();
void DataMayRead();
void ProcessDatagram( QStringList& lstData );
void ProcessMonitorMsg( CommonDataType::DatagramType nType, QStringList& lstData);
void UpdateLableText( );
void SendStateHB( );
void ReconnectDatabase( );
void RecognizePlate( QString strPlate, int nChannel, int nConfidence, bool bNocard, QByteArray byData );
void SendTime( );
void Expiration( QString strMsg, bool bExpiration, bool bRetry );
void on_actLicense_triggered();
void on_actStay_triggered();
void on_actRemoteMgmt_triggered();
void on_actIPC_triggered();
signals:
void OnUserChanged( QString& strUser, QString& strID );
void OnPermission( bool bNormal, int nIndex );
void OnStartDlg( );
void OnDestroyDlg( );
void OnUpdateInfo( QString strInfo );
};
#endif // MAINWINDOW_H