基于Qt、Eigen的四种平差模型计算器

可实现

1、条件平差

2、间接平差

3、附有限制条件的间接平差

4、附有参数的条件平差

 

效果:

 

 

 

 

 

 

 

 

 

直接上代码

.h

#pragma once

#include <QtWidgets/QMainWindow>
#include <QMenuBar>
#include <Eigen/Dense>
#include <Eigen/Sparse>
#include<fstream>
#include <sstream>
#include<vector>
#include <string>
#include<qmessagebox.h>
#include<string.h>
#include<qtextedit.h>
#include<qgridlayout.h>
#include <QAction>
#include<qpushbutton.h>
#include<qmenu.h>
#include<qinputdialog.h>
#include <QTextBlock>
#include<qdebug.h>
#include<qmessagebox.h>
#include<qlabel.h>
#include<qcombobox.h>
class Adjustment : public QMainWindow 
{
	Q_OBJECT

public:
	Adjustment(QWidget *parent = Q_NULLPTR);
	//确定文本的行数
	int getFileRows(const char *fileName);
	//确定文本的列数
	int getFileColumns(const char * fileName);
	void condi_push_data();//条件平差 矩阵转换计算
	void withPara_push_data();//附有参数的条件平差 矩阵转换计算
	void indir_push_data();//间接平差 矩阵转换计算
	void withRestr_push_data();//附有限制条件的间接平差 矩阵转换计算
public slots:

	//条件平差相关参数计算
	void condi_about();//条件平差-界面
	void condi_import_para();//导入参数
	void condi_show_value();
	
	//附有参数的条件平差平差
	void withPara_about();//附有参数的条件平差平差-界面
	void withPara_import_para();//导入参数
	void withPara_show_value();

	//间接平差
	void indir_about();//间接平差-界面
	void indir_import_para();//导入参数
	void indir_show_value();


	//附有限制条件的间接平差
	void withRestr_about();//附有限制条件的间接平差-界面
	void withRestr_import_para();//导入参数
	void withRestr_show_value();


private:
	QString temp;
	int condi_r;//多余观测数
	int condi_n;//观测总数

	int withPara_u;
	int withPara_r;
	int withPara_n;

	int indir_t;
	int indir_n;

	int withRestr_u;
	int withRestr_t;
	int withRestr_n;
	int withRestr_s;

	void createActions();//任务栏指令
	void createMenus();//创建任务栏
	QTextEdit *set_data;//值输出
	QTextEdit *textEdit;
	QTextEdit *weightEdit;
	QTextEdit *B_edit;
	QTextEdit *W_edit;
	QWidget *centralWidget;
	QAction *condi_action;//任务动作
	QAction *withPara_action;
	QAction *indir_action;
	QAction *withRestr_action;
	QPushButton *show_con_value;//相关按钮

	QPushButton *import_con_param;//导入参数

	QPushButton *show_ind_V;
	QGridLayout *centralLayout;//排布控件
	QMenu *chooseMenu;//菜单栏


	QComboBox *chooseValue;//选择计算值
	
	QLabel *A_lable;
	QLabel *B_lable;
	QLabel *L_lable;
	QLabel *P_lable;
	QLabel *W_lable;

    //条件平差
	Eigen::MatrixXd condiadjustment_w;
	Eigen::MatrixXd condiadjustment_A;
	Eigen::MatrixXd condiadjustment_N;
	Eigen::MatrixXd condiadjustment_K;
	Eigen::MatrixXd condiadjustment_V;
	Eigen::MatrixXd condiadjustment_sqm0;//中误差平方
	Eigen::MatrixXd condiadjustment_QlL;//观测值
	Eigen::MatrixXd condiadjustment_QLL;//平差值

	//附有参数的条件平差
	Eigen::MatrixXd wiParadjustment_w;
	Eigen::MatrixXd wiParadjustment_A;
	Eigen::MatrixXd wiParadjustment_B;
	Eigen::MatrixXd wiParadjustment_N;
	Eigen::MatrixXd wiParadjustment_Nbb;
	Eigen::MatrixXd wiParadjustment_K;
	Eigen::MatrixXd wiParadjustment_V;
	Eigen::MatrixXd wiParadjustment_x;
	Eigen::MatrixXd wiParadjustment_sqm0;//中误差平方
	Eigen::MatrixXd wiParadjustment_Qxx;//观测值

	//间接平差
	Eigen::MatrixXd indiradjustment_L;
	Eigen::MatrixXd indiradjustment_A;
	Eigen::MatrixXd indiradjustment_N;
	Eigen::MatrixXd indiradjustment_C;
	Eigen::MatrixXd indiradjustment_X;
	Eigen::MatrixXd indiradjustment_V;
	Eigen::MatrixXd indiradjustment_sqm0;//中误差平方
	Eigen::MatrixXd indiradjustment_Qxx;//观测值
	Eigen::MatrixXd indiradjustment_QLL;//平差值

	//附有限制条件的间接平差
	Eigen::MatrixXd withRestradjustment_L;
	Eigen::MatrixXd withRestradjustment_A;
	Eigen::MatrixXd withRestradjustment_B;
	Eigen::MatrixXd withRestradjustment_W;
	Eigen::MatrixXd withRestradjustment_Naa;
	Eigen::MatrixXd withRestradjustment_Nbb;
	Eigen::MatrixXd withRestradjustment_C;
	Eigen::MatrixXd withRestradjustment_K;
	Eigen::MatrixXd withRestradjustment_X;
	Eigen::MatrixXd withRestradjustment_V;
	Eigen::MatrixXd withRestradjustment_sqm0;//中误差平方
	Eigen::MatrixXd withRestradjustment_Qxx;
	Eigen::MatrixXd withRestradjustment_Qkk;

	bool start;//数据输入开关




};

 .cpp

#include "Adjustment.h"

Adjustment::Adjustment(QWidget *parent)
	: QMainWindow(parent)
{

	setWindowTitle(tr("Adjuster"));
	resize(700, 750);

	
	createActions();
	createMenus();



}

int Adjustment::getFileRows(const char * fileName)
{
	int count = 1;
	std::ifstream fileStream;
	std::string tmp;// 行数计数器
	fileStream.open(fileName, std::ios::in);//ios::in 表示以只读的方式读取文件
	if (!fileStream)//文件打开失败:返回-1
	{
		return -1;
	}
	else//文件存在    
	{
		char c;
		while (fileStream.get(c))
		{
			if (c == '\n')
			{
				count++;
			}
		}
		fileStream.close();
		return count;

	}
}

int Adjustment::getFileColumns(const char * fileName)
{
	int count = 0;//计数器
	std::ifstream fileStream;
	fileStream.open(fileName, std::ios::_Nocreate);
	double tmp = 0;		// 列数计数器
	char c;			//当前位置的字符
	c = fileStream.peek();
	while (('\n' != c) && (!fileStream.eof()))	// 指针指向的当前字符,仅观测,不移动指针位置   
	{
		fileStream >> tmp;
		count++;
		c = fileStream.peek();
	}
	fileStream.close();
	return count;
}

