# Conflicts:
#	logPlus/forminfo.cpp
#	logPlus/forminfo.h
This commit is contained in:
DESKTOP-450PEFP\mainc 2026-02-13 23:00:22 +08:00
commit 8ef9a84e8f
7 changed files with 174 additions and 7 deletions

View File

@ -78,6 +78,8 @@ void PropertyWidget::InitCurrentViewInfo(bool bAll)
m_formHead = NULL;
m_tableWidget = NULL;
m_item = NULL;
m_tdGujing = NULL;
//
m_strUuid = "";
m_strSlfName = "";
m_strWellName = "";
@ -198,6 +200,64 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
}
return;
}
else if (m_strCurrentProperty == Table_Property)
{
if("显示名称" == m_propertyData[pProperty])
{
QString newAliasName = variant.value<QString>();
m_formInfo->m_strAliasName = newAliasName;
m_formInfo->update();
}
else if("字体" == m_propertyData[pProperty])
{
//字体
// 假设variant已经被设置为包含QColor
QFont newFont = variant.value<QFont>();
m_formInfo->m_curveNameFont = newFont;
m_formInfo->update();
}
else if("颜色" == m_propertyData[pProperty])
{
QColor newColor = variant.value<QColor>();
m_formInfo->m_lineColor = newColor;
m_formInfo->update();
}
}
else if (m_strCurrentProperty == GujingItem_Property)
{
//固井结论item
if("顶深(m)" == m_propertyData[pProperty])
{
//qDebug() << "顶深(m)->改变";
if(m_tdGujing)
{
double upper = variant.value<double>();
m_tdGujing->setUpper(-upper);
}
}
else if("底深(m)" == m_propertyData[pProperty])
{
//qDebug() << "底深(m)->改变";
if(m_tdGujing)
{
double lower = variant.value<double>();
m_tdGujing->setLower(-lower);
}
}
else if("固井结论" == m_propertyData[pProperty])
{
//qDebug() << "固井结论->改变";
if(m_tdGujing)
{
QString newResult = variant.value<QString>();
m_tdGujing->setResult(newResult);
//
QCPRange currentRange = m_tdGujing->getRange();
m_tdGujing->setRange(currentRange.lower, currentRange.upper);
}
}
}
if("深度比例尺" == m_propertyData[pProperty])
{
//qDebug() << "深度比例尺->改变";
@ -1270,6 +1330,16 @@ void PropertyWidget::initProperty(FormInfo *formInfo)
else if (formInfo->m_strType == "waveObject")
{
this->initWaveProperty(formInfo, formInfo->m_nDrawType);
}
else if (formInfo->m_strType == "tableObject")
{
if (m_strLineName == "GUJING1_RESULT" || m_strLineName == "GUJING2_RESULT" || m_strLineName == "GUJING3_RESULT")
{
//固井结论
this->initGujingProperty(formInfo);
}
}
}
@ -1390,3 +1460,28 @@ void PropertyWidget::initWaveProperty(FormInfo *formInfo, int nType)
m_strCurrentProperty = Wave_Property;
}
void PropertyWidget::initGujingProperty(FormInfo *formInfo)
{
_CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String);
_CreateVariantPropertyItem("对象", "显示名称", formInfo->m_strAliasName, QVariant::String);
_CreateVariantPropertyItem("对象", "字体", formInfo->m_curveNameFont, QVariant::Font);
_CreateVariantPropertyItem("对象", "颜色", formInfo->m_lineColor, QVariant::Color);
m_strCurrentProperty = Table_Property;
}
void PropertyWidget::initGujingItemProperty(TransparentDraggableGujing* tdGujing, double lower, double upper, QString strResult)
{
//初始化,清空
InitCurrentViewInfo();
//当前属性类型
m_strCurrentProperty = GujingItem_Property;
m_tdGujing = tdGujing;
//
_CreateVariantPropertyItem("当前项", "顶深(m)", -upper, QVariant::Double);
_CreateVariantPropertyItem("当前项", "底深(m)", -lower, QVariant::Double);
_CreateVariantPropertyItem("当前项", "固井结论", strResult, VariantManager::filePathTypeId());
}

View File

@ -20,6 +20,7 @@
#include "formhead.h"
#include "qmytablewidget.h"
#include "formtracktop.h"
#include "TransparentDraggableGujing.h"
//当前曲线类型
#define Widget_Property "Widget_Property"
@ -27,7 +28,9 @@
#define Track_Property "Track_Property" //道
#define Curve_Property "Curve_Property" //曲线
#define Wave_Property "Wave_Property" //波列
#define Table_Property "Table_Property" //表格曲线
#define Head_Property "Head_Property" //图头,单元格
#define GujingItem_Property "GujingItem_Property" //固井item
#define Table_Property "Table_Property" //解释结论
@ -93,6 +96,10 @@ public:
int m_iCurrentCol;
bool m_bSelfChange=false;
//
TransparentDraggableGujing* m_tdGujing;
public:
QWidget* GetPropertyWidget();
@ -122,6 +129,9 @@ public:
void initRoseProperty(FormInfo *formInfo);
// 波列属性
void initWaveProperty(FormInfo *formInfo, int nType = 3);
// 固井结论属性
void initGujingProperty(FormInfo *formInfo);
void initGujingItemProperty(TransparentDraggableGujing* tdGujing, double lower, double upper, QString strResult);
void ChangFillProperty();//填充属性改变

