Compare commits
2 Commits
78e652354c
...
e71f17bd3e
| Author | SHA1 | Date | |
|---|---|---|---|
| e71f17bd3e | |||
| e7fe2002d0 |
|
|
@ -146,6 +146,9 @@ signals:
|
||||||
void sig_changeWidth(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, int iCurrentCol, int iNewWidth);
|
void sig_changeWidth(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, int iCurrentCol, int iNewWidth);
|
||||||
//改变道属性
|
//改变道属性
|
||||||
void sig_changeTrackProperty(QVariantList vlist);
|
void sig_changeTrackProperty(QVariantList vlist);
|
||||||
|
|
||||||
|
//改变Draw属性
|
||||||
|
void sig_changeDrawProperty(QVariantList vlist);
|
||||||
|
|
||||||
//右键--添加分段线
|
//右键--添加分段线
|
||||||
void sig_AddShiftLine(QString strUuid, double left_Low, double right_Hight);
|
void sig_AddShiftLine(QString strUuid, double left_Low, double right_Hight);
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,7 @@ void PropertyWidget::InitCurrentViewInfo()
|
||||||
m_mapGroupItem.clear();
|
m_mapGroupItem.clear();
|
||||||
|
|
||||||
m_fromTop = NULL;
|
m_fromTop = NULL;
|
||||||
|
m_formInfo = NULL;
|
||||||
m_item = NULL;
|
m_item = NULL;
|
||||||
m_strUuid = "";
|
m_strUuid = "";
|
||||||
m_strSlfName = "";
|
m_strSlfName = "";
|
||||||
|
|
@ -117,6 +118,38 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
|
||||||
}
|
}
|
||||||
return;
|
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])
|
if("深度比例尺" == m_propertyData[pProperty])
|
||||||
{
|
{
|
||||||
//qDebug() << "深度比例尺->改变";
|
//qDebug() << "深度比例尺->改变";
|
||||||
|
|
@ -881,9 +914,6 @@ void PropertyWidget::initCurveProperty(FormInfo *formInfo, QStringList strListOt
|
||||||
m_listMax.append(listMax);
|
m_listMax.append(listMax);
|
||||||
m_strListOtherScaleType.append(strListOtherScaleType);
|
m_strListOtherScaleType.append(strListOtherScaleType);
|
||||||
|
|
||||||
//当前属性类型
|
|
||||||
m_strCurrentProperty = Curve_Property;
|
|
||||||
|
|
||||||
QStringList listStyle;
|
QStringList listStyle;
|
||||||
listStyle.append("无");
|
listStyle.append("无");
|
||||||
listStyle.append("实线");
|
listStyle.append("实线");
|
||||||
|
|
@ -944,6 +974,9 @@ void PropertyWidget::initCurveProperty(FormInfo *formInfo, QStringList strListOt
|
||||||
}
|
}
|
||||||
_CreateVariantPropertyItem("岩性填充", "岩性前景色", formInfo->m_frontColor, QVariant::Color);
|
_CreateVariantPropertyItem("岩性填充", "岩性前景色", formInfo->m_frontColor, QVariant::Color);
|
||||||
_CreateVariantPropertyItem("岩性填充", "岩性背景色", formInfo->m_backColor, QVariant::Color);
|
_CreateVariantPropertyItem("岩性填充", "岩性背景色", formInfo->m_backColor, QVariant::Color);
|
||||||
|
|
||||||
|
//当前属性类型
|
||||||
|
m_strCurrentProperty = Curve_Property;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1009,6 +1042,9 @@ void PropertyWidget::initProperty(FormInfo *formInfo)
|
||||||
|
|
||||||
//初始化,清空
|
//初始化,清空
|
||||||
InitCurrentViewInfo();
|
InitCurrentViewInfo();
|
||||||
|
|
||||||
|
m_formInfo = formInfo;
|
||||||
|
|
||||||
m_strUuid = formInfo->m_strUuid;
|
m_strUuid = formInfo->m_strUuid;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
@ -1025,7 +1061,10 @@ void PropertyWidget::initProperty(FormInfo *formInfo)
|
||||||
{
|
{
|
||||||
this->initRoseProperty(formInfo);
|
this->initRoseProperty(formInfo);
|
||||||
}
|
}
|
||||||
|
else if (formInfo->m_strType == "waveObject")
|
||||||
|
{
|
||||||
|
this->initWaveProperty(formInfo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PropertyWidget::initRoseProperty(FormInfo *formInfo)
|
void PropertyWidget::initRoseProperty(FormInfo *formInfo)
|
||||||
|
|
@ -1058,3 +1097,70 @@ void PropertyWidget::initRoseProperty(FormInfo *formInfo)
|
||||||
// _CreateVariantPropertyItem("玫瑰图", "道头字颜色", fromTop->m_fontColor, QVariant::Color);
|
// _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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
#define Well_Property "Well_Property" //井
|
#define Well_Property "Well_Property" //井
|
||||||
#define Track_Property "Track_Property" //道
|
#define Track_Property "Track_Property" //道
|
||||||
#define Curve_Property "Curve_Property" //曲线
|
#define Curve_Property "Curve_Property" //曲线
|
||||||
|
#define Wave_Property "Wave_Property" //波列
|
||||||
#define Head_Property "Head_Property" //图头,单元格
|
#define Head_Property "Head_Property" //图头,单元格
|
||||||
|
|
||||||
#pragma execution_character_set("utf-8")
|
#pragma execution_character_set("utf-8")
|
||||||
|
|
@ -67,8 +68,8 @@ public:
|
||||||
QList<float> m_listMax;
|
QList<float> m_listMax;
|
||||||
QStringList m_strListOtherScaleType;
|
QStringList m_strListOtherScaleType;
|
||||||
|
|
||||||
FormTrackTop* m_fromTop = NULL;
|
FormTrackTop* m_fromTop = NULL;
|
||||||
|
FormInfo * m_formInfo = NULL;
|
||||||
FormHead *m_formHead;
|
FormHead *m_formHead;
|
||||||
QTableWidget *m_tableWidget;
|
QTableWidget *m_tableWidget;
|
||||||
QTableWidgetItem* m_item;
|
QTableWidgetItem* m_item;
|
||||||
|
|
@ -103,8 +104,10 @@ public:
|
||||||
void initDepthProperty(FormInfo *formInfo);
|
void initDepthProperty(FormInfo *formInfo);
|
||||||
|
|
||||||
void initProperty(FormInfo *formInfo);
|
void initProperty(FormInfo *formInfo);
|
||||||
|
// 玫瑰图属性
|
||||||
void initRoseProperty(FormInfo *formInfo);
|
void initRoseProperty(FormInfo *formInfo);
|
||||||
|
// 波列属性
|
||||||
|
void initWaveProperty(FormInfo *formInfo);
|
||||||
|
|
||||||
void ChangFillProperty();//填充属性改变
|
void ChangFillProperty();//填充属性改变
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -806,7 +806,10 @@ void FormDraw::s_addWave(QString strUuid, QString strSlfName, QString strWellNam
|
||||||
|
|
||||||
//curv->setMaximumHeight((int)dHight);
|
//curv->setMaximumHeight((int)dHight);
|
||||||
//curv->setViewport(QRect(0, 0, g_iOneWidth, (int)dHight));//7500-3184
|
//curv->setViewport(QRect(0, 0, g_iOneWidth, (int)dHight));//7500-3184
|
||||||
curv->setGeometry(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->resize(INT_MAX, INT_MAX); // 使用 INT_MAX 来避免16位整数的限制
|
//curv->resize(INT_MAX, INT_MAX); // 使用 INT_MAX 来避免16位整数的限制
|
||||||
|
|
@ -831,7 +834,7 @@ void FormDraw::s_addWave(QString strUuid, QString strSlfName, QString strWellNam
|
||||||
m_listWaveName.push_back(strWaveName);
|
m_listWaveName.push_back(strWaveName);
|
||||||
|
|
||||||
QString strAliasName = "";
|
QString strAliasName = "";
|
||||||
QString strUnit = "";
|
QString strUnit = "mv";
|
||||||
QColor newlineColor=QColor(0,0,0);
|
QColor newlineColor=QColor(0,0,0);
|
||||||
double width=2;
|
double width=2;
|
||||||
QString strScaleType = "";
|
QString strScaleType = "";
|
||||||
|
|
@ -2573,7 +2576,7 @@ void FormDraw::initWave(QMyCustomPlot *widget, QString strSlfName, QString strWa
|
||||||
_Rlev = _wave.DepLevel;
|
_Rlev = _wave.DepLevel;
|
||||||
int m_Record=(float)(fabs((_EDep-_SDep)/_Rlev+0.5));
|
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];
|
char *value=new char[(_nSamples+1)*m_Record*_wave.CodeLen+1];
|
||||||
logio->ReadWave(index,_SDep,m_Record,(void *)value);
|
logio->ReadWave(index,_SDep,m_Record,(void *)value);
|
||||||
|
|
@ -2584,15 +2587,15 @@ void FormDraw::initWave(QMyCustomPlot *widget, QString strSlfName, QString strWa
|
||||||
float vmax = -9999;//(float)_nSamples;
|
float vmax = -9999;//(float)_nSamples;
|
||||||
float vmin = -9999;
|
float vmin = -9999;
|
||||||
//
|
//
|
||||||
double** wavedata;
|
double** wavedata = widget->getWavedata(_nSamples, m_Record);
|
||||||
wavedata = new double*[_nSamples];
|
//wavedata = new double*[_nSamples];
|
||||||
for(int kk = 0;kk<_nSamples;kk++){
|
//for(int kk = 0;kk<_nSamples;kk++){
|
||||||
wavedata[kk] = new double[m_Record];
|
// wavedata[kk] = new double[m_Record];
|
||||||
}
|
//}
|
||||||
|
|
||||||
for (int i=0; i<m_Record; i++)
|
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]);
|
double val = GetData(_wave.RepCode,(char *)&value[(kk)*_wave.CodeLen+i*_nSamples*_wave.CodeLen]);
|
||||||
wavedata[kk][i] = val;
|
wavedata[kk][i] = val;
|
||||||
|
|
@ -2634,51 +2637,57 @@ void FormDraw::initWave(QMyCustomPlot *widget, QString strSlfName, QString strWa
|
||||||
widget->xAxis = yAxis;
|
widget->xAxis = yAxis;
|
||||||
widget->yAxis = xAxis;
|
widget->yAxis = xAxis;
|
||||||
|
|
||||||
//-------------------
|
widget->m_fmin = vmin;
|
||||||
// set up the QCPColorMap:
|
widget->m_fmax = vmax;
|
||||||
QCPColorMap *colorMap = new QCPColorMap(widget->xAxis, widget->yAxis);
|
|
||||||
int nx = m_Record;
|
//-------------------
|
||||||
int ny = _nSamples;
|
// set up the QCPColorMap:
|
||||||
colorMap->data()->setSize(nx, ny); // 我们希望彩色地图有nx*ny的数据点
|
QCPColorMap *colorMap = new QCPColorMap(widget->xAxis, widget->yAxis);
|
||||||
//colorMap->data()->setRange(QCPRange(m_iY1, m_iY2), QCPRange(vmin, vmax)); // 并在键(x)和值(y)维上跨越坐标范围-4..4
|
widget->m_colorMap = colorMap;
|
||||||
colorMap->data()->setRange(QCPRange(0-_EDep, 0-_SDep), QCPRange(vmin, vmax));
|
|
||||||
// :现在,我们通过访问颜色贴图的QCPColorMapData实例来分配一些数据:
|
int nx = m_Record;
|
||||||
double x, y, z;
|
int ny = _nSamples;
|
||||||
for (int xIndex=0; xIndex<nx; ++xIndex)
|
colorMap->data()->setSize(nx, ny); // 我们希望彩色地图有nx*ny的数据点
|
||||||
{
|
//colorMap->data()->setRange(QCPRange(m_iY1, m_iY2), QCPRange(vmin, vmax)); // 并在键(x)和值(y)维上跨越坐标范围-4..4
|
||||||
for (int yIndex=0; yIndex<ny; ++yIndex)
|
colorMap->data()->setRange(QCPRange(0 - _EDep, 0 - _SDep), QCPRange(vmin, vmax));
|
||||||
{
|
// :现在,我们通过访问颜色贴图的QCPColorMapData实例来分配一些数据:
|
||||||
if(wavedata[yIndex][xIndex]==-9999)
|
for (int xIndex = 0; xIndex < nx; ++xIndex)
|
||||||
{
|
{
|
||||||
colorMap->data()->setCell(nx-xIndex-1, yIndex, vmin);
|
for (int yIndex = 0; yIndex < ny; ++yIndex)
|
||||||
continue;
|
{
|
||||||
}
|
if (wavedata[yIndex][xIndex] == -9999)
|
||||||
//colorMap->data()->setCell(xIndex, yIndex, wavedata[yIndex][xIndex]);
|
{
|
||||||
colorMap->data()->setCell(nx-xIndex-1, yIndex, wavedata[yIndex][xIndex]);
|
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();
|
||||||
|
|
||||||
|
|
||||||
// 添加色标:
|
|
||||||
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)
|
void FormDraw::initWave_3D(QMyCustomPlot *widget, QString strSlfName, QString strWaveName, int &_nSamples)
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,12 @@ FormInfo::FormInfo(QWidget *parent, QString strSlfName, QString strWellName, QSt
|
||||||
//修改曲线选择状态 iSelect=0未知,1标准曲线,2主曲线,3从曲线
|
//修改曲线选择状态 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)));
|
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()
|
FormInfo::~FormInfo()
|
||||||
|
|
@ -171,8 +177,7 @@ void FormInfo::paintEvent(QPaintEvent* event)
|
||||||
painter.drawRect(rectRound);
|
painter.drawRect(rectRound);
|
||||||
|
|
||||||
painter.setBrush(Qt::NoBrush); // 确保文字不被填充色遮挡
|
painter.setBrush(Qt::NoBrush); // 确保文字不被填充色遮挡
|
||||||
QFont font1("微软雅黑", 10, false, false); //fontSize 10
|
painter.setFont(m_curveNameFont);
|
||||||
painter.setFont(font1);
|
|
||||||
painter.setPen(m_lineColor); // fontColor QColor(220, 220, 220)
|
painter.setPen(m_lineColor); // fontColor QColor(220, 220, 220)
|
||||||
//painter.drawText(rect.left() + 20, 30, m_strAliasName); // titleBarText QStringLiteral("动画")
|
//painter.drawText(rect.left() + 20, 30, m_strAliasName); // titleBarText QStringLiteral("动画")
|
||||||
//painter.drawText(rect, Qt::AlignCenter, m_strAliasName);
|
//painter.drawText(rect, Qt::AlignCenter, m_strAliasName);
|
||||||
|
|
@ -277,8 +282,7 @@ void FormInfo::paintEvent(QPaintEvent* event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QFont font2("微软雅黑", 8, false, false);
|
painter.setFont(m_curveUnitFont);
|
||||||
painter.setFont(font2);
|
|
||||||
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));
|
||||||
|
|
@ -342,7 +346,17 @@ void FormInfo::paintEvent(QPaintEvent* event)
|
||||||
if(m_strType=="waveObject"
|
if(m_strType=="waveObject"
|
||||||
|| m_strType=="curveObject")
|
|| m_strType=="curveObject")
|
||||||
{
|
{
|
||||||
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()+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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -500,6 +514,55 @@ QColor FormInfo::getBackColor()
|
||||||
return m_backColor;
|
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从曲线
|
//修改曲线选择状态 iSelect=0未知,1标准曲线,2主曲线,3从曲线
|
||||||
void FormInfo::s_ChangeLineStatus(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int iSelect, bool bMerge)
|
void FormInfo::s_ChangeLineStatus(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int iSelect, bool bMerge)
|
||||||
{
|
{
|
||||||
|
|
@ -640,3 +703,4 @@ void FormInfo::s_ChangeFillMode(QString strUuid, QString strSlfName, QString str
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,10 @@ public:
|
||||||
float m_vmax;//右刻度
|
float m_vmax;//右刻度
|
||||||
QString m_strScaleType;//刻度类型(线性,对数)
|
QString m_strScaleType;//刻度类型(线性,对数)
|
||||||
|
|
||||||
|
QFont m_curveNameFont; // 曲线名称
|
||||||
|
QFont m_curveUnitFont; // 曲线单位
|
||||||
|
QFont m_curveScaleFont; // 曲线刻度
|
||||||
|
|
||||||
//岩性填充
|
//岩性填充
|
||||||
QString m_newHeadFill;//头部图例
|
QString m_newHeadFill;//头部图例
|
||||||
QString m_newTargetLine;//目标曲线
|
QString m_newTargetLine;//目标曲线
|
||||||
|
|
@ -93,6 +97,13 @@ public:
|
||||||
|
|
||||||
int m_nJg;
|
int m_nJg;
|
||||||
|
|
||||||
|
|
||||||
|
QString m_strDrawType; // 绘图类型
|
||||||
|
QString m_strFillType; // 填充类型
|
||||||
|
QString m_strAmp; // 幅度刻度
|
||||||
|
float m_fMaxAmp; // 最大振幅
|
||||||
|
bool m_bShowScale; // 显示刻度
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void setLineWidth(double dWidth);
|
void setLineWidth(double dWidth);
|
||||||
double getLineWidth();
|
double getLineWidth();
|
||||||
|
|
@ -112,6 +123,8 @@ public:
|
||||||
void setBackColor(QColor backColor);
|
void setBackColor(QColor backColor);
|
||||||
QColor getBackColor();
|
QColor getBackColor();
|
||||||
|
|
||||||
|
bool setInfoProperty(QString strProName, QVariant val);
|
||||||
|
|
||||||
QJsonObject makeJson();
|
QJsonObject makeJson();
|
||||||
|
|
||||||
//public:
|
//public:
|
||||||
|
|
@ -133,4 +146,5 @@ private:
|
||||||
QPoint startPosition;
|
QPoint startPosition;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // FORMINFO_H
|
#endif // FORMINFO_H
|
||||||
|
|
|
||||||
|
|
@ -321,8 +321,8 @@ void FormTrack::s_addWave(QString strSlfName, QString strWellName, QString strTr
|
||||||
//ui->tableWidget->resize(g_iOneWidth, 100*(row + 1)+10);
|
//ui->tableWidget->resize(g_iOneWidth, 100*(row + 1)+10);
|
||||||
//this->resize(g_iOneWidth, 100*(row + 1)+30);
|
//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_strUuid = m_strUuid;
|
||||||
formInfo->m_strAliasName = strAliasName;
|
formInfo->m_strAliasName = strAliasName;
|
||||||
formInfo->m_strUnit = strUnit;
|
formInfo->m_strUnit = strUnit;
|
||||||
|
|
@ -331,8 +331,12 @@ void FormTrack::s_addWave(QString strSlfName, QString strWellName, QString strTr
|
||||||
formInfo->setLineWidth(dWidth);
|
formInfo->setLineWidth(dWidth);
|
||||||
formInfo->setVMax(vmax);
|
formInfo->setVMax(vmax);
|
||||||
formInfo->setVMin(vmin);
|
formInfo->setVMin(vmin);
|
||||||
formInfo->setFrontColor(QColor(0,0,0));
|
|
||||||
formInfo->setBackColor(QColor(255,255,255));
|
formInfo->m_curveNameFont = QFont("黑体", 12);
|
||||||
|
formInfo->m_curveUnitFont = QFont("黑体", 10);
|
||||||
|
formInfo->m_curveScaleFont = QFont("黑体", 10);
|
||||||
|
formInfo->m_fMaxAmp = 1023.0f;
|
||||||
|
|
||||||
//设置高度
|
//设置高度
|
||||||
ui->tableWidget->setRowHeight(row, 100);
|
ui->tableWidget->setRowHeight(row, 100);
|
||||||
//单元格委托
|
//单元格委托
|
||||||
|
|
@ -340,17 +344,6 @@ void FormTrack::s_addWave(QString strSlfName, QString strWellName, QString strTr
|
||||||
//
|
//
|
||||||
ui->tableWidget->setCellWidget(row, 0, formInfo);
|
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)
|
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)
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,74 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel
|
||||||
|
|
||||||
//Plot重新加载数据
|
//Plot重新加载数据
|
||||||
connect(CallManage::getInstance(), SIGNAL(sig_ReloadPlot(QString, QString, QString)), this, SLOT(s_ReloadPlot(QString, QString, QString)));
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
//蝌蚪图,重绘网格线
|
//蝌蚪图,重绘网格线
|
||||||
|
|
@ -745,6 +813,44 @@ void QMyCustomPlot::s_ReloadPlot(QString strUuid, QString strSlfName, QString st
|
||||||
replot(QCustomPlot::rpQueuedReplot); //刷新曲线
|
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)
|
void QMyCustomPlot::addLineToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor)
|
||||||
{
|
{
|
||||||
QtCommonClass *qtCommon = new QtCommonClass(this);
|
QtCommonClass *qtCommon = new QtCommonClass(this);
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@ public:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double** getWavedata(int nrow, int ncol);
|
||||||
|
QCPColorMap * updateWave();
|
||||||
protected:
|
protected:
|
||||||
//virtual void mouseMoveEvent(QMouseEvent *event);
|
//virtual void mouseMoveEvent(QMouseEvent *event);
|
||||||
|
|
||||||
|
|
@ -61,7 +63,15 @@ public:
|
||||||
bool singleDragMove = false;
|
bool singleDragMove = false;
|
||||||
float singleOldPosition = 0;
|
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:
|
public:
|
||||||
//分段刷新
|
//分段刷新
|
||||||
QVector<double> m_x;
|
QVector<double> m_x;
|
||||||
|
|
@ -178,6 +188,8 @@ public slots:
|
||||||
//Plot重新加载数据
|
//Plot重新加载数据
|
||||||
void s_ReloadPlot(QString strUuid, QString strSlfName, QString strLineName);
|
void s_ReloadPlot(QString strUuid, QString strSlfName, QString strLineName);
|
||||||
|
|
||||||
|
void s_changeDrawProperty(QVariantList vlist);
|
||||||
|
|
||||||
void onAddRect();
|
void onAddRect();
|
||||||
|
|
||||||
//蝌蚪图重绘网格线
|
//蝌蚪图重绘网格线
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user