void Adjustment::condi_push_data()
{
	

	//输入AVW 系数

	Eigen::MatrixXd condiadjustmentAVW = Eigen::MatrixXd(condi_r, condi_n+1);  //生成目标矩阵(确定行列)
	double data_data;
	std::vector<double> data_save;

	//data_save.push_back(data_data);  //存入所有元素于vector
	for (int line_Anum = 0; line_Anum < condi_r; line_Anum++)
	{
		QString get_num = set_data->document()->findBlockByLineNumber(line_Anum*2).text(); //->toPlainText();
		
		for (int col_num = 0; col_num < condi_n; col_num++)
		{
			QString Anum = get_num.section(',', col_num, col_num);

			data_save.push_back(Anum.toDouble());
		}
		QString get_Wnum = textEdit->document()->findBlockByLineNumber(line_Anum * 2).text();
		QString Wnum = get_Wnum.section(',', 0, 0);

		data_save.push_back(Wnum.toDouble());
		
	}




	int count = 0;
	for (int row = 0; row < condi_r; row++)
	{
		for (int col = 0; col < condi_n+1; col++)
		{
			condiadjustmentAVW(row, col) = data_save[count]; //元素转存入目标矩阵
			count++;
		}
	}


	
	
	//输入权重值
	int weight_cols_num = condi_n; int weight_rows_num = condi_n;

	Eigen::MatrixXd condiadjustment_weight = Eigen::MatrixXd(weight_rows_num, weight_cols_num);  //生成目标矩阵(确定行列)
	double weight_data;
	std::vector<double> weight_save;


	for (int line_Pnum = 0; line_Pnum < condi_n; line_Pnum++)
	{
		QString get_Pnum = weightEdit->document()->findBlockByLineNumber(line_Pnum * 2).text(); //->toPlainText();
		for (int col_num = 0; col_num < condi_n; col_num++)
		{
			QString Pnum = get_Pnum.section(',', col_num, col_num);
			
			weight_save.push_back(Pnum.toDouble());
		}


	}

	count = 0;
	for (int row = 0; row < weight_rows_num; row++)
	{
		for (int col = 0; col < weight_cols_num; col++)
		{
			condiadjustment_weight(row, col) = weight_save[count]; //元素转存入目标矩阵
			count++;
		}
	}


	condiadjustment_w= condiadjustmentAVW.topRightCorner(condi_r, 1);

	
	condiadjustment_A = condiadjustmentAVW.topLeftCorner(condi_r, condi_n);

	
	condiadjustment_N= condiadjustment_A*condiadjustment_weight.MatrixBase::inverse()*condiadjustment_A.MatrixBase::transpose();

	
	condiadjustment_K = (-1)*condiadjustment_N.MatrixBase::inverse()*condiadjustment_w;

	
	condiadjustment_V=(-1)*condiadjustment_weight.MatrixBase::inverse()*condiadjustment_A.MatrixBase::transpose()*
		condiadjustment_N.MatrixBase::inverse()*condiadjustment_w;

	
	condiadjustment_sqm0 = condiadjustment_V.MatrixBase::transpose()*condiadjustment_weight*condiadjustment_V;
	condiadjustment_sqm0 = condiadjustment_sqm0 / condiadjustmentAVW.rows();
	
	
	condiadjustment_QlL = condiadjustment_weight.MatrixBase::inverse();

	
	condiadjustment_QLL = condiadjustment_weight.MatrixBase::inverse() - condiadjustment_weight.MatrixBase::inverse()*condiadjustment_A.MatrixBase::transpose()
		*condiadjustment_N.MatrixBase::inverse()*condiadjustment_A*condiadjustment_weight.MatrixBase::inverse();




	

}
void Adjustment::withPara_push_data()
{

	//输入AVBXW 系数
	int withPara_c = withPara_u + withPara_r;
	Eigen::MatrixXd wiparadjustmentAVBXW = Eigen::MatrixXd(withPara_c, withPara_n+withPara_u+1);  //生成目标矩阵(确定行列)
	double data_data;
	std::vector<double> data_save;

	//data_save.push_back(data_data);  //存入所有元素于vector
	for (int line_Anum = 0; line_Anum < withPara_c; line_Anum++)
	{
		QString get_num = set_data->document()->findBlockByLineNumber(line_Anum * 2).text(); //->toPlainText();

		for (int col_num = 0; col_num < withPara_n; col_num++)
		{
			QString Anum = get_num.section(',', col_num, col_num);

			data_save.push_back(Anum.toDouble());
		}

		get_num = B_edit->document()->findBlockByLineNumber(line_Anum * 2).text(); //->toPlainText();
		for (int b_col_num = 0; b_col_num < withPara_u; b_col_num++)
		{
			QString Anum = get_num.section(',', b_col_num, b_col_num);

			data_save.push_back(Anum.toDouble());
		}

		QString get_Wnum = textEdit->document()->findBlockByLineNumber(line_Anum * 2).text();
		QString Wnum = get_Wnum.section(',', 0, 0);

		data_save.push_back(Wnum.toDouble());

	}




	int count = 0;
	for (int row = 0; row < withPara_c; row++)
	{
		for (int col = 0; col < withPara_n + withPara_u + 1; col++)
		{
			wiparadjustmentAVBXW(row, col) = data_save[count]; //元素转存入目标矩阵
			count++;
		}
	}




	//输入权重值
	int weight_cols_num = withPara_n; int weight_rows_num = withPara_n;

	Eigen::MatrixXd wiparadjustment_weight = Eigen::MatrixXd(weight_rows_num, weight_cols_num);  //生成目标矩阵(确定行列)
	double weight_data;
	std::vector<double> weight_save;


	for (int line_Pnum = 0; line_Pnum < withPara_n; line_Pnum++)
	{
		QString get_Pnum = weightEdit->document()->findBlockByLineNumber(line_Pnum * 2).text(); //->toPlainText();
		for (int col_num = 0; col_num < withPara_n; col_num++)
		{
			QString Pnum = get_Pnum.section(',', col_num, col_num);

			weight_save.push_back(Pnum.toDouble());
		}


	}

	count = 0;
	for (int row = 0; row < weight_rows_num; row++)
	{
		for (int col = 0; col < weight_cols_num; col++)
		{
			wiparadjustment_weight(row, col) = weight_save[count]; //元素转存入目标矩阵
			count++;
		}
	}

	wiParadjustment_w= wiparadjustmentAVBXW.topRightCorner(withPara_c, 1);
	wiParadjustment_A = wiparadjustmentAVBXW.topLeftCorner(withPara_c, withPara_n);
	wiParadjustment_B = wiparadjustmentAVBXW.middleCols(withPara_n, withPara_u) ;
 
	//t.MatrixBase::inverse()*condiadjustment_A.MatrixBase::transpose()*
	wiParadjustment_N = wiParadjustment_A * wiparadjustment_weight.MatrixBase::inverse()*wiParadjustment_A.MatrixBase::transpose();
	wiParadjustment_Nbb = wiParadjustment_B.transpose()*wiParadjustment_N.inverse()*wiParadjustment_B;
	wiParadjustment_x = (-1)*wiParadjustment_Nbb.inverse()*wiParadjustment_B.transpose()*wiParadjustment_N.inverse()*wiParadjustment_w;
	wiParadjustment_K = (-1)*wiParadjustment_N.inverse()*(wiParadjustment_B*wiParadjustment_x + wiParadjustment_w);
	wiParadjustment_V = wiparadjustment_weight.inverse()*wiParadjustment_A.transpose()*wiParadjustment_K;
	wiParadjustment_Qxx = wiParadjustment_Nbb.inverse();
	wiParadjustment_sqm0 = wiParadjustment_V.transpose()*wiparadjustment_weight*wiParadjustment_V / withPara_r;


}
void Adjustment::indir_push_data()
{
	//输入AXL 系数

	Eigen::MatrixXd indiradjustmentAXL = Eigen::MatrixXd(indir_n, indir_t + 1);  //生成目标矩阵(确定行列)
	double data_data;
	std::vector<double> data_save;

	//AXL矩阵获取   存入所有元素于vector
	for (int line_Anum = 0; line_Anum < indir_n; line_Anum++)
	{
		QString get_num = set_data->document()->findBlockByLineNumber(line_Anum * 2).text(); //->toPlainText();

		for (int col_num = 0; col_num < indir_t; col_num++)
		{
			QString Anum = get_num.section(',', col_num, col_num);

			data_save.push_back(Anum.toDouble());
		}
		QString get_Lnum = textEdit->document()->findBlockByLineNumber(line_Anum * 2).text();
		QString Lnum = get_Lnum.section(',', 0, 0);

		data_save.push_back(Lnum.toDouble());

	}




	int count = 0;
	for (int row = 0; row < indir_n; row++)
	{
		for (int col = 0; col < indir_t + 1; col++)
		{
			indiradjustmentAXL(row, col) = data_save[count]; //元素转存入目标矩阵
			count++;
		}
	}




	//输入权重值
	int weight_cols_num = indir_n; int weight_rows_num = indir_n;

	Eigen::MatrixXd indiradjustment_weight = Eigen::MatrixXd(weight_rows_num, weight_cols_num);  //生成目标矩阵(确定行列)
	double weight_data;
	std::vector<double> weight_save;


	for (int line_Pnum = 0; line_Pnum < indir_n; line_Pnum++)
	{
		QString get_Pnum = weightEdit->document()->findBlockByLineNumber(line_Pnum * 2).text(); //->toPlainText();
		for (int col_num = 0; col_num < indir_n; col_num++)
		{
			QString Pnum = get_Pnum.section(',', col_num, col_num);

			weight_save.push_back(Pnum.toDouble());
		}


	}

	count = 0;
	for (int row = 0; row < weight_rows_num; row++)
	{
		for (int col = 0; col < weight_cols_num; col++)
		{
			indiradjustment_weight(row, col) = weight_save[count]; //元素转存入目标矩阵
			count++;
		}
	}


	indiradjustment_L = indiradjustmentAXL.topRightCorner(indir_n, 1);
	indiradjustment_A = indiradjustmentAXL.topLeftCorner(indir_n, indir_t);

	indiradjustment_N = indiradjustment_A.transpose()*indiradjustment_weight*indiradjustment_A;
	indiradjustment_C = indiradjustment_A.transpose()*indiradjustment_weight*indiradjustment_L;
	indiradjustment_X = (-1)*indiradjustment_N.inverse()*indiradjustment_C;
	indiradjustment_V = indiradjustment_A * indiradjustment_X + indiradjustment_L;
	indiradjustment_Qxx = indiradjustment_N.inverse();
	indiradjustment_QLL = indiradjustment_A * indiradjustment_N.inverse()*indiradjustment_A.transpose();
	indiradjustment_sqm0 = indiradjustment_V.transpose()*indiradjustment_weight*indiradjustment_V / (indir_n - indir_t);



}
void Adjustment::withRestr_push_data()
{
	//输入AL 系数
	
	Eigen::MatrixXd withRestradjustmentAL = Eigen::MatrixXd(withRestr_n, withRestr_u + 1);  //生成目标矩阵(确定行列)
	double data_data;
	std::vector<double> data_save;

	//data_save.push_back(data_data);  //存入所有元素于vector
	for (int line_Anum = 0; line_Anum < withRestr_n; line_Anum++)
	{
		QString get_num = set_data->document()->findBlockByLineNumber(line_Anum * 2).text(); //->toPlainText();

		for (int col_num = 0; col_num < withRestr_u; col_num++)
		{
			QString Anum = get_num.section(',', col_num, col_num);

			data_save.push_back(Anum.toDouble());
		}

		QString get_Lnum = textEdit->document()->findBlockByLineNumber(line_Anum * 2).text();
		QString Lnum = get_Lnum.section(',', 0, 0);

		data_save.push_back(Lnum.toDouble());

	}




	int count = 0;
	for (int row = 0; row < withRestr_n; row++)
	{
		for (int col = 0; col < withRestr_u + 1; col++)
		{
			withRestradjustmentAL(row, col) = data_save[count]; //元素转存入目标矩阵
			count++;
		}
	}

	//
	Eigen::MatrixXd withRestradjustmentBW = Eigen::MatrixXd(withRestr_s, withRestr_u + 1);  //生成目标矩阵(确定行列)
	
	data_save.clear();

	//data_save.push_back(data_data);  //存入所有元素于vector
	for (int line_Anum = 0; line_Anum < withRestr_s; line_Anum++)
	{
		QString get_Bnum = B_edit->document()->findBlockByLineNumber(line_Anum * 2).text(); //->toPlainText();

		for (int col_num = 0; col_num < withRestr_u; col_num++)
		{
			QString Bnum = get_Bnum.section(',', col_num, col_num);

			data_save.push_back(Bnum.toDouble());
		}

		QString get_Wnum = W_edit->document()->findBlockByLineNumber(line_Anum * 2).text();
		QString Wnum = get_Wnum.section(',', 0, 0);

		data_save.push_back(Wnum.toDouble());

	}




	count = 0;
	for (int row = 0; row < withRestr_s; row++)
	{
		for (int col = 0; col < withRestr_u + 1; col++)
		{
			withRestradjustmentBW(row, col) = data_save[count]; //元素转存入目标矩阵
			count++;
		}
	}



	//输入权重值
	int weight_cols_num = withRestr_n; int weight_rows_num = withRestr_n;

	Eigen::MatrixXd withRestradjustment_weight = Eigen::MatrixXd(weight_rows_num, weight_cols_num);  //生成目标矩阵(确定行列)
	double weight_data;
	std::vector<double> weight_save;


	for (int line_Pnum = 0; line_Pnum < weight_cols_num; line_Pnum++)
	{
		QString get_Pnum = weightEdit->document()->findBlockByLineNumber(line_Pnum * 2).text(); //->toPlainText();
		for (int col_num = 0; col_num < weight_cols_num; col_num++)
		{
			QString Pnum = get_Pnum.section(',', col_num, col_num);

			weight_save.push_back(Pnum.toDouble());
		}


	}

	count = 0;
	for (int row = 0; row < weight_rows_num; row++)
	{
		for (int col = 0; col < weight_cols_num; col++)
		{
			withRestradjustment_weight(row, col) = weight_save[count]; //元素转存入目标矩阵
			count++;
		}
	}
 

	withRestradjustment_A = withRestradjustmentAL.topLeftCorner(withRestr_n, withRestr_u);
	withRestradjustment_L = withRestradjustmentAL.topRightCorner(withRestr_n, 1);
	withRestradjustment_B = withRestradjustmentBW.topLeftCorner(withRestr_s, withRestr_u);
	withRestradjustment_W = withRestradjustmentBW.topRightCorner(withRestr_s, 1);

	withRestradjustment_Naa = withRestradjustment_A.transpose()*withRestradjustment_weight*withRestradjustment_A;
	withRestradjustment_Nbb = withRestradjustment_B * withRestradjustment_Naa.inverse()*withRestradjustment_B.transpose();
	withRestradjustment_C = withRestradjustment_A.transpose()*withRestradjustment_weight*withRestradjustment_L;
	withRestradjustment_K = withRestradjustment_Nbb.inverse()*(withRestradjustment_W - withRestradjustment_B * withRestradjustment_Naa.inverse()*withRestradjustment_C);
	withRestradjustment_X = (-1)*withRestradjustment_Naa.inverse()*(withRestradjustment_B.transpose()*withRestradjustment_K + withRestradjustment_C);
	withRestradjustment_V = withRestradjustment_A * withRestradjustment_X + withRestradjustment_L;
	withRestradjustment_Qkk = withRestradjustment_Nbb.inverse();
	withRestradjustment_Qxx = withRestradjustment_Naa.inverse() - withRestradjustment_Naa.inverse()*withRestradjustment_B.transpose()*withRestradjustment_Nbb.inverse()*
		withRestradjustment_B*withRestradjustment_Naa.inverse();
	withRestradjustment_sqm0 = withRestradjustment_V.transpose()*withRestradjustment_weight*withRestradjustment_V / (withRestr_n - withRestr_t);


}

