コード例 #1
0
/**
 * @brief 刷新震源的状态图标
 * @note  通过每行设定的数据(等于震源的Nb)找到CShotSource* pSource对应的行,
 并刷新震源的状态图标,图标位于网格中第一列
 * @param  CShotSource* pSource,需要刷新显示状态的震源指针
 * @return void
 */
void  CActiveSourceWnd::RefrestShotSourceState(CShotSource* pSource)
{
	if(!pSource)
		return ;
	CBCGPGridCtrl* pGridCtrl = GetGridCtrl();
	if(NULL==pGridCtrl)
		return ;
	CBCGPGridRow *pRow=NULL;
	int nRowCount = pGridCtrl->GetRowCount();	
	for(int i=0;i<nRowCount;i++)
	{
		pRow = pGridCtrl->GetRow(i);		
		// 判断每行的属性数据与震源的编号是否相等
		if(pRow->GetData()==pSource->m_dwSourceNb)
		{
			pRow->GetItem (0)->SetImage(pSource->m_bySourceState);
		}
	}
}
コード例 #2
0
/**
 * @brief  将一条震源加载到网格中
 * @note  将一个震源对象属性添加到网格的对应列中,如果nRowNum小于0,则表示向网格中新增加一行;
 如果nRowNum大于0,则表示向指定行输出震源对象。
 * @param CShotSource* pShotSrc,震源对象指针
 * @param int  nRowNum,行号
 * @return void
 */
void CActiveSourceWnd::LoadShotSource(CShotSource* pShotSrc,int  nRowNum)
{
	if(NULL==pShotSrc)
		return ;
	CBCGPGridCtrl* pGridCtrl = GetGridCtrl();
	if(NULL==pGridCtrl)
		return;
	CBCGPGridRow* pRow=NULL;
	if(nRowNum<0)
	{
		pRow = pGridCtrl->CreateRow (pGridCtrl->GetColumnCount());
		pGridCtrl->AddRow(pRow);
	}	
	else
	{
		pRow = pGridCtrl->GetRow(nRowNum);
	}
	if(!pRow)
		return;
	// 震源属性
	pRow->GetItem (0)->SetImage(pShotSrc->m_bySourceState);
	pRow->GetItem (2)->SetValue (_T("-"));
	pRow->GetItem (3)->SetValue (LPCTSTR(pShotSrc->m_strLabel));
	pRow->GetItem (4)->SetValue (pShotSrc->m_dwSourceIndex);
	// 空的炮点
	pRow->GetItem (5)->SetValue (_T(""));
	pRow->GetItem (6)->SetValue (_T("-"));
	pRow->GetItem (7)->SetValue (_T(""));
	pRow->GetItem (8)->SetValue (_T(""));
	pRow->GetItem (9)->SetValue (_T(""));
	pRow->GetItem (10)->SetValue (_T(""));
	pRow->GetItem (11)->SetValue (_T(""));
	pRow->GetItem (12)->SetValue (_T(""));
	pRow->GetItem (13)->SetValue (_T(""));
	pRow->GetItem (14)->SetValue (_T(""));
	pRow->GetItem (15)->SetValue (_T(""));
	pRow->GetItem (16)->SetValue (_T(""));
	// 设置行的属性数据为震源的编号
	pRow->SetData(pShotSrc->m_dwSourceNb);	
}
コード例 #3
0
/******************************************************************************
    函    数:
    
    输    入:
    
    输    出:
  
    返 回 值:
    
    功    能: 用户选择震源、炮号准备放炮时,将炮号的信息(CShotPoint)写到表格中对应的震源行内

    修改历史:

*******************************************************************************/
int CActiveSourceWnd::LoadShotPointBySource(CShotSource* pSource, CShotPoint* pShotPoint)
{
	if(!pSource || !pShotPoint)
		return -1;
	CBCGPGridCtrl* pGridCtrl = GetGridCtrl();
	if(NULL==pGridCtrl)
		return -1;
	CBCGPGridRow *pRow=NULL;
	int nRowCount = pGridCtrl->GetRowCount();
	COleVariant oVariant;
	for(int i=0;i<nRowCount;i++)
	{
		pRow = pGridCtrl->GetRow(i);		
		// 判断每行的属性数据与震源的编号是否相等
		if(pRow->GetData()==pSource->m_dwSourceNb)
		{
			// 装载下一次要放炮的炮点编号
			oVariant = (long)pShotPoint->m_dwShotNb + pSource->m_lStep;
			oVariant.ChangeType(VT_BSTR);			
			pRow->GetItem (2)->SetValue (oVariant);

			// 装载炮点的数据,编号
			oVariant = (long)pShotPoint->m_dwShotNb;
			oVariant.ChangeType(VT_BSTR);			
			pRow->GetItem (5)->SetValue (oVariant);
			// Dist min
			pRow->GetItem (6)->SetValue (_T("-"));
			// Current Stack
			pRow->GetItem (7)->SetValue (_T("0"));
			// SourcePoint Line			
			oVariant = pShotPoint->m_fSourceLine;
			oVariant.ChangeType(VT_BSTR);
			pRow->GetItem (8)->SetValue (oVariant);
			// SourcePoint Number		
			oVariant = pShotPoint->m_fSourceNb;
			oVariant.ChangeType(VT_BSTR);
			pRow->GetItem (9)->SetValue (oVariant);
			// SourcePoint Index
			oVariant = (long)pShotPoint->m_dwSourcePointIndex;
			oVariant.ChangeType(VT_BSTR);
			pRow->GetItem (10)->SetValue (oVariant);
			// SFL
			oVariant = (long)pShotPoint->m_dwSpreadSFL;
			oVariant.ChangeType(VT_BSTR);
			pRow->GetItem (11)->SetValue (oVariant);
			// SFN			
			oVariant = (long)pShotPoint->m_dwSpreadSFN;
			oVariant.ChangeType(VT_BSTR);
			pRow->GetItem (12)->SetValue (oVariant);
			// Spread#			
			oVariant = (long)pShotPoint->m_dwSpreadNb;
			oVariant.ChangeType(VT_BSTR);
			pRow->GetItem (13)->SetValue (oVariant);
			// SuperSpread			
			oVariant = (long)pShotPoint->m_dwSuperSpread;
			oVariant.ChangeType(VT_BSTR);
			pRow->GetItem (14)->SetValue (oVariant);
			// ProcessType			
			oVariant = (long)pShotPoint->m_dwProcessNb;
			oVariant.ChangeType(VT_BSTR);
			pRow->GetItem (15)->SetValue (oVariant);
			// Swath			
			oVariant = (long)pShotPoint->m_dwSwathNb;
			oVariant.ChangeType(VT_BSTR);
			pRow->GetItem (16)->SetValue (oVariant);
			return 1;
		}
	}
	
	return 1;

}