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

📄 textreportview.cpp

📁 这是本人两年前兼职为某个公司做的石油钻进设计软件
💻 CPP
📖 第 1 页 / 共 2 页
字号:

	m_ctrlWord.SetRange (iLocat,iLocat);	//回车键
	m_ctrlWord.TypeParagraph ();
	iLocat += 1;

	m_ctrlWord.SetRange (iLocat,iLocat);
	cstrTemp = "二、射孔负压设计";
	sprintf(str,"%s",cstrTemp);
	lpStr = str;
	m_ctrlWord.TypeText (lpStr);
	m_ctrlWord.TypeParagraph ();
	iLocat += cstrTemp.GetLength ();

	m_ctrlWord.SetRange (iLocat,iLocat);	//Table2
	m_ctrlWord.CreateTable (5,2);
	iLocat += 15;

	m_ctrlWord.SetRange (iLocat,iLocat);	//回车键
	m_ctrlWord.TypeParagraph ();
	iLocat += 1;

	m_ctrlWord.SetRange (iLocat,iLocat);
	cstrTemp = "三、射孔完井方案";
	sprintf(str,"%s",cstrTemp);
	lpStr = str;
	m_ctrlWord.TypeText (lpStr);
	m_ctrlWord.TypeParagraph ();
	iLocat += cstrTemp.GetLength ();

	m_ctrlWord.SetRange (iLocat,iLocat);	//Table2
	m_ctrlWord.CreateTable (2,8);
	iLocat += 18;

	m_ctrlWord.SetRange (iLocat,iLocat);	//回车键
	m_ctrlWord.TypeParagraph ();
	iLocat += 1;

	m_ctrlWord.SetRange (iLocat,iLocat);	//回车键
	m_ctrlWord.TypeParagraph ();
	iLocat += 1;

	m_ctrlWord.SetRange (iLocat,iLocat);
	cstrTemp = "附加说明:";
	sprintf(str,"%s",cstrTemp);
	lpStr = str;
	m_ctrlWord.TypeText (lpStr);
	m_ctrlWord.TypeParagraph ();
	iLocat += cstrTemp.GetLength ();

	m_ctrlWord.SetRange (iLocat,iLocat);
	m_ctrlWord.TypeTab ();
	cstrTemp = "本标准由石油测井专业标准化委员会提出并归口。";
	sprintf(str,"%s",cstrTemp);
	lpStr = str;
	m_ctrlWord.TypeText (lpStr);
	m_ctrlWord.TypeParagraph ();
	iLocat += cstrTemp.GetLength ();

	//*****填写表格*************
	//表1
	m_ctrlWord.SetTable (1);
	lpStr = "排序";
	m_ctrlWord.SetCell (1,1,lpStr);
	lpStr = "射孔弹型号";
	m_ctrlWord.SetCell (1,2,lpStr);
	lpStr = "地层条件下穿深(mm)";
	m_ctrlWord.SetCell (1,3,lpStr);
	lpStr = "地层条件下孔径(mm)";
	m_ctrlWord.SetCell (1,4,lpStr);
	lpStr = "孔密(孔/m)";
	m_ctrlWord.SetCell (1,5,lpStr);
	lpStr = "相位(度)";
	m_ctrlWord.SetCell (1,6,lpStr);
	lpStr = "射孔方式";
	m_ctrlWord.SetCell (1,7,lpStr);
	lpStr = "布孔格式";
	m_ctrlWord.SetCell (1,8,lpStr);
	if(m_bState)
		lpStr = "相对流体压降";
	else
		lpStr = "预测产率比";
	m_ctrlWord.SetCell (1,9,lpStr);
	
	char strTemp[20];
	for(int i=0;i<m_iSelected;i++)
	{
		sprintf(strTemp,"%d",i+1);
		lpStr = strTemp;
		m_ctrlWord.SetCell (i+2,1,lpStr);
		lpStr = m_structSelected[i].strModel ;
		m_ctrlWord.SetCell (i+2,2,lpStr);
		sprintf(strTemp,"%5.2f",m_structSelected[i].fShotDepth );
		cstrTemp = strTemp;
		cstrTemp.TrimLeft();
		sprintf(strTemp,"%s",cstrTemp);
		lpStr = strTemp;
		m_ctrlWord.SetCell (i+2,3,lpStr);
		sprintf(strTemp,"%5.2f",m_structSelected[i].fDiameter );
		cstrTemp = strTemp;
		cstrTemp.TrimLeft();
		sprintf(strTemp,"%s",cstrTemp);
		lpStr = strTemp;
		m_ctrlWord.SetCell (i+2,4,lpStr);
		sprintf(strTemp,"%5.0f",m_structSelected[i].fShotDen );
		cstrTemp = strTemp;
		cstrTemp.TrimLeft();
		sprintf(strTemp,"%s",cstrTemp);
		lpStr = strTemp;
		lpStr = strTemp;
		m_ctrlWord.SetCell (i+2,5,lpStr);
		sprintf(strTemp,"%5.0f",m_structSelected[i].fAngle );
		cstrTemp = strTemp;
		cstrTemp.TrimLeft();
		sprintf(strTemp,"%s",cstrTemp);
		lpStr = strTemp;
		m_ctrlWord.SetCell (i+2,6,lpStr);
		lpStr = _T("油管传输射孔");
		m_ctrlWord.SetCell (i+2,7,lpStr);
		lpStr = _T("螺旋布孔");
		m_ctrlWord.SetCell (i+2,8,lpStr);
		sprintf(strTemp,"%5.3f",m_structSelected[i].fProPer );
		cstrTemp = strTemp;
		cstrTemp.TrimLeft();
		sprintf(strTemp,"%s",cstrTemp);
		lpStr = strTemp;
		m_ctrlWord.SetCell (i+2,9,lpStr);
	}
	
	//表2
	if(m_bState)
	{
		m_ctrlWord.SetTable (2);
		lpStr = "项目";
		m_ctrlWord.SetCell(1,1,lpStr);
		lpStr = "射孔负压差值(MPa)";
		m_ctrlWord.SetCell(1,2,lpStr);
		lpStr = "保证孔眼清洁的最小负压值";
		m_ctrlWord.SetCell(2,1,lpStr);
		sprintf(strTemp,"%5.2f",m_structSandPressDesign.fPMin);
		cstrTemp = strTemp;
		cstrTemp.TrimLeft();
		sprintf(strTemp,"%s",cstrTemp);
		lpStr = strTemp;
		m_ctrlWord.SetCell(2,2,lpStr);
		lpStr = "防止地层出砂和管柱破坏的最大负压值";
		m_ctrlWord.SetCell(3,1,lpStr);
		sprintf(strTemp,"%5.2f",m_structSandPressDesign.fPMax);
		cstrTemp = strTemp;
		cstrTemp.TrimLeft();
		sprintf(strTemp,"%s",cstrTemp);
		lpStr = strTemp;
		m_ctrlWord.SetCell(3,2,lpStr);
		lpStr = "优化设计推荐的施工负压值";
		m_ctrlWord.SetCell(4,1,lpStr);
		sprintf(strTemp,"%5.2f",m_structSandPressDesign.fPRec);
		cstrTemp = strTemp;
		cstrTemp.TrimLeft();
		sprintf(strTemp,"%s",cstrTemp);
		lpStr = strTemp;
		m_ctrlWord.SetCell(4,2,lpStr);
		lpStr = "备注";
		m_ctrlWord.SetCell(5,1,lpStr);
	}
	else
	{
		m_ctrlWord.SetTable (2);
		lpStr = "项目";
		m_ctrlWord.SetCell(1,1,lpStr);
		lpStr = "射孔负压差值(MPa)";
		m_ctrlWord.SetCell(1,2,lpStr);
		lpStr = "保证孔眼清洁的最小负压值";
		m_ctrlWord.SetCell(2,1,lpStr);
		sprintf(strTemp,"%5.2f",m_structMinusPressResult.fPMin);
		cstrTemp = strTemp;
		cstrTemp.TrimLeft();
		sprintf(strTemp,"%s",cstrTemp);
		lpStr = strTemp;
		m_ctrlWord.SetCell(2,2,lpStr);
		lpStr = "防止地层出砂和管柱破坏的最大负压值";
		m_ctrlWord.SetCell(3,1,lpStr);
		sprintf(strTemp,"%5.2f",m_structMinusPressResult.fPMax);
		cstrTemp = strTemp;
		cstrTemp.TrimLeft();
		sprintf(strTemp,"%s",cstrTemp);
		lpStr = strTemp;
		m_ctrlWord.SetCell(3,2,lpStr);
		lpStr = "优化设计推荐的施工负压值";
		m_ctrlWord.SetCell(4,1,lpStr);
		sprintf(strTemp,"%5.2f",m_structMinusPressResult.fPRec);
		cstrTemp = strTemp;
		cstrTemp.TrimLeft();
		sprintf(strTemp,"%s",cstrTemp);
		lpStr = strTemp;
		m_ctrlWord.SetCell(4,2,lpStr);
		lpStr = "备注";
		m_ctrlWord.SetCell(5,1,lpStr);
	}

	//表3
	m_ctrlWord.SetTable(3);
	lpStr = "射孔枪型";
	m_ctrlWord.SetCell(1,1,lpStr);
	lpStr = "射孔弹型";
	m_ctrlWord.SetCell(1,2,lpStr);
	lpStr = "孔密(孔/m)";
	m_ctrlWord.SetCell(1,3,lpStr);
	lpStr = "相位(度)";
	m_ctrlWord.SetCell(1,4,lpStr);
	lpStr = "射孔方式";
	m_ctrlWord.SetCell(1,5,lpStr);
	lpStr = "射孔压差(MPa)";
	m_ctrlWord.SetCell(1,6,lpStr);
	lpStr = "降液面至(m)";
	m_ctrlWord.SetCell(1,7,lpStr);
	lpStr = "射孔液密度(g/cm3)";
	m_ctrlWord.SetCell(1,8,lpStr);
	
	lpStr = "NULL";
	m_ctrlWord.SetCell (2,1,lpStr);
	lpStr = m_structSelectedPara.strModel;
	m_ctrlWord.SetCell (2,2,lpStr);
	sprintf(strTemp,"%5.0f",m_structSelectedPara.fShotDen );
		cstrTemp = strTemp;
		cstrTemp.TrimLeft();
		sprintf(strTemp,"%s",cstrTemp);
	lpStr = strTemp;
	m_ctrlWord.SetCell (2,3,lpStr);
	sprintf(strTemp,"%5.0f",m_structSelectedPara.fAngle );
		cstrTemp = strTemp;
		cstrTemp.TrimLeft();
		sprintf(strTemp,"%s",cstrTemp);
	lpStr = strTemp;
	m_ctrlWord.SetCell (2,4,lpStr);
	lpStr = "NULL";
	m_ctrlWord.SetCell (2,5,lpStr);
	sprintf(strTemp,"%5.3f",m_structMinusPressResult.fPRec );
		cstrTemp = strTemp;
		cstrTemp.TrimLeft();
		sprintf(strTemp,"%s",cstrTemp);
	lpStr = strTemp;
	m_ctrlWord.SetCell (2,6,lpStr);
	sprintf(strTemp,"%5.3f",m_structMinusPressResult.fDepth );
		cstrTemp = strTemp;
		cstrTemp.TrimLeft();
		sprintf(strTemp,"%s",cstrTemp);
	lpStr = strTemp;
	m_ctrlWord.SetCell (2,7,lpStr);
	sprintf(strTemp,"%2.3f",m_fWater );
		cstrTemp = strTemp;
		cstrTemp.TrimLeft();
		sprintf(strTemp,"%s",cstrTemp);
	lpStr = strTemp;
	m_ctrlWord.SetCell (2,8,lpStr);
	
	m_ctrlWord.SaveAsDoc ();
	m_ctrlWord.CloseTemplate ();
	MessageBox("报告生成完毕 !","工程信息");	
	
}

void CTextReportView::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(0);		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 + -