⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainfrm.cpp

📁 这是本人两年前兼职为某个公司做的石油钻进设计软件
💻 CPP
📖 第 1 页 / 共 5 页
字号:
	}
	else
	{
		CCVenusDoc*	pNewDoc	= new CCVenusDoc;
		
		CRuntimeClass* pNewViewClass;
		if(m_structWellInfo.bWellState == TRUE)
			pNewViewClass = RUNTIME_CLASS(COilMinusPressView);
		else
			pNewViewClass = RUNTIME_CLASS(CGasMinusPressView);
		
		CCreateContext context;
		
		context.m_pNewViewClass = pNewViewClass;
		context.m_pCurrentDoc = pNewDoc;
		context.m_pCurrentFrame = NULL;
		
		CChildFrame*	pNewFrame = new CChildFrame;
		
		pNewFrame->LoadFrame(IDR_MAINFRAME,
			WS_OVERLAPPEDWINDOW ,   // default frame styles
			NULL, &context);
		pNewFrame->InitialUpdateFrame(pNewDoc, true);
	}
*/
	CCVenusDoc*	pNewDoc	= new CCVenusDoc;
	
	CRuntimeClass* pNewViewClass;
	if(m_structWellInfo.bWellState == TRUE)
		pNewViewClass = RUNTIME_CLASS(COilMinusPressView);
	else
		pNewViewClass = RUNTIME_CLASS(CGasMinusPressView);
	
	CCreateContext context;
	context.m_pNewViewClass = pNewViewClass;
	context.m_pCurrentDoc = pNewDoc;
	context.m_pCurrentFrame = NULL;
	
	CChildFrame*	pNewFrame = new CChildFrame;
	
	LockMyWindowUpdate( );
	if(GetActiveFrame() != this)
		GetActiveFrame()->SendMessage(WM_CLOSE, NULL, NULL);
	pNewFrame->LoadFrame(IDR_MAINFRAME,
		WS_OVERLAPPEDWINDOW ,   // default frame styles
		NULL, &context);
	pNewFrame->InitialUpdateFrame(pNewDoc, true);
	MDITile();
	UnlockMyWindowUpdate();

	m_picState = PicNone;
	
}

void CMainFrame::OnMenuitem33799() 
{
	if(m_cstrProjectPath.IsEmpty())
		return;
	if(m_structBDTTable.fStratumFilterPercent == 0)
	{
		MessageBox("请先输入地层渗透率 !","工程信息");
		return;
	}
/*	if(GetActiveFrame() != this)
	{
		CChildFrame *pChild = (CChildFrame *)GetActiveFrame();
		CRuntimeClass* pNewViewClass;
		if(m_structWellInfo.bWellState)
			pNewViewClass = RUNTIME_CLASS(COilSandPressDesign);
		else
			pNewViewClass = RUNTIME_CLASS(CGasSandPressDesign);
		
		CView* pOldActiveView = pChild->GetActiveView();
		CCreateContext context;
		context.m_pNewViewClass = pNewViewClass;
		context.m_pCurrentDoc = GetActiveDocument();
		//	context.m_pCurrentFrame = pChild;
		CView* pNewView = STATIC_DOWNCAST(CView, pChild->CreateView(&context));
		if (pNewView != NULL)
		{
			// the new view is there, but invisible and not active...
			pNewView->ShowWindow(SW_SHOW);
			pNewView->OnInitialUpdate();
			pChild->SetActiveView(pNewView);
			pChild->RecalcLayout();
			
			// finally destroy the old view...
			pOldActiveView->DestroyWindow();
		}
	}
	else
	{
		CCVenusDoc*	pNewDoc	= new CCVenusDoc;
		
		CRuntimeClass* pNewViewClass;
		if(m_structWellInfo.bWellState)
			pNewViewClass = RUNTIME_CLASS(COilSandPressDesign);
		else
			pNewViewClass = RUNTIME_CLASS(CGasSandPressDesign);
		CCreateContext context;
		
		context.m_pNewViewClass = pNewViewClass;
		context.m_pCurrentDoc = pNewDoc;
		context.m_pCurrentFrame = NULL;
		
		CChildFrame*	pNewFrame = new CChildFrame;
		
		pNewFrame->LoadFrame(IDR_MAINFRAME,
			WS_OVERLAPPEDWINDOW ,   // default frame styles
			NULL, &context);
		pNewFrame->InitialUpdateFrame(pNewDoc, true);
	}
*/	
	CCVenusDoc*	pNewDoc	= new CCVenusDoc;
	
	CRuntimeClass* pNewViewClass;
	if(m_structWellInfo.bWellState)
		pNewViewClass = RUNTIME_CLASS(COilSandPressDesign);
	else
		pNewViewClass = RUNTIME_CLASS(CGasSandPressDesign);
	
	CCreateContext context;
	context.m_pNewViewClass = pNewViewClass;
	context.m_pCurrentDoc = pNewDoc;
	context.m_pCurrentFrame = NULL;
	
	CChildFrame*	pNewFrame = new CChildFrame;
	
	LockMyWindowUpdate( );
	if(GetActiveFrame() != this)
		GetActiveFrame()->SendMessage(WM_CLOSE, NULL, NULL);
	pNewFrame->LoadFrame(IDR_MAINFRAME,
		WS_OVERLAPPEDWINDOW ,   // default frame styles
		NULL, &context);
	pNewFrame->InitialUpdateFrame(pNewDoc, true);
	MDITile();
	UnlockMyWindowUpdate();

}

