This commit is contained in:
DESKTOP-450PEFP\mainc 2026-04-29 10:41:38 +08:00
commit 5f4ec06978
10 changed files with 161 additions and 148 deletions

View File

@ -177,11 +177,13 @@ signals:
void sig_changeScale(QString strUuid, int iNewScale);
//自定义滚动条
void sig_vertScrollBarChanged_setGeometry(QString strUuid, int iNewValue, int low, int upper);
void sig_vertScrollBarChanged_setGeometry(QString strUuid, double iNewValue, double low, double upper);
//自定义滚动条
void sig_vertScrollBarChanged(QString strUuid, int iNewValue, int low, int upper);
void sig_vertScrollBarChanged(QString strUuid, double iNewValue, double low, double upper);
//自定义滚动条(三图一表)
void sig_vertScrollBarChanged_santuyibiao(QString strUuid, int iNewValue, int low, int upper);
void sig_vertScrollBarChanged_santuyibiao(QString strUuid, double iNewValue, double low, double upper);
//自定义滚动条(三图一表,打印)
void sig_vertScrollBarChanged_santu_Print(QString strUuid, int iNum, int iHeightOfScreen);
//改变深度
void sig_changeDepth(QString strUuid, QString strSlfName, QString strWellName, int iY1, int iY2);

View File

