修改道宽问题。
This commit is contained in:
parent
349f9910b0
commit
1287c199a0
|
|
@ -117,7 +117,7 @@ void FormDraw::setDrawData(QStringList listdt, QJsonObject objInfo)
|
|||
QString strSlfName = listdt.at(2);
|
||||
QString strLineName = listdt.at(3);
|
||||
QString strType = listdt.at(4);
|
||||
int nW = listdt.at(5).toInt();
|
||||
double dW = listdt.at(5).toDouble();
|
||||
|
||||
m_strSlfName = strSlfName;
|
||||
if(m_listLineName.contains(strLineName))
|
||||
|
|
@ -152,7 +152,7 @@ void FormDraw::setDrawData(QStringList listdt, QJsonObject objInfo)
|
|||
curv->m_bColGridVisible = false;
|
||||
}
|
||||
curv->setDepthY(m_iY1, m_iY2);
|
||||
curv->initGeometry(m_strUuid, m_iScale, nW);
|
||||
curv->initGeometry(m_strUuid, m_iScale, dW);
|
||||
curv->show();
|
||||
|
||||
if ("waveObject" == strType)
|
||||
|
|
|
|||
|
|
@ -84,12 +84,12 @@ void FormWell::resizeEvent(QResizeEvent *event)
|
|||
//重设表格高度
|
||||
}
|
||||
|
||||
int FormWell::insertColumn(int nw)
|
||||
int FormWell::insertColumn(double dw)
|
||||
{
|
||||
auto table = ui->tableWidget;
|
||||
int ncolCount = table->columnCount();
|
||||
table->insertColumn(ncolCount);
|
||||
table->setColumnWidth(ncolCount, nw * g_dPixelPerCm);
|
||||
table->setColumnWidth(ncolCount, dw * g_dPixelPerCm);
|
||||
|
||||
table->setHorizontalHeaderItem(ncolCount, new QTableWidgetItem(""));
|
||||
// ncolCount = table->columnCount();
|
||||
|
|
@ -126,7 +126,7 @@ QVector<QWidget *> FormWell::new_track(QStringList listdt, QString strTrackName)
|
|||
QString strSlfName = listdt.at(2);
|
||||
QString strLineName = listdt.at(3);
|
||||
QString strType = listdt.at(4);
|
||||
double nW = listdt.at(5).toDouble();
|
||||
double dW = listdt.at(5).toDouble();
|
||||
|
||||
//判断当前井是否与自己同名
|
||||
if(strUuid != m_strUuid || strWellName != m_strWellName)
|
||||
|
|
@ -134,11 +134,11 @@ QVector<QWidget *> FormWell::new_track(QStringList listdt, QString strTrackName)
|
|||
return vec;
|
||||
}
|
||||
|
||||
if(nW <= 0)
|
||||
nW = g_iOneWidth;
|
||||
if(dW <= 0)
|
||||
dW = g_iOneWidth;
|
||||
|
||||
//增加1列
|
||||
int columnCount = this->insertColumn(nW);
|
||||
int columnCount = this->insertColumn(dW);
|
||||
|
||||
if(strTrackName.length() <= 0)
|
||||
{
|
||||
|
|
@ -208,7 +208,7 @@ QVector<QWidget *> FormWell::new_track(QStringList listdt, QString strTrackName)
|
|||
// trackTop->setFixedWidth(nW/2);
|
||||
vec << trackTop;
|
||||
trackTop->m_strUuid = m_strUuid;
|
||||
trackTop->m_nTrackW = nW;// / static_cast<int>(g_dPixelPerCm);
|
||||
trackTop->m_nTrackW = dW;// / static_cast<int>(g_dPixelPerCm);
|
||||
ui->tableWidget->setCellWidget(i, columnCount, trackTop);
|
||||
}
|
||||
else if(i==1)
|
||||
|
|
@ -259,7 +259,7 @@ QVector<QWidget *> FormWell::new_track(QStringList listdt, QString strTrackName)
|
|||
formDraw->m_strSlfName = strSlfName;
|
||||
formDraw->m_formTrack = formTrack;
|
||||
formDraw->m_iScale = m_iScale;
|
||||
formDraw->m_nTrackW = nW;
|
||||
formDraw->m_nTrackW = dW;
|
||||
|
||||
ui->tableWidget->setCellWidget(i, columnCount, formDraw);//默认用formDraw填充满
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ public:
|
|||
~FormWell();
|
||||
|
||||
// 插入列,返回列索引
|
||||
int insertColumn(int nw);
|
||||
int insertColumn(double dw);
|
||||
|
||||
QVector<QWidget*> new_track(QStringList listdt, QString strTrackName = "");
|
||||
|
||||
|
|
|
|||
|
|
@ -4467,8 +4467,8 @@ void MainWindowCurve::DisplayTracks(QJsonArray tracksArray)
|
|||
QJsonValue trackValue = tracksArray[iNum];
|
||||
QJsonObject trackObj = trackValue.toObject();
|
||||
//
|
||||
QString strTrackName = "";
|
||||
double nTrackW = 0;
|
||||
//QString strTrackName = "";
|
||||
//double nTrackW = 0;
|
||||
if (trackObj.contains("topinfo") && trackObj.contains("info"))
|
||||
{
|
||||
QJsonValue topVal = trackObj.value("topinfo");
|
||||
|
|
@ -4480,8 +4480,8 @@ void MainWindowCurve::DisplayTracks(QJsonArray tracksArray)
|
|||
//展示其中一道
|
||||
DisplayTrack_Top(id, topObj, infoObj);
|
||||
|
||||
strTrackName = topObj.value("TrackName").toString();
|
||||
nTrackW = topObj.value("TrackW").toDouble();
|
||||
//strTrackName = topObj.value("TrackName").toString();
|
||||
//nTrackW = topObj.value("TrackW").toDouble();
|
||||
}
|
||||
}
|
||||
// if (trackObj.contains("info"))
|
||||
|
|
@ -4522,346 +4522,16 @@ void MainWindowCurve::DisplayTrack_Top(int id, QJsonObject trackTop, QJsonObject
|
|||
if(id==0)
|
||||
{
|
||||
//第一道,默认减掉空井宽g_iOneWidth
|
||||
s_NewTrackChangeWidth(strWellName, nW * g_dPixelPerCm - g_iOneWidth * g_dPixelPerCm);
|
||||
s_NewTrackChangeWidth(strWellName, nW - g_iOneWidth);
|
||||
}
|
||||
else
|
||||
{
|
||||
s_NewTrackChangeWidth(strWellName, nW * g_dPixelPerCm);
|
||||
s_NewTrackChangeWidth(strWellName, nW);
|
||||
}
|
||||
//mainWindowCurve->s_NewTrackChangeWidth(strWellName);
|
||||
}
|
||||
}
|
||||
|
||||
//展示其中一道
|
||||
void MainWindowCurve::DisplayTrack_One(QJsonObject trackObjInfo, QString strTrackName, int nW)
|
||||
{
|
||||
//
|
||||
if (trackObjInfo.contains("formInfos"))
|
||||
{
|
||||
QJsonValue value = trackObjInfo.value("formInfos");
|
||||
if (value.isArray()) {
|
||||
QJsonArray linesArray = value.toArray();
|
||||
qDebug() << "linesArray number:" << QString::number(linesArray.size());
|
||||
//展示所有曲线
|
||||
DisplayLines(linesArray, strTrackName, nW);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//展示所有曲线
|
||||
void MainWindowCurve::DisplayLines(QJsonArray linesArray, QString strTrackName, int nW)
|
||||
{
|
||||
QMap<int, int> mapLines;
|
||||
|
||||
int id = 0;
|
||||
int iCount = linesArray.size();
|
||||
for(int i=0; i<iCount; i++)
|
||||
{
|
||||
QJsonValue lineValue = linesArray[i];
|
||||
|
||||
QJsonObject lineObj = lineValue.toObject();
|
||||
//
|
||||
if (lineObj.contains("id"))
|
||||
{
|
||||
QJsonValue value = lineObj.value("id");
|
||||
if (value.isDouble()) {
|
||||
id = value.toInt();
|
||||
qDebug() << "id:" << QString::number(id);
|
||||
//
|
||||
mapLines.insert(id, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(int id=0; id<iCount; id++)
|
||||
{
|
||||
if(mapLines.contains(id))
|
||||
{
|
||||
int iNum = mapLines.value(id);
|
||||
//按照id顺序,展示曲线
|
||||
QJsonValue lineValue = linesArray[iNum];
|
||||
QJsonObject lineObj = lineValue.toObject();
|
||||
//
|
||||
if (lineObj.contains("info"))
|
||||
{
|
||||
QJsonValue value = lineObj.value("info");
|
||||
if (value.isObject()) {
|
||||
QJsonObject lineObjInfo = value.toObject();
|
||||
|
||||
//展示其中一条曲线
|
||||
if(lineObjInfo.value("Type").toString() == "curveObject")
|
||||
{
|
||||
DisplayLine_One(lineObjInfo, strTrackName);
|
||||
}
|
||||
else
|
||||
{
|
||||
DisplayType_One(lineObjInfo, strTrackName, nW);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//展示其中一条曲线
|
||||
void MainWindowCurve::DisplayLine_One(QJsonObject lineObjInfo, QString strTrackName)
|
||||
{
|
||||
QString strSlfName = "";
|
||||
QString strWellName = "";
|
||||
// QString strTrackName = "";
|
||||
QString strLineName = "";
|
||||
QString strAliasName = "";//显示名称
|
||||
QString strUnit = "";//单位
|
||||
//
|
||||
double newLeftScale = 0;//左刻度
|
||||
double newRightScale = 500;//右刻度
|
||||
QString strScaleType;//刻度类型(线性,对数)
|
||||
//
|
||||
double width = 3;//线宽
|
||||
QColor lineColor = QColor(0,0,0);//颜色
|
||||
Qt::PenStyle lineStyle = Qt::SolidLine;//线形
|
||||
//岩性填充
|
||||
QString newHeadFill;//头部图例
|
||||
QString newTargetLine;//目标曲线
|
||||
QString newFillType;//填充类型
|
||||
QString newFillMode;//填充模式
|
||||
QColor newColor;//填充颜色
|
||||
QString newLithosImage = "";//岩性图片
|
||||
float new_vMin;//其他目标曲线
|
||||
float new_vMax;//其他目标曲线
|
||||
QString strOtherScaleType;//其他目标曲线,刻度类型(线性,对数)
|
||||
QColor frontColor(0, 0, 0);//岩性前景色
|
||||
QColor backColor(255, 255, 255);//岩性背景色
|
||||
|
||||
if (lineObjInfo.contains("SlfName"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("SlfName");
|
||||
if (value.isString()) {
|
||||
strSlfName = value.toString();
|
||||
//qDebug() << "SlfName:" << strSlfName;
|
||||
|
||||
//
|
||||
QString slffilename=QString("");
|
||||
int ind=strSlfName.lastIndexOf('\\');
|
||||
int ind2=strSlfName.lastIndexOf('/');
|
||||
if(ind2>ind) ind=ind2;
|
||||
if(ind>-1) {
|
||||
slffilename = strSlfName.mid(ind+1);
|
||||
strSlfName = slffilename;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (lineObjInfo.contains("WellName"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("WellName");
|
||||
if (value.isString()) {
|
||||
strWellName = value.toString();
|
||||
//qDebug() << "WellName:" << strWellName;
|
||||
}
|
||||
}
|
||||
// if (lineObjInfo.contains("TrackName"))
|
||||
// {
|
||||
// QJsonValue value = lineObjInfo.value("TrackName");
|
||||
// if (value.isString()) {
|
||||
// strTrackName = value.toString();
|
||||
// //qDebug() << "TrackName:" << strTrackName;
|
||||
// }
|
||||
// }
|
||||
if (lineObjInfo.contains("LineName"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("LineName");
|
||||
if (value.isString()) {
|
||||
strLineName = value.toString();
|
||||
//qDebug() << "LineName:" << strLineName;
|
||||
}
|
||||
}
|
||||
if (lineObjInfo.contains("AliasName"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("AliasName");
|
||||
if (value.isString()) {
|
||||
strAliasName = value.toString();
|
||||
//qDebug() << "strAliasName:" << strAliasName;
|
||||
}
|
||||
}
|
||||
if (lineObjInfo.contains("Unit"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("Unit");
|
||||
if (value.isString()) {
|
||||
strUnit = value.toString();
|
||||
//qDebug() << "strUnit:" << strUnit;
|
||||
}
|
||||
}
|
||||
|
||||
if (lineObjInfo.contains("vmin"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("vmin");
|
||||
if (value.isDouble()) {
|
||||
newLeftScale = value.toDouble();
|
||||
//qDebug() << "vmin:" << QString::number(newLeftScale);
|
||||
}
|
||||
}
|
||||
if (lineObjInfo.contains("vmax"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("vmax");
|
||||
if (value.isDouble()) {
|
||||
newRightScale = value.toDouble();
|
||||
//qDebug() << "vmax:" << QString::number(newRightScale);
|
||||
}
|
||||
}
|
||||
if (lineObjInfo.contains("ScaleType"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("ScaleType");
|
||||
if (value.isString()) {
|
||||
strScaleType = value.toString();
|
||||
//qDebug() << "ScaleType:" << strScaleType;
|
||||
}
|
||||
}
|
||||
if (lineObjInfo.contains("Width"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("Width");
|
||||
if (value.isDouble()) {
|
||||
width = value.toDouble();
|
||||
//qDebug() << "Width:" << QString::number(width);
|
||||
}
|
||||
}
|
||||
|
||||
if (lineObjInfo.contains("lineStyle"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("lineStyle");
|
||||
if (value.isDouble()) {
|
||||
lineStyle = (Qt::PenStyle)value.toInt();
|
||||
//qDebug() << "lineStyle:" << QString::number(lineStyle);
|
||||
}
|
||||
}
|
||||
//
|
||||
if (lineObjInfo.contains("lineColor"))
|
||||
{
|
||||
lineColor.setNamedColor(lineObjInfo.value("lineColor").toString());
|
||||
}
|
||||
|
||||
QString folderPath = GetLogdataPath();
|
||||
folderPath = folderPath + g_prjname;
|
||||
strSlfName = folderPath + "/" + "#" + strWellName + "/" + strSlfName;
|
||||
|
||||
if(strLineName!="")
|
||||
{
|
||||
QStringList listOtherProperty;
|
||||
listOtherProperty.append(strAliasName);
|
||||
listOtherProperty.append(strUnit);
|
||||
//新建曲线
|
||||
s_AddLine_Property(strSlfName, strWellName, strTrackName, strLineName,
|
||||
newLeftScale, newRightScale, strScaleType, lineColor, width, lineStyle, listOtherProperty);
|
||||
}
|
||||
|
||||
//---------------
|
||||
if (lineObjInfo.contains("newHeadFill"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("newHeadFill");
|
||||
if (value.isString()) {
|
||||
newHeadFill = value.toString();
|
||||
//qDebug() << "newHeadFill:" << newHeadFill;
|
||||
}
|
||||
}
|
||||
if (lineObjInfo.contains("newTargetLine"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("newTargetLine");
|
||||
if (value.isString()) {
|
||||
newTargetLine = value.toString();
|
||||
//qDebug() << "newTargetLine:" << newTargetLine;
|
||||
}
|
||||
}
|
||||
if (lineObjInfo.contains("newFillType"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("newFillType");
|
||||
if (value.isString()) {
|
||||
newFillType = value.toString();
|
||||
//qDebug() << "newFillType:" << newFillType;
|
||||
}
|
||||
}
|
||||
if (lineObjInfo.contains("newFillMode"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("newFillMode");
|
||||
if (value.isString()) {
|
||||
newFillMode = value.toString();
|
||||
//qDebug() << "newFillMode:" << newFillMode;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
if (lineObjInfo.contains("newColor"))
|
||||
{
|
||||
newColor.setNamedColor(lineObjInfo.value("newColor").toString());
|
||||
}
|
||||
|
||||
if (lineObjInfo.contains("newLithosImage"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("newLithosImage");
|
||||
if (value.isString()) {
|
||||
newLithosImage = value.toString();
|
||||
//qDebug() << "newLithosImage:" << newLithosImage;
|
||||
}
|
||||
}
|
||||
if (lineObjInfo.contains("new_vMin"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("new_vMin");
|
||||
if (value.isDouble()) {
|
||||
new_vMin = value.toDouble();
|
||||
//qDebug() << "new_vMin:" << QString::number(new_vMin);
|
||||
}
|
||||
}
|
||||
if (lineObjInfo.contains("new_vMax"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("new_vMax");
|
||||
if (value.isDouble()) {
|
||||
new_vMax = value.toDouble();
|
||||
//qDebug() << "new_vMax:" << QString::number(new_vMax);
|
||||
}
|
||||
}
|
||||
//
|
||||
if (lineObjInfo.contains("frontColor"))
|
||||
{
|
||||
frontColor.setNamedColor(lineObjInfo.value("frontColor").toString());
|
||||
}
|
||||
|
||||
//
|
||||
if (lineObjInfo.contains("backColor"))
|
||||
{
|
||||
backColor.setNamedColor(lineObjInfo.value("backColor").toString());
|
||||
}
|
||||
|
||||
//
|
||||
if(newFillMode=="无填充")
|
||||
{
|
||||
//emit CallManage::getInstance()->sig_ClearFillMode(m_strUuid, strSlfName, strWellName, strTrackName, strLineName);
|
||||
}
|
||||
else //if(newFillMode=="填充")
|
||||
{
|
||||
//模板不立刻填充,bFillNow=false
|
||||
emit CallManage::getInstance()->sig_ChangeFillMode(m_strUuid, strSlfName, strWellName, strTrackName, strLineName,
|
||||
newFillType, newTargetLine, newColor, newLithosImage, newHeadFill,
|
||||
new_vMin, new_vMax, strOtherScaleType, frontColor, backColor, newFillMode, false);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindowCurve::DisplayType_One(QJsonObject lineObjInfo, QString strTrackName, int nW)
|
||||
{
|
||||
//nW = nW * static_cast<int>(g_dPixelPerCm);
|
||||
QStringList sret = this->insertCol(nW);
|
||||
if(sret.length() <= 0)
|
||||
return;
|
||||
|
||||
QStringList dt;
|
||||
dt << m_strUuid;
|
||||
dt << sret.at(0);
|
||||
dt << sret.at(1);
|
||||
dt << "";
|
||||
dt << "roseObject";
|
||||
dt << QString::number(nW);
|
||||
//新建道
|
||||
emit CallManage::getInstance()->sig_NewCol(dt);
|
||||
}
|
||||
|
||||
void MainWindowCurve::resizeItem(QString strWellName, double colWidth, double rowHight)
|
||||
{
|
||||
int column = ui->tableWidget_2->columnCount();
|
||||
|
|
|
|||
|
|
@ -100,15 +100,6 @@ public:
|
|||
|
||||
void DisplayTrack_Top(int id, QJsonObject trackTop, QJsonObject trackInfo);
|
||||
|
||||
//展示其中一道
|
||||
void DisplayTrack_One(QJsonObject trackObjInfo, QString strTrackName, int nW);
|
||||
//展示所有曲线
|
||||
void DisplayLines(QJsonArray linesArray, QString strTrackName, int nW);
|
||||
//展示其中一条曲线
|
||||
void DisplayLine_One(QJsonObject lineObjInfo, QString strTrackName);
|
||||
|
||||
void DisplayType_One(QJsonObject lineObjInfo, QString strTrackName, int nW);
|
||||
|
||||
void Open(QString fileFull);//打开
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel
|
|||
connect(CallManage::getInstance(), SIGNAL(sig_changeGuanD(QString, QString, QString, QString, QString, QString, double)), this, SLOT(s_changeGuanD(QString, QString, QString, QString, QString, QString, double)));
|
||||
}
|
||||
|
||||
void QMyCustomPlot::initGeometry(QString strUuid, int nscale, int nW)
|
||||
void QMyCustomPlot::initGeometry(QString strUuid, int nscale, double fW)
|
||||
{
|
||||
this->m_strUuid = strUuid;
|
||||
|
||||
|
|
@ -227,7 +227,7 @@ void QMyCustomPlot::initGeometry(QString strUuid, int nscale, int nW)
|
|||
dHight = 32767;
|
||||
}
|
||||
|
||||
int ntmpw = nW * g_dPixelPerCm;
|
||||
int ntmpw = fW * g_dPixelPerCm;
|
||||
this->setGeometry(0, 0, ntmpw - 2, (int)dHight);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
void initGeometry(QString strUuid, int nscale, int nW);
|
||||
void initGeometry(QString strUuid, int nscale, double fW);
|
||||
|
||||
void changePropertyWaveUpdate();
|
||||
// 绘图类型-变密度(成像)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user