#include "output_statistic.h"
#include "QtCore\qfile.h"
#include "QtCore\qtextstream.h"

output_statistic::output_statistic(QDialog *parent)
	: QDialog(parent)
{
	ui.setupUi(this);
	this->setWindowFlags(windowFlags()&~Qt::WindowContextHelpButtonHint);
}

output_statistic::~output_statistic()
{
}

void output_statistic::recMsgFromDialogSetup()
{
	QFile file("../conf/camera0_statistic.txt");
	if (file.open(QIODevice::ReadOnly | QIODevice::Text))
	{
		QTextStream in(&file);
		ui.textBrowser_1->setText(in.readAll());
	}
	file.close();
	file.setFileName("../conf/camera1_statistic.txt");
	if (file.open(QIODevice::ReadOnly | QIODevice::Text))
	{
		QTextStream in(&file);
		ui.textBrowser_2->setText(in.readAll());
	}
	file.close();
	file.setFileName("../conf/camera2_statistic.txt");
	if (file.open(QIODevice::ReadOnly | QIODevice::Text))
	{
		QTextStream in(&file);
		ui.textBrowser_3->setText(in.readAll());
	}
	file.close();
	file.setFileName("../conf/camera3_statistic.txt");
	if (file.open(QIODevice::ReadOnly | QIODevice::Text))
	{
		QTextStream in(&file);
		ui.textBrowser_4->setText(in.readAll());
	}
	file.close();
	file.setFileName("../conf/camera4_statistic.txt");
	if (file.open(QIODevice::ReadOnly | QIODevice::Text))
	{
		QTextStream in(&file);
		ui.textBrowser_5->setText(in.readAll());
	}
	file.close();
	file.setFileName("../conf/camera5_statistic.txt");
	if (file.open(QIODevice::ReadOnly | QIODevice::Text))
	{
		QTextStream in(&file);
		ui.textBrowser_6->setText(in.readAll());
	}
	file.close();
	file.setFileName("../conf/camera6_statistic.txt");
	if (file.open(QIODevice::ReadOnly | QIODevice::Text))
	{
		QTextStream in(&file);
		ui.textBrowser_7->setText(in.readAll());
	}
	file.close();
	file.setFileName("../conf/camera7_statistic.txt");
	if (file.open(QIODevice::ReadOnly | QIODevice::Text))
	{
		QTextStream in(&file);
		ui.textBrowser_8->setText(in.readAll());
	}
	file.close();
	this->show();
}