void Adjustment::createActions()
{
	QString name;
	name = QString::fromLocal8Bit(" &条件平差 ");
	condi_action = new QAction(name, this);
	connect(condi_action, SIGNAL(triggered()), this, SLOT(condi_about()));

	name = QString::fromLocal8Bit(" &附有参数的条件平差 ");
	withPara_action = new QAction(name, this);
	connect(withPara_action, SIGNAL(triggered()), this, SLOT(withPara_about()));

	name = QString::fromLocal8Bit(" &间接平差 ");
	indir_action = new QAction(name, this);
	connect(indir_action, SIGNAL(triggered()), this, SLOT(indir_about()));


	name = QString::fromLocal8Bit(" &附有限制条件的间接平差 ");
	withRestr_action = new QAction(name, this);
	connect(withRestr_action, SIGNAL(triggered()), this, SLOT(withRestr_about()));
}

void Adjustment::createMenus()
{
	QString name;
	name = QString::fromLocal8Bit(" &选择平差模型 ");
	chooseMenu = menuBar()->addMenu(name);
	chooseMenu->addAction(condi_action);
	chooseMenu->addAction(withPara_action);
	chooseMenu->addAction(indir_action);
	chooseMenu->addAction(withRestr_action);
}

void Adjustment::condi_about()
{
	resize(700, 750);
	centralWidget = new QWidget;
	setCentralWidget(centralWidget);

	centralLayout = new QGridLayout;
	set_data = new QTextEdit();
	textEdit = new QTextEdit();
	weightEdit = new QTextEdit();

	A_lable = new QLabel();
	L_lable = new QLabel();
	P_lable = new QLabel();
	A_lable->setText(QString::fromLocal8Bit("A值"));
	L_lable->setText(QString::fromLocal8Bit("W值"));
	P_lable->setText(QString::fromLocal8Bit("P值"));


	centralLayout->addWidget(A_lable, 0, 5, 1, 3);
	centralLayout->addWidget(L_lable, 0, 8, 1, 3);
	centralLayout->addWidget(P_lable, 0, 1, 1, 3);



	centralLayout->addWidget(weightEdit, 1, 0, 4, 4);
	centralLayout->addWidget(set_data, 1, 4, 4, 4);
	centralLayout->addWidget(textEdit, 1, 8, 4, 1);


	centralWidget->setLayout(centralLayout);

	import_con_param= new QPushButton(QString::fromLocal8Bit("导入参数"));

	chooseValue = new QComboBox;
	chooseValue->addItem(QString::fromLocal8Bit("计算N"));
	chooseValue->addItem(QString::fromLocal8Bit("计算K"));
	chooseValue->addItem(QString::fromLocal8Bit("计算QLL(真值)"));
	chooseValue->addItem(QString::fromLocal8Bit("计算V"));
	chooseValue->addItem(QString::fromLocal8Bit("计算m0"));
	show_con_value = new QPushButton(QString::fromLocal8Bit("计算所选参数"));


	centralLayout->addWidget(import_con_param, 6, 1, 2, 2);
	centralLayout->addWidget(chooseValue, 6, 8, 2, 1);
	centralLayout->addWidget(show_con_value, 7, 8, 2, 1);

	connect(import_con_param, SIGNAL(clicked()), this, SLOT(condi_import_para()));
	connect(show_con_value, SIGNAL(clicked()), this, SLOT(condi_show_value()));

}
void Adjustment::withPara_about()
{
	resize(900, 700);
	
	centralWidget = new QWidget;
	setCentralWidget(centralWidget);

	centralLayout = new QGridLayout;
	set_data = new QTextEdit();
	textEdit = new QTextEdit();
	weightEdit = new QTextEdit();
	B_edit = new QTextEdit();
	A_lable = new QLabel();
	L_lable = new QLabel();
	P_lable = new QLabel();
	B_lable = new QLabel();
	P_lable->setText(QString::fromLocal8Bit("P值"));
	A_lable->setText(QString::fromLocal8Bit("A值"));
	B_lable->setText(QString::fromLocal8Bit("B值"));
	L_lable->setText(QString::fromLocal8Bit("W值"));


	centralLayout->addWidget(P_lable, 0, 1, 1, 3);
	centralLayout->addWidget(A_lable, 0, 5, 1, 3);
	centralLayout->addWidget(B_lable, 0, 9, 1, 1);
	centralLayout->addWidget(L_lable, 0, 12, 1, 1);
    centralLayout->addWidget(weightEdit, 1, 0, 4, 4);
	centralLayout->addWidget(set_data, 1, 4, 4, 4);
	centralLayout->addWidget(B_edit, 1, 8, 4, 4);
	centralLayout->addWidget(textEdit, 1, 12, 4, 1);


	centralWidget->setLayout(centralLayout);

	import_con_param = new QPushButton(QString::fromLocal8Bit("导入参数"));

	chooseValue = new QComboBox;
	chooseValue->addItem(QString::fromLocal8Bit("计算N"));
	chooseValue->addItem(QString::fromLocal8Bit("计算Nbb"));
	chooseValue->addItem(QString::fromLocal8Bit("计算deltX"));
	chooseValue->addItem(QString::fromLocal8Bit("计算K"));
	chooseValue->addItem(QString::fromLocal8Bit("计算V"));
	chooseValue->addItem(QString::fromLocal8Bit("计算Qxx"));
	chooseValue->addItem(QString::fromLocal8Bit("计算m0"));
	show_con_value = new QPushButton(QString::fromLocal8Bit("计算所选参数"));


	centralLayout->addWidget(import_con_param, 6, 1, 2, 2);
	centralLayout->addWidget(chooseValue, 6, 8, 2, 1);
	centralLayout->addWidget(show_con_value, 7, 8, 2, 1);

	connect(import_con_param, SIGNAL(clicked()), this, SLOT(withPara_import_para()));
	connect(show_con_value, SIGNAL(clicked()), this, SLOT(withPara_show_value()));
	
}
void Adjustment::indir_about()
{
	resize(700, 750);
	centralWidget = new QWidget;
	setCentralWidget(centralWidget);

	centralLayout = new QGridLayout;
	set_data = new QTextEdit();
	textEdit = new QTextEdit();
	weightEdit = new QTextEdit();

	A_lable = new QLabel();
	L_lable = new QLabel();
	P_lable = new QLabel();
	A_lable->setText(QString::fromLocal8Bit("A值"));
	L_lable->setText(QString::fromLocal8Bit("L值"));
	P_lable->setText(QString::fromLocal8Bit("P值"));


	centralLayout->addWidget(A_lable, 0, 5, 1, 3);
	centralLayout->addWidget(L_lable, 0, 8, 1, 3);
	centralLayout->addWidget(P_lable, 0, 1, 1, 3);



	centralLayout->addWidget(weightEdit, 1, 0, 4, 4);
	centralLayout->addWidget(set_data, 1, 4, 4, 4);
	centralLayout->addWidget(textEdit, 1, 8, 4, 1);


	centralWidget->setLayout(centralLayout);

	import_con_param = new QPushButton(QString::fromLocal8Bit("导入参数"));

	chooseValue = new QComboBox;
	chooseValue->addItem(QString::fromLocal8Bit("计算N"));
	chooseValue->addItem(QString::fromLocal8Bit("计算C"));
	chooseValue->addItem(QString::fromLocal8Bit("计算deltX"));
	chooseValue->addItem(QString::fromLocal8Bit("计算V"));
	chooseValue->addItem(QString::fromLocal8Bit("计算Qxx"));
	chooseValue->addItem(QString::fromLocal8Bit("计算QLL(真值)"));
	chooseValue->addItem(QString::fromLocal8Bit("计算m0"));
	show_con_value = new QPushButton(QString::fromLocal8Bit("计算所选参数"));


	centralLayout->addWidget(import_con_param, 6, 1, 2, 2);
	centralLayout->addWidget(chooseValue, 6, 8, 2, 1);
	centralLayout->addWidget(show_con_value, 7, 8, 2, 1);

	connect(import_con_param, SIGNAL(clicked()), this, SLOT(indir_import_para()));
	connect(show_con_value, SIGNAL(clicked()), this, SLOT(indir_show_value()));
}
void Adjustment::withRestr_about()
{
	resize(1200, 600);

	centralWidget = new QWidget;
	setCentralWidget(centralWidget);

	centralLayout = new QGridLayout;
	set_data = new QTextEdit();
	textEdit = new QTextEdit();
	weightEdit = new QTextEdit();
	B_edit = new QTextEdit();
	W_edit = new QTextEdit();

	A_lable = new QLabel();
	L_lable = new QLabel();
	P_lable = new QLabel();
	B_lable = new QLabel();
	W_lable = new QLabel();
	P_lable->setText(QString::fromLocal8Bit("P值"));
	A_lable->setText(QString::fromLocal8Bit("A值"));
	L_lable->setText(QString::fromLocal8Bit("L值"));
	B_lable->setText(QString::fromLocal8Bit("B值"));
	W_lable->setText(QString::fromLocal8Bit("W值"));

	centralLayout->addWidget(P_lable, 0, 1, 1, 3);
	centralLayout->addWidget(A_lable, 0, 5, 1, 3);
	centralLayout->addWidget(L_lable, 0, 9, 1, 3);
	centralLayout->addWidget(B_lable, 0, 13, 1, 3);
	centralLayout->addWidget(W_lable, 0, 17, 1, 3);


	centralLayout->addWidget(weightEdit, 1, 0, 4, 4);
	centralLayout->addWidget(set_data, 1, 4, 4, 4);
	centralLayout->addWidget(textEdit, 1, 8, 4, 4);
	centralLayout->addWidget(B_edit, 1, 12, 4, 4);
	centralLayout->addWidget(W_edit, 1, 16, 4, 4);



	centralWidget->setLayout(centralLayout);

	import_con_param = new QPushButton(QString::fromLocal8Bit("导入参数"));

	chooseValue = new QComboBox;
	chooseValue->addItem(QString::fromLocal8Bit("计算Naa"));
	chooseValue->addItem(QString::fromLocal8Bit("计算Nbb"));
	chooseValue->addItem(QString::fromLocal8Bit("计算C"));
	chooseValue->addItem(QString::fromLocal8Bit("计算K"));
	chooseValue->addItem(QString::fromLocal8Bit("计算deltX"));
	chooseValue->addItem(QString::fromLocal8Bit("计算V"));
	chooseValue->addItem(QString::fromLocal8Bit("计算Qkk"));
	chooseValue->addItem(QString::fromLocal8Bit("计算Qxx"));
	chooseValue->addItem(QString::fromLocal8Bit("计算m0"));
	show_con_value = new QPushButton(QString::fromLocal8Bit("计算所选参数"));


	centralLayout->addWidget(import_con_param, 6, 5, 2, 1);
	centralLayout->addWidget(chooseValue, 6, 12, 2, 1);
	centralLayout->addWidget(show_con_value, 7, 12, 2, 1);

	connect(import_con_param, SIGNAL(clicked()), this, SLOT(withRestr_import_para()));
	connect(show_con_value, SIGNAL(clicked()), this, SLOT(withRestr_show_value()));
}




