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

📄 sourcedataview.cpp

📁 这是本人两年前兼职为某个公司做的石油钻进设计软件
💻 CPP
📖 第 1 页 / 共 4 页
字号:
			return;
		}
		UpdateData(TRUE);
		m_ctrlList.DeleteAllItems ();
		LVITEM pitem;
		pitem.mask=LVIF_TEXT;
		pitem.state=0;
		pitem.stateMask=0;
		pitem.iSubItem=0;
		pitem.pszText="";

		char str[40];
		m_nNum = fileHead.iNum;
		for(i=0;i<fileHead.iNum;i++)
		{
			fileHandle.Read (&m_structSDT[i],sizeof(STRUCTSDTTABLE));
			pitem.iItem=i;
			m_ctrlList.InsertItem (&pitem);
			m_ctrlList.SetItemText (i,0,m_structSDT[i].strModel );
			m_ctrlList.SetItemText (i,1,m_structSDT[i].strCo );
			sprintf(str,"%5.1f",m_structSDT[i].fShotDepth );
			m_ctrlList.SetItemText (i,2,str);
			sprintf(str,"%3.1f",m_structSDT[i].fDiameter);
			m_ctrlList.SetItemText (i,3, str);
			sprintf(str,"%3.1f",m_structSDT[i].fPressDeep );
			m_ctrlList.SetItemText (i,4, str);
			sprintf(str,"%2.3f",m_structSDT[i].fPressLong );
			m_ctrlList.SetItemText (i,5,str);
			sprintf(str,"%2.3f",m_structSDT[i].fCFE );
			m_ctrlList.SetItemText (i,6,str);
			sprintf(str,"%2.3f",m_structSDT[i].fPortion );
			m_ctrlList.SetItemText (i,7,str);
			sprintf(str,"%5.1f",m_structSDT[i].fBL );
			m_ctrlList.SetItemText (i,8,str);
			sprintf(str,"%5.1f",m_structSDT[i].fBJ );
			m_ctrlList.SetItemText (i,9,str);
		}
		UpdateData(FALSE);
	}
	else
	{
		MessageBox("文件打开错误或文件不存在 !" ,"错误" ,MB_ICONHAND|MB_ICONSTOP|MB_ICONERROR);
		return;
	}
	fileHandle.Close ();	
}

void CSourceDataView::OnButtonBasedataClear() 
{
	// TODO: Add your control notification handler code here
	m_ctrlSelected.ResetContent ();
}

void CSourceDataView::OnButtonBasedataDel() 
{
	// TODO: Add your control notification handler code here
	m_ctrlSelected.DeleteString (m_ctrlSelected.GetCurSel () );
}

void CSourceDataView::OnButtonBasedataAdd() 
{
	// TODO: Add your control notification handler code here
	int iTemp=m_ctrlList.GetSelectionMark ();
	if(iTemp < 0 ) return;
	if(m_ctrlSelected.GetCount () >= 8)
	{
		MessageBox("最多只能选择8个射孔弹。","工程信息");
		return;
	}
	char str[40];
	m_ctrlList.GetItemText (iTemp,0,str,40);
	m_ctrlSelected.AddString (str);
	m_ctrlList.SetSelectionMark (-1);
}


