diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index 9091063..f00f8a2 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -30,11 +30,11 @@ PropertyWidget::PropertyWidget(const QString &title, QWidget *parent , Qt::Windo connect( m_pVariantManager,SIGNAL(valueChanged(QtProperty *, const QVariant &)), this,SLOT(SlotPropertyChanged(QtProperty *, const QVariant &)) ); - QtColorSchemeComboBoxFactory * colorSchemeComboBoxFactory = new QtColorSchemeComboBoxFactory(); - m_pColorSchemeManager = new QtColorSchemeComboBoxPropertyManager(); - m_pPropertyBrowser->setFactoryForManager(m_pColorSchemeManager, colorSchemeComboBoxFactory); - connect(m_pColorSchemeManager, SIGNAL(valueChanged(QtProperty *, const int &, bool)), this, - SLOT(SlotPropertyChanged(QtProperty *, const int &, bool))); + QtColorSchemeComboBoxFactory * colorSchemeComboBoxFactory = new QtColorSchemeComboBoxFactory(); + m_pColorSchemeManager = new QtColorSchemeComboBoxPropertyManager(); + m_pPropertyBrowser->setFactoryForManager(m_pColorSchemeManager, colorSchemeComboBoxFactory); + connect(m_pColorSchemeManager, SIGNAL(valueChanged(QtProperty *, const int &, bool)), this, + SLOT(SlotPropertyChanged(QtProperty *, const int &, bool))); } PropertyWidget::~PropertyWidget() @@ -72,24 +72,24 @@ void PropertyWidget::InitCurrentViewInfo(bool bAll) m_propertyData.clear(); m_mapGroupItem.clear(); - if (bAll) - { - m_fromTop = NULL; - m_formInfo = NULL; - m_formHead = NULL; - m_tableWidget = NULL; - m_item = NULL; + if (bAll) + { + m_fromTop = NULL; + m_formInfo = NULL; + m_formHead = NULL; + m_tableWidget = NULL; + m_item = NULL; m_tdGujing = NULL; // - m_strUuid = ""; - m_strTrackUuid = ""; - m_strSlfName = ""; - m_strWellName = ""; - m_strTrackName = ""; - m_strLineName = ""; - // - m_strCurrentProperty = ""; - } + m_strUuid = ""; + m_strTrackUuid = ""; + m_strSlfName = ""; + m_strWellName = ""; + m_strTrackName = ""; + m_strLineName = ""; + // + m_strCurrentProperty = ""; + } } //处理通用属性 @@ -472,7 +472,6 @@ void PropertyWidget::changedCorePhysicsProperty(QtProperty *qtProperty, const QV else if("数值" == m_propertyData[qtProperty]) { double temp = variant.toDouble(); -// this->m_formInfo->m_cp_coreValue = temp; this->m_tdCorePhysics->setCpCoreValue(temp); this->m_tdCorePhysics->mPlot->saveToSLFCorePhysics(); } @@ -587,36 +586,36 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant } if (m_strCurrentProperty == Table_Property)//解释结论 - { - bool bDraw = false; - QStringList slist; - slist << "显示名称" << "垂向绘制" << "旋转角度(°)" << "字体" << "颜色" - << "结论占比%" << "显示位置(cm)" << "显示层号" << "层号字体" << "层号旋转"; - for (int i = 0; i < slist.length(); i++) - { - if (slist.at(i) == m_propertyData[pProperty]) - { - bDraw = m_formInfo->setInfoProperty(m_propertyData[pProperty], variant); - break; - } - } + { + bool bDraw = false; + QStringList slist; + slist << "显示名称" << "垂向绘制" << "旋转角度(°)" << "字体" << "颜色" + << "结论占比%" << "显示位置(cm)" << "显示层号" << "层号字体" << "层号旋转"; + for (int i = 0; i < slist.length(); i++) + { + if (slist.at(i) == m_propertyData[pProperty]) + { + bDraw = m_formInfo->setInfoProperty(m_propertyData[pProperty], variant); + break; + } + } - if (!slist.contains(m_propertyData[pProperty])) - bDraw = true; + if (!slist.contains(m_propertyData[pProperty])) + bDraw = true; - if (bDraw) - { - QVariantList listCond; - listCond << m_strUuid; - listCond << m_strSlfName; - listCond << m_strWellName; - listCond << m_strTrackName; - listCond << m_strLineName; - listCond << m_propertyData[pProperty]; - listCond << variant; - emit CallManage::getInstance()->sig_changeDrawProperty(listCond); - } - } + if (bDraw) + { + QVariantList listCond; + listCond << m_strUuid; + listCond << m_strSlfName; + listCond << m_strWellName; + listCond << m_strTrackName; + listCond << m_strLineName; + listCond << m_propertyData[pProperty]; + listCond << variant; + emit CallManage::getInstance()->sig_changeDrawProperty(listCond); + } + } else if(m_strCurrentProperty == Track_Property) { if(m_fromTop == NULL) @@ -652,46 +651,46 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant } return; } - else if (m_strCurrentProperty == Wave_Property) - { - bool bDraw = false; - QStringList slist; - slist << "显示名称" << "显示单位" << "曲线名称" << "曲线单位" << "曲线刻度" - << "类型" << "方式" << "左刻度" << "右刻度" << "幅度刻度" << "最大振幅" << "颜色" << "线宽" - << "绘制波深度" << "绘制波基线" << "奇偶配色" - << "波列基值" << "波形间隔" << "波形高度" << "显示刻度" << "色板" << "变密度颜色级数"; - for (int i = 0; i < slist.length(); i++) - { - if (slist.at(i) == m_propertyData[pProperty]) - { - bDraw = m_formInfo->setInfoProperty(m_propertyData[pProperty], variant); - break; - } - } + else if (m_strCurrentProperty == Wave_Property) + { + bool bDraw = false; + QStringList slist; + slist << "显示名称" << "显示单位" << "曲线名称" << "曲线单位" << "曲线刻度" + << "类型" << "方式" << "左刻度" << "右刻度" << "幅度刻度" << "最大振幅" << "颜色" << "线宽" + << "绘制波深度" << "绘制波基线" << "奇偶配色" + << "波列基值" << "波形间隔" << "波形高度" << "显示刻度" << "色板" << "变密度颜色级数"; + for (int i = 0; i < slist.length(); i++) + { + if (slist.at(i) == m_propertyData[pProperty]) + { + bDraw = m_formInfo->setInfoProperty(m_propertyData[pProperty], variant); + break; + } + } - if(!slist.contains(m_propertyData[pProperty])) - bDraw = true; + if(!slist.contains(m_propertyData[pProperty])) + bDraw = true; - if (bDraw) - { - QVariantList listCond; - listCond << m_strUuid; - listCond << m_strSlfName; - listCond << m_strWellName; - listCond << m_strTrackName; - listCond << m_strLineName; - listCond << m_propertyData[pProperty]; - listCond << variant; - emit CallManage::getInstance()->sig_changeDrawProperty(listCond); - } + if (bDraw) + { + QVariantList listCond; + listCond << m_strUuid; + listCond << m_strSlfName; + listCond << m_strWellName; + listCond << m_strTrackName; + listCond << m_strLineName; + listCond << m_propertyData[pProperty]; + listCond << variant; + emit CallManage::getInstance()->sig_changeDrawProperty(listCond); + } - if ("类型" == m_propertyData[pProperty]) - { - this->InitCurrentViewInfo(false); - initWaveProperty(m_formInfo, variant.toInt()); - } - return; - } + if ("类型" == m_propertyData[pProperty]) + { + this->InitCurrentViewInfo(false); + initWaveProperty(m_formInfo, variant.toInt()); + } + return; + } else if (m_strCurrentProperty == Gujing_Property)//固井结论道 { //先处理通用属性 @@ -874,7 +873,7 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant } } else if (m_strCurrentProperty == LayerItem_Property) - { + { //先处理通用属性 CommonPropertyChanged(pProperty, variant); @@ -942,68 +941,54 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant else if("岩性" == m_propertyData[pProperty]) { QString newResult = variant.value(); - - //只能选择自己的符号,不能选择其他。 - QString strDefaultPath = ::GetLithSymbolDir(); - //符号统一 - strDefaultPath.replace("\\","/"); - newResult.replace("\\","/"); + m_tdLayer->setLith(newResult); // - if(newResult.contains(strDefaultPath)) + QCPRange currentRange = m_tdLayer->getRange(); + m_tdLayer->setRange(currentRange.lower, currentRange.upper); + } + } + else if (m_strCurrentProperty == JieshiItem_Property) + { + if (m_tdJieshi) + { + if ("顶深(m)" == m_propertyData[pProperty]) { - m_tdLayer->setLith(newResult); - // - QCPRange currentRange = m_tdLayer->getRange(); - m_tdLayer->setRange(currentRange.lower, currentRange.upper); + double upper = variant.value(); + m_tdJieshi->setDragRect(2, -upper); } - else { - QMessageBox::information(nullptr,"提示","所选目录不支持"); - return; + else if ("底深(m)" == m_propertyData[pProperty]) + { + double lower = variant.value(); + m_tdJieshi->setDragRect(1, -lower); + } + else + { + QString strProperty = m_propertyData[pProperty]; + if (strProperty == "油气结论") + { + m_tdJieshi->setDragResult(0, variant.toString()); + return; + } + int nidx = strProperty.indexOf("油气结论"); + if (nidx >= 0) + { + int nret = extractNumbers("油气结论(\\d+)", strProperty); + m_tdJieshi->setDragResult(nret, variant.toString()); + return; + } + nidx = strProperty.indexOf("分段点"); + if (nidx >= 0) + { + int nret = extractNumbers("分段点(\\d+)深度", strProperty); + m_tdJieshi->setDragDepth(nret, variant.toDouble()); + + return; + } } } } - else if (m_strCurrentProperty == JieshiItem_Property) - { - if (m_tdJieshi) - { - if ("顶深(m)" == m_propertyData[pProperty]) - { - double upper = variant.value(); - m_tdJieshi->setDragRect(2, -upper); - } - else if ("底深(m)" == m_propertyData[pProperty]) - { - double lower = variant.value(); - m_tdJieshi->setDragRect(1, -lower); - } - else - { - QString strProperty = m_propertyData[pProperty]; - if (strProperty == "油气结论") - { - m_tdJieshi->setDragResult(0, variant.toString()); - return; - } - int nidx = strProperty.indexOf("油气结论"); - if (nidx >= 0) - { - int nret = extractNumbers("油气结论(\\d+)", strProperty); - m_tdJieshi->setDragResult(nret, variant.toString()); - return; - } - nidx = strProperty.indexOf("分段点"); - if (nidx >= 0) - { - int nret = extractNumbers("分段点(\\d+)深度", strProperty); - m_tdJieshi->setDragDepth(nret, variant.toDouble()); - - return; - } - } - } - } else if (m_strCurrentProperty == GujingItem_Property) - { + { //先处理通用属性 CommonPropertyChanged(pProperty, variant); @@ -1036,26 +1021,12 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant if(m_tdGujing) { QString newResult = variant.value(); - - //只能选择自己的符号,不能选择其他。 - QString strDefaultPath = ::GetGujingSymbolDir(); - //符号统一 - strDefaultPath.replace("\\","/"); - newResult.replace("\\","/"); + m_tdGujing->setResult(newResult); // - if(newResult.contains(strDefaultPath)) - { - m_tdGujing->setResult(newResult); - // - QCPRange currentRange = m_tdGujing->getRange(); - m_tdGujing->setRange(currentRange.lower, currentRange.upper); - //保存 - m_tdGujing->mPlot->SaveToSLF_Gujing(); - } - else { - QMessageBox::information(nullptr,"提示","所选目录不支持"); - return; - } + QCPRange currentRange = m_tdGujing->getRange(); + m_tdGujing->setRange(currentRange.lower, currentRange.upper); + //保存 + m_tdGujing->mPlot->SaveToSLF_Gujing(); } } } @@ -1105,26 +1076,12 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant if(m_tdSwallCore) { QString newResult = variant.value(); - - //只能选择自己的符号,不能选择其他。 - QString strDefaultPath = ::GetSymbolDir()+"取心岩性符号"; - //符号统一 - strDefaultPath.replace("\\","/"); - newResult.replace("\\","/"); + m_tdSwallCore->setLith(newResult); // - if(newResult.contains(strDefaultPath)) - { - m_tdSwallCore->setLith(newResult); - // - QCPRange currentRange = m_tdSwallCore->getRange(); - m_tdSwallCore->setRange(currentRange.lower, currentRange.upper); - //保存 - m_tdSwallCore->mPlot->SaveToSLF_SwallCore(); - } - else { - QMessageBox::information(nullptr,"提示","所选目录不支持"); - return; - } + QCPRange currentRange = m_tdSwallCore->getRange(); + m_tdSwallCore->setRange(currentRange.lower, currentRange.upper); + //保存 + m_tdSwallCore->mPlot->SaveToSLF_SwallCore(); } } else if("油气" == m_propertyData[pProperty]) @@ -1133,26 +1090,12 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant if(m_tdSwallCore) { QString newResult = variant.value(); - - //只能选择自己的符号,不能选择其他。 - QString strDefaultPath = ::GetGasSymbolDir(); - //符号统一 - strDefaultPath.replace("\\","/"); - newResult.replace("\\","/"); + m_tdSwallCore->setOil(newResult); // - if(newResult.contains(strDefaultPath)) - { - m_tdSwallCore->setOil(newResult); - // - QCPRange currentRange = m_tdSwallCore->getRange(); - m_tdSwallCore->setRange(currentRange.lower, currentRange.upper); - //保存 - m_tdSwallCore->mPlot->SaveToSLF_SwallCore(); - } - else { - QMessageBox::information(nullptr,"提示","所选目录不支持"); - return; - } + QCPRange currentRange = m_tdSwallCore->getRange(); + m_tdSwallCore->setRange(currentRange.lower, currentRange.upper); + //保存 + m_tdSwallCore->mPlot->SaveToSLF_SwallCore(); } } else if("颜色" == m_propertyData[pProperty]) @@ -1162,37 +1105,24 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant { QString ColorImage = variant.value(); - //只能选择自己的符号,不能选择其他。 - QString strDefaultPath = ::GetColorSymbolDir(); - //符号统一 - strDefaultPath.replace("\\","/"); + QString name = ""; + int CoreColor = 0; ColorImage.replace("\\","/"); + int l=ColorImage.lastIndexOf("/"); + if(l>-1) name=ColorImage.mid(l+1); + + l=name.indexOf("."); + if(l>-1)name=name.left(l); + int ind=m_tdSwallCore->mPlot->colors_SWallCore.indexOf(name); + if(ind<0||ind>=m_tdSwallCore->mPlot->colorinds_SWallCore.size()) CoreColor=0; + else CoreColor=m_tdSwallCore->mPlot->colorinds_SWallCore[ind].toInt(); + + m_tdSwallCore->setTitle(QString::number(CoreColor)); // - if(ColorImage.contains(strDefaultPath)) - { - QString name = ""; - int CoreColor = 0; - ColorImage.replace("\\","/"); - int l=ColorImage.lastIndexOf("/"); - if(l>-1) name=ColorImage.mid(l+1); - - l=name.indexOf("."); - if(l>-1)name=name.left(l); - int ind=m_tdSwallCore->mPlot->colors_SWallCore.indexOf(name); - if(ind<0||ind>=m_tdSwallCore->mPlot->colorinds_SWallCore.size()) CoreColor=0; - else CoreColor=m_tdSwallCore->mPlot->colorinds_SWallCore[ind].toInt(); - - m_tdSwallCore->setTitle(QString::number(CoreColor)); - // - QCPRange currentRange = m_tdSwallCore->getRange(); - m_tdSwallCore->setRange(currentRange.lower, currentRange.upper); - //保存 - m_tdSwallCore->mPlot->SaveToSLF_SwallCore(); - } - else { - QMessageBox::information(nullptr,"提示","所选目录不支持"); - return; - } + QCPRange currentRange = m_tdSwallCore->getRange(); + m_tdSwallCore->setRange(currentRange.lower, currentRange.upper); + //保存 + m_tdSwallCore->mPlot->SaveToSLF_SwallCore(); } } else if("起始位置" == m_propertyData[pProperty]) @@ -1244,26 +1174,12 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant if(m_tdGeoLith) { QString newResult = variant.value(); - - //只能选择自己的符号,不能选择其他。 - QString strDefaultPath = ::GetMudSymbolDir(); - //符号统一 - strDefaultPath.replace("\\","/"); - newResult.replace("\\","/"); + m_tdGeoLith->setLith(newResult, m_tdGeoLith->m_Color); // - if(newResult.contains(strDefaultPath)) - { - m_tdGeoLith->setLith(newResult, m_tdGeoLith->m_Color); - // - QCPRange currentRange = m_tdGeoLith->getRange(); - m_tdGeoLith->setRange(currentRange.lower, currentRange.upper); - //保存 - m_tdGeoLith->mPlot->SaveToSLF_GeoLith(); - } - else { - QMessageBox::information(nullptr,"提示","所选目录不支持"); - return; - } + QCPRange currentRange = m_tdGeoLith->getRange(); + m_tdGeoLith->setRange(currentRange.lower, currentRange.upper); + //保存 + m_tdGeoLith->mPlot->SaveToSLF_GeoLith(); } } else if("油气" == m_propertyData[pProperty]) @@ -1272,26 +1188,12 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant if(m_tdGeoLith) { QString newResult = variant.value(); - - //只能选择自己的符号,不能选择其他。 - QString strDefaultPath = ::GetGasSymbolDir(); - //符号统一 - strDefaultPath.replace("\\","/"); - newResult.replace("\\","/"); + m_tdGeoLith->setOil(newResult); // - if(newResult.contains(strDefaultPath)) - { - m_tdGeoLith->setOil(newResult); - // - QCPRange currentRange = m_tdGeoLith->getRange(); - m_tdGeoLith->setRange(currentRange.lower, currentRange.upper); - //保存 - m_tdGeoLith->mPlot->SaveToSLF_GeoLith(); - } - else { - QMessageBox::information(nullptr,"提示","所选目录不支持"); - return; - } + QCPRange currentRange = m_tdGeoLith->getRange(); + m_tdGeoLith->setRange(currentRange.lower, currentRange.upper); + //保存 + m_tdGeoLith->mPlot->SaveToSLF_GeoLith(); } } else if("颜色" == m_propertyData[pProperty]) @@ -1300,26 +1202,12 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant if(m_tdGeoLith) { QString newResult = variant.value(); - - //只能选择自己的符号,不能选择其他。 - QString strDefaultPath = ::GetColorSymbolDir(); - //符号统一 - strDefaultPath.replace("\\","/"); - newResult.replace("\\","/"); + m_tdGeoLith->setLith(m_tdGeoLith->m_Lith, newResult); // - if(newResult.contains(strDefaultPath)) - { - m_tdGeoLith->setLith(m_tdGeoLith->m_Lith, newResult); - // - QCPRange currentRange = m_tdGeoLith->getRange(); - m_tdGeoLith->setRange(currentRange.lower, currentRange.upper); - //保存 - m_tdGeoLith->mPlot->SaveToSLF_GeoLith(); - } - else { - QMessageBox::information(nullptr,"提示","所选目录不支持"); - return; - } + QCPRange currentRange = m_tdGeoLith->getRange(); + m_tdGeoLith->setRange(currentRange.lower, currentRange.upper); + //保存 + m_tdGeoLith->mPlot->SaveToSLF_GeoLith(); } } else if("含油占比(1~8)" == m_propertyData[pProperty]) @@ -1787,38 +1675,24 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant //-------------------------- QString newResult = variant.value(); - - //只能选择自己的符号,不能选择其他。 - QString strDefaultPath = GetSymbolDir()+"管柱组件"; - //符号统一 - strDefaultPath.replace("\\","/"); - newResult.replace("\\","/"); + m_tdGuan->setResult(newResult); // - if(newResult.contains(strDefaultPath)) - { - m_tdGuan->setResult(newResult); - // - QCPRange currentRange = m_tdGuan->getRange(); - m_tdGuan->setRange(currentRange.lower, currentRange.upper); - //保存 - m_tdGuan->mPlot->SaveToSLF_Tubing(); + QCPRange currentRange = m_tdGuan->getRange(); + m_tdGuan->setRange(currentRange.lower, currentRange.upper); + //保存 + m_tdGuan->mPlot->SaveToSLF_Tubing(); - //--------- - bool bReDrawNew = m_tdGuan->mPlot->checkTubingName(m_tdGuan->m_Result); - if(bReDrawOld || bReDrawNew) - { - //组件改变后,重绘管柱 - m_tdGuan->mPlot->LoadFromSLF_ReDrawTubing(m_tdGuan->mPlot->m_strSlfName, m_tdGuan->mPlot->m_strLineName); - } - } - else { - QMessageBox::information(nullptr,"提示","所选目录不支持"); - return; + //--------- + bool bReDrawNew = m_tdGuan->mPlot->checkTubingName(m_tdGuan->m_Result); + if(bReDrawOld || bReDrawNew) + { + //组件改变后,重绘管柱 + m_tdGuan->mPlot->LoadFromSLF_ReDrawTubing(m_tdGuan->mPlot->m_strSlfName, m_tdGuan->mPlot->m_strLineName); } } } } - else if (m_strCurrentProperty == Depth_Property) // 深度 + else if (m_strCurrentProperty == Depth_Property) // 深度 { //先处理通用属性 CommonPropertyChanged(pProperty, variant); @@ -2295,7 +2169,7 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant m_item->setFont(newFont); } } - + @@ -2304,22 +2178,22 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant void PropertyWidget::SlotPropertyChanged(QtProperty *property, const int &val, bool islinestyle) { - QString str = m_propertyData[property]; - if (m_strCurrentProperty == Wave_Property) - { - m_formInfo->setInfoProperty(str, val); + QString str = m_propertyData[property]; + if (m_strCurrentProperty == Wave_Property) + { + m_formInfo->setInfoProperty(str, val); - QVariantList listCond; - listCond << m_strUuid; - listCond << m_strSlfName; - listCond << m_strWellName; - listCond << m_strTrackName; - listCond << m_strLineName; - listCond << str; - listCond << val; - emit CallManage::getInstance()->sig_changeDrawProperty(listCond); - } - return; + QVariantList listCond; + listCond << m_strUuid; + listCond << m_strSlfName; + listCond << m_strWellName; + listCond << m_strTrackName; + listCond << m_strLineName; + listCond << str; + listCond << val; + emit CallManage::getInstance()->sig_changeDrawProperty(listCond); + } + return; } void PropertyWidget::ChangHeadItemProperty() @@ -2547,14 +2421,14 @@ QtVariantProperty* PropertyWidget::_CreateVariantPropertyItem(QString strGroup, m_propertyData[item] = strPropertyCaption; pGroupItem->addSubProperty(item); - // 字体不展开 - if (QVariant::Font == propertyType || QVariant::Color == propertyType) - { - QList list = m_pPropertyBrowser->items(item); - if (list.size() > 0) - m_pPropertyBrowser->setExpanded(list.at(0), false); - } - return item; + // 字体不展开 + if (QVariant::Font == propertyType || QVariant::Color == propertyType) + { + QList list = m_pPropertyBrowser->items(item); + if (list.size() > 0) + m_pPropertyBrowser->setExpanded(list.at(0), false); + } + return item; } void PropertyWidget::_CreateVariantPropertyItem(QString strGroup, QString strPropertyCaption, QVariant vtPropertyValue, int propertyType, double dMin, double dMax) @@ -2607,33 +2481,33 @@ void PropertyWidget::_CreateEnumPropertyItem(QString strGroup, QString strProper void PropertyWidget::_CreateColorSchemePropertyItem(QString strGroup, QString strPropertyCaption, QVariant vtPropertyValue) { - QtProperty *pGroupItem = NULL; - { - QMap::Iterator it = m_mapGroupItem.find(strGroup); - if (it != m_mapGroupItem.end()) - { - pGroupItem = it.value(); - } - else - { - pGroupItem = m_pVariantManager->addProperty(QtVariantPropertyManager::groupTypeId(), strGroup); - m_mapGroupItem[strGroup] = pGroupItem; - m_pPropertyBrowser->addProperty(pGroupItem); - } - } + QtProperty *pGroupItem = NULL; + { + QMap::Iterator it = m_mapGroupItem.find(strGroup); + if (it != m_mapGroupItem.end()) + { + pGroupItem = it.value(); + } + else + { + pGroupItem = m_pVariantManager->addProperty(QtVariantPropertyManager::groupTypeId(), strGroup); + m_mapGroupItem[strGroup] = pGroupItem; + m_pPropertyBrowser->addProperty(pGroupItem); + } + } - QtProperty *colorSchemeProperty = m_pColorSchemeManager->addProperty(strPropertyCaption); - m_pColorSchemeManager->setLinear(colorSchemeProperty); - if (colorSchemeProperty) - { - m_propertyData[colorSchemeProperty] = strPropertyCaption; - pGroupItem->addSubProperty(colorSchemeProperty); - m_pColorSchemeManager->setValue(colorSchemeProperty, vtPropertyValue.toInt(), false); - //if (pMetaProperty) - //{ - // m_mapProperty[colorSchemeProperty] = pMetaProperty; - //} - } + QtProperty *colorSchemeProperty = m_pColorSchemeManager->addProperty(strPropertyCaption); + m_pColorSchemeManager->setLinear(colorSchemeProperty); + if (colorSchemeProperty) + { + m_propertyData[colorSchemeProperty] = strPropertyCaption; + pGroupItem->addSubProperty(colorSchemeProperty); + m_pColorSchemeManager->setValue(colorSchemeProperty, vtPropertyValue.toInt(), false); + //if (pMetaProperty) + //{ + // m_mapProperty[colorSchemeProperty] = pMetaProperty; + //} + } } void PropertyWidget::initWidgetProperty(QString strUuid, int iScale) @@ -2731,7 +2605,7 @@ void PropertyWidget::initCurveProperty(FormInfo *formInfo, QStringList strListOt //初始化,清空 InitCurrentViewInfo(); m_strUuid = formInfo->m_strUuid; - m_strTrackUuid = formInfo->m_strTrackUuid; + m_strTrackUuid = formInfo->m_strTrackUuid; m_formInfo = formInfo; // @@ -2810,8 +2684,8 @@ void PropertyWidget::initCurveProperty(FormInfo *formInfo, QStringList strListOt _CreateVariantPropertyItem("刻度设置", "左刻度", formInfo->m_vmin, QVariant::Double); _CreateVariantPropertyItem("刻度设置", "右刻度", formInfo->m_vmax, QVariant::Double); _CreateEnumPropertyItem("刻度设置", "刻度类型", listScaleType.indexOf(formInfo->m_strScaleType), listScaleType); - _CreateVariantPropertyItem("刻度设置", "左跨道个数", formInfo->m_nLeftCross, QVariant::Int); - _CreateVariantPropertyItem("刻度设置", "右跨道个数", formInfo->m_nRightCross, QVariant::Int); + _CreateVariantPropertyItem("刻度设置", "左跨道个数", formInfo->m_nLeftCross, QVariant::Int); + _CreateVariantPropertyItem("刻度设置", "右跨道个数", formInfo->m_nRightCross, QVariant::Int); // _CreateVariantPropertyItem("曲线线型", "线宽", formInfo->m_dWidth, QVariant::Double, 1, 20); _CreateVariantPropertyItem("曲线线型", "颜色", formInfo->m_lineColor, QVariant::Color); @@ -2840,8 +2714,8 @@ void PropertyWidget::initCurveProperty(FormInfo *formInfo, QStringList strListOt _CreateVariantPropertyItem("岩性填充", "岩性前景色", formInfo->m_frontColor, QVariant::Color); _CreateVariantPropertyItem("岩性填充", "岩性背景色", formInfo->m_backColor, QVariant::Color); - //当前属性类型 - m_strCurrentProperty = Curve_Property; + //当前属性类型 + m_strCurrentProperty = Curve_Property; } @@ -2907,21 +2781,21 @@ void PropertyWidget::initHeadProperty(FormHead *formHead, QTableWidget *tableWid void PropertyWidget::initTableProperty(FormInfo *formInfo) { - _CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String); + _CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String); - _CreateVariantPropertyItem("名称", "显示名称", formInfo->m_strLineName, QVariant::String); - _CreateVariantPropertyItem("名称", "垂向绘制", formInfo->m_bVerticaDrawing, QVariant::Bool); - _CreateVariantPropertyItem("名称", "旋转角度(°)", formInfo->m_nRotationAngle, QVariant::Int); - _CreateVariantPropertyItem("名称", "字体", formInfo->m_curveNameFont, QVariant::Font); - _CreateVariantPropertyItem("名称", "颜色", formInfo->m_lineColor, QVariant::Color); + _CreateVariantPropertyItem("名称", "显示名称", formInfo->m_strLineName, QVariant::String); + _CreateVariantPropertyItem("名称", "垂向绘制", formInfo->m_bVerticaDrawing, QVariant::Bool); + _CreateVariantPropertyItem("名称", "旋转角度(°)", formInfo->m_nRotationAngle, QVariant::Int); + _CreateVariantPropertyItem("名称", "字体", formInfo->m_curveNameFont, QVariant::Font); + _CreateVariantPropertyItem("名称", "颜色", formInfo->m_lineColor, QVariant::Color); - _CreateVariantPropertyItem("显示", "结论占比%", formInfo->m_nConclusionProportion, QVariant::Int); - _CreateVariantPropertyItem("显示", "显示位置(cm)", formInfo->m_nShowPos, QVariant::Int); - _CreateVariantPropertyItem("显示", "显示层号", formInfo->m_bShowLayerNo, QVariant::Bool); - _CreateVariantPropertyItem("显示", "层号字体", formInfo->m_layerFont, QVariant::Font); - _CreateVariantPropertyItem("显示", "层号旋转", formInfo->m_fLayerRotate, QVariant::Double); + _CreateVariantPropertyItem("显示", "结论占比%", formInfo->m_nConclusionProportion, QVariant::Int); + _CreateVariantPropertyItem("显示", "显示位置(cm)", formInfo->m_nShowPos, QVariant::Int); + _CreateVariantPropertyItem("显示", "显示层号", formInfo->m_bShowLayerNo, QVariant::Bool); + _CreateVariantPropertyItem("显示", "层号字体", formInfo->m_layerFont, QVariant::Font); + _CreateVariantPropertyItem("显示", "层号旋转", formInfo->m_fLayerRotate, QVariant::Double); - m_strCurrentProperty = Table_Property; + m_strCurrentProperty = Table_Property; } void PropertyWidget::initDepthProperty(FormInfo *formInfo) @@ -2965,24 +2839,24 @@ void PropertyWidget::initDepthProperty(FormInfo *formInfo) void PropertyWidget::initProperty(FormInfo *formInfo) { - if (formInfo == NULL) - return; + if (formInfo == NULL) + return; - //初始化,清空 - InitCurrentViewInfo(); + //初始化,清空 + InitCurrentViewInfo(); - m_formInfo = formInfo; + m_formInfo = formInfo; - m_strUuid = formInfo->m_strUuid; - m_strTrackUuid = formInfo->m_strTrackUuid; - // - m_strSlfName = formInfo->m_strSlfName; - m_strWellName = formInfo->m_strWellName; - m_strTrackName = formInfo->m_strTrackName; - m_strLineName = formInfo->m_strLineName; + m_strUuid = formInfo->m_strUuid; + m_strTrackUuid = formInfo->m_strTrackUuid; + // + m_strSlfName = formInfo->m_strSlfName; + m_strWellName = formInfo->m_strWellName; + m_strTrackName = formInfo->m_strTrackName; + m_strLineName = formInfo->m_strLineName; - if (formInfo->m_strType == "tableObject") - { + if (formInfo->m_strType == "tableObject") + { if (m_strLineName == "GUJING1_RESULT" || m_strLineName == "GUJING2_RESULT" || m_strLineName == "GUJING3_RESULT") { //固井结论 @@ -3022,18 +2896,18 @@ void PropertyWidget::initProperty(FormInfo *formInfo) { this->initTableProperty(formInfo); } - } - else if (formInfo->m_strType == "depthObject") - { - this->initDepthProperty(formInfo); - } - else if (formInfo->m_strType == "roseObject") - { - this->initRoseProperty(formInfo); - } - else if (formInfo->m_strType == "waveObject") - { - this->initWaveProperty(formInfo, formInfo->m_nDrawType); + } + else if (formInfo->m_strType == "depthObject") + { + this->initDepthProperty(formInfo); + } + else if (formInfo->m_strType == "roseObject") + { + this->initRoseProperty(formInfo); + } + else if (formInfo->m_strType == "waveObject") + { + this->initWaveProperty(formInfo, formInfo->m_nDrawType); } else if (formInfo->m_strType == "JiegutextObject") { @@ -3045,7 +2919,7 @@ void PropertyWidget::initProperty(FormInfo *formInfo) //沉积相 this->initFacProperty(formInfo); } - else if(formInfo->m_strType=="SantuyibiaoObject") + else if(formInfo->m_strType=="SantuyibiaoObject") { this->initTvdProperty(formInfo); } @@ -3058,152 +2932,152 @@ void PropertyWidget::initProperty(FormInfo *formInfo) void PropertyWidget::initRoseProperty(FormInfo *formInfo) { - // - _CreateVariantPropertyItem("数据", "名称", formInfo->m_strAliasName, QVariant::String); + // + _CreateVariantPropertyItem("数据", "名称", formInfo->m_strAliasName, QVariant::String); - QStringList listType; - listType.append("曲线型数据"); - listType.append("表格型数据"); - _CreateEnumPropertyItem("数据", "数据类型", listType.indexOf("曲线型数据"), listType); - _CreateVariantPropertyItem("数据", "显示单位", "°", QVariant::String); - _CreateVariantPropertyItem("数据", "井文件名称", m_strSlfName, QVariant::String); - _CreateVariantPropertyItem("数据", "方位曲线", "STRDIR", QVariant::String); - _CreateVariantPropertyItem("数据", "倾角曲线", "CALM", QVariant::String); - // - _CreateVariantPropertyItem("玫瑰图", "扇形", 36, QVariant::Int); - _CreateVariantPropertyItem("玫瑰图", "圆半径(cm)", 1, QVariant::Int); - _CreateVariantPropertyItem("玫瑰图", "辐射圈", 9, QVariant::Int); - _CreateVariantPropertyItem("玫瑰图", "方位打印间隔", 3, QVariant::Int); - _CreateVariantPropertyItem("玫瑰图", "圆线颜色", QColor(0,0,0), QVariant::Color); - _CreateVariantPropertyItem("玫瑰图", "圆线宽度", 2, QVariant::Int); - _CreateVariantPropertyItem("玫瑰图", "应力线颜色", QColor(255, 170, 0), QVariant::Color); - _CreateVariantPropertyItem("玫瑰图", "垮塌线颜色", QColor(0, 0, 255), QVariant::Color); - _CreateVariantPropertyItem("玫瑰图", "绘制辐射线?", true, QVariant::Bool); - _CreateVariantPropertyItem("玫瑰图", "绘制井眼垮塌", true, QVariant::Bool); - _CreateVariantPropertyItem("玫瑰图", "是否填充", true, QVariant::Bool); - _CreateVariantPropertyItem("玫瑰图", "是否绘制标注?", true, QVariant::Bool); + QStringList listType; + listType.append("曲线型数据"); + listType.append("表格型数据"); + _CreateEnumPropertyItem("数据", "数据类型", listType.indexOf("曲线型数据"), listType); + _CreateVariantPropertyItem("数据", "显示单位", "°", QVariant::String); + _CreateVariantPropertyItem("数据", "井文件名称", m_strSlfName, QVariant::String); + _CreateVariantPropertyItem("数据", "方位曲线", "STRDIR", QVariant::String); + _CreateVariantPropertyItem("数据", "倾角曲线", "CALM", QVariant::String); + // + _CreateVariantPropertyItem("玫瑰图", "扇形", 36, QVariant::Int); + _CreateVariantPropertyItem("玫瑰图", "圆半径(cm)", 1, QVariant::Int); + _CreateVariantPropertyItem("玫瑰图", "辐射圈", 9, QVariant::Int); + _CreateVariantPropertyItem("玫瑰图", "方位打印间隔", 3, QVariant::Int); + _CreateVariantPropertyItem("玫瑰图", "圆线颜色", QColor(0,0,0), QVariant::Color); + _CreateVariantPropertyItem("玫瑰图", "圆线宽度", 2, QVariant::Int); + _CreateVariantPropertyItem("玫瑰图", "应力线颜色", QColor(255, 170, 0), QVariant::Color); + _CreateVariantPropertyItem("玫瑰图", "垮塌线颜色", QColor(0, 0, 255), QVariant::Color); + _CreateVariantPropertyItem("玫瑰图", "绘制辐射线?", true, QVariant::Bool); + _CreateVariantPropertyItem("玫瑰图", "绘制井眼垮塌", true, QVariant::Bool); + _CreateVariantPropertyItem("玫瑰图", "是否填充", true, QVariant::Bool); + _CreateVariantPropertyItem("玫瑰图", "是否绘制标注?", true, QVariant::Bool); // _CreateVariantPropertyItem("玫瑰图", "道头字体", fromTop->m_font, QVariant::Font); // _CreateVariantPropertyItem("玫瑰图", "道头字颜色", fromTop->m_fontColor, QVariant::Color); } void PropertyWidget::initWaveProperty(FormInfo *formInfo, int nType) { - if (formInfo == NULL) - return; + if (formInfo == NULL) + return; - _CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String); - _CreateVariantPropertyItem("通常", "显示名称", formInfo->m_strLineName, QVariant::String); - //_CreateVariantPropertyItem("通常", "例区高度(cm)", formInfo->m_strUnit, QVariant::Double); - QStringList lineType; - lineType.append("线性"); - lineType.append("对数"); - lineType.append("核磁对数"); - lineType.append("二维核磁"); - lineType.append("色级图"); - lineType.append("时间对数"); - lineType.append("时间指数"); - _CreateEnumPropertyItem("通常", "曲线类型", lineType.indexOf("线性"), lineType); + _CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String); + _CreateVariantPropertyItem("通常", "显示名称", formInfo->m_strLineName, QVariant::String); + //_CreateVariantPropertyItem("通常", "例区高度(cm)", formInfo->m_strUnit, QVariant::Double); + QStringList lineType; + lineType.append("线性"); + lineType.append("对数"); + lineType.append("核磁对数"); + lineType.append("二维核磁"); + lineType.append("色级图"); + lineType.append("时间对数"); + lineType.append("时间指数"); + _CreateEnumPropertyItem("通常", "曲线类型", lineType.indexOf("线性"), lineType); - _CreateVariantPropertyItem("曲线单位", "显示单位", formInfo->m_strUnit, QVariant::String); + _CreateVariantPropertyItem("曲线单位", "显示单位", formInfo->m_strUnit, QVariant::String); - _CreateVariantPropertyItem("字体", "曲线名称", formInfo->m_curveNameFont, QVariant::Font); - _CreateVariantPropertyItem("字体", "曲线单位", formInfo->m_curveUnitFont, QVariant::Font); - _CreateVariantPropertyItem("字体", "曲线刻度", formInfo->m_curveScaleFont, QVariant::Font); + _CreateVariantPropertyItem("字体", "曲线名称", formInfo->m_curveNameFont, QVariant::Font); + _CreateVariantPropertyItem("字体", "曲线单位", formInfo->m_curveUnitFont, QVariant::Font); + _CreateVariantPropertyItem("字体", "曲线刻度", formInfo->m_curveScaleFont, QVariant::Font); - QStringList drawType; - drawType.append("波形"); - drawType.append("填充"); - drawType.append("变密度(成像)"); - drawType.append("全阵列"); - drawType.append("奇数阵列"); - drawType.append("偶数阵列"); - drawType.append("变密度(镜像)"); - drawType.append("自选阵列"); - drawType.append("三维图像"); - drawType.append("多臂井径"); - _CreateEnumPropertyItem("绘图类型", "类型", formInfo->m_nDrawType, drawType); + QStringList drawType; + drawType.append("波形"); + drawType.append("填充"); + drawType.append("变密度(成像)"); + drawType.append("全阵列"); + drawType.append("奇数阵列"); + drawType.append("偶数阵列"); + drawType.append("变密度(镜像)"); + drawType.append("自选阵列"); + drawType.append("三维图像"); + drawType.append("多臂井径"); + _CreateEnumPropertyItem("绘图类型", "类型", formInfo->m_nDrawType, drawType); - if (nType == 2) - { - QStringList fillType; - fillType.append("全周"); - fillType.append("正半周"); - fillType.append("负半周"); - _CreateEnumPropertyItem("填充方式", "方式", formInfo->m_nFillType, fillType); - } + if (nType == 2) + { + QStringList fillType; + fillType.append("全周"); + fillType.append("正半周"); + fillType.append("负半周"); + _CreateEnumPropertyItem("填充方式", "方式", formInfo->m_nFillType, fillType); + } - if (nType == 0 || nType == 1) - { - _CreateVariantPropertyItem("波形绘制参数", "绘制波深度", formInfo->m_bDrawDepth, QVariant::Bool); - _CreateVariantPropertyItem("波形绘制参数", "绘制波基线", formInfo->m_bDrawBase, QVariant::Bool); - _CreateVariantPropertyItem("波形绘制参数", "奇偶配色", formInfo->m_bOddEven, QVariant::Bool); - } - //_CreateVariantPropertyItem("波形绘制参数", "自动平滑", true, QVariant::Bool); - _CreateVariantPropertyItem("波形绘制参数", "左刻度", formInfo->m_vmin, QVariant::Double); - _CreateVariantPropertyItem("波形绘制参数", "右刻度", formInfo->m_vmax, QVariant::Double); - _CreateVariantPropertyItem("波形绘制参数", "幅度刻度", formInfo->m_strAmp, QVariant::String); - _CreateVariantPropertyItem("波形绘制参数", "最大振幅", formInfo->m_fMaxAmp, QVariant::Double); - _CreateVariantPropertyItem("波形绘制参数", "显示刻度", formInfo->m_bShowScale, QVariant::Bool); - _CreateVariantPropertyItem("波形绘制参数", "波列基值", formInfo->m_fWaveBase, QVariant::Double); - _CreateVariantPropertyItem("波形绘制参数", "波形间隔", formInfo->m_nWaveJg, QVariant::Int); - _CreateVariantPropertyItem("波形绘制参数", "波形高度", formInfo->m_fWaveHei, QVariant::Double); - if (nType == 0 || nType == 1) - { - _CreateVariantPropertyItem("波形绘制参数", "线宽", formInfo->m_dWidth, QVariant::Int); - _CreateVariantPropertyItem("波形绘制参数", "颜色", formInfo->m_lineColor, QVariant::Color); - } - //_CreateVariantPropertyItem("成像显示", "RGBA数据", false, QVariant::Bool); - //_CreateVariantPropertyItem("成像显示", "绘制阵列数", 1, QVariant::Int); - //_CreateVariantPropertyItem("成像显示", "是否顶底倒置", false, QVariant::Bool); - //_CreateVariantPropertyItem("成像显示", "是否行列互换", false, QVariant::Bool); - //_CreateVariantPropertyItem("成像显示", "无效值跳过", false, QVariant::Bool); - //_CreateVariantPropertyItem("成像显示", "是否方位校正", false, QVariant::Bool); - //_CreateVariantPropertyItem("成像显示", "是否深度校正", false, QVariant::Bool); - //_CreateVariantPropertyItem("成像显示", "是否自动计算波参数", "", QVariant::String); + if (nType == 0 || nType == 1) + { + _CreateVariantPropertyItem("波形绘制参数", "绘制波深度", formInfo->m_bDrawDepth, QVariant::Bool); + _CreateVariantPropertyItem("波形绘制参数", "绘制波基线", formInfo->m_bDrawBase, QVariant::Bool); + _CreateVariantPropertyItem("波形绘制参数", "奇偶配色", formInfo->m_bOddEven, QVariant::Bool); + } + //_CreateVariantPropertyItem("波形绘制参数", "自动平滑", true, QVariant::Bool); + _CreateVariantPropertyItem("波形绘制参数", "左刻度", formInfo->m_vmin, QVariant::Double); + _CreateVariantPropertyItem("波形绘制参数", "右刻度", formInfo->m_vmax, QVariant::Double); + _CreateVariantPropertyItem("波形绘制参数", "幅度刻度", formInfo->m_strAmp, QVariant::String); + _CreateVariantPropertyItem("波形绘制参数", "最大振幅", formInfo->m_fMaxAmp, QVariant::Double); + _CreateVariantPropertyItem("波形绘制参数", "显示刻度", formInfo->m_bShowScale, QVariant::Bool); + _CreateVariantPropertyItem("波形绘制参数", "波列基值", formInfo->m_fWaveBase, QVariant::Double); + _CreateVariantPropertyItem("波形绘制参数", "波形间隔", formInfo->m_nWaveJg, QVariant::Int); + _CreateVariantPropertyItem("波形绘制参数", "波形高度", formInfo->m_fWaveHei, QVariant::Double); + if (nType == 0 || nType == 1) + { + _CreateVariantPropertyItem("波形绘制参数", "线宽", formInfo->m_dWidth, QVariant::Int); + _CreateVariantPropertyItem("波形绘制参数", "颜色", formInfo->m_lineColor, QVariant::Color); + } + //_CreateVariantPropertyItem("成像显示", "RGBA数据", false, QVariant::Bool); + //_CreateVariantPropertyItem("成像显示", "绘制阵列数", 1, QVariant::Int); + //_CreateVariantPropertyItem("成像显示", "是否顶底倒置", false, QVariant::Bool); + //_CreateVariantPropertyItem("成像显示", "是否行列互换", false, QVariant::Bool); + //_CreateVariantPropertyItem("成像显示", "无效值跳过", false, QVariant::Bool); + //_CreateVariantPropertyItem("成像显示", "是否方位校正", false, QVariant::Bool); + //_CreateVariantPropertyItem("成像显示", "是否深度校正", false, QVariant::Bool); + //_CreateVariantPropertyItem("成像显示", "是否自动计算波参数", "", QVariant::String); - if (nType == 2) - { - _CreateColorSchemePropertyItem("调色板参数设置", "色板", formInfo->m_nSchemeIndex); - _CreateVariantPropertyItem("调色板参数设置", "变密度颜色级数", formInfo->m_nColorNum, QVariant::Int); - } + if (nType == 2) + { + _CreateColorSchemePropertyItem("调色板参数设置", "色板", formInfo->m_nSchemeIndex); + _CreateVariantPropertyItem("调色板参数设置", "变密度颜色级数", formInfo->m_nColorNum, QVariant::Int); + } // _CreateVariantPropertyItem("调色板参数设置", "图例置顶", false, QVariant::Bool); // _CreateVariantPropertyItem("调色板参数设置", "反转显示", false, QVariant::Bool); - - m_strCurrentProperty = Wave_Property; + + m_strCurrentProperty = Wave_Property; } void PropertyWidget::initJieshiItemProperty(TransparentGroupResult* tdJieshi, double lower, double upper, QString strResult) { - //初始化,清空 - InitCurrentViewInfo(); + //初始化,清空 + InitCurrentViewInfo(); - m_tdJieshi = tdJieshi; + m_tdJieshi = tdJieshi; - // - _CreateVariantPropertyItem("当前项", "顶深(m)", -upper, QVariant::Double); - _CreateVariantPropertyItem("当前项", "底深(m)", -lower, QVariant::Double); - _CreateVariantPropertyItem("当前项", "解释层号", tdJieshi->getTitle(), QVariant::String); - QtVariantProperty* pItem = _CreateVariantPropertyItem("当前项", "油气结论", tdJieshi->getOilGasConclusion(0), VariantManager::filePathTypeId()); - m_pVariantManager->setAttribute(pItem, "filepath", GetOilSymbolDir()); - m_pVariantManager->setAttribute(pItem, "filter", "图片(*.png *.svg)"); + // + _CreateVariantPropertyItem("当前项", "顶深(m)", -upper, QVariant::Double); + _CreateVariantPropertyItem("当前项", "底深(m)", -lower, QVariant::Double); + _CreateVariantPropertyItem("当前项", "解释层号", tdJieshi->getTitle(), QVariant::String); + QtVariantProperty* pItem = _CreateVariantPropertyItem("当前项", "油气结论", tdJieshi->getOilGasConclusion(0), VariantManager::filePathTypeId()); + m_pVariantManager->setAttribute(pItem, "filepath", GetOilSymbolDir()); + m_pVariantManager->setAttribute(pItem, "filter", "图片(*.png *.svg)"); - _CreateVariantPropertyItem("当前项", "备注", tdJieshi->getRemark(), QVariant::String); - for (int i = 1; i <= 10; i++) - { - QString s = tdJieshi->getOilGasConclusion(i); - QtVariantProperty* pItem = _CreateVariantPropertyItem("当前项", QString("油气结论%1").arg(i), s, VariantManager::filePathTypeId()); - //pItem->setAttribute("FilePath", "123542"); - m_pVariantManager->setAttribute(pItem, "filepath", GetOilSymbolDir()); - m_pVariantManager->setAttribute(pItem, "filter", "图片(*.png *.svg)"); - } - for (int i = 1; i <= 10; i++) - { - QString s = tdJieshi->getOilGasDepth(i); - _CreateVariantPropertyItem("当前项", QString("分段点%1深度").arg(i), s, QVariant::Double); - } - //当前属性类型 - m_strCurrentProperty = JieshiItem_Property; + _CreateVariantPropertyItem("当前项", "备注", tdJieshi->getRemark(), QVariant::String); + for (int i = 1; i <= 10; i++) + { + QString s = tdJieshi->getOilGasConclusion(i); + QtVariantProperty* pItem = _CreateVariantPropertyItem("当前项", QString("油气结论%1").arg(i), s, VariantManager::filePathTypeId()); + //pItem->setAttribute("FilePath", "123542"); + m_pVariantManager->setAttribute(pItem, "filepath", GetOilSymbolDir()); + m_pVariantManager->setAttribute(pItem, "filter", "图片(*.png *.svg)"); + } + for (int i = 1; i <= 10; i++) + { + QString s = tdJieshi->getOilGasDepth(i); + _CreateVariantPropertyItem("当前项", QString("分段点%1深度").arg(i), s, QVariant::Double); + } + //当前属性类型 + m_strCurrentProperty = JieshiItem_Property; } void PropertyWidget::initSwallCoreProperty(FormInfo *formInfo) @@ -3251,51 +3125,9 @@ void PropertyWidget::initSwallCoreItemProperty(TransparentDraggableSwallCore* td // _CreateVariantPropertyItem("当前项", "深度", -Depth, QVariant::Double); - - //只能选择自己的符号,不能选择其他。 - QString strDefaultPath = ::GetSymbolDir()+"取心岩性符号"; - //符号统一 - strDefaultPath.replace("\\","/"); - LithologyImage.replace("\\","/"); - // - if(LithologyImage.contains(strDefaultPath)) - { - _CreateVariantPropertyItem("当前项", "岩性", LithologyImage, VariantManager::filePathTypeId()); - } - else{ - _CreateVariantPropertyItem("当前项", "岩性", strDefaultPath, VariantManager::filePathTypeId()); - } - - //只能选择自己的符号,不能选择其他。 - strDefaultPath = ::GetGasSymbolDir(); - //符号统一 - strDefaultPath.replace("\\","/"); - OilGasImage.replace("\\","/"); - // - if(OilGasImage.contains(strDefaultPath)) - { - _CreateVariantPropertyItem("当前项", "油气", OilGasImage, VariantManager::filePathTypeId()); - } - else - { - _CreateVariantPropertyItem("当前项", "油气", strDefaultPath, VariantManager::filePathTypeId()); - } - - //只能选择自己的符号,不能选择其他。 - strDefaultPath = ::GetColorSymbolDir(); - //符号统一 - strDefaultPath.replace("\\","/"); - ColorImage.replace("\\","/"); - // - if(ColorImage.contains(strDefaultPath)) - { - _CreateVariantPropertyItem("当前项", "颜色", ColorImage, VariantManager::filePathTypeId()); - } - else - { - _CreateVariantPropertyItem("当前项", "颜色", strDefaultPath, VariantManager::filePathTypeId()); - } - + _CreateVariantPropertyItem("当前项", "岩性", LithologyImage, VariantManager::filePathTypeId()); + _CreateVariantPropertyItem("当前项", "油气", OilGasImage, VariantManager::filePathTypeId()); + _CreateVariantPropertyItem("当前项", "颜色", ColorImage, VariantManager::filePathTypeId()); _CreateVariantPropertyItem("当前项", "起始位置", Sideleft, QVariant::Double); //_CreateVariantPropertyItem("当前项", "宽度", -Depth, QVariant::Double); } @@ -3404,7 +3236,7 @@ void PropertyWidget::initLayerItemProperty(TransparentDraggableLayer* tdLayer, d // _CreateVariantPropertyItem("当前项", "顶深(m)", -upper, QVariant::Double); _CreateVariantPropertyItem("当前项", "底深(m)", -lower, QVariant::Double); - _CreateVariantPropertyItem("当前项", "文字结论", strResult, QVariant::String); + _CreateVariantPropertyItem("当前项", "文字结论", strResult, QVariant::String); QFont myFont = tdLayer->wordfont; //("Arial", 12, QFont::Bold); // 名称字体 QColor myColor = tdLayer->fontColor; //Qt::black; //颜色 @@ -3462,21 +3294,7 @@ void PropertyWidget::initGujingItemProperty(TransparentDraggableGujing* tdGujing // _CreateVariantPropertyItem("当前项", "顶深(m)", -upper, QVariant::Double); _CreateVariantPropertyItem("当前项", "底深(m)", -lower, QVariant::Double); - - //只能选择自己的符号,不能选择其他。 - QString strDefaultPath = ::GetGujingSymbolDir(); - //符号统一 - strDefaultPath.replace("\\","/"); - strResult.replace("\\","/"); - // - if(strResult.contains(strDefaultPath)) - { - _CreateVariantPropertyItem("当前项", "固井结论", strResult, VariantManager::filePathTypeId()); - } - else - { - _CreateVariantPropertyItem("当前项", "固井结论", strDefaultPath, VariantManager::filePathTypeId()); - } + _CreateVariantPropertyItem("当前项", "固井结论", strResult, VariantManager::filePathTypeId()); } void PropertyWidget::initImageProperty(FormInfo *formInfo) @@ -3794,7 +3612,7 @@ void PropertyWidget::initTvdProperty(FormInfo *formInfo) m_strCurrentProperty = Tvd_Property; } -void PropertyWidget::initGeoLithItemProperty(TransparentDraggableGeoLith* tdGeoLith, double lower, double upper, QString myLith, QString myOil, QString myColor) +void PropertyWidget::initGeoLithItemProperty(TransparentDraggableGeoLith* tdGeoLith, double lower, double upper, const QString myLith, const QString myOil, const QString myColor) { //初始化,清空 InitCurrentViewInfo(); @@ -3836,54 +3654,9 @@ void PropertyWidget::initGeoLithItemProperty(TransparentDraggableGeoLith* tdGeoL // _CreateVariantPropertyItem("当前项", "顶深(m)", -upper, QVariant::Double); _CreateVariantPropertyItem("当前项", "底深(m)", -lower, QVariant::Double); - - //只能选择自己的符号,不能选择其他。 - QString strDefaultPath = ::GetMudSymbolDir(); - //符号统一 - strDefaultPath.replace("\\","/"); - myLith.replace("\\","/"); - // - if(myLith.contains(strDefaultPath)) - { - _CreateVariantPropertyItem("当前项", "岩性", myLith, VariantManager::filePathTypeId()); - } - else{ - _CreateVariantPropertyItem("当前项", "岩性", strDefaultPath, VariantManager::filePathTypeId()); - } - - //只能选择自己的符号,不能选择其他。 - strDefaultPath = ::GetGasSymbolDir(); - //符号统一 - strDefaultPath.replace("\\","/"); - myOil.replace("\\","/"); - // - if(myOil.contains(strDefaultPath)) - { - _CreateVariantPropertyItem("当前项", "油气", myOil, VariantManager::filePathTypeId()); - } - else - { - _CreateVariantPropertyItem("当前项", "油气", strDefaultPath, VariantManager::filePathTypeId()); - } - - //只能选择自己的符号,不能选择其他。 - strDefaultPath = ::GetColorSymbolDir(); - //符号统一 - strDefaultPath.replace("\\","/"); - myColor.replace("\\","/"); - // - if(myColor.contains(strDefaultPath)) - { - _CreateVariantPropertyItem("当前项", "颜色", myColor, VariantManager::filePathTypeId()); - } - else - { - _CreateVariantPropertyItem("当前项", "颜色", strDefaultPath, VariantManager::filePathTypeId()); - } - -// _CreateVariantPropertyItem("当前项", "岩性", myLith, VariantManager::filePathTypeId()); -// _CreateVariantPropertyItem("当前项", "油气", myOil, VariantManager::filePathTypeId()); -// _CreateVariantPropertyItem("当前项", "颜色", myColor, VariantManager::filePathTypeId()); + _CreateVariantPropertyItem("当前项", "岩性", myLith, VariantManager::filePathTypeId()); + _CreateVariantPropertyItem("当前项", "油气", myOil, VariantManager::filePathTypeId()); + _CreateVariantPropertyItem("当前项", "颜色", myColor, VariantManager::filePathTypeId()); } //气测/FMT/射孔/文本 @@ -4042,20 +3815,7 @@ void PropertyWidget::initTubingItemProperty(TransparentDraggableGuan* tdGuan, do // _CreateVariantPropertyItem("当前项", "深度(m)", -(upper+lower)/2.0, QVariant::Double); - - //只能选择自己的符号,不能选择其他。 - QString strDefaultPath = GetSymbolDir()+"管柱组件"; - //符号统一 - strDefaultPath.replace("\\","/"); - strResult.replace("\\","/"); - // - if(strResult.contains(strDefaultPath)) - { - _CreateVariantPropertyItem("当前项", "组件类型", strResult, VariantManager::filePathTypeId()); - } - else { - _CreateVariantPropertyItem("当前项", "组件类型", strDefaultPath, VariantManager::filePathTypeId()); - } + _CreateVariantPropertyItem("当前项", "组件类型", strResult, VariantManager::filePathTypeId()); } void PropertyWidget::changedDepthProperty(QString strProperty, QVariant varVal) diff --git a/logPlus/TransparentDraggableCorePhysics.cpp b/logPlus/TransparentDraggableCorePhysics.cpp index 28165a7..0423273 100644 --- a/logPlus/TransparentDraggableCorePhysics.cpp +++ b/logPlus/TransparentDraggableCorePhysics.cpp @@ -130,6 +130,8 @@ void TransparentDraggableCorePhysics::update() void TransparentDraggableCorePhysics::initRect() { + + // 连接鼠标事件 connect(mPlot, &QCustomPlot::mousePress, this, &TransparentDraggableCorePhysics::onMousePress); connect(mPlot, &QCustomPlot::mouseMove, this, &TransparentDraggableCorePhysics::onMouseMove); @@ -197,17 +199,13 @@ void TransparentDraggableCorePhysics::onMousePress(QMouseEvent *event) { //之前的选中线段,恢复黑色 TransparentDraggableCorePhysics *tmpLine = (TransparentDraggableCorePhysics*)mPlot->m_SelectShiftLine; - QPen pen = tmpLine->qcpItemLine->pen(); -// pen.setWidth(getCpLineWidth()); - pen.setColor(this->getCpLineColor()); // 线宽 + QPen pen = tmpLine->qcpItemLine->pen(); // 现在这里绝对安全 + pen.setColor(this->getCpLineColor()); tmpLine->qcpItemLine->setPen(pen); -// tmpLine->qcpItemLine->setPen(QPen(Qt::black)); } - //重新设置选中线段 mPlot->m_SelectShiftLine = this; QPen pen = qcpItemLine->pen(); -// pen.setWidth(getCpLineWidth()); pen.setColor(Qt::red); qcpItemLine->setPen(pen); @@ -544,17 +542,28 @@ bool TransparentDraggableCorePhysics::getCpLeftBoundary() const void TransparentDraggableCorePhysics::setCpLeftBoundary(bool value) { this->m_cp_leftBoundary = value; - // 由于 X轴↔Y轴 互换,"水平翻转"变成关于 Y轴中心对称 - double y_center = (this->mPlot->yAxis->range().lower + this->mPlot->yAxis->range().upper) / 2; - // 获取原坐标(注意:此时 coords() 返回的是互换后的坐标) - QPointF start = this->qcpItemLine->start->coords(); - QPointF end = this->qcpItemLine->end->coords(); - - // 翻转:Y轴不变(实际是视觉上的X轴),X轴镜像(实际是视觉上的Y轴) - // 但由于轴互换了,我们需要翻转的是 y 坐标 - this->qcpItemLine->start->setCoords(start.x(), 2 * y_center - start.y()); - this->qcpItemLine->end->setCoords(end.x(), 2 * y_center - end.y()); + double y_min = mPlot->yAxis->range().lower; + double y_max = mPlot->yAxis->range().upper; + double y_center = (y_min + y_max) / 2; + QPointF start = qcpItemLine->start->coords(); + QPointF end = qcpItemLine->end->coords(); + double targetYStart, targetYEnd; + if (value) { + // ====================================== + // ✅ TRUE = 强制回到左边(固定公式) + // ====================================== + targetYStart = y_min + (y_max - start.y()); + targetYEnd = y_min + (y_max - end.y()); + } else { + // ====================================== + // ✅ FALSE = 强制去到右边(固定公式) + // ====================================== + targetYStart = 2 * y_center - start.y(); + targetYEnd = 2 * y_center - end.y(); + } + qcpItemLine->start->setCoords(start.x(), targetYStart); + qcpItemLine->end->setCoords(end.x(), targetYEnd); } bool TransparentDraggableCorePhysics::getCpSkipZeroInvalidValues() const @@ -680,12 +689,12 @@ void TransparentDraggableCorePhysics::setCpSymbolFillColor(QColor value) } } -int TransparentDraggableCorePhysics::getCpFieldName() const -{ - return this->m_cp_fieldName; -} +//int TransparentDraggableCorePhysics::getCpFieldName() const +//{ +// return this->m_cp_fieldName; +//} -void TransparentDraggableCorePhysics::setCpFieldName(const int &value) -{ - this->m_cp_fieldName = value; -} +//void TransparentDraggableCorePhysics::setCpFieldName(const int &value) +//{ +// this->m_cp_fieldName = value; +//} diff --git a/logPlus/TransparentDraggableCorePhysics.h b/logPlus/TransparentDraggableCorePhysics.h index 4adf41a..1073482 100644 --- a/logPlus/TransparentDraggableCorePhysics.h +++ b/logPlus/TransparentDraggableCorePhysics.h @@ -114,8 +114,8 @@ public: QColor getCpSymbolFillColor() const; void setCpSymbolFillColor(QColor value); - int getCpFieldName() const; - void setCpFieldName(const int &value); +// int getCpFieldName() const; +// void setCpFieldName(const int &value); signals: void rangeChanged(QCPRange newRange); @@ -143,7 +143,7 @@ private: QColor m_cp_symbolBorderColor; // 边框颜色 int m_cp_symbolSize; // 大小 QColor m_cp_symbolFillColor; // 填充颜色 - int m_cp_fieldName; // 字段名称 +// int m_cp_fieldName; // 字段名称 // 这四个是slf文件保存读取的 int m_cp_order; // 序号 double m_cp_depth; // 深度 @@ -179,7 +179,6 @@ public: double m_lY1 = 0; // 添加最小宽度成员变量 double mMinWidth; - }; #endif // TRANSPARENTDRAGGABLECOREPHYSICS_H diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index 8d648e2..e7b98d7 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -1937,6 +1937,7 @@ void QMyCustomPlot::deleteItemsImage() //保存 SaveToSLFImage(); + m_mapDraggable_Image.clear(); //属性清空 PropertyService()->InitCurrentViewInfo(); } @@ -2006,10 +2007,12 @@ void QMyCustomPlot::deleteCorePhysics() it++; pDraggableRect->deleteRect(); } + m_SelectShiftLine = nullptr; this->replot(); //保存 saveToSLFCorePhysics(); + m_mapDraggable_CorePhysics.clear(); //属性清空 PropertyService()->InitCurrentViewInfo(); } @@ -5122,9 +5125,9 @@ void QMyCustomPlot::s_changeCorePhysicsProperty(QVariantMap variantMap) // 左界 if(variantMap["leftBoundary"].isValid()) { - tdCorePhysics->setCpLeftBoundary(variantMap["leftBoundary"].toBool()); + bool aa = variantMap["leftBoundary"].toBool(); + tdCorePhysics->setCpLeftBoundary(aa); } - // 不绘零等无效值 if(variantMap["skipZeroInvalidValues"].isValid()) { @@ -5171,7 +5174,6 @@ void QMyCustomPlot::s_changeCorePhysicsProperty(QVariantMap variantMap) { tdCorePhysics->setCpRightScale(variantMap["rightScale"].toDouble()); } - // 刻度类型 if(variantMap["scaleType"].isValid()) {