void Adjustment::condi_import_para()
{
	start = 1;//开始计算开关
	set_data->clear();
	textEdit->clear();
	weightEdit->clear();
	QString info = QString::fromLocal8Bit("请输入条件平差 多余观测数r、观测总数n ,并用/分隔参数");
	bool ok;
	QString text = QInputDialog::getText(this, tr("Adjuster"), info, QLineEdit::Normal, "Format like r/n", &ok);
	
	//获取参数
	QString num = text.section('/', 0, 0);
	condi_r = num.toInt();
	num = text.section('/', 1, 1);
	condi_n = num.toInt();
	if (condi_n < condi_r)
	{
		QMessageBox::warning(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("输入参数有误,请检查后重新输入"));
		return;
	}
	QMessageBox::information(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("导入成功,请修改上侧条件方程相应系数"));
	QString func;
	for (int r = 0; r < condi_r; r++)
	{
		for (int n = 0; n < condi_n; n++)
		{			
			func=func+"0,";
		}
		set_data->append(func + "\n");
		func.clear();
	}

	func = "0,";
	for (int w_r = 0; w_r < condi_r; w_r++)
	{		
		textEdit->append(func + "\n");
	}
	func.clear();

	for (int p_r = 0; p_r < condi_n; p_r++)
	{
		for (int p_r2 = 0; p_r2 < condi_n; p_r2++)
		{
			if (p_r2 == p_r)
			{
				func = func + "1,";
			}
			else
			{
				func = func + "0,";
			}
			
		}
		weightEdit->append(func + "\n");
		func.clear();
	}
	func.clear();


}
void Adjustment::withPara_import_para()
{
	start = 1;//开始计算开关
	set_data->clear();
	textEdit->clear();
	weightEdit->clear();
	B_edit->clear();
	QString info = QString::fromLocal8Bit("请输入条件平差 未知数个数u、多余观测数r、观测总数n ,并用/分隔参数");
	bool ok;
	QString text = QInputDialog::getText(this, tr("Adjuster"), info, QLineEdit::Normal, "Format like u/r/n", &ok);

	//获取参数
	QString num = text.section('/', 0, 0);
	withPara_u = num.toInt();
	num = text.section('/', 1, 1);
	withPara_r = num.toInt();
	num = text.section('/', 2, 2);
	withPara_n = num.toInt();
	if (withPara_u >= withPara_n - withPara_r || withPara_r >= withPara_n)
	{
		QMessageBox::warning(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("输入参数有误,请检查后重新输入"));
		return;
	}
	QMessageBox::information(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("导入成功,请修改上侧相应系数"));
	QString func;
	int withPara_c = withPara_u + withPara_r;


	for (int c = 0; c < withPara_c; c++)
	{
		for (int n = 0; n < withPara_n; n++)
		{
			func = func + "0,";
		}
		set_data->append(func + "\n");
		func.clear();
	}

	func = "0,";
	for (int w_c = 0; w_c < withPara_c; w_c++)
	{
		textEdit->append(func + "\n");
	}
	func.clear();

	for (int p_r = 0; p_r < withPara_n; p_r++)
	{
		for (int p_r2 = 0; p_r2 < withPara_n; p_r2++)
		{
			if (p_r2 == p_r)
			{
				func = func + "1,";
			}
			else
			{
				func = func + "0,";
			}

		}
		weightEdit->append(func + "\n");
		func.clear();
	}
	func.clear();

	for (int b_c = 0; b_c < withPara_c; b_c++)
	{
		for (int b_u = 0; b_u < withPara_u; b_u++)
		{
			func = func + "0,";
		}
		B_edit->append(func + "\n");
		func.clear();
	}


}
void Adjustment::indir_import_para()
{

	start = 1;//开始计算开关
	set_data->clear();
	textEdit->clear();
	weightEdit->clear();
	QString info = QString::fromLocal8Bit("请输入条件平差 未知数个数u(t)、观测总数n ,并用/分隔参数");
	bool ok;
	QString text = QInputDialog::getText(this, tr("Adjuster"), info, QLineEdit::Normal, "Format like u/n", &ok);

	//获取参数
	QString num = text.section('/', 0, 0);
	indir_t = num.toInt();
	num = text.section('/', 1, 1);
	indir_n = num.toInt();
	if (indir_n < indir_t)
	{
		QMessageBox::warning(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("输入参数有误,请检查后重新输入"));
		return;
	}
	QMessageBox::information(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("导入成功,请修改上侧条件方程相应系数"));
	QString func;
	for (int n = 0; n < indir_n; n++)
	{
		for (int t = 0; t < indir_t; t++)
		{
			func = func + "0,";
		}
		set_data->append(func + "\n");
		func.clear();
	}

	func = "0,";
	for (int L_n = 0; L_n < indir_n; L_n++)
	{
		textEdit->append(func + "\n");
	}
	func.clear();

	for (int p_r = 0; p_r < indir_n; p_r++)
	{
		for (int p_r2 = 0; p_r2 < indir_n; p_r2++)
		{
			if (p_r2 == p_r)
			{
				func = func + "1,";
			}
			else
			{
				func = func + "0,";
			}

		}
		weightEdit->append(func + "\n");
		func.clear();
	}
	func.clear();

}
void Adjustment::withRestr_import_para()
{
	start = 1;//开始计算开关
	set_data->clear();
	textEdit->clear();
	weightEdit->clear();
	B_edit->clear();
	W_edit->clear();
	QString info = QString::fromLocal8Bit("请输入条件平差 未知数个数u、必要观测数t、观测总数n ,并用/分隔参数");
	bool ok;
	QString text = QInputDialog::getText(this, tr("Adjuster"), info, QLineEdit::Normal, "Format like u/t/n", &ok);

	//获取参数
	QString num = text.section('/', 0, 0);
	withRestr_u = num.toInt();
	num = text.section('/', 1, 1);
	withRestr_t = num.toInt();
	num = text.section('/', 2, 2);
	withRestr_n = num.toInt();
	withRestr_s = withRestr_u - withRestr_t;


	if (withRestr_t >= withRestr_u || withRestr_t >= withRestr_n)
	{
		QMessageBox::warning(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("输入参数有误,请检查后重新输入"));
		return;
	}
	QMessageBox::information(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("导入成功,请修改上侧相应系数"));
	QString func;



	for (int c = 0; c < withRestr_n; c++)
	{
		for (int n = 0; n < withRestr_u; n++)
		{
			func = func + "0,";
		}
		set_data->append(func + "\n");
		func.clear();
	}

	func = "0,";
	for (int L_c = 0; L_c < withRestr_n; L_c++)
	{
		textEdit->append(func + "\n");
	}
	func.clear();

	for (int p_r = 0; p_r < withRestr_n; p_r++)
	{
		for (int p_r2 = 0; p_r2 < withRestr_n; p_r2++)
		{
			if (p_r2 == p_r)
			{
				func = func + "1,";
			}
			else
			{
				func = func + "0,";
			}

		}
		weightEdit->append(func + "\n");
		func.clear();
	}
	func.clear();

	for (int b_s = 0; b_s < withRestr_s; b_s++)
	{
		for (int b_u = 0; b_u < withRestr_u; b_u++)
		{
			func = func + "0,";
		}
		B_edit->append(func + "\n");
		func.clear();
	}

	func = "0,";
	for (int B_s = 0; B_s < withRestr_s; B_s++)
	{
		W_edit->append(func + "\n");
	}
	func.clear();


}

