-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPTZUnit.h
107 lines (94 loc) · 3.37 KB
/
PTZUnit.h
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
//
// Created by level8 on ١٨/٦/٢٠٢٠.
//
#ifndef PTZSIMULATOR_PTZUNIT_H
#define PTZSIMULATOR_PTZUNIT_H
class PTZUnit {
public:
enum WarningLevel{ERROR,WARNING,INFORMATION};
PTZUnit();
int saveInXML(std::string & filename) const;
float getFiledOfView() const;
float getAzimuthRotation() const;
float getAzimuthRotationMaxSpeed() const;
float getAzimuthRotationSpeed() const;
float getElevationRotation() const;
float getElevationRotationMaxSpeed() const;
float getElevationRotationSpeed() const;
float getLat() const;
float getLon() const;
float getAzimuthSpeedFactor() const;
float getElevationSpeedFactor() const;
PTZUnit(int id ,float filedOfView, float azimuthRotation, float azimuthRotationSpeed, float elevationRotation,
float elevationRotationSpeed, float lat, float lon ,float alt,float range,float phi,float ref);
void setFiledOfView(float filedOfView);
void setAzimuthRotation(float azimuthRotation);
void setAzimuthRotationSpeed(float azimuthRotationSpeed);
void setElevationRotation(float elevationRotation);
void setElevationRotationSpeed(float elevationRotationSpeed);
void setElevationSpeedFactor(char factor);
void setAzimuthSpeedFactor(char factor);
void setLat(float lat);
void setLon(float lon);
void log(char * msg, char * location, WarningLevel level);
void runSimulation(float timeElapsed);
void loadAzimuth();
void loadElevation();
float getTargetAngelAzimuth() const;
void setTargetAngelAzimuth(float targetAngelAzimuth);
float getTargetAngelElevation() const;
void setTargetAngelElevation(float targetAngelElevation);
void addTargetElevationLower(char ang);
void addTargetElevationUpper(char ang);
void setTargetElevationLower(char ang);
void setTargetElevationUpper(char ang);
void addTargetAzimuthLower(char ang);
void addTargetAzimuthUpper(char ang);
void setTargetAzimuthLower(char ang);
void setTargetAzimuthUpper(char ang);
volatile float getRefWithNorth() const;
void setRefWithNorth(volatile float refWithNorth);
volatile float getAlt() const;
void setAlt(volatile float alt);
volatile float getPhi() const;
void setPhi(volatile float phi);
volatile float getRange() const;
void setRange(volatile float range);
void loadAzimuthSpeed();
void loadElevationSpeed();
void setAzimuthSpeedLower(char sp);
void setAzimuthSpeedUpper(char sp);
void setElevationSpeedLower(char sp);
void setElevationSpeedUpper(char sp);
float accelerate(float current,float target,float step);
private:
int id;
int tick;
float FiledOfView;
float AzimuthRotation;
float AzimuthRotationSpeed;
float ElevationRotation;
float ElevationRotationSpeed;
float lat;
float lon;
float alt;
float phi;
float range;
float refWithNorth;
float targetAngelAzimuth;
float targetAngelElevation;
float targetAngelAzimuth2;
float targetAngelElevation2;
float SpeedAzimuth;
float SpeedElevation;
float SpeedAzimuth2;
float SpeedElevation2;
float currentSpeedAzm = 0;
float currentSpeedEle = 0;
float acceleration = 4;
volatile bool elevationMotorOn;
volatile bool azimuthMotorOn;
volatile uint8_t speedDividerElevation;
volatile uint8_t speedDividerAzimuth;
};
#endif //PTZSIMULATOR_PTZUNIT_H