|
|
|
@ -44,25 +44,12 @@ const QVector<QPointF>& phasePoints(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// “有该相产量”按至少一个非零值判断;只有公共零占位行不算真实产量。
|
|
|
|
|
|
|
|
bool hasNonZeroPhaseRate(
|
|
|
|
|
|
|
|
const nmFlowGaugeRecord& oRecord, NM_PHASE_TYPE ePhase)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
const QVector<QPointF>& vecPoints = phasePoints(oRecord, ePhase);
|
|
|
|
|
|
|
|
for(int nIndex = 0; nIndex < vecPoints.size(); ++nIndex) {
|
|
|
|
|
|
|
|
if(vecPoints[nIndex].y() != 0.0) {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 下拉项只有在记录可用且该相确有非零产量时才允许选择。
|
|
|
|
// 下拉项只有在记录可用且该相确有非零产量时才允许选择。
|
|
|
|
bool isSelectableFlowPhase(
|
|
|
|
bool isSelectableFlowPhase(
|
|
|
|
const nmFlowGaugeRecord& oRecord, NM_PHASE_TYPE ePhase)
|
|
|
|
const nmFlowGaugeRecord& oRecord, NM_PHASE_TYPE ePhase)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oRecord.eStatus == NM_GaugeRecord_Usable &&
|
|
|
|
return oRecord.eStatus == NM_GaugeRecord_Usable &&
|
|
|
|
hasNonZeroPhaseRate(oRecord, ePhase);
|
|
|
|
nmHasNonZeroFlowRate(phasePoints(oRecord, ePhase));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 候选井至少要有一条可选分相记录;压力记录不是主动井候选的必要条件。
|
|
|
|
// 候选井至少要有一条可选分相记录;压力记录不是主动井候选的必要条件。
|
|
|
|
@ -70,9 +57,7 @@ bool hasSelectableRateRecord(const QVector<nmFlowGaugeRecord>& vecRecords)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for(int nIndex = 0; nIndex < vecRecords.size(); ++nIndex) {
|
|
|
|
for(int nIndex = 0; nIndex < vecRecords.size(); ++nIndex) {
|
|
|
|
const nmFlowGaugeRecord& oRecord = vecRecords[nIndex];
|
|
|
|
const nmFlowGaugeRecord& oRecord = vecRecords[nIndex];
|
|
|
|
if(isSelectableFlowPhase(oRecord, PHASE_Oil) ||
|
|
|
|
if(nmIsSelectableFlowRecord(oRecord)) {
|
|
|
|
isSelectableFlowPhase(oRecord, PHASE_Gas) ||
|
|
|
|
|
|
|
|
isSelectableFlowPhase(oRecord, PHASE_Water)) {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -110,13 +95,6 @@ nmFlowGaugeRecord* findMutableFlowRecord(
|
|
|
|
return nullptr;
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 压力曲线至少需要两个点才能用于历史曲线计算。
|
|
|
|
|
|
|
|
bool isSelectablePressureRecord(const nmPressureGaugeRecord& oRecord)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return oRecord.eStatus == NM_GaugeRecord_Usable &&
|
|
|
|
|
|
|
|
oRecord.vecPressurePoints.size() >= 2;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 打开对话框时只恢复仍存在且仍可用的压力记录 Code。
|
|
|
|
// 打开对话框时只恢复仍存在且仍可用的压力记录 Code。
|
|
|
|
bool containsSelectablePressureCode(
|
|
|
|
bool containsSelectablePressureCode(
|
|
|
|
const QVector<nmPressureGaugeRecord>& vecRecords,
|
|
|
|
const QVector<nmPressureGaugeRecord>& vecRecords,
|
|
|
|
@ -124,7 +102,7 @@ bool containsSelectablePressureCode(
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for(int nIndex = 0; nIndex < vecRecords.size(); ++nIndex) {
|
|
|
|
for(int nIndex = 0; nIndex < vecRecords.size(); ++nIndex) {
|
|
|
|
if(vecRecords[nIndex].sGaugeCode == sGaugeCode &&
|
|
|
|
if(vecRecords[nIndex].sGaugeCode == sGaugeCode &&
|
|
|
|
isSelectablePressureRecord(vecRecords[nIndex])) {
|
|
|
|
nmIsSelectablePressureRecord(vecRecords[nIndex])) {
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -429,7 +407,7 @@ void nmWxIncludeOtherWells::setupTable()
|
|
|
|
++nRecordIndex) {
|
|
|
|
++nRecordIndex) {
|
|
|
|
const nmFlowGaugeRecord& oRecord =
|
|
|
|
const nmFlowGaugeRecord& oRecord =
|
|
|
|
oWellRow.m_vecFlowRecords[nRecordIndex];
|
|
|
|
oWellRow.m_vecFlowRecords[nRecordIndex];
|
|
|
|
if(oRecord.eStatus != NM_GaugeRecord_Usable) {
|
|
|
|
if(!nmIsSelectableFlowRecord(oRecord)) {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
oWellRow.m_sFlowGaugeCode = oRecord.sGaugeCode;
|
|
|
|
oWellRow.m_sFlowGaugeCode = oRecord.sGaugeCode;
|
|
|
|
@ -718,7 +696,7 @@ void nmWxIncludeOtherWells::populatePressureCombo(
|
|
|
|
pComboBox->setItemData(0, tr("None"), Qt::ToolTipRole);
|
|
|
|
pComboBox->setItemData(0, tr("None"), Qt::ToolTipRole);
|
|
|
|
for(int nIndex = 0; nIndex < data.m_vecPressureRecords.size(); ++nIndex) {
|
|
|
|
for(int nIndex = 0; nIndex < data.m_vecPressureRecords.size(); ++nIndex) {
|
|
|
|
const nmPressureGaugeRecord& oRecord = data.m_vecPressureRecords[nIndex];
|
|
|
|
const nmPressureGaugeRecord& oRecord = data.m_vecPressureRecords[nIndex];
|
|
|
|
if(!isSelectablePressureRecord(oRecord)) {
|
|
|
|
if(!nmIsSelectablePressureRecord(oRecord)) {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
appendGaugeRecordItem(pComboBox,
|
|
|
|
appendGaugeRecordItem(pComboBox,
|
|
|
|
|