void Adjustment::condi_show_value()
{
	if (start !=1)
	{
		QMessageBox::warning(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("请先导入参数"));
		return;
	}
	condi_push_data();
	QString str;
	QMessageBox box;
	int type;
	type = chooseValue->currentIndex();
	switch (type)
	{
	  case 0:
	
		 
		  for (int row = 0; row < condiadjustment_N.rows(); row++)
		  {
			  for (int col = 0; col < condiadjustment_N.cols(); col++)
			  {
				  double AVW_data = condiadjustment_N(row, col);
				  str = str + QString::number(AVW_data, 10, 4) + ",";

			  }
			  str = str + "           (" + QString::number(row + 1) + ")\n";
		  }
		
		  box.about(this, tr("N"), str);
		break;

	  case 1:
		  for (int row = 0; row < condiadjustment_K.rows(); row++)
		  {
			  for (int col = 0; col < condiadjustment_K.cols(); col++)
			  {
				  double AVW_data = condiadjustment_K(row, col);
				  str = str + QString::number(AVW_data, 10, 4) + ",";

			  }
			  str = str + "           (" + QString::number(row + 1) + ")\n";

		  }
		  box.about(this, tr("K"), str);
		  break;
	  case 2:
		  for (int row = 0; row < condiadjustment_QLL.rows(); row++)
		  {
			  for (int col = 0; col < condiadjustment_QLL.cols(); col++)
			  {
				  double AVW_data = condiadjustment_QLL(row, col);
				  str = str + QString::number(AVW_data, 10, 4) + ",";

			  }
			  str = str + "           (" + QString::number(row + 1) + ")\n";
		  }
		  box.about(this, tr("QLL"), str);
		  break;
	  case 3:
		  for (int row = 0; row < condiadjustment_V.rows(); row++)
		  {
			  for (int col = 0; col < condiadjustment_V.cols(); col++)
			  {
				  double AVW_data = condiadjustment_V(row, col);
				  str = str + QString::number(AVW_data, 10, 4) + "           V" + QString::number(row + 1);

			  }
			  str = str + "                     \n";
		  }
		  box.about(this, tr("Show-V"), str);
		  break;
	  case 4:
		  double AVW_data = condiadjustment_sqm0(0, 0);
		  AVW_data = sqrt(AVW_data);
		  str = QString::number(AVW_data, 10, 4);
		  //set_data->append(str);
		  box.about(this, tr("m0"), str);
		  break;

	}
}

