#include "poletrackingdialog.h"
#include "ui_poletrackingdialog.h"

PoleTrackingDialog::PoleTrackingDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::PoleTrackingDialog)
{
    ui->setupUi(this);

    this->setFixedSize(this->width(), this->height());//设置窗口不可改变大小
    this->setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);// hide the "?" help button ont the title bar
}

PoleTrackingDialog::~PoleTrackingDialog()
{
    delete ui;
}

void PoleTrackingDialog::uiReset()
{
    ui->retranslateUi(this);
}

void PoleTrackingDialog::on_pushButton_tracking_minus_clicked()
{
    int val = ui->dial_tracking->value();
    val -= 1;
    if(val < 0)
        val = 0;

    ui->dial_tracking->setValue(val);

}

void PoleTrackingDialog::on_pushButton_tracking_add_clicked()
{
    int val = ui->dial_tracking->value();
    val += 1;
    if(val > 360)
        val = 360;

    ui->dial_tracking->setValue(val);
}

void PoleTrackingDialog::on_pushButton_reset_clicked()
{
    ui->dial_tracking->setValue(0);
}

void PoleTrackingDialog::on_dial_tracking_valueChanged(int value)
{
    emit trackPole(value);
}