void CSourceDataView::Save() 
{
	// TODO: Add your control notification handler code here
	CMainFrame*	wnd = (CMainFrame*)AfxGetMainWnd();
	UpdateData();
	if(m_iCanModel == 0)
		m_cstrOilResCanModel = "P110";
	else if(m_iCanModel == 1)
		m_cstrOilResCanModel = "N80";
	else if(m_iCanModel == 2)
		m_cstrOilResCanModel = "J55";

	switch(m_iCanPara)
	{
	case -1:
			break;
	case 0:
		wnd->m_structBDTTable.fOilResCannulaCliffDeep = 0.0075f;
		wnd->m_structBDTTable.fOilResCannulaDiameter = 0.127f;
		break;
	case 1:
		wnd->m_structBDTTable.fOilResCannulaCliffDeep = 0.007f;
		wnd->m_structBDTTable.fOilResCannulaDiameter = 0.1397f;
		break;
	case 2:
		wnd->m_structBDTTable.fOilResCannulaCliffDeep = 0.0092f;
		wnd->m_structBDTTable.fOilResCannulaDiameter = 0.1397f;
		break;
	case 3:
		wnd->m_structBDTTable.fOilResCannulaCliffDeep = 0.009f;
		wnd->m_structBDTTable.fOilResCannulaDiameter = 0.16828f;
		break;
	case 4:
		wnd->m_structBDTTable.fOilResCannulaCliffDeep = 0.006f;
		wnd->m_structBDTTable.fOilResCannulaDiameter = 0.1778f;
		break;
	case 5:
		wnd->m_structBDTTable.fOilResCannulaCliffDeep = 0.0092f;
		wnd->m_structBDTTable.fOilResCannulaDiameter = 0.1778f;
		break;
	case 6:
		wnd->m_structBDTTable.fOilResCannulaCliffDeep = 0.01f;
		wnd->m_structBDTTable.fOilResCannulaDiameter = 0.21908f;
		break;
	case 7:
		wnd->m_structBDTTable.fOilResCannulaCliffDeep = 0.0089f;
		wnd->m_structBDTTable.fOilResCannulaDiameter = 0.24448f;
		break;
	case 8:
		wnd->m_structBDTTable.fOilResCannulaCliffDeep = 0.0089f;
		wnd->m_structBDTTable.fOilResCannulaDiameter = 0.24448f;
		break;
	case 9:
		wnd->m_structBDTTable.fOilResCannulaCliffDeep = 0.011f;
		wnd->m_structBDTTable.fOilResCannulaDiameter = 0.24448f;
		break;
	case 10:
		wnd->m_structBDTTable.fOilResCannulaCliffDeep = 0.01384f;
		wnd->m_structBDTTable.fOilResCannulaDiameter = 0.24448f;
		break;
	case 11:
		wnd->m_structBDTTable.fOilResCannulaCliffDeep = 0.0089f;
		wnd->m_structBDTTable.fOilResCannulaDiameter = 0.27305f;
		break;
	case 12:
		wnd->m_structBDTTable.fOilResCannulaCliffDeep = 0.0126f;
		wnd->m_structBDTTable.fOilResCannulaDiameter = 0.27305f;
		break;
	case 13:
		wnd->m_structBDTTable.fOilResCannulaCliffDeep = 0.0097f;
		wnd->m_structBDTTable.fOilResCannulaDiameter = 0.33973f;
		break;
	case 14:
		wnd->m_structBDTTable.fOilResCannulaCliffDeep = 0.011f;
		wnd->m_structBDTTable.fOilResCannulaDiameter = 0.33973f;
		break;
	}

	wnd->m_structBDTTable .bState = TRUE;
	wnd->m_structBDTTable.fCannulaPressResistance = m_fCanPressRes ;
	wnd->m_structBDTTable.fProducePressDiff = m_fComputePressDiff ;
	wnd->m_structBDTTable.fDrillPolluteDepth = m_fDrillPollutDepth ;
	wnd->m_structBDTTable.fDrillPollutePercent = m_fDrillPollutePercent ;
	wnd->m_structBDTTable.fFloorGasPorportion = m_fFloorGasPorportion ;
	wnd->m_structBDTTable.fFloorOilPorportion = m_fFloorOilPorportion ;
	wnd->m_structBDTTable.fOilFaceTension = m_fOilFaceTension ;
	sprintf(wnd->m_structBDTTable.strOilResCannulaModel ,"%s", m_cstrOilResCanModel) ;
	wnd->m_structBDTTable.fOilSaturationPress = m_fOilSaturationPress ;
	wnd->m_structBDTTable.fProduceGasWater = m_fProduceGasWater ;
	wnd->m_structBDTTable.fRevealOilRadius = m_fRevealOilRadius ;
	wnd->m_structBDTTable.fShotDen [0] = m_fShotDen1 ;
	wnd->m_structBDTTable.fShotDen [1] = m_fShotDen2 ;
	wnd->m_structBDTTable.fShotDen [2] = m_fShotDen3 ;
	wnd->m_structBDTTable.fShotDen [3] = m_fShotDen4 ;
	wnd->m_structBDTTable.fShotDen [4] = m_fShotDen5 ;
	wnd->m_structBDTTable.fShotDen [5] = m_fShotDen6 ;
	wnd->m_structBDTTable.fShotDen [6] = m_fShotDen7 ;
	wnd->m_structBDTTable.fShotDen [7] = m_fShotDen8  ;
	wnd->m_structBDTTable.fShotLayerPly = m_fShotLayerPly ;
	wnd->m_structBDTTable.fShotPhasic [0] = m_fShotPhasic1 ;
	wnd->m_structBDTTable.fShotPhasic [1] = m_fShotPhasic2 ;
	wnd->m_structBDTTable.fShotPhasic [2] = m_fShotPhasic3 ;
	wnd->m_structBDTTable.fShotPhasic [3] = m_fShotPhasic4 ;
	wnd->m_structBDTTable.fShotPhasic [4] = m_fShotPhasic5 ;
	wnd->m_structBDTTable.fShotPhasic [5] = m_fShotPhasic6 ;
	wnd->m_structBDTTable.iShotDenNum = m_iShotDenNum;
	wnd->m_structBDTTable.iShotPhasicNum = m_iShotPhasicNum;
	wnd->m_structBDTTable.fStratumAverPress = m_fStratumAverPress ;
	wnd->m_structBDTTable.fStratumCentralDepth = m_fStratumCentralDepth ;
	wnd->m_structBDTTable.fStratumFilterPercent = m_fStratumFilterPercent ;
	wnd->m_structBDTTable.fStratumHeterosphere = m_fStratumHeter ;
	wnd->m_structBDTTable.fStratumHolePercent = m_fStratumHolePercent ;
	wnd->m_structBDTTable.fStratumOilStiff = m_fStratumOilStiff ;
	wnd->m_structBDTTable.fStratumPly = m_fStratumPly ;
	wnd->m_structBDTTable.fStratumTemp = m_fStratumTemp ;
	wnd->m_structBDTTable.fVittaCompCoarseness = m_fVittaCompCoareseness ;
	wnd->m_structBDTTable.fVittaInsideDiameter = m_fVittaInsideDiameter ;
	wnd->m_structBDTTable.fVittaMeasureDepth = m_fVittaMeasureDepth ;
	sprintf(wnd->m_structBDTTable.strVittaModel ,"%s", m_cstrVittaModel) ;
	wnd->m_structBDTTable.fVittaPlumbDepth = m_fVittaPlumbDepth ;
	wnd->m_structBDTTable.fWaterFaceTension = m_fWaterFaceTension ;
	wnd->m_structBDTTable.fWaterPercent = m_fWaterPercent ;
	wnd->m_structBDTTable.fWellBottomTemp = m_fWellBottomTemp ;
	wnd->m_structBDTTable.fWellMouthTemp = m_fWellMouthTemp ;
	wnd->m_structBDTTable.fWellRadius = m_fWellRadius ;
	wnd->m_structBDTTable.lCount = m_ctrlSelected.GetCount ();

	CString cstrTemp,cstrTemp1;
	for(int iTemp=0;iTemp<wnd->m_structBDTTable .lCount ;iTemp++)
	{
		m_ctrlSelected.GetText (iTemp,cstrTemp);
		for(int iTemp1=0;iTemp1<=m_nNum;iTemp1++)
		{
			cstrTemp1 = m_structSDT[iTemp1].strModel;
			if(cstrTemp.Compare (cstrTemp1)==0)
				wnd->m_structSDT [iTemp] = m_structSDT[iTemp1];
		}
	}
	UpdateData(FALSE);
	MessageBox("数据修改完毕 !","工程信息");
}