void Adjustment::withPara_show_value()
{
	if (start != 1)
	{
		QMessageBox::warning(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("请先导入参数"));
		return;
	}
	withPara_push_data();
	QString str;
	QMessageBox box;
	int type;
	type = chooseValue->currentIndex();

	switch (type)
	{
	case 0:


		for (int row = 0; row < wiParadjustment_N.rows(); row++)
		{
			for (int col = 0; col < wiParadjustment_N.cols(); col++)
			{
				double AVBXW_data = wiParadjustment_N(row, col);
				str = str + QString::number(AVBXW_data, 10, 4) + ",";

			}
			str = str + "           (" + QString::number(row + 1) + ")\n";
		}

		box.about(this, tr("N"), str);
		break;

	case 1:
		for (int row = 0; row < wiParadjustment_Nbb.rows(); row++)
		{
			for (int col = 0; col < wiParadjustment_Nbb.cols(); col++)
			{
				double AVW_data = wiParadjustment_Nbb(row, col);
				str = str + QString::number(AVW_data, 10, 4) + ",";

			}
			str = str + "           (" + QString::number(row + 1) + ")\n";

		}
		box.about(this, tr("Nbb"), str);
		break;
	case 2:
		for (int row = 0; row < wiParadjustment_x.rows(); row++)
		{
			for (int col = 0; col < wiParadjustment_x.cols(); col++)
			{
				double AVW_data = wiParadjustment_x(row, col);
				str = str + QString::number(AVW_data, 10, 4) + ",";

			}
			str = str + "           (" + QString::number(row + 1) + ")\n";
		}
		box.about(this, tr("X"), str);
		break;
	case 3:
		for (int row = 0; row < wiParadjustment_K.rows(); row++)
		{
			for (int col = 0; col < wiParadjustment_K.cols(); col++)
			{
				double AVW_data = wiParadjustment_K(row, col);
				str = str + QString::number(AVW_data, 10, 4) + ",";

			}
			str = str + "           (" + QString::number(row + 1) + ")\n";
		}
		box.about(this, tr("Show-K"), str);
		break;
	case 4:
		for (int row = 0; row < wiParadjustment_V.rows(); row++)
		{
			for (int col = 0; col < wiParadjustment_V.cols(); col++)
			{
				double AVW_data = wiParadjustment_V(row, col);
				str = str + QString::number(AVW_data, 10, 4) + "           V" + QString::number(row + 1);

			}
			str = str + "                     \n";
		}
		box.about(this, tr("Show-V"), str);
		break;
	case 5:
		for (int row = 0; row < wiParadjustment_Qxx.rows(); row++)
		{
			for (int col = 0; col < wiParadjustment_Qxx.cols(); col++)
			{
				double AVW_data = wiParadjustment_Qxx(row, col);
				str = str + QString::number(AVW_data, 10, 4) + ",";

			}
			str = str + "           (" + QString::number(row + 1) + ")\n";
		}
		box.about(this, tr("Show-Qxx"), str);
		break;
	case 6:
		double AVW_data = wiParadjustment_sqm0(0, 0);
		AVW_data = sqrt(AVW_data);
		str = QString::number(AVW_data, 10, 4);
		box.about(this, tr("m0"), str);
		break;

	}
}

void Adjustment::indir_show_value()
{
	if (start != 1)
	{
		QMessageBox::warning(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("请先导入参数"));
		return;
	}
	indir_push_data();
	QString str;
	QMessageBox box;
	int type;
	type = chooseValue->currentIndex();
	switch (type)
	{
	case 0:


		for (int row = 0; row < indiradjustment_N.rows(); row++)
		{
			for (int col = 0; col < indiradjustment_N.cols(); col++)
			{
				double AXL_data = indiradjustment_N(row, col);
				str = str + QString::number(AXL_data, 10, 4) + ",";

			}
			str = str + "           (" + QString::number(row + 1) + ")\n";
		}

		box.about(this, tr("N"), str);
		break;

	case 1:
		for (int row = 0; row < indiradjustment_C.rows(); row++)
		{
			for (int col = 0; col < indiradjustment_C.cols(); col++)
			{
				double C_data = indiradjustment_C(row, col);
				str = str + QString::number(C_data, 10, 4) + ",";

			}
			str = str + "           (" + QString::number(row + 1) + ")\n";

		}
		box.about(this, tr("C"), str);
		break;
	case 2:
		for (int row = 0; row < indiradjustment_X.rows(); row++)
		{
			for (int col = 0; col < indiradjustment_X.cols(); col++)
			{
				double deltX_data = indiradjustment_X(row, col);
				str = str + QString::number(deltX_data, 10, 4) + ",";

			}
			str = str + "           (" + QString::number(row + 1) + ")\n";
		}
		box.about(this, tr("deltX"), str);
		break;
	case 3:
		for (int row = 0; row < indiradjustment_V.rows(); row++)
		{
			for (int col = 0; col < indiradjustment_V.cols(); col++)
			{
				double V_data = indiradjustment_V(row, col);
				str = str + QString::number(V_data, 10, 4) + "           V" + QString::number(row + 1);

			}
			str = str + "                     \n";
		}
		box.about(this, tr("Show-V"), str);
		break;
	case 4:
		for (int row = 0; row < indiradjustment_Qxx.rows(); row++)
		{
			for (int col = 0; col < indiradjustment_Qxx.cols(); col++)
			{
				double Qxx_data = indiradjustment_Qxx(row, col);
				str = str + QString::number(Qxx_data, 10, 4) + ",";

			}
			str = str + "           (" + QString::number(row + 1) + ")\n";
		}
		box.about(this, tr("Qxx"), str);
		break;
	case 5:
		for (int row = 0; row < indiradjustment_QLL.rows(); row++)
		{
			for (int col = 0; col < indiradjustment_QLL.cols(); col++)
			{
				double QLL_data = indiradjustment_QLL(row, col);
				str = str + QString::number(QLL_data, 10, 4) + ",";

			}
			str = str + "              (" + QString::number(row + 1) + ")\n";
		}
		box.about(this, tr("QLL"), str);
		break;
	case 6:
		double m0_data = indiradjustment_sqm0(0, 0);
		m0_data = sqrt(m0_data);
		str = QString::number(m0_data, 10, 4);
		box.about(this, tr("m0"), str);
		break;

	}
}

