#pragma once #include #include "ui_IncCamera.h" //set a struct to save the camera information typedef struct CAMERAINFO { //the camera User name QString szUserName; //the camera password QString szPassword; //the camera ip address QString szIpAddress1; QString szIpAddress2; QString szIpAddress3; QString szIpAddress4; //the camera port int nPort; //the camera channel int nChannel; //the camera stream type int nStreamType; //the camera horizon offset int nHorizonOffset; //the camera vertical offset int nVerticalOffset; //the camera light offset int nLightOffset; //set a flags to indicate the right check is checked bool bIsCheckRight; //define two int to record the camera item row and col index int nColIndex; int nRowIndex; //set a constructor to init the value CAMERAINFO() { szUserName = ""; szPassword = ""; szIpAddress1 = ""; szIpAddress2 = ""; szIpAddress3 = ""; szIpAddress4 = ""; nPort = 0; nChannel = 0; nStreamType = 0; nHorizonOffset = 0; nVerticalOffset = 0; nLightOffset = 0; nColIndex = 0; nRowIndex = 0; bIsCheckRight = false; } //set a function to output complete camera ip address QString GetCompleteIpAddress() { QString szCompleteIpAddress = ""; //set a branch to judge the right check is checked if (bIsCheckRight) { szCompleteIpAddress = "rtsp://" + szUserName + ":" + szPassword + "@" + szIpAddress1 + "." + szIpAddress2 + "." + szIpAddress3 + "." + szIpAddress4 + ":" + QString::number(nPort) + "/0/" + QString::number(nChannel) + "/" + QString::number(nStreamType); } else { szCompleteIpAddress = "rtsp://" + szIpAddress1 + "." + szIpAddress2 + "." + szIpAddress3 + "." + szIpAddress4 + ":" + QString::number(nPort) + "/0/" + QString::number(nChannel) + "/" + QString::number(nStreamType); } return szCompleteIpAddress; } }CAMERA_INFO,*LPCAMERA_INFO; class IncCamera : public QMainWindow { Q_OBJECT public: IncCamera(QWidget *parent = nullptr); ~IncCamera(); //use to set connect the signal and slot void SetConnect(); //set a ok button slot void OnOKBtnClicked(); //set a cancel button slot void OnCancelBtnClicked(); //set a function to get the camera information CAMERAINFO GetCameraInfo(); //set a function to get the ok button is clicked bool GetIsOKBtnClicked(); //set a slot to set the main stream select radio button is clicked void OnMainSteamSelectRadioClicked(); //set a slot to set the right check is checked void OnIsCheckRightCheckClicked(); private: Ui::IncCameraClass ui; //set a struct to save the camera information CAMERAINFO m_CameraInfo; //set a flags to indicate the ok button is clicked bool m_bIsOKBtnClicked; };