void CMainFrame::OnMenuitemWord() 
{
	if(m_cstrProjectPath.IsEmpty())
		return;
	if(m_structShotParaBase.bState == FALSE)
	{
		MessageBox("尚未进行参数优选的计算 !","工程信息");
		return;
	}

/*	CDialogTextReport dlg;
	dlg.m_iNum = m_structShotParaBase.iNum ;
	for(int iTemp=0;iTemp<384;iTemp++)
	{
		dlg.m_structList[iTemp] = m_structShotParaSelect[iTemp];
	}
	dlg.m_structSelectedPara = m_structSelectedPara;
	dlg.m_structMinusPressResult = m_structMinusPressResult;
	dlg.m_structSandPressDesign = m_structSandPressDesign;
	dlg.m_cstrWellName = m_structWellInfo.strWellName ;
	dlg.m_fWater = m_structMinusPressPara.fWater ;
	if(this->m_structShotParaSelect[m_structShotParaBase.iNum-1].fProPer>0.8)
		dlg.m_bState = TRUE;
	dlg.DoModal ();	
*/	
	CCVenusDoc*	pNewDoc	= new CCVenusDoc;
	
	CRuntimeClass* pNewViewClass;
	pNewViewClass = RUNTIME_CLASS(CTextReportView);
	CCreateContext context;
	
	context.m_pNewViewClass = pNewViewClass;
	context.m_pCurrentDoc = pNewDoc;
	context.m_pCurrentFrame = NULL;
	
	CChildFrame*	pNewFrame = new CChildFrame;
	
	LockMyWindowUpdate( );
	if(GetActiveFrame() != this)
		GetActiveFrame()->SendMessage(WM_CLOSE, NULL, NULL);
	pNewFrame->LoadFrame(IDR_MAINFRAME,
		WS_OVERLAPPEDWINDOW ,   // default frame styles
		NULL, &context);
	pNewFrame->InitialUpdateFrame(pNewDoc, true);
	MDITile();
	UnlockMyWindowUpdate();
}