@ -4273,8 +4273,6 @@ void PropertyWidget::initTubingItemProperty(TransparentDraggableGuan* tdGuan, do
}
}
void PropertyWidget::changedDepthProperty(QString strProperty, QVariant varVal)
{
if ("显示单位" == strProperty)
@ -4342,66 +4340,15 @@ void PropertyWidget::changedDepthProperty(QString strProperty, QVariant varVal)
}
else if ("斜深位置" == strProperty)
{
int temp = varVal.toInt();
int newStyle = 0;
switch(temp)
{
case 0:
// 偏左
newStyle = Qt::NoPen;
break;
case 1:
// 居中
newStyle = Qt::SolidLine;
break;
case 2:
// 偏右
newStyle = Qt::DashLine;
break;
}
this->m_formInfo->m_sdMeasuredDepthPosition = newStyle;
this->m_formInfo->m_sdMeasuredDepthPosition = varVal.toInt();
}
else if ("垂深位置" == strProperty)
{
int temp = varVal.toInt();
int newStyle = 0;
switch(temp)
{
case 0:
// 偏左
newStyle = Qt::NoPen;
break;
case 1:
// 居中
newStyle = Qt::SolidLine;
break;
case 2:
// 偏右
newStyle = Qt::DashLine;
break;
}
this->m_formInfo->m_sdVerticalDepthPosition = newStyle;
this->m_formInfo->m_sdVerticalDepthPosition = varVal.toInt();
}
else if ("海拔垂深位置" == strProperty)
{
int temp = varVal.toInt();
int newStyle = 0;
switch(temp)
{
case 0:
// 偏左
newStyle = Qt::NoPen;
break;
case 1:
// 居中
newStyle = Qt::SolidLine;
break;
case 2:
// 偏右
newStyle = Qt::DashLine;
break;
}
this->m_formInfo->m_sdElevationVerticalDepthPosition = newStyle;
this->m_formInfo->m_sdElevationVerticalDepthPosition = varVal.toInt();
}
else if ("垂深" == strProperty)
{

View File

@ -193,38 +193,32 @@ void FormDraw::setDrawData(QStringList listdt, QJsonObject objInfo)
curv->yAxis->setTicker(fixedTicker);
// 标注字体
curv->yAxis->setTickLabelFont(pInfo->m_sdLabelFont);
curv->m_yAxis2->setTickLabelFont(pInfo->m_sdLabelFont);
curv->m_yAxis3->setTickLabelFont(pInfo->m_sdLabelFont);
// 旋转(°)
curv->yAxis->setTickLabelRotation(pInfo->m_sdRotationAngle);
curv->m_yAxis2->setTickLabelRotation(pInfo->m_sdRotationAngle);
curv->m_yAxis3->setTickLabelRotation(pInfo->m_sdRotationAngle);
// 斜深
curv->yAxis->setTickLabels(pInfo->m_sdMeasuredDepth);
// 海拔垂深
{
bool temp = pInfo->m_sdElevationVerticalDepth;
if(!curv->m_yAxis2)
{
curv->m_yAxis2 = new QCPAxis(curv->axisRect(), QCPAxis::atLeft);
curv->axisRect()->addAxis(QCPAxis::atLeft, curv->m_yAxis2);
curv->m_yAxis2->setRange(0, 100);
curv->m_yAxis2->setOffset(40);
curv->m_yAxis2->setTickLabelPadding(10);
}
curv->m_yAxis2->setVisible(temp);
curv->m_yAxis2->setTickLabels(temp);
curv->m_yAxis2->setTickLabelSide(QCPAxis::lsInside);
}
// 垂深
bool temp2 = pInfo->m_sdVerticalDepth;
if(!curv->m_yAxis3)
{
curv->m_yAxis3 = new QCPAxis(curv->axisRect(), QCPAxis::atLeft);
curv->axisRect()->addAxis(QCPAxis::atLeft, curv->m_yAxis3);
curv->m_yAxis3->setRange(0, 100);
curv->m_yAxis3->setOffset(40);
curv->m_yAxis3->setTickLabelPadding(10);
}
curv->m_yAxis3->setVisible(temp2); // 显示第三个Y轴
curv->m_yAxis3->setTickLabels(temp2);
curv->m_yAxis3->setTickLabelSide(QCPAxis::lsInside);
QSize size = curv->size(); // 包含宽高的QSize对象
int width2 = size.width();
int center = width2 / 2 - pInfo->m_sdLabelFont.pointSize();
int right = width2 - pInfo->m_sdLabelFont.pointSize() - 5;
// 斜深位置
switch(pInfo->m_sdMeasuredDepthPosition)
{
@ -234,10 +228,10 @@ void FormDraw::setDrawData(QStringList listdt, QJsonObject objInfo)
break;
case 1:
// 居中
curv->yAxis->setTickLabelPadding(30);
curv->yAxis->setTickLabelPadding(center);
break;
case 2:
curv->yAxis->setTickLabelPadding(50);
curv->yAxis->setTickLabelPadding(right);
break;
}
@ -250,10 +244,10 @@ void FormDraw::setDrawData(QStringList listdt, QJsonObject objInfo)
break;
case 1:
// 居中
curv->m_yAxis3->setTickLabelPadding(30);
curv->m_yAxis3->setTickLabelPadding(center);
break;
case 2:
curv->m_yAxis3->setTickLabelPadding(50);
curv->m_yAxis3->setTickLabelPadding(right);
break;
}
// 海拔垂深位置
@ -265,10 +259,10 @@ void FormDraw::setDrawData(QStringList listdt, QJsonObject objInfo)
break;
case 1:
// 居中
curv->m_yAxis2->setTickLabelPadding(30);
curv->m_yAxis2->setTickLabelPadding(center);
break;
case 2:
curv->m_yAxis2->setTickLabelPadding(50);
curv->m_yAxis2->setTickLabelPadding(right);
break;
}
// 主刻度线长度
@ -3502,7 +3496,8 @@ void FormDraw::setRowHeight(double dHight, QProgressBar *progressBar, int iSplit
if(form)
{
int nw = form->geometry().width();
form->setGeometry(0, 0, nw, (int)dHight);
form->setGeometry(form->geometry().x(), form->geometry().y(), nw, (int)dHight);
//form->setGeometry(0, 0, nw, (int)dHight);
form->updateDepthY(m_iY1, m_iY2);
//emit CallManage::getInstance()->sig_ChangeLeftScale(m_strUuid, form->m_strSlfName, m_strWellName, m_strTrackName, form->m_strLineName, form->m_iX1);
@ -4072,7 +4067,8 @@ FormLine* FormDraw::s_addSantuyibiao(QString strUuid, QString strSlfName, QStrin
ntmpw = (g_iOneWidth*4)* g_dPixelPerCm;
}
//curv->setGeometry(0, 0, ntmpw - 2, (int)dHight);
curv->setGeometry(0, 0, ntmpw - 2, (int)32767);//斜井三图一表,固定最大值,方便上下滚动
//curv->setGeometry(0, 0, ntmpw - 2, (int)32767);//斜井三图一表,固定最大值,方便上下滚动
curv->setGeometry(curv->geometry().x(), curv->geometry().y(), ntmpw - 2, (int)30000);
curv->show();
//斜井三图一表
@ -5947,21 +5943,34 @@ void FormDraw::initGujing(QMyCustomPlot *widget, QString strSlfName, QString str
void FormDraw::initDepth(QMyCustomPlot *curv)
{
// x轴隐藏
curv->setScaleX(0, 1024);
curv->yAxis->setTicks(true);
curv->yAxis->setVisible(true);
curv->yAxis->setBasePen(Qt::NoPen);
//curv->yAxis->setTickLabels(true);
curv->yAxis->setTickLabelSide(QCPAxis::lsInside);
QFont font1("微软雅黑", 8);
curv->yAxis->setTickLabelFont(font1);
//curv->yAxis->setRangeReversed(true);
//curv->axisRect()->setupFullAxesBox();
curv->yAxis->ticker()->setTickCount(60);//y个主刻度
curv->m_bX2Y = false;
if(!curv->m_yAxis2)
{
curv->m_yAxis2 = new QCPAxis(curv->axisRect(), QCPAxis::atLeft);
curv->axisRect()->addAxis(QCPAxis::atLeft, curv->m_yAxis2);
curv->m_yAxis2->setRange(0, 100);
curv->m_yAxis2->setOffset(40);
curv->m_yAxis2->setTickLabelPadding(10);
}
if(!curv->m_yAxis3)
{
curv->m_yAxis3 = new QCPAxis(curv->axisRect(), QCPAxis::atLeft);
curv->axisRect()->addAxis(QCPAxis::atLeft, curv->m_yAxis3);
curv->m_yAxis3->setRange(0, 100);
curv->m_yAxis3->setOffset(40);
curv->m_yAxis3->setTickLabelPadding(10);
}
}
void FormDraw::initFgrq(QMyCustomPlot *widget)

View File

@ -22,7 +22,9 @@ FormLine::FormLine(QWidget *parent, QString strSlfName, QString strWellName, QSt
connect(CallManage::getInstance(), SIGNAL(sig_ChangeTvdProperty(QString, QString, QString, QString, QString, QString, QString, QVariant)),
this, SLOT(s_ChangeTvdProperty(QString, QString, QString, QString, QString, QString, QString, QVariant)));
//自定义滚动条
connect(CallManage::getInstance(), SIGNAL(sig_vertScrollBarChanged_santuyibiao(QString, int, int, int)), this, SLOT(vertScrollBarChanged(QString, int, int, int)));
connect(CallManage::getInstance(), SIGNAL(sig_vertScrollBarChanged_santuyibiao(QString, double, double, double)), this, SLOT(vertScrollBarChanged(QString, double, double, double)));
//打印
connect(CallManage::getInstance(), SIGNAL(sig_vertScrollBarChanged_santu_Print(QString, int, int)), this, SLOT(vertScrollBarChanged_Print(QString, int, int)));
}
@ -324,7 +326,7 @@ void FormLine::s_ChangeTvdProperty(QString strUuid, QString strSlfName, QString
}
//自定义滚动条
void FormLine::vertScrollBarChanged(QString strUuid, int value, int low, int upper)
void FormLine::vertScrollBarChanged(QString strUuid, double value, double low, double upper)
{
if(m_strUuid==strUuid)
{
@ -342,6 +344,23 @@ void FormLine::vertScrollBarChanged(QString strUuid, int value, int low, int upp
setGeometry(0, -(dPercent*geoRect.height()), geoRect.width(), geoRect.height());
}
//打印
void FormLine::vertScrollBarChanged_Print(QString strUuid, int iNum, int iHeightOfScreen)
{
if(m_strUuid==strUuid)
{
}
else
{
return;
}
//上移或下移
QRect geoRect = geometry();
//
double dDelta = iHeightOfScreen*(iNum-1);
setGeometry(0, -dDelta, geoRect.width(), geoRect.height());
}
void FormLine::wheelEvent(QWheelEvent *event) // 滚轮事件
{
emit CallManage::getInstance()->sig_mouseWheel(event);

View File

@ -41,7 +41,8 @@ public slots:
QString strGroup, QString strProperty, QVariant variant);
//滚动条
void vertScrollBarChanged(QString strUuid, int value, int low, int upper);
void vertScrollBarChanged(QString strUuid, double value, double low, double upper);
void vertScrollBarChanged_Print(QString strUuid, int iNum, int iHeightOfScreen);
};
#endif // FORMLINE_H

View File

@ -224,6 +224,21 @@ QVector<QWidget *> FormWell::new_track(QStringList listdt, QString strTrackName)
vec << trackTop;
trackTop->m_strUuid = m_strUuid;
trackTop->m_nTrackW = dW;// / static_cast<int>(g_dPixelPerCm);
if(strTrackName.contains("深度"))
{
trackTop->m_nTrackW = 1.2;
QVariantList listCond;
listCond << strUuid;
listCond << strSlfName;
listCond << strWellName;
listCond << columnCount;
listCond << "道宽(cm)";
listCond << "1.2";
emit CallManage::getInstance()->sig_changeTrackProperty(listCond);
}
ui->tableWidget->setCellWidget(i, columnCount, trackTop);
}
else if(i==1)

View File

@ -252,7 +252,7 @@ void MainWindowCurve::vertScrollBarChanged(int value)
}
if(m_iCurPage == iNumShow)
{
int iCurValue = dDelta - (iNumShow-1)*dScrollHeight;
double iCurValue = dDelta - (iNumShow-1)*dScrollHeight;
//通知界面重设范围
emit CallManage::getInstance()->sig_vertScrollBarChanged_setGeometry(m_strUuid, iCurValue, dScrollHeight_setGeometry, 0);
}
@ -260,14 +260,14 @@ void MainWindowCurve::vertScrollBarChanged(int value)
{
m_iCurPage = iNumShow;
//通知界面重设范围
int iCurValue = (iNumShow-1)*dScrollHeight + upper;
double iCurValue = (iNumShow-1)*dScrollHeight + upper;
emit CallManage::getInstance()->sig_vertScrollBarChanged(m_strUuid, iCurValue, -m_iY1, -m_iY2);//(iNumShow-1)*dScrollHeight_setGeometry
}
else if(value==upper)
{
m_iCurPage = 1;
//通知界面重设范围
int iCurValue = upper;
double iCurValue = upper;
emit CallManage::getInstance()->sig_vertScrollBarChanged(m_strUuid, iCurValue, -m_iY1, -m_iY2);//(iNumShow-1)*dScrollHeight_setGeometry
}
@ -2755,6 +2755,7 @@ void MainWindowCurve::_slotExport(QPrinter &printer, int IsBmp, QString pngName,
{
iHeightOfScreen = g_iHeight_MyCustom;
}
iHeightOfScreen = iHeightOfScreen - 2;
double dScrollHeight = iHeightOfScreen/g_dPixelPerCm/100.0 * (double)m_iScale;
double dDeep = m_iY2-m_iY1;
@ -2784,7 +2785,7 @@ void MainWindowCurve::_slotExport(QPrinter &printer, int IsBmp, QString pngName,
int iTableSize_Head = 0;
getTableSize_Head(iTableSize_Head);
//
int iTableWellTrack_height = ui->tableWidget_2->rowHeight(0) + (9+3) + iTableSize_Head;
int iTableWellTrack_height = ui->tableWidget_2->rowHeight(0) + (9+3) + iTableSize_Head -1;
//图片高度
int iTotalSize_Height = iHight_Head+iHight_Tail;
int iNum = dDeep/dScrollHeight;
@ -2888,13 +2889,13 @@ void MainWindowCurve::_slotExport(QPrinter &printer, int IsBmp, QString pngName,
//通知界面重设范围
emit CallManage::getInstance()->sig_vertScrollBarChanged(m_strUuid, newValue, -m_iY1, -m_iY2);
//通知界面重设范围(三图一表)
emit CallManage::getInstance()->sig_vertScrollBarChanged_santuyibiao(m_strUuid, newValue, -m_iY1, -m_iY2);
emit CallManage::getInstance()->sig_vertScrollBarChanged_santu_Print(m_strUuid, iLoop+1, iHeightOfScreen);
if(iLoop==iNum-1)
{
//最后1页
ui->centralwidget->setGeometry(geoRect.x(), geoRect.y(), iMaxWidth, iHight+40);
QPixmap pPixmap = this->grab(QRect(geoRect.x(), geoRect.y()+iTableWellTrack_height, iMaxWidth, dLastHeight-2));
QPixmap pPixmap = this->grab(QRect(geoRect.x(), geoRect.y()+iTableWellTrack_height, iMaxWidth, dLastHeight));
//保存,方便查看
if(g_iDebug)
{
@ -2903,7 +2904,7 @@ void MainWindowCurve::_slotExport(QPrinter &printer, int IsBmp, QString pngName,
if(IsBmp == 0 || IsBmp == 4)
{
//pdf,svg
painter.drawPixmap(0, iHight_Head + iTableWellTrack_height + (iHeightOfScreen-2)*iLoop, pPixmap);
painter.drawPixmap(0, iHight_Head + iTableWellTrack_height + (iHeightOfScreen)*iLoop, pPixmap);
}
else
{
@ -2912,7 +2913,7 @@ void MainWindowCurve::_slotExport(QPrinter &printer, int IsBmp, QString pngName,
}
else{
ui->centralwidget->setGeometry(geoRect.x(), geoRect.y(), iMaxWidth, iHight+40);
QPixmap pPixmap = this->grab(QRect(geoRect.x(), geoRect.y()+iTableWellTrack_height, iMaxWidth, iHeightOfScreen-2));
QPixmap pPixmap = this->grab(QRect(geoRect.x(), geoRect.y()+iTableWellTrack_height, iMaxWidth, iHeightOfScreen));
//保存,方便查看
if(g_iDebug)
{
@ -2921,7 +2922,7 @@ void MainWindowCurve::_slotExport(QPrinter &printer, int IsBmp, QString pngName,
if(IsBmp == 0 || IsBmp == 4)
{
//pdf,svg
painter.drawPixmap(0, iHight_Head + iTableWellTrack_height + (iHeightOfScreen-2)*iLoop, pPixmap);
painter.drawPixmap(0, iHight_Head + iTableWellTrack_height + (iHeightOfScreen)*iLoop, pPixmap);
}
else
{
@ -2938,9 +2939,9 @@ void MainWindowCurve::_slotExport(QPrinter &printer, int IsBmp, QString pngName,
mDepthProgress.SetShowName(s);
mDepthProgress.SetDepth(iNumShow+2);
//
painter.drawPixmap(0, iHight_Head + iTableWellTrack_height + (iHeightOfScreen-2)*(iNum-1) + (dLastHeight-2), pPixmap_wellTrackInfo);
painter.drawPixmap(0, iHight_Head + iTableWellTrack_height + (iHeightOfScreen)*(iNum-1) + (dLastHeight), pPixmap_wellTrackInfo);
//尾
painter.drawPixmap(0, iHight_Head + iTableWellTrack_height*2 + (iHeightOfScreen-2)*(iNum-1) + (dLastHeight-2), pPixmap_Tail);
painter.drawPixmap(0, iHight_Head + iTableWellTrack_height*2 + (iHeightOfScreen)*(iNum-1) + (dLastHeight), pPixmap_Tail);
//结束
painter.end();
}

View File

@ -129,8 +129,8 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel
connect(CallManage::getInstance(), SIGNAL(sig_ChangeScaleType(QString, QString, QString, QString, QString, QString)), this, SLOT(s_ChangeScaleType(QString, QString, QString, QString, QString, QString)));
//自定义滚动条
connect(CallManage::getInstance(), SIGNAL(sig_vertScrollBarChanged(QString, int, int, int)), this, SLOT(vertScrollBarChanged(QString, int, int, int)));
connect(CallManage::getInstance(), SIGNAL(sig_vertScrollBarChanged_setGeometry(QString, int, int, int)), this, SLOT(vertScrollBarChanged_setGeometry(QString, int, int, int)));
connect(CallManage::getInstance(), SIGNAL(sig_vertScrollBarChanged(QString, double, double, double)), this, SLOT(vertScrollBarChanged(QString, double, double, double)));
connect(CallManage::getInstance(), SIGNAL(sig_vertScrollBarChanged_setGeometry(QString, double, double, double)), this, SLOT(vertScrollBarChanged_setGeometry(QString, double, double, double)));
//曲线选中,置顶
connect(CallManage::getInstance(), SIGNAL(sig_Raise(QString, QString, QString, QString, QString, int, QString)), this, SLOT(s_Raise(QString, QString, QString, QString, QString, int, QString)));
@ -889,7 +889,7 @@ void QMyCustomPlot::mousePressEvent(QMouseEvent *event)
{
if (event->button() == Qt::LeftButton)
{
if (m_strLineName == "RESULT")
if (m_strLineName == "RESULT" || m_strLineName == "IMAGE_DATA")
{
if (m_bEditor)
{
@ -985,7 +985,7 @@ void QMyCustomPlot::mousePressEvent(QMouseEvent *event)
void QMyCustomPlot::mouseMoveEvent(QMouseEvent *event)
{
if (m_strLineName == "RESULT")
if (m_strLineName == "RESULT" || m_strLineName == "IMAGE_DATA")
{
if (mMousePress)
{
@ -1138,7 +1138,14 @@ void QMyCustomPlot::mouseMoveEvent(QMouseEvent *event)
}
else
{
this->setCursor(Qt::ArrowCursor);
QCursor currentCursor = this->cursor();
if(currentCursor == Qt::CrossCursor)
{
}
else
{
this->setCursor(Qt::ArrowCursor);
}
}
// if (mMousePress) {
// auto items = selectedItems();
@ -1180,7 +1187,7 @@ void QMyCustomPlot::mouseMoveEvent(QMouseEvent *event)
void QMyCustomPlot::mouseReleaseEvent(QMouseEvent *event)
{
if (m_strLineName == "RESULT")
if (m_strLineName == "RESULT" || m_strLineName == "IMAGE_DATA")
{
if (mMousePress)
{
@ -1955,9 +1962,17 @@ void QMyCustomPlot::onEditImage()
if (dlg.exec() == QDialog::Accepted) // 点击“确定”按钮
{
imagePath = dlg.getImagePath();
m_pAddLine1->setVisible(false);
m_pAddLine2->setVisible(false);
mMousePress = false;
replot();
}
else
{
m_pAddLine1->setVisible(false);
m_pAddLine2->setVisible(false);
mMousePress = false;
replot();
return;
}
@ -3210,11 +3225,12 @@ bool QMyCustomPlot::SaveToSLFImage()
isrun=false;
return false;
}
iIndex=logio->Open_Set_Table(m_strLineName.toStdString().c_str(),GUJING_OBJECT,4,
"NO,SDEP,EDEP,RESULT",
"4,4,4,4",//字段长度
"1,4,4,1",//字段类型
"0,0,0,2");//字段备注
iIndex=logio->Open_Set_Table(m_strLineName.toStdString().c_str(),0,6,
"NO,SDEP,EDEP,LEFT,WIDTH,IMAGE",
"4,4,4,4,4,100",//字段长度
"1,4,4,4,4,6",//字段类型
"0,0,0,0,0,0");//字段备注
isfirst=true;
}
logio->SetTableRecordCount(iIndex,m_mapDraggable_Image.size());
@ -3251,18 +3267,22 @@ bool QMyCustomPlot::SaveToSLFImage()
float fSDepth = -tmpRange.upper;
if(fSDepth == listSDepth[i])//按顺序写入
{
memset(&m_Result,0,sizeof(GUJING_DATA));
memset(&m_Result,0,sizeof(IMAGE_DATA));
m_Result.StartDepth = -tmpRange.upper;
m_Result.EndDepth = -tmpRange.lower;
m_Result.Order=i+1;
// 拷贝字符串到数组,长度为数组长度-1留1位存'\0'结束符)
strncpy(m_Result.Image, pDraggableRect->getMResult().toLocal8Bit().constData(), sizeof(m_Result.Image) - 1);
// 手动添加结束符(确保字符串合法)
m_Result.Image[sizeof(m_Result.Image) - 1] = '\0';
m_Result.Left = static_cast<float>(pDraggableRect->getLeft());
m_Result.Order=i+1;
m_Result.Width = static_cast<float>(pDraggableRect->getWidth());
//写入
QString result = pDraggableRect->getMResult();
strcpy(m_Result.Image, result.toStdString().c_str());
logio->WriteTable(iIndex,i+1,&m_Result);
qDebug() << "===---======" << result;
qDebug() << "===---====-----------==" << m_Result.Image;
//写入
qDebug() << "Save: sizeof IMAGE_DATA=" << sizeof(IMAGE_DATA);
qDebug() << "Save: Image size=" << sizeof(m_Result.Image);
break;
}
}
@ -3304,7 +3324,7 @@ bool QMyCustomPlot::saveToSLFCorePhysics()
isrun=false;
return false;
}
iIndex=logio->Open_Set_Table(m_strLineName.toStdString().c_str(),GUJING_OBJECT,4,
iIndex=logio->Open_Set_Table(m_strLineName.toStdString().c_str(),CORE_PHYSICS_OBJECT,4,
"NO,SDEP,EDEP,RESULT",
"4,4,4,4",//字段长度
"1,4,4,1",//字段类型
@ -3341,7 +3361,7 @@ bool QMyCustomPlot::saveToSLFCorePhysics()
float fSDepth = -pDraggableRect->m_right_Hight;
if(fSDepth == listSDepth[i])//按顺序写入
{
memset(&m_Result,0,sizeof(GUJING_DATA));
memset(&m_Result,0,sizeof(Slf_CORE_PHYSICS));
m_Result.Order = i + 1;
m_Result.CoreValue = -pDraggableRect->getCpCoreValue();
m_Result.Depth = -pDraggableRect->m_right_Hight;
@ -4029,21 +4049,10 @@ bool QMyCustomPlot::LoadFromIMAGE_SLF(QString strSlfName, QString strLineName)
for(int i=0;i<count;i++) {
memset(m_Result,0,sizeof(IMAGE_DATA));
logio->ReadTable(iIndex,i+1,m_Result);
// WelllogItem* item=AddItem(m_Result->StartDepth,m_Result->EndDepth);
// if(!item) continue;
// OGWordsResultItem* pResult = dynamic_cast<OGWordsResultItem*>(item);
//logio->GetTableFieldData(iIndex,(char*)FieldName.toStdString().c_str(),m_Result->Image,i+1);
// SetCharacters(m_Result->Words);
// fontColor=QColor(0,0,0,255);
// backgroundColor=QColor(255,255,255,255);
// wordfont.setFamily("黑体");
// wordfont.setPointSize(10);
//显示图片Image
QString filename=QString::fromLocal8Bit(m_Result->Image);
qDebug() << "=--==-=-------------------------" << filename;
int pos=filename.lastIndexOf("\\");
int pos1=filename.lastIndexOf("/");
if(pos1>pos) pos=pos1;
@ -4053,6 +4062,10 @@ bool QMyCustomPlot::LoadFromIMAGE_SLF(QString strSlfName, QString strLineName)
filename="";
}
}
qDebug() << "Load: sizeof IMAGE_DATA=" << sizeof(IMAGE_DATA);
qDebug() << "Load: Image size=" << sizeof(m_Result->Image);
this->addImageToPlot(-m_Result->EndDepth, -m_Result->StartDepth, filename, static_cast<double>(m_Result->Left), static_cast<double>(m_Result->Width));
}
logio->CloseTable(iIndex);
@ -5401,6 +5414,11 @@ void QMyCustomPlot::s_changeDepthProperty(QVariantList vlist)
}
else if ("斜深位置" == strProperty)
{
QSize size = this->size(); // 包含宽高的QSize对象
int width2 = size.width();
int center = width2 / 2 - this->yAxis->tickLabelFont().pointSize();
int right = width2 - this->yAxis->tickLabelFont().pointSize() - 5;
// 没有直接设置偏移方法 动态计算太麻烦
int temp = varVal.toInt();
switch(temp)
@ -5411,10 +5429,10 @@ void QMyCustomPlot::s_changeDepthProperty(QVariantList vlist)
break;
case 1:
// 居中
this->yAxis->setTickLabelPadding(30);
this->yAxis->setTickLabelPadding(center);
break;
case 2:
this->yAxis->setTickLabelPadding(50);
this->yAxis->setTickLabelPadding(right);
break;
}
}
@ -8572,6 +8590,7 @@ void QMyCustomPlot::onCloseEditResult()
//取消框选
this->setInteractions(QCP::iSelectLegend | QCP::iSelectPlottables);
this->setSelectionRectMode(QCP::srmNone);
this->setCursor(Qt::ArrowCursor);
}
void QMyCustomPlot::DeleteItemGroup()
@ -11911,7 +11930,7 @@ void QMyCustomPlot::addQCPItemLine(QMyCustomPlot *widget, float cx, float cy, co
pLine->setPoints(myPolygon);
}
void QMyCustomPlot::vertScrollBarChanged_setGeometry(QString strUuid, int value, int low, int upper)
void QMyCustomPlot::vertScrollBarChanged_setGeometry(QString strUuid, double value, double low, double upper)
{
if(m_strUuid==strUuid)
{
@ -11931,7 +11950,7 @@ void QMyCustomPlot::vertScrollBarChanged_setGeometry(QString strUuid, int value,
}
//自定义滚动条
void QMyCustomPlot::vertScrollBarChanged(QString strUuid, int value, int low, int upper)
void QMyCustomPlot::vertScrollBarChanged(QString strUuid, double value, double low, double upper)
{
if(m_strUuid==strUuid)
{

View File

@ -407,8 +407,8 @@ signals:
public slots:
void slot_time();
//自定义滚动条
void vertScrollBarChanged(QString strUuid, int value, int low, int upper);
void vertScrollBarChanged_setGeometry(QString strUuid, int value, int low, int upper);
void vertScrollBarChanged(QString strUuid, double value, double low, double upper);
void vertScrollBarChanged_setGeometry(QString strUuid, double value, double low, double upper);
//信号槽刷新
void slot_replot();

View File

@ -448,13 +448,13 @@ void TransparentDraggableImage::onMouseMove(QMouseEvent *event)
// 无论哪种模式(只要不是 DragNone都显示参考线
if(mDragMode == DragReferenceOnly)
{
mDragLine->point1->setCoords(mDragStartY, 0);
mDragLine->point2->setCoords(mDragStartY, 1);
mDragLine->setVisible(true);
mDragLine2->point1->setCoords(currentY, 0);
mDragLine2->point2->setCoords(currentY, 1);
mDragLine2->setVisible(true);
mPlot->replot();
// mDragLine->point1->setCoords(mDragStartY, 0);
// mDragLine->point2->setCoords(mDragStartY, 1);
// mDragLine->setVisible(true);
// mDragLine2->point1->setCoords(currentY, 0);
// mDragLine2->point2->setCoords(currentY, 1);
// mDragLine2->setVisible(true);
// mPlot->replot();
return;
}