Compare commits

..

No commits in common. "e71f17bd3ebd27fc6b39c1f27da76911eea5f867" and "78e652354c7ca3bd09430a19358f8450b3b26a1d" have entirely different histories.

9 changed files with 81 additions and 391 deletions

View File

@ -147,9 +147,6 @@ signals:
//改变道属性
void sig_changeTrackProperty(QVariantList vlist);
//改变Draw属性
void sig_changeDrawProperty(QVariantList vlist);
//右键--添加分段线
void sig_AddShiftLine(QString strUuid, double left_Low, double right_Hight);
//校深线段

View File

@ -67,7 +67,6 @@ void PropertyWidget::InitCurrentViewInfo()
m_mapGroupItem.clear();
m_fromTop = NULL;
m_formInfo = NULL;
m_item = NULL;
m_strUuid = "";
m_strSlfName = "";
@ -118,38 +117,6 @@ 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;
}
}
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);
}
return;
}
if("深度比例尺" == m_propertyData[pProperty])
{
//qDebug() << "深度比例尺->改变";
@ -914,6 +881,9 @@ void PropertyWidget::initCurveProperty(FormInfo *formInfo, QStringList strListOt
m_listMax.append(listMax);
m_strListOtherScaleType.append(strListOtherScaleType);
//当前属性类型
m_strCurrentProperty = Curve_Property;
QStringList listStyle;
listStyle.append("");
listStyle.append("实线");
@ -974,9 +944,6 @@ void PropertyWidget::initCurveProperty(FormInfo *formInfo, QStringList strListOt
}
_CreateVariantPropertyItem("岩性填充", "岩性前景色", formInfo->m_frontColor, QVariant::Color);
_CreateVariantPropertyItem("岩性填充", "岩性背景色", formInfo->m_backColor, QVariant::Color);
//当前属性类型
m_strCurrentProperty = Curve_Property;
}
@ -1042,9 +1009,6 @@ void PropertyWidget::initProperty(FormInfo *formInfo)
//初始化,清空
InitCurrentViewInfo();
m_formInfo = formInfo;
m_strUuid = formInfo->m_strUuid;
//
@ -1061,10 +1025,7 @@ void PropertyWidget::initProperty(FormInfo *formInfo)
{
this->initRoseProperty(formInfo);
}
else if (formInfo->m_strType == "waveObject")
{
this->initWaveProperty(formInfo);
}
}
void PropertyWidget::initRoseProperty(FormInfo *formInfo)
@ -1097,70 +1058,3 @@ void PropertyWidget::initRoseProperty(FormInfo *formInfo)
// _CreateVariantPropertyItem("玫瑰图", "道头字颜色", fromTop->m_fontColor, QVariant::Color);
}
void PropertyWidget::initWaveProperty(FormInfo *formInfo)
{
_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_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("绘图类型", "类型", drawType.indexOf(formInfo->m_strDrawType), drawType);
QStringList fillType;
fillType.append("全周");
fillType.append("正半周");
fillType.append("负半周");
_CreateEnumPropertyItem("填充方式", "方式", fillType.indexOf(formInfo->m_strFillType), fillType);
//_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("波形绘制参数", "波列基值", 0, QVariant::Double);
//_CreateVariantPropertyItem("波形绘制参数", "波形间隔", 1, QVariant::Int);
//_CreateVariantPropertyItem("波形绘制参数", "波形高度", 1, QVariant::Double);
//_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);
// _CreateVariantPropertyItem("调色板参数设置", "色板", false, QVariant::Bool);
// _CreateVariantPropertyItem("调色板参数设置", "变密度颜色级数", 256, QVariant::Int);
// _CreateVariantPropertyItem("调色板参数设置", "图例置顶", false, QVariant::Bool);
// _CreateVariantPropertyItem("调色板参数设置", "反转显示", false, QVariant::Bool);
m_strCurrentProperty = Wave_Property;
}

View File

