فهرست منبع

灰色聚类数据采集页面布局和量纲

chengxr 1 سال پیش
والد
کامیت
bbcf29fb2d

+ 4 - 0
QFD/widgets/DataTableWidget.cpp

@@ -64,6 +64,7 @@ void DataTableWidget::initWidget()
 void DataTableWidget::initLayout()
 {
     m_layout = new QVBoxLayout(this);
+    m_layout->setMargin(0);
     m_layout->addWidget(m_dataTab);
     m_pageLayout = new QHBoxLayout();
     m_layout->addLayout(m_pageLayout);
@@ -657,6 +658,9 @@ void DataTableWidget::itemChanged(QStandardItem *item)
             info.ordinate          = vHeader->text();
         }
 
+        qDebug() << __FUNCTION__ << __LINE__ << info.tableMsg << info.strUuid << info.abscissa << info.ordinate
+                 << info.nodeValue << endl;
+
         bool ret = NodeMatrixService().UpdateMeasureData(info);
         if (ret) {
             emit sigMeasureDataEdited(&info);

+ 8 - 0
QFD/widgets/EvalReportWidget.cpp

@@ -547,6 +547,14 @@ void EvalReportWidget::showEffiResult()
             model->setVerticalHeaderItem(j + 1, vHeader);
         }
 
+        for (int r = 0; r < model->rowCount(); ++r) {
+            for (int c = 0; c < model->columnCount(); ++c) {
+                QStandardItem *item = new QStandardItem();
+                item->setEditable(false);
+                model->setItem(r, c, item);
+            }
+        }
+
         m_EffiTab->addTab(t, tabList[i]);
     }
 }

+ 10 - 5
QFD/widgets/GreyClusteringConfigWidget.cpp

@@ -126,8 +126,9 @@ void GreyClusteringConfigWidget::initClusteringItems()
 
         if (subNodes.size() == 0) {  // 没有子节点,需要录入值
             GreyClusteringValue *sg = new GreyClusteringValue;
-            sg->units               = "";
-            sg->weiget              = 0;
+
+            sg->units  = n.dimension;
+            sg->weiget = 0;
             for (const auto &gname : m_grayNames) {
                 sg->greyRanges << GreyRange { gname, true, 0, true, 0 };
             }
@@ -145,7 +146,7 @@ void GreyClusteringConfigWidget::initClusteringItems()
             // 因为已有父节点,所以在第2列
             GreyClusteringItem childItem = { sub.name, subRow, 1, 1, 1, nullptr };
             GreyClusteringValue *sg      = new GreyClusteringValue;
-            sg->units                    = "";
+            sg->units                    = sub.dimension;
             sg->weiget                   = 0;
             for (const auto &gname : m_grayNames) {
                 sg->greyRanges << GreyRange { gname, true, 0, true, 0 };
@@ -155,6 +156,7 @@ void GreyClusteringConfigWidget::initClusteringItems()
             sg->oldValue       = 0;
             sg->newValue       = 0;
             childItem.value.reset(sg);
+            qDebug() << __FUNCTION__ << __LINE__ << childItem.indexName << childItem.value->units << endl;
             m_greyClusterings.append(childItem);
             subRow++;
         }
@@ -203,7 +205,9 @@ void GreyClusteringConfigWidget::initClusteringItems()
 
             for (const auto &effInfo : effectIndexInfoList) {
                 if (effInfo->effectIndexName == item.indexName) {
-                    item.value->units          = effInfo->effectIndexUnit;
+                    if (effInfo->effectIndexUnit.length() > 0) {
+                        item.value->units = effInfo->effectIndexUnit;
+                    }
                     item.value->leftExtension  = effInfo->extendLeft.toDouble();
                     item.value->rightExtension = effInfo->extendRight.toDouble();
                     //[0:0],[0:0],[0:0]
@@ -342,7 +346,8 @@ void GreyClusteringConfigWidget::refreshTableView()
         }
 
         if (!item.value.isNull()) {
-            m_model->item(item.row, nodeDepth)->setText(item.value->units);  // 指标
+            m_model->item(item.row, nodeDepth)->setText(item.value->units);  // 量纲
+            m_model->item(item.row, nodeDepth)->setEditable(false);
             for (int r = 0; r < item.value->greyRanges.size(); r++) {
                 m_model->item(item.row, nodeDepth + r + 1)
                         ->setText(QString("%1%2, %3%4")

+ 25 - 1
QFD/widgets/GreyClusteringConfigWidget.ui

@@ -14,10 +14,22 @@
    <string>Form</string>
   </property>
   <layout class="QGridLayout" name="gridLayout_2">
+   <property name="leftMargin">
+    <number>0</number>
+   </property>
+   <property name="topMargin">
+    <number>0</number>
+   </property>
+   <property name="rightMargin">
+    <number>0</number>
+   </property>
+   <property name="bottomMargin">
+    <number>0</number>
+   </property>
    <item row="0" column="1">
     <widget class="QStackedWidget" name="stackedWidget">
      <property name="currentIndex">
-      <number>0</number>
+      <number>1</number>
      </property>
      <widget class="QWidget" name="categoryPage">
       <layout class="QGridLayout" name="gridLayout">
@@ -155,6 +167,18 @@
      </widget>
      <widget class="QWidget" name="configPage">
       <layout class="QGridLayout" name="gridLayout_3">
+       <property name="leftMargin">
+        <number>0</number>
+       </property>
+       <property name="topMargin">
+        <number>0</number>
+       </property>
+       <property name="rightMargin">
+        <number>0</number>
+       </property>
+       <property name="bottomMargin">
+        <number>0</number>
+       </property>
        <item row="1" column="1">
         <widget class="QToolButton" name="editGrayBtn">
          <property name="text">

+ 5 - 3
QFD/widgets/GreyClusteringSampleTable.cpp

@@ -388,7 +388,7 @@ void GreyClusteringSampleTable::initClusteringItems()
 
         if (subNodes.size() == 0) {  // 没有子节点,需要录入值
             GreyClusteringValue *sg = new GreyClusteringValue;
-            sg->units               = "";
+            sg->units               = n.dimension;
             sg->weiget              = 0;
             for (const auto &gname : m_grayNames) {
                 sg->greyRanges << GreyRange { gname, true, 0, true, 0 };
@@ -407,7 +407,7 @@ void GreyClusteringSampleTable::initClusteringItems()
             // 因为已有父节点,所以在第2列
             GreyClusteringItem childItem = { sub.name, subRow, 1, 1, 1, nullptr };
             GreyClusteringValue *sg      = new GreyClusteringValue;
-            sg->units                    = "";
+            sg->units                    = sub.dimension;
             sg->weiget                   = 0;
             for (const auto &gname : m_grayNames) {
                 sg->greyRanges << GreyRange { gname, true, 0, true, 0 };
@@ -441,7 +441,9 @@ void GreyClusteringSampleTable::initClusteringItems()
 
             for (const auto &effInfo : effectIndexInfoList) {
                 if (effInfo->effectIndexName == item.indexName) {
-                    item.value->units          = effInfo->effectIndexUnit;
+                    if (effInfo->effectIndexUnit.length() > 0) {
+                        item.value->units = effInfo->effectIndexUnit;
+                    }
                     item.value->leftExtension  = effInfo->extendLeft.toDouble();
                     item.value->rightExtension = effInfo->extendRight.toDouble();
                     //[0:0],[0:0],[0:0]