コード例 #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
/******************************************************************************
    函    数:
    
    输    入:
    
    输    出:
  
    返 回 值:
    
    功    能: 用户选择震源、炮号准备放炮时,将炮号的信息(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;

}