@ -25,7 +25,6 @@
#define Well_Property "Well_Property" //井
#define Track_Property "Track_Property" //道
#define Curve_Property "Curve_Property" //曲线
#define Wave_Property "Wave_Property" //波列
#define Head_Property "Head_Property" //图头,单元格
#pragma execution_character_set("utf-8")
@ -68,8 +67,8 @@ public:
QList<float> m_listMax;
QStringList m_strListOtherScaleType;
FormTrackTop* m_fromTop = NULL;
FormInfo * m_formInfo = NULL;
FormTrackTop* m_fromTop = NULL;
FormHead *m_formHead;
QTableWidget *m_tableWidget;
QTableWidgetItem* m_item;
@ -104,10 +103,8 @@ public:
void initDepthProperty(FormInfo *formInfo);
void initProperty(FormInfo *formInfo);
// 玫瑰图属性
void initRoseProperty(FormInfo *formInfo);
// 波列属性
void initWaveProperty(FormInfo *formInfo);
void ChangFillProperty();//填充属性改变

View File

@ -806,10 +806,7 @@ void FormDraw::s_addWave(QString strUuid, QString strSlfName, QString strWellNam
//curv->setMaximumHeight((int)dHight);
//curv->setViewport(QRect(0, 0, g_iOneWidth, (int)dHight));//7500-3184
int nW = m_nTrackW;
if (nW < 0)
nW = g_iOneWidth;
curv->setGeometry(0, 0, nW, (int)dHight);//7500-3184
curv->setGeometry(0, 0, g_iOneWidth, (int)dHight);//7500-3184
//curv->resize(INT_MAX, INT_MAX); // 使用 INT_MAX 来避免16位整数的限制
@ -834,7 +831,7 @@ void FormDraw::s_addWave(QString strUuid, QString strSlfName, QString strWellNam
m_listWaveName.push_back(strWaveName);
QString strAliasName = "";
QString strUnit = "mv";
QString strUnit = "";
QColor newlineColor=QColor(0,0,0);
double width=2;
QString strScaleType = "";
@ -2576,7 +2573,7 @@ void FormDraw::initWave(QMyCustomPlot *widget, QString strSlfName, QString strWa
_Rlev = _wave.DepLevel;
int m_Record=(float)(fabs((_EDep-_SDep)/_Rlev+0.5));
_nSamples = _wave.TimeSamples;
_nSamples = _wave.TimeSamples;
char *value=new char[(_nSamples+1)*m_Record*_wave.CodeLen+1];
logio->ReadWave(index,_SDep,m_Record,(void *)value);
@ -2587,15 +2584,15 @@ void FormDraw::initWave(QMyCustomPlot *widget, QString strSlfName, QString strWa
float vmax = -9999;//(float)_nSamples;
float vmin = -9999;
//
double** wavedata = widget->getWavedata(_nSamples, m_Record);
//wavedata = new double*[_nSamples];
//for(int kk = 0;kk<_nSamples;kk++){
// wavedata[kk] = new double[m_Record];
//}
double** wavedata;
wavedata = new double*[_nSamples];
for(int kk = 0;kk<_nSamples;kk++){
wavedata[kk] = new double[m_Record];
}
for (int i=0; i<m_Record; i++)
{
for(int kk = 0;kk< _nSamples;kk++)
for(int kk = 0;kk<_nSamples;kk++)
{
double val = GetData(_wave.RepCode,(char *)&value[(kk)*_wave.CodeLen+i*_nSamples*_wave.CodeLen]);
wavedata[kk][i] = val;
@ -2637,57 +2634,51 @@ void FormDraw::initWave(QMyCustomPlot *widget, QString strSlfName, QString strWa
widget->xAxis = yAxis;
widget->yAxis = xAxis;
widget->m_fmin = vmin;
widget->m_fmax = vmax;
//-------------------
// set up the QCPColorMap:
QCPColorMap *colorMap = new QCPColorMap(widget->xAxis, widget->yAxis);
widget->m_colorMap = colorMap;
int nx = m_Record;
int ny = _nSamples;
colorMap->data()->setSize(nx, ny); // 我们希望彩色地图有nx*ny的数据点
//colorMap->data()->setRange(QCPRange(m_iY1, m_iY2), QCPRange(vmin, vmax)); // 并在键x和值y维上跨越坐标范围-4..4
colorMap->data()->setRange(QCPRange(0 - _EDep, 0 - _SDep), QCPRange(vmin, vmax));
// 现在我们通过访问颜色贴图的QCPColorMapData实例来分配一些数据
for (int xIndex = 0; xIndex < nx; ++xIndex)
{
for (int yIndex = 0; yIndex < ny; ++yIndex)
{
if (wavedata[yIndex][xIndex] == -9999)
{
colorMap->data()->setCell(nx - xIndex - 1, yIndex, vmin);
continue;
}
//colorMap->data()->setCell(xIndex, yIndex, wavedata[yIndex][xIndex]);
colorMap->data()->setCell(nx - xIndex - 1, yIndex, wavedata[yIndex][xIndex]);
}
}
// 添加色标:
QCPColorScale *colorScale = new QCPColorScale(widget);
colorMap->setColorScale(colorScale); // 将颜色图与色标关联
// 将颜色贴图的“颜色渐变”设置为其中一个预设
//colorMap->setGradient(QCPColorGradient::gpPolar);//gpJet);
// 我们还可以创建一个QCPColorGradient实例并向其中添加自己的颜色
// 渐变请参阅QCPColorGradient的文档以获取可能的效果.
int nIndex = 11;
QVector<MyColorItem> colorList;
bool inpolation = true;
int iColorNum = getSystemColor(nIndex, colorList, inpolation);
//
QCPColorGradient gradient;
for (int i = 0; i < iColorNum; i++)
{
double dbTmpIndex = (double)(i + 1) / iColorNum;
gradient.setColorStopAt(dbTmpIndex, colorList[i].color); // x% 位置的颜色
}
colorMap->setGradient(gradient);
// 重新缩放数据维度(颜色),以使所有数据点都位于颜色渐变显示的范围内:
colorMap->rescaleDataRange();
//-------------------
// set up the QCPColorMap:
QCPColorMap *colorMap = new QCPColorMap(widget->xAxis, widget->yAxis);
int nx = m_Record;
int ny = _nSamples;
colorMap->data()->setSize(nx, ny); // 我们希望彩色地图有nx*ny的数据点
//colorMap->data()->setRange(QCPRange(m_iY1, m_iY2), QCPRange(vmin, vmax)); // 并在键x和值y维上跨越坐标范围-4..4
colorMap->data()->setRange(QCPRange(0-_EDep, 0-_SDep), QCPRange(vmin, vmax));
// 现在我们通过访问颜色贴图的QCPColorMapData实例来分配一些数据
double x, y, z;
for (int xIndex=0; xIndex<nx; ++xIndex)
{
for (int yIndex=0; yIndex<ny; ++yIndex)
{
if(wavedata[yIndex][xIndex]==-9999)
{
colorMap->data()->setCell(nx-xIndex-1, yIndex, vmin);
continue;
}
//colorMap->data()->setCell(xIndex, yIndex, wavedata[yIndex][xIndex]);
colorMap->data()->setCell(nx-xIndex-1, yIndex, wavedata[yIndex][xIndex]);
}
}
// 添加色标:
QCPColorScale *colorScale = new QCPColorScale(widget);
colorMap->setColorScale(colorScale); // 将颜色图与色标关联
// 将颜色贴图的“颜色渐变”设置为其中一个预设
//colorMap->setGradient(QCPColorGradient::gpPolar);//gpJet);
// 我们还可以创建一个QCPColorGradient实例并向其中添加自己的颜色
// 渐变请参阅QCPColorGradient的文档以获取可能的效果.
int nIndex=11;
QVector<MyColorItem> colorList;
bool inpolation = true;
int iColorNum = getSystemColor(nIndex, colorList, inpolation);
//
QCPColorGradient gradient;
for(int i=0; i<iColorNum; i++)
{
double dbTmpIndex=(double)(i+1)/iColorNum;
gradient.setColorStopAt(dbTmpIndex, colorList[i].color); // x% 位置的颜色
}
colorMap->setGradient(gradient);
// 重新缩放数据维度(颜色),以使所有数据点都位于颜色渐变显示的范围内:
colorMap->rescaleDataRange();
}
void FormDraw::initWave_3D(QMyCustomPlot *widget, QString strSlfName, QString strWaveName, int &_nSamples)

View File

@ -59,12 +59,6 @@ FormInfo::FormInfo(QWidget *parent, QString strSlfName, QString strWellName, QSt
//修改曲线选择状态 iSelect=0未知1标准曲线2主曲线3从曲线
connect(CallManage::getInstance(), SIGNAL(sig_ChangeLineStatus(QString, QString, QString, QString, QString, int, bool)), this, SLOT(s_ChangeLineStatus(QString, QString, QString, QString, QString, int, bool)));
QFont font1("微软雅黑", 10);
QFont font2("微软雅黑", 8);
m_curveNameFont = font1; // 曲线名称
m_curveUnitFont = font2; // 曲线单位
m_curveScaleFont = font2; // 曲线刻度
m_bShowScale = true;
}
FormInfo::~FormInfo()
@ -177,7 +171,8 @@ void FormInfo::paintEvent(QPaintEvent* event)
painter.drawRect(rectRound);
painter.setBrush(Qt::NoBrush); // 确保文字不被填充色遮挡
painter.setFont(m_curveNameFont);
QFont font1("微软雅黑", 10, false, false); //fontSize 10
painter.setFont(font1);
painter.setPen(m_lineColor); // fontColor QColor(220, 220, 220)
//painter.drawText(rect.left() + 20, 30, m_strAliasName); // titleBarText QStringLiteral("动画")
//painter.drawText(rect, Qt::AlignCenter, m_strAliasName);
@ -282,7 +277,8 @@ void FormInfo::paintEvent(QPaintEvent* event)
}
}
painter.setFont(m_curveUnitFont);
QFont font2("微软雅黑", 8, false, false);
painter.setFont(font2);
painter.setPen(m_lineColor);
//painter.drawText(rect.left() + 20, 55, m_strUnit);
//painter.drawText(rect.left() + 20, 80, QString::number(m_vmin)+" ~ "+QString::number(m_vmax));
@ -346,17 +342,7 @@ void FormInfo::paintEvent(QPaintEvent* event)
if(m_strType=="waveObject"
|| m_strType=="curveObject")
{
painter.drawText(rect.left()+10, rect.top() + rect.height() * 2 / 3, rect.width(), rect.height() / 3, Qt::AlignCenter, m_strUnit);
// 显示刻度
if (m_bShowScale)
{
painter.setFont(m_curveScaleFont);
QFontMetrics fm1(m_curveScaleFont);
QRect textRect = fm1.boundingRect(QString::number(m_vmax, 'f', 0));
painter.drawText(rect.left() + 10, rect.top() + rect.height() * 2 / 3, rect.width(), rect.height() / 3, Qt::AlignLeft | Qt::AlignVCenter, QString::number(m_vmin));// +" ~ " + QString::number(m_vmax));
painter.drawText(rect.left() + 10, rect.top() + rect.height() * 2 / 3, rect.width() - textRect.width(), rect.height() / 3, Qt::AlignRight | Qt::AlignVCenter, 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));
}
}
@ -514,55 +500,6 @@ QColor FormInfo::getBackColor()
return m_backColor;
}
bool FormInfo::setInfoProperty(QString strProName, QVariant val)
{
bool bDraw = false;
if ("显示名称" == strProName)
{
this->m_strLineName = val.toString();
}
else if ("显示单位" == strProName)
{
this->m_strUnit = val.toString();
}
else if ("曲线名称" == strProName)
{
this->m_curveNameFont = val.value<QFont>();
}
else if ("曲线单位" == strProName)
{
this->m_curveUnitFont = val.value<QFont>();
}
else if ("曲线刻度" == strProName)
{
this->m_curveScaleFont = val.value<QFont>();
}
else if ("左刻度" == strProName)
{
bDraw = true;
this->m_vmin = val.toDouble();
}
else if ("右刻度" == strProName)
{
bDraw = true;
this->m_vmax = val.toDouble();
}
else if ("幅度刻度" == strProName)
{
this->m_strAmp = val.toString();
}
else if ("最大振幅" == strProName)
{
this->m_fMaxAmp = val.toFloat();
}
else if ("显示刻度" == strProName)
{
this->m_bShowScale = val.toBool();
}
this->update();
return bDraw;
}
//修改曲线选择状态 iSelect=0未知1标准曲线2主曲线3从曲线
void FormInfo::s_ChangeLineStatus(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int iSelect, bool bMerge)
{
@ -703,4 +640,3 @@ void FormInfo::s_ChangeFillMode(QString strUuid, QString strSlfName, QString str
}
}

View File

@ -78,10 +78,6 @@ public:
float m_vmax;//右刻度
QString m_strScaleType;//刻度类型(线性,对数)
QFont m_curveNameFont; // 曲线名称
QFont m_curveUnitFont; // 曲线单位
QFont m_curveScaleFont; // 曲线刻度
//岩性填充
QString m_newHeadFill;//头部图例
QString m_newTargetLine;//目标曲线
@ -97,13 +93,6 @@ public:
int m_nJg;
QString m_strDrawType; // 绘图类型
QString m_strFillType; // 填充类型
QString m_strAmp; // 幅度刻度
float m_fMaxAmp; // 最大振幅
bool m_bShowScale; // 显示刻度
public:
void setLineWidth(double dWidth);
double getLineWidth();
@ -123,8 +112,6 @@ public:
void setBackColor(QColor backColor);
QColor getBackColor();
bool setInfoProperty(QString strProName, QVariant val);
QJsonObject makeJson();
//public:
@ -146,5 +133,4 @@ private:
QPoint startPosition;
};
#endif // FORMINFO_H

View File

@ -321,8 +321,8 @@ void FormTrack::s_addWave(QString strSlfName, QString strWellName, QString strTr
//ui->tableWidget->resize(g_iOneWidth, 100*(row + 1)+10);
//this->resize(g_iOneWidth, 100*(row + 1)+30);
//波列信息栏
FormInfo *formInfo = new FormInfo(this, strSlfName, strWellName, strTrackName, strLineName, lineColor);
//曲线信息栏
FormInfo *formInfo = new FormInfo(this, strSlfName, strWellName, strTrackName, strLineName, lineColor);
formInfo->m_strUuid = m_strUuid;
formInfo->m_strAliasName = strAliasName;
formInfo->m_strUnit = strUnit;
@ -331,12 +331,8 @@ void FormTrack::s_addWave(QString strSlfName, QString strWellName, QString strTr
formInfo->setLineWidth(dWidth);
formInfo->setVMax(vmax);
formInfo->setVMin(vmin);
formInfo->m_curveNameFont = QFont("黑体", 12);
formInfo->m_curveUnitFont = QFont("黑体", 10);
formInfo->m_curveScaleFont = QFont("黑体", 10);
formInfo->m_fMaxAmp = 1023.0f;
formInfo->setFrontColor(QColor(0,0,0));
formInfo->setBackColor(QColor(255,255,255));
//设置高度
ui->tableWidget->setRowHeight(row, 100);
//单元格委托
@ -344,6 +340,17 @@ void FormTrack::s_addWave(QString strSlfName, QString strWellName, QString strTr
//
ui->tableWidget->setCellWidget(row, 0, formInfo);
//------------------------------------
// QFont font("微软雅黑", 10, QFont::Bold, false);
// //
// QTableWidgetItem* item = new QTableWidgetItem(strLineName);
// item->setFlags(item->flags() & (~Qt::ItemIsEditable));
// item->setForeground(QBrush(lineColor));// 设置字体颜色
// item->setFont(font); // 应用新的字体
// item->setTextAlignment(Qt::AlignCenter);//居中
// //
// ui->tableWidget->setItem(row, 0, item);
}
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)

View File

@ -92,74 +92,6 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel
//Plot重新加载数据
connect(CallManage::getInstance(), SIGNAL(sig_ReloadPlot(QString, QString, QString)), this, SLOT(s_ReloadPlot(QString, QString, QString)));
connect(CallManage::getInstance(), SIGNAL(sig_changeDrawProperty(QVariantList)), this, SLOT(s_changeDrawProperty(QVariantList)));
}
double** QMyCustomPlot::getWavedata(int nrow, int ncol)
{
if (nrow > 0 && m_wavedata)
{
for (int i = 0; i < m_nRow; i++)
{
if (m_wavedata[i])
{
delete[] m_wavedata[i];
}
}
delete[] m_wavedata;
m_wavedata = NULL;
}
m_nRow = nrow;
m_nCol = ncol;
m_wavedata = new double*[nrow];
for (int kk = 0; kk < nrow; kk++) {
m_wavedata[kk] = new double[ncol];
}
return m_wavedata;
}
QCPColorMap * QMyCustomPlot::updateWave()
{
int nx = m_nCol;
int ny = m_nRow;
// 现在我们通过访问颜色贴图的QCPColorMapData实例来分配一些数据
double x, y, z;
for (int xIndex = 0; xIndex < nx; ++xIndex)
{
for (int yIndex = 0; yIndex < ny; ++yIndex)
{
double dz = m_wavedata[yIndex][xIndex];
if (m_nMode == 0)
{
if (m_wavedata[yIndex][xIndex] == -9999)
{
dz = m_fmax;
}
}
else if (m_nMode == 1)
{
if (m_wavedata[yIndex][xIndex] == -9999)
{
dz = m_fmin;
}
}
else if (m_nMode == 2)
{
if (m_wavedata[yIndex][xIndex] == -9999)
{
dz = m_fmax;
}
else
{
dz = m_fmin;
}
}
m_colorMap->data()->setCell(nx - xIndex - 1, yIndex, dz);
}
}
return m_colorMap;
}
//蝌蚪图,重绘网格线
@ -813,44 +745,6 @@ void QMyCustomPlot::s_ReloadPlot(QString strUuid, QString strSlfName, QString st
replot(QCustomPlot::rpQueuedReplot); //刷新曲线
}
void QMyCustomPlot::s_changeDrawProperty(QVariantList vlist)
{
QString strUuid = vlist.at(0).toString();
QString strSlfName = vlist.at(1).toString();
QString strWellName = vlist.at(2).toString();
QString strTrackName = vlist.at(3).toString();
QString strLineName = vlist.at(4).toString();
if (m_strUuid == strUuid &&
m_strSlfName == strSlfName &&
m_strWellName == strWellName &&
m_strTrackName == strTrackName &&
m_strLineName == strLineName)
{
QString strProperty = vlist.at(5).toString();
QString strValue = vlist.at(6).toString();
if ("方式" == strProperty)
{
m_nMode = strValue.toFloat();
this->updateWave();
this->replot();
}
else if ("左刻度" == strProperty)
{
}
else if ("右刻度" == strProperty)
{
if (m_colorMap)
{
float f = 264 / strValue.toFloat();
m_colorMap->data()->setValueRange(QCPRange(m_fmin, m_fmax*f));
this->replot();
}
}
}
}
void QMyCustomPlot::addLineToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor)
{
QtCommonClass *qtCommon = new QtCommonClass(this);

View File

@ -20,8 +20,6 @@ public:
{
}
double** getWavedata(int nrow, int ncol);
QCPColorMap * updateWave();
protected:
//virtual void mouseMoveEvent(QMouseEvent *event);
@ -63,15 +61,7 @@ public:
bool singleDragMove = false;
float singleOldPosition = 0;
QCPColorMap *m_colorMap = NULL;
QCPColorScale * m_colorScale = NULL;
double** m_wavedata = NULL;
int m_nRow = 0;
int m_nCol = 0;
// 0.全周 1.正半周 2.负半周
int m_nMode = 1;
float m_fmin;
float m_fmax;
public:
//分段刷新
QVector<double> m_x;
@ -188,8 +178,6 @@ public slots:
//Plot重新加载数据
void s_ReloadPlot(QString strUuid, QString strSlfName, QString strLineName);
void s_changeDrawProperty(QVariantList vlist);
void onAddRect();
//蝌蚪图重绘网格线