|
|
@ -631,11 +631,35 @@ void nmSubWndMain::updateSelectedWells(QList<ZxDataWell *> wellObjList)
|
|
|
|
if (wellObjList.count() == 0) {
|
|
|
|
if (wellObjList.count() == 0) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// TODO 1,如果已经画在油藏地图上了,则不需要添加,
|
|
|
|
// setp 1,获取现在画布上所有的井信息
|
|
|
|
// TODO 2,如何不在,需要添加
|
|
|
|
QVector<nmObjPointWell*> pWellPlotList = m_pWxPlot->getWellPlots();
|
|
|
|
// TODO 3,如果以前在,现在不在,需要删除
|
|
|
|
QMap<ZxDataWell*, nmObjPointWell*> pWellDataToPlotMap;
|
|
|
|
for (int i = 0; i < wellObjList.count(); i++ ) {
|
|
|
|
// setp 2,在图元里,不在wellObjList里,是要删除的图元
|
|
|
|
ZxDataWell* wellObj = wellObjList[i];
|
|
|
|
QVector<nmObjPointWell*> vDeleteWellPlotList;
|
|
|
|
|
|
|
|
for (int i = 0; i < pWellPlotList.count(); i++) {
|
|
|
|
|
|
|
|
ZxDataWell *pWellData = pWellPlotList[i]->getWellData();
|
|
|
|
|
|
|
|
pWellDataToPlotMap.insert(pWellData, pWellPlotList[i]);
|
|
|
|
|
|
|
|
if (!wellObjList.contains(pWellData)) {
|
|
|
|
|
|
|
|
vDeleteWellPlotList.append(pWellPlotList[i]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO 3,在wellObjList 不在 图元pWellPlotDataList里 需要添加
|
|
|
|
|
|
|
|
QList<ZxDataWell*> pWellPlotDataList = pWellDataToPlotMap.keys();
|
|
|
|
|
|
|
|
QVector<ZxDataWell*> vAddWellPlotList;
|
|
|
|
|
|
|
|
for (int i = 0; i < wellObjList.count() ; i++ ) {
|
|
|
|
|
|
|
|
ZxDataWell *pWellData = wellObjList[i];
|
|
|
|
|
|
|
|
if (!pWellPlotDataList.contains(pWellData)) {
|
|
|
|
|
|
|
|
vAddWellPlotList.append(pWellData);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// setp 4,将vDeleteWellPlotList中的图元删除
|
|
|
|
|
|
|
|
for (int i = 0; i < vDeleteWellPlotList.count() ; i++ ) {
|
|
|
|
|
|
|
|
nmObjPointWell* pWellPlot = vDeleteWellPlotList[i];
|
|
|
|
|
|
|
|
m_pWxPlot->m_pPlot->removeObjByName(pWellPlot->getName());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// setp 5,将vAddWellPlotList中的井数据,构建图元,添加到画布上
|
|
|
|
|
|
|
|
for (int i = 0; i < vAddWellPlotList.count(); i++ ) {
|
|
|
|
|
|
|
|
ZxDataWell* wellObj = vAddWellPlotList[i];
|
|
|
|
QString sName = tr("nmObj");
|
|
|
|
QString sName = tr("nmObj");
|
|
|
|
QVector<QPointF> points;
|
|
|
|
QVector<QPointF> points;
|
|
|
|
points.append(QPointF(wellObj->getLocationX(), wellObj->getLocationY()));
|
|
|
|
points.append(QPointF(wellObj->getLocationX(), wellObj->getLocationY()));
|
|
|
@ -724,6 +748,8 @@ void nmSubWndMain::drawFault()
|
|
|
|
|
|
|
|
|
|
|
|
void nmSubWndMain::selectWell()
|
|
|
|
void nmSubWndMain::selectWell()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
// 先获取已经添加到的界面中井
|
|
|
|
|
|
|
|
QStringList wellPlotNameList = m_pWxPlot->getWellNames();
|
|
|
|
// 先找到所有的井
|
|
|
|
// 先找到所有的井
|
|
|
|
int wellCount = zxCurProject->getChildrenCount(iDataModelType::sTypeWell);
|
|
|
|
int wellCount = zxCurProject->getChildrenCount(iDataModelType::sTypeWell);
|
|
|
|
ZxDataObjectList wellList = zxCurProject->getChildren(iDataModelType::sTypeWell);
|
|
|
|
ZxDataObjectList wellList = zxCurProject->getChildren(iDataModelType::sTypeWell);
|
|
|
@ -745,6 +771,7 @@ void nmSubWndMain::selectWell()
|
|
|
|
// 展示dialog供选择
|
|
|
|
// 展示dialog供选择
|
|
|
|
nmWxSelectWellsDlg dlg;
|
|
|
|
nmWxSelectWellsDlg dlg;
|
|
|
|
nmWxSelectWellsWidget wellListWidget;
|
|
|
|
nmWxSelectWellsWidget wellListWidget;
|
|
|
|
|
|
|
|
wellListWidget.setSelectedItems(wellPlotNameList);
|
|
|
|
wellListWidget.addItems(wellNames, wellCodes);
|
|
|
|
wellListWidget.addItems(wellNames, wellCodes);
|
|
|
|
dlg.setWidget(&wellListWidget);
|
|
|
|
dlg.setWidget(&wellListWidget);
|
|
|
|
if(dlg.exec() == QDialog::Accepted) {
|
|
|
|
if(dlg.exec() == QDialog::Accepted) {
|
|
|
|