You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
99 lines
2.4 KiB
C
99 lines
2.4 KiB
C
|
1 year ago
|
#ifndef MAINWINDOW_H
|
||
|
|
#define MAINWINDOW_H
|
||
|
|
|
||
|
|
#include <QMainWindow>
|
||
|
|
#include <QLibrary>
|
||
|
|
|
||
|
|
QT_BEGIN_NAMESPACE
|
||
|
|
namespace Ui { class MainWindow; }
|
||
|
|
QT_END_NAMESPACE
|
||
|
|
|
||
|
|
#define IP_MAXLEN 15
|
||
|
|
#define IP_MINLEN 7
|
||
|
|
|
||
|
|
#define IPPORT_MAXLEN 21
|
||
|
|
#define IPPORT_MINLEN 9
|
||
|
|
|
||
|
|
#define SOCKET_IPBUF_MAXLEN 32
|
||
|
|
|
||
|
|
#include "databasetype.h"
|
||
|
|
|
||
|
|
typedef HV_HANDLE(* HV_Openfun)(const PSTR pcIP);
|
||
|
|
typedef HRESULT(* HV_Closefun)(HV_HANDLE hHandle);
|
||
|
|
typedef HRESULT(* HV_StartPlayfun)(HV_HANDLE hHandle, HWND hWnd, INT32 iChannelType);
|
||
|
|
|
||
|
|
typedef HRESULT(* HV_StopPlayfun)(HV_HANDLE hHandle);
|
||
|
|
typedef HRESULT(* HV_Capturefun)(HV_HANDLE hHandle,INT32 ImageFormat, BYTE *pbImageBuf,INT32* iBufLen);
|
||
|
|
typedef HRESULT(* HV_Capture2fun)(HV_HANDLE hHandle,INT32 ImageFormat, BYTE *pbImageBuf,INT32* iBufLen,INT32 iChannelType);
|
||
|
|
|
||
|
|
typedef HRESULT(* HV_AddCharfun)(HV_HANDLE hHandle,INT32 xPos,INT32 yPos, UINT32 iColor, INT32 iFontSize, char* pcValue);
|
||
|
|
typedef HRESULT(* HV_ClearCharfun)(HV_HANDLE hHandle);
|
||
|
|
|
||
|
|
class MainWindow : public QMainWindow
|
||
|
|
{
|
||
|
|
Q_OBJECT
|
||
|
|
|
||
|
|
public:
|
||
|
|
MainWindow(QWidget *parent = nullptr);
|
||
|
|
~MainWindow();
|
||
|
|
|
||
|
|
private:
|
||
|
|
void initstr();
|
||
|
|
int mylogin();
|
||
|
|
|
||
|
|
int isnumer(char cChar, int base =10);
|
||
|
|
int isnumerc(char * buf,int base =10);
|
||
|
|
int isIpAddr(const char * ptr);
|
||
|
|
int isIpAddrAndPort(char * ptr);
|
||
|
|
|
||
|
|
int QStringToChar(char * dest, int iLen, QString & Qsource,int isChange =0);
|
||
|
|
|
||
|
|
QString GBK2QStr(const char *pStr, int len);
|
||
|
|
int QStr2GBK(const QString &str, char *pStr, int len);
|
||
|
|
|
||
|
|
int SetDllPath(char * path);
|
||
|
|
int saveimage(char * pname, char * pdata,int ilen);
|
||
|
|
|
||
|
|
void initplaintext();
|
||
|
|
|
||
|
|
private slots:
|
||
|
|
void on_pushButtonLogin_clicked();
|
||
|
|
|
||
|
|
void on_pushButtonadd_clicked();
|
||
|
|
|
||
|
|
void on_pushButtonplay_clicked();
|
||
|
|
|
||
|
|
void on_pushButtonstop_clicked();
|
||
|
|
|
||
|
|
void on_pushButtoncap_clicked();
|
||
|
|
|
||
|
|
void on_pushButton_clicked();
|
||
|
|
|
||
|
|
void on_pushButton_3_clicked();
|
||
|
|
|
||
|
|
void on_pushButtonTimecap_clicked();
|
||
|
|
|
||
|
|
private:
|
||
|
|
int m_step;
|
||
|
|
HV_HANDLE m_hd;
|
||
|
|
|
||
|
|
HV_Openfun m_Openfun;
|
||
|
|
HV_Closefun m_Closefun;
|
||
|
|
HV_StartPlayfun m_StartPlayfun;
|
||
|
|
HV_StopPlayfun m_StopPlayfun;
|
||
|
|
HV_Capturefun m_Capturefun;
|
||
|
|
HV_Capture2fun m_Capture2fun;
|
||
|
|
|
||
|
|
HV_AddCharfun m_AddCharfun;
|
||
|
|
HV_ClearCharfun m_ClearCharfun;
|
||
|
|
|
||
|
|
// int m_loadflag;
|
||
|
|
QLibrary m_lib;
|
||
|
|
|
||
|
|
char * m_dataptr;
|
||
|
|
|
||
|
|
private:
|
||
|
|
Ui::MainWindow *ui;
|
||
|
|
};
|
||
|
|
#endif // MAINWINDOW_H
|