View File

@ -1,4 +1,6 @@
#include "TransparentDraggableGujing.h"
#include "PropertyWidget.h"
#include "CallManage.h"
extern double g_dPixelPerCm;//每厘米像素数
//static GeoIndicatorGenerator m_drawGeo;
@ -311,6 +313,48 @@ void TransparentDraggableGujing::onDelRect()
deleteRect();
}
//设置顶深
void TransparentDraggableGujing::setUpper(double upper)
{
QCPRange currentRange = getRange();
QCPRange newRange = currentRange;
double proposedRight = upper;
// 确保不超出轴范围且不使宽度小于最小值
newRange.upper = qBound(
currentRange.lower + mMinWidth,
proposedRight,
getMyUpper());
// 最终确保宽度不小于最小值(针对整体拖动的情况)
if(newRange.size() < mMinWidth) {
newRange.upper = newRange.lower + mMinWidth;
}
setRange(newRange.lower, newRange.upper);
}
//设置底深
void TransparentDraggableGujing::setLower(double lower)
{
QCPRange currentRange = getRange();
QCPRange newRange = currentRange;
double proposedLeft = lower;
// 确保不超出轴范围且不使宽度小于最小值
newRange.lower = qBound(
getMyLower(),
proposedLeft,
currentRange.upper - mMinWidth);
// 最终确保宽度不小于最小值(针对整体拖动的情况)
if(newRange.size() < mMinWidth) {
// 如果是边界拖动,强制设置最小宽度
newRange.lower = newRange.upper - mMinWidth;
}
setRange(newRange.lower, newRange.upper);
}
void TransparentDraggableGujing::onMousePress(QMouseEvent *event)
{
@ -486,6 +530,16 @@ void TransparentDraggableGujing::onMouseRelease(QMouseEvent *event)
{
if(event->button() == Qt::LeftButton && mDragMode != DragNone) {
event->accept();
//属性
//if(mDragMode == DragRect)
{
double low = mRect->topLeft->coords().x();
double hight = mRect->bottomRight->coords().x();
PropertyService()->initGujingItemProperty(this, low, hight, m_Result);
//取消所有选中单元格
emit CallManage::getInstance()->sig_Raise(mPlot->m_strUuid, "", "", "", "", 1, "");
}
//避免二次绘制框图
mPlot->m_bDrawRect = false;
//emit rangeChanged(getRange());
@ -499,6 +553,7 @@ void TransparentDraggableGujing::onMouseRelease(QMouseEvent *event)
mPlot->selectionRect()->cancel();
mPlot->replot();
mPlot->selectionRect()->mActive=true;
}
}

View File

@ -45,6 +45,11 @@ public:
// 删除框图
void deleteRect();
//设置顶深
void setUpper(double upper);
//设置底深
void setLower(double lower);
signals:
void rangeChanged(QCPRange newRange);
@ -80,6 +85,7 @@ private:
// 添加最小宽度成员变量
double mMinWidth;
};
#endif // TRANSPARENTDRAGGABLEGUJING_H

View File

@ -4021,7 +4021,7 @@ void FormDraw::initGujing(QMyCustomPlot *widget, QString strSlfName, QString str
//
LoadFromSLF_Gujing(widget, strSlfName, strLineName);
QString strAliasName = "";
QString strAliasName = "固井结论";
QString strUnit = "";
QColor newlineColor=QColor(0,0,0);
double width=2;
@ -4075,7 +4075,7 @@ bool FormDraw::LoadFromSLF_Gujing(QMyCustomPlot *widget, QString strSlfName, QSt
int NO = m_Result->NO;
float SDEP = m_Result->SDEP;
float EDEP = m_Result->EDEP;
int RESULT = m_Result->RESULT;
int iRESULT = m_Result->RESULT;
QString result = "";
//

View File

@ -389,7 +389,7 @@ void FormInfo::paintEvent(QPaintEvent* event)
else if(m_strLineName == "GUJING1_RESULT" || m_strLineName == "GUJING2_RESULT" || m_strLineName == "GUJING3_RESULT")
{
//固井结论,不绘制左右范围
painter.drawText(rect.left(), rect.top()+rect.height()/3, rect.width(), rect.height()/3 ,Qt::AlignCenter, "固井结论");
//painter.drawText(rect.left(), rect.top()+rect.height()/3, rect.width(), rect.height()/3 ,Qt::AlignCenter, "固井结论");
}
else if(m_strLineName=="CORE_PHYSICS")
{
@ -412,7 +412,7 @@ void FormInfo::paintEvent(QPaintEvent* event)
if(m_strType=="tableObject" && (m_strLineName=="WORDS_RELUST" || m_strLineName == "RESULT"
|| m_strLineName == "GEO_LITH"|| m_strLineName == "SWALL_CORE"
|| m_strLineName == "GUJING1_RESULT" || m_strLineName == "GUJING2_RESULT" || m_strLineName == "GUJING3_RESULT"
|| m_strLineName == "CORE_PHYSICS") )
|| m_strLineName == "CORE_PHYSICS" || m_strLineName == "IMAGE_DATA") )
{
}

View File

@ -125,6 +125,7 @@ public:
QFont m_layerFont; // 层号字体
float m_fLayerRotate = 0.0f; // 层号旋转
public:
void setLineWidth(double dWidth);
double getLineWidth();