提交 c1f1465d 作者: zhangyl

添加抓拍,监控,语音

上级 35a46bef
The dll in this directoryiconv.dll,libxml2.dll,zlib1.dll,calib.dll,libcurl.dll,libssl-1_1.dll,libcrypto-1_1.dllonly used in ClientDemo.
\ No newline at end of file
#ifndef DATA_TYPE_H
#define DATA_TYPE_H
#define FRAME_HEAD_MAGIC 0x03211546
#define SYSTEM_SYNC_ID 2
#ifdef __LINUX__
typedef unsigned char UCHAR;
typedef unsigned char* PBYTE;
typedef char* LPTSTR;
typedef unsigned short USHORT;
typedef int HANDLE;
typedef unsigned long ULONG;
typedef unsigned long DWORD;
#endif //#ifdef __LINUX__
typedef struct tagFrameInfo{
ULONG SyncId; /* 00000000000000000000000000010b */
ULONG Magic;
USHORT FrameType; /* I frames , P frames or BBP frames Audio frames or dsp status etc */
ULONG Length; /*lenth include this header */
ULONG FrameNumber; /* serial number of this frame */
UCHAR Breakable; /* indicate if stream breakable, you could restart new file(with PktSysHeader) if true */
/*ULONG Ack;*/
ULONG PTS; /* system clock when this frames is processed */
}TMFRAME_HEADER, *PTMFRAME_HEADER;
typedef enum {
StandardNone = 0x80000000,
StandardNTSC = 0x00000001,
StandardPAL = 0x00000002,
StandardSECAM = 0x00000004,
} VideoStandard_t;
typedef enum {
PktError = 0,
PktIFrames = 0x0001,
PktPFrames = 0x0002,
PktBBPFrames = 0x0004,
PktAudioFrames = 0x0008,
PktMotionDetection = 0x00010,
PktDspStatus = 0x00020,
PktOrigImage = 0x00040,
PktSysHeader = 0x00080,
PktBPFrames = 0x00100,
PktSFrames = 0x00200,
PktSubIFrames = 0x00400,
PktSubPFrames = 0x00800,
PktSubBBPFrames = 0x01000,
PktSubSysHeader = 0x02000
}FrameType_t;
typedef struct tagVersion{
ULONG DspVersion, DspBuildNum;
ULONG DriverVersion, DriverBuildNum;
ULONG SDKVersion, SDKBuildNum;
}VERSION_INFO, *PVERSION_INFO;
typedef enum {
ENC_CIF_FORMAT = 0,
ENC_QCIF_FORMAT = 1,
ENC_2CIF_FORMAT = 2,
ENC_4CIF_FORMAT = 3,
ENC_QQCIF_FORMAT = 4,
ENC_CIFQCIF_FORMAT =5,
ENC_CIFQQCIF_FORMAT =6,
ENC_DCIF_FORMAT =7,
ENC_VGA_FORMAT=8
}PictureFormat_t;
typedef struct tagMotionData{
PictureFormat_t PicFormat;
ULONG HorizeBlocks;
ULONG VerticalBlocks;
ULONG BlockSize;
}MOTION_DATA_HEADER, *PMOTION_DATA_HEADER;
#define _OSD_BASE 0x9000 /*base address of special character*/
#define _OSD_YEAR4 (_OSD_BASE+0) /*show year time by length of 4 , for example: 2005*/
#define _OSD_YEAR2 (_OSD_BASE+1) /*show year time by length of 2, for example: 05 */
#define _OSD_MONTH3 (_OSD_BASE+2) /*show month time in English, for example: Jan*/
#define _OSD_MONTH2 (_OSD_BASE+3) /*show month time by two Arabic numerals, for example: 07*/
#define _OSD_DAY (_OSD_BASE+4) /*show day time by two Arabic numerals, for example: 31*/
#define _OSD_WEEK3 (_OSD_BASE+5) /*show week time in English: MONSUN*/
#define _OSD_CWEEK1 (_OSD_BASE+6) /*show week time in Chinese GB code*/
#define _OSD_HOUR24 (_OSD_BASE+7) /*show 24 hours clock: 0023 */
#define _OSD_HOUR12 (_OSD_BASE+8) /*show 12 hours clock: 0012*/
#define _OSD_MINUTE (_OSD_BASE+9) /*show minute time by length of 2: 0059*/
#define _OSD_SECOND (_OSD_BASE+10) /*show second time by length of 2: 0059*/
#define _OSD_MILISECOND (_OSD_BASE+11) /*show millisecond time by length of 3: 000~999*/
#define _OSD_APM (_OSD_BASE+14) /*show a.m. or p.m. by length of 2 bit, AM or PM*/
//For new added APIs to set OSD: SetEncoderOsdDisplayMode, SetDecoderOsdDisplayMode and SetDisplayOsdDisplayMode in v6.0 SDK, we use new basic address of special character.
#define _OSD_BASE_EX 0x90000 /*base address of special character*/
#define _OSD_YEAR4_EX (_OSD_BASE_EX+0) /*the same as _OSD_YEAR4*/
#define _OSD_YEAR2_EX (_OSD_BASE_EX+1) /*the same as _OSD_YEAR2*/
#define _OSD_MONTH3_EX (_OSD_BASE_EX+2) /*the same as _OSD_MONTH3*/
#define _OSD_MONTH2_EX (_OSD_BASE_EX+3) /*the same as _OSD_MONTH2*/
#define _OSD_DAY_EX (_OSD_BASE_EX+4) /*the same as _OSD_DAY*/
#define _OSD_WEEK3_EX (_OSD_BASE_EX+5) /*the same as _OSD_WEEK3*/
#define _OSD_CWEEK1_EX (_OSD_BASE_EX+6) /*the same as _OSD_CWEEK1*/
#define _OSD_HOUR24_EX (_OSD_BASE_EX+7) /*the same as _OSD_HOUR24*/
#define _OSD_HOUR12_EX (_OSD_BASE_EX+8) /*the same as _OSD_HOUR12*/
#define _OSD_MINUTE_EX (_OSD_BASE_EX+9) /*the same as _OSD_MINUTE*/
#define _OSD_SECOND_EX (_OSD_BASE_EX+10) /*the same as _OSD_SECOND*/
#define _OSD_MILISECOND_EX (_OSD_BASE_EX+11) /*the same as _OSD_MILISECOND*/
#define _OSD_APM_EX (_OSD_BASE_EX+14) /*the same as _OSD_APM*/
#endif
{
"Devices": []
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
#缺省不输出日志到控制台
#FATAL、ERROR、WARN、INFO、DEBUG 优先级顺序 如果子模块和根模块都匹配,那么都会输出
log4j.rootLogger=DEBUG, stdout
#log4j.rootLogger=DEBUG
##hlog.async=false
##hlog.secret.show=true
##hlog.secret.encrypt=false
#log4j.logger用于控制日志采集级别及采集内容,Threshold用于控制日志输出级别
#应用于控制台
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=[%d][%t][%-5p]- %m%n
log4j.logger.NPQ=TRACE, NPQ
log4j.appender.NPQ=org.apache.log4j.RollingFileAppender
log4j.appender.NPQ.File=./NPQLog/NPQ.log
log4j.appender.NPQ.MaxFileSize=80MB
log4j.appender.NPQ.MaxBackupIndex=12
log4j.appender.NPQ.Append=false
log4j.appender.NPQ.Threshold=TRACE
log4j.appender.NPQ.layout=org.apache.log4j.PatternLayout
log4j.appender.NPQ.layout.ConversionPattern=[%d][%t][%-5p]- %m%n
log4j.additivity.NPQ = false
#最后一位修改为true 既可以控制台输出又可以文件输出
############################################################################# #############################################################################
# Makefile for building: QUI_MVC # Makefile for building: XinHu_ASC
# Generated by qmake (3.1) (Qt 5.13.2) # Generated by qmake (3.1) (Qt 5.13.2)
# Project: QUI_MVC.pro # Project: XinHu_ASC.pro
# Template: app # Template: app
# Command: C:\Qt\Qt5.13.2\5.13.2\mingw73_32\bin\qmake.exe -o Makefile QUI_MVC.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug" # Command: C:\Qt\Qt5.13.2\5.13.2\mingw73_32\bin\qmake.exe -o Makefile XinHu_ASC.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug"
############################################################################# #############################################################################
MAKEFILE = Makefile MAKEFILE = Makefile
...@@ -63,7 +63,7 @@ release-install: FORCE ...@@ -63,7 +63,7 @@ release-install: FORCE
release-uninstall: FORCE release-uninstall: FORCE
$(MAKE) -f $(MAKEFILE).Release uninstall $(MAKE) -f $(MAKEFILE).Release uninstall
Makefile: QUI_MVC.pro C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/win32-g++/qmake.conf C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/spec_pre.prf \ Makefile: XinHu_ASC.pro C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/win32-g++/qmake.conf C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/spec_pre.prf \
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/qdevice.pri \ C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/qdevice.pri \
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/device_config.prf \ C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/device_config.prf \
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/common/sanitize.conf \ C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/common/sanitize.conf \
...@@ -233,6 +233,12 @@ Makefile: QUI_MVC.pro C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/win32-g++/qmake.c ...@@ -233,6 +233,12 @@ Makefile: QUI_MVC.pro C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/win32-g++/qmake.c
modeller_applog/applogmodel.pri \ modeller_applog/applogmodel.pri \
sqliteassistant/sqliteassistant.pri \ sqliteassistant/sqliteassistant.pri \
scanCode_control/scanCode_control.pri \ scanCode_control/scanCode_control.pri \
readEPC/readEPC.pri \
hkCapture_control/hkCapture_control.pri \
hkVideo_control/hkvideocontrol.pri \
eqptcontrol/eqptcontrol.pri \
eqptmodel/eqptmodel.pri \
voicecontrol/voicecontrol.pri \
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/resolve_config.prf \ C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/resolve_config.prf \
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/exclusive_builds_post.prf \ C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/exclusive_builds_post.prf \
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/default_post.prf \ C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/default_post.prf \
...@@ -251,14 +257,15 @@ Makefile: QUI_MVC.pro C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/win32-g++/qmake.c ...@@ -251,14 +257,15 @@ Makefile: QUI_MVC.pro C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/win32-g++/qmake.c
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/exceptions.prf \ C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/exceptions.prf \
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/yacc.prf \ C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/yacc.prf \
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/lex.prf \ C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/lex.prf \
QUI_MVC.pro \ XinHu_ASC.pro \
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/lib/Qt5Widgets.prl \ C:/Qt/Qt5.13.2/5.13.2/mingw73_32/lib/Qt5Widgets.prl \
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/lib/Qt5Gui.prl \ C:/Qt/Qt5.13.2/5.13.2/mingw73_32/lib/Qt5Gui.prl \
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/lib/Qt5Sql.prl \ C:/Qt/Qt5.13.2/5.13.2/mingw73_32/lib/Qt5Sql.prl \
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/lib/Qt5SerialPort.prl \ C:/Qt/Qt5.13.2/5.13.2/mingw73_32/lib/Qt5SerialPort.prl \
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/lib/Qt5TextToSpeech.prl \
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/lib/Qt5Core.prl \ C:/Qt/Qt5.13.2/5.13.2/mingw73_32/lib/Qt5Core.prl \
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/lib/qtmain.prl C:/Qt/Qt5.13.2/5.13.2/mingw73_32/lib/qtmain.prl
$(QMAKE) -o Makefile QUI_MVC.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug" $(QMAKE) -o Makefile XinHu_ASC.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug"
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/spec_pre.prf: C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/spec_pre.prf:
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/qdevice.pri: C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/qdevice.pri:
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/device_config.prf: C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/device_config.prf:
...@@ -429,6 +436,12 @@ C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/win32/default_pre.prf: ...@@ -429,6 +436,12 @@ C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/win32/default_pre.prf:
modeller_applog/applogmodel.pri: modeller_applog/applogmodel.pri:
sqliteassistant/sqliteassistant.pri: sqliteassistant/sqliteassistant.pri:
scanCode_control/scanCode_control.pri: scanCode_control/scanCode_control.pri:
readEPC/readEPC.pri:
hkCapture_control/hkCapture_control.pri:
hkVideo_control/hkvideocontrol.pri:
eqptcontrol/eqptcontrol.pri:
eqptmodel/eqptmodel.pri:
voicecontrol/voicecontrol.pri:
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/resolve_config.prf: C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/resolve_config.prf:
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/exclusive_builds_post.prf: C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/exclusive_builds_post.prf:
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/default_post.prf: C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/default_post.prf:
...@@ -447,15 +460,16 @@ C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/testcase_targets.prf: ...@@ -447,15 +460,16 @@ C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/testcase_targets.prf:
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/exceptions.prf: C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/exceptions.prf:
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/yacc.prf: C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/yacc.prf:
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/lex.prf: C:/Qt/Qt5.13.2/5.13.2/mingw73_32/mkspecs/features/lex.prf:
QUI_MVC.pro: XinHu_ASC.pro:
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/lib/Qt5Widgets.prl: C:/Qt/Qt5.13.2/5.13.2/mingw73_32/lib/Qt5Widgets.prl:
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/lib/Qt5Gui.prl: C:/Qt/Qt5.13.2/5.13.2/mingw73_32/lib/Qt5Gui.prl:
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/lib/Qt5Sql.prl: C:/Qt/Qt5.13.2/5.13.2/mingw73_32/lib/Qt5Sql.prl:
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/lib/Qt5SerialPort.prl: C:/Qt/Qt5.13.2/5.13.2/mingw73_32/lib/Qt5SerialPort.prl:
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/lib/Qt5TextToSpeech.prl:
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/lib/Qt5Core.prl: C:/Qt/Qt5.13.2/5.13.2/mingw73_32/lib/Qt5Core.prl:
C:/Qt/Qt5.13.2/5.13.2/mingw73_32/lib/qtmain.prl: C:/Qt/Qt5.13.2/5.13.2/mingw73_32/lib/qtmain.prl:
qmake: FORCE qmake: FORCE
@$(QMAKE) -o Makefile QUI_MVC.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug" @$(QMAKE) -o Makefile XinHu_ASC.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug"
qmake_all: FORCE qmake_all: FORCE
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
QT += core gui sql serialport QT += core gui sql serialport texttospeech
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
...@@ -52,6 +52,18 @@ include(modeller_applog/applogmodel.pri) ...@@ -52,6 +52,18 @@ include(modeller_applog/applogmodel.pri)
include(sqliteassistant/sqliteassistant.pri) include(sqliteassistant/sqliteassistant.pri)
#添加扫码模块 #添加扫码模块
include(scanCode_control/scanCode_control.pri) include(scanCode_control/scanCode_control.pri)
#添加读卡模块
include(readEPC/readEPC.pri)
#添加抓拍机控制模块
include(hkCapture_control/hkCapture_control.pri)
#添加监控机控制模块
include(hkVideo_control/hkvideocontrol.pri)
#添加外围控制模块
include(eqptcontrol/eqptcontrol.pri)
#添加外围控制逻辑模块
include(eqptmodel/eqptmodel.pri)
#添加语音模块
include(voicecontrol/voicecontrol.pri)
# Default rules for deployment. # Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin
...@@ -59,3 +71,8 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin ...@@ -59,3 +71,8 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin
RESOURCES += \ RESOURCES += \
image.qrc image.qrc
win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/HKSDK6.0.0.20/ -lHCNetSDK
INCLUDEPATH += $$PWD/HKSDK6.0.0.20
DEPENDPATH += $$PWD/HKSDK6.0.0.20
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.10.1, 2022-02-11T17:26:34. --> <!-- Written by QtCreator 4.10.1, 2022-02-14T16:12:14. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:/ZYL_JM/GitLab/Git_JM_ACS/JM_PRO/QUI_MVC</value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">F:/XinHu/XinHu_ASC/XinHuCoalMine</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap> </valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:/ZYL_QT/Qt_Test/build-QUI_MVC-Desktop_Qt_5_13_2_MinGW_32_bit-Release</value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">F:/XinHu/XinHu_ASC/build-XinHu_ASC-Desktop_Qt_5_13_2_MinGW_32_bit-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
...@@ -183,7 +183,7 @@ ...@@ -183,7 +183,7 @@
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap> </valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:/ZYL_QT/Qt_Test/build-QUI_MVC-Desktop_Qt_5_13_2_MinGW_32_bit-Profile</value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">F:/XinHu/XinHu_ASC/build-XinHu_ASC-Desktop_Qt_5_13_2_MinGW_32_bit-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
...@@ -305,9 +305,9 @@ ...@@ -305,9 +305,9 @@
</valuelist> </valuelist>
<value type="int" key="PE.EnvironmentAspect.Base">2</value> <value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">QUI_MVC</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">XinHu_ASC</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">QUI_MVC2</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:E:/ZYL_JM/GitLab/Git_JM_ACS/JM_PRO/QUI_MVC/QUI_MVC.pro</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:F:/XinHu/XinHu_ASC/XinHuCoalMine/XinHu_ASC.pro</value>
<value type="QString" key="RunConfiguration.Arguments"></value> <value type="QString" key="RunConfiguration.Arguments"></value>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value> <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
...@@ -317,7 +317,7 @@ ...@@ -317,7 +317,7 @@
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory"></value> <value type="QString" key="RunConfiguration.WorkingDirectory"></value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">E:/ZYL_JM/GitLab/Git_JM_ACS/JM_PRO/QUI_MVC/bin</value> <value type="QString" key="RunConfiguration.WorkingDirectory.default">F:/XinHu/XinHu_ASC/XinHuCoalMine/bin</value>
</valuemap> </valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value> <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap> </valuemap>
......
No preview for this file type
File:(sqliteassistant\sqliteassistant.cpp) Line:(30) Function:long int SqliteAssistant::connectSql() Succeed to connect database. (2022-02-14 15:05:44 周一)
File:(main.cpp) Line:(26) Function:int qMain(int, char**) connectSql ok (2022-02-14 15:05:44 周一)
File:(mainwindow.cpp) Line:(164) Function:void MainWindow::SoftStart() 软件启动时间: "2022-02-14 15:05:44" (2022-02-14 15:05:44 周一)
File:(mainwindow.cpp) Line:(191) Function:void MainWindow::SoftClose() 软件关闭时间: "2022-02-14 15:27:05" (2022-02-14 15:27:05 周一)
This source diff could not be displayed because it is too large. You can view the blob instead.
File:(kernel\qwidget.cpp) Line:(1145) Function: ASSERT failure in QWidget: "Widgets must be created in the GUI thread.", file kernel\qwidget.cpp, line 1145 (2022-02-16 10:49:47 )
File:(kernel\qwidget.cpp) Line:(1145) Function: ASSERT failure in QWidget: "Widgets must be created in the GUI thread.", file kernel\qwidget.cpp, line 1145 (2022-02-16 11:00:35 )
File:(kernel\qwidget.cpp) Line:(1145) Function: ASSERT failure in QWidget: "Widgets must be created in the GUI thread.", file kernel\qwidget.cpp, line 1145 (2022-02-16 14:51:41 )
#ifndef BRIDGE_H #ifndef BRIDGE_H
#define BRIDGE_H #define BRIDGE_H
#include <QMutex>
#include <QObject> #include <QObject>
#include "readEPC/readepccontrol.h" //读卡器模块
#include "eqptcontrol/eqptcontrol.h" //硬件控制模块
#include "hkCapture_control/cameracontrol.h" //海康抓拍机模块
#include "hkVideo_control/hkvideocontrol.h" //海康监控机模块
#include <QThread> #include <QThread>
#include <windows.h> #include <windows.h>
//#include "getPcInfo_model/globalapiclass.h" //获取电脑信息
//#include "meter_control/tcpcontrol.h" // 仪表控制--TCP链接
//#include "meter_model/metermodel.h" // 仪表数据处理
//#include "eqpt_control/eqptcontrol.h" // 外围设备控制
//#include "eqpt_model/eqptmodel.h"
//#include "hkCapture_control/cameracontrol.h" // 抓拍机控制模块
//#include "rightCarmera_control/rightcarmeracontrol.h" // 右侧相机控制
//#include "leftCarmera_control/leftcarmeracontrol.h" // 左侧相机控制
//#include "picToBase64_model/pictobase64model.h" //图片转换控制
////#include "sqlite_control/sqlitecontrol.h" //数据库管理模块
////#include "voice_view/voiceview.h" // 语音管理模块
#include "scanCode_control/scancodecontrol.h" //扫码模块
//#include "tcpTools_control/tcptoolscontrol.h" //TCP控制模块
//#include "tcpTools_model/tcptoolsmodel.h" //TCP数据管理模块
//#include "led_model/yangbangscreen.h"
//#include "weightinfo.h"
using namespace std; using namespace std;
class Bridge : public QObject class Bridge : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
~Bridge(); explicit Bridge(QObject *parent = nullptr);
//单例模式 ReadEPCControl *m_ReadEPCControl; //定义EPC对象
static Bridge* GetInstance(); EqptControl *m_EqptControl; //定义硬件控制对象
//声明模块 CameraControl *m_CameraControl; //定义抓拍机对象
//TcpControl *m_TcpControl; HkVideoControl *m_HkVideoControl; //定义监控机对象
//MeterModel *m_MeterModel;
QString m_subnum; //缓存业务流水号
//EqptControl *m_EqptControl;
//EqptModel *m_EqptModel;
//CameraControl *m_CameraControl;
//RightCarmeraControl *m_RightCarmeraControl;
// LeftCarmeraControl *m_LeftCarmeraControl;
// PicToBase64Model *m_PicToBase64Model;
// PicToBase64Model_LeftPic *m_PicToBase64Model_LeftPic;
// PicToBase64Model_CarPic *m_PicToBase64Model_CarPic;
// PicToBase64Model_CarPlnumPic *m_PicToBase64Model_CarPlnumPic;
// SqliteControl *m_SqliteControl;
ScanCodeControl *m_ScanCodeControl;
// TcpToolsControl *m_TcpToolsControl;
// TcpToolsModel *m_TcpToolsModel;
// yangbangScreen *m_yangbangScreen;
public:
//更改状态
void CD_is_startCheck();
//通过回调函数,更新Ui界面数据;
QString UpDataUi_WeighingData();
QString UpDataUi_carInTime();
QString UpDataUi_carOutTime();
signals: signals:
//仪表线程启动信号 ///读卡器信号
void SendToTcpControl_threadStart(); void SendToReadEPCControl_Connect(QString comName,long comBund);
//外围设备线程启动信号 void SendToReadEPCControl_Close();
void SendToEqptControl_threadStart(); void SendToWindow(QString data);
//通过界面绿灯 void SendToWindowRFIDStatus(bool status); //告知读卡器状态
void SendToEqptControl_HeadGreen();
void SendToEqptControl_HeadRed();
void SendToEqptControl_HeadTrunkUp();
void SendToEqptControl_HeadTrunkUpRelease();
void SendToEqptControl_HeadTrunkLock();
void SendToEqptControl_HeadTrunkUnLock();
void SendToEqptControl_HeadTrunkDown();
void SendToEqptControl_HeadTrunkDownRelease();
void SendToEqptControl_LastTrunkUp();
void SendToEqptControl_LastTrunkLock();
void SendToEqptControl_LastTrunkUnLock();
void SendToEqptControl_LastTrunkUpRelease();
void SendToEqptControl_LastTrunkDown();
void SendToEqptControl_LastTrunkDownRelease();
void SendToEqptControl_LastGreen();
void SendToEqptControl_LastRed();
void SendToEqptControl_CartchPic();
//抓拍机控制 ///硬件控制信号
void SendToCameraControl_Login(); void SendToEqptControl_Connect(QString comName,long comBund);
void SendToCameraControl_Catchpic(); void SendToEqptControl_SnapByHand(); //手动抓拍
// //右侧相机 void SendToEqptControl_HTrunkUp(); //抬起道闸
void SendToRightCarmeraControl_Login(); void SendToEqptControl_HTrunkDown();
void SendToRightCarmeraControl_CatchRightpic(); void SendToEqptControl_Close();
// //左侧相机
void SendToLeftCarmeraControl_Login();
void SendToLeftCarmeraControl_CatchLeftpic();
//图片转换
void SendToPicToBase64Model_Strat(QString data);
void SendToPicToBase64Model_LeftPic_Strat(QString data);
void SendToPicToBase64Model_CarPic_Strat(QString data);
void SendToPicToBase64Model_CarPlnumPic_Strat(QString data);
// 数据库
void SendToSqliteControl_OpenDB(); //打开数据库
// void SendToSqliteControl_InsertDB(Vehicle_info &info); //插入数据库
void SendToSqliteControl_DeletDB(); //删除数据库
void SendToSqliteControl_UpDataDB(); //更新数据库
void SendToSqliteControl_SelectDB(); //查询数据库
//扫码 ///抓拍机控制信号
void SendToScanCodeControl_Start(); void SendToCameraControl_Connect(QString ip,int port,QString user,QString pwd);
//TCP
void SendToTcpToolsControl_Connect(); //连接服务器
void SendToTcpToolsControl_Register(QByteArray data); //连接服务器
void SendToTcpToolsControl_Enter1(QByteArray data); //模式一入场
void SendToTcpToolsControl_ScanCodeStart(QByteArray data); //发送扫码数据
void SendToTcpToolsControl_ScanEnter(QByteArray data); //扫码入场
void SendToTcpToolsControl_Enter2(QByteArray data); //模式二入场
void SendToTcpToolsControl_HeadTrunk(QByteArray data); //前道闸
void SendToTcpToolsControl_Out(QByteArray data); //出场
void SendToTcpToolsControl_ScanOut(QByteArray data); //出场
void SendToTcpToolsControl_Weight(QByteArray data); //称重
void SendToTcpToolsControl_ScanCodeWeight(QByteArray data); //扫码称重
void SendToTcpToolsControl_Error(QByteArray data); //异常
//TCP_MODEL
void SendToTcpToolsModel_Register(); //站点注册
void SendToTcpToolsModel_Enter1(); //模式一入场
void SendToTcpToolsModel_ScanEnter(); //扫码入场
void SendToTcpToolsModel_ScanCodeStart(); //扫码开始称重
void SendToTcpToolsModel_Enter2(); //模式二入场
void SendToTcpToolsModel_HeadTrunk(); //前道闸
void SendToTcpToolsModel_ScanCodeWeight(); //扫码称重
void SendToTcpToolsModel_Out(); //出场
void SendToTcpToolsModel_ScanOut(); //出场
void SendToTcpToolsModel_Weight(); //称重
void SendToTcpToolsModel_Error(); //异常
//LCD 显示屏
void SendToyangbangScreen_Login(); //登陆
//发送给界面提示称重开始
void SendToUi_ScanCodeWeightStart();
void SendToUi_ScanCodeReplay();
void SendToUi_ScanCodeReplayError();
///监控机控制信号
void SendToHkVideoControl_Connect(QString ip,int port,QString user,QString pwd);
public slots: public slots:
private: private:
Bridge(); void Func_ReadEPCControl(); //读卡器槽函数
void Func_EqptControl(); //硬件控制槽函数
static Bridge *m_instance; void Func_CameraControl(); //抓拍机控制槽函数
static QMutex m_mutex; void Func_HkVideoControl(); //抓拍机控制槽函数
QThread *m_TcpControl_Thread;
QThread *m_EqptControl_Thread;
QThread *m_CameraControl_Thread;
QThread *m_RightCarmeraControl_Thread;
QThread *m_LeftCarmeraControl_Thread;
QThread *m_PicToBase64Model_Thread;
QThread *m_PicToBase64Model_LeftPic_Thread;
QThread *m_PicToBase64Model_CarPic_Thread;
QThread *m_PicToBase64Model_CarPlnumPic_Thread;
QThread *m_SqliteControl_Thread;
QThread *m_ScanCodeControl_Thread;
QThread *m_TcpToolsControl_Thread;
void BridgeToTcpControl_connect(); // 桥和仪表之间的通讯
void BridgeToEqptControl_connect(); // 桥和外围设备之间的通讯
void BridgeToEqptModel_connect(); // 桥和外围处理设备之间的通讯
void BridgeToCameraControl_connect(); // 桥和抓拍机之间的通讯
void BridgeToRightCarmeraControl_connect(); // 桥和右侧相机之间的通讯
void BridgeToLeftCarmeraControl_connect(); // 桥和左侧相机之间的通讯
void BridgeToPicToBase64Model_connect(); // 桥和图片转换器之间的通讯
void BridgeToSqliteControl_connect(); // 桥和数据库之间的通讯
void BridgeToScanCodeControl_connect(); // 桥和扫码模块之间的通讯
void BridgeToTcpToolsControl_connect(); // 桥和TCP控制模块之间的通讯
void BridgeToTcpToolsModel_connect(); // 桥和TCP控制模块之间的通讯
void BridgeToyangbangScreen_connect(); // 桥和LCD控制模块之间的通讯
string QByteToCStr(QByteArray data);
string strTime();
private: private:
//实时称重 QThread *m_ReadEPCControl_thread; //定读卡器子线程
QString m_WeighingData_timely; //实时称重数据 QThread *m_EqptControl_thread; //定硬件控制子线程
QString plateNum = ""; QThread *m_CameraControl_thread; //抓拍机控制子线程
QString picPath = ""; QThread *m_HkVideoControl_thread; //监控机控制子线程
bool is_weight = false;
bool is_startCheck = false;
QTimer *m_Headtimer;
QTimer *m_Headtimer2;
QTimer *m_Lasttimer;
QTimer *m_Lasttimer2;
}; };
#endif // BRIDGE_H #endif // BRIDGE_H
#include "comchange.h"
#include <QApplication>
#include <QMutex>
#include <QSerialPort>
#include <QSerialPortInfo>
#include <qdebug.h>
ComChange* ComChange::m_comChange = nullptr;
ComChange *ComChange::getInstance()
{
if(m_comChange == nullptr)
{
static QMutex mutex; //实例互斥锁。
QMutexLocker locker(&mutex); //加互斥锁。
if(m_comChange == nullptr)
{
m_comChange = new ComChange();
}
}
return m_comChange;
}
/**
* @brief 获取系统中所有可用的串口名
* @return
*/
QStringList ComChange::getAvailablePort()
{
QStringList strName;
foreach(const QSerialPortInfo& info, QSerialPortInfo::availablePorts())
{
QSerialPort port(info);
if(port.open(QIODevice::ReadWrite))
{
strName << info.portName();
port.close();
}
}
return strName;
}
/**
* @brief 设置窗口句柄用于过滤事件
* @param hwnd
*/
void ComChange::setHWND(HWND hwnd)
{
this->m_hwnd = hwnd;
}
ComChange::ComChange(QObject *parent) : QObject(parent)
{
qApp->installNativeEventFilter(this); // 安装事件过滤器
}
bool ComChange::nativeEventFilter(const QByteArray &eventType, void *message, long *result)
{
MSG* msg = reinterpret_cast<MSG*>(message);
if(msg->message == WM_DEVICECHANGE // 通知应用程序设备或计算机的硬件配置发生更改。
&& msg->hwnd == this->m_hwnd) // 过滤事件
{
PDEV_BROADCAST_HDR lpdb = (PDEV_BROADCAST_HDR)msg->lParam;
switch (msg->wParam)
{
case DBT_DEVICEARRIVAL: // 插入
{
if (lpdb->dbch_devicetype == DBT_DEVTYP_PORT) // 设备类型为串口
{
PDEV_BROADCAST_PORT lpdbv = (PDEV_BROADCAST_PORT)lpdb;
QString strName = QString::fromWCharArray(lpdbv->dbcp_name); //插入的串口名
emit comStatus(strName, true);
}
break;
}
case DBT_DEVICEREMOVECOMPLETE: // 拔出
{
if (lpdb->dbch_devicetype == DBT_DEVTYP_PORT) // 设备类型为串口
{
PDEV_BROADCAST_PORT lpdbv = (PDEV_BROADCAST_PORT)lpdb;
QString strName = QString::fromWCharArray(lpdbv->dbcp_name); //拔出的串口名
emit comStatus(strName, false);
}
break;
}
default:
break;
}
}
return false;
}
/******************************************************************************
* @文件名 comchange.h
* @功能 通过继承于QAbstractNativeEventFilter来监测串口热插拔由于windows消息会发给每一个窗口,
* 所以如果打开多个窗或者使用到如QComboBox之类的控件,当串口插入或者拔出时会触发多次事件,
* 在这里我使用的解决方法时传入一个窗口句柄,通过窗口句柄过滤事件,但不知道有没有其它更好的办法。
*
* @开发者 (作者)
* @时间 2021/11/15
* @备注
*****************************************************************************/
#ifndef COMCHANGE_H
#define COMCHANGE_H
#include <QObject>
#include <qabstractnativeeventfilter.h>
#include <windows.h>
#include "dbt.h"
class ComChange : public QObject, public QAbstractNativeEventFilter
{
Q_OBJECT
public:
static ComChange* getInstance();
static QStringList getAvailablePort();
void setHWND(HWND hwnd);
private:
explicit ComChange(QObject *parent = nullptr);
protected:
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result);
signals:
/**
* @brief 传出串口热插拔状态
* @param name 串口名
* @param flag true:插入 false:拔出
*/
void comStatus(QString name, bool flag);
private:
static ComChange* m_comChange;
HWND m_hwnd;
};
#endif // COMCHANGE_H
++ "b/comChange/\344\270\262\345\217\243\347\203\255\346\217\222\346\213\224\346\250\241\345\235\227"
#include "eqptcontrol.h"
#include <QThread>
#include <QDebug>
#include <QTimer>
EqptControl::EqptControl(QObject *parent) : QObject(parent)
{
}
void EqptControl::setComm(QString ComName, long baudRate)
{
qDebug()<<"硬件控制子线程:"<< QThread::currentThreadId()<<ComName<<baudRate;
SerialPort = new QSerialPort(this);
// 设置串口号
SerialPort->setPortName(ComName);
// 打开串口
if(SerialPort->open(QIODevice::ReadWrite))
{
// 设置波特率
SerialPort->setBaudRate(baudRate);
SerialPort->setDataBits(QSerialPort::Data8);
SerialPort->setParity(QSerialPort::NoParity);
// 设置流控制
SerialPort->setFlowControl(QSerialPort::NoFlowControl);
SerialPort->setStopBits(QSerialPort::OneStop);
qDebug()<<"打开RFID";
emit SendRFIDStatus(true);
}else {
qDebug()<<"打开道闸控制失败";
emit SendRFIDStatus(false);
}
connect(SerialPort,&QSerialPort::readyRead,this,[=](){
QByteArray data = SerialPort->readAll();
//QString str(SerialPort.readAll());
//qDebug()<<"接收到的初始数据:"<<data;
emit SendToBridge(data);
});
connect(this,&EqptControl::SendToSelf_Close,this,[=](){
SerialPort->close();
emit SendRFIDStatus(false);
});
///控制信号触发
connect(this,&EqptControl::SendToSelf_HeadTrunkUp,this,[=](){
//抬起门禁道闸
SerialPort->write(WriteData(m_head_trunk_up));
QTimer *m_headTimer = new QTimer(this);
m_headTimer->start(300);
connect(m_headTimer,&QTimer::timeout,this,[=](){
//抬起前道闸释放
m_headTimer->stop();
SerialPort->write(WriteData(m_head_trunk_up2));
});
});
///落道闸信号
connect(this,&EqptControl::SendToSelf_HeadTrunkDown,this,[=](){
//落下门禁道闸
SerialPort->write(WriteData(m_head_trunk_down));
QTimer *m_lastTimer = new QTimer(this);
m_lastTimer->start(300);
connect(m_lastTimer,&QTimer::timeout,this,[=](){
//落下前道闸释放
m_lastTimer->stop();
SerialPort->write(WriteData(m_head_trunk_down2));
});
});
connect(this,&EqptControl::SendToSelf_SnapByHand,this,[=](){
SerialPort->write(WriteData(m_snap));
QTimer *m_SnapTimer = new QTimer(this);
m_SnapTimer->start(300);
connect(m_SnapTimer,&QTimer::timeout,this,[=](){
//落下前道闸释放
m_SnapTimer->stop();
SerialPort->write(WriteData(m_snap_r));
});
});
}
QByteArray EqptControl::WriteData(QString order)
{
QByteArray Data_1;
QString Data = order;
Data_1 = QByteArray::fromHex (Data.toLatin1().data());
return Data_1;
}
/**
* @projectName XinHu_ASC
* @brief 摘要
* 外围设备控制,目前支持串口方式连接
*
* @author ZhangYL
* @date 2022-02-16
*/
#ifndef EQPTCONTROL_H
#define EQPTCONTROL_H
#include <QObject>
#include <QSerialPort>
class EqptControl : public QObject
{
Q_OBJECT
public:
explicit EqptControl(QObject *parent = nullptr);
signals:
void SendToBridge(QByteArray data);
void SendRFIDStatus(bool status);
//自己的信号
void SendToSelf_Close();
void SendToSelf_HeadTrunkUp();
void SendToSelf_HeadTrunkUpRelease();
void SendToSelf_HeadTrunkLock();
void SendToSelf_HeadTrunkUnLock();
void SendToSelf_HeadTrunkDown();
void SendToSelf_HeadTrunkDownRelease();
void SendToSelf_SnapByHand();
public slots:
void setComm(QString ComName,long baudRate); //打开串口
private:
QSerialPort *SerialPort;
private:
QByteArray WriteData(QString order); //组装命令
private:
///控制指令
QString m_head_trunk_up = "01 05 08 15 FF 00 9F 9E";
QString m_head_trunk_up2 = "01 05 08 15 00 00 DE 6E";
QString m_head_trunk_down = "01 05 08 16 FF 00 6F 9E";
QString m_head_trunk_down2 = "01 05 08 16 00 00 2E 6E";
//相机抓拍参数
QString m_snap = "01 05 08 19 FF 00 5F 9D";
QString m_snap_r = "01 05 08 19 00 00 1E 6D";
};
#endif // EQPTCONTROL_H
HEADERS += \
$$PWD/eqptcontrol.h
SOURCES += \
$$PWD/eqptcontrol.cpp
++ "b/eqptcontrol/\347\241\254\344\273\266\346\216\247\345\210\266\346\250\241\345\235\227-\351\201\223\351\227\270"
#include "eqptmodel.h"
EqptModel::EqptModel(QObject *parent) : QObject(parent)
{
}
void EqptModel::RecvEqptData(QString data)
{
}
/**
* @projectName XinHu_ASC
* @brief 摘要
* 外围控制逻辑模块
* @author ZhangYL
* @date 2022-02-16
*/
#ifndef EQPTMODEL_H
#define EQPTMODEL_H
#include <QObject>
class EqptModel : public QObject
{
Q_OBJECT
public:
explicit EqptModel(QObject *parent = nullptr);
signals:
public slots:
void RecvEqptData(QString data); //接受原始硬件数据
};
#endif // EQPTMODEL_H
HEADERS += \
$$PWD/eqptmodel.h
SOURCES += \
$$PWD/eqptmodel.cpp
++ "b/eqptmodel/\345\244\226\345\233\264\346\216\247\345\210\266\351\200\273\350\276\221\346\250\241\345\235\227"
This source diff could not be displayed because it is too large. You can view the blob instead.
#include "cameracontrol.h"
#include <QDebug>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <streambuf>
#include <time.h>
#include <conio.h>//getch()函数用
#include <QMessageBox>
#include "myhelper.h"
using namespace std;
//参数定义
static int iNum = 1; //车图片名称序号
static int pNum = 1; //车牌图序号
string LineByLine;//逐行读取文件
string carNum;//车牌号
QString carNum1 = nullptr;
QString car_pic;
QString carplnum_pic;
//判断是否有车
bool IsSendCarPic = false;
CameraControl::CameraControl(QObject *parent) : QObject(parent)
{
CarIsComingTimer = new QTimer;
CarIsComingTimer->start(800);
connect(CarIsComingTimer,&QTimer::timeout,this,[=](){
//轮询是否有车辆进入识别区
if(carNum1.isEmpty()){
//无预警
return;
}
if(!carNum1.isEmpty()){
if(carNum1 == "无车牌"){
//未识别到车牌,有车辆到来,语音提示;
qDebug()<<"未识别到车牌,有车辆到来,语音提示;";
emit SendToBridge_CarPic(car_pic,nullptr,nullptr);
}else {
//识别车牌成功,语音提示上磅;
QString carPlnum = carNum1;
qDebug()<<"carPlnum"<<carPlnum;
//emit SendToBridge_CarPlnum(carPlnum);
emit SendToBridge_CarPic(car_pic,carplnum_pic,carPlnum);
//emit SendToBridge_CarPlnumPic(carplnum_pic);
}
}
carNum1 = nullptr;
});
}
BOOL CALLBACK MSesGCallback(LONG lCommand, NET_DVR_ALARMER *pAlarmer, char *pAlarmInfo, DWORD dwBufLen, void* pUser)
{
QDateTime currentDateTime = QDateTime::currentDateTime();
QString str_time = currentDateTime.toString("yyyyMMddhhmmss");
string s_time = str_time.toStdString();
DWORD i=0;
char filename[100];
FILE *fSnapPic=nullptr;
FILE *fSnapPicPlate=nullptr;
//以下代码仅供参考,实际应用中不建议在该回调函数中直接处理数据保存文件,
//例如可以使用消息的方式(PostMessage)在消息响应函数里进行处理。
switch (lCommand)
{
case COMM_ITS_PLATE_RESULT:
{
NET_ITS_PLATE_RESULT struITSPlateResult={0};
memcpy(&struITSPlateResult, pAlarmInfo, sizeof(struITSPlateResult));
string plateNum(struITSPlateResult.struPlateInfo.sLicense);
QString str =QString::fromLocal8Bit(plateNum.c_str());
carNum1 = str;
if(carNum1!="无车牌"){
carNum1 = carNum1.right(carNum1.size()-1);
}
//qDebug()<<"车牌号:"<<carNum1;//车牌号
for (i=0;i<struITSPlateResult.dwPicNum;i++)
{
if ((struITSPlateResult.struPicInfo[i].dwDataLen != 0)
&&
(struITSPlateResult.struPicInfo[i].byType==1)
||
(struITSPlateResult.struPicInfo[i].byType == 2))
{
sprintf(filename,"C:\\AFrontPicture\\%s_%s_CarPic.jpg",plateNum.c_str(),s_time.c_str());
car_pic = QString::fromLocal8Bit(filename);
qDebug()<<"car_pic:"<<car_pic;
fSnapPic=fopen(filename,"wb");
fwrite(struITSPlateResult.struPicInfo[i].pBuffer, struITSPlateResult.struPicInfo[i].dwDataLen,1,fSnapPic);
//iNum++;
fclose(fSnapPic);
//SendCarPic_True();
}
//车牌小图片
if ((struITSPlateResult.struPicInfo[i].dwDataLen != 0)&&(struITSPlateResult.struPicInfo[i].byType == 0))
{
sprintf(filename,"C:\\AFrontPicture\\%s_%s_PlatePic.jpg",plateNum.c_str(),s_time.c_str());
fSnapPicPlate=fopen(filename,"wb");
carplnum_pic = QString::fromLocal8Bit(filename);
qDebug()<<"carplnum_pic:"<<carplnum_pic;
fwrite(struITSPlateResult.struPicInfo[i].pBuffer, struITSPlateResult.struPicInfo[i].dwDataLen, 1, \
fSnapPicPlate);
fclose(fSnapPicPlate);
}
//其他信息处理......
iNum++;
++pNum;
}
break;
}
default:
break;
}
}
long CameraControl::play(HWND hWnd, NET_DVR_PREVIEWINFO struPlayInfo, long userID)
{
struPlayInfo={0};
struPlayInfo.hPlayWnd = hWnd;//需要 SDK 解码时句柄设为有效值,仅取流不解码时可设为空
struPlayInfo.lChannel = 1;//预览通道号
struPlayInfo.dwStreamType = 0;//码流类型:0-主码流,1-子码流,2-三码流,3-虚拟码流,以此类推
struPlayInfo.dwLinkMode = 0;//0- TCP 方式,1- UDP 方式,2- 多播方式,3- RTP 方式,4-RTP/RTSP,5-RSTP/HTTP
struPlayInfo.bBlocked = 1;//0- 非阻塞取流,1- 阻塞取流
long IRealPlayHandle = NET_DVR_RealPlay_V40(userID,&struPlayInfo,NULL,NULL);
if(IRealPlayHandle <0)
{
qDebug() << "NET_DVR_RealPlay_V40 error;error number " <<NET_DVR_GetLastError();
myHelper::ShowMessageBoxError(QString::number(NET_DVR_GetLastError()));
//QMessageBox::warning(NULL,"error","NET_DVR_RealPlay_V40 error;error number "+);
NET_DVR_Logout(userID);
userID=-1;
return -1;
}
return IRealPlayHandle;
}
long CameraControl::setupAlarm()
{
//设置报警回调函数
char logInfo[128] = { 0 };
NET_DVR_SetDVRMessageCallBack_V31(MSesGCallback,&userID);
//启用布防
NET_DVR_SETUPALARM_PARAM struSetupParam = { 0 };
struSetupParam.dwSize = sizeof(NET_DVR_SETUPALARM_PARAM);
struSetupParam.byLevel = 1; //布防优先级:0- 一等级(高),1- 二等级
struSetupParam.byAlarmInfoType = 1; //上传报警信息类型: 0- 老报警信息(NET_DVR_PLATE_RESULT), 1- 新报警信息(NET_ITS_PLATE_RESULT)
struSetupParam.byDeployType = 1;
LONG lHandle = NET_DVR_SetupAlarmChan_V41(userID, &struSetupParam);
if (lHandle < 0)
{
sprintf_s(logInfo, "Thread-Alarm-In 启用布防失败 %s,error,%d", userID, NET_DVR_GetLastError());
isAlarm =false;
return lHandle;
}
qDebug()<<"Thread-Alarm-In 启用布防成功"<< userID<<"error"<<NET_DVR_GetLastError();
isAlarm =true;
return lHandle;
}
bool CameraControl::initSDK()
{
bool isok = NET_DVR_Init();
if(isok == false)
{
qDebug()<< "NET_DVR_Init error;error number is " <<NET_DVR_GetLastError();
QMessageBox::warning(NULL,"error","NET_DVR_Init error;error number is "+QString::number(NET_DVR_GetLastError()));
return isok;
}
//设置连接时间与重连时间
NET_DVR_SetConnectTime(2000, 1);
NET_DVR_SetReconnect(10000, true);
return isok;
}
bool CameraControl::uninitSDK()
{
bool isok = NET_DVR_Cleanup();
if(isok == false)
{
qDebug()<< "NET_DVR_Cleanup error;error number is " <<NET_DVR_GetLastError();
QMessageBox::warning(NULL,"error","NET_DVR_Cleanup error;error number "+QString::number(NET_DVR_GetLastError()));
return isok;
}
return isok;
}
void CameraControl::OnClickedLogin(QString ip, int port, QString user, QString pwd)
{
initSDK();
NET_DVR_DEVICEINFO_V30 DeviceInfoTmp;
char * ipc = new char[strlen(ip.toStdString().c_str()) + 1];
strcpy_s(ipc, strlen(ip.toStdString().c_str()) + 1, ip.toStdString().c_str());
char * userc = new char[strlen(user.toStdString().c_str()) + 1];
strcpy_s(userc, strlen(user.toStdString().c_str()) + 1, user.toStdString().c_str());
char * pwdc = new char[strlen(pwd.toStdString().c_str()) + 1];
strcpy_s(pwdc, strlen(pwd.toStdString().c_str()) + 1, pwd.toStdString().c_str());
//NET_DVR_Login_V30(char *sDVRIP, WORD wDVRPort, char *sUserName, char *sPassword, LPNET_DVR_DEVICEINFO_V30 lpDeviceInfo);
userID=NET_DVR_Login_V30(ipc,port,userc,pwdc,&DeviceInfoTmp);
if(userID<0)
{
qDebug() << "NET_DVR_Login_V30 error;" << "error number is " << NET_DVR_GetLastError();
QMessageBox::warning(NULL,"error","NET_DVR_Login_V30 error;error number "+QString::number(NET_DVR_GetLastError()));
return;
}
qDebug()<<"车牌识别相机 Login Success,userID:" << userID<<endl;
setupAlarm();
emit SendToBridge_LoginOk();
}
void CameraControl::OnClickedLogout()
{
}
void CameraControl::OnClickedPreview()
{
}
void CameraControl::OnClickedStopPreview()
{
}
void CameraControl::OnClickedCapture()
{
}
void CameraControl::Picinfo(QByteArray ba)
{
}
void CameraControl::Get_PlateNum()
{
}
void CameraControl::Get_PlatePic()
{
}
void CameraControl::Get_CarPic()
{
}
#ifndef CAMERACONTROL_H
#define CAMERACONTROL_H
#include <QObject>
#include <QDateTime>
#include <QTimer>
#include "HCNetSDK.h"
#include <windows.h>
using namespace std;
class CameraControl : public QObject
{
Q_OBJECT
public:
explicit CameraControl(QObject *parent = nullptr);
long play(HWND hWnd,NET_DVR_PREVIEWINFO struPlayInfo,long userID);
long setupAlarm();
bool initSDK();
bool uninitSDK();
signals:
//发送车牌号;
void SendToBridge_CarPlnum(QString data);
void SendToBridge_CarPic(QString data1,QString data2,QString data3); //车头图,车牌图,车牌号,
void SendToBridge_CarPlnumPic(QString data);
void SendToBridge_LoginOk();
public slots:
//摄像头登录
void OnClickedLogin(QString ip, int port,QString user,QString pwd);
//摄像头退出登录
void OnClickedLogout();
//摄像头预览
void OnClickedPreview();
//摄像头停止预览
void OnClickedStopPreview();
//普通抓拍(不是车牌识别抓拍)
void OnClickedCapture();
void Picinfo(QByteArray ba);
//获取车牌号
void Get_PlateNum();
//获取车牌图
void Get_PlatePic();
//获取车头图
void Get_CarPic();
//测试显示车牌
//void Show_Get_PlateNum(QString num);
//定时器,轮询抓拍机,是否有车辆到来
//void CarIsComingTimer_timeout();
private:
QTimer *CarIsComingTimer;
private:
bool isAlarm;
long userID;
long previewID;
//传递车牌号
QString carNumpublic;
//车头图片路径
QString CarPicPath;
//车牌路径
QString PlatePicPath;
};
#endif // CAMERACONTROL_H
HEADERS += \
$$PWD/HCNetSDK.h \
$$PWD/cameracontrol.h
SOURCES += \
$$PWD/cameracontrol.cpp
++ "b/hkCapture_control/\346\265\267\345\272\267\346\212\223\346\213\215\346\234\272\346\216\247\345\210\266\346\250\241\345\235\227"
This source diff could not be displayed because it is too large. You can view the blob instead.
#include "hkvideocontrol.h"
#include <QDebug>
#include <QMessageBox>
HkVideoControl::HkVideoControl(QObject *parent) : QObject(parent)
{
}
bool HkVideoControl::initSDK()
{
bool isok = NET_DVR_Init();
if(isok == false)
{
qDebug()<< "NET_DVR_Init error;error number is " <<NET_DVR_GetLastError();
QMessageBox::warning(NULL,"error","NET_DVR_Init error;error number is "+QString::number(NET_DVR_GetLastError()));
return isok;
}
//设置连接时间与重连时间
NET_DVR_SetConnectTime(2000, 1);
NET_DVR_SetReconnect(10000, true);
return isok;
}
bool HkVideoControl::uninitSDK()
{
bool isok = NET_DVR_Cleanup();
if(isok == false)
{
qDebug()<< "NET_DVR_Cleanup error;error number is " <<NET_DVR_GetLastError();
QMessageBox::warning(NULL,"error","NET_DVR_Cleanup error;error number "+QString::number(NET_DVR_GetLastError()));
return isok;
}
return isok;
}
void HkVideoControl::HkVideo_Login(QString ip, int port, QString user, QString pwd)
{
initSDK();
NET_DVR_DEVICEINFO_V30 DeviceInfoTmp;
char * ipc = new char[strlen(ip.toStdString().c_str()) + 1];
strcpy_s(ipc, strlen(ip.toStdString().c_str()) + 1, ip.toStdString().c_str());
char * userc = new char[strlen(user.toStdString().c_str()) + 1];
strcpy_s(userc, strlen(user.toStdString().c_str()) + 1, user.toStdString().c_str());
char * pwdc = new char[strlen(pwd.toStdString().c_str()) + 1];
strcpy_s(pwdc, strlen(pwd.toStdString().c_str()) + 1, pwd.toStdString().c_str());
//NET_DVR_Login_V30(char *sDVRIP, WORD wDVRPort, char *sUserName, char *sPassword, LPNET_DVR_DEVICEINFO_V30 lpDeviceInfo);
userID=NET_DVR_Login_V30(ipc,port,userc,pwdc,&DeviceInfoTmp);
if(userID<0)
{
qDebug() << "NET_DVR_Login_V30 error;" << "error number is " << NET_DVR_GetLastError();
QMessageBox::warning(nullptr,"error","NET_DVR_Login_V30 error;error number "+QString::number(NET_DVR_GetLastError()));
return;
}
emit Send_UserID(userID);
}
/**
* @projectName XinHu_ASC
* @brief 摘要
* 监控机控制模块
* @author ZhangYL
* @date 2022-02-16
*/
#ifndef HKVIDEOCONTROL_H
#define HKVIDEOCONTROL_H
#include <QObject>
#include <QThread>
#include <QDateTime>
#include <QTimer>
#include "HCNetSDK.h"
#include <windows.h>
using namespace std;
class HkVideoControl : public QObject
{
Q_OBJECT
public:
explicit HkVideoControl(QObject *parent = nullptr);
bool initSDK();
bool uninitSDK();
signals:
void Send_UserID(long userID);
public slots:
void HkVideo_Login(QString ip,int port,QString user,QString pwd); //连接监控机
private:
long userID;
};
#endif // HKVIDEOCONTROL_H
HEADERS += \
$$PWD/hkvideocontrol.h
SOURCES += \
$$PWD/hkvideocontrol.cpp
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
<file>image/main.png</file> <file>image/main.png</file>
<file>image/Min_0.png</file> <file>image/Min_0.png</file>
<file>image/Min_1.png</file> <file>image/Min_1.png</file>
<file>image/navy.css</file>
<file>image/off.ico</file> <file>image/off.ico</file>
<file>image/ok.png</file> <file>image/ok.png</file>
<file>image/on.ico</file> <file>image/on.ico</file>
...@@ -59,5 +58,6 @@ ...@@ -59,5 +58,6 @@
<file>image/sub-line_vertical.png</file> <file>image/sub-line_vertical.png</file>
<file>image/up.png</file> <file>image/up.png</file>
<file>image/update.png</file> <file>image/update.png</file>
<file>image/navy.qss</file>
</qresource> </qresource>
</RCC> </RCC>
...@@ -343,5 +343,4 @@ QTabBar::tab:selected, QTabBar::tab:hover { ...@@ -343,5 +343,4 @@ QTabBar::tab:selected, QTabBar::tab:hover {
QStatusBar::item { QStatusBar::item {
border: 1px solid #50A3F0; border: 1px solid #50A3F0;
border-radius: 3px; }
}
\ No newline at end of file
...@@ -2,13 +2,89 @@ ...@@ -2,13 +2,89 @@
#include "myhelper.h" #include "myhelper.h"
#include <QApplication> #include <QApplication>
#include <QDebug> #include <QDebug>
#include <QDir>
#include <QSqlDatabase> #include <QSqlDatabase>
#include <QSqlQuery> #include <QSqlQuery>
#include "modeller_applog/applog.h" //日志 #include "modeller_applog/applog.h" //日志
#include "sqliteassistant/sqliteassistant.h" //数据库助手 #include "sqliteassistant/sqliteassistant.h" //数据库助手
#include "logindlg.h" //登陆 #include "logindlg.h" //登陆
int LogKeepDay = 0; //日志保存天数, int LogKeepDay = 0; //日志保存天数,
//读取数据库信息
QString DB_ServerIP; //服务器IP
QString DB_ServerProt;
QString DB_HkIP; //抓拍机IP
QString DB_HkProt;
QString DB_HkUser;
QString DB_HkPwd;
QString DB_RFIDComName; //读卡器
QString DB_RFIDComBund;
QString DB_ScanComName; //扫码器
QString DB_ScanComBund;
QString DB_HTrunkComName; //道闸
QString DB_HTrunkComBund;
QString DB_HkVideoIP; //监控机IP
QString DB_HkVideoProt;
QString DB_HkVideoUser;
QString DB_HkVideoPwd;
int nFiles = 0;
int rmFiles = 0;
SqliteAssistant *m_SqliteAssistant; SqliteAssistant *m_SqliteAssistant;
int GetRSSCount(QString path)
{
int count=0;
QDir myDir(path);
//QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
for(unsigned int i=0;i<myDir.count();i++)
{
QString sext=myDir[i].toLower();
if(-1!=sext.indexOf(".jpg"))
count++;
}
return count;
}
void removefilesindir(const QString& path){
QDir dir(path);
QFileInfoList info_list = dir.entryInfoList(QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot | QDir::NoSymLinks | QDir::AllDirs);
if(dir.exists())
{
dir.setFilter(QDir::Files | QDir::NoSymLinks);
QFileInfoList list = dir.entryInfoList();
//qDebug()<<list.count();
}
foreach(QFileInfo file_info, info_list)
{
if (file_info.isDir())
{
removefilesindir(file_info.absoluteFilePath());
}
else if (file_info.isFile())
{
QFile file(file_info.absoluteFilePath());
qDebug() << "remove file : " << file_info.absoluteFilePath();
file.remove();
rmFiles ++;
qDebug() << "%" << int((double)rmFiles / nFiles * 100) << rmFiles;
}
}
}
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
QApplication a(argc, argv); QApplication a(argc, argv);
...@@ -19,12 +95,58 @@ int main(int argc, char *argv[]) ...@@ -19,12 +95,58 @@ int main(int argc, char *argv[])
if(0!=m_SqliteAssistant->connectSql()) if(0!=m_SqliteAssistant->connectSql())
{ {
qDebug()<<"connectSql error"; qDebug()<<"connectSql error";
return 1; return 0;
} }
else else
{ {
qDebug()<<"connectSql ok"; qDebug()<<"connectSql ok";
} }
///读取配置信息
DB_ServerIP = m_SqliteAssistant->Select_SystemConfigInfo("ServerIP");
DB_ServerProt = m_SqliteAssistant->Select_SystemConfigInfo("ServerProt");
DB_RFIDComName = m_SqliteAssistant->Select_SystemConfigInfo("RFIDComName");
DB_RFIDComBund = m_SqliteAssistant->Select_SystemConfigInfo("RFIDComBund");
DB_ScanComName = m_SqliteAssistant->Select_SystemConfigInfo("ScanComName");
DB_ScanComBund = m_SqliteAssistant->Select_SystemConfigInfo("ScanComBund");
DB_HkIP = m_SqliteAssistant->Select_SystemConfigInfo("HkIP");
DB_HkProt = m_SqliteAssistant->Select_SystemConfigInfo("HkProt");
DB_HkUser = m_SqliteAssistant->Select_SystemConfigInfo("HkUser");
DB_HkPwd = m_SqliteAssistant->Select_SystemConfigInfo("HkPwd");
DB_HTrunkComName = m_SqliteAssistant->Select_SystemConfigInfo("HTrunkComName");
DB_HTrunkComBund = m_SqliteAssistant->Select_SystemConfigInfo("HTrunkComBund");
DB_HkVideoIP = m_SqliteAssistant->Select_SystemConfigInfo("HkVideoIP");
DB_HkVideoProt = m_SqliteAssistant->Select_SystemConfigInfo("HkVideoProt");
DB_HkVideoUser = m_SqliteAssistant->Select_SystemConfigInfo("HkVideoUser");
DB_HkVideoPwd = m_SqliteAssistant->Select_SystemConfigInfo("HkVideoPwd");
qDebug()<<"DB_ServerIP"<<DB_ServerIP;
qDebug()<<"DB_ServerProt"<<DB_ServerProt;
qDebug()<<"DB_RFIDComName"<<DB_RFIDComName;
qDebug()<<"DB_RFIDComBund"<<DB_RFIDComBund;
qDebug()<<"DB_ScanComName"<<DB_ScanComName;
qDebug()<<"DB_ScanComBund"<<DB_ScanComBund;
qDebug()<<"DB_ScanComBund"<<DB_HkIP;
qDebug()<<"DB_HkProt"<<DB_HkProt;
qDebug()<<"DB_HkUser"<<DB_HkUser;
qDebug()<<"DB_HkPwd"<<DB_HkPwd;
qDebug()<<"DB_HTrunkComName"<<DB_HTrunkComName;
qDebug()<<"DB_HTrunkComBund"<<DB_HTrunkComBund;
qDebug()<<"DB_HkVideoIP"<<DB_HkVideoIP;
qDebug()<<"DB_HkVideoProt"<<DB_HkVideoProt;
qDebug()<<"DB_HkVideoUser"<<DB_HkVideoUser;
qDebug()<<"DB_HkVideoPwd"<<DB_HkVideoPwd;
qDebug()<<GetRSSCount("C:\\AFrontPicture");
if(GetRSSCount("C:\\AFrontPicture")>300){
removefilesindir("C:\\AFrontPicture");
}
//LogKeepDay //LogKeepDay
Singleton<AppLog>::getInstance().onClearLogFile("./log",LogKeepDay); Singleton<AppLog>::getInstance().onClearLogFile("./log",LogKeepDay);
LoginDlg login; LoginDlg login;
......
...@@ -5,7 +5,10 @@ ...@@ -5,7 +5,10 @@
#include <QMainWindow> #include <QMainWindow>
#include <QPushButton> #include <QPushButton>
#include <QTimer> #include <QTimer>
#include "bridge.h"
#include <windows.h>
#include "voicecontrol/voiceform.h"
using namespace std;
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; } namespace Ui { class MainWindow; }
QT_END_NAMESPACE QT_END_NAMESPACE
...@@ -17,28 +20,35 @@ class MainWindow : public QMainWindow ...@@ -17,28 +20,35 @@ class MainWindow : public QMainWindow
public: public:
MainWindow(QWidget *parent = nullptr); MainWindow(QWidget *parent = nullptr);
~MainWindow(); ~MainWindow();
long play(HWND hWnd,NET_DVR_PREVIEWINFO struPlayInfo,long userID);
private: private:
void init(); //软件初始化 void init(); //软件初始化
void SoftStart(); void SoftStart();
void ReadSystemInfo(); void ReadSystemInfo();
void CheckAll(); void CheckAll();
bool CheckComIsAlive(); //检查串口是否活着
void SoftClose(); void SoftClose();
void dataUpDate(); void dataUpDate();
void Pbn_clicked(); void Pbn_clicked();
void SetLineEdit(bool status); void SetLineEdit(bool status);
QStringList getAvailablePort(); //获取串口
char * StrToChar(QString data);
void ShowMessage(QString msg,int time); //显示提示,时间
protected: protected:
bool eventFilter(QObject *watched, QEvent *event); bool eventFilter(QObject *watched, QEvent *event);
bool nativeEvent(const QByteArray &eventType, void *message, long *result);
void closeEvent(QCloseEvent *event); void closeEvent(QCloseEvent *event);
private: private:
Ui::MainWindow *ui; Ui::MainWindow *ui;
//Bridge *m_Bridge; //中间类 VoiceForm *m_VoiceForm; //语音控制
Bridge *m_Bridge; //中间类
QLabel *m_systemTime; //系统运行时间 QLabel *m_systemTime; //系统运行时间
QLabel *m_ScanCode; //二维码识别器 QLabel *m_ScanCode; //二维码识别器
QLabel *m_Rfid; //FRID读卡器 QLabel *m_Rfid; //FRID读卡器
QLabel *m_Trunk; //道闸 QLabel *m_Trunk; //道闸
QLabel *m_SportsCamera; //抓拍相机 QLabel *m_SportsCamera; //抓拍相机
QLabel *m_monitorCamera; //监控相机 QLabel *m_monitorCamera; //监控相机
QLabel *m_ServerStatus; //服务器状态
QLabel *m_carplnumPic; QLabel *m_carplnumPic;
//QPushButton *m_ScanStatus; //QPushButton *m_ScanStatus;
QTimer *m_SoftBreath; QTimer *m_SoftBreath;
...@@ -47,5 +57,10 @@ private: ...@@ -47,5 +57,10 @@ private:
int m_SoftBreath_m = 0; int m_SoftBreath_m = 0;
int m_SoftBreath_h = 0; int m_SoftBreath_h = 0;
int m_SoftBreath_d = 0; int m_SoftBreath_d = 0;
int changeVehTotal; //变化车辆数
int VehTotal; //厂区容纳车辆
long UserID; //监控机UserID
long previewID; //监控机UserID
}; };
#endif // MAINWINDOW_H #endif // MAINWINDOW_H
...@@ -41,11 +41,11 @@ public: ...@@ -41,11 +41,11 @@ public:
//设置皮肤样式 //设置皮肤样式
static void SetStyle(const QString &styleName) static void SetStyle(const QString &styleName)
{ {
QFile file(QString(":/image/%1.css").arg(styleName)); QFile file(QString(":/image/%1.qss").arg(styleName));
file.open(QFile::ReadOnly); file.open(QFile::ReadOnly);
QString qss = QLatin1String(file.readAll()); QString qss = QLatin1String(file.readAll());
qApp->setStyleSheet(qss); qApp->setStyleSheet(qss);
qApp->setPalette(QPalette(QColor("#F0F0F0"))); //qApp->setPalette(QPalette(QColor("#F0F0F0")));
} }
//加载中文字符 //加载中文字符
......
...@@ -8,6 +8,12 @@ temp/obj/sqlitehandle.o ...@@ -8,6 +8,12 @@ temp/obj/sqlitehandle.o
temp/obj/applog.o temp/obj/applog.o
temp/obj/sqliteassistant.o temp/obj/sqliteassistant.o
temp/obj/scancodecontrol.o temp/obj/scancodecontrol.o
temp/obj/readepccontrol.o
temp/obj/cameracontrol.o
temp/obj/hkvideocontrol.o
temp/obj/eqptcontrol.o
temp/obj/eqptmodel.o
temp/obj/voiceform.o
temp/obj/qrc_image.o temp/obj/qrc_image.o
temp/obj/moc_bridge.o temp/obj/moc_bridge.o
temp/obj/moc_frmmessagebox.o temp/obj/moc_frmmessagebox.o
...@@ -16,3 +22,9 @@ temp/obj/moc_mainwindow.o ...@@ -16,3 +22,9 @@ temp/obj/moc_mainwindow.o
temp/obj/moc_sqlitehandle.o temp/obj/moc_sqlitehandle.o
temp/obj/moc_sqliteassistant.o temp/obj/moc_sqliteassistant.o
temp/obj/moc_scancodecontrol.o temp/obj/moc_scancodecontrol.o
temp/obj/moc_readepccontrol.o
temp/obj/moc_cameracontrol.o
temp/obj/moc_hkvideocontrol.o
temp/obj/moc_eqptcontrol.o
temp/obj/moc_eqptmodel.o
temp/obj/moc_voiceform.o
...@@ -8,6 +8,12 @@ temp/obj/sqlitehandle.o ...@@ -8,6 +8,12 @@ temp/obj/sqlitehandle.o
temp/obj/applog.o temp/obj/applog.o
temp/obj/sqliteassistant.o temp/obj/sqliteassistant.o
temp/obj/scancodecontrol.o temp/obj/scancodecontrol.o
temp/obj/readepccontrol.o
temp/obj/cameracontrol.o
temp/obj/hkvideocontrol.o
temp/obj/eqptcontrol.o
temp/obj/eqptmodel.o
temp/obj/voiceform.o
temp/obj/qrc_image.o temp/obj/qrc_image.o
temp/obj/moc_bridge.o temp/obj/moc_bridge.o
temp/obj/moc_frmmessagebox.o temp/obj/moc_frmmessagebox.o
...@@ -16,3 +22,9 @@ temp/obj/moc_mainwindow.o ...@@ -16,3 +22,9 @@ temp/obj/moc_mainwindow.o
temp/obj/moc_sqlitehandle.o temp/obj/moc_sqlitehandle.o
temp/obj/moc_sqliteassistant.o temp/obj/moc_sqliteassistant.o
temp/obj/moc_scancodecontrol.o temp/obj/moc_scancodecontrol.o
temp/obj/moc_readepccontrol.o
temp/obj/moc_cameracontrol.o
temp/obj/moc_hkvideocontrol.o
temp/obj/moc_eqptcontrol.o
temp/obj/moc_eqptmodel.o
temp/obj/moc_voiceform.o
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论