1.修改道名称,道字体颜色等属性修改后实时渲染
2.修改保存可视解释属性,保存道名称,道字体颜色等属性到josn文件 3.修改读取可视解释逻辑,读取后根据属性显示对应的效果
This commit is contained in:
parent
a2853b1c17
commit
bfa8d8ec44
|
|
@ -47,7 +47,7 @@ signals:
|
|||
void sig_NewCol(QStringList listdt);
|
||||
void sig_NewTrack(QString strUuid, QString strWellName, QString strSlfName, QString strLineName, QString strType, int nW = 0);//新建道
|
||||
void sig_NewTrack_No_Line(QString strUuid, QString strWellName, QString strTrackName);//新建空白道,没有曲线
|
||||
void sig_NewTrack_No_Line(QString strUuid, QJsonObject obj);//新建空白道,没有曲线
|
||||
void sig_NewTrack_No_Line(QString strUuid, QJsonObject topObj, QJsonObject infoObj);//新建空白道,没有曲线
|
||||
void sig_AddLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);//新建曲线
|
||||
void sig_AddLine_Property(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName,
|
||||
double newLeftScale, double newRightScale, QString strScaleType, QColor lineColor, double width, Qt::PenStyle lineStyle);//新建曲线,带属性
|
||||
|
|
|
|||
|
|
@ -994,6 +994,19 @@ void PropertyWidget::initHeadProperty(FormHead *formHead, QTableWidget *tableWid
|
|||
|
||||
void PropertyWidget::initDepthProperty(FormInfo *formInfo)
|
||||
{
|
||||
//
|
||||
_CreateVariantPropertyItem("通常", "显示名称", formInfo->m_strAliasName, QVariant::String);
|
||||
//
|
||||
_CreateVariantPropertyItem("深度标注", "间隔", formInfo->m_nJg, QVariant::String);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void PropertyWidget::initProperty(FormInfo *formInfo)
|
||||
{
|
||||
if (formInfo == NULL)
|
||||
return;
|
||||
|
||||
//初始化,清空
|
||||
InitCurrentViewInfo();
|
||||
m_strUuid = formInfo->m_strUuid;
|
||||
|
|
@ -1004,11 +1017,44 @@ void PropertyWidget::initDepthProperty(FormInfo *formInfo)
|
|||
m_strTrackName = formInfo->m_strTrackName;
|
||||
m_strLineName = formInfo->m_strLineName;
|
||||
|
||||
//
|
||||
_CreateVariantPropertyItem("通常", "显示名称", formInfo->m_strAliasName, QVariant::String);
|
||||
//
|
||||
_CreateVariantPropertyItem("深度标注", "间隔", formInfo->m_nJg, QVariant::String);
|
||||
|
||||
if (formInfo->m_strType == "depthObject")
|
||||
{
|
||||
this->initDepthProperty(formInfo);
|
||||
}
|
||||
else if (formInfo->m_strType == "roseObject")
|
||||
{
|
||||
this->initRoseProperty(formInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void PropertyWidget::initRoseProperty(FormInfo *formInfo)
|
||||
{
|
||||
//
|
||||
_CreateVariantPropertyItem("数据", "名称", formInfo->m_strAliasName, QVariant::String);
|
||||
|
||||
QStringList listType;
|
||||
listType.append("曲线型数据");
|
||||
listType.append("表格型数据");
|
||||
_CreateEnumPropertyItem("数据", "数据类型", listType.indexOf("曲线型数据"), listType);
|
||||
_CreateVariantPropertyItem("数据", "显示单位", "°", QVariant::String);
|
||||
_CreateVariantPropertyItem("数据", "井文件名称", m_strSlfName, QVariant::String);
|
||||
_CreateVariantPropertyItem("数据", "方位曲线", "STRDIR", QVariant::String);
|
||||
_CreateVariantPropertyItem("数据", "倾角曲线", "CALM", QVariant::String);
|
||||
//
|
||||
_CreateVariantPropertyItem("玫瑰图", "扇形", 36, QVariant::Int);
|
||||
_CreateVariantPropertyItem("玫瑰图", "圆半径(cm)", 1, QVariant::Int);
|
||||
_CreateVariantPropertyItem("玫瑰图", "辐射圈", 9, QVariant::Int);
|
||||
_CreateVariantPropertyItem("玫瑰图", "方位打印间隔", 3, QVariant::Int);
|
||||
_CreateVariantPropertyItem("玫瑰图", "圆线颜色", QColor(0,0,0), QVariant::Color);
|
||||
_CreateVariantPropertyItem("玫瑰图", "圆线宽度", 2, QVariant::Int);
|
||||
_CreateVariantPropertyItem("玫瑰图", "应力线颜色", QColor(255, 170, 0), QVariant::Color);
|
||||
_CreateVariantPropertyItem("玫瑰图", "垮塌线颜色", QColor(0, 0, 255), QVariant::Color);
|
||||
_CreateVariantPropertyItem("玫瑰图", "绘制辐射线?", true, QVariant::Bool);
|
||||
_CreateVariantPropertyItem("玫瑰图", "绘制井眼垮塌", true, QVariant::Bool);
|
||||
_CreateVariantPropertyItem("玫瑰图", "是否填充", true, QVariant::Bool);
|
||||
_CreateVariantPropertyItem("玫瑰图", "是否绘制标注?", true, QVariant::Bool);
|
||||
// _CreateVariantPropertyItem("玫瑰图", "道头字体", fromTop->m_font, QVariant::Font);
|
||||
// _CreateVariantPropertyItem("玫瑰图", "道头字颜色", fromTop->m_fontColor, QVariant::Color);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -102,6 +102,10 @@ public:
|
|||
|
||||
void initDepthProperty(FormInfo *formInfo);
|
||||
|
||||
void initProperty(FormInfo *formInfo);
|
||||
|
||||
void initRoseProperty(FormInfo *formInfo);
|
||||
|
||||
void ChangFillProperty();//填充属性改变
|
||||
|
||||
void ChangHeadItemProperty();//图头项改变
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ extern int g_iX2;
|
|||
extern int g_iCanZoom ;
|
||||
//
|
||||
extern double g_dPixelPerCm;//每厘米像素数
|
||||
|
||||
extern QString g_prjname;
|
||||
|
||||
extern int g_iSupport3D;
|
||||
|
||||
|
|
@ -186,6 +186,438 @@ void FormDraw::setDrawData(QStringList listdt)
|
|||
}
|
||||
|
||||
|
||||
void FormDraw::setDrawPropert(QJsonObject objInfo)
|
||||
{
|
||||
if (objInfo.contains("formInfos"))
|
||||
{
|
||||
QJsonValue value = objInfo.value("formInfos");
|
||||
if (value.isArray()) {
|
||||
QJsonArray linesArray = value.toArray();
|
||||
qDebug() << "linesArray number:" << QString::number(linesArray.size());
|
||||
//展示所有曲线
|
||||
DisplayLines(linesArray);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FormDraw::DisplayLines(QJsonArray linesArray)
|
||||
{
|
||||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
DisplayType_One(lineObjInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FormDraw::DisplayLine_One(QJsonObject lineObjInfo)
|
||||
{
|
||||
QString strSlfName = "";
|
||||
QString strWellName = "";
|
||||
// QString strTrackName = "";
|
||||
QString strLineName = "";
|
||||
//
|
||||
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("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("lineColorRed"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("lineColorRed");
|
||||
if (value.isDouble()) {
|
||||
lineColor.setRed(value.toInt());
|
||||
//qDebug() << "lineColorRed:" << QString::number(value.toInt());
|
||||
}
|
||||
}
|
||||
//
|
||||
if (lineObjInfo.contains("lineColorGreen"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("lineColorGreen");
|
||||
if (value.isDouble()) {
|
||||
lineColor.setGreen(value.toInt());
|
||||
//qDebug() << "lineColorGreen:" << QString::number(value.toInt());
|
||||
}
|
||||
}
|
||||
//
|
||||
if (lineObjInfo.contains("lineColorBlue"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("lineColorBlue");
|
||||
if (value.isDouble()) {
|
||||
lineColor.setBlue(value.toInt());
|
||||
//qDebug() << "lineColorBlue:" << QString::number(value.toInt());
|
||||
}
|
||||
}
|
||||
//
|
||||
if (lineObjInfo.contains("lineColorAlpha"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("lineColorAlpha");
|
||||
if (value.isDouble()) {
|
||||
lineColor.setAlpha(value.toInt());
|
||||
//qDebug() << "lineColorAlpha:" << QString::number(value.toInt());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
QString folderPath = GetLogdataPath();
|
||||
folderPath = folderPath + g_prjname;
|
||||
strSlfName = folderPath + "/" + "#" + strWellName + "/" + strSlfName;
|
||||
|
||||
if (strLineName != "")
|
||||
{
|
||||
//新建曲线
|
||||
s_AddLine_Property(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName,
|
||||
newLeftScale, newRightScale, strScaleType, lineColor, width, lineStyle);
|
||||
}
|
||||
|
||||
//---------------
|
||||
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("newColorRed"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("newColorRed");
|
||||
if (value.isDouble()) {
|
||||
newColor.setRed(value.toInt());
|
||||
//qDebug() << "newColorRed:" << QString::number(value.toInt());
|
||||
}
|
||||
}
|
||||
//
|
||||
if (lineObjInfo.contains("newColorGreen"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("newColorGreen");
|
||||
if (value.isDouble()) {
|
||||
newColor.setGreen(value.toInt());
|
||||
//qDebug() << "newColorGreen:" << QString::number(value.toInt());
|
||||
}
|
||||
}
|
||||
//
|
||||
if (lineObjInfo.contains("newColorBlue"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("newColorBlue");
|
||||
if (value.isDouble()) {
|
||||
newColor.setBlue(value.toInt());
|
||||
//qDebug() << "newColorBlue:" << QString::number(value.toInt());
|
||||
}
|
||||
}
|
||||
//
|
||||
if (lineObjInfo.contains("newColorAlpha"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("newColorAlpha");
|
||||
if (value.isDouble()) {
|
||||
newColor.setAlpha(value.toInt());
|
||||
//qDebug() << "newColorAlpha:" << QString::number(value.toInt());
|
||||
}
|
||||
}
|
||||
|
||||
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("frontColorRed"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("frontColorRed");
|
||||
if (value.isDouble()) {
|
||||
frontColor.setRed(value.toInt());
|
||||
//qDebug() << "frontColorRed:" << QString::number(value.toInt());
|
||||
}
|
||||
}
|
||||
//
|
||||
if (lineObjInfo.contains("frontColorGreen"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("frontColorGreen");
|
||||
if (value.isDouble()) {
|
||||
frontColor.setGreen(value.toInt());
|
||||
//qDebug() << "frontColorGreen:" << QString::number(value.toInt());
|
||||
}
|
||||
}
|
||||
//
|
||||
if (lineObjInfo.contains("frontColorBlue"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("frontColorBlue");
|
||||
if (value.isDouble()) {
|
||||
frontColor.setBlue(value.toInt());
|
||||
//qDebug() << "frontColorBlue:" << QString::number(value.toInt());
|
||||
}
|
||||
}
|
||||
//
|
||||
if (lineObjInfo.contains("frontColorAlpha"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("frontColorAlpha");
|
||||
if (value.isDouble()) {
|
||||
frontColor.setAlpha(value.toInt());
|
||||
//qDebug() << "frontColorAlpha:" << QString::number(value.toInt());
|
||||
}
|
||||
}
|
||||
//
|
||||
if (lineObjInfo.contains("backColorRed"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("backColorRed");
|
||||
if (value.isDouble()) {
|
||||
backColor.setRed(value.toInt());
|
||||
//qDebug() << "backColorRed:" << QString::number(value.toInt());
|
||||
}
|
||||
}
|
||||
//
|
||||
if (lineObjInfo.contains("backColorGreen"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("backColorGreen");
|
||||
if (value.isDouble()) {
|
||||
backColor.setGreen(value.toInt());
|
||||
//qDebug() << "backColorGreen:" << QString::number(value.toInt());
|
||||
}
|
||||
}
|
||||
//
|
||||
if (lineObjInfo.contains("backColorBlue"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("backColorBlue");
|
||||
if (value.isDouble()) {
|
||||
backColor.setBlue(value.toInt());
|
||||
//qDebug() << "backColorBlue:" << QString::number(value.toInt());
|
||||
}
|
||||
}
|
||||
//
|
||||
if (lineObjInfo.contains("backColorAlpha"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("backColorAlpha");
|
||||
if (value.isDouble()) {
|
||||
backColor.setAlpha(value.toInt());
|
||||
//qDebug() << "backColorAlpha:" << QString::number(value.toInt());
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
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, m_strTrackName, strLineName,
|
||||
newFillType, newTargetLine, newColor, newLithosImage, newHeadFill,
|
||||
new_vMin, new_vMax, strOtherScaleType, frontColor, backColor, newFillMode, false);
|
||||
}
|
||||
}
|
||||
|
||||
void FormDraw::DisplayType_One(QJsonObject objInfo)
|
||||
{
|
||||
QString strType = objInfo.value("Type").toString();
|
||||
QString strLineName = objInfo.value("LineName").toString();
|
||||
if (strType == "waveObject")
|
||||
{
|
||||
//新建波列
|
||||
emit CallManage::getInstance()->sig_AddWave(m_strUuid, m_strSlfName, m_strWellName, m_strTrackName, strLineName);
|
||||
}
|
||||
else
|
||||
{
|
||||
QStringList dt;
|
||||
dt << m_strUuid;
|
||||
dt << m_strWellName;
|
||||
dt << m_strSlfName;
|
||||
dt << "";
|
||||
dt << strType;
|
||||
dt << QString::number(m_nTrackW);
|
||||
this->setDrawData(dt);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void FormDraw::paintEvent(QPaintEvent*)
|
||||
{
|
||||
// QPainter painter(this);
|
||||
|
|
|
|||
|
|
@ -50,6 +50,13 @@ public:
|
|||
~FormDraw();
|
||||
|
||||
void setDrawData(QStringList slist);
|
||||
|
||||
void setDrawPropert(QJsonObject obj);
|
||||
|
||||
//展示所有曲线
|
||||
void DisplayLines(QJsonArray linesArray);
|
||||
void DisplayLine_One(QJsonObject lineObjInfo);
|
||||
void DisplayType_One(QJsonObject objInfo);
|
||||
private:
|
||||
Ui::FormDraw *ui;
|
||||
|
||||
|
|
@ -68,8 +75,10 @@ public slots:
|
|||
|
||||
public:
|
||||
QString m_strUuid;
|
||||
QString m_strSlfName = "";
|
||||
QString m_strWellName;
|
||||
QString m_strTrackName;
|
||||
int m_nTrackW = 0;
|
||||
|
||||
int m_iScale=200;
|
||||
double m_iY1=0;
|
||||
|
|
@ -136,7 +145,6 @@ public:
|
|||
float m_nSltk; // 杆状图长度
|
||||
QColor m_crPointFill,m_crTail,m_crCircle;
|
||||
QColor m_crGridSmall;
|
||||
QString m_strSlfName;
|
||||
//TabDip
|
||||
QString m_qsWellName,m_qsTable; //
|
||||
QString m_qsDepth,m_qsDIP,m_qsDIR,m_qsID,m_qsProperty; // 控制曲线
|
||||
|
|
|
|||
|
|
@ -80,8 +80,9 @@ QJsonObject FormInfo::makeJson()
|
|||
}
|
||||
rootObj["SlfName"] = slffilename;
|
||||
rootObj["WellName"] = m_strWellName;
|
||||
rootObj["TrackName"] = m_strTrackName;
|
||||
// rootObj["TrackName"] = m_strTrackName;
|
||||
rootObj["LineName"] = m_strLineName;
|
||||
rootObj["Type"] = m_strType;
|
||||
rootObj["lineColorRed"] = m_lineColor.red();
|
||||
rootObj["lineColorGreen"] = m_lineColor.green();
|
||||
rootObj["lineColorBlue"] = m_lineColor.blue();
|
||||
|
|
|
|||
|
|
@ -882,7 +882,7 @@ QJsonObject FormTrack::makeJson()
|
|||
QJsonObject rootObj;
|
||||
//
|
||||
rootObj["WellName"] = m_strWellName;
|
||||
rootObj["TrackName"] = m_strTrackName;
|
||||
// rootObj["TrackName"] = m_strTrackName;
|
||||
|
||||
// 创建JSON数组并填充数据
|
||||
QJsonArray subcaseArray;
|
||||
|
|
|
|||
|
|
@ -20,22 +20,6 @@ FormTrackTop::FormTrackTop(QWidget *parent, QString strSlfName, QString strWellN
|
|||
m_strSlfName = strSlfName;
|
||||
m_strWellName = strWellName;
|
||||
m_strTrackName = strTrackName;
|
||||
m_strLineName = strLineName;
|
||||
m_lineColor = lineColor;
|
||||
//
|
||||
m_dWidth = 3;
|
||||
m_lineStyle = Qt::SolidLine;
|
||||
m_newFillMode = "无填充";
|
||||
m_newHeadFill = "不绘制";
|
||||
// //
|
||||
// QPushButton *button = new QPushButton("Drag Me", this);
|
||||
// QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
// layout->addWidget(button);
|
||||
// setLayout(layout);
|
||||
// // 设置拖拽功能
|
||||
// setWindowFlags(Qt::FramelessWindowHint | Qt::Window);
|
||||
// setAttribute(Qt::WA_TranslucentBackground);
|
||||
|
||||
|
||||
m_font = QFont("微软雅黑", 10);
|
||||
m_fontColor = QColor(0,0,0);
|
||||
|
|
@ -46,13 +30,28 @@ FormTrackTop::~FormTrackTop()
|
|||
delete ui;
|
||||
}
|
||||
|
||||
void FormTrackTop::setTrackTopPropert(QJsonObject topObj)
|
||||
{
|
||||
if (topObj.contains("Font"))
|
||||
{
|
||||
QJsonValue value = topObj.value("Font");
|
||||
this->m_font.fromString(value.toString());
|
||||
}
|
||||
if (topObj.contains("FontColor"))
|
||||
{
|
||||
QJsonValue value = topObj.value("FontColor");
|
||||
this->m_fontColor.setNamedColor(value.toString());
|
||||
}
|
||||
}
|
||||
|
||||
QJsonObject FormTrackTop::makeJson()
|
||||
{
|
||||
// 创建根对象
|
||||
QJsonObject rootObj;
|
||||
//
|
||||
rootObj["WellName"] = m_strWellName;
|
||||
rootObj["TrackName"] = m_strTrackName;
|
||||
rootObj["WellName"] = m_strWellName; // 道名称
|
||||
rootObj["TrackName"] = m_strTrackName; // 道名称
|
||||
rootObj["TrackW"] = m_nTrackW; // 道宽
|
||||
rootObj["Font"] = m_font.toString();
|
||||
rootObj["FontColor"] = m_fontColor.name();
|
||||
|
||||
|
|
@ -163,65 +162,3 @@ void FormTrackTop::dropEvent(QDropEvent* event)
|
|||
//QApplication::restoreOverrideCursor();
|
||||
}
|
||||
|
||||
//线宽
|
||||
void FormTrackTop::setLineWidth(double dWidth)
|
||||
{
|
||||
m_dWidth = dWidth;
|
||||
}
|
||||
|
||||
double FormTrackTop::getLineWidth()
|
||||
{
|
||||
return m_dWidth;
|
||||
}
|
||||
|
||||
//线型
|
||||
void FormTrackTop::setLineStyle(Qt::PenStyle lineStyle)
|
||||
{
|
||||
m_lineStyle = lineStyle;
|
||||
}
|
||||
|
||||
Qt::PenStyle FormTrackTop::getLineStyle()
|
||||
{
|
||||
return m_lineStyle;
|
||||
}
|
||||
|
||||
void FormTrackTop::setVMax(float vmax)
|
||||
{
|
||||
m_vmax = vmax;
|
||||
}
|
||||
|
||||
float FormTrackTop::getVMax()
|
||||
{
|
||||
return m_vmax;
|
||||
}
|
||||
|
||||
void FormTrackTop::setVMin(float vmin)
|
||||
{
|
||||
m_vmin = vmin;
|
||||
}
|
||||
|
||||
float FormTrackTop::getVMin()
|
||||
{
|
||||
return m_vmin;
|
||||
}
|
||||
|
||||
void FormTrackTop::setFrontColor(QColor frontColor)
|
||||
{
|
||||
m_frontColor = frontColor;
|
||||
}
|
||||
|
||||
QColor FormTrackTop::getFrontColor()
|
||||
{
|
||||
return m_frontColor;
|
||||
}
|
||||
|
||||
void FormTrackTop::setBackColor(QColor backColor)
|
||||
{
|
||||
m_backColor = backColor;
|
||||
}
|
||||
|
||||
QColor FormTrackTop::getBackColor()
|
||||
{
|
||||
return m_backColor;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ public:
|
|||
explicit FormTrackTop(QWidget *parent = nullptr, QString strSlfName="", QString strWellName="", QString strTrackName="", QString strLineName="", QColor lineColor=QColor(255,0,0));
|
||||
~FormTrackTop();
|
||||
|
||||
void setTrackTopPropert(QJsonObject topObj);
|
||||
private:
|
||||
Ui::FormTrackTop *ui;
|
||||
|
||||
|
|
@ -42,74 +43,18 @@ public:
|
|||
QString m_strWellName;
|
||||
QString m_strTrackName;
|
||||
QString m_strLineName;
|
||||
QString m_strAliasName;//显示名称
|
||||
QString m_strUnit;//单位
|
||||
|
||||
QString m_strType;
|
||||
int m_nTrackW;
|
||||
|
||||
QFont m_font;
|
||||
QColor m_fontColor;//颜色
|
||||
|
||||
int m_iSelect=0; //iSelect=0未知,1标准曲线,2主曲线,3从曲线
|
||||
QString m_strType;//类型:curve, wave
|
||||
//
|
||||
double m_dWidth;//线宽
|
||||
QColor m_lineColor;//颜色
|
||||
Qt::PenStyle m_lineStyle;//线形
|
||||
//X坐标
|
||||
float m_vmin;//左刻度
|
||||
float m_vmax;//右刻度
|
||||
QString m_strScaleType;//刻度类型(线性,对数)
|
||||
|
||||
//岩性填充
|
||||
QString m_newHeadFill;//头部图例
|
||||
QString m_newTargetLine;//目标曲线
|
||||
QString m_newFillType;//填充类型
|
||||
QString m_newFillMode;//填充模式
|
||||
QColor m_newColor;//填充颜色
|
||||
QString m_newLithosImage = "";//岩性图片
|
||||
float m_new_vMin;//其他目标曲线
|
||||
float m_new_vMax;//其他目标曲线
|
||||
QString m_strOtherScaleType;//其他目标曲线,刻度类型(线性,对数)
|
||||
QColor m_frontColor;//岩性前景色
|
||||
QColor m_backColor;//岩性背景色
|
||||
|
||||
int m_nJg;
|
||||
|
||||
public:
|
||||
void setLineWidth(double dWidth);
|
||||
double getLineWidth();
|
||||
|
||||
void setLineStyle(Qt::PenStyle lineStyle);
|
||||
Qt::PenStyle getLineStyle();
|
||||
|
||||
void setVMax(float vmax);
|
||||
float getVMax();
|
||||
|
||||
void setVMin(float vmin);
|
||||
float getVMin();
|
||||
|
||||
void setFrontColor(QColor frontColor);
|
||||
QColor getFrontColor();
|
||||
|
||||
void setBackColor(QColor backColor);
|
||||
QColor getBackColor();
|
||||
|
||||
QJsonObject makeJson();
|
||||
|
||||
//public:
|
||||
// void mousePressEvent(QMouseEvent *event) override {
|
||||
// if (event->button() == Qt::LeftButton) {
|
||||
// startPosition = event->globalPos() - frameGeometry().topLeft();
|
||||
// event->accept();
|
||||
// }
|
||||
// }
|
||||
|
||||
// void mouseMoveEvent(QMouseEvent *event) override {
|
||||
// if (event->buttons() & Qt::LeftButton) {
|
||||
// move(event->globalPos() - startPosition);
|
||||
// event->accept();
|
||||
// }
|
||||
// }
|
||||
|
||||
private:
|
||||
QPoint startPosition;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ FormWell::FormWell(QWidget *parent, QString strWellName) :
|
|||
//关联信号槽
|
||||
connect(CallManage::getInstance(), SIGNAL(sig_NewTrack_No_Line(QString, QString, QString)), this, SLOT(s_NewTrack_No_Line(QString, QString, QString)));
|
||||
|
||||
connect(CallManage::getInstance(), SIGNAL(sig_NewTrack_No_Line(QString, QJsonObject)), this, SLOT(slot_NewTrack_No_Line(QString, QJsonObject)));
|
||||
connect(CallManage::getInstance(), SIGNAL(sig_NewTrack_No_Line(QString, QJsonObject, QJsonObject)), this, SLOT(slot_NewTrack_No_Line(QString, QJsonObject, QJsonObject)));
|
||||
|
||||
//曲线选中,置顶
|
||||
connect(CallManage::getInstance(), SIGNAL(sig_Raise(QString, QString, QString, QString, QString, int, QString)), this, SLOT(s_Raise(QString, QString, QString, QString, QString, int, QString)));
|
||||
|
|
@ -55,13 +55,13 @@ int FormWell::insertColumn(int nw)
|
|||
return ncolCount;
|
||||
}
|
||||
|
||||
QVector<QWidget *> FormWell::new_track(QStringList listdt)
|
||||
QVector<QWidget *> FormWell::new_track(QStringList listdt, QString strTrackName)
|
||||
{
|
||||
QVector<QWidget *> vec;
|
||||
QString strUuid = listdt.at(0);
|
||||
QString strWellName = listdt.at(1);
|
||||
QString strSlfName = listdt.at(2);
|
||||
QString strTrackName = listdt.at(3);
|
||||
QString strLineName = listdt.at(3);
|
||||
QString strType = listdt.at(4);
|
||||
int nW = listdt.at(5).toInt();
|
||||
|
||||
|
|
@ -91,7 +91,7 @@ QVector<QWidget *> FormWell::new_track(QStringList listdt)
|
|||
strTrackName = "TDT";
|
||||
}
|
||||
|
||||
FormTrack *formTrack = NULL;
|
||||
FormTrack *formTrack = nullptr;
|
||||
//总行数
|
||||
for(int i = 0; i< 3; i++)
|
||||
{
|
||||
|
|
@ -103,6 +103,7 @@ QVector<QWidget *> FormWell::new_track(QStringList listdt)
|
|||
FormTrackTop* trackTop= new FormTrackTop(this, strSlfName, strWellName, strTrackName);
|
||||
vec << trackTop;
|
||||
trackTop->m_strUuid = m_strUuid;
|
||||
trackTop->m_nTrackW = nW / static_cast<int>(g_dPixelPerCm);
|
||||
ui->tableWidget->setCellWidget(i, columnCount, trackTop);
|
||||
}
|
||||
else if(i==1)
|
||||
|
|
@ -139,7 +140,10 @@ QVector<QWidget *> FormWell::new_track(QStringList listdt)
|
|||
formDraw->m_iY1 = m_iY1;
|
||||
formDraw->m_iY2 = m_iY2;
|
||||
formDraw->m_strUuid = m_strUuid;
|
||||
formDraw->m_strSlfName = strSlfName;
|
||||
formDraw->m_formTrack = formTrack;
|
||||
formDraw->m_iScale = m_iScale;
|
||||
formDraw->m_nTrackW = nW;
|
||||
|
||||
ui->tableWidget->setCellWidget(i, columnCount, formDraw);
|
||||
}
|
||||
|
|
@ -286,64 +290,77 @@ void FormWell::s_NewTrack_No_Line(QString strUuid, QString strWellName, QString
|
|||
}
|
||||
}
|
||||
|
||||
void FormWell::slot_NewTrack_No_Line(QString strUuid, QJsonObject obj)
|
||||
void FormWell::slot_NewTrack_No_Line(QString strUuid, QJsonObject topObj, QJsonObject infoObj)
|
||||
{
|
||||
QString strWellName="";
|
||||
QString strTrackName="";
|
||||
if (obj.contains("WellName"))
|
||||
if (topObj.contains("WellName"))
|
||||
{
|
||||
QJsonValue value = obj.value("WellName");
|
||||
QJsonValue value = topObj.value("WellName");
|
||||
if (value.isString()) {
|
||||
strWellName = value.toString();
|
||||
qDebug() << "WellName:" << strWellName;
|
||||
}
|
||||
}
|
||||
if (obj.contains("TrackName"))
|
||||
if (topObj.contains("TrackName"))
|
||||
{
|
||||
QJsonValue value = obj.value("TrackName");
|
||||
QJsonValue value = topObj.value("TrackName");
|
||||
if (value.isString()) {
|
||||
strTrackName = value.toString();
|
||||
}
|
||||
}
|
||||
|
||||
int nW = 0;
|
||||
if (topObj.contains("TrackW"))
|
||||
{
|
||||
QJsonValue value = topObj.value("TrackW");
|
||||
nW = value.toInt();
|
||||
}
|
||||
|
||||
QStringList listdt;
|
||||
listdt << strUuid;
|
||||
listdt << strWellName;
|
||||
listdt << m_strSlfName;
|
||||
listdt << strTrackName;
|
||||
listdt << "";
|
||||
listdt << "0";
|
||||
listdt << "";
|
||||
listdt << QString::number(nW * static_cast<int>(g_dPixelPerCm));
|
||||
|
||||
QVector<QWidget*> vecWgt = new_track(listdt);
|
||||
QVector<QWidget*> vecWgt = new_track(listdt, strTrackName);
|
||||
if(vecWgt.size() <= 0)
|
||||
return;
|
||||
|
||||
FormTrackTop *formTop = qobject_cast<FormTrackTop*>(vecWgt.at(0));
|
||||
if(formTop)
|
||||
{
|
||||
if (obj.contains("Font"))
|
||||
{
|
||||
QJsonValue value = obj.value("Font");
|
||||
formTop->m_font.fromString(value.toString());
|
||||
formTop->setTrackTopPropert(topObj);
|
||||
}
|
||||
if (obj.contains("FontColor"))
|
||||
FormDraw *formDraw = qobject_cast<FormDraw*>(vecWgt.at(2));
|
||||
if (formDraw)
|
||||
{
|
||||
QJsonValue value = obj.value("FontColor");
|
||||
formTop->m_fontColor.setNamedColor(value.toString());
|
||||
}
|
||||
formDraw->setDrawPropert(infoObj);
|
||||
}
|
||||
}
|
||||
|
||||
int FormWell::setColWidth(int iCurrentCol, int iNewWidth)
|
||||
int FormWell::setColWidth(int iCurrentCol, int iWidth)
|
||||
{
|
||||
int iNewWidth = iWidth * static_cast<int>(g_dPixelPerCm);
|
||||
//设置列宽
|
||||
ui->tableWidget->setColumnWidth(iCurrentCol, iNewWidth);
|
||||
|
||||
auto topWidget = ui->tableWidget->cellWidget(0, iCurrentCol);
|
||||
if(topWidget)
|
||||
{
|
||||
FormTrackTop *formTop = qobject_cast<FormTrackTop*>(topWidget);//获得widget
|
||||
if(formTop)
|
||||
{
|
||||
formTop->m_nTrackW = iWidth;
|
||||
}
|
||||
}
|
||||
auto myWidget = ui->tableWidget->cellWidget(2, iCurrentCol);
|
||||
if(myWidget)
|
||||
{
|
||||
//
|
||||
FormDraw *formDraw = (FormDraw*)myWidget;//获得widget
|
||||
FormDraw *formDraw = qobject_cast<FormDraw*>(myWidget);//获得widget
|
||||
if(formDraw)
|
||||
{
|
||||
formDraw->setColWidth(iNewWidth);
|
||||
|
|
@ -447,7 +464,7 @@ QJsonObject FormWell::makeJson()
|
|||
if( ui->tableWidget->cellWidget(1, i) != nullptr )
|
||||
{
|
||||
auto myWidget = ui->tableWidget->cellWidget(1, i);
|
||||
FormTrack *formTrack = (FormTrack*)myWidget;//获得widget
|
||||
FormTrack *formTrack = qobject_cast<FormTrack*>(myWidget); //获得widget
|
||||
if(formTrack)
|
||||
{
|
||||
//options
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public:
|
|||
// 插入列,返回列索引
|
||||
int insertColumn(int nw);
|
||||
|
||||
QVector<QWidget*> new_track(QStringList listdt);
|
||||
QVector<QWidget*> new_track(QStringList listdt, QString strTrackName = "");
|
||||
|
||||
private:
|
||||
Ui::FormWell *ui;
|
||||
|
|
@ -51,7 +51,7 @@ public slots:
|
|||
//新建空白道,没有曲线
|
||||
void s_NewTrack_No_Line(QString strUuid, QString strWellName, QString strTrackName);
|
||||
|
||||
void slot_NewTrack_No_Line(QString strUuid, QJsonObject obj);
|
||||
void slot_NewTrack_No_Line(QString strUuid, QJsonObject topObj, QJsonObject infoObj);
|
||||
|
||||
void s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int iTableType, QString strFormInfoType);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1805,7 +1805,7 @@ QJsonObject MainWindowCurve::makeJson()
|
|||
{
|
||||
auto myWidget = ui->tableWidget_2->cellWidget(1, i);
|
||||
//
|
||||
FormWell *widgetWell = (FormWell*)myWidget;//获得widget
|
||||
FormWell *widgetWell = qobject_cast<FormWell*>(myWidget);//获得widget
|
||||
if(widgetWell)
|
||||
{
|
||||
//options
|
||||
|
|
@ -1886,6 +1886,7 @@ void MainWindowCurve::s_NewWell(QString strWellName, QString strSlfName)
|
|||
widgetWell->m_iY2 = m_iY2;
|
||||
widgetWell->m_strUuid = m_strUuid;
|
||||
widgetWell->m_strSlfName = strSlfName;
|
||||
widgetWell->m_iScale = m_iScale;
|
||||
ui->tableWidget_2->setCellWidget(i, columnCount, widgetWell);
|
||||
|
||||
//
|
||||
|
|
@ -2619,9 +2620,9 @@ void MainWindowCurve::s_NewTrack_No_Line(QString strWellName, QString strTrackNa
|
|||
emit CallManage::getInstance()->sig_NewTrack_No_Line(m_strUuid, strWellName, strTrackName);
|
||||
}
|
||||
|
||||
void MainWindowCurve::s_NewTrack_No_Line(QJsonObject obj)
|
||||
void MainWindowCurve::s_NewTrack_No_Line(QJsonObject topObj, QJsonObject infoObj)
|
||||
{
|
||||
emit CallManage::getInstance()->sig_NewTrack_No_Line(m_strUuid, obj);
|
||||
emit CallManage::getInstance()->sig_NewTrack_No_Line(m_strUuid, topObj, infoObj);
|
||||
}
|
||||
|
||||
//新建曲线,带属性
|
||||
|
|
@ -3229,7 +3230,7 @@ void MainWindowCurve::s_changeTrackProperty(QVariantList vlist)
|
|||
if(myWidget == nullptr)
|
||||
continue;
|
||||
//
|
||||
FormWell *widgetWell = (FormWell*)myWidget;//获得widget
|
||||
FormWell *widgetWell = qobject_cast<FormWell*>(myWidget);//获得widget
|
||||
if(widgetWell == nullptr)
|
||||
continue;
|
||||
|
||||
|
|
@ -3242,9 +3243,7 @@ void MainWindowCurve::s_changeTrackProperty(QVariantList vlist)
|
|||
QString strProperty = vlist.at(4).toString();
|
||||
if("道宽(cm)" == strProperty)
|
||||
{
|
||||
QString strTrackName = vlist.at(5).toString();
|
||||
int iNewWidth = vlist.at(5).toInt();
|
||||
iNewWidth = iNewWidth * g_dPixelPerCm;
|
||||
int iWellWidth = widgetWell->setColWidth(iCurrentCol, iNewWidth);
|
||||
|
||||
//调整井宽
|
||||
|
|
@ -3562,33 +3561,43 @@ void MainWindowCurve::DisplayTracks(QJsonArray tracksArray)
|
|||
QJsonObject trackObj = trackValue.toObject();
|
||||
//
|
||||
//
|
||||
if (trackObj.contains("topinfo"))
|
||||
QString strTrackName = "";
|
||||
int nTrackW = 0;
|
||||
if (trackObj.contains("topinfo") && trackObj.contains("info"))
|
||||
{
|
||||
QJsonValue value = trackObj.value("topinfo");
|
||||
if (value.isObject()) {
|
||||
QJsonObject trackObjInfo = value.toObject();
|
||||
QJsonValue topVal = trackObj.value("topinfo");
|
||||
QJsonValue infoVal = trackObj.value("info");
|
||||
|
||||
if (topVal.isObject() && infoVal.isObject()) {
|
||||
QJsonObject topObj = topVal.toObject();
|
||||
QJsonObject infoObj = infoVal.toObject();
|
||||
//展示其中一道
|
||||
DisplayTrack_Top(trackObjInfo, id);
|
||||
}
|
||||
}
|
||||
if (trackObj.contains("info"))
|
||||
{
|
||||
QJsonValue value = trackObj.value("info");
|
||||
if (value.isObject()) {
|
||||
QJsonObject trackObjInfo = value.toObject();
|
||||
//展示其中一道
|
||||
DisplayTrack_One(trackObjInfo, id);
|
||||
DisplayTrack_Top(id, topObj, infoObj);
|
||||
|
||||
strTrackName = topObj.value("TrackName").toString();
|
||||
nTrackW = topObj.value("TrackW").toInt();
|
||||
}
|
||||
}
|
||||
// if (trackObj.contains("info"))
|
||||
// {
|
||||
// QJsonValue value = trackObj.value("info");
|
||||
// if (value.isObject()) {
|
||||
// QJsonObject trackObjInfo = value.toObject();
|
||||
// //展示其中一道
|
||||
// DisplayTrack_One(trackObjInfo, strTrackName, nTrackW);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindowCurve::DisplayTrack_Top(QJsonObject trackTop, int id)
|
||||
void MainWindowCurve::DisplayTrack_Top(int id, QJsonObject trackTop, QJsonObject trackInfo)
|
||||
{
|
||||
//新建道+曲线
|
||||
s_NewTrack_No_Line(trackTop, trackInfo);//新建空白道,没有曲线
|
||||
if(id>0)
|
||||
{
|
||||
QString strWellName = "";
|
||||
QString strTrackName = "";
|
||||
|
||||
if (trackTop.contains("WellName"))
|
||||
{
|
||||
QJsonValue value = trackTop.value("WellName");
|
||||
|
|
@ -3597,27 +3606,20 @@ void MainWindowCurve::DisplayTrack_Top(QJsonObject trackTop, int id)
|
|||
qDebug() << "WellName:" << strWellName;
|
||||
}
|
||||
}
|
||||
if (trackTop.contains("TrackName"))
|
||||
int nW = 0;
|
||||
if (trackTop.contains("TrackW"))
|
||||
{
|
||||
QJsonValue value = trackTop.value("TrackName");
|
||||
if (value.isString()) {
|
||||
strTrackName = value.toString();
|
||||
qDebug() << "TrackName:" << strTrackName;
|
||||
QJsonValue value = trackTop.value("TrackW");
|
||||
nW = value.toInt();
|
||||
}
|
||||
}
|
||||
|
||||
//新建道+曲线
|
||||
s_NewTrack_No_Line(trackTop);//新建空白道,没有曲线
|
||||
if(id>0)
|
||||
{
|
||||
//改变井宽
|
||||
s_NewTrackChangeWidth(strWellName);
|
||||
s_NewTrackChangeWidth(strWellName, nW * static_cast<int>(g_dPixelPerCm));
|
||||
//mainWindowCurve->s_NewTrackChangeWidth(strWellName);
|
||||
}
|
||||
}
|
||||
|
||||
//展示其中一道
|
||||
void MainWindowCurve::DisplayTrack_One(QJsonObject trackObjInfo, int id)
|
||||
void MainWindowCurve::DisplayTrack_One(QJsonObject trackObjInfo, QString strTrackName, int nW)
|
||||
{
|
||||
//
|
||||
if (trackObjInfo.contains("formInfos"))
|
||||
|
|
@ -3627,13 +3629,13 @@ void MainWindowCurve::DisplayTrack_One(QJsonObject trackObjInfo, int id)
|
|||
QJsonArray linesArray = value.toArray();
|
||||
qDebug() << "linesArray number:" << QString::number(linesArray.size());
|
||||
//展示所有曲线
|
||||
DisplayLines(linesArray);
|
||||
DisplayLines(linesArray, strTrackName, nW);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//展示所有曲线
|
||||
void MainWindowCurve::DisplayLines(QJsonArray linesArray)
|
||||
void MainWindowCurve::DisplayLines(QJsonArray linesArray, QString strTrackName, int nW)
|
||||
{
|
||||
QMap<int, int> mapLines;
|
||||
|
||||
|
|
@ -3671,8 +3673,16 @@ void MainWindowCurve::DisplayLines(QJsonArray linesArray)
|
|||
QJsonValue value = lineObj.value("info");
|
||||
if (value.isObject()) {
|
||||
QJsonObject lineObjInfo = value.toObject();
|
||||
|
||||
//展示其中一条曲线
|
||||
DisplayLine_One(lineObjInfo);
|
||||
if(lineObjInfo.value("Type").toString() == "curveObject")
|
||||
{
|
||||
DisplayLine_One(lineObjInfo, strTrackName);
|
||||
}
|
||||
else
|
||||
{
|
||||
DisplayType_One(lineObjInfo, strTrackName, nW);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3681,11 +3691,11 @@ void MainWindowCurve::DisplayLines(QJsonArray linesArray)
|
|||
|
||||
|
||||
//展示其中一条曲线
|
||||
void MainWindowCurve::DisplayLine_One(QJsonObject lineObjInfo)
|
||||
void MainWindowCurve::DisplayLine_One(QJsonObject lineObjInfo, QString strTrackName)
|
||||
{
|
||||
QString strSlfName = "";
|
||||
QString strWellName = "";
|
||||
QString strTrackName = "";
|
||||
// QString strTrackName = "";
|
||||
QString strLineName = "";
|
||||
//
|
||||
double newLeftScale = 0;//左刻度
|
||||
|
|
@ -3734,14 +3744,14 @@ void MainWindowCurve::DisplayLine_One(QJsonObject lineObjInfo)
|
|||
//qDebug() << "WellName:" << strWellName;
|
||||
}
|
||||
}
|
||||
if (lineObjInfo.contains("TrackName"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("TrackName");
|
||||
if (value.isString()) {
|
||||
strTrackName = value.toString();
|
||||
//qDebug() << "TrackName:" << strTrackName;
|
||||
}
|
||||
}
|
||||
// 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");
|
||||
|
|
@ -4021,3 +4031,21 @@ void MainWindowCurve::DisplayLine_One(QJsonObject lineObjInfo)
|
|||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,14 +92,16 @@ public:
|
|||
//展示所有道
|
||||
void DisplayTracks(QJsonArray tracksArray);
|
||||
|
||||
void DisplayTrack_Top(QJsonObject trackTop, int id);
|
||||
void DisplayTrack_Top(int id, QJsonObject trackTop, QJsonObject trackInfo);
|
||||
|
||||
//展示其中一道
|
||||
void DisplayTrack_One(QJsonObject trackObjInfo, int id);
|
||||
void DisplayTrack_One(QJsonObject trackObjInfo, QString strTrackName, int nW);
|
||||
//展示所有曲线
|
||||
void DisplayLines(QJsonArray linesArray);
|
||||
void DisplayLines(QJsonArray linesArray, QString strTrackName, int nW);
|
||||
//展示其中一条曲线
|
||||
void DisplayLine_One(QJsonObject lineObjInfo);
|
||||
void DisplayLine_One(QJsonObject lineObjInfo, QString strTrackName);
|
||||
|
||||
void DisplayType_One(QJsonObject lineObjInfo, QString strTrackName, int nW);
|
||||
|
||||
void Open(QString fileFull);//打开
|
||||
|
||||
|
|
@ -158,7 +160,7 @@ public slots:
|
|||
void s_NewTrackChangeWidth(QString strWellName, int nW=0);//新建道后,改变井宽
|
||||
void s_NewTrack_No_Line(QString strWellName, QString strTrackName);//新建空白道,没有曲线
|
||||
|
||||
void s_NewTrack_No_Line(QJsonObject obj);//新建空白道,没有曲线
|
||||
void s_NewTrack_No_Line(QJsonObject topObj, QJsonObject infoObj);//新建空白道,没有曲线
|
||||
|
||||
void s_AddLine_Property(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName,
|
||||
double newLeftScale, double newRightScale, QString strScaleType, QColor lineColor, double width, Qt::PenStyle lineStyle);//新建曲线,带属性
|
||||
|
|
|
|||
|
|
@ -302,10 +302,10 @@ void PreQTableWidget::mouseReleaseEvent(QMouseEvent *event)
|
|||
QStringList strListOtherLine = getListLineName(formInfo->m_strLineName, listMin, listMax, strListOtherScaleType);
|
||||
//PropertyService()->initCurveProperty(formInfo->m_strSlfName, formInfo->m_strWellName, formInfo->m_strTrackName, formInfo->m_strLineName, formInfo->m_lineColor, formInfo->m_dWidth, strListOtherLine);
|
||||
|
||||
if(formInfo->m_strType == "depthObject")
|
||||
PropertyService()->initDepthProperty(formInfo);
|
||||
else
|
||||
if(formInfo->m_strType == "curveObject")
|
||||
PropertyService()->initCurveProperty(formInfo, strListOtherLine, listMin, listMax, strListOtherScaleType);
|
||||
else
|
||||
PropertyService()->initProperty(formInfo);
|
||||
|
||||
//曲线置顶显示,激活可选
|
||||
emit CallManage::getInstance()->sig_Raise(m_strUuid, formInfo->m_strSlfName, formInfo->m_strWellName, formInfo->m_strTrackName, formInfo->m_strLineName, 3, formInfo->m_strType);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user