void CMainFrame::OnMenuitemGasPaintKskm() 
{
	if(m_cstrProjectPath.IsEmpty())
		return;
	if(m_structOilShotForecast.bState == FALSE)
	{
		MessageBox("请先进行油井表皮系数预测的计算 !","工程信息");
		return ;
	}
	if(m_structOilShotForecast.bState == FALSE)
	{
		MessageBox("请先进行油井表皮系数预测的计算 !","工程信息");
		return ;
	}
	m_picState = OilKsKm;
	if(m_dlgScale == NULL)
		m_fScale = 1;
	else
		m_fScale = m_dlgScale->m_fScaleUser ;
	m_iPaint = 1;

	SpdShowGraph();	
/*	CRuntimeClass* pNewViewClass;
	pNewViewClass = RUNTIME_CLASS(CGraph);

	CView* pOldActiveView = GetActiveView();
	CCreateContext context;
	context.m_pNewViewClass = pNewViewClass;
	context.m_pCurrentDoc = GetActiveDocument();
	CView* pNewView = STATIC_DOWNCAST(CView, CreateView(&context));
	if (pNewView != NULL)
	{
		// the new view is there, but invisible and not active...
		pNewView->ShowWindow(SW_SHOW);
		pNewView->OnInitialUpdate();
		SetActiveView(pNewView);
		RecalcLayout();
		pNewView->UpdateWindow();

		// finally destroy the old view...
		pOldActiveView->DestroyWindow();
	}	
*/	
}

void CMainFrame::OnMenuitemScale() 
{
	// TODO: Add your command handler code here
	if(m_cstrProjectPath.IsEmpty())
		return;
	if(m_dlgScale == NULL)
	{
		m_dlgScale = new CDialogScale(this);
		m_dlgScale->Create (IDD_DIALOG_SCALE);
		m_dlgScale->ShowWindow (true);
	}
	else
	{
		m_dlgScale->ShowWindow (true);
		m_dlgScale->SetActiveWindow ();
	}
	m_dlgScale->SetScale (m_fScale);
	
}

void CMainFrame::OnMenuitemGasPaintKsxw() 
{
	if(m_cstrProjectPath.IsEmpty())
		return;
	if(m_structGasShotForecast.bState == FALSE)
	{
		MessageBox("请先进行气井表皮系数预测的计算 !","工程信息");
		return ;
	}
	if(m_structGasShotForecast.bState == FALSE)
	{
		MessageBox("请先进行气井表皮系数预测的计算 !","工程信息");
		return ;
	}
	m_picState = GasKsXw;
	if(m_dlgScale == NULL)
		m_fScale = 1;
	else
		m_fScale = m_dlgScale->m_fScaleUser ;
	m_iPaint = 2;
	SpdShowGraph();	
}

void CMainFrame::SpdShowGraph()
{
	
	CCVenusDoc*	pNewDoc	= new CCVenusDoc;
	
	CRuntimeClass* pNewViewClass;
	pNewViewClass = RUNTIME_CLASS(CNewGraph);
	CCreateContext context;
	
	context.m_pNewViewClass = pNewViewClass;
	context.m_pCurrentDoc = pNewDoc;
	context.m_pCurrentFrame = NULL;
	
	CChildFrame*	pNewFrame = new CChildFrame;
	
	LockMyWindowUpdate( );
	if(GetActiveFrame() != this)
		GetActiveFrame()->SendMessage(WM_CLOSE, NULL, NULL);
	pNewFrame->LoadFrame(IDR_MAINFRAME,
		WS_OVERLAPPEDWINDOW ,   // default frame styles
		NULL, &context);
	pNewFrame->InitialUpdateFrame(pNewDoc, true);
	MDITile();
	CNewGraph* pActiveView = (CNewGraph*)(pNewFrame->GetActiveView());
	pActiveView->UpdateWindow();
	UnlockMyWindowUpdate( );

}

void CMainFrame::OnMenuitemGasPaintKskj() 
{
	if(m_cstrProjectPath.IsEmpty())
		return;
	if(m_structGasShotForecast.bState == FALSE)
	{
		MessageBox("请先进行气井表皮系数预测的计算 !","工程信息");
		return ;
	}
	if(m_structGasShotForecast.bState == FALSE)
	{
		MessageBox("请先进行气井表皮系数预测的计算 !","工程信息");
		return ;
	}
	m_picState = GasKsKj;
	if(m_dlgScale == NULL)
		m_fScale = 1;
	else
		m_fScale = m_dlgScale->m_fScaleUser ;
	m_iPaint = 3;
	SpdShowGraph();	
	
}

