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

📄 newsourcedataview.cpp

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

#include "stdafx.h"
#include "cvenus.h"
#include "NewSourceDataView.h"
#include	"Mainfrm.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CNewSourceDataView
const	CString	CNewSourceDataView::strCombo2Data[15] =
{
		"127.00(5\")      / 7.5",
		"139.70(5 1/2\")  / 7.0",
		"139.70(5 1/2\")  / 9.2",
		"168.28(6 5/8\")  / 9.0",
		"177.80(7\")      / 6.0",
		"177.80(7\")      / 9.2",
		"193.68(7 5/8\")  / 8.3",
		"219.08(8 5/8\")  / 10.0",
		"244.48(9 5/8\")  / 8.9",
		"244.48(9 5/8\")  / 11.0",
		"244.48(9 5/8\")  / 13.8",
		"273.05(10 3/4\") / 8.9",
		"273.05(10 3/4\") / 12.6",
		"339.73(13 3/8\") / 9.7",
		"339.73(13 3/8\") / 11.0"
};
IMPLEMENT_DYNCREATE(CNewSourceDataView, CFormView)

CNewSourceDataView::CNewSourceDataView()
	: CFormView(CNewSourceDataView::IDD)
{
	//{{AFX_DATA_INIT(CNewSourceDataView)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	m_fCanPressRes = 0.0f;
	m_fComputePressDiff = 0.0f;
	m_fDrillPollutDepth = 0.0f;
	m_fDrillPollutePercent = 0.0f;
	m_fFloorGasPorportion = 0.0f;
	m_fFloorOilPorportion = 0.0f;
	m_fOilFaceTension = 0.0f;
	m_fOilSaturationPress = 0.0f;
	m_fProduceGasWater = 0.0f;
	m_fRevealOilRadius = 0.0f;
	m_fStratumAverPress = 0.0f;
	m_fStratumCentralDepth = 0.0f;
	m_fStratumFilterPercent = 0.0f;
	m_fStratumHeter = 0.0f;
	m_fStratumHolePercent = 0.0f;
	m_fStratumOilStiff = 0.0f;
	m_fStratumPly = 0.0f;
	m_fStratumTemp = 0.0f;
	m_fVittaInsideDiameter = 0.0f;
	m_fVittaCompCoareseness = 0.0f;
	m_fVittaMeasureDepth = 0.0f;
	m_cstrVittaModel = _T("");
	m_fVittaPlumbDepth = 0.0f;
	m_fWaterFaceTension = 0.0f;
	m_fWaterPercent = 0.0f;
	m_fWellBottomTemp = 0.0f;
	m_fWellMouthTemp = 0.0f;
	m_fWellRadius = 0.0f;
	m_fShotDen1 = 0.0f;
	m_fShotLayerPly = 0.0f;
	m_fShotPhasic1 = 0.0f;
	m_fShotPhasic2 = 0.0f;
	m_fShotPhasic3 = 0.0f;
	m_fShotPhasic4 = 0.0f;
	m_fShotPhasic5 = 0.0f;
	m_fShotPhasic6 = 0.0f;
	m_fShotDen2 = 0.0f;
	m_fShotDen3 = 0.0f;
	m_fShotDen4 = 0.0f;
	m_fShotDen5 = 0.0f;
	m_fShotDen6 = 0.0f;
	m_fShotDen7 = 0.0f;
	m_fShotDen8 = 0.0f;
	m_iShotDenNum = 0;
	m_iShotPhasicNum = 0;
	m_iCanModel = -1;
	m_iCanPara = -1;

	bModified = false;
}

CNewSourceDataView::~CNewSourceDataView()
{
}

void CNewSourceDataView::DoDataExchange(CDataExchange* pDX)
{
	CFormView::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CNewSourceDataView)
	DDX_Control(pDX, IDC_STATIC4_4, m_ctrl4_6);
	DDX_Control(pDX, IDC_STATIC4_1, m_ctrl4_5);
	DDX_Control(pDX, IDC_TAB1, m_ctrlTab);
	DDX_Control(pDX, IDC_SPREAD1, m_spread1);
	DDX_Control(pDX, IDC_SPREAD2, m_spread2);
	DDX_Control(pDX, IDC_SPREAD4, m_spread3);
	DDX_Control(pDX, IDC_BUTTON_BASEDATA_ADD, m_ctrl4_1);
	DDX_Control(pDX, IDC_BUTTON_BASEDATA_CLEAR, m_ctrl4_2);
	DDX_Control(pDX, IDC_BUTTON_BASEDATA_DEL, m_ctrl4_3);
	DDX_Control(pDX, IDC_BUTTON_LOADBULLET, m_ctrl4_4);
	DDX_Control(pDX, IDC_LIST_SHOOTBULLETLIST, m_ctrlList);
	DDX_Control(pDX, IDC_LIST_SELECTED, m_ctrlSelected);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CNewSourceDataView, CFormView)
	//{{AFX_MSG_MAP(CNewSourceDataView)
	ON_NOTIFY(TCN_SELCHANGE, IDC_TAB1, OnSelchangeTab1)
	ON_WM_CREATE()
	ON_BN_CLICKED(IDC_BUTTON_BASEDATA_ADD, OnButtonBasedataAdd)
	ON_BN_CLICKED(IDC_BUTTON_BASEDATA_CLEAR, OnButtonBasedataClear)
	ON_BN_CLICKED(IDC_BUTTON_BASEDATA_DEL, OnButtonBasedataDel)
	ON_BN_CLICKED(IDC_BUTTON_LOADBULLET, OnButtonLoadbullet)
	ON_WM_DESTROY()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CNewSourceDataView diagnostics

#ifdef _DEBUG
void CNewSourceDataView::AssertValid() const
{
	CFormView::AssertValid();
}

void CNewSourceDataView::Dump(CDumpContext& dc) const
{
	CFormView::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CNewSourceDataView message handlers

void CNewSourceDataView::OnSelchangeTab1(NMHDR* pNMHDR, LRESULT* pResult) 
{
	// TODO: Add your control notification handler code here
	m_spread1.ShowWindow (false);
	int selected = m_ctrlTab.GetCurSel ();
	switch(selected)
	{
	case 0:
		m_spread1.ShowWindow (true);
		m_spread2.ShowWindow (false);
		m_spread3.ShowWindow (false);
		m_ctrl4_1.ShowWindow (false);
		m_ctrl4_2.ShowWindow (false);
		m_ctrl4_3.ShowWindow (false);
		m_ctrl4_4.ShowWindow (false);
		m_ctrl4_5.ShowWindow (false);
		m_ctrl4_6.ShowWindow (false);
		m_ctrlList.ShowWindow (false);
		m_ctrlSelected.ShowWindow (false);
		break;
	case 1:
		m_spread1.ShowWindow (false);
		m_spread2.ShowWindow (true);
		m_spread3.ShowWindow (false);
		m_ctrl4_1.ShowWindow (false);
		m_ctrl4_2.ShowWindow (false);
		m_ctrl4_3.ShowWindow (false);
		m_ctrl4_4.ShowWindow (false);
		m_ctrl4_5.ShowWindow (false);
		m_ctrl4_6.ShowWindow (false);
		m_ctrlList.ShowWindow (false);
		m_ctrlSelected.ShowWindow (false);
		break;
	case 2:
		m_spread1.ShowWindow (false);
		m_spread2.ShowWindow (false);
		m_spread3.ShowWindow (true);
		m_ctrl4_1.ShowWindow (false);
		m_ctrl4_2.ShowWindow (false);
		m_ctrl4_3.ShowWindow (false);
		m_ctrl4_4.ShowWindow (false);
		m_ctrl4_5.ShowWindow (false);
		m_ctrl4_6.ShowWindow (false);
		m_ctrlList.ShowWindow (false);
		m_ctrlSelected.ShowWindow (false);
		break;
	case 3:
		m_spread1.ShowWindow (false);
		m_spread2.ShowWindow (false);
		m_spread3.ShowWindow (false);
		m_ctrl4_1.ShowWindow (true);
		m_ctrl4_2.ShowWindow (true);
		m_ctrl4_3.ShowWindow (true);
		m_ctrl4_4.ShowWindow (true);
		m_ctrl4_5.ShowWindow (true);
		m_ctrl4_6.ShowWindow (true);
		m_ctrlList.ShowWindow (true);
		m_ctrlSelected.ShowWindow (true);
		break;
	default:
		break;
	}	
	
	*pResult = 0;
}

void CNewSourceDataView::OnInitialUpdate() 
{
	CFormView::OnInitialUpdate();
	
	// TODO: Add your specialized code here and/or call the base class
	TC_ITEM TabCtrlItem;
	TabCtrlItem.mask = TCIF_TEXT;
	TabCtrlItem.pszText = _T("储层参数");
	m_ctrlTab.InsertItem( 0, &TabCtrlItem );
	TabCtrlItem.pszText = _T("生产动态参数");
	m_ctrlTab.InsertItem( 1, &TabCtrlItem );
	TabCtrlItem.pszText = _T("射孔参数");
	m_ctrlTab.InsertItem( 2, &TabCtrlItem );
	TabCtrlItem.pszText = _T("射孔弹型号选择");
	m_ctrlTab.InsertItem( 3, &TabCtrlItem );

	m_spread1.ShowWindow(true);
	Load();	
	NewLoad1();
	NewLoad2();
	NewLoad3();
	
}

int CNewSourceDataView::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CFormView::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	CMainFrame*	pMainWnd = (CMainFrame*)AfxGetMainWnd();
	m_cstrProjectPath = pMainWnd->m_cstrProjectPath ;
	m_cstrSDTPath = pMainWnd->m_cstrSDTPath ;
	m_cstrEDTPath = pMainWnd->m_cstrEDTPath ;

	GetParentFrame()->SetWindowText(_T("基本数据"));
	
	return 0;
}

void CNewSourceDataView::Load()
{
	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

⌨️ 快捷键说明

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