|
@@ -1,511 +0,0 @@
|
|
|
-#include "MatrixPanelWidget.h"
|
|
|
-#include "ui_MatrixPanelWidget.h"
|
|
|
-#include "MatrixTableWidget.h"
|
|
|
-#include "MatrixTableTechMeasuresWidget.h"
|
|
|
-#include "dbService/DBServiceSet.h"
|
|
|
-
|
|
|
-#include <CollectKnowledgeWidget.h>
|
|
|
-
|
|
|
-MatrixPanelWidget::MatrixPanelWidget(QWidget *parent) : QWidget(parent), ui(new Ui::MatrixPanelWidget)
|
|
|
-{
|
|
|
- ui->setupUi(this);
|
|
|
-
|
|
|
- firstLayout = new QGridLayout;
|
|
|
- firstPlainWidget = nullptr;
|
|
|
- ui->stackedWidget->widget(0)->setLayout(firstLayout);
|
|
|
- secondLayout = new QGridLayout;
|
|
|
- secondPlainWidget = nullptr;
|
|
|
- ui->stackedWidget->widget(1)->setLayout(secondLayout);
|
|
|
- ui->stackedWidget->setCurrentIndex(0);
|
|
|
-
|
|
|
- ui->saveBtn->setDisabled(true);
|
|
|
-}
|
|
|
-
|
|
|
-MatrixPanelWidget::MatrixPanelWidget(QWidget *parent, ProfessorInfo professor)
|
|
|
- : QWidget(parent), ui(new Ui::MatrixPanelWidget)
|
|
|
-{
|
|
|
- ui->setupUi(this);
|
|
|
-
|
|
|
- firstLayout = new QGridLayout;
|
|
|
- firstPlainWidget = nullptr;
|
|
|
- ui->stackedWidget->widget(0)->setLayout(firstLayout);
|
|
|
- secondLayout = new QGridLayout;
|
|
|
- secondPlainWidget = nullptr;
|
|
|
- ui->stackedWidget->widget(1)->setLayout(secondLayout);
|
|
|
- ui->stackedWidget->setCurrentIndex(0);
|
|
|
-
|
|
|
- ui->saveBtn->setDisabled(true);
|
|
|
-
|
|
|
- m_professor = professor;
|
|
|
-}
|
|
|
-
|
|
|
-MatrixPanelWidget::~MatrixPanelWidget()
|
|
|
-{
|
|
|
- if (currentMindNodes) { delete currentMindNodes; }
|
|
|
- if (classifiedNodes) { delete classifiedNodes; }
|
|
|
- if (indexsRefClassifiedNodes) { delete indexsRefClassifiedNodes; }
|
|
|
- delete ui;
|
|
|
-}
|
|
|
-
|
|
|
-void MatrixPanelWidget::init(const QStringList indexsRef, const QStringList indexs)
|
|
|
-{
|
|
|
- indexsRefClassifiedNodes = nullptr;
|
|
|
- if (!indexsRef.isEmpty()) {
|
|
|
- MindNodeManager *indexsRefNodes = new MindNodeManager(); //是否参考指标体系
|
|
|
- getMindNodes(indexsRefNodes, indexsRef);
|
|
|
- indexsRefClassifiedNodes = new QList<QList<MindNodeManager::NodeMessage>>;
|
|
|
- sortMindNodes(*indexsRefNodes, indexsRefClassifiedNodes);
|
|
|
- delete indexsRefNodes;
|
|
|
- }
|
|
|
-
|
|
|
- if (!indexs.isEmpty()) {
|
|
|
- currentMindNodes = new MindNodeManager();
|
|
|
- classifiedNodes = new QList<QList<MindNodeManager::NodeMessage>>;
|
|
|
- getMindNodes(currentMindNodes, indexs);
|
|
|
- sortMindNodes(*currentMindNodes, classifiedNodes);
|
|
|
- } else {
|
|
|
- currentMindNodes = nullptr;
|
|
|
- classifiedNodes = nullptr;
|
|
|
- }
|
|
|
-
|
|
|
- ui->toatalPagesLabel->setText(QString("共%1页").arg(getPages()));
|
|
|
- ui->currPageLabel->setText(QString("当前第0页"));
|
|
|
- if (!indexsRef.isEmpty()) {
|
|
|
- currentTab = "技术措施";
|
|
|
- initPlainTechMeasuresWidget();
|
|
|
- setPage(1);
|
|
|
- return;
|
|
|
- }
|
|
|
- if (!indexs.isEmpty()) {
|
|
|
- currentTab = "";
|
|
|
- initPlainWidget();
|
|
|
- setPage(1);
|
|
|
- return;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-void MatrixPanelWidget::sortMindNodes(const MindNodeManager &manager,
|
|
|
- QList<QList<MindNodeManager::NodeMessage>> *classify)
|
|
|
-{
|
|
|
-
|
|
|
- for (MindNodeManager::NodeMessage msg : manager.getMindNodes()) {
|
|
|
- QStringList nodePonit = msg.node.split(".");
|
|
|
- while (nodePonit.count() - 1 > classify->count()) {
|
|
|
- (*classify) << QList<MindNodeManager::NodeMessage>();
|
|
|
- }
|
|
|
- (*classify)[nodePonit.count() - 2] << msg;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-void MatrixPanelWidget::getMindNodes(MindNodeManager *manager, QStringList listNodes)
|
|
|
-{
|
|
|
- int sn[16];
|
|
|
- memset(sn, 0, sizeof(int) * 16);
|
|
|
- int spaceNum = -1;
|
|
|
- int level = 0;
|
|
|
- MindNodeManager::NodeMessage temp;
|
|
|
-
|
|
|
- manager->setMindName(listNodes[0].trimmed());
|
|
|
-
|
|
|
- for (int i = 1; i < listNodes.count(); i++) {
|
|
|
- int tempSpace = 0;
|
|
|
- for (QString s : listNodes[i]) {
|
|
|
- if (s == " ") {
|
|
|
- tempSpace++;
|
|
|
- } else {
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- tempSpace /= 4;
|
|
|
- if (tempSpace == 1) { //一级
|
|
|
- spaceNum = tempSpace;
|
|
|
- level = 0;
|
|
|
- sn[level]++;
|
|
|
- memset((void *)&sn[1], 0, sizeof(int) * 15);
|
|
|
- } else {
|
|
|
- if (spaceNum < tempSpace) { //空格增加
|
|
|
- spaceNum = tempSpace;
|
|
|
- level++;
|
|
|
- sn[level]++;
|
|
|
- } else if (spaceNum == tempSpace) { //同一级
|
|
|
- sn[level]++;
|
|
|
- } else {
|
|
|
- spaceNum = tempSpace;
|
|
|
- sn[level] = 0;
|
|
|
- level--;
|
|
|
- sn[level]++;
|
|
|
- }
|
|
|
- }
|
|
|
- QString node = "1";
|
|
|
- for (int l : sn) {
|
|
|
- if (l > 0) {
|
|
|
- node += QString(".%1").arg(l);
|
|
|
- } else {
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if (listNodes[i].trimmed().isEmpty()) {
|
|
|
- temp.name = QString("NULL(节点%1)").arg(node);
|
|
|
- temp.node = node;
|
|
|
- temp.remark = "";
|
|
|
- manager->pushNewMind(temp);
|
|
|
- } else {
|
|
|
- temp.name = listNodes[i].trimmed().split("\t")[0];
|
|
|
- temp.node = node;
|
|
|
- temp.remark = listNodes[i].trimmed().split("\t")[1];
|
|
|
- manager->pushNewMind(temp);
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-QStringList MatrixPanelWidget::getFirstIndexNodes(const MindNodeManager &manager)
|
|
|
-{
|
|
|
- QList<QList<MindNodeManager::NodeMessage>> classify;
|
|
|
-
|
|
|
- for (MindNodeManager::NodeMessage msg : manager.getMindNodes()) {
|
|
|
- QStringList nodePonit = msg.node.split(".");
|
|
|
- while (nodePonit.count() - 1 > classify.count()) {
|
|
|
- classify << QList<MindNodeManager::NodeMessage>();
|
|
|
- }
|
|
|
- classify[nodePonit.count() - 2] << msg;
|
|
|
- }
|
|
|
-
|
|
|
- QStringList firstNodes;
|
|
|
-
|
|
|
- for (MindNodeManager::NodeMessage msg : classify.first()) {
|
|
|
- firstNodes << msg.name;
|
|
|
- }
|
|
|
- return firstNodes;
|
|
|
-}
|
|
|
-
|
|
|
-QStringList MatrixPanelWidget::getLastIndexNodes(const MindNodeManager &manager)
|
|
|
-{
|
|
|
- QList<QList<MindNodeManager::NodeMessage>> classify;
|
|
|
-
|
|
|
- for (MindNodeManager::NodeMessage msg : manager.getMindNodes()) {
|
|
|
- QStringList nodePonit = msg.node.split(".");
|
|
|
- while (nodePonit.count() - 1 > classify.count()) {
|
|
|
- classify << QList<MindNodeManager::NodeMessage>();
|
|
|
- }
|
|
|
- classify[nodePonit.count() - 2] << msg;
|
|
|
- }
|
|
|
-
|
|
|
- QStringList lastNodes;
|
|
|
-
|
|
|
- for (MindNodeManager::NodeMessage msg : classify.last()) {
|
|
|
- lastNodes << msg.name;
|
|
|
- }
|
|
|
- return lastNodes;
|
|
|
-}
|
|
|
-
|
|
|
-int MatrixPanelWidget::getPages()
|
|
|
-{
|
|
|
-#if 0
|
|
|
- int max = 0;
|
|
|
- for (MindNodeManager::NodeMessage msg : currentMindNodes->getMindNodes()) {
|
|
|
- QStringList nodePonit = msg.node.split(".");
|
|
|
- if (max < nodePonit.count() - 1) { max = nodePonit.count() - 1; }
|
|
|
- }
|
|
|
- return max;
|
|
|
-#else
|
|
|
- if (!classifiedNodes) { return 0; }
|
|
|
- return classifiedNodes->count();
|
|
|
-#endif
|
|
|
-}
|
|
|
-
|
|
|
-void MatrixPanelWidget::setPage(int page)
|
|
|
-{
|
|
|
- if (page < 1 || page > getPages()) { return; }
|
|
|
- currentPage = page;
|
|
|
- ui->currPageLabel->setText(QString("当前第%1页").arg(currentPage));
|
|
|
- if (currentPage == 1) {
|
|
|
- ui->prePageBtn->setDisabled(true);
|
|
|
- ui->nextPageBtn->setDisabled(false);
|
|
|
- } else if (currentPage == getPages()) {
|
|
|
- ui->prePageBtn->setDisabled(false);
|
|
|
- ui->nextPageBtn->setDisabled(true);
|
|
|
- } else {
|
|
|
- ui->prePageBtn->setDisabled(false);
|
|
|
- ui->nextPageBtn->setDisabled(false);
|
|
|
- }
|
|
|
- paintPlainWidget();
|
|
|
-}
|
|
|
-
|
|
|
-void MatrixPanelWidget::initPlainWidget()
|
|
|
-{
|
|
|
- if (getPages() == 0) { return; }
|
|
|
-
|
|
|
- //准备第一页,非tab的
|
|
|
- MatrixTableWidget *table = new MatrixTableWidget((indexsRefClassifiedNodes == nullptr), nullptr);
|
|
|
- connect(table, &MatrixTableWidget::dataReady, this, &MatrixPanelWidget::oneTableDataReady);
|
|
|
- if (indexsRefClassifiedNodes) {
|
|
|
- for (MindNodeManager::NodeMessage msg : indexsRefClassifiedNodes->last()) {
|
|
|
- table->addRowNode(msg.node, msg.name, msg.remark);
|
|
|
- }
|
|
|
- }
|
|
|
- for (MindNodeManager::NodeMessage msg : classifiedNodes->first()) {
|
|
|
- table->addColNode(msg.node, msg.name, msg.remark);
|
|
|
- if (indexsRefClassifiedNodes == nullptr) { table->addRowNode(msg.node, msg.name, msg.remark); }
|
|
|
- }
|
|
|
- table->paintMatrixTable();
|
|
|
- firstLayout->addWidget(table);
|
|
|
-
|
|
|
- //准备第二页,tab组合的
|
|
|
- for (int p = 1; p < getPages(); ++p) {
|
|
|
- QTabWidget *tab = new QTabWidget;
|
|
|
- tab->setTabPosition(QTabWidget::South);
|
|
|
- for (MindNodeManager::NodeMessage msg : classifiedNodes->at(p - 1)) {
|
|
|
- QString node = msg.node;
|
|
|
- // MatrixTableWidget *table = nullptr;
|
|
|
- table = nullptr;
|
|
|
- for (MindNodeManager::NodeMessage info : classifiedNodes->at(p)) {
|
|
|
- if ((info.node.count('.') == msg.node.count('.') + 1)
|
|
|
- && (info.node.left(msg.node.count()) == msg.node)) {
|
|
|
- if (!table) { table = new MatrixTableWidget((indexsRefClassifiedNodes == nullptr), nullptr); }
|
|
|
- if (table) {
|
|
|
- table->addColNode(info.node, info.name, info.remark);
|
|
|
- if (!indexsRefClassifiedNodes) { table->addRowNode(info.node, info.name, info.remark); }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (indexsRefClassifiedNodes) {
|
|
|
- for (MindNodeManager::NodeMessage msg : indexsRefClassifiedNodes->last()) {
|
|
|
- table->addRowNode(msg.node, msg.name, msg.remark);
|
|
|
- }
|
|
|
- }
|
|
|
- if (table) {
|
|
|
- table->paintMatrixTable();
|
|
|
- tab->addTab(table, msg.name);
|
|
|
- connect(table, &MatrixTableWidget::dataReady, this, &MatrixPanelWidget::oneTableDataReady);
|
|
|
- }
|
|
|
- }
|
|
|
- tabWidgets << tab;
|
|
|
- }
|
|
|
-
|
|
|
- // secondLayout->addWidget(tab);
|
|
|
-}
|
|
|
-
|
|
|
-void MatrixPanelWidget::initPlainTechMeasuresWidget()
|
|
|
-{
|
|
|
- if (getPages() == 0) { return; }
|
|
|
-
|
|
|
- //准备第一页,非tab的
|
|
|
- MatrixTableTechMeasuresWidget *table = new MatrixTableTechMeasuresWidget(nullptr);
|
|
|
- connect(table, &MatrixTableTechMeasuresWidget::dataReady, this, &MatrixPanelWidget::oneTechMeasureTableDataReady);
|
|
|
- if (indexsRefClassifiedNodes) {
|
|
|
- for (MindNodeManager::NodeMessage msg : indexsRefClassifiedNodes->last()) {
|
|
|
- table->addRowNode(msg.node, msg.name, msg.remark);
|
|
|
- }
|
|
|
- }
|
|
|
- for (MindNodeManager::NodeMessage msg : classifiedNodes->first()) {
|
|
|
- table->addColNode(msg.node, msg.name, msg.remark);
|
|
|
- if (indexsRefClassifiedNodes == nullptr) { table->addRowNode(msg.node, msg.name, msg.remark); }
|
|
|
- }
|
|
|
- table->paintMatrixTable();
|
|
|
- firstLayout->addWidget(table);
|
|
|
-
|
|
|
- //准备第二页,tab组合的
|
|
|
- for (int p = 1; p < getPages(); ++p) {
|
|
|
- QTabWidget *tab = new QTabWidget;
|
|
|
- tab->setTabPosition(QTabWidget::South);
|
|
|
- for (MindNodeManager::NodeMessage msg : classifiedNodes->at(p - 1)) {
|
|
|
- QString node = msg.node;
|
|
|
- // MatrixTableWidget *table = nullptr;
|
|
|
- table = nullptr;
|
|
|
- for (MindNodeManager::NodeMessage info : classifiedNodes->at(p)) {
|
|
|
- if ((info.node.count('.') == msg.node.count('.') + 1)
|
|
|
- && (info.node.left(msg.node.count()) == msg.node)) {
|
|
|
- if (!table) { table = new MatrixTableTechMeasuresWidget(nullptr); }
|
|
|
- if (table) {
|
|
|
- table->addColNode(info.node, info.name, info.remark);
|
|
|
- if (!indexsRefClassifiedNodes) { table->addRowNode(info.node, info.name, info.remark); }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (indexsRefClassifiedNodes) {
|
|
|
- for (MindNodeManager::NodeMessage msg : indexsRefClassifiedNodes->last()) {
|
|
|
- table->addRowNode(msg.node, msg.name, msg.remark);
|
|
|
- }
|
|
|
- }
|
|
|
- if (table) {
|
|
|
- table->paintMatrixTable();
|
|
|
- tab->addTab(table, msg.name);
|
|
|
- connect(table, &MatrixTableTechMeasuresWidget::dataReady, this,
|
|
|
- &MatrixPanelWidget::oneTechMeasureTableDataReady);
|
|
|
- }
|
|
|
- }
|
|
|
- tabWidgets << tab;
|
|
|
- }
|
|
|
-
|
|
|
- // secondLayout->addWidget(tab);
|
|
|
-}
|
|
|
-
|
|
|
-void MatrixPanelWidget::paintPlainWidget()
|
|
|
-{
|
|
|
- bool firstShow = true;
|
|
|
- if (getPages() == 0) { return; }
|
|
|
-
|
|
|
- if (currentPage > 1) { firstShow = false; }
|
|
|
-
|
|
|
- if (firstShow) {
|
|
|
- ui->stackedWidget->setCurrentIndex(0);
|
|
|
- } else {
|
|
|
- QTabWidget *newTab = tabWidgets.at(currentPage - 2);
|
|
|
- if (secondLayout->count() == 0) {
|
|
|
- secondLayout->addWidget(newTab);
|
|
|
- newTab->show();
|
|
|
- } else {
|
|
|
- QTabWidget *currTab = qobject_cast<QTabWidget *>(secondLayout->itemAt(0)->widget());
|
|
|
- if (newTab == currTab) {
|
|
|
- qDebug() << "same tab";
|
|
|
- } else {
|
|
|
- secondLayout->removeWidget(currTab);
|
|
|
- currTab->hide();
|
|
|
- secondLayout->addWidget(newTab);
|
|
|
- newTab->show();
|
|
|
- }
|
|
|
- }
|
|
|
- ui->stackedWidget->setCurrentIndex(1);
|
|
|
- }
|
|
|
-}
|
|
|
-void MatrixPanelWidget::on_prePageBtn_clicked()
|
|
|
-{
|
|
|
- setPage(currentPage - 1);
|
|
|
-}
|
|
|
-
|
|
|
-void MatrixPanelWidget::on_nextPageBtn_clicked()
|
|
|
-{
|
|
|
- setPage(currentPage + 1);
|
|
|
-}
|
|
|
-
|
|
|
-void MatrixPanelWidget::on_saveBtn_clicked()
|
|
|
-{
|
|
|
- if (currentTab == "技术措施") {
|
|
|
- QList<NodeMatrixInfo *> nodeInfoList;
|
|
|
- MatrixTableTechMeasuresWidget *first =
|
|
|
- qobject_cast<MatrixTableTechMeasuresWidget *>(firstLayout->itemAt(0)->widget());
|
|
|
-
|
|
|
- //保存第一页数据
|
|
|
- for (MatrixDataSource s : first->getSource()) {
|
|
|
- NodeMatrixInfo *t = new NodeMatrixInfo();
|
|
|
- t->abscissa = s.abscissa;
|
|
|
- t->ordinate = s.ordinate;
|
|
|
- t->node = s.node;
|
|
|
- t->nodeValue = s.nodeValue;
|
|
|
- t->expertId = m_professor.id;
|
|
|
- t->expertName = m_professor.name;
|
|
|
- t->engineerId = m_professor.engineer.engineerId;
|
|
|
- t->writeDate = m_professor.createDataTime;
|
|
|
-
|
|
|
- nodeInfoList.append(t);
|
|
|
- }
|
|
|
- DBServiceSet().AddNodeMatrixInfoList(nodeInfoList);
|
|
|
-
|
|
|
- //保存第二页数据,如果有
|
|
|
- QList<NodeMatrixInfo *> secondNodeInfoList;
|
|
|
- for (QTabWidget *tabWidget : tabWidgets) {
|
|
|
- for (int i = 0; i < tabWidget->count(); ++i) {
|
|
|
- MatrixTableTechMeasuresWidget *table =
|
|
|
- dynamic_cast<MatrixTableTechMeasuresWidget *>(tabWidget->widget(i));
|
|
|
- for (MatrixDataSource s : table->getSource()) {
|
|
|
- NodeMatrixInfo *t = new NodeMatrixInfo();
|
|
|
- t->abscissa = s.abscissa;
|
|
|
- t->ordinate = s.ordinate;
|
|
|
- t->node = s.node;
|
|
|
- t->nodeValue = s.nodeValue;
|
|
|
- secondNodeInfoList.append(t);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- DBServiceSet().AddNodeMatrixInfoList(secondNodeInfoList);
|
|
|
- QMessageBox::information(this, tr("成功"), tr("数据保存成功"));
|
|
|
- this->close();
|
|
|
- } else {
|
|
|
- QList<NodeMatrixInfo *> nodeInfoList;
|
|
|
- MatrixTableWidget *first = qobject_cast<MatrixTableWidget *>(firstLayout->itemAt(0)->widget());
|
|
|
- //保存第一页数据
|
|
|
- for (MatrixDataSource s : first->getSource()) {
|
|
|
- NodeMatrixInfo *t = new NodeMatrixInfo();
|
|
|
- t->abscissa = s.abscissa;
|
|
|
- t->ordinate = s.ordinate;
|
|
|
- t->node = s.node;
|
|
|
- t->nodeValue = s.nodeValue;
|
|
|
- nodeInfoList.append(t);
|
|
|
- }
|
|
|
- DBServiceSet().AddNodeMatrixInfoList(nodeInfoList);
|
|
|
-
|
|
|
- //保存第二页数据,如果有
|
|
|
- QList<NodeMatrixInfo *> secondNodeInfoList;
|
|
|
- for (QTabWidget *tabWidget : tabWidgets) {
|
|
|
- for (int i = 0; i < tabWidget->count(); ++i) {
|
|
|
- MatrixTableWidget *table = dynamic_cast<MatrixTableWidget *>(tabWidget->widget(i));
|
|
|
- for (MatrixDataSource s : table->getSource()) {
|
|
|
- NodeMatrixInfo *t = new NodeMatrixInfo();
|
|
|
- t->abscissa = s.abscissa;
|
|
|
- t->ordinate = s.ordinate;
|
|
|
- t->node = s.node;
|
|
|
- t->nodeValue = s.nodeValue;
|
|
|
- t->expertId = m_professor.name;
|
|
|
- t->expertName = m_professor.name;
|
|
|
- t->engineerId = m_professor.engineer.engineerId;
|
|
|
- t->writeDate = m_professor.createDataTime;
|
|
|
- secondNodeInfoList.append(t);
|
|
|
- }
|
|
|
- }
|
|
|
- DBServiceSet().AddNodeMatrixInfoList(secondNodeInfoList);
|
|
|
- QMessageBox::information(this, tr("成功"), tr("数据保存成功"));
|
|
|
- this->close();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- void MatrixPanelWidget::oneTableDataReady(bool status)
|
|
|
- {
|
|
|
- if (status) {
|
|
|
- bool filled = true;
|
|
|
- MatrixTableWidget *first = qobject_cast<MatrixTableWidget *>(firstLayout->itemAt(0)->widget());
|
|
|
- if (!first->isDataReady()) { filled = false; }
|
|
|
- for (QTabWidget *tab : tabWidgets) {
|
|
|
- for (int t = 0; t < tab->count(); ++t) {
|
|
|
- MatrixTableWidget *table = qobject_cast<MatrixTableWidget *>(tab->widget(t));
|
|
|
- if (!table->isDataReady()) { filled = false; }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (filled) {
|
|
|
- ui->saveBtn->setDisabled(false);
|
|
|
- } else {
|
|
|
- ui->saveBtn->setDisabled(true);
|
|
|
- }
|
|
|
- } else {
|
|
|
- ui->saveBtn->setDisabled(true);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- void MatrixPanelWidget::oneTechMeasureTableDataReady(bool status)
|
|
|
- {
|
|
|
- qDebug() << "status = " << status;
|
|
|
- if (status) {
|
|
|
- bool filled = true;
|
|
|
- MatrixTableTechMeasuresWidget *first =
|
|
|
- qobject_cast<MatrixTableTechMeasuresWidget *>(firstLayout->itemAt(0)->widget());
|
|
|
- if (!first->isDataReady()) { filled = false; }
|
|
|
- qDebug() << "filled1 = " << filled;
|
|
|
- qDebug() << "tabWidgets = " << tabWidgets.size();
|
|
|
- for (QTabWidget *tab : tabWidgets) {
|
|
|
- for (int t = 0; t < tab->count(); ++t) {
|
|
|
- MatrixTableTechMeasuresWidget *table =
|
|
|
- qobject_cast<MatrixTableTechMeasuresWidget *>(tab->widget(t));
|
|
|
- qDebug() << "table = " << table->isDataReady();
|
|
|
- if (!table->isDataReady()) { filled = false; }
|
|
|
- }
|
|
|
- }
|
|
|
- qDebug() << "filled2 = " << filled;
|
|
|
- if (filled) {
|
|
|
- ui->saveBtn->setDisabled(false);
|
|
|
- } else {
|
|
|
- ui->saveBtn->setDisabled(true);
|
|
|
- }
|
|
|
- } else {
|
|
|
- ui->saveBtn->setDisabled(true);
|
|
|
- }
|
|
|
- }
|