void CMainFrame::OnMenuitemGasPaintKsdp() 
{
	if(m_cstrProjectPath.IsEmpty())
		return;
	if(m_structGasShotForecast.bState == FALSE)
	{
		MessageBox("请先进行气井表皮系数预测的计算 !","工程信息");
		return ;
	}
	m_picState = GasKsDp;
	if(m_dlgScale == NULL)
		m_fScale = 1;
	else
		m_fScale = m_dlgScale->m_fScaleUser ;
	m_iPaint = 4;
	SpdShowGraph();	

}

void CMainFrame::OnMenuitemGasPaintKsyc() 
{
	// TODO: Add your command handler code here
	if(m_cstrProjectPath.IsEmpty())
		return;
	if(m_structGasShotForecast.bState == FALSE)
	{
		MessageBox("请先进行气井表皮系数预测的计算 !","工程信息");
		return ;
	}
	if(m_structGasShotForecast.bState == FALSE)
	{
		MessageBox("请先进行气井表皮系数预测的计算 !","工程信息");
		return ;
	}
	m_picState = GasKsYc;
	if(m_dlgScale == NULL)
		m_fScale = 1;
	else
		m_fScale = m_dlgScale->m_fScaleUser ;
	m_iPaint = 5;
	SpdShowGraph();	
	
}

void CMainFrame::OnMenuitemGasPaintKspk() 
{
	if(m_cstrProjectPath.IsEmpty())
		return;
	if(m_structGasShotForecast.bState == FALSE)
	{
		MessageBox("请先进行气井表皮系数预测的计算 !","工程信息");
		return ;
	}
	if(m_structGasShotForecast.bState == FALSE)
	{
		MessageBox("请先进行气井表皮系数预测的计算 !","工程信息");
		return ;
	}
	m_picState = GasKsPk;
	if(m_dlgScale == NULL)
		m_fScale = 1;
	else
		m_fScale = m_dlgScale->m_fScaleUser ;
	m_iPaint = 6;
	SpdShowGraph();	
	
}

void CMainFrame::OnMenuitemGasPaintKswc() 
{
	if(m_cstrProjectPath.IsEmpty())
		return;
	if(m_structGasShotForecast.bState == FALSE)
	{
		MessageBox("请先进行气井表皮系数预测的计算 !","工程信息");
		return ;
	}
	if(m_structGasShotForecast.bState == FALSE)
	{
		MessageBox("请先进行气井表皮系数预测的计算 !","工程信息");
		return ;
	}
	m_picState = GasKsWc;
	if(m_dlgScale == NULL)
		m_fScale = 1;
	else
		m_fScale = m_dlgScale->m_fScaleUser ;
	m_iPaint = 7;
	SpdShowGraph();	
	
}

void CMainFrame::OnMenuitemGasPaintKskzr() 
{
	if(m_cstrProjectPath.IsEmpty())
		return;
	if(m_structGasShotForecast.bState == FALSE)
	{
		MessageBox("请先进行气井表皮系数预测的计算 !","工程信息");
		return ;
	}
	if(m_structGasShotForecast.bState == FALSE)
	{
		MessageBox("请先进行气井表皮系数预测的计算 !","工程信息");
		return ;
	}
	m_picState = GasKsKzr;
	if(m_dlgScale == NULL)
		m_fScale = 1;
	else
		m_fScale = m_dlgScale->m_fScaleUser ;
	m_iPaint = 8;
	SpdShowGraph();	
	
}

void CMainFrame::OnMenuitemOilPaintKskm() 
{
	// TODO: Add your command handler code here
	if(m_cstrProjectPath.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -