标签:文件信息 and ipc ntp时间 lse main sdn ken ref
云台控制也是onvif功能中最常用的,最常用的功能排第一的是拿到视频流地址,排第二的就是云台控制了,云台控制的含义就是对带云台的摄像机进行上下左右的移动,一般云台摄像机都是带有一个小电机,一旦收到485或者网络来的正确的指令以后就触发单片机程序,然后单片机程序驱动电机进行转动,所以相对来说云台摄像机比普通的摄像机更耗电,当然价格也更贵。
云台控制的发送命令除了用户信息玩主要就三个核心参数xyz,通过这三个参数的组合来实现云台和焦距的控制,云台的转动主要就是改变xy的值,焦距的控制通过改变z的值来实现。
云台控制说明:
onvif主要的功能:
onvif的处理流程:
void frmPtz::moveAbsolute()
{
OnvifDevice *device = frm->getCurrentDevice();
if (device) {
QString profile = frm->getProfile();
device->moveAbsolute(profile, x, y, z);
frm->append(5, QString("执行绝对移动-> x: %1 y: %2 z: %3").arg(x).arg(y).arg(z));
}
}
void frmPtz::moveRelative()
{
OnvifDevice *device = frm->getCurrentDevice();
if (device) {
QString profile = frm->getProfile();
device->moveRelative(profile, x, y, z);
frm->append(5, QString("执行相对移动-> x: %1 y: %2 z: %3").arg(x).arg(y).arg(z));
}
}
void frmPtz::setFrm(frmMain *frm)
{
this->frm = frm;
}
void frmPtz::on_btnPtzUp_clicked()
{
if (ui->rbtnMoveRelative->isChecked()) {
x = 0.0;
y = 0.1;
z = 0.0;
moveRelative();
} else {
y = 0.1;
moveAbsolute();
}
}
void frmPtz::on_btnPtzDown_clicked()
{
if (ui->rbtnMoveRelative->isChecked()) {
x = 0.0;
y = -0.1;
z = 0.0;
moveRelative();
} else {
y = -0.0;
moveAbsolute();
}
}
void frmPtz::on_btnPtzLeft_clicked()
{
if (ui->rbtnMoveRelative->isChecked()) {
x = -0.1;
y = 0.0;
z = 0.0;
moveRelative();
} else {
x = 0.0;
moveAbsolute();
}
}
void frmPtz::on_btnPtzRight_clicked()
{
if (ui->rbtnMoveRelative->isChecked()) {
x = 0.1;
y = 0.0;
z = 0.0;
moveRelative();
} else {
x = 0.1;
moveAbsolute();
}
}
void frmPtz::on_btnPtzLeftUp_clicked()
{
if (ui->rbtnMoveRelative->isChecked()) {
x = -0.1;
y = 0.1;
z = 0.0;
moveRelative();
} else {
x = 0.0;
y = 0.0;
moveAbsolute();
}
}
void frmPtz::on_btnPtzLeftDown_clicked()
{
if (ui->rbtnMoveRelative->isChecked()) {
x = -0.1;
y = -0.1;
z = 0.0;
moveRelative();
} else {
x = 0.1;
y = 0.1;
moveAbsolute();
}
}
void frmPtz::on_btnPtzRightUp_clicked()
{
if (ui->rbtnMoveRelative->isChecked()) {
x = 0.1;
y = 0.1;
z = 0.0;
moveRelative();
} else {
x = 0.0;
y = 0.0;
moveAbsolute();
}
}
void frmPtz::on_btnPtzRightDown_clicked()
{
if (ui->rbtnMoveRelative->isChecked()) {
x = 0.1;
y = -0.1;
z = 0.0;
moveRelative();
} else {
x = 0.1;
y = 0.1;
moveAbsolute();
}
}
void frmPtz::on_btnPtzZoomIn_clicked()
{
if (ui->rbtnMoveRelative->isChecked()) {
x = 0.0;
y = 0.0;
z = 0.01;
moveRelative();
} else {
z = 0.01;
moveAbsolute();
}
}
void frmPtz::on_btnPtzZoomOut_clicked()
{
if (ui->rbtnMoveRelative->isChecked()) {
x = 0.0;
y = 0.0;
z = -0.01;
moveRelative();
} else {
z = 0.0;
moveAbsolute();
}
}
void frmPtz::on_btnPtzStop_clicked()
{
OnvifDevice *device = frm->getCurrentDevice();
if (device) {
frm->setText("ptzStop");
QString profile = frm->getProfile();
device->moveStop(profile);
}
}
void frmPtz::on_btnPtzReset_clicked()
{
x = 0.0;
y = 0.0;
z = 0.0;
moveAbsolute();
}
标签:文件信息 and ipc ntp时间 lse main sdn ken ref
原文地址:https://www.cnblogs.com/feiyangqingyun/p/13780460.html