追加解释结论RESULT表格的可视化
This commit is contained in:
parent
e884d9b00a
commit
d512c3cac9
|
|
@ -221,6 +221,7 @@ QMap<QString,QString> GetZoneOrder(QString table,bool isOilFile,QWidget *pW)
|
||||||
QFile file( configfile );
|
QFile file( configfile );
|
||||||
if ( file.open( QIODevice::ReadOnly ) ) {
|
if ( file.open( QIODevice::ReadOnly ) ) {
|
||||||
QTextStream stream( &file );
|
QTextStream stream( &file );
|
||||||
|
stream.setCodec("UTF-8"); // 设置UTF-8编码
|
||||||
QString line;
|
QString line;
|
||||||
while ( !stream.atEnd() ) {
|
while ( !stream.atEnd() ) {
|
||||||
line = stream.readLine(); // 不包括“\n”的一行文本
|
line = stream.readLine(); // 不包括“\n”的一行文本
|
||||||
|
|
@ -1004,3 +1005,34 @@ void ReadColorSettings(QList<SchemeColor> &shcemeLis)
|
||||||
fclose(fp1);
|
fclose(fp1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString GetSymbolDir(QString cs)
|
||||||
|
{
|
||||||
|
return GetImagePath()+GetOilFieldName("")+"符号库"+cs;
|
||||||
|
}
|
||||||
|
QString GetMudSymbolDir(QString cs)
|
||||||
|
{
|
||||||
|
return GetSymbolDir()+"录井岩性符号"+cs;
|
||||||
|
}
|
||||||
|
QString GetColorSymbolDir(QString cs)
|
||||||
|
{
|
||||||
|
return GetSymbolDir()+"颜色符号"+cs;
|
||||||
|
}
|
||||||
|
QString GetGasSymbolDir(QString cs)
|
||||||
|
{
|
||||||
|
return GetSymbolDir()+"油气符号"+cs;
|
||||||
|
}
|
||||||
|
QString GetGujingSymbolDir(QString cs)
|
||||||
|
{
|
||||||
|
return GetSymbolDir()+"固井结论符号"+cs;
|
||||||
|
}
|
||||||
|
QString GetLithSymbolDir(QString cs)
|
||||||
|
{
|
||||||
|
return GetSymbolDir()+"岩性符号"+cs;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString GetOilSymbolDir(QString cs)
|
||||||
|
{
|
||||||
|
return GetSymbolDir()+"解释结论符号"+cs;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -206,6 +206,15 @@ QVector<MyColorItem> myInpolation(const QVector<MyColorItem> &colorList,int tota
|
||||||
// 读取定制的颜色方案
|
// 读取定制的颜色方案
|
||||||
void ReadColorSettings(QList<SchemeColor> &shcemeLis);
|
void ReadColorSettings(QList<SchemeColor> &shcemeLis);
|
||||||
|
|
||||||
|
|
||||||
|
QString GetSymbolDir(QString cs=QDir::separator());
|
||||||
|
QString GetGasSymbolDir(QString cs=QDir::separator());
|
||||||
|
QString GetColorSymbolDir(QString cs=QDir::separator());
|
||||||
|
QString GetMudSymbolDir(QString cs=QDir::separator());
|
||||||
|
QString GetOilSymbolDir(QString cs=QDir::separator());
|
||||||
|
QString GetLithSymbolDir(QString cs=QDir::separator());
|
||||||
|
QString GetGujingSymbolDir(QString cs=QDir::separator());
|
||||||
|
|
||||||
struct WellHead
|
struct WellHead
|
||||||
{
|
{
|
||||||
WellHead()
|
WellHead()
|
||||||
|
|
|
||||||
|
|
@ -49,8 +49,9 @@ public:
|
||||||
mRect->topLeft->setCoords(left_Low, lY1);
|
mRect->topLeft->setCoords(left_Low, lY1);
|
||||||
mRect->bottomRight->setCoords(right_Hight, lY2);
|
mRect->bottomRight->setCoords(right_Hight, lY2);
|
||||||
|
|
||||||
mPixmap->topLeft->setCoords(left_Low, lY1);
|
//位置与rect不一样,否则图像反转
|
||||||
mPixmap->bottomRight->setCoords(right_Hight, lY2);
|
mPixmap->topLeft->setCoords(right_Hight, lY1);
|
||||||
|
mPixmap->bottomRight->setCoords(left_Low, lY2);
|
||||||
|
|
||||||
//mItemTitle->position->setCoords(0.5, 0.5);
|
//mItemTitle->position->setCoords(0.5, 0.5);
|
||||||
// 设置父锚点,定位点
|
// 设置父锚点,定位点
|
||||||
|
|
@ -338,13 +339,13 @@ private slots:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//取整数(方便显示统计,左右边界整数显示。)
|
// //取整数(方便显示统计,左右边界整数显示。)
|
||||||
newRange.lower = (int)newRange.lower;
|
// newRange.lower = (int)newRange.lower;
|
||||||
QCPRange rangeByFile = mPlot->xAxis->range();
|
// QCPRange rangeByFile = mPlot->xAxis->range();
|
||||||
if (std::fabs(rangeByFile.upper - (int)newRange.upper) >= 1.0)
|
// if (std::fabs(rangeByFile.upper - (int)newRange.upper) >= 1.0)
|
||||||
{
|
// {
|
||||||
newRange.upper = (int)newRange.upper;
|
// newRange.upper = (int)newRange.upper;
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 最终确保宽度不小于最小值(针对整体拖动的情况)
|
// 最终确保宽度不小于最小值(针对整体拖动的情况)
|
||||||
if(newRange.size() < mMinWidth) {
|
if(newRange.size() < mMinWidth) {
|
||||||
|
|
|
||||||
499
logPlus/TransparentDraggableResult.h
Normal file
499
logPlus/TransparentDraggableResult.h
Normal file
|
|
@ -0,0 +1,499 @@
|
||||||
|
#ifndef TRANSPARENTDRAGGABLERESUL_H
|
||||||
|
#define TRANSPARENTDRAGGABLERESUL_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include "qmycustomplot.h"
|
||||||
|
#include <QString>
|
||||||
|
#include <QMenu>
|
||||||
|
#include "geometryutils.h"
|
||||||
|
#include <QSvgRenderer>
|
||||||
|
|
||||||
|
#pragma execution_character_set("utf-8") // 强制指定执行字符集为 UTF-8
|
||||||
|
|
||||||
|
class TransparentDraggableResult : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit TransparentDraggableResult(QMyCustomPlot *parentPlot, QString strUuid="", double minWidth = 1.0, QString strTitle = "")
|
||||||
|
: QObject(parentPlot), mPlot(parentPlot), mstrTitle(strTitle), mMinWidth(minWidth)
|
||||||
|
{
|
||||||
|
m_strUuid = strUuid;
|
||||||
|
//
|
||||||
|
initRect();
|
||||||
|
}
|
||||||
|
|
||||||
|
~TransparentDraggableResult() {
|
||||||
|
if(mPlot) {
|
||||||
|
// mPlot->removeItem(mRect);
|
||||||
|
// mPlot->removeItem(mLeftHandle);
|
||||||
|
// mPlot->removeItem(mRightHandle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置最小宽度
|
||||||
|
void setMinWidth(double minWidth){
|
||||||
|
mMinWidth = minWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置标题
|
||||||
|
void setTitle(QString strTitle){
|
||||||
|
mstrTitle = strTitle;
|
||||||
|
mItemTitle->setText(mstrTitle);
|
||||||
|
mPlot->replot();
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置解释结论
|
||||||
|
void setResult(QString result){
|
||||||
|
m_Result = result;
|
||||||
|
//
|
||||||
|
QString strLast = result.right(4);
|
||||||
|
if(strLast.toLower()==".svg")
|
||||||
|
{
|
||||||
|
QSvgRenderer* svgRender = new QSvgRenderer();
|
||||||
|
svgRender->load(result);
|
||||||
|
//
|
||||||
|
QPixmap* pixmap = new QPixmap(10, 10);
|
||||||
|
pixmap->fill(Qt::transparent);//设置背景透明
|
||||||
|
QPainter p(pixmap);
|
||||||
|
svgRender->render(&p);
|
||||||
|
//
|
||||||
|
mPixmap->setPixmap(*pixmap); // 设置图片
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mPixmap->setPixmap(QPixmap(result)); // 设置图片
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
mPlot->replot();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置矩形范围
|
||||||
|
void setRange(double left_Low, double right_Hight) {
|
||||||
|
if(left_Low >= right_Hight) return;
|
||||||
|
|
||||||
|
double lY1 = mPlot->yAxis->range().lower;//+10
|
||||||
|
double lY2 = mPlot->yAxis->range().upper/4;
|
||||||
|
mRect->topLeft->setCoords(left_Low, lY1);
|
||||||
|
mRect->bottomRight->setCoords(right_Hight, lY2);
|
||||||
|
|
||||||
|
//位置与rect不一样,否则图像反转
|
||||||
|
mPixmap->topLeft->setCoords(right_Hight, lY1);
|
||||||
|
mPixmap->bottomRight->setCoords(left_Low, lY2);
|
||||||
|
|
||||||
|
//mItemTitle->position->setCoords(0.5, 0.5);
|
||||||
|
// 设置父锚点,定位点
|
||||||
|
//mItemTitle->position->setParentAnchor(mRect->bottom);
|
||||||
|
mItemTitle->position->setCoords((mRect->topLeft->coords().x() + mRect->bottomRight->coords().x())/2,
|
||||||
|
(mRect->topLeft->coords().y() + mRect->bottomRight->coords().y())/2); // 设置文本在矩形中心位置
|
||||||
|
|
||||||
|
//mRect->topLeft->setCoords(left, mPlot->yAxis->range().upper);
|
||||||
|
//mRect->bottomRight->setCoords(right, mPlot->yAxis->range().lower);
|
||||||
|
|
||||||
|
updateHandles();
|
||||||
|
mPlot->replot();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取当前范围
|
||||||
|
QCPRange getRange() const {
|
||||||
|
return QCPRange(mRect->topLeft->coords().x(), mRect->bottomRight->coords().x());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置矩形颜色
|
||||||
|
void setColor(const QColor &color) {
|
||||||
|
mRect->setBrush(QBrush(color));
|
||||||
|
mRect->setPen(QPen(color.darker()));
|
||||||
|
mPlot->replot();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除框图
|
||||||
|
void deleteRect() {
|
||||||
|
if(mPlot) {
|
||||||
|
|
||||||
|
// mRect->deleteLater();
|
||||||
|
// mLeftHandle->deleteLater();
|
||||||
|
// mRightHandle->deleteLater();
|
||||||
|
// mPixmap->deleteLater();
|
||||||
|
|
||||||
|
mPlot->m_mapDraggable_Result.remove(m_strUuid);
|
||||||
|
|
||||||
|
mPlot->removeItem(mRect);
|
||||||
|
mPlot->removeItem(mLeftHandle);
|
||||||
|
mPlot->removeItem(mRightHandle);
|
||||||
|
mPlot->removeItem(mPixmap);
|
||||||
|
mPlot->removeItem(mItemTitle);
|
||||||
|
|
||||||
|
mPlot->replot();
|
||||||
|
this->deleteLater();
|
||||||
|
|
||||||
|
//
|
||||||
|
// //避免二次绘制框图
|
||||||
|
// mPlot->m_bDrawRect = false;
|
||||||
|
// mDragMode = DragNone;
|
||||||
|
// //取消选中框
|
||||||
|
// mPlot->selectionRect()->cancel();
|
||||||
|
// mPlot->replot();
|
||||||
|
// mPlot->selectionRect()->mActive=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void rangeChanged(QCPRange newRange);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void initRect() {
|
||||||
|
// 创建透明矩形
|
||||||
|
mRect = new QCPItemRect(mPlot);
|
||||||
|
mRect->setLayer("overlay"); // 确保在最上层
|
||||||
|
mRect->setBrush(QBrush(QColor(100, 100, 255, 50))); // 半透明蓝色
|
||||||
|
mRect->setPen(QPen(QColor(70, 70, 255, 200)));
|
||||||
|
|
||||||
|
// 创建左右边界控制点
|
||||||
|
mLeftHandle = new QCPItemRect(mPlot);
|
||||||
|
mLeftHandle->setLayer("overlay");
|
||||||
|
mLeftHandle->setBrush(QBrush(Qt::red));
|
||||||
|
mLeftHandle->setPen(QPen(Qt::darkRed));
|
||||||
|
|
||||||
|
mRightHandle = new QCPItemRect(mPlot);
|
||||||
|
mRightHandle->setLayer("overlay");
|
||||||
|
mRightHandle->setBrush(QBrush(Qt::red));
|
||||||
|
mRightHandle->setPen(QPen(Qt::darkRed));
|
||||||
|
|
||||||
|
// 设置初始位置
|
||||||
|
//double center = mPlot->xAxis->range().center();
|
||||||
|
// setRange(center - 10, center + 10);
|
||||||
|
|
||||||
|
// 连接鼠标事件
|
||||||
|
connect(mPlot, &QCustomPlot::mousePress, this, &TransparentDraggableResult::onMousePress);
|
||||||
|
connect(mPlot, &QCustomPlot::mouseMove, this, &TransparentDraggableResult::onMouseMove);
|
||||||
|
connect(mPlot, &QCustomPlot::mouseRelease, this, &TransparentDraggableResult::onMouseRelease);
|
||||||
|
|
||||||
|
mPixmap = new QCPItemPixmap(mPlot);
|
||||||
|
//mPixmap->setPixmap(QPixmap(":/image/file.png")); // 设置图片
|
||||||
|
mPixmap->setScaled(true, Qt::IgnoreAspectRatio); // 设置缩放方式
|
||||||
|
mPixmap->setLayer("overlay"); // 确保在最上层
|
||||||
|
|
||||||
|
mItemTitle = new QCPItemText(mPlot);
|
||||||
|
mItemTitle->setText(mstrTitle);
|
||||||
|
//mItemTitle->setBrush(QBrush(Qt::red));
|
||||||
|
mItemTitle->setFont(QFont("Arial", 12, QFont::Bold));
|
||||||
|
mItemTitle->setColor(Qt::black);
|
||||||
|
mItemTitle->setPositionAlignment(Qt::AlignTop | Qt::AlignHCenter);
|
||||||
|
mItemTitle->position->setType(QCPItemPosition::ptPlotCoords);
|
||||||
|
//mItemTitle->position->setType(QCPItemPosition::ptAxisRectRatio);
|
||||||
|
mItemTitle->position->setCoords(0.5, 0);
|
||||||
|
mItemTitle->setLayer("overlay");
|
||||||
|
}
|
||||||
|
|
||||||
|
void updateHandles() {
|
||||||
|
// 左边界矩形控制点
|
||||||
|
mLeftHandle->topLeft->setParentAnchor(mRect->topLeft);
|
||||||
|
mLeftHandle->bottomRight->setParentAnchor(mRect->topRight);//(mRect->bottomLeft);
|
||||||
|
mLeftHandle->topLeft->setCoords(-5, 5); // 矩形大小
|
||||||
|
mLeftHandle->bottomRight->setCoords(5, -5); // 矩形大小
|
||||||
|
|
||||||
|
// 右边界矩形控制点
|
||||||
|
mRightHandle->topLeft->setParentAnchor(mRect->bottomLeft);
|
||||||
|
mRightHandle->bottomRight->setParentAnchor(mRect->bottomRight);
|
||||||
|
mRightHandle->topLeft->setCoords(-5, 5); // 矩形大小
|
||||||
|
mRightHandle->bottomRight->setCoords(5, -5); // 矩形大小
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void onDelRect()
|
||||||
|
{
|
||||||
|
//mDragMode = DragNone;
|
||||||
|
//删除框图
|
||||||
|
deleteRect();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 事件过滤器处理函数
|
||||||
|
// bool eventFilter(QObject* object, QEvent* event) {
|
||||||
|
// if (event->type() == QEvent::MouseButtonPress) {
|
||||||
|
// // 拦截操作
|
||||||
|
// return true; // 阻止事件传递
|
||||||
|
|
||||||
|
//// if (object == action) {
|
||||||
|
//// // 验证权限
|
||||||
|
//// if (1) {
|
||||||
|
//// // 允许操作
|
||||||
|
//// action->trigger();
|
||||||
|
//// } else {
|
||||||
|
//// // 拦截操作
|
||||||
|
//// return true; // 阻止事件传递
|
||||||
|
//// }
|
||||||
|
//// }
|
||||||
|
// }
|
||||||
|
// return false; // 默认不拦截其他事件
|
||||||
|
// }
|
||||||
|
|
||||||
|
void onMousePress(QMouseEvent *event) {
|
||||||
|
if(event->button() != Qt::LeftButton)//右键
|
||||||
|
{
|
||||||
|
double y = mPlot->xAxis->pixelToCoord(event->pos().y());//x轴展示深度
|
||||||
|
QCPRange currentRange = getRange();
|
||||||
|
if(mLeftHandle->selectTest(event->pos(), false) < 5) {
|
||||||
|
mDragMode = DragNone;
|
||||||
|
}
|
||||||
|
else if(mRightHandle->selectTest(event->pos(), false) < 5) {
|
||||||
|
mDragMode = DragNone;
|
||||||
|
}
|
||||||
|
//else if(x >= currentRange.lower && x <= currentRange.upper) {
|
||||||
|
else if(y >= currentRange.lower && y <= currentRange.upper) {
|
||||||
|
mDragMode = DragNone;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
mDragMode = DragNone;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//event->accept();
|
||||||
|
|
||||||
|
QMenu menu(nullptr);
|
||||||
|
QAction *delAction = menu.addAction("删除框图");
|
||||||
|
//delAction->installEventFilter(this);
|
||||||
|
connect(delAction, &QAction::triggered, this, &TransparentDraggableResult::onDelRect);
|
||||||
|
|
||||||
|
// QAction* pItem = menu.exec(event->globalPos());
|
||||||
|
// if(pItem == delAction)
|
||||||
|
// {
|
||||||
|
// //event->accept();
|
||||||
|
|
||||||
|
// int ii=0;
|
||||||
|
// ii++;
|
||||||
|
// }
|
||||||
|
menu.exec(event->globalPos());
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
event->accept();
|
||||||
|
|
||||||
|
// 检查点击了哪个部分
|
||||||
|
//double x = mPlot->xAxis->pixelToCoord(event->pos().x());
|
||||||
|
//double y = mPlot->yAxis->pixelToCoord(event->pos().y());
|
||||||
|
|
||||||
|
double y = mPlot->xAxis->pixelToCoord(event->pos().y());//x轴展示深度
|
||||||
|
|
||||||
|
QCPRange currentRange = getRange();
|
||||||
|
|
||||||
|
if(mLeftHandle->selectTest(event->pos(), false) < 5) {
|
||||||
|
mDragMode = DragLeft;
|
||||||
|
}
|
||||||
|
else if(mRightHandle->selectTest(event->pos(), false) < 5) {
|
||||||
|
mDragMode = DragRight;
|
||||||
|
}
|
||||||
|
//else if(x >= currentRange.lower && x <= currentRange.upper) {
|
||||||
|
else if(y >= currentRange.lower && y <= currentRange.upper) {
|
||||||
|
mDragMode = DragRect;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
mDragMode = DragNone;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//mDragStartX = x;
|
||||||
|
mDragStartY = y;
|
||||||
|
mDragStartRange = currentRange;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void onMouseMove(QMouseEvent *event) {
|
||||||
|
if(mDragMode == DragNone) return;
|
||||||
|
|
||||||
|
event->accept();
|
||||||
|
|
||||||
|
//double x = mPlot->xAxis->pixelToCoord(event->pos().x());
|
||||||
|
//double dx = x - mDragStartX;
|
||||||
|
|
||||||
|
double y = mPlot->xAxis->pixelToCoord(event->pos().y());
|
||||||
|
double dy = y - mDragStartY;
|
||||||
|
|
||||||
|
QCPRange newRange = mDragStartRange;
|
||||||
|
|
||||||
|
switch(mDragMode) {
|
||||||
|
case DragLeft: {
|
||||||
|
//double proposedLeft = mDragStartRange.lower + dx;
|
||||||
|
double proposedLeft = mDragStartRange.lower + dy;
|
||||||
|
// 确保不超出轴范围且不使宽度小于最小值
|
||||||
|
newRange.lower = qBound(
|
||||||
|
//mPlot->xAxis->range().lower,
|
||||||
|
getMyLower(),
|
||||||
|
proposedLeft,
|
||||||
|
mDragStartRange.upper - mMinWidth);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DragRight: {
|
||||||
|
//double proposedRight = mDragStartRange.upper + dx;
|
||||||
|
double proposedRight = mDragStartRange.upper + dy;
|
||||||
|
// 确保不超出轴范围且不使宽度小于最小值
|
||||||
|
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() + 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
// QCPRange axisRange = mPlot->xAxis->range();
|
||||||
|
// if(newRange.lower < axisRange.lower) {
|
||||||
|
// newRange.lower = axisRange.lower;
|
||||||
|
// newRange.upper = newRange.lower + width;
|
||||||
|
// }
|
||||||
|
// else if(newRange.upper > axisRange.upper) {
|
||||||
|
// newRange.upper = axisRange.upper;
|
||||||
|
// newRange.lower = newRange.upper - width;
|
||||||
|
// }
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// //取整数(方便显示统计,左右边界整数显示。)
|
||||||
|
// newRange.lower = (int)newRange.lower;
|
||||||
|
// QCPRange rangeByFile = mPlot->xAxis->range();
|
||||||
|
// if (std::fabs(rangeByFile.upper - (int)newRange.upper) >= 1.0)
|
||||||
|
// {
|
||||||
|
// newRange.upper = (int)newRange.upper;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 最终确保宽度不小于最小值(针对整体拖动的情况)
|
||||||
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void onMouseRelease(QMouseEvent *event) {
|
||||||
|
if(event->button() == Qt::LeftButton && mDragMode != DragNone) {
|
||||||
|
event->accept();
|
||||||
|
//避免二次绘制框图
|
||||||
|
mPlot->m_bDrawRect = false;
|
||||||
|
//emit rangeChanged(getRange());
|
||||||
|
mDragMode = DragNone;
|
||||||
|
//取消选中状态
|
||||||
|
// QCPDataSelection emptySelection;
|
||||||
|
// mPlot->graph(0)->setSelection(emptySelection);
|
||||||
|
// mPlot->replot();
|
||||||
|
|
||||||
|
//取消选中框
|
||||||
|
mPlot->selectionRect()->cancel();
|
||||||
|
mPlot->replot();
|
||||||
|
mPlot->selectionRect()->mActive=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
double getMyLower()
|
||||||
|
{
|
||||||
|
double dLower = mPlot->xAxis->range().lower;
|
||||||
|
double proposedLeft = mDragStartRange.lower;
|
||||||
|
|
||||||
|
TransparentDraggableResult *pDraggableRect =NULL;
|
||||||
|
{
|
||||||
|
QMap<QString,QObject *>::Iterator it = mPlot->m_mapDraggable_Result.begin();
|
||||||
|
while( it != mPlot->m_mapDraggable_Result.end() )
|
||||||
|
{
|
||||||
|
if(it.key() == m_strUuid)
|
||||||
|
{
|
||||||
|
it++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
pDraggableRect = (TransparentDraggableResult*)it.value();
|
||||||
|
//
|
||||||
|
QCPRange tmpRange = pDraggableRect->getRange();
|
||||||
|
if(tmpRange.upper >= dLower && tmpRange.upper <= proposedLeft)
|
||||||
|
{
|
||||||
|
dLower = tmpRange.upper;
|
||||||
|
}
|
||||||
|
it++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return dLower;
|
||||||
|
}
|
||||||
|
|
||||||
|
double getMyUpper()
|
||||||
|
{
|
||||||
|
double dUpper = mPlot->xAxis->range().upper;
|
||||||
|
double proposedRight = mDragStartRange.upper;
|
||||||
|
|
||||||
|
TransparentDraggableResult *pDraggableRect =NULL;
|
||||||
|
{
|
||||||
|
QMap<QString,QObject *>::Iterator it = mPlot->m_mapDraggable_Result.begin();
|
||||||
|
while( it != mPlot->m_mapDraggable_Result.end() )
|
||||||
|
{
|
||||||
|
if(it.key() == m_strUuid)
|
||||||
|
{
|
||||||
|
it++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
pDraggableRect = (TransparentDraggableResult*)it.value();
|
||||||
|
//
|
||||||
|
QCPRange tmpRange = pDraggableRect->getRange();
|
||||||
|
if(tmpRange.lower <= dUpper && tmpRange.lower >= proposedRight)
|
||||||
|
{
|
||||||
|
dUpper = tmpRange.lower;
|
||||||
|
}
|
||||||
|
it++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return dUpper;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
QMyCustomPlot *mPlot;
|
||||||
|
QCPItemRect *mRect;
|
||||||
|
QCPItemRect *mLeftHandle;
|
||||||
|
QCPItemRect *mRightHandle;
|
||||||
|
|
||||||
|
QCPItemPixmap *mPixmap;
|
||||||
|
QCPItemText *mItemTitle;
|
||||||
|
QString mstrTitle="";
|
||||||
|
QString m_strUuid = "";
|
||||||
|
|
||||||
|
QString m_Result;
|
||||||
|
|
||||||
|
enum DragMode { DragNone, DragLeft, DragRight, DragRect };
|
||||||
|
DragMode mDragMode = DragNone;
|
||||||
|
//double mDragStartX = 0;
|
||||||
|
double mDragStartY = 0;
|
||||||
|
QCPRange mDragStartRange;
|
||||||
|
|
||||||
|
// 添加最小宽度成员变量
|
||||||
|
double mMinWidth;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // TRANSPARENTDRAGGABLERESUL_H
|
||||||
|
|
@ -96,7 +96,6 @@ void FormDraw::s_addLine(QString strUuid, QString strSlfName, QString strWellNam
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//AppendConsole(PAI_INFO, "FormDraw s_addLine");
|
|
||||||
|
|
||||||
if(m_listLineName.contains(strLineName))
|
if(m_listLineName.contains(strLineName))
|
||||||
{
|
{
|
||||||
|
|
@ -271,7 +270,7 @@ void FormDraw::s_addWave(QString strUuid, QString strSlfName, QString strWellNam
|
||||||
|
|
||||||
void FormDraw::s_addTableLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName)
|
void FormDraw::s_addTableLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName)
|
||||||
{
|
{
|
||||||
if(strLineName != "FRAC_HOLE.TABLE" || strLineName != "WORDS_RELUST")
|
if(strLineName == "FRAC_HOLE.TABLE" || strLineName == "WORDS_RELUST" || strLineName == "RESULT")
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -344,7 +343,11 @@ void FormDraw::s_addTableLine(QString strUuid, QString strSlfName, QString strWe
|
||||||
//文字结论
|
//文字结论
|
||||||
initWords(curv, strSlfName, strLineName);
|
initWords(curv, strSlfName, strLineName);
|
||||||
}
|
}
|
||||||
|
else if(strLineName == "RESULT")
|
||||||
|
{
|
||||||
|
//解释结论
|
||||||
|
initResult(curv, strSlfName, strLineName);
|
||||||
|
}
|
||||||
connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*)));
|
connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*)));
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
@ -1437,25 +1440,25 @@ bool FormDraw::LoadFromSLF(QMyCustomPlot *widget, QString strSlfName, QString st
|
||||||
char buf1[100];
|
char buf1[100];
|
||||||
strncpy(buf1,s+2,len);
|
strncpy(buf1,s+2,len);
|
||||||
buf1[len]=0;
|
buf1[len]=0;
|
||||||
// pResult->SetLeftAndRightAlign(atoi(buf1));
|
// SetLeftAndRightAlign(atoi(buf1));
|
||||||
// pResult->SetUpAndDownAlign(atoi(p+2));
|
// SetUpAndDownAlign(atoi(p+2));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// pResult->SetLeftAndRightAlign(atoi(s+2));
|
// SetLeftAndRightAlign(atoi(s+2));
|
||||||
}
|
}
|
||||||
*s=0;
|
*s=0;
|
||||||
}
|
}
|
||||||
else if(strstr(m_Result->Words,"$U")){
|
else if(strstr(m_Result->Words,"$U")){
|
||||||
char *p=strstr(m_Result->Words,"$U");
|
char *p=strstr(m_Result->Words,"$U");
|
||||||
// pResult->SetUpAndDownAlign(atoi(p+2));
|
// SetUpAndDownAlign(atoi(p+2));
|
||||||
*p=0;
|
*p=0;
|
||||||
}
|
}
|
||||||
// pResult->SetCharacters(m_Result->Words);
|
// SetCharacters(m_Result->Words);
|
||||||
|
|
||||||
// pResult->fontColor=QColor(0,0,0,255);
|
// fontColor=QColor(0,0,0,255);
|
||||||
// pResult->backgroundColor=QColor(255,255,255,255);
|
// backgroundColor=QColor(255,255,255,255);
|
||||||
// pResult->wordfont.setFamily("黑体");
|
// wordfont.setFamily("黑体");
|
||||||
// pResult->wordfont.setPointSize(10);
|
// wordfont.setPointSize(10);
|
||||||
|
|
||||||
//显示文本
|
//显示文本
|
||||||
widget->addTextToPlot(-m_Result->EndDepth, -m_Result->StartDepth, QString::fromLocal8Bit(m_Result->Words));
|
widget->addTextToPlot(-m_Result->EndDepth, -m_Result->StartDepth, QString::fromLocal8Bit(m_Result->Words));
|
||||||
|
|
@ -1469,6 +1472,260 @@ bool FormDraw::LoadFromSLF(QMyCustomPlot *widget, QString strSlfName, QString st
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//解释结论
|
||||||
|
void FormDraw::initResult(QMyCustomPlot *widget, QString strSlfName, QString strLineName)
|
||||||
|
{
|
||||||
|
|
||||||
|
int iMyWidth = widget->axisRect(0)->width();
|
||||||
|
float vmax = iMyWidth;
|
||||||
|
float vmin = 0;
|
||||||
|
widget->m_iX1 = vmin;
|
||||||
|
widget->m_iX2 = iMyWidth;
|
||||||
|
widget->m_iY1 = g_iY1;
|
||||||
|
widget->m_iY2 = g_iY2;
|
||||||
|
//
|
||||||
|
widget->xAxis->setRange(vmin, vmax);
|
||||||
|
widget->yAxis->setRange(g_iY1, g_iY2);
|
||||||
|
widget->axisRect()->setupFullAxesBox();
|
||||||
|
//
|
||||||
|
widget->xAxis->ticker()->setTickCount(10);//x个主刻度
|
||||||
|
widget->yAxis->ticker()->setTickCount(60);//y个主刻度
|
||||||
|
|
||||||
|
//对调XY轴,在最前面设置
|
||||||
|
QCPAxis *yAxis = widget->yAxis;
|
||||||
|
QCPAxis *xAxis = widget->xAxis;
|
||||||
|
widget->xAxis = yAxis;
|
||||||
|
widget->yAxis = xAxis;
|
||||||
|
|
||||||
|
|
||||||
|
m_LeftVal = 0;
|
||||||
|
m_RightVal = 90;
|
||||||
|
//隐藏刻度
|
||||||
|
widget->xAxis->setTicks(false);
|
||||||
|
widget->yAxis->setTicks(false);
|
||||||
|
widget->xAxis2->setTicks(false);
|
||||||
|
widget->yAxis2->setTicks(false);
|
||||||
|
//
|
||||||
|
LoadFromSLF_Result(widget, strSlfName, strLineName);
|
||||||
|
|
||||||
|
QString strAliasName = "";
|
||||||
|
QString strUnit = "";
|
||||||
|
QColor newlineColor=QColor(0,0,0);
|
||||||
|
double width=2;
|
||||||
|
QString strScaleType = "";
|
||||||
|
//道-对象
|
||||||
|
m_formTrack->Add(strSlfName, m_strWellName, m_strTrackName, strLineName, strAliasName, strUnit, newlineColor, width, m_RightVal, m_LeftVal, strScaleType, "tableObject");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool FormDraw::LoadFromSLF_Result(QMyCustomPlot *widget, QString strSlfName, QString strLineName)
|
||||||
|
{
|
||||||
|
static bool isrun=false;
|
||||||
|
CMemRdWt *logio=new CMemRdWt();
|
||||||
|
if(!logio->Open(strSlfName.toStdString().c_str(), CSlfIO::modeRead))
|
||||||
|
{
|
||||||
|
delete logio;
|
||||||
|
isrun=false;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int iIndex=logio->OpenTable(strLineName.toStdString().c_str());
|
||||||
|
if(iIndex>-1) {
|
||||||
|
int len = logio->GetTableRecordLength(iIndex);
|
||||||
|
int sl = sizeof(LAYER_DATA);
|
||||||
|
if(sl>len) len=sl;
|
||||||
|
LAYER_DATA *m_Result,*m_Result1;
|
||||||
|
int count=logio->GetTableRecordCount(iIndex);
|
||||||
|
char *pstr=new char[len*count+1];
|
||||||
|
memset(pstr,0,len*count);
|
||||||
|
int zone=1;
|
||||||
|
for(int i=0;i<count;i++) {
|
||||||
|
m_Result=(LAYER_DATA *)(pstr+i*len);
|
||||||
|
logio->ReadTable(iIndex,i+1,m_Result);
|
||||||
|
if(!i) zone=atoi(m_Result->Zone);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i=0;i<count;i++)
|
||||||
|
{
|
||||||
|
m_Result=(LAYER_DATA *)(pstr+i*len);
|
||||||
|
|
||||||
|
if(m_Result->StartDepth==m_Result->EndDepth) continue;
|
||||||
|
|
||||||
|
//以下字段为临时添加,后面需要和pai数据组集成
|
||||||
|
//tmp code
|
||||||
|
QString resultNo;//解释层号
|
||||||
|
QString result;//油气结论
|
||||||
|
double thick;//有效厚度
|
||||||
|
double tt;//累计厚度
|
||||||
|
QString result1;//油气结论2
|
||||||
|
QString result2;//油气结论3
|
||||||
|
QString result3;//油气结论3
|
||||||
|
QString result4;//油气结论3
|
||||||
|
QString result5;//油气结论3
|
||||||
|
QString result6;//油气结论2
|
||||||
|
QString result7;//油气结论3
|
||||||
|
QString result8;//油气结论3
|
||||||
|
QString result9;//油气结论3
|
||||||
|
QString result10;//油气结论3
|
||||||
|
float m_MDepth1;
|
||||||
|
float m_MDepth2;
|
||||||
|
float m_MDepth3;
|
||||||
|
float m_MDepth4;
|
||||||
|
float m_MDepth5;
|
||||||
|
float m_MDepth6;
|
||||||
|
float m_MDepth7;
|
||||||
|
float m_MDepth8;
|
||||||
|
float m_MDepth9;
|
||||||
|
float m_MDepth10;
|
||||||
|
QString Zone;
|
||||||
|
QString Description1;
|
||||||
|
QString Description2;
|
||||||
|
QString Description3;
|
||||||
|
QString Description4;
|
||||||
|
QString Description5;
|
||||||
|
QString Description6;
|
||||||
|
QString Description7;
|
||||||
|
QString Description8;
|
||||||
|
QString Description9;
|
||||||
|
QString Description10;
|
||||||
|
int m_GEOName;
|
||||||
|
QString m_DEST;
|
||||||
|
float m_SDEP,m_EDEP;
|
||||||
|
float m_SDEP1,m_EDEP1;
|
||||||
|
float m_SDEP2,m_EDEP2;
|
||||||
|
float m_SDEP3,m_EDEP3;
|
||||||
|
float m_SDEP4,m_EDEP4;
|
||||||
|
float m_SDEP5,m_EDEP5;
|
||||||
|
float m_SDEP6,m_EDEP6;
|
||||||
|
float m_SDEP7,m_EDEP7;
|
||||||
|
float m_SDEP8,m_EDEP8;
|
||||||
|
float m_SDEP9,m_EDEP9;
|
||||||
|
float m_SDEP10,m_EDEP10;
|
||||||
|
//0代表直接绘制 1代表平铺 2代表拉伸 默认值是2
|
||||||
|
|
||||||
|
QMap<QString,QString> zoneOrder = GetZoneOrder();//初始化ZoneOrder 层序号根据层位名来,配置文件在conf\\RESULT.txt
|
||||||
|
|
||||||
|
//
|
||||||
|
QDir fexit;
|
||||||
|
QString result_str=QString::number(m_Result->Result);
|
||||||
|
QString iconshotname;
|
||||||
|
if(result_str.length()>0&&m_Result->MDepth1)
|
||||||
|
iconshotname=zoneOrder.key(result_str.at(0));
|
||||||
|
else
|
||||||
|
iconshotname=zoneOrder.key(result_str);
|
||||||
|
|
||||||
|
if(iconshotname!=""){
|
||||||
|
result=::GetOilSymbolDir()+iconshotname+".svg";
|
||||||
|
if(!fexit.exists(result))
|
||||||
|
{
|
||||||
|
result=::GetOilSymbolDir()+iconshotname+".png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(m_Result->MDepth1!=0) {
|
||||||
|
if(result_str.length()>1) iconshotname=zoneOrder.key(QString::number(m_Result->Result).at(1));
|
||||||
|
if(iconshotname!=""){
|
||||||
|
result1=::GetOilSymbolDir()+iconshotname+".svg";
|
||||||
|
if(!fexit.exists(result1))
|
||||||
|
result1=::GetOilSymbolDir()+iconshotname+".png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(m_Result->MDepth2!=0) {
|
||||||
|
if(result_str.length()>2) iconshotname=zoneOrder.key(result_str.at(2));
|
||||||
|
if(iconshotname!=""){
|
||||||
|
result2=::GetOilSymbolDir()+iconshotname+".svg";
|
||||||
|
if(!fexit.exists(result2))
|
||||||
|
result2=::GetOilSymbolDir()+iconshotname+".png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(m_Result->MDepth3!=0) {
|
||||||
|
if(result_str.length()>3) iconshotname=zoneOrder.key(result_str.at(3));
|
||||||
|
if(iconshotname!=""){
|
||||||
|
result3=::GetOilSymbolDir()+iconshotname+".svg";
|
||||||
|
if(!fexit.exists(result3))
|
||||||
|
result3=::GetOilSymbolDir()+iconshotname+".png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(m_Result->MDepth4!=0) {
|
||||||
|
if(result_str.length()>4) iconshotname=zoneOrder.key(result_str.at(4));
|
||||||
|
if(iconshotname!=""){
|
||||||
|
result4=::GetOilSymbolDir()+iconshotname+".svg";
|
||||||
|
if(!fexit.exists(result4))
|
||||||
|
result4=::GetOilSymbolDir()+iconshotname+".png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(m_Result->MDepth5!=0) {
|
||||||
|
if(result_str.length()>5) iconshotname=zoneOrder.key(result_str.at(5));
|
||||||
|
if(iconshotname!=""){
|
||||||
|
result5=::GetOilSymbolDir()+iconshotname+".svg";
|
||||||
|
if(!fexit.exists(result5))
|
||||||
|
result5=::GetOilSymbolDir()+iconshotname+".png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(m_Result->MDepth6!=0) {
|
||||||
|
if(result_str.length()>6) iconshotname=zoneOrder.key(result_str.at(6));
|
||||||
|
if(iconshotname!=""){
|
||||||
|
result6=::GetOilSymbolDir()+iconshotname+".svg";
|
||||||
|
if(!fexit.exists(result6))
|
||||||
|
result6=::GetOilSymbolDir()+iconshotname+".png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(m_Result->MDepth7!=0) {
|
||||||
|
if(result_str.length()>7) iconshotname=zoneOrder.key(result_str.at(7));
|
||||||
|
if(iconshotname!=""){
|
||||||
|
result7=::GetOilSymbolDir()+iconshotname+".svg";
|
||||||
|
if(!fexit.exists(result7))
|
||||||
|
result7=::GetOilSymbolDir()+iconshotname+".png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(m_Result->MDepth8!=0) {
|
||||||
|
if(result_str.length()>8) iconshotname=zoneOrder.key(result_str.at(8));
|
||||||
|
if(iconshotname!=""){
|
||||||
|
result8=::GetOilSymbolDir()+iconshotname+".svg";
|
||||||
|
if(!fexit.exists(result8))
|
||||||
|
result8=::GetOilSymbolDir()+iconshotname+".png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(m_Result->MDepth9!=0) {
|
||||||
|
if(result_str.length()>9) iconshotname=zoneOrder.key(result_str.at(9));
|
||||||
|
if(iconshotname!=""){
|
||||||
|
result9=::GetOilSymbolDir()+iconshotname+".svg";
|
||||||
|
if(!fexit.exists(result9))
|
||||||
|
result9=::GetOilSymbolDir()+iconshotname+".png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(m_Result->MDepth10!=0) {
|
||||||
|
if(result_str.length()>10) iconshotname=zoneOrder.key(result_str.at(10));
|
||||||
|
if(iconshotname!=""){
|
||||||
|
result10=::GetOilSymbolDir()+iconshotname+".svg";
|
||||||
|
if(!fexit.exists(result10))
|
||||||
|
result10=::GetOilSymbolDir()+iconshotname+".png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if(result != "" && m_Result->MDepth1!=0) {
|
||||||
|
widget->addResultToPlot(-m_Result->MDepth1, -m_Result->StartDepth, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(result1 != "" && m_Result->MDepth2!=0) {
|
||||||
|
widget->addResultToPlot(-m_Result->MDepth2, -m_Result->MDepth1, result1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(result2 != "" && m_Result->MDepth3!=0) {
|
||||||
|
widget->addResultToPlot(-m_Result->MDepth3, -m_Result->MDepth2, result2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
logio->CloseTable(iIndex);
|
||||||
|
delete pstr;
|
||||||
|
}
|
||||||
|
delete logio;
|
||||||
|
|
||||||
|
|
||||||
|
isrun=false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void FormDraw::CalcDipWidth(int nColumn,float *flWidth,float factor,int x1,int x2,float flHoriRatio)
|
void FormDraw::CalcDipWidth(int nColumn,float *flWidth,float factor,int x1,int x2,float flHoriRatio)
|
||||||
{
|
{
|
||||||
float scale ;
|
float scale ;
|
||||||
|
|
|
||||||
|
|
@ -138,6 +138,10 @@ public:
|
||||||
void initWords(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
|
void initWords(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
|
||||||
bool LoadFromSLF(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
|
bool LoadFromSLF(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
|
||||||
|
|
||||||
|
//解释结论
|
||||||
|
void initResult(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
|
||||||
|
bool LoadFromSLF_Result(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
//void sig_AddLine(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
|
//void sig_AddLine(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -215,7 +215,13 @@ void FormInfo::paintEvent(QPaintEvent* event)
|
||||||
painter.drawText(rect.left(), rect.top()+rect.height()/3, rect.width(), rect.height()/3, Qt::AlignCenter, m_strUnit);
|
painter.drawText(rect.left(), rect.top()+rect.height()/3, rect.width(), rect.height()/3, Qt::AlignCenter, m_strUnit);
|
||||||
}
|
}
|
||||||
|
|
||||||
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_strType=="tableObject" && (m_strLineName=="WORDS_RELUST" || m_strLineName == "RESULT"))
|
||||||
|
{
|
||||||
|
//文字结论,不绘制左右范围
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
QWidget::paintEvent(event);
|
QWidget::paintEvent(event);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,11 @@ void FormTrack::s_addWave(QString strSlfName, QString strWellName, QString strTr
|
||||||
|
|
||||||
void FormTrack::s_AddTableLine(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType)
|
void FormTrack::s_AddTableLine(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType)
|
||||||
{
|
{
|
||||||
if(strLineName != "FRAC_HOLE.TABLE")
|
if(strLineName == "FRAC_HOLE.TABLE" || strLineName == "WORDS_RELUST" || strLineName == "RESULT")
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,7 @@ HEADERS += \
|
||||||
QCPSizeHandle.h \
|
QCPSizeHandle.h \
|
||||||
QCPSizeHandleManager.h \
|
QCPSizeHandleManager.h \
|
||||||
TransparentDraggableRect.h \
|
TransparentDraggableRect.h \
|
||||||
|
TransparentDraggableResult.h \
|
||||||
backgrounddelegate.h \
|
backgrounddelegate.h \
|
||||||
customtabbar.h \
|
customtabbar.h \
|
||||||
customtabwidget.h \
|
customtabwidget.h \
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
#include "CallManage.h"
|
#include "CallManage.h"
|
||||||
#include "geometryutils.h"
|
#include "geometryutils.h"
|
||||||
#include "TransparentDraggableRect.h"
|
#include "TransparentDraggableRect.h"
|
||||||
|
#include "TransparentDraggableResult.h"
|
||||||
#include "qtcommonclass.h"
|
#include "qtcommonclass.h"
|
||||||
|
|
||||||
//是否隐藏刻度
|
//是否隐藏刻度
|
||||||
|
|
@ -264,6 +265,24 @@ void QMyCustomPlot::addTextToPlot(double left_Low, double right_Hight, const QSt
|
||||||
m_mapDraggableRect[strUuid] = dragRect;
|
m_mapDraggableRect[strUuid] = dragRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QMyCustomPlot::addResultToPlot(double left_Low, double right_Hight, QString myResult)
|
||||||
|
{
|
||||||
|
QtCommonClass *qtCommon = new QtCommonClass(this);
|
||||||
|
QString strUuid = qtCommon->getUUid();
|
||||||
|
|
||||||
|
// 在初始化代码中
|
||||||
|
TransparentDraggableResult *dragRect = new TransparentDraggableResult(this, strUuid);
|
||||||
|
// 设置初始范围
|
||||||
|
dragRect->setRange(left_Low, right_Hight);
|
||||||
|
// 可选:设置颜色
|
||||||
|
dragRect->setColor(QColor(255, 100, 100, 80)); // 半透明红色
|
||||||
|
//最小宽度
|
||||||
|
dragRect->setMinWidth(0.1);
|
||||||
|
dragRect->setResult(myResult);
|
||||||
|
|
||||||
|
m_mapDraggable_Result[strUuid] = dragRect;
|
||||||
|
}
|
||||||
|
|
||||||
void QMyCustomPlot::onResetZoom()
|
void QMyCustomPlot::onResetZoom()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ public:
|
||||||
int m_iSplitNum=2000; //2000000; //2000;
|
int m_iSplitNum=2000; //2000000; //2000;
|
||||||
|
|
||||||
QMap<QString, QObject*> m_mapDraggableRect;
|
QMap<QString, QObject*> m_mapDraggableRect;
|
||||||
|
QMap<QString, QObject*> m_mapDraggable_Result;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void slot_time();
|
void slot_time();
|
||||||
|
|
@ -72,6 +73,8 @@ public:
|
||||||
|
|
||||||
void addTextToPlot(double left_Low, double right_Hight, const QString strText);
|
void addTextToPlot(double left_Low, double right_Hight, const QString strText);
|
||||||
|
|
||||||
|
void addResultToPlot(double left_Low, double right_Hight, QString myResult);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void s_LineClicked(int index);
|
void s_LineClicked(int index);
|
||||||
void onResetZoom();
|
void onResetZoom();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user