解释结论ITEM属性开发
垂向绘制, 旋转角度(°)效果实现。
This commit is contained in:
parent
00d29515ed
commit
a6a5d707b0
|
|
@ -25,6 +25,8 @@
|
||||||
#include "TransparentDraggableGeoLith.h"
|
#include "TransparentDraggableGeoLith.h"
|
||||||
#include "TransparentDraggableRect.h"
|
#include "TransparentDraggableRect.h"
|
||||||
|
|
||||||
|
#include "TransparentGroupResult.h"
|
||||||
|
|
||||||
//当前曲线类型
|
//当前曲线类型
|
||||||
#define Widget_Property "Widget_Property"
|
#define Widget_Property "Widget_Property"
|
||||||
#define Well_Property "Well_Property" //井
|
#define Well_Property "Well_Property" //井
|
||||||
|
|
@ -32,6 +34,8 @@
|
||||||
#define Curve_Property "Curve_Property" //曲线
|
#define Curve_Property "Curve_Property" //曲线
|
||||||
#define Wave_Property "Wave_Property" //波列
|
#define Wave_Property "Wave_Property" //波列
|
||||||
#define Table_Property "Table_Property" //解释结论
|
#define Table_Property "Table_Property" //解释结论
|
||||||
|
#define JieshiItem_Property "JieshiItem_Property" //解释结论Item
|
||||||
|
|
||||||
#define Head_Property "Head_Property" //图头,单元格
|
#define Head_Property "Head_Property" //图头,单元格
|
||||||
|
|
||||||
#define Gujing_Property "Gujing_Property" //固井结论
|
#define Gujing_Property "Gujing_Property" //固井结论
|
||||||
|
|
@ -110,6 +114,7 @@ public:
|
||||||
|
|
||||||
bool m_bSelfChange=false;
|
bool m_bSelfChange=false;
|
||||||
|
|
||||||
|
TransparentGroupResult* m_tdJieshi;
|
||||||
//
|
//
|
||||||
TransparentDraggableGujing* m_tdGujing;
|
TransparentDraggableGujing* m_tdGujing;
|
||||||
TransparentDraggableSwallCore* m_tdSwallCore;
|
TransparentDraggableSwallCore* m_tdSwallCore;
|
||||||
|
|
@ -146,6 +151,9 @@ public:
|
||||||
// 波列属性
|
// 波列属性
|
||||||
void initWaveProperty(FormInfo *formInfo, int nType = 3);
|
void initWaveProperty(FormInfo *formInfo, int nType = 3);
|
||||||
|
|
||||||
|
// 解释结论Item属性
|
||||||
|
void initJieshiItemProperty(TransparentGroupResult* tdJieshi, double lower, double upper, QString strResult);
|
||||||
|
|
||||||
// 固井结论属性
|
// 固井结论属性
|
||||||
void initGujingProperty(FormInfo *formInfo);
|
void initGujingProperty(FormInfo *formInfo);
|
||||||
void initGujingItemProperty(TransparentDraggableGujing* tdGujing, double lower, double upper, QString strResult);
|
void initGujingItemProperty(TransparentDraggableGujing* tdGujing, double lower, double upper, QString strResult);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
#include "TransparentGroupResult.h"
|
#include "TransparentGroupResult.h"
|
||||||
#include "TransparentDraggableResult.h"
|
#include "TransparentDraggableResult.h"
|
||||||
|
#include "PropertyWidget.h"
|
||||||
|
|
||||||
extern double g_dPixelPerCm;//每厘米像素数
|
extern double g_dPixelPerCm;//每厘米像素数
|
||||||
|
|
||||||
TransparentGroupResult::TransparentGroupResult(QMyCustomPlot *parentPlot, TransparentGroupResult *upDraggableResult, QString strUuid, double minWidth, QString strTitle)
|
TransparentGroupResult::TransparentGroupResult(QMyCustomPlot *parentPlot, TransparentGroupResult *upDraggableResult, QString strUuid, double minWidth, QString strTitle)
|
||||||
|
|
@ -62,6 +64,11 @@ void TransparentGroupResult::setTitle(QString strTitle)
|
||||||
//mPlot->replot();
|
//mPlot->replot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString TransparentGroupResult::getTitle()
|
||||||
|
{
|
||||||
|
return mstrTitle;
|
||||||
|
}
|
||||||
|
|
||||||
//设置解释结论
|
//设置解释结论
|
||||||
void TransparentGroupResult::setResult(QString filePath)
|
void TransparentGroupResult::setResult(QString filePath)
|
||||||
{
|
{
|
||||||
|
|
@ -138,6 +145,7 @@ void TransparentGroupResult::setGroupShowPos(int nSPos)
|
||||||
|
|
||||||
void TransparentGroupResult::setFloorVisible(bool bs)
|
void TransparentGroupResult::setFloorVisible(bool bs)
|
||||||
{
|
{
|
||||||
|
mItemTitle->setRotation(90);
|
||||||
mItemTitle->setVisible(bs);
|
mItemTitle->setVisible(bs);
|
||||||
mPlot->replot();
|
mPlot->replot();
|
||||||
}
|
}
|
||||||
|
|
@ -148,6 +156,122 @@ void TransparentGroupResult::setFloorFont(QFont f)
|
||||||
mPlot->replot();
|
mPlot->replot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TransparentGroupResult::setFloorRot(double dr)
|
||||||
|
{
|
||||||
|
mItemTitle->setRotation(dr);
|
||||||
|
mPlot->replot();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TransparentGroupResult::setDragRect(int dMode, double dragVal)
|
||||||
|
{
|
||||||
|
QCPRange mDragStartRange = getRange();
|
||||||
|
QCPRange newRange = mDragStartRange;
|
||||||
|
|
||||||
|
switch (dMode) {
|
||||||
|
case DragLeft: {
|
||||||
|
//double proposedLeft = mDragStartRange.lower + dx;
|
||||||
|
double proposedLeft = dragVal;
|
||||||
|
// 确保不超出轴范围且不使宽度小于最小值
|
||||||
|
newRange.lower = qBound(
|
||||||
|
//mPlot->xAxis->range().lower,
|
||||||
|
getMyLower(),
|
||||||
|
proposedLeft,
|
||||||
|
mDragStartRange.upper - mMinWidth);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DragRight: {
|
||||||
|
//double proposedRight = mDragStartRange.upper + dx;
|
||||||
|
double proposedRight = dragVal;
|
||||||
|
// 确保不超出轴范围且不使宽度小于最小值
|
||||||
|
newRange.upper = qBound(
|
||||||
|
mDragStartRange.lower + mMinWidth,
|
||||||
|
proposedRight,
|
||||||
|
getMyUpper());
|
||||||
|
//mPlot->xAxis->range().upper);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DragRect: {
|
||||||
|
double width = mDragStartRange.size();
|
||||||
|
//double center = mDragStartRange.center() + dx;
|
||||||
|
double center = mDragStartRange.center() + dragVal;
|
||||||
|
newRange.lower = center - width / 2;
|
||||||
|
newRange.upper = center + width / 2;
|
||||||
|
|
||||||
|
// 检查是否超出轴范围
|
||||||
|
if (newRange.lower < getMyLower()) {
|
||||||
|
newRange.lower = getMyLower();
|
||||||
|
newRange.upper = newRange.lower + width;
|
||||||
|
}
|
||||||
|
else if (newRange.upper > getMyUpper()) {
|
||||||
|
newRange.upper = getMyUpper();
|
||||||
|
newRange.lower = newRange.upper - width;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// 最终确保宽度不小于最小值(针对整体拖动的情况)
|
||||||
|
if (newRange.size() < mMinWidth) {
|
||||||
|
if (mDragMode == DragRect) {
|
||||||
|
// 如果是整体拖动,保持中心点不变
|
||||||
|
double center = newRange.center();
|
||||||
|
newRange.lower = center - mMinWidth / 2;
|
||||||
|
newRange.upper = center + mMinWidth / 2;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// 如果是边界拖动,强制设置最小宽度
|
||||||
|
if (mDragMode == DragLeft) {
|
||||||
|
newRange.lower = newRange.upper - mMinWidth;
|
||||||
|
}
|
||||||
|
else if (mDragMode == DragRight) {
|
||||||
|
newRange.upper = newRange.lower + mMinWidth;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setRange(newRange.lower, newRange.upper);
|
||||||
|
|
||||||
|
if (m_vecResult.size() == 1)
|
||||||
|
{
|
||||||
|
TransparentDraggableResult* pret = qobject_cast<TransparentDraggableResult*>(m_mapDraggable_Result.value(m_vecResult.at(0)));
|
||||||
|
if (pret)
|
||||||
|
{
|
||||||
|
pret->setRange(newRange.lower, newRange.upper);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (mDragMode == DragRect)
|
||||||
|
{
|
||||||
|
float offset = mDragStartRange.lower - getRange().lower;
|
||||||
|
for (int i = 0; i < m_vecResult.size(); i++)
|
||||||
|
{
|
||||||
|
TransparentDraggableResult* pret = qobject_cast<TransparentDraggableResult*>(m_mapDraggable_Result.value(m_vecResult.at(i)));
|
||||||
|
if (pret == NULL)
|
||||||
|
continue;
|
||||||
|
QCPRange rg = pret->getRange();
|
||||||
|
pret->setRange(rg.lower - offset, rg.upper - offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TransparentDraggableResult* pret = qobject_cast<TransparentDraggableResult*>(m_mapDraggable_Result.value(m_vecResult.at(0)));
|
||||||
|
if (pret)
|
||||||
|
{
|
||||||
|
pret->setRange(pret->getRange().lower, newRange.upper);
|
||||||
|
}
|
||||||
|
pret = qobject_cast<TransparentDraggableResult*>(m_mapDraggable_Result.value(m_vecResult.last()));
|
||||||
|
if (pret)
|
||||||
|
{
|
||||||
|
pret->setRange(newRange.lower, pret->getRange().upper);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mPlot->replot();
|
||||||
|
}
|
||||||
|
|
||||||
// 删除框图
|
// 删除框图
|
||||||
void TransparentGroupResult::deleteRect()
|
void TransparentGroupResult::deleteRect()
|
||||||
{
|
{
|
||||||
|
|
@ -453,7 +577,11 @@ void TransparentGroupResult::onMouseRelease(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(event->button() == Qt::LeftButton && mDragMode != DragNone) {
|
if(event->button() == Qt::LeftButton && mDragMode != DragNone) {
|
||||||
|
{
|
||||||
|
double low = mRect->topLeft->coords().x();
|
||||||
|
double hight = mRect->bottomRight->coords().x();
|
||||||
|
PropertyService()->initJieshiItemProperty(this, low, hight, m_Result);
|
||||||
|
}
|
||||||
if (mDragRect->visible())
|
if (mDragRect->visible())
|
||||||
{
|
{
|
||||||
double y = mPlot->xAxis->pixelToCoord(event->pos().y());
|
double y = mPlot->xAxis->pixelToCoord(event->pos().y());
|
||||||
|
|
@ -461,134 +589,49 @@ void TransparentGroupResult::onMouseRelease(QMouseEvent *event)
|
||||||
|
|
||||||
QCPRange newRange = mDragStartRange;
|
QCPRange newRange = mDragStartRange;
|
||||||
|
|
||||||
|
double dval = dy;
|
||||||
switch (mDragMode) {
|
switch (mDragMode) {
|
||||||
case DragLeft: {
|
case DragLeft: {
|
||||||
//double proposedLeft = mDragStartRange.lower + dx;
|
dval = mDragStartRange.lower + dy;
|
||||||
double proposedLeft = mDragStartRange.lower + dy;
|
|
||||||
// 确保不超出轴范围且不使宽度小于最小值
|
|
||||||
newRange.lower = qBound(
|
|
||||||
//mPlot->xAxis->range().lower,
|
|
||||||
getMyLower(),
|
|
||||||
proposedLeft,
|
|
||||||
mDragStartRange.upper - mMinWidth);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DragRight: {
|
case DragRight: {
|
||||||
//double proposedRight = mDragStartRange.upper + dx;
|
dval = mDragStartRange.upper + dy;
|
||||||
double proposedRight = mDragStartRange.upper + dy;
|
|
||||||
// 确保不超出轴范围且不使宽度小于最小值
|
|
||||||
newRange.upper = qBound(
|
|
||||||
mDragStartRange.lower + mMinWidth,
|
|
||||||
proposedRight,
|
|
||||||
getMyUpper());
|
|
||||||
//mPlot->xAxis->range().upper);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DragRect: {
|
case DragRect: {
|
||||||
double width = mDragStartRange.size();
|
|
||||||
//double center = mDragStartRange.center() + dx;
|
|
||||||
double center = mDragStartRange.center() + dy;
|
|
||||||
newRange.lower = center - width / 2;
|
|
||||||
newRange.upper = center + width / 2;
|
|
||||||
|
|
||||||
// 检查是否超出轴范围
|
|
||||||
if (newRange.lower < getMyLower()) {
|
|
||||||
newRange.lower = getMyLower();
|
|
||||||
newRange.upper = newRange.lower + width;
|
|
||||||
}
|
|
||||||
else if (newRange.upper > getMyUpper()) {
|
|
||||||
newRange.upper = getMyUpper();
|
|
||||||
newRange.lower = newRange.upper - width;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// 最终确保宽度不小于最小值(针对整体拖动的情况)
|
this->setDragRect(mDragMode, dval);
|
||||||
if (newRange.size() < mMinWidth) {
|
|
||||||
if (mDragMode == DragRect) {
|
|
||||||
// 如果是整体拖动,保持中心点不变
|
|
||||||
double center = newRange.center();
|
|
||||||
newRange.lower = center - mMinWidth / 2;
|
|
||||||
newRange.upper = center + mMinWidth / 2;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// 如果是边界拖动,强制设置最小宽度
|
|
||||||
if (mDragMode == DragLeft) {
|
|
||||||
newRange.lower = newRange.upper - mMinWidth;
|
|
||||||
}
|
|
||||||
else if (mDragMode == DragRight) {
|
|
||||||
newRange.upper = newRange.lower + mMinWidth;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mDragRect->setVisible(false);
|
mDragRect->setVisible(false);
|
||||||
mDragLine->setVisible(false);
|
mDragLine->setVisible(false);
|
||||||
setRange(newRange.lower, newRange.upper);
|
|
||||||
|
|
||||||
if (m_vecResult.size() == 1)
|
|
||||||
{
|
|
||||||
TransparentDraggableResult* pret = qobject_cast<TransparentDraggableResult*>(m_mapDraggable_Result.value(m_vecResult.at(0)));
|
|
||||||
if (pret)
|
|
||||||
{
|
|
||||||
pret->setRange(newRange.lower, newRange.upper);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (mDragMode == DragRect)
|
|
||||||
{
|
|
||||||
float offset = mDragStartRange.lower - getRange().lower;
|
|
||||||
for (int i = 0; i < m_vecResult.size(); i++)
|
|
||||||
{
|
|
||||||
TransparentDraggableResult* pret = qobject_cast<TransparentDraggableResult*>(m_mapDraggable_Result.value(m_vecResult.at(i)));
|
|
||||||
if (pret == NULL)
|
|
||||||
continue;
|
|
||||||
QCPRange rg = pret->getRange();
|
|
||||||
pret->setRange(rg.lower - offset, rg.upper - offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
TransparentDraggableResult* pret = qobject_cast<TransparentDraggableResult*>(m_mapDraggable_Result.value(m_vecResult.at(0)));
|
|
||||||
if (pret)
|
|
||||||
{
|
|
||||||
pret->setRange(pret->getRange().lower, newRange.upper);
|
|
||||||
}
|
|
||||||
pret = qobject_cast<TransparentDraggableResult*>(m_mapDraggable_Result.value(m_vecResult.last()));
|
|
||||||
if (pret)
|
|
||||||
{
|
|
||||||
pret->setRange(newRange.lower, pret->getRange().upper);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (mDragLine->visible())
|
else if (mDragLine->visible())
|
||||||
{
|
{
|
||||||
if (mDragMode == DragItem)
|
if (mDragMode == DragItem)
|
||||||
{
|
|
||||||
if (m_pDragResult)
|
|
||||||
{
|
{
|
||||||
double y = mPlot->xAxis->pixelToCoord(event->pos().y());
|
if (m_pDragResult)
|
||||||
double dy = y - mDragStartY;
|
|
||||||
|
|
||||||
QCPRange rg = m_pDragResult->getRange();
|
|
||||||
m_pDragResult->setRange(rg.lower, rg.upper + dy);
|
|
||||||
|
|
||||||
TransparentDraggableResult* upr = m_pDragResult->getUpResult();
|
|
||||||
if (upr)
|
|
||||||
{
|
{
|
||||||
QCPRange rg = upr->getRange();
|
double y = mPlot->xAxis->pixelToCoord(event->pos().y());
|
||||||
upr->setRange(rg.lower + dy, rg.upper);
|
double dy = y - mDragStartY;
|
||||||
|
|
||||||
|
QCPRange rg = m_pDragResult->getRange();
|
||||||
|
m_pDragResult->setRange(rg.lower, rg.upper + dy);
|
||||||
|
|
||||||
|
TransparentDraggableResult* upr = m_pDragResult->getUpResult();
|
||||||
|
if (upr)
|
||||||
|
{
|
||||||
|
QCPRange rg = upr->getRange();
|
||||||
|
upr->setRange(rg.lower + dy, rg.upper);
|
||||||
|
}
|
||||||
|
m_pDragResult = NULL;
|
||||||
}
|
}
|
||||||
m_pDragResult = NULL;
|
mDragLine->setVisible(false);
|
||||||
}
|
}
|
||||||
mDragLine->setVisible(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
mPlot->replot();
|
mPlot->replot();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,12 +19,15 @@ public:
|
||||||
|
|
||||||
~TransparentGroupResult();
|
~TransparentGroupResult();
|
||||||
|
|
||||||
|
enum DragMode { DragNone, DragLeft, DragRight, DragItem, DragRect };
|
||||||
|
|
||||||
void addResultToPlot(double left_Low, double right_Hight, QString myResult, QString &strUuid);
|
void addResultToPlot(double left_Low, double right_Hight, QString myResult, QString &strUuid);
|
||||||
|
|
||||||
//设置最小宽度
|
//设置最小宽度
|
||||||
void setMinWidth(double minWidth);
|
void setMinWidth(double minWidth);
|
||||||
//设置标题
|
//设置标题
|
||||||
void setTitle(QString strTitle);
|
void setTitle(QString strTitle);
|
||||||
|
QString getTitle();
|
||||||
|
|
||||||
//设置解释结论
|
//设置解释结论
|
||||||
void setResult(QString filePath);
|
void setResult(QString filePath);
|
||||||
|
|
@ -40,8 +43,15 @@ public:
|
||||||
void setGroupConclusionProportion(int nCopr);
|
void setGroupConclusionProportion(int nCopr);
|
||||||
// 设置显示位置
|
// 设置显示位置
|
||||||
void setGroupShowPos(int nSPos);
|
void setGroupShowPos(int nSPos);
|
||||||
|
// 设置层号显示
|
||||||
void setFloorVisible(bool bs);
|
void setFloorVisible(bool bs);
|
||||||
|
// 设置层号字体
|
||||||
void setFloorFont(QFont f);
|
void setFloorFont(QFont f);
|
||||||
|
// 设置层号旋转
|
||||||
|
void setFloorRot(double dr);
|
||||||
|
|
||||||
|
//设置顶深, 底深
|
||||||
|
void setDragRect(int dMode, double dragVal);
|
||||||
|
|
||||||
// 删除框图
|
// 删除框图
|
||||||
void deleteRect();
|
void deleteRect();
|
||||||
|
|
@ -86,7 +96,6 @@ private:
|
||||||
|
|
||||||
QString m_Result;
|
QString m_Result;
|
||||||
|
|
||||||
enum DragMode { DragNone, DragLeft, DragRight, DragItem, DragRect };
|
|
||||||
DragMode mDragMode = DragNone;
|
DragMode mDragMode = DragNone;
|
||||||
//double mDragStartX = 0;
|
//double mDragStartX = 0;
|
||||||
double mDragStartY = 0;
|
double mDragStartY = 0;
|
||||||
|
|
|
||||||
|
|
@ -284,7 +284,7 @@ void FormInfo::paintEvent(QPaintEvent* event)
|
||||||
//painter.drawText(rect, Qt::AlignCenter, m_strAliasName);
|
//painter.drawText(rect, Qt::AlignCenter, m_strAliasName);
|
||||||
if(m_strAliasName == "")
|
if(m_strAliasName == "")
|
||||||
{
|
{
|
||||||
painter.drawText(rect.left(), rect.top(), rect.width(), rect.height()/3, Qt::AlignCenter, m_strLineName);
|
//painter.drawText(rect.left(), rect.top(), rect.width(), rect.height()/3, Qt::AlignCenter, m_strLineName);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//气测/FMT/射孔/文本
|
//气测/FMT/射孔/文本
|
||||||
|
|
@ -421,6 +421,7 @@ void FormInfo::paintEvent(QPaintEvent* event)
|
||||||
painter.setPen(m_lineColor);
|
painter.setPen(m_lineColor);
|
||||||
//painter.drawText(rect.left() + 20, 55, m_strUnit);
|
//painter.drawText(rect.left() + 20, 55, m_strUnit);
|
||||||
//painter.drawText(rect.left() + 20, 80, QString::number(m_vmin)+" ~ "+QString::number(m_vmax));
|
//painter.drawText(rect.left() + 20, 80, QString::number(m_vmin)+" ~ "+QString::number(m_vmax));
|
||||||
|
QString strShowTxt = "";
|
||||||
if(m_strType=="curveObject")
|
if(m_strType=="curveObject")
|
||||||
{
|
{
|
||||||
//曲线
|
//曲线
|
||||||
|
|
@ -435,7 +436,7 @@ void FormInfo::paintEvent(QPaintEvent* event)
|
||||||
else if(m_strLineName=="RESULT")
|
else if(m_strLineName=="RESULT")
|
||||||
{
|
{
|
||||||
//解释结论,不绘制左右范围
|
//解释结论,不绘制左右范围
|
||||||
painter.drawText(rect.left(), rect.top()+rect.height()/3, rect.width(), rect.height()/3 ,Qt::AlignCenter, "解释结论");
|
strShowTxt = "解释结论";
|
||||||
}
|
}
|
||||||
else if(m_strLineName=="GEO_LITH")
|
else if(m_strLineName=="GEO_LITH")
|
||||||
{
|
{
|
||||||
|
|
@ -455,12 +456,12 @@ void FormInfo::paintEvent(QPaintEvent* event)
|
||||||
else if(m_strLineName=="CORE_PHYSICS")
|
else if(m_strLineName=="CORE_PHYSICS")
|
||||||
{
|
{
|
||||||
//岩心分析,不绘制左右范围
|
//岩心分析,不绘制左右范围
|
||||||
painter.drawText(rect.left(), rect.top()+rect.height()/3, rect.width(), rect.height()/3 ,Qt::AlignCenter, "岩心实验数据");
|
strShowTxt = "岩心实验数据";
|
||||||
}
|
}
|
||||||
else if(m_strLineName=="FRAC_HOLE.TABLE" && m_strType=="tableObject")
|
else if(m_strLineName=="FRAC_HOLE.TABLE" && m_strType=="tableObject")
|
||||||
{
|
{
|
||||||
//蝌蚪图,不绘制左右范围
|
//蝌蚪图,不绘制左右范围
|
||||||
painter.drawText(rect.left(), rect.top()+rect.height()/3, rect.width(), rect.height()/3 ,Qt::AlignCenter, "蝌蚪图");
|
strShowTxt = "蝌蚪图";
|
||||||
}
|
}
|
||||||
else if(m_strLineName=="井眼垮塌矢量图"
|
else if(m_strLineName=="井眼垮塌矢量图"
|
||||||
|| m_strLineName=="井斜方位图")
|
|| m_strLineName=="井斜方位图")
|
||||||
|
|
@ -469,6 +470,53 @@ 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));
|
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 (strShowTxt.length()>0)
|
||||||
|
{
|
||||||
|
QRect rt = rect;
|
||||||
|
QString text = "";
|
||||||
|
if (!m_bVerticaDrawing)
|
||||||
|
{
|
||||||
|
rt.setX(rect.left());
|
||||||
|
rt.setY(rect.top() + rect.height() / 3);
|
||||||
|
rt.setWidth(rect.width());
|
||||||
|
rt.setHeight(rect.height() / 3);
|
||||||
|
text = strShowTxt;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (int i = 0; i < strShowTxt.size(); i++) {
|
||||||
|
if (!i)text += strShowTxt.at(i);
|
||||||
|
else {
|
||||||
|
text += "\n";
|
||||||
|
text += strShowTxt.at(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_nRotationAngle != 0)
|
||||||
|
{
|
||||||
|
// 获取文本的精确尺寸
|
||||||
|
QFontMetrics fm(m_curveUnitFont);
|
||||||
|
int textWidth = fm.horizontalAdvance(text);
|
||||||
|
int textHeight = fm.height();
|
||||||
|
|
||||||
|
painter.save();
|
||||||
|
painter.translate(rect.center()); // 将原点移到控件中心
|
||||||
|
painter.rotate(m_nRotationAngle); // 顺时针旋转90度
|
||||||
|
|
||||||
|
// 3. 绘制文本(相对于新原点居中)
|
||||||
|
painter.drawText(-textWidth / 2, // x偏移:向左一半宽度
|
||||||
|
-textHeight / 2, // y偏移:向上一半高度
|
||||||
|
text);
|
||||||
|
|
||||||
|
painter.restore();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
painter.drawText(rt, Qt::AlignCenter, text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
if(m_strType=="tableObject" && (m_strLineName=="WORDS_RELUST" || m_strLineName == "RESULT"
|
if(m_strType=="tableObject" && (m_strLineName=="WORDS_RELUST" || m_strLineName == "RESULT"
|
||||||
|| m_strLineName == "GEO_LITH"|| m_strLineName == "SWALL_CORE"
|
|| m_strLineName == "GEO_LITH"|| m_strLineName == "SWALL_CORE"
|
||||||
|
|
|
||||||
|
|
@ -628,6 +628,10 @@ void QMyCustomPlot::setShowProperty(QVariant val, int ntag)
|
||||||
QFont f = val.value<QFont>();
|
QFont f = val.value<QFont>();
|
||||||
pGroup->setFloorFont(f);
|
pGroup->setFloorFont(f);
|
||||||
}
|
}
|
||||||
|
else if (ntag == 5)
|
||||||
|
{
|
||||||
|
pGroup->setFloorRot(val.toDouble());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3567,6 +3571,10 @@ void QMyCustomPlot::s_changeDrawProperty(QVariantList vlist)
|
||||||
{
|
{
|
||||||
this->setShowProperty(varVal, 4);
|
this->setShowProperty(varVal, 4);
|
||||||
}
|
}
|
||||||
|
else if ("层号旋转" == strProperty)
|
||||||
|
{
|
||||||
|
this->setShowProperty(varVal, 5);
|
||||||
|
}
|
||||||
this->replot();
|
this->replot();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user