void Adjustment::withRestr_show_value()
{
	if (start != 1)
	{
		QMessageBox::warning(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("请先导入参数"));
		return;
	}
	withRestr_push_data();
	QString str;
	QMessageBox box;
	int type;
	type = chooseValue->currentIndex();
	switch (type)
	{
	case 0:


		for (int row = 0; row < withRestradjustment_Naa.rows(); row++)
		{
			for (int col = 0; col < withRestradjustment_Naa.cols(); col++)
			{
				double Naa_data = withRestradjustment_Naa(row, col);
				str = str + QString::number(Naa_data, 10, 4) + ",";

			}
			str = str + "           (" + QString::number(row + 1) + ")\n";
		}

		box.about(this, tr("Naa"), str);
		break;

	case 1:
		for (int row = 0; row < withRestradjustment_Nbb.rows(); row++)
		{
			for (int col = 0; col < withRestradjustment_Nbb.cols(); col++)
			{
				double Nbb_data = withRestradjustment_Nbb(row, col);
				str = str + QString::number(Nbb_data, 10, 4) + ",";

			}
			str = str + "           (" + QString::number(row + 1) + ")\n";

		}
		box.about(this, tr("Nbb"), str);
		break;
	case 2:
		for (int row = 0; row < withRestradjustment_C.rows(); row++)
		{
			for (int col = 0; col < withRestradjustment_C.cols(); col++)
			{
				double C_data = withRestradjustment_C(row, col);
				str = str + QString::number(C_data, 10, 4) + ",";

			}
			str = str + "           (" + QString::number(row + 1) + ")\n";
		}
		box.about(this, tr("C"), str);
		break;
	case 3:
		for (int row = 0; row < withRestradjustment_K.rows(); row++)
		{
			for (int col = 0; col < withRestradjustment_K.cols(); col++)
			{
				double K_data = withRestradjustment_K(row, col);
				str = str + QString::number(K_data, 10, 4) + ",";

			}
			str = str + "           (" + QString::number(row + 1) + ")\n";
		}
		box.about(this, tr("K"), str);
		break;
		break;
	case 4:
		for (int row = 0; row < withRestradjustment_X.rows(); row++)
		{
			for (int col = 0; col < withRestradjustment_X.cols(); col++)
			{
				double deltX_data = withRestradjustment_X(row, col);
				str = str + QString::number(deltX_data, 10, 4) + ",";

			}
			str = str + "           (" + QString::number(row + 1) + ")\n";
		}
		box.about(this, tr("deltX"), str);
		break;
	case 5:
		for (int row = 0; row < withRestradjustment_V.rows(); row++)
		{
			for (int col = 0; col < withRestradjustment_V.cols(); col++)
			{
				double V_data = withRestradjustment_V(row, col);
				str = str + QString::number(V_data, 10, 4) + "           V" + QString::number(row + 1);

			}
			str = str + "                     \n";
		}
		box.about(this, tr("Show-V"), str);
		break;
	case 6:
		for (int row = 0; row < withRestradjustment_Qkk.rows(); row++)
		{
			for (int col = 0; col < withRestradjustment_Qkk.cols(); col++)
			{
				double Qkk_data = withRestradjustment_Qkk(row, col);
				str = str + QString::number(Qkk_data, 10, 4) + ",";

			}
			str = str + "              (" + QString::number(row + 1) + ")\n";
		}
		box.about(this, tr("Qkk"), str);
		break;
	case 7:
		for (int row = 0; row < withRestradjustment_Qxx.rows(); row++)
		{
			for (int col = 0; col < withRestradjustment_Qxx.cols(); col++)
			{
				double Qxx_data = withRestradjustment_Qxx(row, col);
				str = str + QString::number(Qxx_data, 10, 4) + ",";

			}
			str = str + "              (" + QString::number(row + 1) + ")\n";
		}
		box.about(this, tr("Qxx"), str);
		break;
	case 8:
		double m0_data = withRestradjustment_sqm0(0, 0);
		m0_data = sqrt(m0_data);
		str = QString::number(m0_data, 10, 4);
		box.about(this, tr("m0"), str);
		break;

	}


}





 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值