📄 oilshotforecastview.cpp
字号:
if(wnd->m_structBDTTable.fStratumPly == 0)
{
MessageBox("请输入地层总厚度 !","工程信息");
return FALSE;
}
return TRUE;
}
void COilShotForecastView::OilshotforecastLoad()
{
// TODO: Add your control notification handler code here
CMainFrame* wnd = (CMainFrame*)AfxGetMainWnd();
if(wnd->m_structOilShotForecast.bState == FALSE)
return;
UpdateData();
m_fAngle = wnd->m_structOilShotForecast.fAngle;
m_cstrModel = wnd->m_structOilShotForecast.strModel;
m_fNPro = wnd->m_structOilShotForecast.fNPro;
m_fPR = wnd->m_structOilShotForecast.fPR;
m_fS4 = wnd->m_structOilShotForecast.fS4;
m_fSD = wnd->m_structOilShotForecast.fSD;
m_fSDP = wnd->m_structOilShotForecast.fSDP;
m_fSP = wnd->m_structOilShotForecast.fSP;
m_fSPP = wnd->m_structOilShotForecast.fSPP;
m_fSPro = wnd->m_structOilShotForecast.fSPro;
m_fST = wnd->m_structOilShotForecast.fST;
m_fShotDen = wnd->m_structSelectedPara.fShotDen ;
m_fShotPhasic = wnd->m_structSelectedPara .fAngle ;
m_cstrModel = wnd->m_structSelectedPara.strModel;
UpdateData(FALSE);
}
int COilShotForecastView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFormView::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
CMainFrame* wnd = (CMainFrame*)AfxGetMainWnd();
if(wnd->m_bSelected == FALSE)
{
MessageBox("请先在参数优选中选择一种射孔弹 !","工程信息");
return -1;
}
/* CString cstrProjectName;
CSpdDoc* pDoc = (CSpdDoc*)GetDocument();
cstrProjectName = pDoc->m_cstrTitle +" - [油井产能比表皮系数预测]";
pDoc->SetTitle (cstrProjectName);
*/
GetParentFrame()->SetWindowText(_T("油井产能比表皮系数预测"));
return 0;
}
void COilShotForecastView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
// TODO: Add your specialized code here and/or call the base class
OilshotforecastLoad();
}
void COilShotForecastView::OnSpdCacl()
{
// TODO: Add your command handler code here
CWaitCursor wait;
if(DataOK() == FALSE) return;
CMainFrame* wnd = (CMainFrame*)AfxGetMainWnd();
UpdateData();
int iShotBullet;
for(iShotBullet=0;iShotBullet<wnd->m_structBDTTable.lCount;iShotBullet++)
{
if(m_cstrModel.Compare(wnd->m_structSDT[iShotBullet].strModel)==0)
break;
}
UpdateData(FALSE);
if(iShotBullet>=wnd->m_structBDTTable.lCount)
{
MessageBox("射孔弹型号错误 !","工程信息");
return;
}
float ks1,kj1,aa;
aa = wnd->m_structBDTTable.fStratumHeterosphere ;
// ks1 = wnd->m_structSDT[iShotBullet].fShotDepth *wnd->m_structTTPResult.fPP[iShotBullet];
// kj1 = wnd->m_structSDT[iShotBullet].fDiameter *wnd->m_structTTPResult.fPP[iShotBullet];
ks1 = wnd->m_structTTPResult.fPDepth[iShotBullet];
kj1 = wnd->m_structTTPResult.fPDiameter[iShotBullet];
if(ks1 == 600) ks1 = (float)600;
CString dx;
dx = wnd->m_structSDT[iShotBullet].strModel ;
float ks = ks1;
float kj = kj1;
float yh = wnd->m_structSDT[iShotBullet].fPressDeep ;
float yc = wnd->m_structSDT[iShotBullet].fPressLong ;
float wh = wnd->m_structBDTTable.fDrillPolluteDepth ;
float wc = wnd->m_structBDTTable.fDrillPollutePercent ;
float jbj = (float)(wnd->m_structBDTTable.fWellRadius * 1000);
float pe = wnd->m_structBDTTable.fStratumAverPress ;
float miu = wnd->m_structBDTTable.fStratumOilStiff ;
float pk = wnd->m_structBDTTable.fStratumFilterPercent ;
float tave = wnd->m_structBDTTable.fStratumTemp ;
float faif = wnd->m_structBDTTable.fStratumHolePercent ;
float faib = wnd->m_structBDTTable.fStratumCentralDepth ;
float re = wnd->m_structBDTTable.fRevealOilRadius ;
float dp = wnd->m_structBDTTable.fProducePressDiff ;
float kzr = wnd->m_structBDTTable.fStratumHeterosphere ;
float h = wnd->m_structBDTTable.fStratumPly ;
float h1 = wnd->m_structBDTTable.fShotLayerPly ;
UpdateData();
float km = m_fShotDen;
float xw = m_fShotPhasic;
UpdateData(FALSE);
//*****
float prp,pry,prt,sp,sy,st,sd,sc;
if(yh>0 || wh>0)
{
prp = (float)(fnprl(ks,km,kj,xw,jbj,kzr)*1.1);
pry = (float)(fnpry(ks,km,kj,xw,jbj,kzr,yh,yc)*1.1);
if(ks<=wh)
{
prt = (float)(fnprw(ks,km,kj,xw,jbj,kzr,yh,yc,wh,wc)*1.1);
if(prt>=pry)
{
swap(prt,pry);
sp = (float)((1-prp)*(log(re*1000/jbj)-0.75)/prp);
sy = (float)((1-pry)*(log(re*1000/jbj)-0.75)/pry);
st = (float)((1-prt)*(log(re*1000/jbj)-0.75)/prt);
swap(prt,pry);
}
else
{
sp = (float)((1-prp)*(log(re*1000/jbj)-0.75)/prp);
sy = (float)((1-pry)*(log(re*1000/jbj)-0.75)/pry);
st = (float)((1-prt)*(log(re*1000/jbj)-0.75)/prt);
}
}
else
{
prt = (float)(fnprc(ks,km,kj,xw,jbj,kzr,yh,yc,wh,wc)*1.1);
if(prt>=pry)
{
swap(prt,pry);
sp = (float)((1-prp)*(log(re*1000/jbj)-0.75)/prp);
sy = (float)((1-pry)*(log(re*1000/jbj)-0.75)/pry);
st = (float)((1-prt)*(log(re*1000/jbj)-0.75)/prt);
swap(prt,pry);
}
else
{
sp = (float)((1-prp)*(log(re*1000/jbj)-0.75)/prp);
sy = (float)((1-pry)*(log(re*1000/jbj)-0.75)/pry);
st = (float)((1-prt)*(log(re*1000/jbj)-0.75)/prt);
}
}
if(yh == 0 || yc ==1)
{
sd = st - sp;
sc = (float)0;
}
else
{
sd = st - sy;
sc = sy - sp;
}
}
else
{
prp = (float)(fnprl(ks,km,kj,xw,jbj,kzr)*1.1);
sp = (float)((1-prp)*(log(re*1000/jbj)-0.75)/prp);
sd = (float)0;
sc = (float)0;
st = sp;
prt = prp;
}
float qo = (float)(542.87*pk*h*dp/(1.1*miu*(log(re*1000/jbj)-0.75)));
if(prt<0.01)
{
prt = (float)0.05;
st = (float)((1-prt)*(log(re*1000/jbj)-0.75)/prt);
}
//************
UpdateData();
float sita = m_fAngle;
UpdateData(FALSE);
float hd = (float)((h*1000/jbj)*pow((1/kzr),0.5));
float s4 = (float)(-pow(sita/41,2.06)-pow(sita/56,1.865)*log(hd/100));
float b = h1/h;
float gb = (float)(2.948-7.363*b+11.45*b*b-4.675*pow(b,3));
float s5 = (float)(((1-b)/b)*(log(h*1000*pow(1/kzr,0.5)/jbj)-gb));
float st1 = st+s4+s5;
float q = (float)(542.87*pk*h*dp/(1.1*miu*(log(re*1000/jbj)-0.75+st1)));
UpdateData();
m_fPR = prt;
m_fST = st1;
m_fNPro = qo;
m_fSPro = q;
m_fSP = sp;
m_fSD = sd;
m_fSDP = sc;
m_fS4 = s4;
m_fSPP = s5;
//修改
wnd->m_structOilShotForecast.bState = TRUE;
wnd->m_structOilShotForecast.fAngle = m_fAngle;
wnd->m_structOilShotForecast.fShotDen = m_fShotDen;
wnd->m_structOilShotForecast.fShotPhasic = m_fShotPhasic;
sprintf(wnd->m_structOilShotForecast.strModel,"%s",m_cstrModel);
wnd->m_structOilShotForecast.fNPro = m_fNPro;
wnd->m_structOilShotForecast.fPR = m_fPR;
wnd->m_structOilShotForecast.fS4 = m_fS4;
wnd->m_structOilShotForecast.fSD = m_fSD;
wnd->m_structOilShotForecast.fSDP = m_fSDP;
wnd->m_structOilShotForecast.fSP = m_fSP;
wnd->m_structOilShotForecast.fSPP = m_fSPP;
wnd->m_structOilShotForecast.fSPro = m_fSPro;
wnd->m_structOilShotForecast.fST = m_fST;
UpdateData(FALSE);
}
void COilShotForecastView::OnContextMenu(CWnd*, CPoint point)
{
// CG: This block was added by the Pop-up Menu component { if (point.x == -1 && point.y == -1){ //keystroke invocation CRect rect; GetClientRect(rect); ClientToScreen(rect); point = rect.TopLeft(); point.Offset(5, 5); } CMenu menu; VERIFY(menu.LoadMenu(IDR_POPUP_SPD)); CMenu* pPopup = menu.GetSubMenu(3); ASSERT(pPopup != NULL); CWnd* pWndPopupOwner = this; while (pWndPopupOwner->GetStyle() & WS_CHILD) pWndPopupOwner = pWndPopupOwner->GetParent(); pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, pWndPopupOwner); }
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -