Sh3/vvodsectazim.cpp
2025-07-02 07:45:34 +03:00

73 lines
1.5 KiB
C++

#include "vvodsectazim.h"
#include "ui_vvodsectazim.h"
vvodSectAzim::vvodSectAzim(QWidget *parent) :
QDialog(parent),
ui(new Ui::vvodSectAzim)
{
ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose);
Widget* w =(Widget*) parent;
w->changeOpenWidget(this);
ui->lineEdit->setText(QString::number(w->sectAzLow1));
ui->lineEdit_2->setText(QString::number(w->sectAzLow2));
ui->lineEdit_3->setText(QString::number(w->sectAzHigh1));
ui->lineEdit_4->setText(QString::number(w->sectAzHigh2));
}
vvodSectAzim::~vvodSectAzim()
{
delete ui;
}
void vvodSectAzim::on_pushButton_3_clicked()
{
close();
}
void vvodSectAzim::on_pushButton_2_clicked()
{
Widget *w = (Widget*)parent();
w->sectAzLow1 = 0;
w->sectAzLow2 = 0;
w->sectAzHigh1 = 0;
w->sectAzHigh2 = 0;
// w->kzsSect.left= 0;
// w->kzsSect.right=0;
close();
}
void vvodSectAzim::on_pushButton_clicked()
{
int sl1, sl2, sh1, sh2;
Widget *w = (Widget*)parent();
sl1 = ui->lineEdit->text().toInt();
sl2 = ui->lineEdit_2->text().toInt();
sh1 = ui->lineEdit_3->text().toInt();
sh2 = ui->lineEdit_4->text().toInt();
// ïðîâåðêè
///
w->sectAzLow1 = sl1;
w->sectAzLow2 = sl2;
w->sectAzHigh1 = sh1;
w->sectAzHigh2 = sh2;
// w->kzsSect.left= (sl1*100+sl2)/100*6;
// w->kzsSect.right=(sh1*100+sh2)/100*6;
w->writeFile();
close();
}
void vvodSectAzim::closeEvent(QCloseEvent *event)
{
((Widget*)parent())->clearOpenWidget();
event->accept();
}