-
Notifications
You must be signed in to change notification settings - Fork 6
/
test_analyser.cpp
51 lines (43 loc) · 1.38 KB
/
test_analyser.cpp
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
#include <chrono>
#include <iostream>
#include <sstream>
#include "glog/logging.h"
#include "OnvifClientDevice.hpp"
#include "OnvifClientPTZ.hpp"
#include "OnvifClientMedia.hpp"
using namespace std;
int main(int argc, const char *argv[]) {
std::string url = "192.168.66.64";
std::string name = "admin";
std::string password = "wst123456";
OnvifClientPTZ *PTZ = new OnvifClientPTZ(url, name, password, true);
OnvifClientMedia *Media = new OnvifClientMedia(url, name, password, true);
std::vector<_ocp_Profile> get_profilesResponse;
Media->getProfiles(get_profilesResponse);
PTZ->gotoPreset(get_profilesResponse[0].profileToken,3,0.5);
PTZ->getPresets(get_profilesResponse[0].profileToken);
return 0;
// Media->deleteProfile("test");
//std::cout << "Configurations:" << std::endl;
// Media->addPTZConfiguration("Move", "PTZToken");
//PTZ->getConfiguration("Profile_1");
//PTZ->getPTZConfigurations();
//PTZ->setHomePosition("Profile_1");
// move
//PTZ->continuousMove("Profile_1", 0.5, 0, 0);
//sleep(2);
//PTZ->stop("Profile_1", 0, 0);
//PTZ->relativeMove("Profile_1", 0.0, 0.0, 0.0, 0.0, 0.5, 1);
// zoom
//PTZ->ZoomIn("Move");
//sleep(2);
//PTZ->ZoomOut("Move");
//sleep(2);
//PTZ->goToHomePosition("Move");
//return 0;
// move
Media->createProfile("Move", "Move");
Media->addPTZConfiguration("Move", "PTZToken");
PTZ->getConfiguration("PTZToken");
return 0;
}