diff --git a/CallManage/CallManage.h b/CallManage/CallManage.h index d3e0a7d..b6dbc51 100644 --- a/CallManage/CallManage.h +++ b/CallManage/CallManage.h @@ -39,7 +39,7 @@ signals: void sig_CloseProject();//关闭项目 void sig_ShowParameterCard(QString strSlfName, QString strName);//参数表查看 - void sig_ShowCurve(QString strSlfName, QString strName);//曲线数据查看 + void sig_ShowCurve(QMap> mapShowObject);//曲线数据查看 void sig_DepthShift(QString strSlfName, QString strName, double DepthOffset);//深度移动 void sig_ShowTable(QString strSlfName, QString strName);//表格数据查看 void sig_ShowWave(QString strSlfName, QString strName);//波列数据查看 diff --git a/DataMgr/src/DataManagger.cpp b/DataMgr/src/DataManagger.cpp index da75e5a..c6be05b 100644 --- a/DataMgr/src/DataManagger.cpp +++ b/DataMgr/src/DataManagger.cpp @@ -1930,37 +1930,37 @@ void CDataManagger::CallDisplayWaveOrCurve(int Type, const QString& FileName, } -// void CDataManagger::CallDisplayCurveVerChange(int Type, const QString& FileName, -// const QString& CurveName, QWidget* parent, int value, float tipValue) -// { -// //常规曲线 -// if (Type == 0) -// { -// ShowCurve *pDlg=parent->findChild("curveView"); -// if(NULL == pDlg) -// { -// pDlg=new ShowCurve(parent); -// pDlg->setObjectName("curveView"); -// pDlg->FileName=FileName; -// pDlg->CurveName=CurveName; -// pDlg->init(); -// pDlg->show(); -// } +void CDataManagger::CallDisplayCurveVerChange(int Type, const QString& FileName, + const QString& CurveName, QWidget* parent, int value, float tipValue) +{ + //常规曲线 + if (Type == 0) + { + ShowCurve *pDlg=parent->findChild("curveView"); + if(NULL == pDlg) + { + pDlg=new ShowCurve(parent); + pDlg->setObjectName("curveView"); + pDlg->FileName=FileName; + pDlg->CurveName=CurveName; + pDlg->init(); + pDlg->show(); + } -// pDlg->linkVerDeptSliderValueChange(value, tipValue); + pDlg->linkVerDeptSliderValueChange(value, tipValue); -// } + } -// } +} -// void CDataManagger::sendTableP2Mgr(QWidget* parent, QScrollBar *p, QTableWidget *t) -// { -// ShowCurve *pDlg = parent->findChild("curveView"); -// if(NULL == pDlg) return; +void CDataManagger::sendTableP2Mgr(QWidget* parent, QScrollBar *p, QTableWidget *t) +{ + ShowCurve *pDlg = parent->findChild("curveView"); + if(NULL == pDlg) return; -// pDlg->setTableBro(p); -// pDlg->setCurveTable(t); -// } + pDlg->setTableBro(p); + pDlg->setCurveTable(t); +} /* void CDataManagger::ListMessage(const QString& listName,const QStringList& header,const QStringList& listMessage) diff --git a/DataMgr/src/DataMgr.pro b/DataMgr/src/DataMgr.pro index 06c3bc1..3fe3838 100644 --- a/DataMgr/src/DataMgr.pro +++ b/DataMgr/src/DataMgr.pro @@ -70,6 +70,7 @@ FORMS += \ HEADERS += \ ../../common/geometryutils.h \ + ../include/DataManagger.h \ AdaptionComboBox.h \ AngleAdjTool.h \ CheckHeadView.h \ @@ -92,8 +93,7 @@ HEADERS += \ cdialog.h \ dataslothelper.h \ deptlineedit.h \ - view.h \ - ../include/DataManagger.h + view.h SOURCES += \ ../../common/geometryutils.cpp \ diff --git a/WellLogUI/include/WellLogTableDialogNew.h b/WellLogUI/include/WellLogTableDialogNew.h index fc24613..deb6ac0 100644 --- a/WellLogUI/include/WellLogTableDialogNew.h +++ b/WellLogUI/include/WellLogTableDialogNew.h @@ -138,6 +138,7 @@ public: public: void setName(QString strOldPath, QString strOldName, int nObjectType); + void setShowCurveName(QString strPath, QString strName, QMap> mapShowObject); }; #endif /* PAITABLEWIDGET_H_ */ diff --git a/WellLogUI/src/WellLogTableDialogNew.cpp b/WellLogUI/src/WellLogTableDialogNew.cpp index 25fdc5b..8fc5c57 100644 --- a/WellLogUI/src/WellLogTableDialogNew.cpp +++ b/WellLogUI/src/WellLogTableDialogNew.cpp @@ -191,6 +191,7 @@ void WellLogTableDialogNew::setName(QString strOldPath, QString strOldName, int pWellLog->m_name = strOldName; m_pWellLogs.clear(); m_pWellLogs.append(pWellLog); + //初始化 InitWell(); @@ -205,6 +206,46 @@ void WellLogTableDialogNew::setName(QString strOldPath, QString strOldName, int //m_pUI->tableWidget->setCurrentCell(300, 0); } +void WellLogTableDialogNew::setShowCurveName(QString strPath, QString strName, QMap> mapShowObject) +{ + FileName = strPath; + CurveName = strName; + m_ObjectType = CURVE_OBJECT; + + if (WAVE_OBJECT != m_ObjectType) + m_pUI->horizontalScrollBar->hide(); + m_pWellLogs.clear(); + + QList listShowSlfName = mapShowObject.keys(); + + for(int i= 0; i < listShowSlfName.size(); i++) + { + QString strSlfName = listShowSlfName.at(i); + QList listObjectName = mapShowObject[listShowSlfName.at(i)]; + for(int j= 0; j < listObjectName.size(); j++) + { + QString strCurveName = listObjectName.at(j); + CObjWellLog* pWellLog = new CObjWellLog; + pWellLog->SetSlfFileName(strSlfName); + pWellLog->m_name = strCurveName; + + m_pWellLogs.append(pWellLog); + } + } + + //初始化 + InitWell(); + + m_gridData->m_middleWidth=0; + m_gridData->m_gridWidth=0; + InitWellLog(); + + qDebug() << "count=" << QString::number(count); + m_pUI->tableWidget->verticalScrollBar()->setRange(0, count);//count + m_pUI->tableWidget->verticalScrollBar()->setValue(count / 2); + + //m_pUI->tableWidget->setCurrentCell(300, 0); +} //井眼轨迹 void WellLogTableDialogNew::InitWell() { diff --git a/WellLogUI/src/griddataadapter.cpp b/WellLogUI/src/griddataadapter.cpp index 6549a2c..aaefc96 100644 --- a/WellLogUI/src/griddataadapter.cpp +++ b/WellLogUI/src/griddataadapter.cpp @@ -3448,17 +3448,17 @@ void GridDataAdapter::slotVerScrollValueChange(int nValue) m_popTip->moveCursorPoint(m_popTipValue); if(m_dtype == D_WellLogData){ - // //20210111 GZL add 联动 - // QWidget* parent=qobject_cast(m_table->parent()); - // QWidget* pvPage=parent->findChild("curvePreViewPage"); - // int value = (m_EDep-m_popTipValue)*CurveViewVerRange/(m_EDep-m_SDep)+1; - // if(value >= 0 && value <= CurveViewVerRange){ - // m_mgr->CallDisplayCurveVerChange(0,fileName,curveName,pvPage,value,m_popTipValue); + //20210111 GZL add 联动 + QWidget* parent=qobject_cast(m_table->parent()); + QWidget* pvPage=parent->findChild("curvePreViewPage"); + int value = (m_EDep-m_popTipValue)*CurveViewVerRange/(m_EDep-m_SDep)+1; + if(value >= 0 && value <= CurveViewVerRange){ + m_mgr->CallDisplayCurveVerChange(0,fileName,curveName,pvPage,value,m_popTipValue); - // m_mgr->sendTableP2Mgr(pvPage, m_verScrolBar, m_table); - // } + m_mgr->sendTableP2Mgr(pvPage, m_verScrolBar, m_table); + } - // //updateTableView(); + //updateTableView(); } } else{ diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index f00f8a2..ddccbdd 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 = ""; + } } //处理通用属性 @@ -286,7 +286,13 @@ void PropertyWidget::changedYxzpItemProperty(QtProperty *qtProperty, const QVari void PropertyWidget::changedCorePhysicsProperty(QtProperty *qtProperty, const QVariant &variant, bool isItem) { - if("例区高度" == m_propertyData[qtProperty]) + if("曲线名称" == m_propertyData[qtProperty]) + { + QFont newFont = variant.value(); + m_formInfo->m_curveNameFont = newFont; + m_formInfo->update(); + } + else if("例区高度" == m_propertyData[qtProperty]) { int temp = variant.toInt(); this->m_formInfo->m_headHeight = temp; @@ -456,24 +462,28 @@ void PropertyWidget::changedCorePhysicsProperty(QtProperty *qtProperty, const QV int temp = variant.toInt(); this->m_tdCorePhysics->setCpOrder(temp); this->m_tdCorePhysics->mPlot->saveToSLFCorePhysics(); + this->m_tdCorePhysics->update(); } else if("深度" == m_propertyData[qtProperty]) { double temp = variant.toDouble(); this->m_tdCorePhysics->setCpDepth(temp); this->m_tdCorePhysics->mPlot->saveToSLFCorePhysics(); + this->m_tdCorePhysics->update(); } else if("校正深度" == m_propertyData[qtProperty]) { double temp = variant.toDouble(); this->m_tdCorePhysics->setRange(temp,temp,this->m_tdCorePhysics->getCpCoreValue()); this->m_tdCorePhysics->mPlot->saveToSLFCorePhysics(); + this->m_tdCorePhysics->update(); } else if("数值" == m_propertyData[qtProperty]) { double temp = variant.toDouble(); this->m_tdCorePhysics->setCpCoreValue(temp); this->m_tdCorePhysics->mPlot->saveToSLFCorePhysics(); + this->m_tdCorePhysics->update(); } else if("左刻度" == m_propertyData[qtProperty]) { @@ -484,15 +494,6 @@ void PropertyWidget::changedCorePhysicsProperty(QtProperty *qtProperty, const QV QVariantMap variantMap; variantMap["leftScale"] = temp; emit CallManage::getInstance()->sig_changeCorePhysicsProperty(variantMap); - -// this->m_tdCorePhysics->setCpLeftScale(temp); - // 这个操作需要修改所有对象 -// QMap m_mapDraggable_CorePhysics = this->m_tdCorePhysics->mPlot->m_mapDraggable_CorePhysics; -// for (QMap::Iterator iter = m_mapDraggable_CorePhysics.begin(); iter != m_mapDraggable_CorePhysics.end(); iter++) -// { -// TransparentDraggableCorePhysics* pDraggableRect = (TransparentDraggableCorePhysics*)iter.value(); -// pDraggableRect->setCpLeftScale(temp); -// } } else if("右刻度" == m_propertyData[qtProperty]) { @@ -503,14 +504,6 @@ void PropertyWidget::changedCorePhysicsProperty(QtProperty *qtProperty, const QV QVariantMap variantMap; variantMap["rightScale"] = temp; emit CallManage::getInstance()->sig_changeCorePhysicsProperty(variantMap); - -// this->m_tdCorePhysics->setCpRightScale(temp); -// QMap m_mapDraggable_CorePhysics = this->m_tdCorePhysics->mPlot->m_mapDraggable_CorePhysics; -// for (QMap::Iterator iter = m_mapDraggable_CorePhysics.begin(); iter != m_mapDraggable_CorePhysics.end(); iter++) -// { -// TransparentDraggableCorePhysics* pDraggableRect = (TransparentDraggableCorePhysics*)iter.value(); -// pDraggableRect->setCpRightScale(temp); -// } } else if("等分刻度数或自定义序列" == m_propertyData[qtProperty]) { @@ -564,12 +557,7 @@ void PropertyWidget::changedCorePhysicsProperty(QtProperty *qtProperty, const QV { QFont temp = variant.value(); this->m_formInfo->m_cp_curveScale = temp; - this->m_tdCorePhysics->setCpCurveScale(temp); - } - - if(isItem) - { - this->m_tdCorePhysics->update(); + this->m_formInfo->repaint(); } } @@ -586,36 +574,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) @@ -651,46 +639,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)//固井结论道 { //先处理通用属性 @@ -873,7 +861,7 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant } } else if (m_strCurrentProperty == LayerItem_Property) - { + { //先处理通用属性 CommonPropertyChanged(pProperty, variant); @@ -941,54 +929,68 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant else if("岩性" == m_propertyData[pProperty]) { QString newResult = variant.value(); - m_tdLayer->setLith(newResult); - // - 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]) - { - 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; - } + //只能选择自己的符号,不能选择其他。 + QString strDefaultPath = ::GetLithSymbolDir(); + //符号统一 + strDefaultPath.replace("\\","/"); + newResult.replace("\\","/"); + // + if(newResult.contains(strDefaultPath)) + { + m_tdLayer->setLith(newResult); + // + QCPRange currentRange = m_tdLayer->getRange(); + m_tdLayer->setRange(currentRange.lower, currentRange.upper); + } + else { + QMessageBox::information(nullptr,"提示","所选目录不支持"); + 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); @@ -1021,12 +1023,26 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant if(m_tdGujing) { QString newResult = variant.value(); - m_tdGujing->setResult(newResult); + + //只能选择自己的符号,不能选择其他。 + QString strDefaultPath = ::GetGujingSymbolDir(); + //符号统一 + strDefaultPath.replace("\\","/"); + newResult.replace("\\","/"); // - QCPRange currentRange = m_tdGujing->getRange(); - m_tdGujing->setRange(currentRange.lower, currentRange.upper); - //保存 - m_tdGujing->mPlot->SaveToSLF_Gujing(); + 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; + } } } } @@ -1076,12 +1092,26 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant if(m_tdSwallCore) { QString newResult = variant.value(); - m_tdSwallCore->setLith(newResult); + + //只能选择自己的符号,不能选择其他。 + QString strDefaultPath = ::GetSymbolDir()+"取心岩性符号"; + //符号统一 + strDefaultPath.replace("\\","/"); + newResult.replace("\\","/"); // - QCPRange currentRange = m_tdSwallCore->getRange(); - m_tdSwallCore->setRange(currentRange.lower, currentRange.upper); - //保存 - m_tdSwallCore->mPlot->SaveToSLF_SwallCore(); + 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; + } } } else if("油气" == m_propertyData[pProperty]) @@ -1090,12 +1120,26 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant if(m_tdSwallCore) { QString newResult = variant.value(); - m_tdSwallCore->setOil(newResult); + + //只能选择自己的符号,不能选择其他。 + QString strDefaultPath = ::GetGasSymbolDir(); + //符号统一 + strDefaultPath.replace("\\","/"); + newResult.replace("\\","/"); // - QCPRange currentRange = m_tdSwallCore->getRange(); - m_tdSwallCore->setRange(currentRange.lower, currentRange.upper); - //保存 - m_tdSwallCore->mPlot->SaveToSLF_SwallCore(); + 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; + } } } else if("颜色" == m_propertyData[pProperty]) @@ -1105,24 +1149,37 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant { QString ColorImage = variant.value(); - QString name = ""; - int CoreColor = 0; + //只能选择自己的符号,不能选择其他。 + QString strDefaultPath = ::GetColorSymbolDir(); + //符号统一 + strDefaultPath.replace("\\","/"); 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(); + 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; + } } } else if("起始位置" == m_propertyData[pProperty]) @@ -1174,12 +1231,26 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant if(m_tdGeoLith) { QString newResult = variant.value(); - m_tdGeoLith->setLith(newResult, m_tdGeoLith->m_Color); + + //只能选择自己的符号,不能选择其他。 + QString strDefaultPath = ::GetMudSymbolDir(); + //符号统一 + strDefaultPath.replace("\\","/"); + newResult.replace("\\","/"); // - QCPRange currentRange = m_tdGeoLith->getRange(); - m_tdGeoLith->setRange(currentRange.lower, currentRange.upper); - //保存 - m_tdGeoLith->mPlot->SaveToSLF_GeoLith(); + 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; + } } } else if("油气" == m_propertyData[pProperty]) @@ -1188,12 +1259,26 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant if(m_tdGeoLith) { QString newResult = variant.value(); - m_tdGeoLith->setOil(newResult); + + //只能选择自己的符号,不能选择其他。 + QString strDefaultPath = ::GetGasSymbolDir(); + //符号统一 + strDefaultPath.replace("\\","/"); + newResult.replace("\\","/"); // - QCPRange currentRange = m_tdGeoLith->getRange(); - m_tdGeoLith->setRange(currentRange.lower, currentRange.upper); - //保存 - m_tdGeoLith->mPlot->SaveToSLF_GeoLith(); + 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; + } } } else if("颜色" == m_propertyData[pProperty]) @@ -1202,12 +1287,26 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant if(m_tdGeoLith) { QString newResult = variant.value(); - m_tdGeoLith->setLith(m_tdGeoLith->m_Lith, newResult); + + //只能选择自己的符号,不能选择其他。 + QString strDefaultPath = ::GetColorSymbolDir(); + //符号统一 + strDefaultPath.replace("\\","/"); + newResult.replace("\\","/"); // - QCPRange currentRange = m_tdGeoLith->getRange(); - m_tdGeoLith->setRange(currentRange.lower, currentRange.upper); - //保存 - m_tdGeoLith->mPlot->SaveToSLF_GeoLith(); + 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; + } } } else if("含油占比(1~8)" == m_propertyData[pProperty]) @@ -1675,24 +1774,38 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant //-------------------------- QString newResult = variant.value(); - m_tdGuan->setResult(newResult); - // - 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) + //只能选择自己的符号,不能选择其他。 + QString strDefaultPath = GetSymbolDir()+"管柱组件"; + //符号统一 + strDefaultPath.replace("\\","/"); + newResult.replace("\\","/"); + // + if(newResult.contains(strDefaultPath)) { - //组件改变后,重绘管柱 - m_tdGuan->mPlot->LoadFromSLF_ReDrawTubing(m_tdGuan->mPlot->m_strSlfName, m_tdGuan->mPlot->m_strLineName); + m_tdGuan->setResult(newResult); + // + 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; } } } } - else if (m_strCurrentProperty == Depth_Property) // 深度 + else if (m_strCurrentProperty == Depth_Property) // 深度 { //先处理通用属性 CommonPropertyChanged(pProperty, variant); @@ -2169,7 +2282,11 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant m_item->setFont(newFont); } } - + else if(m_strCurrentProperty == PL_OBJECT_PROPERTY) // 频率统计图 + { + CommonPropertyChanged(pProperty, variant); + changedPlObjectProperty(m_propertyData[pProperty], variant); + } @@ -2178,22 +2295,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() @@ -2421,14 +2538,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) @@ -2481,33 +2598,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) @@ -2605,7 +2722,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; // @@ -2684,8 +2801,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); @@ -2714,8 +2831,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; } @@ -2781,21 +2898,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) @@ -2807,7 +2924,7 @@ void PropertyWidget::initDepthProperty(FormInfo *formInfo) _CreateVariantPropertyItem("通常", "显示单位", formInfo->m_strUnit, QVariant::String); _CreateVariantPropertyItem("通常", "标尺颜色", formInfo->m_sdRulerColor, QVariant::Color); - _CreateVariantPropertyItem("字体", "字体", formInfo->m_curveNameFont, QVariant::Font); + _CreateVariantPropertyItem("字体", "名称", formInfo->m_curveNameFont, QVariant::Font); _CreateVariantPropertyItem("字体", "单位", formInfo->m_strUnitFont, QVariant::Font); _CreateVariantPropertyItem("深度标注", "间隔", formInfo->m_sdInterval, QVariant::Double); @@ -2819,9 +2936,9 @@ void PropertyWidget::initDepthProperty(FormInfo *formInfo) _CreateVariantPropertyItem("深度标注", "海拔垂深", formInfo->m_sdElevationVerticalDepth, QVariant::Bool); _CreateVariantPropertyItem("深度标注", "垂深", formInfo->m_sdVerticalDepth, QVariant::Bool); QStringList listStyle; - listStyle.append("偏左"); + listStyle.append("靠左"); listStyle.append("居中"); - listStyle.append("偏右"); + listStyle.append("靠右"); _CreateEnumPropertyItem("深度标注", "斜深位置", formInfo->m_sdMeasuredDepthPosition, listStyle); _CreateEnumPropertyItem("深度标注", "垂深位置", formInfo->m_sdVerticalDepthPosition, listStyle); _CreateEnumPropertyItem("深度标注", "海拔垂深位置", formInfo->m_sdElevationVerticalDepthPosition, listStyle); @@ -2839,24 +2956,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") { //固井结论 @@ -2896,18 +3013,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") { @@ -2919,7 +3036,7 @@ void PropertyWidget::initProperty(FormInfo *formInfo) //沉积相 this->initFacProperty(formInfo); } - else if(formInfo->m_strType=="SantuyibiaoObject") + else if(formInfo->m_strType=="SantuyibiaoObject") { this->initTvdProperty(formInfo); } @@ -2928,156 +3045,162 @@ void PropertyWidget::initProperty(FormInfo *formInfo) //套管组件 this->initTubingProperty(formInfo); } + else if (formInfo->m_strType == "plObject") + { + //频率统计图 + this->initPlObjectProperty(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) @@ -3125,9 +3248,51 @@ void PropertyWidget::initSwallCoreItemProperty(TransparentDraggableSwallCore* td // _CreateVariantPropertyItem("当前项", "深度", -Depth, QVariant::Double); - _CreateVariantPropertyItem("当前项", "岩性", LithologyImage, VariantManager::filePathTypeId()); - _CreateVariantPropertyItem("当前项", "油气", OilGasImage, VariantManager::filePathTypeId()); - _CreateVariantPropertyItem("当前项", "颜色", ColorImage, VariantManager::filePathTypeId()); + + //只能选择自己的符号,不能选择其他。 + 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("当前项", "起始位置", Sideleft, QVariant::Double); //_CreateVariantPropertyItem("当前项", "宽度", -Depth, QVariant::Double); } @@ -3236,7 +3401,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; //颜色 @@ -3294,7 +3459,21 @@ void PropertyWidget::initGujingItemProperty(TransparentDraggableGujing* tdGujing // _CreateVariantPropertyItem("当前项", "顶深(m)", -upper, QVariant::Double); _CreateVariantPropertyItem("当前项", "底深(m)", -lower, QVariant::Double); - _CreateVariantPropertyItem("当前项", "固井结论", strResult, VariantManager::filePathTypeId()); + + //只能选择自己的符号,不能选择其他。 + QString strDefaultPath = ::GetGujingSymbolDir(); + //符号统一 + strDefaultPath.replace("\\","/"); + strResult.replace("\\","/"); + // + if(strResult.contains(strDefaultPath)) + { + _CreateVariantPropertyItem("当前项", "固井结论", strResult, VariantManager::filePathTypeId()); + } + else + { + _CreateVariantPropertyItem("当前项", "固井结论", strDefaultPath, VariantManager::filePathTypeId()); + } } void PropertyWidget::initImageProperty(FormInfo *formInfo) @@ -3420,7 +3599,7 @@ void PropertyWidget::initCorePhysicsProperty(FormInfo *formInfo, bool isItem) _CreateEnumPropertyItem("显示设置", "刻度类型", formInfo->m_cp_scaleType, listStyle4); _CreateVariantPropertyItem("显示设置", "显示单位", formInfo->m_strUnit, QVariant::String); - _CreateVariantPropertyItem("字体", "字体", formInfo->m_curveNameFont, QVariant::Font); + _CreateVariantPropertyItem("字体", "曲线名称", formInfo->m_curveNameFont, QVariant::Font); _CreateVariantPropertyItem("字体", "曲线单位", formInfo->m_strUnitFont, QVariant::Font); _CreateVariantPropertyItem("字体", "曲线刻度", formInfo->m_cp_curveScale, QVariant::Font); @@ -3612,7 +3791,7 @@ void PropertyWidget::initTvdProperty(FormInfo *formInfo) m_strCurrentProperty = Tvd_Property; } -void PropertyWidget::initGeoLithItemProperty(TransparentDraggableGeoLith* tdGeoLith, double lower, double upper, const QString myLith, const QString myOil, const QString myColor) +void PropertyWidget::initGeoLithItemProperty(TransparentDraggableGeoLith* tdGeoLith, double lower, double upper, QString myLith, QString myOil, QString myColor) { //初始化,清空 InitCurrentViewInfo(); @@ -3654,9 +3833,51 @@ void PropertyWidget::initGeoLithItemProperty(TransparentDraggableGeoLith* tdGeoL // _CreateVariantPropertyItem("当前项", "顶深(m)", -upper, QVariant::Double); _CreateVariantPropertyItem("当前项", "底深(m)", -lower, QVariant::Double); - _CreateVariantPropertyItem("当前项", "岩性", myLith, VariantManager::filePathTypeId()); - _CreateVariantPropertyItem("当前项", "油气", myOil, VariantManager::filePathTypeId()); - _CreateVariantPropertyItem("当前项", "颜色", myColor, VariantManager::filePathTypeId()); + + //只能选择自己的符号,不能选择其他。 + 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()); + } + } //气测/FMT/射孔/文本 @@ -3815,7 +4036,116 @@ void PropertyWidget::initTubingItemProperty(TransparentDraggableGuan* tdGuan, do // _CreateVariantPropertyItem("当前项", "深度(m)", -(upper+lower)/2.0, QVariant::Double); - _CreateVariantPropertyItem("当前项", "组件类型", strResult, VariantManager::filePathTypeId()); + + //只能选择自己的符号,不能选择其他。 + QString strDefaultPath = GetSymbolDir()+"管柱组件"; + //符号统一 + strDefaultPath.replace("\\","/"); + strResult.replace("\\","/"); + // + if(strResult.contains(strDefaultPath)) + { + _CreateVariantPropertyItem("当前项", "组件类型", strResult, VariantManager::filePathTypeId()); + } + else { + _CreateVariantPropertyItem("当前项", "组件类型", strDefaultPath, VariantManager::filePathTypeId()); + } +} + +void PropertyWidget::initPlObjectProperty(FormInfo *formInfo) +{ + _CreateVariantPropertyItem("数据", "数据名称", formInfo->m_strAliasName, QVariant::String); + QStringList listType; + listType.append("曲线型数据"); + listType.append("表格型数据"); + _CreateEnumPropertyItem("数据", "数据类型", formInfo->m_pl_dataType, listType); + _CreateVariantPropertyItem("数据", "显示单位", formInfo->m_strUnit, QVariant::String); + _CreateVariantPropertyItem("数据", "井文件名称", formInfo->m_strSlfName, QVariant::String); + _CreateVariantPropertyItem("数据", "方位曲线", formInfo->m_pl_azimuthCurve, QVariant::String); + _CreateVariantPropertyItem("数据", "倾角曲线", formInfo->m_pl_inclinationCurve, QVariant::String); + + _CreateVariantPropertyItem("通常", "例区高度", formInfo->m_headHeight, QVariant::Int); + + _CreateVariantPropertyItem("字体", "名称", formInfo->m_strAliasNameFont, QVariant::Font); + _CreateVariantPropertyItem("字体", "单位", formInfo->m_strUnitFont, QVariant::Font); + _CreateVariantPropertyItem("字体", "刻度", formInfo->m_strAliasName, QVariant::Font); + _CreateVariantPropertyItem("字体", "曲线名称", formInfo->m_strAliasName, QVariant::Font); + + _CreateVariantPropertyItem("控制曲线", "曲线名", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("控制曲线", "最小值", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("控制曲线", "最大值", formInfo->m_strAliasName, QVariant::String); + + _CreateVariantPropertyItem("方位频率", "扇形", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("方位频率", "圆半径(cm)", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("方位频率", "圆线颜色", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("方位频率", "圆线宽度", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("方位频率", "是否填充", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("方位频率", "填充颜色", formInfo->m_strAliasName, QVariant::String); + + _CreateVariantPropertyItem("倾角频率", "线数", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("倾角频率", "统计线高度(cm)", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("倾角频率", "线粗细", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("倾角频率", "线颜色", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("倾角频率", "是否绘制标注?", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("倾角频率", "绘制直方图?", formInfo->m_strAliasName, QVariant::String); + + _CreateVariantPropertyItem("基线", "宽度", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("基线", "颜色", formInfo->m_strAliasName, QVariant::String); + + _CreateVariantPropertyItem("统计参数", "统计间隔", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("统计参数", "最小倾角", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("统计参数", "最大倾角", formInfo->m_strAliasName, QVariant::String); + + _CreateVariantPropertyItem("分类", "高导缝", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("分类", "高阻缝", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("分类", "网状缝", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("分类", "诱导缝", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("分类", "层理", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("分类", "侵蚀面", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("分类", "孔洞", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("分类", "气孔", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("分类", "砾石", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("分类", "结核", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("分类", "团块", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("分类", "断层", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("分类", "垂直缝", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("分类", "自定义1", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("分类", "自定义2", formInfo->m_strAliasName, QVariant::String); + + m_strCurrentProperty = PL_OBJECT_PROPERTY; +} + +void PropertyWidget::changedPlObjectProperty(QString strProperty, QVariant varVal) +{ + if ("数据名称" == strProperty) + { + m_formInfo->m_strAliasName = varVal.toString(); + this->m_formInfo->repaint(); + } + if ("显示单位" == strProperty) + { + this->m_formInfo->m_strUnit = varVal.toString(); + this->m_formInfo->repaint(); + } + else if ("例区高度" == strProperty) + { + int temp = varVal.toInt(); + this->m_formInfo->m_headHeight = temp; + this->m_formInfo->setFixedHeight(temp); + } + else if ("名称" == strProperty) + { + QFont newFont = varVal.value(); + this->m_formInfo->m_strAliasNameFont = newFont; + this->m_formInfo->repaint(); + } + else if ("单位" == strProperty) + { + QFont temp = varVal.value(); + this->m_formInfo->m_strUnitFont = temp; + this->m_formInfo->repaint(); + } + } void PropertyWidget::changedDepthProperty(QString strProperty, QVariant varVal) diff --git a/logPlus/PropertyWidget.h b/logPlus/PropertyWidget.h index cf1ead6..ed4d4be 100644 --- a/logPlus/PropertyWidget.h +++ b/logPlus/PropertyWidget.h @@ -52,6 +52,7 @@ #define CORE_PHYSICS_ITEM_PROPERTY "CORE_PHYSICS_ITEM_PROPERTY" // 岩心分析item #define Depth_Property "Depth_Property" // 深度 +#define PL_OBJECT_PROPERTY "PL_OBJECT_PROPERTY" // 频率统计图 #define SwallCore_Property "SwallCore_Property" //井壁取心 #define SwallCoreItem_Property "SwallCoreItem_Property" //井壁取心item @@ -173,8 +174,6 @@ public: void initHeadProperty(FormHead *formHead, QTableWidget *tableWidget, QTableWidgetItem* item, int row, int col); void initTableProperty(FormInfo *formInfo); - // 深度 - void initDepthProperty(FormInfo *formInfo); void initProperty(FormInfo *formInfo); // 玫瑰图属性 @@ -189,14 +188,6 @@ public: void initGujingProperty(FormInfo *formInfo); void initGujingItemProperty(TransparentDraggableGujing* tdGujing, double lower, double upper, QString strResult); - // 岩心照片属性 - void initImageProperty(FormInfo *formInfo); - void initImageItemProperty(TransparentDraggableImage* tdImage, double lower, double upper, QString strResult, double left, double width, QColor borderColor, Qt::PenStyle borderStyle, int borderWidth); - - // 岩心分析属性 isItem用来判断是不是item 默认false - void initCorePhysicsProperty(FormInfo *formInfo, bool isItem = false); - void initCorePhysicsItemProperty(TransparentDraggableCorePhysics* tdImage); - // 井壁取心属性 void initSwallCoreProperty(FormInfo *formInfo); void initSwallCoreItemProperty(TransparentDraggableSwallCore* tdSwallCore, double Depth, QString LithologyImage, QString OilGasImage, QString ColorImage, double Sideleft, double width, int iColor); @@ -234,15 +225,25 @@ public: //处理通用属性 void CommonPropertyChanged(QtProperty *pProperty, const QVariant &variant); - // 岩心照片 + // 频率统计图 + void initPlObjectProperty(FormInfo *formInfo); + void changedPlObjectProperty(QString strProName, QVariant val); + + // 岩心照片 属性 + void initImageProperty(FormInfo *formInfo); + void initImageItemProperty(TransparentDraggableImage* tdImage, double lower, double upper, QString strResult, double left, double width, QColor borderColor, Qt::PenStyle borderStyle, int borderWidth); void changedYxzpProperty(QtProperty *pProperty, const QVariant &variant); void changedYxzpItemProperty(QtProperty *pProperty, const QVariant &variant); // 深度 + void initDepthProperty(FormInfo *formInfo); void changedDepthProperty(QString strProName, QVariant val); - // 岩心分析 + // 岩心分析 属性 isItem用来判断是不是item 默认false + void initCorePhysicsProperty(FormInfo *formInfo, bool isItem = false); + void initCorePhysicsItemProperty(TransparentDraggableCorePhysics* tdImage); void changedCorePhysicsProperty(QtProperty *pProperty, const QVariant &variant, bool isItem = false); + public slots: void SlotPropertyChanged(QtProperty *property, const QVariant &variant); void SlotPropertyChanged(QtProperty *property, const int &val, bool islinestyle); diff --git a/logPlus/YxzpDialog.cpp b/logPlus/YxzpDialog.cpp index 9909dd6..cf2ab9f 100644 --- a/logPlus/YxzpDialog.cpp +++ b/logPlus/YxzpDialog.cpp @@ -1,4 +1,4 @@ -#include "YxzpDialog.h" +#include "YxzpDialog.h" YxzpDialog::YxzpDialog(QWidget *parent) : QDialog(parent) diff --git a/logPlus/YxzpDialog.h b/logPlus/YxzpDialog.h index 6402322..841e761 100644 --- a/logPlus/YxzpDialog.h +++ b/logPlus/YxzpDialog.h @@ -1,4 +1,4 @@ -#ifndef YXZPDIALOG_H +#ifndef YXZPDIALOG_H #define YXZPDIALOG_H // 岩心照片 自定义 dialog #include @@ -8,10 +8,10 @@ #include #include #include - - #include +#pragma execution_character_set("utf-8") + class YxzpDialog : public QDialog { Q_OBJECT diff --git a/logPlus/customtabwidget.cpp b/logPlus/customtabwidget.cpp index 427fd92..1f7bd6c 100644 --- a/logPlus/customtabwidget.cpp +++ b/logPlus/customtabwidget.cpp @@ -189,6 +189,16 @@ void CustomTabWidget::dropEvent(QDropEvent *event) //关闭 void CustomTabWidget::slot_tabClose(int index) { + QWidget *selectWidget = tabWidget(index); + + QString objectName = selectWidget->objectName(); + if(objectName == "MainWindowSplitter") + { + int flag = QMessageBox::warning(NULL,"提示",QString("图文件尚未保存,您确信关闭当前窗口?"),QMessageBox::Yes,QMessageBox::No); + if(flag!=QMessageBox::Yes) return; + } + + //移除 removeTab(index); //属性清空 diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index 2798823..61aed8c 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -192,7 +192,7 @@ void FormDraw::setDrawData(QStringList listdt, QJsonObject objInfo) // 设置左侧显示属性 设置界面样式 if(pInfo->m_strUnit.isEmpty()){ pInfo->m_strUnit = "(米)"; - pInfo->m_strUnitFont = QFont("微软雅黑", 10); + pInfo->m_strUnitFont = QFont("微软雅黑", 8); } initDepth(curv); // 读json后 重新设置样式 @@ -312,6 +312,11 @@ void FormDraw::setDrawData(QStringList listdt, QJsonObject objInfo) } else if("plObject" == strType) { + if(pInfo->m_strUnit.isEmpty()){ + pInfo->m_strUnit = "(°)"; + pInfo->m_strUnitFont = QFont("微软雅黑", 8); + } + initFgrq(curv); } else if("roseObject" == strType) @@ -8154,6 +8159,63 @@ void FormDraw::dropEvent(QDropEvent* event) //新建表格曲线 emit CallManage::getInstance()->sig_AddTableLine(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); } + else if(strType=="depthObject") + { + qDebug() << "新建深度"; + //新建曲线 + emit CallManage::getInstance()->sig_AddDepth(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="ganzhuangtuObject") + { + //新建杆状图 + emit CallManage::getInstance()->sig_AddGanZhuangTu(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="JyktObject") + { + //新建井眼垮塌矢量图 + emit CallManage::getInstance()->sig_AddJykt(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="DenvObject") + { + //新建井斜方位图 + emit CallManage::getInstance()->sig_AddDenv(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="DrawImageObject") + { + //图像 成图 + emit CallManage::getInstance()->sig_AddDrawImage(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="SantuyibiaoObject") + { + //斜井三图一表 + emit CallManage::getInstance()->sig_AddSantuyibiao(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="CrackObject") + { + //裂缝 + emit CallManage::getInstance()->sig_AddCrack(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="JiegutextObject") + { + //气测/FMT/射孔/文本 + emit CallManage::getInstance()->sig_AddJiegutext(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="LogfaceObject") + { + //沉积相 + emit CallManage::getInstance()->sig_AddLogface(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="MCalsObject") + { + //多臂井径 + emit CallManage::getInstance()->sig_AddMCals(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="TubingstringObject") + { + //套管组件 + emit CallManage::getInstance()->sig_AddTubingstring(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + // 接受拖拽事件 event->setDropAction(Qt::MoveAction); event->accept(); diff --git a/logPlus/forminfo.cpp b/logPlus/forminfo.cpp index df4b35e..04b1314 100644 --- a/logPlus/forminfo.cpp +++ b/logPlus/forminfo.cpp @@ -747,7 +747,10 @@ void FormInfo::paintEvent(QPaintEvent* event) } else { + QFont oldFont = painter.font(); + painter.setFont(this->m_strAliasNameFont); painter.drawText(rt, Qt::AlignCenter, text); + painter.setFont(oldFont); } } @@ -793,18 +796,19 @@ void FormInfo::paintEvent(QPaintEvent* event) painter.drawText(rect.left(), rect.top()+rect.height()*2/3, rect.width(), rect.height()/3 ,Qt::AlignCenter, QString::number(m_vmin)+" ~ "+QString::number(m_vmax)); } - if(m_strLineName == "深度") + if(m_strLineName == "深度" || m_strType == "plObject") { + QFont oldFont = painter.font(); painter.setFont(m_strUnitFont); painter.drawText(rect.left(), rect.top() + rect.height() * 2 / 3, rect.width(), rect.height() / 3, Qt::AlignCenter, this->m_strUnit); + painter.setFont(oldFont); } + // 岩心分析 if(m_strType == "tableObject" && m_strLineName == "CORE_PHYSICS") { painter.setPen(Qt::black); - // 字体->曲线单位 QFont oldFont = painter.font(); painter.setFont(m_strUnitFont); - // 显示单位 painter.drawText(rect.left()+10, rect.top() + rect.height() * 2 / 3, rect.width(), rect.height() / 3, Qt::AlignCenter, m_strUnit); painter.setFont(oldFont); @@ -854,6 +858,11 @@ void FormInfo::paintEvent(QPaintEvent* event) painter.setFont(oldFont); } + if(this->m_strType == "plObject") + { + + } + QWidget::paintEvent(event); } diff --git a/logPlus/forminfo.h b/logPlus/forminfo.h index 53116bc..4c78082 100644 --- a/logPlus/forminfo.h +++ b/logPlus/forminfo.h @@ -85,9 +85,10 @@ public: QString m_strWellName; QString m_strTrackName; QString m_strLineName; - QString m_strAliasName;//显示名称 + QString m_strAliasName; //显示名称 + QFont m_strAliasNameFont = QFont("微软雅黑", 10); //显示名称字体 QString m_strUnit = "(米)";//单位 - QFont m_strUnitFont = QFont("微软雅黑", 10);//单位字体 + QFont m_strUnitFont = QFont("微软雅黑", 8);//单位字体 // 头部高度 int m_headHeight = 100; @@ -205,7 +206,7 @@ public: QColor m_sdRulerColor; // 标尺颜色 double m_sdInterval = 20; // 间隔 QFont m_sdLabelFont = QFont("微软雅黑", 10); // 标注字体 - double m_sdRotationAngle = 0.0; // 旋转(°) + double m_sdRotationAngle = 90.0; // 旋转(°) bool m_sdDrawStartDepth; // 绘制起点深度 bool m_sdDrawEndDepth; // 绘制终点深度 bool m_sdMeasuredDepth = true; // 斜深 @@ -240,6 +241,61 @@ public: QColor m_cp_symbolFillColor; // 填充颜色 int m_cp_fieldName = 0; // 字段名称 + // 频率统计图 + // 数据 + int m_pl_dataType; // 数据类型 + QString m_pl_azimuthCurve = "DDIR"; // 方位曲线 + QString m_pl_inclinationCurve = "DANG"; // 倾角曲线 + // 通用界面配置 + QString m_pl_sectionHeight; // 例区高度(cm) + // 字体相关配置 + QString m_pl_fontName; // 字体名称 + QString m_pl_fontUnit; // 单位字体 + int m_pl_fontScale; // 刻度字体大小 + QString m_pl_curveName; // 曲线名称 + // 控制曲线参数 + QString m_pl_controlCurveName; // 控制曲线名 + double m_pl_controlMinValue; // 控制最小值 + double m_pl_controlMaxValue; // 控制最大值 + // 方位频率绘图参数 + int m_pl_azimuthFrequency; // 方位频率 + int m_pl_sectorCount; // 扇形数量 + double m_pl_circleRadius; // 圆半径(cm) + QColor m_pl_circleColor; // 圆线颜色 + int m_pl_circleLineWidth; // 圆线宽度 + bool m_pl_isFillEnabled; // 是否启用填充 + QColor m_pl_fillColor; // 填充颜色 + int m_pl_fillFrequency; // 填充频率 + // 倾角频率绘图参数 + int m_pl_dipFrequency; // 倾角频率 + int m_pl_lineType; // 线型 + int m_pl_lineThickness; // 线粗细 + QColor m_pl_lineColor; // 线颜色 + bool m_pl_drawAnnotation; // 是否绘制标注 + bool m_pl_drawHistogram; // 是否绘制直方图 + // 基线参数 + int m_pl_baselineWidth; // 基线宽度 + QColor m_pl_baselineColor; // 基线颜色 + // 统计参数 + int m_pl_statInterval; // 统计间隔 + double m_pl_minInclination; // 最小倾角 + double m_pl_maxInclination; // 最大倾角 + // 地质要素分类开关 + bool m_pl_highGap; // 高导缝 + bool m_pl_highReservoir; // 高阻缝 + bool m_pl_reticularFracture; // 网状缝 + bool m_pl_inducedFracture; // 诱导缝 + bool m_pl_bedLayer; // 层理 + bool m_pl_erosionSurface; // 侵蚀面 + bool m_pl_pore; // 孔洞 + bool m_pl_vesicle; // 气孔 + bool m_pl_gravel; // 砾石 + bool m_pl_nodule; // 结核 + bool m_pl_lumps; // 团块 + bool m_pl_fault; // 断层 + bool m_pl_verticalFracture; // 垂直缝 + QString m_pl_custom1; // 自定义1 + int cpLineWidth() const; void setCpLineWidth(int cpLineWidth); diff --git a/logPlus/formtracktop.cpp b/logPlus/formtracktop.cpp index b721042..e5e3b07 100644 --- a/logPlus/formtracktop.cpp +++ b/logPlus/formtracktop.cpp @@ -137,6 +137,62 @@ void FormTrackTop::dropEvent(QDropEvent* event) //新建表格曲线 emit CallManage::getInstance()->sig_AddTableLine(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); } + else if(strType=="depthObject") + { + qDebug() << "新建深度"; + //新建曲线 + emit CallManage::getInstance()->sig_AddDepth(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="ganzhuangtuObject") + { + //新建杆状图 + emit CallManage::getInstance()->sig_AddGanZhuangTu(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="JyktObject") + { + //新建井眼垮塌矢量图 + emit CallManage::getInstance()->sig_AddJykt(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="DenvObject") + { + //新建井斜方位图 + emit CallManage::getInstance()->sig_AddDenv(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="DrawImageObject") + { + //图像 成图 + emit CallManage::getInstance()->sig_AddDrawImage(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="SantuyibiaoObject") + { + //斜井三图一表 + emit CallManage::getInstance()->sig_AddSantuyibiao(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="CrackObject") + { + //裂缝 + emit CallManage::getInstance()->sig_AddCrack(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="JiegutextObject") + { + //气测/FMT/射孔/文本 + emit CallManage::getInstance()->sig_AddJiegutext(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="LogfaceObject") + { + //沉积相 + emit CallManage::getInstance()->sig_AddLogface(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="MCalsObject") + { + //多臂井径 + emit CallManage::getInstance()->sig_AddMCals(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="TubingstringObject") + { + //套管组件 + emit CallManage::getInstance()->sig_AddTubingstring(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } // 接受拖拽事件 event->setDropAction(Qt::MoveAction); event->accept(); diff --git a/logPlus/formwell.cpp b/logPlus/formwell.cpp index 6fdab02..71d0cfa 100644 --- a/logPlus/formwell.cpp +++ b/logPlus/formwell.cpp @@ -28,8 +28,12 @@ FormWell::FormWell(QWidget *parent, QString strWellName) : ui->tableWidget->setRowCount(rowcount); //动态设置行数 //ui->tableWidget->verticalHeader()->setFixedWidth(3);//标题栏宽度 ui->tableWidget->horizontalHeader()->setFixedHeight(3); - - ui->tableWidget->setStyleSheet( "QTableView::item:selected {color:#57595B; background:#E4E4E4;}"); + //左右边框隐藏 + ui->tableWidget->setStyleSheet("QTableView::item {border-left: 0px solid black;} \ + QTableView::item:selected {border-left: 0px solid black; color:#57595B; background:#E4E4E4;}\ + QTableView::item {border-right: 0px solid black;} \ + QTableView::item:selected {border-right: 0px solid black;}"); + //"QTableView::item:selected {color:#57595B; background:#E4E4E4;}" // 假设你的类中有一个槽函数:onTableRowsInserted(QModelIndex parent, int first, int last) //connect(ui->tableWidget->model(), &QAbstractItemModel::columnsInserted, diff --git a/logPlus/mainwindow.cpp b/logPlus/mainwindow.cpp index 9de0cb9..3e9cc99 100644 --- a/logPlus/mainwindow.cpp +++ b/logPlus/mainwindow.cpp @@ -89,7 +89,7 @@ MainWindow::MainWindow(QWidget *parent) : connect(CallManage::getInstance(), SIGNAL(sig_ShowParameterCard(QString, QString)), this, SLOT(s_ShowParameterCard(QString, QString))); //曲线 //关联信号槽,数据查看曲线数据 - connect(CallManage::getInstance(), SIGNAL(sig_ShowCurve(QString, QString)), this, SLOT(s_ShowCurve(QString, QString))); + connect(CallManage::getInstance(), SIGNAL(sig_ShowCurve(QMap>)), this, SLOT(s_ShowCurve(QMap>))); //关联信号槽,数据查看表格数据 connect(CallManage::getInstance(), SIGNAL(sig_ShowTable(QString, QString)), this, SLOT(s_ShowTable(QString, QString))); @@ -583,12 +583,21 @@ void MainWindow::s_ShowParameterCard(QString strSlfName, QString strName) } //曲线数据查看 -void MainWindow::s_ShowCurve(QString strSlfName, QString strName) +void MainWindow::s_ShowCurve(QMap> mapShowObject) { if(m_centerWidgets) { + QString strSlfName; + QString strName; + QList listShowSlfName = mapShowObject.keys(); + if (listShowSlfName.size()>0) + { + strSlfName = listShowSlfName.at(0); + strName = mapShowObject[listShowSlfName.at(0)].at(0); + } + WellLogTableDialogNew* pDialog = new WellLogTableDialogNew(); - pDialog->setName(strSlfName, strName, CURVE_OBJECT); + pDialog->setShowCurveName(strSlfName, strName, mapShowObject); QString wellname; QString path; GetWellNameAndPath(strSlfName, wellname, path); diff --git a/logPlus/mainwindow.h b/logPlus/mainwindow.h index 5a36106..9e630f1 100644 --- a/logPlus/mainwindow.h +++ b/logPlus/mainwindow.h @@ -91,7 +91,7 @@ public slots: //开发工具 void s_development(); void s_ShowParameterCard(QString strSlfName, QString strName);//参数卡数据查看 - void s_ShowCurve(QString strSlfName, QString strName);//曲线数据查看 + void s_ShowCurve(QMap> mapShowObject);//曲线数据查看 void s_ShowTable(QString strSlfName, QString strName);//表格数据查看 void s_ShowWave(QString strSlfName, QString strName); //波列数据查看 void s_WelllogInformation(QString strSlfName);//编辑测井信息 diff --git a/logPlus/preqtablewidget.cpp b/logPlus/preqtablewidget.cpp index b27d323..bee6c2f 100644 --- a/logPlus/preqtablewidget.cpp +++ b/logPlus/preqtablewidget.cpp @@ -125,7 +125,71 @@ void PreQTableWidget::dropEvent(QDropEvent *event) //新建表格曲线 emit CallManage::getInstance()->sig_AddTableLine(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); } + else if(strType=="depthObject") + { + qDebug() << "新建深度"; + //新建曲线 + emit CallManage::getInstance()->sig_AddDepth(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="ganzhuangtuObject") + { + //新建杆状图 + emit CallManage::getInstance()->sig_AddGanZhuangTu(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="JyktObject") + { + //新建井眼垮塌矢量图 + emit CallManage::getInstance()->sig_AddJykt(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="DenvObject") + { + //新建井斜方位图 + emit CallManage::getInstance()->sig_AddDenv(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="DrawImageObject") + { + //图像 成图 + emit CallManage::getInstance()->sig_AddDrawImage(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="SantuyibiaoObject") + { + //斜井三图一表 + emit CallManage::getInstance()->sig_AddSantuyibiao(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="CrackObject") + { + //裂缝 + emit CallManage::getInstance()->sig_AddCrack(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="JiegutextObject") + { + //删除表格 +// emit CallManage::getInstance()->sig_delTableLine(m_strUuid, strWellName, strTrackName, strLineName); + //气测/FMT/射孔/文本 + emit CallManage::getInstance()->sig_AddJiegutext(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="LogfaceObject") + { + //删除表格 +// emit CallManage::getInstance()->sig_delTableLine(m_strUuid, strWellName, strTrackName, strLineName); + + //沉积相 + emit CallManage::getInstance()->sig_AddLogface(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="MCalsObject") + { + //多臂井径 + emit CallManage::getInstance()->sig_AddMCals(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="TubingstringObject") + { + //删除表格 +// emit CallManage::getInstance()->sig_delTableLine(m_strUuid, strWellName, strTrackName, strLineName); + + //套管组件 + emit CallManage::getInstance()->sig_AddTubingstring(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } // //m_listLineName.push_back(strLineName); @@ -190,7 +254,62 @@ void PreQTableWidget::dropEvent(QDropEvent *event) //新建表格曲线 emit CallManage::getInstance()->sig_AddTableLine(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); } - + else if(strType=="depthObject") + { + qDebug() << "新建深度"; + //新建曲线 + emit CallManage::getInstance()->sig_AddDepth(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="ganzhuangtuObject") + { + //新建杆状图 + emit CallManage::getInstance()->sig_AddGanZhuangTu(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="JyktObject") + { + //新建井眼垮塌矢量图 + emit CallManage::getInstance()->sig_AddJykt(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="DenvObject") + { + //新建井斜方位图 + emit CallManage::getInstance()->sig_AddDenv(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="DrawImageObject") + { + //图像 成图 + emit CallManage::getInstance()->sig_AddDrawImage(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="SantuyibiaoObject") + { + //斜井三图一表 + emit CallManage::getInstance()->sig_AddSantuyibiao(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="CrackObject") + { + //裂缝 + emit CallManage::getInstance()->sig_AddCrack(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="JiegutextObject") + { + //气测/FMT/射孔/文本 + emit CallManage::getInstance()->sig_AddJiegutext(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="LogfaceObject") + { + //沉积相 + emit CallManage::getInstance()->sig_AddLogface(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="MCalsObject") + { + //多臂井径 + emit CallManage::getInstance()->sig_AddMCals(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + else if(strType=="TubingstringObject") + { + //套管组件 + emit CallManage::getInstance()->sig_AddTubingstring(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } // //m_listLineName.push_back(strLineName); @@ -237,9 +356,10 @@ void PreQTableWidget::performDrag() // 执行拖拽操作 m_AddSuc = false; Qt::DropAction dropAction = drag->exec(Qt::MoveAction); - if (dropAction == Qt::MoveAction) { //&& m_AddSuc + if (dropAction == Qt::MoveAction) + { // 处理拖拽结束的逻辑,例如从界面上移除拖拽的项 - removeRow(iCurrentRow); +// removeRow(iCurrentRow); if(strType=="curveObject") { //删除曲线 @@ -252,12 +372,67 @@ void PreQTableWidget::performDrag() } else if(strType=="tableObject") { - //删除波列 + //删除表格 emit CallManage::getInstance()->sig_delTableLine(m_strUuid, formInfo->m_strWellName, formInfo->m_strTrackName, formInfo->m_strLineName); } + else if(strType=="depthObject") + { + //深度 - // - //m_listLineName.removeOne(formInfo->m_strLineName); + } + else if(strType=="ganzhuangtuObject") + { + //杆状图 + + } + else if(strType=="JyktObject") + { + //井眼垮塌矢量图 + + } + else if(strType=="DenvObject") + { + //井斜方位图 + + } + else if(strType=="DrawImageObject") + { + //图像 成图 + + } + else if(strType=="SantuyibiaoObject") + { + //斜井三图一表 + + } + else if(strType=="CrackObject") + { + //裂缝 + + } + else if(strType=="JiegutextObject") + { + //气测/FMT/射孔/文本 + //删除表格 + emit CallManage::getInstance()->sig_delTableLine(m_strUuid, formInfo->m_strWellName, formInfo->m_strTrackName, formInfo->m_strLineName); + } + else if(strType=="LogfaceObject") + { + //沉积相 + //删除表格 + emit CallManage::getInstance()->sig_delTableLine(m_strUuid, formInfo->m_strWellName, formInfo->m_strTrackName, formInfo->m_strLineName); + } + else if(strType=="MCalsObject") + { + //多臂井径 + + } + else if(strType=="TubingstringObject") + { + //套管组件 + //删除表格 + emit CallManage::getInstance()->sig_delTableLine(m_strUuid, formInfo->m_strWellName, formInfo->m_strTrackName, formInfo->m_strLineName); + } } } } diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index fd6f4f2..e759253 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -4222,6 +4222,18 @@ void QMyCustomPlot::ClearSelectItems() pGroup->setSelectRect(false); } } + else if (m_strLineName == "CORE_PHYSICS") + { + if(m_SelectShiftLine) + { + TransparentDraggableCorePhysics *tdCorePhysics = (TransparentDraggableCorePhysics*)this->m_SelectShiftLine; + QPen pen = tdCorePhysics->qcpItemLine->pen(); + pen.setColor(tdCorePhysics->getCpLineColor()); + tdCorePhysics->qcpItemLine->setPen(pen); + this->replot(); + m_SelectShiftLine = nullptr; + } + } //属性清空 PropertyService()->InitCurrentViewInfo(); } @@ -5070,7 +5082,7 @@ void QMyCustomPlot::s_changeDepthProperty(QVariantList vlist) switch(temp) { case 0: - // 偏左 + // 靠左 this->yAxis->setTickLabelPadding(5); break; case 1: diff --git a/logPlus/qtprojectwidgets.cpp b/logPlus/qtprojectwidgets.cpp index a176eb6..7154663 100644 --- a/logPlus/qtprojectwidgets.cpp +++ b/logPlus/qtprojectwidgets.cpp @@ -63,7 +63,7 @@ QtProjectWidgets::QtProjectWidgets(QWidget *parent) // 设置选择模式为多选模式 ui->treeWidget->setSelectionMode(QAbstractItemView::ExtendedSelection); // 或者使用 QAbstractItemView::MultiSelection - + m_ReFlag = 0; } QtProjectWidgets::~QtProjectWidgets() @@ -76,6 +76,19 @@ QString QtProjectWidgets::getLeftTreeString() return ui->treeWidget->getCurrentItemString(); } +void QtProjectWidgets::slotButtonCancel() +{ + m_ReFlag=QDialogButtonBox::StandardButton::Cancel; +} +void QtProjectWidgets::slotButtonOk() +{ + m_ReFlag=QDialogButtonBox::StandardButton::Yes; +} +void QtProjectWidgets::slotButtonNo() +{ + m_ReFlag=QDialogButtonBox::StandardButton::No; +} + ////初始化树图控件 //void QtProjectWidgets::initTreeWidget(QString fullPath, QString strProjectName) //{ @@ -937,7 +950,28 @@ void QtProjectWidgets::onShowParameterCard(bool checked) //曲线数据查看 void QtProjectWidgets::onShowCurve(bool checked) { - emit CallManage::getInstance()->sig_ShowCurve(m_strSlfName, m_strCurveObjectName); + m_mapShowObject.clear(); + foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems()) + { + QTreeWidgetItem *parentItem = pItem->parent()->parent(); // 上两层目录是井次 + if (parentItem) + { + QString strSlfName = parentItem->data(0, Qt::UserRole+1).toString(); + if (strSlfName.contains(".slf")) + { + QString strObjectName = pItem->text(0); + if(!m_mapShowObject.contains(strSlfName)) + { + QList selList; + selList.clear(); + m_mapShowObject.insert(strSlfName,selList); + } + m_mapShowObject[strSlfName].append(strObjectName); + } + } + } + if(m_mapShowObject.size()>0) + emit CallManage::getInstance()->sig_ShowCurve(m_mapShowObject); } //深度移动 @@ -1160,41 +1194,169 @@ void QtProjectWidgets::onDeleteObject() void QtProjectWidgets::onCopySelObject() // 复制 { - m_strCopySlfName = m_strSlfName; // 当前复制的对象Slf文件 - m_strCopyCurveObjectName = m_strCurveObjectName; // 当前复制的对象名 + m_mapCopyObject.clear(); + foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems()) + { + QTreeWidgetItem *parentItem = pItem->parent()->parent(); // 上两层目录是井次 + if (parentItem) + { + QString strSlfName = parentItem->data(0, Qt::UserRole+1).toString(); + if (strSlfName.contains(".slf")) + { + QString strObjectName = pItem->text(0); + if(!m_mapCopyObject.contains(strSlfName)) + { + QList selList; + selList.clear(); + m_mapCopyObject.insert(strSlfName,selList); + } + m_mapCopyObject[strSlfName].append(strObjectName); + } + } + } + } void QtProjectWidgets::onPasteSelObject() // 粘贴 { - if (m_strCopySlfName == m_strSlfName) + int flag=0; + int check=0; + m_ReFlag=0; + QList listCopySlfName = m_mapCopyObject.keys(); + for(int i= 0; i < listCopySlfName.size(); i++) { - CLogIO *logio=new CLogIO; - if(!logio->Open(m_strSlfName.toStdString().c_str(),CLogIO::modeReadWrite)) { - delete logio; - return; - } - char buf[1000]; - int i=1; - while(1) { - sprintf(buf,"%s_%d",m_strCopyCurveObjectName.toLocal8Bit().data(),i++); - if (0>logio->FindObjectName(buf)) - break; - } - logio->CopyObject(m_strCopyCurveObjectName.toLocal8Bit().data(), buf); - logio->Close(); - delete logio; - - foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems()) + QString strCopySlfName = listCopySlfName.at(i); + QList listObjectName = m_mapCopyObject[listCopySlfName.at(i)]; + if (strCopySlfName == m_strSlfName) { - QTreeWidgetItem *parentItem = pItem/*->parent()*/; // 上一层目录是井次 - if (parentItem && m_strSlfName == parentItem->data(0, Qt::UserRole+1).toString()) - RefreshWellRoundTree(parentItem); - parentItem = parentItem = pItem->parent(); - if (parentItem && m_strSlfName == parentItem->data(0, Qt::UserRole+1).toString()) - RefreshWellRoundTree(parentItem); - break; + CLogIO *logio=new CLogIO; + if(!logio->Open(m_strSlfName.toStdString().c_str(),CLogIO::modeReadWrite)) { + delete logio; + return; + } + for(int j= 0; j < listObjectName.size(); j++) + { + char buf[1000]; + int nindex=1; + while(1) { + sprintf(buf,"%s_%d",listObjectName.at(j).toLocal8Bit().data(),nindex++); + if (0>logio->FindObjectName(buf)) + break; + } + logio->CopyObject(listObjectName.at(j).toLocal8Bit().data(), buf); + } + logio->Close(); + delete logio; } - return; + else + { + for(int j= 0; j < listObjectName.size(); j++) + { + bool bExistence = false; + CLogIO *logio=new CLogIO; + if(!logio->Open(m_strSlfName.toStdString().c_str(),CLogIO::modeReadWrite)) { + delete logio; + return; + } + if (logio->FindObjectName(listObjectName.at(j).toLocal8Bit().data())>=0) + bExistence = true; + logio->Close(); + delete logio; + + if((!flag||!check)&&bExistence) + { + QDialog dialog(NULL); + Qt::WindowFlags flags = dialog.windowFlags(); + flags |= Qt::WindowStaysOnTopHint; + flags &= ~Qt::WindowContextHelpButtonHint; + dialog.setWindowTitle("提示"); + QString mess="已存在!\n 该功能只具覆盖或另创建能力,无法完成拼接操作。\n如需要进行拼接,请在图形区可视化编辑状态完成。\n请选择操作模式:\n"; + QFormLayout form(&dialog); + form.addRow(new QLabel(listObjectName.at(j)+mess)); + QCheckBox *pCheckBox=new QCheckBox("均按下列操作",&dialog); + form.addRow(pCheckBox); + QDialogButtonBox buttonBox(QDialogButtonBox::Yes |QDialogButtonBox::No | QDialogButtonBox::Cancel, + Qt::Horizontal, &dialog); + form.addRow(&buttonBox); + + buttonBox.button(QDialogButtonBox::Yes)->setText(QString("覆盖")); + buttonBox.button(QDialogButtonBox::No)->setText(QString("增加")); + buttonBox.button(QDialogButtonBox::Cancel)->setText(QString("放弃")); + form.addRow(&buttonBox); + QObject::connect(buttonBox.button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(slotButtonCancel())); + QObject::connect(buttonBox.button(QDialogButtonBox::Yes), SIGNAL(clicked()), this, SLOT(slotButtonOk())); + QObject::connect(buttonBox.button(QDialogButtonBox::No), SIGNAL(clicked()), this, SLOT(slotButtonNo())); + QObject::connect(&buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept())); + QObject::connect(&buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject())); + dialog.exec(); + flag=m_ReFlag; + check=pCheckBox->checkState(); + } + if (flag==QDialogButtonBox::Cancel) + { + QMessageBox::information(NULL,"Cancel","Cancel"); + continue; + } + else if (flag==QDialogButtonBox::Yes) + { + CLogIO *logio=new CLogIO; + if(!logio->Open(m_strSlfName.toStdString().c_str(),CLogIO::modeReadWrite)) { + delete logio; + return; + } + logio->DeleteObject(listObjectName.at(j).toLocal8Bit().data()); + logio->Close(); + delete logio; + + CObjWellLog* pcopyingwelllog= new CObjWellLog(); + pcopyingwelllog->SetSlfFileName(strCopySlfName); + pcopyingwelllog->SetName(listObjectName.at(j)); + pcopyingwelllog->CopyToSLFFile(m_strSlfName); + delete pcopyingwelllog; + } + else if (flag==QDialogButtonBox::No && bExistence) + { + CLogIO *logio=new CLogIO; + if(!logio->Open(m_strSlfName.toStdString().c_str(),CLogIO::modeReadWrite)) { + delete logio; + return; + } + char buf[1000]; + int nindex=1; + while(1) { + sprintf(buf,"%s_%d",listObjectName.at(j).toLocal8Bit().data(),nindex++); + if (0>logio->FindObjectName(buf)) + break; + } + logio->Close(); + delete logio; + + CObjWellLog* pcopyingwelllog= new CObjWellLog(); + pcopyingwelllog->SetSlfFileName(strCopySlfName); + pcopyingwelllog->SetName(listObjectName.at(j)); + pcopyingwelllog->CopyToSLFFile(m_strSlfName,false,buf); + delete pcopyingwelllog; + } + else if (!bExistence) + { + CObjWellLog* pcopyingwelllog= new CObjWellLog(); + pcopyingwelllog->SetSlfFileName(strCopySlfName); + pcopyingwelllog->SetName(listObjectName.at(j)); + pcopyingwelllog->CopyToSLFFile(m_strSlfName); + delete pcopyingwelllog; + } + } + } + } + foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems()) + { + QTreeWidgetItem *parentItem = pItem/*->parent()*/; // 上一层目录是井次 + if (parentItem && m_strSlfName == parentItem->data(0, Qt::UserRole+1).toString()) + RefreshWellRoundTree(parentItem); + parentItem = parentItem = pItem->parent(); + if (parentItem && m_strSlfName == parentItem->data(0, Qt::UserRole+1).toString()) + RefreshWellRoundTree(parentItem); + break; } } @@ -1489,11 +1651,11 @@ void QtProjectWidgets::onItemClicked(QTreeWidgetItem* item, int index) m_strSlfName = item->parent()->data(0, Qt::UserRole+1).toString();//从父节点(井次)获取slf } - if (m_strCopySlfName != m_strSlfName) + if (m_mapCopyObject.size()==0) m_action_Paste->setVisible(false); else m_action_Paste->setVisible(true); - // + if (qApp->mouseButtons() == Qt::RightButton) // 只针对鼠标右键,弹出菜单 { if (NULL == popMenu) diff --git a/logPlus/qtprojectwidgets.h b/logPlus/qtprojectwidgets.h index 7ca3038..cf69b35 100644 --- a/logPlus/qtprojectwidgets.h +++ b/logPlus/qtprojectwidgets.h @@ -24,6 +24,9 @@ private: Ui::QtProjectWidgetsClass *ui; public slots: + void slotButtonOk(); + void slotButtonNo(); + void slotButtonCancel(); //void s_initTreeWidget(QString strName);//初始化树图控件 void s_loadTreeWidget(QString fileFull);//加载树图 @@ -85,7 +88,7 @@ public: QMenu *_menuParCardFolder; //参数卡目录 QMenu *_menuWaveFolder; //波列目录 - QAction* m_action_Paste; //黏贴 + QAction* m_action_Paste; //粘贴 //根节点(项目名称)-右键菜单 QAction* m_action_New; QAction* m_action_Open; @@ -99,8 +102,9 @@ public: QString m_strSlfName; QString m_strCurveObjectName; - QString m_strCopySlfName; // 当前复制的对象Slf文件 - QString m_strCopyCurveObjectName; // 当前复制的对象名 + QMap> m_mapShowObject;// 显示Slf文件里对象名 + QMap> m_mapCopyObject;// 复制Slf文件里对象名 + int m_ReFlag; public: void loadIndexSysTree(QTreeWidgetItem *parent, QString fileFull, QString prjname);