1、调整 储存和网格的顺序;

2、优化井的选择;
feature/ribbon-menu-20240927
simonyan 3 weeks ago
parent ee8fd00cc3
commit 6436e4a057

File diff suppressed because one or more lines are too long

@ -210,13 +210,13 @@
<Cmd ID="5311" Bounds="0,8,2,1" Name="TODO4" Alias="区域绘制" Icon="Time" />
<Cmd ID="5312" Bounds="0,9,2,1" Name="TODO4" Alias="区域标识" Icon="Time" />
</Group>
<Group Name="NtGrid" Alias="网格">
<Cmd ID="5401" Bounds="0,0,2,1" Name="WellGrid" Alias="网格生成" Icon="PrepareGrid" />
</Group>
<Group Name="NtReservoir" Alias="储层">
<Cmd ID="5501" Bounds="0,0,2,1" Name="Reservoir" Alias="属性" Icon="PrepareGrid" />
</Group>
<Group Name="NtGrid" Alias="网格">
<Cmd ID="5401" Bounds="0,0,2,1" Name="WellGrid" Alias="网格生成" Icon="PrepareGrid" />
</Group>
<Group Name="NtPostprocessing" Alias="后处理">
<Cmd ID="5601" Bounds="0,0,2,1" Name="Postprocessing" Alias="后处理" Icon="PrepareGrid" />
</Group>

@ -7,6 +7,7 @@
class QCheckBox;
class QVariant;
class QListWidget;
class QTextEdit;
class nmWxSelectWellItemWidget: public QWidget
{
@ -24,6 +25,8 @@ protected:
void mousePressEvent(QMouseEvent *event) override;
signals:
void sigItemClicked();
private slots:
void onStateChanged(int);
private:
QCheckBox* m_pCBox;
QString m_sName;
@ -39,9 +42,10 @@ public:
public:
void addItems(QStringList items, QList<QVariant> values);
void addItem(QString name, QVariant value);
QStringList getItems();
private:
QListWidget* m_pListWidget;
QLineEdit* m_pLineEdit;
QTextEdit* m_pLineEdit;
QStringList m_items;
QList<QVariant> m_values;

@ -712,16 +712,20 @@ void nmSubWndMain::selectWell()
wellCodes.append(wellObj->getCode());
}
nmWxSelectWellsDlg* dlg = new nmWxSelectWellsDlg(this);
nmWxSelectWellsWidget *wellListWidget = new nmWxSelectWellsWidget(this);
nmWxSelectWellsWidget *wellListWidget = new nmWxSelectWellsWidget(NULL);
wellListWidget->addItems(wellNames, wellCodes);
dlg->setWidget(wellListWidget);
if(dlg->exec() == QDialog::Accepted) {
// 用户点击了“确定”按钮
nmDataLogFile::getInstance()->writeLog(" OK ");
QStringList wellNames = wellListWidget->getItems();
nmDataLogFile::getInstance()->writeLog(wellNames.join(";"));
} else {
// 用户点击了“取消”按钮
nmDataLogFile::getInstance()->writeLog(" Cancel ");
}
delete wellListWidget;
wellListWidget = NULL;
}
void nmSubWndMain::drawWell()

@ -8,16 +8,19 @@
#include <QDebug>
#include <QListWidget>
#include "nmData/nmDataLogFile.h"
#include <QTextEdit>
nmWxSelectWellsWidget::nmWxSelectWellsWidget(QWidget* aParent) :
QWidget(aParent),
m_pListWidget(new QListWidget(this)),
m_pLineEdit(new QLineEdit(this))
m_pLineEdit(new QTextEdit(this))
{
QVBoxLayout* layout = new QVBoxLayout;
layout->addWidget(m_pLineEdit);
layout->addWidget(m_pListWidget);
this->setLayout(layout);
// m_pLineEdit->setText(multiLineText);
m_pLineEdit->setReadOnly(true);
}
void nmWxSelectWellsWidget::addItems(QStringList items, QList<QVariant> values)
@ -43,6 +46,11 @@ void nmWxSelectWellsWidget::addItem(QString name, QVariant value)
connect(itemWidget, SIGNAL(sigItemClicked()), this, SLOT(onUpdateSelections()));
}
QStringList nmWxSelectWellsWidget::getItems()
{
return m_pLineEdit->toPlainText().split(",");
}
void nmWxSelectWellsWidget::onUpdateSelections()
{
QStringList nameList;
@ -53,7 +61,7 @@ void nmWxSelectWellsWidget::onUpdateSelections()
nameList.append(m_items[i]);
}
}
m_pLineEdit->setText(nameList.join(","));
m_pLineEdit->setPlainText(nameList.join(","));
}
@ -97,6 +105,9 @@ void nmWxSelectWellItemWidget::initUI()
m_pCBox = new QCheckBox(this);
m_pCBox->setText(m_sName);
layout->setAlignment(Qt::AlignVCenter);
layout->setContentsMargins(10, 0, 0, 0);
layout->setSpacing(0);
connect(m_pCBox, SIGNAL(stateChanged(int)), this, SLOT(onStateChanged(int)));
}
void nmWxSelectWellItemWidget::mousePressEvent(QMouseEvent *event)
@ -110,3 +121,8 @@ void nmWxSelectWellItemWidget::mousePressEvent(QMouseEvent *event)
this->toggleSelected();
emit this->sigItemClicked();
}
void nmWxSelectWellItemWidget::onStateChanged(int)
{
emit this->sigItemClicked();
}

Loading…
Cancel
Save