c++qt窗口程序下的高斯投影正反算及换带程序
公式算法前往:高斯投影正反算及换带程序_进击中的小龙的博客-CSDN博客
此项目基于VS2017IDE并配置Qt工具使用c++语言进行编程
项目头文件project.h(包括主窗口,正算窗口,反算/换带窗口类定义)
#pragma once
#include <QtWidgets/QWidget>
#include "ui_main.h"
namespace Ui {
class Form;
class Form2;
}
class project : public QWidget
{
Q_OBJECT
public:
project(QWidget *parent = nullptr);
~project();
private:
Ui::projectClass ui;
};
class Form : public QWidget//正算窗口类
{
Q_OBJECT
public:
explicit Form(QWidget *parent = nullptr);
void compute();//定义计算函数
~Form();
private:
Ui::Form *ui_new;
};
class Form2 : public QWidget//反算窗口类
{
Q_OBJECT
public:
explicit Form2(QWidget *parent = nullptr);
void compute();//定义投影计算函数
void uncompute();//定义换带计算函数
~Form2();
private:
Ui::Form2 *ui_new1;
};
主窗口UI设计
主函数main.cpp(调用主窗口)
#include "project.h"
#include <QtWidgets/QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
project w;
w.show();
return a.exec();
}
正算窗口UI设计
反算窗口UI设计
正算窗口与反算/换带窗口代码实现均在这里project.cpp
#include "project.h"
#include "ui_Widget1.h"
#include "ui_Widget2.h"
#include<qpushbutton.h>
#include<qmessagebox.h>
#include<qdebug.h>
#include<cmath>
#define PI acos(-1)
project::project(QWidget *parent)
: QWidget(parent)
{
ui.setupUi(this);
ui.setupUi(this);
//正算窗口信号-槽函数
connect(ui.pushButton, &QPushButton::clicked, this, [=]() {
static Form *f = new Form;
f->show();
});
//反算窗口信号-槽函数
connect(ui.pushButton_2, &QPushButton::clicked, this, [=]() {
static Form2 *n = new Form2;
n->show();
});
//退出功能
connect(ui.pushButton_3, &QPushButton::clicked, this, &QWidget::close);
}
project::~project()
{}
Form::Form(QWidget *parent) :// 正算窗口构造函数
QWidget(parent),
ui_new(new Ui::Form)
{
ui_new->setupUi(this);
//计算函数;lambda表达式调用compute函数
connect(ui_new->pushButton, &QPushButton::clicked, this, [=]() {
compute();
});
//清空功能
connect(ui_new->pushButton_2, &QPushButton::clicked, this, [=]() {
ui_new->lineEdit->clear();
ui_new->lineEdit_2->clear();
ui_new->lineEdit_3->clear();
ui_new->lineEdit_4->clear();
ui_new->lineEdit_5->clear();
ui_new->lineEdit_6->clear();
ui_new->lineEdit_7->clear();
ui_new->lineEdit_8->clear();
ui_new->lineEdit_9->clear();
ui_new->lineEdit_10->clear();
ui_new->lineEdit_11->clear();
ui_new->lineEdit_12->clear();
});
//退出功能
connect(ui_new->pushButton_3, &QPushButton::clicked, this, &QWidget::close);
}
Form::~Form()
{
delete ui_new;
}
Form2::Form2(QWidget *parent) : // 反算窗口构造函数
QWidget(parent),
ui_new1(new Ui::Form2)
{
ui_new1->setupUi(this);
//投影计算函数;lambda表达式调用compute函数
connect(ui_new1->pushButton, &QPushButton::clicked, this, [=]() {
compute();
});
//换带计算函数
connect(ui_new1->pushButton_4, &QPushButton::clicked, this, [=]() {
uncompute();
});
//清空功能
connect(ui_new1->pushButton_2, &QPushButton::clicked, this, [=]() {
ui_new1->lineEdit->clear();
ui_new1->lineEdit_2->clear();
ui_new1->lineEdit_3->clear();
ui_new1->lineEdit_4->clear();
ui_new1->lineEdit_5->clear();
ui_new1->lineEdit_6->clear();
ui_new1->lineEdit_7->clear();
ui_new1->lineEdit_8->clear();
ui_new1->lineEdit_9->clear();
ui_new1->lineEdit_10->clear();
ui_new1->lineEdit_11->clear();
ui_new1->lineEdit_12->clear();
ui_new1->lineEdit_13->clear();
ui_new1->lineEdit_14->clear();
ui_new1->lineEdit_15->clear();
ui_new1->lineEdit_16->clear();
ui_new1->lineEdit_17->clear();
ui_new1->lineEdit_18->clear();
});
//退出功能
connect(ui_new1->pushButton_3, &QPushButton::clicked, this, &QWidget::close);
}
Form2::~Form2()
{
delete ui_new1;
}
void Form::compute()//正算窗口计算函数
{
double a = 0, b = 0, e_2 = 0, e_dot_2 = 0, rou = 206264.806247096355;
int pp = 0;
if (ui_new->radioButton->isChecked())
{
a = 6378245;//椭圆长半轴
b = 6356863.0187730473;//椭圆短半轴
e_2 = 0.006693421622966;//椭圆第一偏心率e^2
e_dot_2 = 0.006738525414683;//椭圆第二偏心率e'^2
pp = 1;
}
else if (ui_new->radioButton_2->isChecked())//
{
a = 6378140;//椭圆长半轴
b = 6356755.2881575287;//椭圆短半轴
e_2 = 0.006694384999588;//椭圆第一偏心率e^2
e_dot_2 = 0.006739501819473;//椭圆第二偏心率e'^2
pp = 1;
}
else if (ui_new->radioButton_3->isChecked())//
{
a = 6378137;//椭圆长半轴
b = 6356752.3142;//椭圆短半轴
e_2 = 0.00669437999013;//椭圆第一偏心率e^2
e_dot_2 = 0.00673949674227;//椭圆第二偏心率e'^2
pp = 1;
}
else if (ui_new->radioButton_4->isChecked())//
{
a = 6378137;//椭圆长半轴
b = 6356752.3141;//椭圆短半轴
e_2 = 0.00669438002290;//椭圆第一偏心率e^2
e_dot_2 = 0.00673949677548;//椭圆第二偏心率e'^2
pp = 1;
}
else if (pp == 0)
{
QMessageBox::critical(this, "warning", "Please select an ellipsoid");
}
double c = a * a / b;
if (ui_new->lineEdit->text().isEmpty() || ui_new->lineEdit_2->text().isEmpty() || ui_new->lineEdit_3->text().isEmpty() ||
ui_new->lineEdit_4->text().isEmpty() || ui_new->lineEdit_5->text().isEmpty() || ui_new->lineEdit_6->text().isEmpty() ||
ui_new->lineEdit_7->text().isEmpty() )
{
QMessageBox::warning(this, "warning", "Please enter complete parameters");
}
else
{
//转化为弧度制
double B = (ui_new->lineEdit->text().toDouble() + ui_new->lineEdit_2->text().toDouble() / 60 + ui_new->lineEdit_3->text().toDouble() / 3600) / 180 * PI;
double L = (ui_new->lineEdit_4->text().toDouble() + ui_new->lineEdit_5->text().toDouble() / 60 + ui_new->lineEdit_6->text().toDouble() / 3600) / 180 * PI;
double L0 = ui_new->lineEdit_7->text().toDouble()/180*PI;
double W = sqrt(1 - e_2 * sin(B) * sin(B));
double V = sqrt(1 + e_dot_2 * cos(B) * cos(B));
double M = a * (1 - e_2) / (W * W * W);//子午圈曲率半径
double N = a / W;//卯酉圈曲率半径
double t =tan(B), n = e_dot_2 * cos(B) * cos(B);
double l = (L - L0) * rou;//单位弧度秒
//计算子午圈弧长
double A1 = 1 + 3 / 4 * e_2 + 45 / 64 * e_2 * e_2 + 175 / 256 * pow(e_2, 3) + 11025 / 16384 * pow(e_2, 4) + 43659 / 65536 * pow(e_2, 5);
double A2 = 3 / 4 * e_2 + 15 / 16 * e_2 * e_2 + 525 / 512 * pow(e_2, 3) + 2205 / 2048 * pow(e_2, 4) + 72765 / 65536 * pow(e_2, 5);
double A3 = 15 / 64 * e_2 * e_2 + 105 / 256 * pow(e_2, 3) + 2205 / 4096 * pow(e_2, 4) + 10395 / 16384 * pow(e_2, 5);
double A4 = 35 / 512 * pow(e_2, 3) + 315 / 2048 *pow(e_2, 4) + 31185 / 131072 *pow(e_2, 5);
double A5 = 315 / 16384 * pow(e_2, 4) + 3465 / 65536 * pow(e_2, 5);
double A6 = 693 / 131072 * pow(e_2, 5);
double a0 = A1 * a * (1 - e_2), a2 = -A2 / 2 * a * (1 - e_2), a4 = A3 / 4 * a * (1 - e_2), a6 = -A4 * a / 6 * (1 - e_2), a8 = A5 * a / 8 * (1 - e_2), a10 = -A6 * a / 10 * (1 - e_2);
double X = a0 * B + a2 * sin(2 * B) + a4 * sin(4 * B) + a6 * sin(6 * B) + a8 * sin(8 * B) + a10 * sin(10 * B);
double x = X + N * sin(B) * cos(B) * l * l / 2 / rou / rou +
N / 24 * sin(B) * pow(cos(B), 3) * (5 - t * t + 9 * n * n + 4 * pow(n, 4)) * pow(l, 4) / pow(rou, 4) +
N * sin(B)*pow(cos(B), 5)*(61 - 58 * t*t + pow(t, 4))*pow(l, 6) / 720 /pow(rou, 6);
double y = N * cos(B) * l / rou + N * pow(cos(B), 3) * (1 - t * t + n * n) * pow(l, 3) / 6 / pow(rou, 3)
+ N *pow(cos(B), 5) * (5 - 18 * t * t + pow(t, 4)) *pow(l, 5) / 120 / pow(rou, 5);
double gamma =sin(B) * l / rou + sin(B) * cos(B) *cos(B) * pow(l / rou, 3) / 3 * (1 + 3 * n * n + 2 * pow(n, 4)) +
sin(B) * pow(cos(B), 4) * pow(l / rou, 5) / 15 * (2 - t * t);//弧度制
gamma = gamma * 180 / PI;//角度制
//打印x,y坐标
ui_new->lineEdit_8->setText(QString::number(x, 'f', 4));
ui_new->lineEdit_9->setText(QString::number(y, 'f', 4));
//打印子午线收敛角
ui_new->lineEdit_10->setText(QString::number((int)(gamma)));
ui_new->lineEdit_11->setText(QString::number((int)((gamma - (int)(gamma)) * 60)));
ui_new->lineEdit_12->setText(QString::number(((gamma - (int)(gamma)) * 60 - (int)((gamma - (int)(gamma)) * 60)) * 60));
}
}
void Form2::compute()//反算投影函数
{
double a = 0, b = 0, e_2 = 0, e_dot_2 = 0, rou = 206264.806247096355;
int pp = 0;
if (ui_new1->radioButton->isChecked())
{
a = 6378245;//椭圆长半轴
b = 6356863.0187730473;//椭圆短半轴
e_2 = 0.006693421622966;//椭圆第一偏心率e^2
e_dot_2 = 0.006738525414683;//椭圆第二偏心率e'^2
pp = 1;
}
else if (ui_new1->radioButton_2->isChecked())//
{
a = 6378140;//椭圆长半轴
b = 6356755.2881575287;//椭圆短半轴
e_2 = 0.006694384999588;//椭圆第一偏心率e^2
e_dot_2 = 0.006739501819473;//椭圆第二偏心率e'^2
pp = 1;
}
else if (ui_new1->radioButton_3->isChecked())//
{
a = 6378137;//椭圆长半轴
b = 6356752.3142;//椭圆短半轴
e_2 = 0.00669437999013;//椭圆第一偏心率e^2
e_dot_2 = 0.00673949674227;//椭圆第二偏心率e'^2
pp = 1;
}
else if (ui_new1->radioButton_4->isChecked())//
{
a = 6378137;//椭圆长半轴
b = 6356752.3141;//椭圆短半轴
e_2 = 0.00669438002290;//椭圆第一偏心率e^2
e_dot_2 = 0.00673949677548;//椭圆第二偏心率e'^2
pp = 1;
}
else if (pp == 0)
{
QMessageBox::critical(this, "warning", "Please select an ellipsoid");
}
double c = a * a / b;
if (ui_new1->lineEdit->text().isEmpty() || ui_new1->lineEdit_2->text().isEmpty() || ui_new1->lineEdit_3->text().isEmpty())
{
QMessageBox::warning(this, "warning", "Please enter complete parameters");
}
else
{
double x = ui_new1->lineEdit->text().toDouble();
double y = ui_new1->lineEdit_2->text().toDouble();
double L0 = ui_new1->lineEdit_3->text().toDouble();
//子午线弧长求大地纬度(迭代法)
double Bf = x / 111134.8611, cha;//单位度
double F = -16036.4803 * sin(2 * Bf / 180 * PI) + 16.8281 * sin(4 * Bf / 180 * PI) - 0.022 * sin(6 * Bf / 180 * PI);
do
{
cha = Bf;
F = -16036.4803 * sin(2 * Bf / 180 * PI) + 16.8281 * sin(4 * Bf / 180 * PI) - 0.022 * sin(6 * Bf / 180 * PI);
Bf = (x - F) / 111134.8611;
} while (abs(cha - Bf) > 1e-8);
Bf = Bf / 180 * PI;//单位弧度
double Wf = sqrt(1 - e_2 * sin(Bf) * sin(Bf));
double Vf = sqrt(1 + e_dot_2 * cos(Bf) * cos(Bf));
double Mf = a * (1 - e_2) / (Wf * Wf * Wf);
double Nf = a / Wf;
double tf =tan(Bf), nf = e_dot_2 * cos(Bf) * cos(Bf);
double gamma = rou * y * tf / Nf - rou * y * y * y * tf / 3 / pow(Nf, 3) * (1 + tf * tf - nf * nf) +
rou * pow(y, 5) * tf / 15 / pow(Nf, 5) * (2 + 5 * tf * tf + 3 * pow(tf, 4));//单位弧度秒
gamma = gamma * 180 / PI / rou;//单位度
double B = Bf - tf * y * y / 2 / Mf / pow(Nf, 3) + tf * (5 + 3 * tf * tf + nf * nf - 9 * nf * nf * tf * tf) * pow(y, 4) / 24 / Mf / pow(Nf, 3) -
tf * (61 + 90 * tf * tf + 45 * pow(tf, 4)) * pow(y, 6) / 720 / Mf / pow(Nf, 5);
double l = y / Nf / cos(Bf) - (1 + 2 * tf * tf + nf * nf) * pow(y, 3) / 6 / cos(Bf) / pow(Nf, 3) +
(5 + 28 * tf * tf + 24 * pow(tf, 4) + 6 * nf * nf + 8 * tf * tf * nf * nf) * pow(y, 5) / 120 / cos(Bf) / pow(Nf, 5);
double L = l * 180 / PI + L0;//单位度
B = B * 180 / PI;
//打印纬度
ui_new1->lineEdit_5->setText(QString::number((int)(B)));
ui_new1->lineEdit_6->setText(QString::number((int)((B - (int)(B)) * 60)));
ui_new1->lineEdit_7->setText(QString::number(((B - (int)(B)) * 60 - floor((B - (int)(B)) * 60)) * 60));
//打印经度
ui_new1->lineEdit_8->setText(QString::number((int)(L)));
ui_new1->lineEdit_9->setText(QString::number((int)((L - (int)(L)) * 60)));
ui_new1->lineEdit_10->setText(QString::number(((L - (int)(L)) * 60 - floor((L - (int)(L)) * 60)) * 60));
//打印子午线收敛角
ui_new1->lineEdit_11->setText(QString::number((int)(gamma)));
ui_new1->lineEdit_12->setText(QString::number((int)((gamma - (int)(gamma)) * 60)));
ui_new1->lineEdit_13->setText(QString::number(((gamma - (int)(gamma)) * 60 - (int)((gamma - (int)(gamma)) * 60)) * 60));
}
}
void Form2::uncompute()
{
double a = 0, b = 0, e_2 = 0, e_dot_2 = 0, rou = 206264.806247096355;
int pp = 0;
if (ui_new1->radioButton->isChecked())
{
a = 6378245;//椭圆长半轴
b = 6356863.0187730473;//椭圆短半轴
e_2 = 0.006693421622966;//椭圆第一偏心率e^2
e_dot_2 = 0.006738525414683;//椭圆第二偏心率e'^2
pp = 1;
}
else if (ui_new1->radioButton_2->isChecked())//
{
a = 6378140;//椭圆长半轴
b = 6356755.2881575287;//椭圆短半轴
e_2 = 0.006694384999588;//椭圆第一偏心率e^2
e_dot_2 = 0.006739501819473;//椭圆第二偏心率e'^2
pp = 1;
}
else if (ui_new1->radioButton_3->isChecked())//
{
a = 6378137;//椭圆长半轴
b = 6356752.3142;//椭圆短半轴
e_2 = 0.00669437999013;//椭圆第一偏心率e^2
e_dot_2 = 0.00673949674227;//椭圆第二偏心率e'^2
pp = 1;
}
else if (ui_new1->radioButton_4->isChecked())//
{
a = 6378137;//椭圆长半轴
b = 6356752.3141;//椭圆短半轴
e_2 = 0.00669438002290;//椭圆第一偏心率e^2
e_dot_2 = 0.00673949677548;//椭圆第二偏心率e'^2
pp = 1;
}
else if (pp == 0)
{
QMessageBox::critical(this, "warning", "Please select an ellipsoid");
}
double c = a * a / b;
if (ui_new1->lineEdit->text().isEmpty() || ui_new1->lineEdit_2->text().isEmpty() || ui_new1->lineEdit_3->text().isEmpty())
{
QMessageBox::warning(this, "warning", "Please enter complete parameters");
}
else
{
double x = ui_new1->lineEdit->text().toDouble();
double y = ui_new1->lineEdit_2->text().toDouble();
double L0 = ui_new1->lineEdit_3->text().toDouble();
//子午线弧长求大地纬度(迭代法)
double Bf = x / 111134.8611, cha;//单位度
double F = -16036.4803 * sin(2 * Bf / 180 * PI) + 16.8281 * sin(4 * Bf / 180 * PI) - 0.022 * sin(6 * Bf / 180 * PI);
do
{
cha = Bf;
F = -16036.4803 * sin(2 * Bf / 180 * PI) + 16.8281 * sin(4 * Bf / 180 * PI) - 0.022 * sin(6 * Bf / 180 * PI);
Bf = (x - F) / 111134.8611;
} while (abs(cha - Bf) > 1e-8);
Bf = Bf / 180 * PI;//单位弧度
double Wf = sqrt(1 - e_2 * sin(Bf) * sin(Bf));
double Vf = sqrt(1 + e_dot_2 * cos(Bf) * cos(Bf));
double Mf = a * (1 - e_2) / (Wf * Wf * Wf);
double Nf = a / Wf;
double tf = tan(Bf), nf = e_dot_2 * cos(Bf) * cos(Bf);
double gamma = rou * y * tf / Nf - rou * y * y * y * tf / 3 / pow(Nf, 3) * (1 + tf * tf - nf * nf) +
rou * pow(y, 5) * tf / 15 / pow(Nf, 5) * (2 + 5 * tf * tf + 3 * pow(tf, 4));//单位弧度秒
gamma = gamma * 180 / PI / rou;//单位度
double B = Bf - tf * y * y / 2 / Mf / pow(Nf, 3) + tf * (5 + 3 * tf * tf + nf * nf - 9 * nf * nf * tf * tf) * pow(y, 4) / 24 / Mf / pow(Nf, 3) -
tf * (61 + 90 * tf * tf + 45 * pow(tf, 4)) * pow(y, 6) / 720 / Mf / pow(Nf, 5);
double l = y / Nf / cos(Bf) - (1 + 2 * tf * tf + nf * nf) * pow(y, 3) / 6 / cos(Bf) / pow(Nf, 3) +
(5 + 28 * tf * tf + 24 * pow(tf, 4) + 6 * nf * nf + 8 * tf * tf * nf * nf) * pow(y, 5) / 120 / cos(Bf) / pow(Nf, 5);
double L = l * 180 / PI + L0;//单位度
B = B * 180 / PI;
//打印纬度
ui_new1->lineEdit_5->setText(QString::number((int)(B)));
ui_new1->lineEdit_6->setText(QString::number((int)((B - (int)(B)) * 60)));
ui_new1->lineEdit_7->setText(QString::number(((B - (int)(B)) * 60 - floor((B - (int)(B)) * 60)) * 60));
//打印经度
ui_new1->lineEdit_8->setText(QString::number((int)(L)));
ui_new1->lineEdit_9->setText(QString::number((int)((L - (int)(L)) * 60)));
ui_new1->lineEdit_10->setText(QString::number(((L - (int)(L)) * 60 - floor((L - (int)(L)) * 60)) * 60));
//打印子午线收敛角
ui_new1->lineEdit_11->setText(QString::number((int)(gamma)));
ui_new1->lineEdit_12->setText(QString::number((int)((gamma - (int)(gamma)) * 60)));
ui_new1->lineEdit_13->setText(QString::number(((gamma - (int)(gamma)) * 60 - (int)((gamma - (int)(gamma)) * 60)) * 60));
//求新坐标的x,y
//转化为弧度制
B = B / 180 * PI;
L = L / 180 * PI;
L0 = ui_new1->lineEdit_4->text().toDouble() / 180 * PI;
double W = sqrt(1 - e_2 * sin(B) * sin(B));
double V = sqrt(1 + e_dot_2 * cos(B) * cos(B));
double M = a * (1 - e_2) / (W * W * W);//子午圈曲率半径
double N = a / W;//卯酉圈曲率半径
double t = tan(B), n = e_dot_2 * cos(B) * cos(B);
l = (L - L0) * rou;//单位弧度秒
//计算子午圈弧长
double A1 = 1 + 3 / 4 * e_2 + 45 / 64 * e_2 * e_2 + 175 / 256 * pow(e_2, 3) + 11025 / 16384 * pow(e_2, 4) + 43659 / 65536 * pow(e_2, 5);
double A2 = 3 / 4 * e_2 + 15 / 16 * e_2 * e_2 + 525 / 512 * pow(e_2, 3) + 2205 / 2048 * pow(e_2, 4) + 72765 / 65536 * pow(e_2, 5);
double A3 = 15 / 64 * e_2 * e_2 + 105 / 256 * pow(e_2, 3) + 2205 / 4096 * pow(e_2, 4) + 10395 / 16384 * pow(e_2, 5);
double A4 = 35 / 512 * pow(e_2, 3) + 315 / 2048 * pow(e_2, 4) + 31185 / 131072 * pow(e_2, 5);
double A5 = 315 / 16384 * pow(e_2, 4) + 3465 / 65536 * pow(e_2, 5);
double A6 = 693 / 131072 * pow(e_2, 5);
double a0 = A1 * a * (1 - e_2), a2 = -A2 / 2 * a * (1 - e_2), a4 = A3 / 4 * a * (1 - e_2), a6 = -A4 * a / 6 * (1 - e_2), a8 = A5 * a / 8 * (1 - e_2), a10 = -A6 * a / 10 * (1 - e_2);
double X = a0 * B + a2 * sin(2 * B) + a4 * sin(4 * B) + a6 * sin(6 * B) + a8 * sin(8 * B) + a10 * sin(10 * B);
x = X + N * sin(B) * cos(B) * l * l / 2 / rou / rou +
N / 24 * sin(B) * pow(cos(B), 3) * (5 - t * t + 9 * n * n + 4 * pow(n, 4)) * pow(l, 4) / pow(rou, 4) +
N * sin(B) * pow(cos(B), 5) * (61 - 58 * t * t + pow(t, 4)) * pow(l, 6) / 720 / pow(rou, 6);
y = N * cos(B) * l / rou + N * pow(cos(B), 3) * (1 - t * t + n * n) * pow(l, 3) / 6 / pow(rou, 3)
+ N * pow(cos(B), 5) * (5 - 18 * t * t + pow(t, 4)) * pow(l, 5) / 120 / pow(rou, 5);
gamma = sin(B) * l / rou + sin(B) * cos(B) * cos(B) * pow(l / rou, 3) / 3 * (1 + 3 * n * n + 2 * pow(n, 4)) +
sin(B) * pow(cos(B), 4) * pow(l / rou, 5) / 15 * (2 - t * t);//弧度制
gamma = gamma * 180 / PI;//单位度
//打印新坐标
ui_new1->lineEdit_14->setText(QString::number(x,'f',4));
ui_new1->lineEdit_15->setText(QString::number(y,'f',4));
//打印新子午线收敛角
ui_new1->lineEdit_16->setText(QString::number((int)(gamma)));
ui_new1->lineEdit_17->setText(QString::number((int)((gamma - (int)(gamma)) * 60)));
ui_new1->lineEdit_18->setText(QString::number(((gamma - (int)(gamma)) * 60 - (int)((gamma - (int)(gamma)) * 60)) * 60));
}
}