diff --git a/CallManage/CallManage.h b/CallManage/CallManage.h index 3999fbc..31cff80 100644 --- a/CallManage/CallManage.h +++ b/CallManage/CallManage.h @@ -131,7 +131,10 @@ signals: void sig_mouseWheel(QWheelEvent *event); //改变缩放比例 - void sig_changeScale(int iNewScale); + void sig_changeScale(QString strUuid, int iNewScale); + + //改变深度 + void sig_changeDepth(QString strUuid, QString strSlfName, QString strWellName, int iY1, int iY2); //改变道宽 void sig_changeWidth(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, int iCurrentCol, int iNewWidth); diff --git a/logPlus/DrawTvd.cpp b/logPlus/DrawTvd.cpp index 5db0f27..01015ed 100644 --- a/logPlus/DrawTvd.cpp +++ b/logPlus/DrawTvd.cpp @@ -14,8 +14,8 @@ #pragma warning( pop ) -extern int g_iY1; -extern int g_iY2; +//extern int g_iY1; +//extern int g_iY2; //BEGIN_OSGGRAPHICS_NAMESPACE; @@ -70,8 +70,8 @@ CDrawTvd::CDrawTvd(void) Ymax=-9999.; Ymin=9999.; // - m_SDep = -g_iY2; - m_EDep = -g_iY1; + m_SDep = 0;//-g_iY2; + m_EDep = 0;//-g_iY1; rgbList.append(QRgb(4294967295)); rgbList.append(QRgb(4294966617)); rgbList.append(QRgb(4294944512)); diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index a514179..b1c2a07 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -7,10 +7,9 @@ #include "CallManage.h" #include "geometryutils.h" -extern int g_iScale; extern double g_dPixelPerCm;//每厘米像素数 -extern int g_iY1; -extern int g_iY2; +//extern int m_iY1; +//extern int m_iY2; PropertyWidget::PropertyWidget(const QString &title, QWidget *parent , Qt::WindowFlags flags ) :QDockWidget(title,parent,flags) @@ -100,7 +99,7 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant } // - g_iScale = iScale; + m_iScale = iScale; //清空自定义比例尺,防止混淆 for (auto it = m_propertyData.constBegin(); it != m_propertyData.constEnd(); ++it) @@ -113,7 +112,7 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant } } //通知界面缩放 - emit CallManage::getInstance()->sig_changeScale(g_iScale); + emit CallManage::getInstance()->sig_changeScale(m_strUuid, iScale); } } else if("自定义比例尺" == m_propertyData[pProperty]) @@ -160,10 +159,10 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant } // - g_iScale = iScale; + m_iScale = iScale; //通知界面缩放 - emit CallManage::getInstance()->sig_changeScale(g_iScale); + emit CallManage::getInstance()->sig_changeScale(m_strUuid, iScale); } } else if("开始深度(m)" == m_propertyData[pProperty]) @@ -173,13 +172,13 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant if(m_strCurrentProperty == Well_Property) { double newStartDepth = variant.value(); - g_iY2 = 0 - newStartDepth; - if(g_iY2 < g_iY1) + m_iY2 = 0 - newStartDepth; + if(m_iY2 < m_iY1) { return; } - //通知界面缩放 - emit CallManage::getInstance()->sig_changeScale(g_iScale); + //通知界面 + emit CallManage::getInstance()->sig_changeDepth(m_strUuid, m_strSlfName, m_strWellName, m_iY1, m_iY2); } } else if("终止深度(m)" == m_propertyData[pProperty]) @@ -189,13 +188,13 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant if(m_strCurrentProperty == Well_Property) { double newEndDepth = variant.value(); - g_iY1 = 0 - newEndDepth; - if(g_iY2 < g_iY1) + m_iY1 = 0 - newEndDepth; + if(m_iY2 < m_iY1) { return; } - //通知界面缩放 - emit CallManage::getInstance()->sig_changeScale(g_iScale); + //通知界面 + emit CallManage::getInstance()->sig_changeDepth(m_strUuid, m_strSlfName, m_strWellName, m_iY1, m_iY2); } } else if("道宽(cm)" == m_propertyData[pProperty]) @@ -741,11 +740,14 @@ void PropertyWidget::_CreateEnumPropertyItem(QString strGroup, QString strProper } -void PropertyWidget::initWidgetProperty() +void PropertyWidget::initWidgetProperty(QString strUuid, int iScale) { //初始化,清空 InitCurrentViewInfo(); + m_iScale = iScale; + m_strUuid = strUuid; + //当前属性类型 m_strCurrentProperty = Widget_Property; @@ -765,7 +767,7 @@ void PropertyWidget::initWidgetProperty() listSize.append("1:20000"); listSize.append("1:1"); - QString strScale = "1:" + QString::number(g_iScale); + QString strScale = "1:" + QString::number(m_iScale); int iIndex = listSize.indexOf(strScale); if(iIndex<0) { @@ -782,17 +784,24 @@ void PropertyWidget::initWidgetProperty() _CreateVariantPropertyItem("水平格线", "中格线间隔(m)", 2.0, QVariant::Double); } -void PropertyWidget::initWellProperty() +void PropertyWidget::initWellProperty(QString strUuid, QString strSlfName, QString strWellName, double iY1, double iY2) { //初始化,清空 InitCurrentViewInfo(); + m_strUuid = strUuid; + m_strSlfName = strSlfName; + m_strWellName = strWellName; + m_iY1 = iY1; + m_iY2 = iY2; + + //当前属性类型 m_strCurrentProperty = Well_Property; // - _CreateVariantPropertyItem("通常", "开始深度(m)", 0-g_iY2, QVariant::Double); - _CreateVariantPropertyItem("通常", "终止深度(m)", 0-g_iY1, QVariant::Double); + _CreateVariantPropertyItem("通常", "开始深度(m)", 0-m_iY2, QVariant::Double); + _CreateVariantPropertyItem("通常", "终止深度(m)", 0-m_iY1, QVariant::Double); } void PropertyWidget::initTrackProperty(QTableWidgetItem *item, int iWidth, QMyTableWidget *myTableWidget, int iCurrentCol) diff --git a/logPlus/PropertyWidget.h b/logPlus/PropertyWidget.h index 2349aaa..d9f3066 100644 --- a/logPlus/PropertyWidget.h +++ b/logPlus/PropertyWidget.h @@ -51,6 +51,9 @@ public: QString m_strWellName; QString m_strTrackName; QString m_strLineName; + int m_iScale=200; + double m_iY1=0; + double m_iY2=0; QString m_strCurrentProperty; QMap m_propertyData; //属性页值 @@ -84,9 +87,9 @@ public: void _CreateEnumPropertyItem(QString strGroup, QString strPropertyCaption, QVariant vtPropertyValue, QStringList listValue); void InitCurrentViewInfo(); //初始化属性,清空 - void initWidgetProperty(); //可视解释整体属性 + void initWidgetProperty(QString strUuid, int iScale); //可视解释整体属性 //井 - void initWellProperty(); + void initWellProperty(QString strUuid, QString strSlfName, QString strWellName, double iY1, double iY2); //道 void initTrackProperty(QTableWidgetItem *item, int iWidth, QMyTableWidget *myTableWidget, int iCurrentCol); //曲线 diff --git a/logPlus/customtabwidget.cpp b/logPlus/customtabwidget.cpp index 51dbc91..427fd92 100644 --- a/logPlus/customtabwidget.cpp +++ b/logPlus/customtabwidget.cpp @@ -14,6 +14,7 @@ #include #include #include "customtabbar.h" +#include "PropertyWidget.h" CustomTabWidget::CustomTabWidget(QWidget *parent) : QWidget(parent) @@ -125,6 +126,9 @@ void CustomTabWidget::setCurrentIndex(int index) { m_pStackedWidget->setCurrentIndex(index); emit currentTabChanged(m_pTabBar->tabText(index)); + + //属性清空 + PropertyService()->InitCurrentViewInfo(); } void CustomTabWidget::setAutoDelete(bool bAuto) @@ -186,4 +190,7 @@ void CustomTabWidget::dropEvent(QDropEvent *event) void CustomTabWidget::slot_tabClose(int index) { removeTab(index); + + //属性清空 + PropertyService()->InitCurrentViewInfo(); } diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index 6c0753a..b6069db 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -32,12 +32,12 @@ extern int g_iShow; //显示刻度 // extern int g_iX1; extern int g_iX2; -extern int g_iY1; -extern int g_iY2; +//extern int m_iY1; +//extern int m_iY2; extern int g_iCanZoom ; // extern double g_dPixelPerCm;//每厘米像素数 -extern int g_iScale; + extern int g_iSupport3D; @@ -133,7 +133,7 @@ void FormDraw::setDrawData(QStringList listdt) curv->setStyleSheet("background: transparent;"); double dHight = 0; - dHight = (g_iY2-g_iY1)*100.0/(double)g_iScale * g_dPixelPerCm; + dHight = (m_iY2-m_iY1)*100.0/(double)m_iScale * g_dPixelPerCm; if(g_iShow==1) { //显示刻度 @@ -225,7 +225,7 @@ void FormDraw::s_addLine(QString strUuid, QString strSlfName, QString strWellNam //curv->setGeometry(rect.left(),rect.top(), rect.width(), rect.height()); double dHight = 0; - dHight = (g_iY2-g_iY1)*100.0/(double)g_iScale * g_dPixelPerCm; + dHight = (m_iY2-m_iY1)*100.0/(double)m_iScale * g_dPixelPerCm; if(g_iShow==1) { //显示刻度 @@ -286,7 +286,7 @@ AppendConsole(PAI_INFO, "FormDraw s_AddLine_Property"); //curv->setGeometry(rect.left(),rect.top(), rect.width(), rect.height()); double dHight = 0; - dHight = (g_iY2-g_iY1)*100.0/(double)g_iScale * g_dPixelPerCm; + dHight = (m_iY2-m_iY1)*100.0/(double)m_iScale * g_dPixelPerCm; if(g_iShow==1) { //显示刻度 @@ -348,7 +348,7 @@ void FormDraw::s_addWave(QString strUuid, QString strSlfName, QString strWellNam //curv->setGeometry(rect.left(),rect.top(), rect.width(), rect.height()); double dHight = 0; - dHight = (g_iY2-g_iY1)*100.0/(double)g_iScale * g_dPixelPerCm; + dHight = (m_iY2-m_iY1)*100.0/(double)m_iScale * g_dPixelPerCm; if(g_iShow==1) { //显示刻度 @@ -437,7 +437,7 @@ void FormDraw::s_addTableLine(QString strUuid, QString strSlfName, QString strWe //curv->setGeometry(rect.left(),rect.top(), rect.width(), rect.height()); double dHight = 0; - dHight = (g_iY2-g_iY1)*100.0/(double)g_iScale * g_dPixelPerCm; + dHight = (m_iY2-m_iY1)*100.0/(double)m_iScale * g_dPixelPerCm; if(g_iShow==1) { //显示刻度 @@ -586,12 +586,12 @@ void FormDraw::setRowHeight(double dHight, QProgressBar *progressBar, int iSplit if(form->m_bX2Y == true) { //默认调换 - form->xAxis->setRange(g_iY1, g_iY2); + form->xAxis->setRange(m_iY1, m_iY2); } else { //针对裂缝的横向波形图,X,Y轴不调换 - form->yAxis->setRange(g_iY1, g_iY2); + form->yAxis->setRange(m_iY1, m_iY2); } //emit CallManage::getInstance()->sig_ChangeLeftScale(m_strUuid, form->m_strSlfName, m_strWellName, m_strTrackName, form->m_strLineName, form->m_iX1); @@ -979,7 +979,7 @@ void FormDraw::s_addGanZuangTu(QString strUuid, QString strSlfName, QString strW //curv->setGeometry(rect.left(),rect.top(), rect.width(), rect.height()); double dHight = 0; - dHight = (g_iY2-g_iY1)*100.0/(double)g_iScale * g_dPixelPerCm; + dHight = (m_iY2-m_iY1)*100.0/(double)m_iScale * g_dPixelPerCm; if(g_iShow==1) { //显示刻度 @@ -1047,7 +1047,7 @@ void FormDraw::s_addGanZuangTu(QString strUuid, QString strSlfName, QString strW QFont font1("微软雅黑", 16); //fontSize 10 curv->yAxis->setTickLabelFont(font1); - curv->yAxis->setRange(g_iY1, g_iY2); + curv->yAxis->setRange(m_iY1, m_iY2); curv->axisRect()->setupFullAxesBox(); // // curv->xAxis->ticker()->setTickCount(10);//x个主刻度 @@ -1057,11 +1057,11 @@ void FormDraw::s_addGanZuangTu(QString strUuid, QString strSlfName, QString strW float vmin = 0; curv->m_iX1 = vmin; curv->m_iX2 = iMyWidth; - curv->m_iY1 = g_iY1; - curv->m_iY2 = g_iY2; + curv->m_iY1 = m_iY1; + curv->m_iY2 = m_iY2; // curv->xAxis->setRange(vmin, vmax); - curv->yAxis->setRange(g_iY1, g_iY2); + curv->yAxis->setRange(m_iY1, m_iY2); curv->axisRect()->setupFullAxesBox(); // curv->xAxis->ticker()->setTickCount(10);//x个主刻度 @@ -1130,7 +1130,7 @@ void FormDraw::s_addJykt(QString strUuid, QString strSlfName, QString strWellNam //curv->setGeometry(rect.left(),rect.top(), rect.width(), rect.height()); double dHight = 0; - dHight = (g_iY2-g_iY1)*100.0/(double)g_iScale * g_dPixelPerCm; + dHight = (m_iY2-m_iY1)*100.0/(double)m_iScale * g_dPixelPerCm; if(g_iShow==1) { //显示刻度 @@ -1199,7 +1199,7 @@ void FormDraw::s_addDenv(QString strUuid, QString strSlfName, QString strWellNam //curv->setGeometry(rect.left(),rect.top(), rect.width(), rect.height()); double dHight = 0; - dHight = (g_iY2-g_iY1)*100.0/(double)g_iScale * g_dPixelPerCm; + dHight = (m_iY2-m_iY1)*100.0/(double)m_iScale * g_dPixelPerCm; if(g_iShow==1) { //显示刻度 @@ -1268,7 +1268,7 @@ void FormDraw::s_addDrawImage(QString strUuid, QString strSlfName, QString strWe //curv->setGeometry(rect.left(),rect.top(), rect.width(), rect.height()); double dHight = 0; - dHight = (g_iY2-g_iY1)*100.0/(double)g_iScale * g_dPixelPerCm; + dHight = (m_iY2-m_iY1)*100.0/(double)m_iScale * g_dPixelPerCm; if(g_iShow==1) { //显示刻度 @@ -1337,7 +1337,7 @@ void FormDraw::s_addSantuyibiao(QString strUuid, QString strSlfName, QString str // curv->setStyleSheet("background: transparent;"); double dHight = 0; - dHight = (g_iY2-g_iY1)*100.0/(double)g_iScale * g_dPixelPerCm; + dHight = (m_iY2-m_iY1)*100.0/(double)m_iScale * g_dPixelPerCm; if(g_iShow==1) { //显示刻度 @@ -1398,7 +1398,7 @@ void FormDraw::s_addCrack(QString strUuid, QString strSlfName, QString strWellNa curv->setStyleSheet("background: transparent;"); // double dHight = 0; - dHight = (g_iY2-g_iY1)*100.0/(double)g_iScale * g_dPixelPerCm; + dHight = (m_iY2-m_iY1)*100.0/(double)m_iScale * g_dPixelPerCm; if(g_iShow==1) { //显示刻度 @@ -1422,11 +1422,11 @@ void FormDraw::s_addCrack(QString strUuid, QString strSlfName, QString strWellNa float vmin = 0; curv->m_iX1 = vmin; curv->m_iX2 = vmax; - curv->m_iY1 = g_iY1; - curv->m_iY2 = g_iY2; + curv->m_iY1 = m_iY1; + curv->m_iY2 = m_iY2; // curv->xAxis->setRange(vmin, vmax); - curv->yAxis->setRange(g_iY1, g_iY2); + curv->yAxis->setRange(m_iY1, m_iY2); curv->axisRect()->setupFullAxesBox(); // curv->xAxis->ticker()->setTickCount(10);//x个主刻度 @@ -1486,7 +1486,7 @@ void FormDraw::s_addGeoSection(QString strUuid, QString strSlfName, QString strW curv->setStyleSheet("background: transparent;"); // double dHight = 0; - dHight = (g_iY2-g_iY1)*100.0/(double)g_iScale * g_dPixelPerCm; + dHight = (m_iY2-m_iY1)*100.0/(double)m_iScale * g_dPixelPerCm; if(g_iShow==1) { //显示刻度 @@ -1511,11 +1511,11 @@ void FormDraw::s_addGeoSection(QString strUuid, QString strSlfName, QString strW float vmin = 0; curv->m_iX1 = vmin; curv->m_iX2 = vmax; - curv->m_iY1 = g_iY1; - curv->m_iY2 = g_iY2; + curv->m_iY1 = m_iY1; + curv->m_iY2 = m_iY2; // curv->xAxis->setRange(vmin, vmax); - curv->yAxis->setRange(g_iY1, g_iY2); + curv->yAxis->setRange(m_iY1, m_iY2); curv->axisRect()->setupFullAxesBox(); // curv->xAxis->ticker()->setTickCount(10);//x个主刻度 @@ -1573,7 +1573,7 @@ void FormDraw::s_addJiegutext(QString strUuid, QString strSlfName, QString strWe curv->setStyleSheet("background: transparent;"); // double dHight = 0; - dHight = (g_iY2-g_iY1)*100.0/(double)g_iScale * g_dPixelPerCm; + dHight = (m_iY2-m_iY1)*100.0/(double)m_iScale * g_dPixelPerCm; if(g_iShow==1) { //显示刻度 @@ -1598,11 +1598,11 @@ void FormDraw::s_addJiegutext(QString strUuid, QString strSlfName, QString strWe float vmin = 0; curv->m_iX1 = vmin; curv->m_iX2 = vmax; - curv->m_iY1 = g_iY1; - curv->m_iY2 = g_iY2; + curv->m_iY1 = m_iY1; + curv->m_iY2 = m_iY2; // curv->xAxis->setRange(vmin, vmax); - curv->yAxis->setRange(g_iY1, g_iY2); + curv->yAxis->setRange(m_iY1, m_iY2); curv->axisRect()->setupFullAxesBox(); // curv->xAxis->ticker()->setTickCount(10);//x个主刻度 @@ -1679,7 +1679,7 @@ void FormDraw::s_addLogface(QString strUuid, QString strSlfName, QString strWell curv->setStyleSheet("background: transparent;"); // double dHight = 0; - dHight = (g_iY2-g_iY1)*100.0/(double)g_iScale * g_dPixelPerCm; + dHight = (m_iY2-m_iY1)*100.0/(double)m_iScale * g_dPixelPerCm; if(g_iShow==1) { //显示刻度 @@ -1704,11 +1704,11 @@ void FormDraw::s_addLogface(QString strUuid, QString strSlfName, QString strWell float vmin = 0; curv->m_iX1 = vmin; curv->m_iX2 = vmax; - curv->m_iY1 = g_iY1; - curv->m_iY2 = g_iY2; + curv->m_iY1 = m_iY1; + curv->m_iY2 = m_iY2; // curv->xAxis->setRange(vmin, vmax); - curv->yAxis->setRange(g_iY1, g_iY2); + curv->yAxis->setRange(m_iY1, m_iY2); curv->axisRect()->setupFullAxesBox(); // curv->xAxis->ticker()->setTickCount(10);//x个主刻度 @@ -1765,7 +1765,7 @@ void FormDraw::s_addMCals(QString strUuid, QString strSlfName, QString strWellNa curv->setStyleSheet("background: transparent;"); // double dHight = 0; - dHight = (g_iY2-g_iY1)*100.0/(double)g_iScale * g_dPixelPerCm; + dHight = (m_iY2-m_iY1)*100.0/(double)m_iScale * g_dPixelPerCm; if(g_iShow==1) { //显示刻度 @@ -1790,11 +1790,11 @@ void FormDraw::s_addMCals(QString strUuid, QString strSlfName, QString strWellNa float vmin = 0; curv->m_iX1 = vmin; curv->m_iX2 = vmax; - curv->m_iY1 = g_iY1; - curv->m_iY2 = g_iY2; + curv->m_iY1 = m_iY1; + curv->m_iY2 = m_iY2; // curv->xAxis->setRange(vmin, vmax); - curv->yAxis->setRange(g_iY1, g_iY2); + curv->yAxis->setRange(m_iY1, m_iY2); curv->axisRect()->setupFullAxesBox(); // curv->xAxis->ticker()->setTickCount(10);//x个主刻度 @@ -1851,7 +1851,7 @@ void FormDraw::s_addTubingstring(QString strUuid, QString strSlfName, QString st curv->setStyleSheet("background: transparent;"); // double dHight = 0; - dHight = (g_iY2-g_iY1)*100.0/(double)g_iScale * g_dPixelPerCm; + dHight = (m_iY2-m_iY1)*100.0/(double)m_iScale * g_dPixelPerCm; if(g_iShow==1) { //显示刻度 @@ -1876,11 +1876,11 @@ void FormDraw::s_addTubingstring(QString strUuid, QString strSlfName, QString st float vmin = 0; curv->m_iX1 = vmin; curv->m_iX2 = vmax; - curv->m_iY1 = g_iY1; - curv->m_iY2 = g_iY2; + curv->m_iY1 = m_iY1; + curv->m_iY2 = m_iY2; // curv->xAxis->setRange(vmin, vmax); - curv->yAxis->setRange(g_iY1, g_iY2); + curv->yAxis->setRange(m_iY1, m_iY2); curv->axisRect()->setupFullAxesBox(); // curv->xAxis->ticker()->setTickCount(10);//x个主刻度 @@ -2011,11 +2011,11 @@ void FormDraw::initForm(QMyCustomPlot *widget, QString strSlfName, QString strLi widget->m_iX1 = vmin; widget->m_iX2 = vmax; - widget->m_iY1 = g_iY1; - widget->m_iY2 = g_iY2; + widget->m_iY1 = m_iY1; + widget->m_iY2 = m_iY2; // widget->xAxis->setRange(vmin, vmax); - widget->yAxis->setRange(g_iY1, g_iY2); + widget->yAxis->setRange(m_iY1, m_iY2); widget->axisRect()->setupFullAxesBox(); // widget->xAxis->ticker()->setTickCount(10);//x个主刻度 @@ -2038,7 +2038,7 @@ void FormDraw::initForm(QMyCustomPlot *widget, QString strSlfName, QString strLi // // // widget->yAxis->setRange(vmin, vmax); -// widget->xAxis->setRange(g_iY1, g_iY2); +// widget->xAxis->setRange(m_iY1, m_iY2); // widget->axisRect()->setupFullAxesBox(); // // // widget->yAxis->ticker()->setTickCount(10);//x个主刻度 @@ -2130,8 +2130,8 @@ void FormDraw::initWave(QMyCustomPlot *widget, QString strSlfName, QString strWa float _SDep,_EDep,_Rlev; _SDep = _wave.StartDepth; _EDep = _wave.EndDepth; -// _SDep = 0.0 - g_iY2; -// _EDep = 0.0 - g_iY1; +// _SDep = 0.0 - m_iY2; +// _EDep = 0.0 - m_iY1; _Rlev = _wave.DepLevel; int m_Record=(float)(fabs((_EDep-_SDep)/_Rlev+0.5)); @@ -2175,16 +2175,16 @@ void FormDraw::initWave(QMyCustomPlot *widget, QString strSlfName, QString strWa } delete[] value; -// g_iY1 = 0.0 -_EDep; -// g_iY2 = 0.0 -_SDep; +// m_iY1 = 0.0 -_EDep; +// m_iY2 = 0.0 -_SDep; //------------------------ widget->m_iX1 = vmin; widget->m_iX2 = vmax; - widget->m_iY1 = g_iY1; - widget->m_iY2 = g_iY2; + widget->m_iY1 = m_iY1; + widget->m_iY2 = m_iY2; // widget->xAxis->setRange(vmin, vmax); - widget->yAxis->setRange(g_iY1, g_iY2); + widget->yAxis->setRange(m_iY1, m_iY2); widget->axisRect()->setupFullAxesBox(); // widget->xAxis->ticker()->setTickCount(10);//x个主刻度 @@ -2202,7 +2202,7 @@ void FormDraw::initWave(QMyCustomPlot *widget, QString strSlfName, QString strWa int nx = m_Record; int ny = _nSamples; colorMap->data()->setSize(nx, ny); // 我们希望彩色地图有nx*ny的数据点 - //colorMap->data()->setRange(QCPRange(g_iY1, g_iY2), QCPRange(vmin, vmax)); // 并在键(x)和值(y)维上跨越坐标范围-4..4 + //colorMap->data()->setRange(QCPRange(m_iY1, m_iY2), QCPRange(vmin, vmax)); // 并在键(x)和值(y)维上跨越坐标范围-4..4 colorMap->data()->setRange(QCPRange(0-_EDep, 0-_SDep), QCPRange(vmin, vmax)); // :现在,我们通过访问颜色贴图的QCPColorMapData实例来分配一些数据: double x, y, z; @@ -2259,8 +2259,8 @@ void FormDraw::initWave_3D(QMyCustomPlot *widget, QString strSlfName, QString st float _SDep,_EDep,_Rlev; _SDep = _wave.StartDepth; _EDep = _wave.EndDepth; -// _SDep = 0.0 - g_iY2; -// _EDep = 0.0 - g_iY1; +// _SDep = 0.0 - m_iY2; +// _EDep = 0.0 - m_iY1; _Rlev = _wave.DepLevel; int m_Record=(float)(fabs((_EDep-_SDep)/_Rlev+0.5)); @@ -2307,16 +2307,16 @@ void FormDraw::initWave_3D(QMyCustomPlot *widget, QString strSlfName, QString st // vmax = (float)_nSamples; // vmin = 0; -// g_iY1 = 0.0 -_EDep; -// g_iY2 = 0.0 -_SDep; +// m_iY1 = 0.0 -_EDep; +// m_iY2 = 0.0 -_SDep; //------------------------ widget->m_iX1 = vmin; widget->m_iX2 = vmax; - widget->m_iY1 = g_iY1; - widget->m_iY2 = g_iY2; + widget->m_iY1 = m_iY1; + widget->m_iY2 = m_iY2; // widget->xAxis->setRange(vmin, vmax); - widget->yAxis->setRange(g_iY1, g_iY2); + widget->yAxis->setRange(m_iY1, m_iY2); widget->axisRect()->setupFullAxesBox(); // widget->xAxis->ticker()->setTickCount(10);//x个主刻度 @@ -2496,7 +2496,7 @@ void FormDraw::initWave_3D(QMyCustomPlot *widget, QString strSlfName, QString st int nx = m_Record; int ny = _nSamples; colorMap->data()->setSize(nx, ny); // 我们希望彩色地图有nx*ny的数据点 - //colorMap->data()->setRange(QCPRange(g_iY1, g_iY2), QCPRange(vmin, vmax)); // 并在键(x)和值(y)维上跨越坐标范围-4..4 + //colorMap->data()->setRange(QCPRange(m_iY1, m_iY2), QCPRange(vmin, vmax)); // 并在键(x)和值(y)维上跨越坐标范围-4..4 colorMap->data()->setRange(QCPRange(0-_EDep, 0-_SDep), QCPRange(vmin, vmax)); // :现在,我们通过访问颜色贴图的QCPColorMapData实例来分配一些数据: //double x, y, z; @@ -2592,8 +2592,8 @@ void FormDraw::DrawImageNew_NoFilter(QMyCustomPlot *widget, QString strSlfName, float _SDep,_EDep,_Rlev; _SDep = _wave.StartDepth; _EDep = _wave.EndDepth; -// _SDep = 0.0 - g_iY2; -// _EDep = 0.0 - g_iY1; +// _SDep = 0.0 - m_iY2; +// _EDep = 0.0 - m_iY1; _Rlev = _wave.DepLevel; int m_Record=(float)(fabs((_EDep-_SDep)/_Rlev+0.5)); @@ -2637,16 +2637,16 @@ void FormDraw::DrawImageNew_NoFilter(QMyCustomPlot *widget, QString strSlfName, } delete[] value; -// g_iY1 = 0.0 -_EDep; -// g_iY2 = 0.0 -_SDep; +// m_iY1 = 0.0 -_EDep; +// m_iY2 = 0.0 -_SDep; //------------------------ widget->m_iX1 = vmin; widget->m_iX2 = vmax; - widget->m_iY1 = g_iY1; - widget->m_iY2 = g_iY2; + widget->m_iY1 = m_iY1; + widget->m_iY2 = m_iY2; // widget->xAxis->setRange(vmin, vmax); - widget->yAxis->setRange(g_iY1, g_iY2); + widget->yAxis->setRange(m_iY1, m_iY2); widget->axisRect()->setupFullAxesBox(); // widget->xAxis->ticker()->setTickCount(10);//x个主刻度 @@ -2664,7 +2664,7 @@ void FormDraw::DrawImageNew_NoFilter(QMyCustomPlot *widget, QString strSlfName, int nx = m_Record; int ny = _nSamples; colorMap->data()->setSize(nx, ny); // 我们希望彩色地图有nx*ny的数据点 - //colorMap->data()->setRange(QCPRange(g_iY1, g_iY2), QCPRange(vmin, vmax)); // 并在键(x)和值(y)维上跨越坐标范围-4..4 + //colorMap->data()->setRange(QCPRange(m_iY1, m_iY2), QCPRange(vmin, vmax)); // 并在键(x)和值(y)维上跨越坐标范围-4..4 colorMap->data()->setRange(QCPRange(0-_EDep, 0-_SDep), QCPRange(vmin, vmax)); // :现在,我们通过访问颜色贴图的QCPColorMapData实例来分配一些数据: double x, y, z; @@ -2760,11 +2760,11 @@ void FormDraw::initWave2(QMyCustomPlot *widget, QString strSlfName, QString strW // _SDep = _wave.StartDepth; // _EDep = _wave.EndDepth; - g_iY2 = 0 - _wave.StartDepth; - g_iY1 = 0 - _wave.EndDepth; + m_iY2 = 0 - _wave.StartDepth; + m_iY1 = 0 - _wave.EndDepth; - _SDep = 0.0 - g_iY2; - _EDep = 0.0 - g_iY1; + _SDep = 0.0 - m_iY2; + _EDep = 0.0 - m_iY1; _Rlev = _wave.DepLevel; int m_Record=(float)(fabs((_EDep-_SDep)/_Rlev+0.5)); @@ -2808,16 +2808,16 @@ void FormDraw::initWave2(QMyCustomPlot *widget, QString strSlfName, QString strW } delete[] value; -// g_iY1 = 0.0 -_EDep; -// g_iY2 = 0.0 -_SDep; +// m_iY1 = 0.0 -_EDep; +// m_iY2 = 0.0 -_SDep; //------------------------ widget->m_iX1 = vmin; widget->m_iX2 = vmax; - widget->m_iY1 = g_iY1; - widget->m_iY2 = g_iY2; + widget->m_iY1 = m_iY1; + widget->m_iY2 = m_iY2; // widget->xAxis->setRange(vmin, vmax); - widget->yAxis->setRange(g_iY1, g_iY2); + widget->yAxis->setRange(m_iY1, m_iY2); widget->axisRect()->setupFullAxesBox(); // widget->xAxis->ticker()->setTickCount(10);//x个主刻度 @@ -2980,11 +2980,11 @@ void FormDraw::initTableLine(QMyCustomPlot *widget, QString strSlfName, QString float vmin = 0; widget->m_iX1 = vmin; widget->m_iX2 = iMyWidth; - widget->m_iY1 = g_iY1; - widget->m_iY2 = g_iY2; + widget->m_iY1 = m_iY1; + widget->m_iY2 = m_iY2; // widget->xAxis->setRange(vmin, vmax); - widget->yAxis->setRange(g_iY1, g_iY2); + widget->yAxis->setRange(m_iY1, m_iY2); widget->axisRect()->setupFullAxesBox(); // widget->xAxis->ticker()->setTickCount(10);//x个主刻度 @@ -3032,11 +3032,11 @@ void FormDraw::initWords(QMyCustomPlot *widget, QString strSlfName, QString strL float vmin = 0; widget->m_iX1 = vmin; widget->m_iX2 = iMyWidth; - widget->m_iY1 = g_iY1; - widget->m_iY2 = g_iY2; + widget->m_iY1 = m_iY1; + widget->m_iY2 = m_iY2; // widget->xAxis->setRange(vmin, vmax); - widget->yAxis->setRange(g_iY1, g_iY2); + widget->yAxis->setRange(m_iY1, m_iY2); widget->axisRect()->setupFullAxesBox(); // widget->xAxis->ticker()->setTickCount(10);//x个主刻度 @@ -3076,11 +3076,11 @@ void FormDraw::initIMAGE_DATA(QMyCustomPlot *widget, QString strSlfName, QString float vmin = 0; widget->m_iX1 = vmin; widget->m_iX2 = iMyWidth; - widget->m_iY1 = g_iY1; - widget->m_iY2 = g_iY2; + widget->m_iY1 = m_iY1; + widget->m_iY2 = m_iY2; // widget->xAxis->setRange(vmin, vmax); - widget->yAxis->setRange(g_iY1, g_iY2); + widget->yAxis->setRange(m_iY1, m_iY2); widget->axisRect()->setupFullAxesBox(); // widget->xAxis->ticker()->setTickCount(10);//x个主刻度 @@ -3247,11 +3247,11 @@ void FormDraw::initResult(QMyCustomPlot *widget, QString strSlfName, QString str float vmin = 0; widget->m_iX1 = vmin; widget->m_iX2 = iMyWidth; - widget->m_iY1 = g_iY1; - widget->m_iY2 = g_iY2; + widget->m_iY1 = m_iY1; + widget->m_iY2 = m_iY2; // widget->xAxis->setRange(vmin, vmax); - widget->yAxis->setRange(g_iY1, g_iY2); + widget->yAxis->setRange(m_iY1, m_iY2); widget->axisRect()->setupFullAxesBox(); // widget->xAxis->ticker()->setTickCount(10);//x个主刻度 @@ -3611,11 +3611,11 @@ void FormDraw::initGeoLith(QMyCustomPlot *widget, QString strSlfName, QString st float vmin = 0; widget->m_iX1 = vmin; widget->m_iX2 = iMyWidth; - widget->m_iY1 = g_iY1; - widget->m_iY2 = g_iY2; + widget->m_iY1 = m_iY1; + widget->m_iY2 = m_iY2; // widget->xAxis->setRange(vmin, vmax); - widget->yAxis->setRange(g_iY1, g_iY2); + widget->yAxis->setRange(m_iY1, m_iY2); widget->axisRect()->setupFullAxesBox(); // widget->xAxis->ticker()->setTickCount(10);//x个主刻度 @@ -3763,11 +3763,11 @@ void FormDraw::initSwallCore(QMyCustomPlot *widget, QString strSlfName, QString float vmin = 0; widget->m_iX1 = vmin; widget->m_iX2 = iMyWidth; - widget->m_iY1 = g_iY1; - widget->m_iY2 = g_iY2; + widget->m_iY1 = m_iY1; + widget->m_iY2 = m_iY2; // widget->xAxis->setRange(vmin, vmax); - widget->yAxis->setRange(g_iY1, g_iY2); + widget->yAxis->setRange(m_iY1, m_iY2); widget->axisRect()->setupFullAxesBox(); // widget->xAxis->ticker()->setTickCount(10);//x个主刻度 @@ -3912,11 +3912,11 @@ void FormDraw::initGujing(QMyCustomPlot *widget, QString strSlfName, QString str float vmin = 0; widget->m_iX1 = vmin; widget->m_iX2 = iMyWidth; - widget->m_iY1 = g_iY1; - widget->m_iY2 = g_iY2; + widget->m_iY1 = m_iY1; + widget->m_iY2 = m_iY2; // widget->xAxis->setRange(vmin, vmax); - widget->yAxis->setRange(g_iY1, g_iY2); + widget->yAxis->setRange(m_iY1, m_iY2); widget->axisRect()->setupFullAxesBox(); // widget->xAxis->ticker()->setTickCount(10);//x个主刻度 @@ -4036,7 +4036,7 @@ void FormDraw::initDepth(QMyCustomPlot *curv) QFont font1("微软雅黑", 16); //fontSize 10 curv->yAxis->setTickLabelFont(font1); - curv->yAxis->setRange(g_iY1, g_iY2); + curv->yAxis->setRange(m_iY1, m_iY2); curv->axisRect()->setupFullAxesBox(); // // curv->xAxis->ticker()->setTickCount(10);//x个主刻度 @@ -4054,11 +4054,11 @@ void FormDraw::initFgrq(QMyCustomPlot *widget) { widget->m_iX1 = 0; widget->m_iX2 = 1024; - widget->m_iY1 = g_iY1; - widget->m_iY2 = g_iY2; + widget->m_iY1 = m_iY1; + widget->m_iY2 = m_iY2; // widget->xAxis->setRange(widget->m_iX1, widget->m_iX2); - widget->yAxis->setRange(g_iY1, g_iY2); + widget->yAxis->setRange(m_iY1, m_iY2); //对调XY轴,在最前面设置 QCPAxis *yAxis = widget->yAxis; @@ -4112,8 +4112,8 @@ void FormDraw::initFgrq(QMyCustomPlot *widget) m_bTypeDraw[i] = true; } - ftmpSdep = -g_iY2; - ftmpEdep = -g_iY1; + ftmpSdep = -m_iY2; + ftmpEdep = -m_iY1; } int nPointNum = m_FracTabList.count(); @@ -4314,11 +4314,11 @@ void FormDraw::initRose(QMyCustomPlot *widget) { widget->m_iX1 = 0; widget->m_iX2 = 1024; - widget->m_iY1 = g_iY1; - widget->m_iY2 = g_iY2; + widget->m_iY1 = m_iY1; + widget->m_iY2 = m_iY2; // widget->xAxis->setRange(widget->m_iX1, widget->m_iX2); - widget->yAxis->setRange(g_iY1, g_iY2); + widget->yAxis->setRange(m_iY1, m_iY2); //对调XY轴,在最前面设置 QCPAxis *yAxis = widget->yAxis; @@ -4372,8 +4372,8 @@ void FormDraw::initRose(QMyCustomPlot *widget) m_bTypeDraw[i] = true; } - ftmpSdep = -g_iY2; - ftmpEdep = -g_iY1; + ftmpSdep = -m_iY2; + ftmpEdep = -m_iY1; } int nPointNum = m_FracTabList.count(); @@ -4677,11 +4677,11 @@ void FormDraw::initDCA(QMyCustomPlot *widget) { widget->m_iX1 = 0; widget->m_iX2 = 360; - widget->m_iY1 = g_iY1; - widget->m_iY2 = g_iY2; + widget->m_iY1 = m_iY1; + widget->m_iY2 = m_iY2; // widget->xAxis->setRange(widget->m_iX1, widget->m_iX2); - widget->yAxis->setRange(g_iY1, g_iY2); + widget->yAxis->setRange(m_iY1, m_iY2); //对调XY轴,在最前面设置 QCPAxis *yAxis = widget->yAxis; @@ -4745,8 +4745,8 @@ void FormDraw::initDCA(QMyCustomPlot *widget) // 计算显示深度 float sdepc,edepc; - sdepc = -g_iY2; - edepc = -g_iY1; + sdepc = -m_iY2; + edepc = -m_iY1; if ( sdepc > m_EDep ) sdepc=m_EDep; if ( edepc > m_EDep ) edepc = m_EDep; if(edepcm_iX1 = vmin; widget->m_iX2 = vmax; - widget->m_iY1 = g_iY1; - widget->m_iY2 = g_iY2; + widget->m_iY1 = m_iY1; + widget->m_iY2 = m_iY2; // widget->xAxis->setRange(vmin, vmax); - widget->yAxis->setRange(g_iY1, g_iY2); + widget->yAxis->setRange(m_iY1, m_iY2); widget->axisRect()->setupFullAxesBox(); // widget->xAxis->ticker()->setTickCount(10);//x个主刻度 @@ -5203,11 +5203,11 @@ void FormDraw::DrawJykt(QMyCustomPlot *widget, QString strSlfName) float vmin = m_LeftVal; widget->m_iX1 = vmin; widget->m_iX2 = vmax; - widget->m_iY1 = g_iY1; - widget->m_iY2 = g_iY2; + widget->m_iY1 = m_iY1; + widget->m_iY2 = m_iY2; // widget->xAxis->setRange(vmin, vmax); - widget->yAxis->setRange(g_iY1, g_iY2); + widget->yAxis->setRange(m_iY1, m_iY2); widget->axisRect()->setupFullAxesBox(); // widget->xAxis->ticker()->setTickCount(10);//x个主刻度 @@ -5329,11 +5329,11 @@ void FormDraw::DrawDenv(QMyCustomPlot *widget, QString strSlfName) float vmin = m_LeftVal; widget->m_iX1 = vmin; widget->m_iX2 = vmax; - widget->m_iY1 = g_iY1; - widget->m_iY2 = g_iY2; + widget->m_iY1 = m_iY1; + widget->m_iY2 = m_iY2; // widget->xAxis->setRange(vmin, vmax); - widget->yAxis->setRange(g_iY1, g_iY2); + widget->yAxis->setRange(m_iY1, m_iY2); widget->axisRect()->setupFullAxesBox(); // widget->xAxis->ticker()->setTickCount(10);//x个主刻度 @@ -5598,8 +5598,8 @@ void FormDraw::DrawTabDip(QMyCustomPlot *widget) if(i==0&&j==0) continue; { QCPItemStraightLine *qcpItemLine = new QCPItemStraightLine(widget); - qcpItemLine->point1->setCoords(-g_iY2, dtick);//位置 - qcpItemLine->point2->setCoords(-g_iY1, dtick);//位置 + qcpItemLine->point1->setCoords(-m_iY2, dtick);//位置 + qcpItemLine->point2->setCoords(-m_iY1, dtick);//位置 if(j==0) { qcpItemLine->setPen(pPenStraightLine); @@ -5618,7 +5618,7 @@ void FormDraw::DrawTabDip(QMyCustomPlot *widget) for (i=0; i -g_iY1) +// if ( frac.DEP < -m_iY2 || frac.DEP > -m_iY1) // { // continue; // } diff --git a/logPlus/formdraw.h b/logPlus/formdraw.h index a2c1ec1..1a9b859 100644 --- a/logPlus/formdraw.h +++ b/logPlus/formdraw.h @@ -71,6 +71,10 @@ public: QString m_strWellName; QString m_strTrackName; + int m_iScale=200; + double m_iY1=0; + double m_iY2=0; + FormTrack *m_formTrack; QStringList m_listLineName; diff --git a/logPlus/formwell.cpp b/logPlus/formwell.cpp index 865f0d9..5ee051b 100644 --- a/logPlus/formwell.cpp +++ b/logPlus/formwell.cpp @@ -3,10 +3,10 @@ #include "CallManage.h" extern int g_iOneWidth; //道宽 -extern int g_iY1; -extern int g_iY2; +//extern int m_iY1; +//extern int m_iY2; extern double g_dPixelPerCm;//每厘米像素数 -extern int g_iScale; + extern int g_iShow; //显示刻度 //井+道名 FormWell::FormWell(QWidget *parent, QString strWellName) : @@ -104,6 +104,8 @@ void FormWell::s_NewTrack(QString strUuid, QString strWellName, QString strSlfNa formTrack->show(); //曲线绘制栏 FormDraw *formDraw = new FormDraw(this, m_strWellName, strTrackName); + formDraw->m_iY1 = m_iY1; + formDraw->m_iY2 = m_iY2; formDraw->m_strUuid = m_strUuid; formDraw->m_formTrack = formTrack; // @@ -132,7 +134,7 @@ void FormWell::s_NewTrack(QString strUuid, QString strWellName, QString strSlfNa else if(i==2) { double dHight = 0; - dHight = (g_iY2-g_iY1)*100.0/(double)g_iScale * g_dPixelPerCm; + dHight = (m_iY2-m_iY1)*100.0/(double)m_iScale * g_dPixelPerCm; if(g_iShow==1) { //显示刻度 @@ -265,11 +267,13 @@ void FormWell::s_NewTrack_No_Line(QString strUuid, QString strWellName, QString ui->tableWidget->setHorizontalHeaderItem(columnCount, headerItem); //曲线名称栏 - FormTrack *formTrack = new FormTrack(this, m_strWellName, strTrackName); + FormTrack *formTrack = new FormTrack(this, m_strWellName, strTrackName); formTrack->m_strUuid = m_strUuid; formTrack->show(); //曲线绘制栏 FormDraw *formDraw = new FormDraw(this, m_strWellName, strTrackName); + formDraw->m_iY1 = m_iY1; + formDraw->m_iY2 = m_iY2; formDraw->m_strUuid = m_strUuid; formDraw->m_formTrack = formTrack; // @@ -298,7 +302,7 @@ void FormWell::s_NewTrack_No_Line(QString strUuid, QString strWellName, QString else if(i==2) { double dHight = 0; - dHight = (g_iY2-g_iY1)*100.0/(double)g_iScale * g_dPixelPerCm; + dHight = (m_iY2-m_iY1)*100.0/(double)m_iScale * g_dPixelPerCm; if(g_iShow==1) { //显示刻度 @@ -348,6 +352,10 @@ void FormWell::setRowHeight(double dHight, QProgressBar *progressBar, int iSplit //设置高度 ui->tableWidget->setRowHeight(2, (int)dHight);//7582 + ui->tableWidget->m_iScale = m_iScale; + ui->tableWidget->m_strUuid = m_strUuid; + + int iBeginValue = progressBar->value(); // int columnCount = ui->tableWidget->columnCount();//总列数 @@ -364,6 +372,9 @@ void FormWell::setRowHeight(double dHight, QProgressBar *progressBar, int iSplit if(formDraw) { //progressBar->setValue(iBeginValue+ i*iSplitWell); // 更新进度条的值 + formDraw->m_iY1 = m_iY1; + formDraw->m_iY2 = m_iY2; + formDraw->m_iScale = m_iScale; formDraw->setRowHeight(dHight, progressBar, iSplitWell); } } @@ -432,7 +443,7 @@ void FormWell::s_NewCol(QStringList listdt) else if(i==2) { double dHight = 0; - dHight = (g_iY2-g_iY1)*100.0/(double)g_iScale * g_dPixelPerCm; + dHight = (m_iY2-m_iY1)*100.0/(double)m_iScale * g_dPixelPerCm; if(g_iShow==1) { //显示刻度 @@ -447,6 +458,8 @@ void FormWell::s_NewCol(QStringList listdt) ui->tableWidget->setRowHeight(i, (int)dHight);//7582 //曲线绘制栏 FormDraw *formDraw = new FormDraw(this, m_strWellName, strTrackName); + formDraw->m_iY1 = m_iY1; + formDraw->m_iY2 = m_iY2; formDraw->m_strUuid = m_strUuid; formDraw->m_formTrack = formTrack; formDraw->setDrawData(listdt); diff --git a/logPlus/formwell.h b/logPlus/formwell.h index f963367..e1a48c7 100644 --- a/logPlus/formwell.h +++ b/logPlus/formwell.h @@ -29,6 +29,9 @@ public: QString m_strUuid; QString m_strWellName; QString m_strSlfName=""; + int m_iScale=200; + double m_iY1=0; + double m_iY2=0; public: QJsonObject makeJson(); diff --git a/logPlus/mainwindow.cpp b/logPlus/mainwindow.cpp index feb876d..2bd47d4 100644 --- a/logPlus/mainwindow.cpp +++ b/logPlus/mainwindow.cpp @@ -39,7 +39,6 @@ int g_iY1 = -3000; int g_iY2 = 0; int g_iCanZoom = 0; -int g_iScale = 200;//2500 QString g_prjname=""; //是否隐藏刻度 @@ -307,8 +306,8 @@ void MainWindow::dockLayout() tabifyDockWidget(m_consoleOutputWidget, m_propertyWidget); - // - m_propertyWidget->initWidgetProperty(); + //属性清空 + m_propertyWidget->InitCurrentViewInfo(); } void MainWindow::s_New() diff --git a/logPlus/mainwindowcurve.cpp b/logPlus/mainwindowcurve.cpp index 45f9ad9..9d7bf06 100644 --- a/logPlus/mainwindowcurve.cpp +++ b/logPlus/mainwindowcurve.cpp @@ -17,10 +17,9 @@ extern int g_iOneWidth; //道宽 extern QString g_prjname; // -extern int g_iY1; -extern int g_iY2; +//extern int m_iY1; +//extern int m_iY2; extern double g_dPixelPerCm;//每厘米像素数 -extern int g_iScale; extern int g_iShow; //显示刻度 extern int g_iRows; @@ -111,7 +110,8 @@ MainWindowCurve::MainWindowCurve(QWidget *parent) : //connect(this, SIGNAL(sig_NewWell(QString, QString)), this, SLOT(s_NewWell(QString, QString))); connect(CallManage::getInstance(), SIGNAL(sig_mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*))); - connect(CallManage::getInstance(), SIGNAL(sig_changeScale(int)), this, SLOT(s_changeScale(int))); + connect(CallManage::getInstance(), SIGNAL(sig_changeScale(QString, int)), this, SLOT(s_changeScale(QString, int))); + connect(CallManage::getInstance(), SIGNAL(sig_changeDepth(QString, QString, QString, int, int)), this, SLOT(s_changeDepth(QString, QString, QString, int, int))); connect(CallManage::getInstance(), SIGNAL(sig_changeWidth(QString, QString, QString, QString, int, int)), this, SLOT(s_changeWidth(QString, QString, QString, QString, int, int))); //曲线选中,置顶 connect(CallManage::getInstance(), SIGNAL(sig_Raise(QString, QString, QString, QString, QString, int)), this, SLOT(s_Raise(QString, QString, QString, QString, QString, int))); @@ -749,7 +749,7 @@ void MainWindowCurve::s_MoveShift() QString value1 = QString("起始深度: "); spinbox1 = new QLineEdit(&dialog); if(1) { - float yGeoNormal =-g_iY2; + float yGeoNormal =-m_iY2; spinbox1->setText(toString(((int)(yGeoNormal*10+0.5))/10.0)); } else spinbox1->setText("-9999.0"); @@ -759,7 +759,7 @@ void MainWindowCurve::s_MoveShift() form.addRow(value1, spinbox2); if(1) { - spinbox2->setText(toString(-g_iY1)); + spinbox2->setText(toString(-m_iY1)); } else spinbox2->setText("-9999.0"); value1 = QString("移动量(上移-,下移+): "); @@ -1040,9 +1040,9 @@ QJsonObject MainWindowCurve::makeJson() QJsonObject rootObj; // rootObj["prjname"] = g_prjname; - rootObj["iScale"] = g_iScale; - rootObj["iY1"] = g_iY1; - rootObj["iY2"] = g_iY2; + rootObj["iScale"] = m_iScale; + rootObj["iY1"] = m_iY1; + rootObj["iY2"] = m_iY2; // 创建JSON数组并填充数据 QJsonArray subcaseArray; @@ -1124,7 +1124,7 @@ void MainWindowCurve::s_NewWell(QString strWellName, QString strSlfName) else { double dHight = 0; - dHight = (g_iY2-g_iY1)*100.0/(double)g_iScale * g_dPixelPerCm; + dHight = (m_iY2-m_iY1)*100.0/(double)m_iScale * g_dPixelPerCm; if(g_iShow==1) { //显示刻度 @@ -1140,6 +1140,8 @@ void MainWindowCurve::s_NewWell(QString strWellName, QString strSlfName) ui->tableWidget_2->setRowHeight(i, (int)dHight);//8020 // FormWell *widgetWell = new FormWell(this, strWellName); + widgetWell->m_iY1 = m_iY1; + widgetWell->m_iY2 = m_iY2; widgetWell->m_strUuid = m_strUuid; widgetWell->m_strSlfName = strSlfName; ui->tableWidget_2->setCellWidget(i, columnCount, widgetWell); @@ -1163,7 +1165,7 @@ void MainWindowCurve::mousePressEvent(QMouseEvent *event) qDebug()<< "mouse clicked at" << event->pos(); - PropertyService()->initWidgetProperty(); + PropertyService()->initWidgetProperty(m_strUuid, m_iScale); //取消所有选中单元格 emit CallManage::getInstance()->sig_Raise(m_strUuid, "", "", "", "", 1); } @@ -1210,9 +1212,9 @@ void MainWindowCurve::onItemClicked(QTableWidgetItem* item) //曲线 QString strWellName = item->text(); - //QString strSlfName = item->data(Qt::UserRole+1).toString(); + QString strSlfName = item->data(Qt::UserRole+1).toString(); - PropertyService()->initWellProperty(); + PropertyService()->initWellProperty(m_strUuid, strSlfName, strWellName, m_iY1, m_iY2); //取消所有选中单元格 emit CallManage::getInstance()->sig_Raise(m_strUuid, "", "", "", "", 1); @@ -2362,7 +2364,7 @@ void MainWindowCurve::Open(QString fileFull) int iScale = value.toInt(); qDebug() << "iScale:" << QString::number(iScale); // - g_iScale = iScale; + m_iScale = iScale; } } // @@ -2373,7 +2375,7 @@ void MainWindowCurve::Open(QString fileFull) int iY1 = value.toInt(); qDebug() << "iY1:" << QString::number(iY1); // - g_iY1 = iY1; + m_iY1 = iY1; } } // @@ -2384,7 +2386,7 @@ void MainWindowCurve::Open(QString fileFull) int iY2 = value.toInt(); qDebug() << "iY2:" << QString::number(iY2); // - g_iY2 = iY2; + m_iY2 = iY2; } } // @@ -2444,6 +2446,7 @@ void MainWindowCurve::s_changeWidth(QString strUuid, QString strSlfName, QString //调整井宽 ui->tableWidget_2->setColumnWidth(i, iWellWidth); + break; } } } @@ -2451,22 +2454,31 @@ void MainWindowCurve::s_changeWidth(QString strUuid, QString strSlfName, QString } } -//改变缩放比例 -void MainWindowCurve::s_changeScale(int iNewScale) -{ - slot_time(); -} - void MainWindowCurve::slot_time() { +} + +//改变缩放比例 +void MainWindowCurve::s_changeScale(QString strUuid, int iNewScale) +{ + if(m_strUuid==strUuid) + { + } + else + { + return; + } + QProgressBar *progressBar = new QProgressBar(this); progressBar->setGeometry(100, 100, 500, 30); // 设置进度条的位置和大小 progressBar->setMaximum(100); // 设置最大值为100 progressBar->setValue(0); // 初始值设为0 progressBar->show(); + m_iScale = iNewScale; + double dHight = 0; - dHight = (g_iY2-g_iY1)*100.0/(double)g_iScale * g_dPixelPerCm; + dHight = (m_iY2-m_iY1)*100.0/(double)m_iScale * g_dPixelPerCm; if(g_iShow==1) { //显示刻度 @@ -2509,7 +2521,8 @@ void MainWindowCurve::slot_time() FormWell *widgetWell = (FormWell*)myWidget;//获得widget if(widgetWell) { - widgetWell->setRowHeight(dHight, progressBar, iSplit); + widgetWell->m_iScale = iNewScale; + widgetWell->setRowHeight(dHight, progressBar, iSplit); } } } @@ -2519,6 +2532,99 @@ void MainWindowCurve::slot_time() //update(); } + +//改变深度 +void MainWindowCurve::s_changeDepth(QString strUuid, QString strSlfName, QString strWellName, int iY1, int iY2) +{ + if(m_strUuid==strUuid) + { + } + else + { + return; + } + + QProgressBar *progressBar = new QProgressBar(this); + progressBar->setGeometry(100, 100, 500, 30); // 设置进度条的位置和大小 + progressBar->setMaximum(100); // 设置最大值为100 + progressBar->setValue(0); // 初始值设为0 + progressBar->show(); + + m_iY1 = iY1; + m_iY2 = iY2; + + double dHight = 0; + dHight = (m_iY2-m_iY1)*100.0/(double)m_iScale * g_dPixelPerCm; + if(g_iShow==1) + { + //显示刻度 + dHight = dHight+30; + } + if(dHight>32767) + { + dHight = 32767; + } + + + double dHightMax=0; + //-------------------- + // + int columnCount = ui->tableWidget_2->columnCount();//总列数 + int iSplit = 100 / (columnCount/2+1); + + for(int i=0; isetValue(i*iSplit); // 更新进度条的值 + //QCoreApplication::processEvents(); // 让界面更新显示进度条的当前值 + + if( ui->tableWidget_2->cellWidget(1, i) != nullptr ) + { + auto myWidget = ui->tableWidget_2->cellWidget(1, i); + if(myWidget) + { + // + FormWell *widgetWell = (FormWell*)myWidget;//获得widget + if(widgetWell) + { + if(widgetWell->m_strUuid==strUuid + && widgetWell->m_strSlfName==strSlfName + && widgetWell->m_strWellName==strWellName) + { + widgetWell->m_iY1 = iY1; + widgetWell->m_iY2 = iY2; + widgetWell->setRowHeight(dHight, progressBar, iSplit); + //break; + } + // + double temp = widgetWell->m_iY2 - widgetWell->m_iY1; + if(dHightMaxtableWidget_2->setRowHeight(1, (int)dHightOne);//8020 + + // + progressBar->deleteLater(); + //update(); +} + void MainWindowCurve::DisplayWells(QJsonArray wellsArray) { QMap mapWells; diff --git a/logPlus/mainwindowcurve.h b/logPlus/mainwindowcurve.h index 066231f..4e9c250 100644 --- a/logPlus/mainwindowcurve.h +++ b/logPlus/mainwindowcurve.h @@ -48,7 +48,9 @@ public: public slots: void slot_time(); //改变缩放比例 - void s_changeScale(int iNewScale); + void s_changeScale(QString strUuid, int iNewScale); + //改变深度 + void s_changeDepth(QString strUuid, QString strSlfName, QString strWellName, int iY1, int iY2); //改变道宽 void s_changeWidth(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, int iCurrentCol, int iNewWidth); @@ -83,6 +85,10 @@ public: QLineEdit *spinbox2; QLineEdit *spinbox3; + int m_iScale=200; + double m_iY1=0; + double m_iY2=0; + public: //展示所有井 void DisplayWells(QJsonArray wellsArray); diff --git a/logPlus/qmytablewidget.cpp b/logPlus/qmytablewidget.cpp index cee2959..0c1a460 100644 --- a/logPlus/qmytablewidget.cpp +++ b/logPlus/qmytablewidget.cpp @@ -131,7 +131,7 @@ void QMyTableWidget::mouseReleaseEvent(QMouseEvent *event) if(iCurrentRow<0) { //未选中 - PropertyService()->initWidgetProperty(); + PropertyService()->initWidgetProperty(m_strUuid, m_iScale); } else { QTableWidgetItem *item = currentItem(); diff --git a/logPlus/qmytablewidget.h b/logPlus/qmytablewidget.h index 6b32fc1..a050f22 100644 --- a/logPlus/qmytablewidget.h +++ b/logPlus/qmytablewidget.h @@ -35,6 +35,9 @@ public: bool m_press;//判断鼠标是否按下 //bool m_draging;//判断是鼠标是否释放 + QString m_strUuid; + int m_iScale=200; + signals: void sig_columnDragged(int from, int to);