pans
2016-12-15 87e3ee273b2f84081ac45926be9d8e5be3166eaa
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
/************************************************************************
 *        Copyright 2009-2011 Hikvision Digital Technology Co., Ltd.
 *        FileName                      :   ptzpreset.cpp
 *        Description                   :   Ô¤ÀÀÔÆÌ¨Ô¤ÖõãÉèÖÃÏà¹Ø²Ù×÷
 *        Modification History          :   none
 *        Version                       :   V1.0
 *        Time                          :   2009-11,12
 *        Author                        :   wanggongpu
 *        Descrp                        :   none
*************************************************************************/
#include "ptzpreset.h"
#include <QMessageBox>
#include <QString>
#include <QStringList>
#include <stdio.h>
 
/************************************************************************
 *        Function            :  PtzPreset
 *        Description         :  ¹¹Ô캯Êý
 *        Input               :  int realhandle Ô¤ÀÀ¾ä±úºÅ,QWidget *parent
                                  QT widget»ùÀà
 *        Output              :  none
 *        Return              :  none
*************************************************************************/
PtzPreset::PtzPreset(int realhandle,QWidget *parent)
    : QDialog(parent)
{
    ui.setupUi(this);
    m_rpcurrentrealhandle = realhandle;
    QStringList stringlistforpreset;
    char strTemp[10];
    for (int i=1;i<256;i++)
    {
        memset(strTemp, 0, sizeof(strTemp));
        sprintf(strTemp, "%d", i);
        stringlistforpreset <<strTemp;
    }
    ui.comboBox_ptzpresetpointindex->addItems(stringlistforpreset);
}
 
/************************************************************************
 *        Function            :  ~PtzPreset
 *        Description         :  Îö¹¹º¯Êý
 *        Input               :  none
 *        Output              :  none
 *        Return              :  none
*************************************************************************/
PtzPreset::~PtzPreset()
{
 
}
 
/************************************************************************
 *        Function            :  on_pushButton_addptzpresetpoint_clicked
 *        Description         :  Ôö¼ÓÔÆÌ¨Ô¤Öõã
 *        Input               :  none
 *        Output              :  none
 *        Return              :  none
*************************************************************************/
void PtzPreset::on_pushButton_addptzpresetpoint_clicked()
{
//for(int m_presetpointindex=1;m_presetpointindex<=255;m_presetpointindex++)
//{
     if (!NET_DVR_PTZPreset(m_rpcurrentrealhandle,SET_PRESET,m_presetpointindex))
    {
        QMessageBox::information(this,tr("NET_DVR_PTZControl Error"),\
                tr("SDK_LASTERROR=%1").arg(NET_DVR_GetLastError()));
    //break;
    }
    else
    {
         //QMessageBox::information(this,tr("NET_DVR_PTZControl Error"),\
              //  tr("m_presetpointindex =%1").arg(m_presetpointindex));
   
    }
//}
}
 
/************************************************************************
 *        Function            :  on_pushButton_deleteptzpresetpoint_clicked
 *        Description         :  É¾³ýÔÆÌ¨Ô¤Öõã
 *        Input               :  none
 *        Output              :  none
 *        Return              :  none
*************************************************************************/
void PtzPreset::on_pushButton_deleteptzpresetpoint_clicked()
{
 
     if (!NET_DVR_PTZPreset(m_rpcurrentrealhandle,CLE_PRESET,m_presetpointindex))
    {
        QMessageBox::information(this,tr("NET_DVR_PTZControl Error"),\
                tr("SDK_LASTERROR=%1").arg(NET_DVR_GetLastError()));
    }
}
 
/************************************************************************
 *        Function            :  on_pushButton_exit_clicked
 *        Description         :  Í˳ö¶Ô»°¿ò
 *        Input               :  none
 *        Output              :  none
 *        Return              :  none
*************************************************************************/
void PtzPreset::on_pushButton_exit_clicked()
{
    close();
 
}
 
/************************************************************************
 *        Function            :  on_comboBox_ptzpresetpointindex_currentIndexChanged
 *        Description         :  ÐÞ¸ÄÔÆÌ¨Ô¤Öõã±àºÅ
 *        Input               :  int index ÔÆÌ¨Ô¤Öõã±àºÅ
 *        Output              :  none
 *        Return              :  none
*************************************************************************/
void PtzPreset::on_comboBox_ptzpresetpointindex_currentIndexChanged(int index)
{
    m_presetpointindex =index+1;
}