123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- #pragma once
- #include <QMainWindow>
- #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;
- };
|