void CSourceDataView::Load() 
{
	// TODO: Add your control notification handler code here
	CMainFrame*	wnd = (CMainFrame*)AfxGetMainWnd();
	
	m_cstrProjectPath = wnd->m_cstrProjectPath ;
	m_cstrSDTPath = wnd->m_cstrSDTPath ;
	m_cstrEDTPath = wnd->m_cstrEDTPath ;

	if(wnd->m_structBDTTable .bState == FALSE)
		return;

	m_ctrlSelected.ResetContent ();
	for(int i = 0 ;i<wnd->m_structBDTTable .lCount ;i++)
	{
		m_ctrlSelected.AddString (wnd->m_structSDT [i].strModel  );
	}
	UpdateData();
	m_fCanPressRes = wnd->m_structBDTTable.fCannulaPressResistance ;
	m_fComputePressDiff = wnd->m_structBDTTable.fProducePressDiff ;
	m_fDrillPollutDepth = wnd->m_structBDTTable.fDrillPolluteDepth ;
	m_fDrillPollutePercent = wnd->m_structBDTTable.fDrillPollutePercent ;
	m_fFloorGasPorportion = wnd->m_structBDTTable.fFloorGasPorportion ;
	m_fFloorOilPorportion = wnd->m_structBDTTable.fFloorOilPorportion ;
	m_fOilFaceTension = wnd->m_structBDTTable.fOilFaceTension ;
	m_cstrOilResCanModel = wnd->m_structBDTTable.strOilResCannulaModel ;
	m_fOilSaturationPress = wnd->m_structBDTTable.fOilSaturationPress ;
	m_fProduceGasWater = wnd->m_structBDTTable.fProduceGasWater ;
	m_fRevealOilRadius = wnd->m_structBDTTable.fRevealOilRadius ;
	m_fShotDen1 = wnd->m_structBDTTable.fShotDen [0] ;
	m_fShotDen2 = wnd->m_structBDTTable.fShotDen [1] ;
	m_fShotDen3 = wnd->m_structBDTTable.fShotDen [2] ;
	m_fShotDen4 = wnd->m_structBDTTable.fShotDen [3] ;
	m_fShotDen5 = wnd->m_structBDTTable.fShotDen [4] ;
	m_fShotDen6 = wnd->m_structBDTTable.fShotDen [5] ;
	m_fShotDen7 = wnd->m_structBDTTable.fShotDen [6] ;
	m_fShotDen8  = wnd->m_structBDTTable.fShotDen [7] ;
	m_fShotLayerPly = wnd->m_structBDTTable.fShotLayerPly ;
	m_fShotPhasic1 = wnd->m_structBDTTable.fShotPhasic [0] ;
	m_fShotPhasic2 = wnd->m_structBDTTable.fShotPhasic [1] ;
	m_fShotPhasic3 = wnd->m_structBDTTable.fShotPhasic [2] ;
	m_fShotPhasic4 = wnd->m_structBDTTable.fShotPhasic [3] ;
	m_fShotPhasic5 = wnd->m_structBDTTable.fShotPhasic [4] ;
	m_fShotPhasic6 = wnd->m_structBDTTable.fShotPhasic [5] ;
	m_iShotDenNum = wnd->m_structBDTTable.iShotDenNum ;
	m_iShotPhasicNum = wnd->m_structBDTTable.iShotPhasicNum ;
	m_fStratumAverPress = wnd->m_structBDTTable.fStratumAverPress ;
	m_fStratumCentralDepth = wnd->m_structBDTTable.fStratumCentralDepth ;
	m_fStratumFilterPercent = wnd->m_structBDTTable.fStratumFilterPercent ;
	m_fStratumHeter = wnd->m_structBDTTable.fStratumHeterosphere ;
	m_fStratumHolePercent = wnd->m_structBDTTable.fStratumHolePercent ;
	m_fStratumOilStiff = wnd->m_structBDTTable.fStratumOilStiff ;
	m_fStratumPly = wnd->m_structBDTTable.fStratumPly ;
	m_fStratumTemp = wnd->m_structBDTTable.fStratumTemp ;
	m_fVittaCompCoareseness = wnd->m_structBDTTable.fVittaCompCoarseness ;
	m_fVittaInsideDiameter = wnd->m_structBDTTable.fVittaInsideDiameter ;
	m_fVittaMeasureDepth = wnd->m_structBDTTable.fVittaMeasureDepth ;
	m_cstrVittaModel = wnd->m_structBDTTable.strVittaModel ;
	m_fVittaPlumbDepth = wnd->m_structBDTTable.fVittaPlumbDepth ;
	m_fWaterFaceTension = wnd->m_structBDTTable.fWaterFaceTension ;
	m_fWaterPercent = wnd->m_structBDTTable.fWaterPercent ;
	m_fWellBottomTemp = wnd->m_structBDTTable.fWellBottomTemp ;
	m_fWellMouthTemp = wnd->m_structBDTTable.fWellMouthTemp ;
	m_fWellRadius = wnd->m_structBDTTable.fWellRadius ;
	if(m_cstrOilResCanModel.Compare ("P110") == 0)
		m_iCanModel = 0;
	else if(m_cstrOilResCanModel.Compare ("J55") == 0)
		m_iCanModel = 2;
	else if(m_cstrOilResCanModel.Compare ("N80") == 0)
		m_iCanModel = 1;

	if(wnd->m_structBDTTable.fOilResCannulaCliffDeep == 0.0075f
		&& wnd->m_structBDTTable.fOilResCannulaDiameter == 0.127f)
		m_iCanPara = 0;
	else if(wnd->m_structBDTTable.fOilResCannulaCliffDeep == 0.007f
		&& wnd->m_structBDTTable.fOilResCannulaDiameter == 0.1397f)
		m_iCanPara = 1;
	else if(wnd->m_structBDTTable.fOilResCannulaCliffDeep == 0.0092f
		&& wnd->m_structBDTTable.fOilResCannulaDiameter == 0.1397f)
		m_iCanPara = 2;
	else if(wnd->m_structBDTTable.fOilResCannulaCliffDeep == 0.009f
		&& wnd->m_structBDTTable.fOilResCannulaDiameter == 0.16828f)
		m_iCanPara = 3;
	else if(wnd->m_structBDTTable.fOilResCannulaCliffDeep == 0.006f
		&& wnd->m_structBDTTable.fOilResCannulaDiameter == 0.1778f)
		m_iCanPara = 4;
	else if(wnd->m_structBDTTable.fOilResCannulaCliffDeep == 0.01f
		&& wnd->m_structBDTTable.fOilResCannulaDiameter == 0.21908f)
		m_iCanPara = 6;
	else if(wnd->m_structBDTTable.fOilResCannulaCliffDeep == 0.0092f
		&& wnd->m_structBDTTable.fOilResCannulaDiameter == 0.1778f)
		m_iCanPara = 5;
	else if(wnd->m_structBDTTable.fOilResCannulaCliffDeep == 0.0089f
		&& wnd->m_structBDTTable.fOilResCannulaDiameter == 0.24448f)
		m_iCanPara = 7;
	else if(wnd->m_structBDTTable.fOilResCannulaCliffDeep == 0.0089f
		&& wnd->m_structBDTTable.fOilResCannulaDiameter == 0.24448f)
		m_iCanPara = 8;
	else if(wnd->m_structBDTTable.fOilResCannulaCliffDeep == 0.011f
		&& wnd->m_structBDTTable.fOilResCannulaDiameter == 0.24448f)
		m_iCanPara = 9;
	else if(wnd->m_structBDTTable.fOilResCannulaCliffDeep == 0.01384f
		&& wnd->m_structBDTTable.fOilResCannulaDiameter == 0.24448f)
		m_iCanPara = 10;
	else if(wnd->m_structBDTTable.fOilResCannulaCliffDeep == 0.0089f
		&& wnd->m_structBDTTable.fOilResCannulaDiameter == 0.27305f)
		m_iCanPara = 11;
	else if(wnd->m_structBDTTable.fOilResCannulaCliffDeep == 0.0126f
		&& wnd->m_structBDTTable.fOilResCannulaDiameter == 0.27305f)
		m_iCanPara = 12;
	else if(wnd->m_structBDTTable.fOilResCannulaCliffDeep == 0.0097f
		&& wnd->m_structBDTTable.fOilResCannulaDiameter == 0.33973)
		m_iCanPara = 13;
	else if(wnd->m_structBDTTable.fOilResCannulaCliffDeep == 0.011f
		&& wnd->m_structBDTTable.fOilResCannulaDiameter == 0.33973f)
		m_iCanPara = 14;
	else

⌨️ 快捷键说明

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