コード例 #1
0
/************************************************************************************
    函    数:
    
    输    入:
    
    输    出:
  
    返 回 值:
    
    功    能:     用户按下“GO”按钮,开始放炮。
	               服务器响应“GO按钮”,执行三个动作:
				   
				   1、服务器程序通知服务器采集线程开始接收数据采集;
				   2、通知测网开始数据采集;
				   3、发送命令通知爆炸机点火。

    修改历史:

*************************************************************************************/
void CActiveSourceView::OnBnClickedButtongo()
{
	CMainFrame* pFrm = (CMainFrame*)AfxGetMainWnd();
	CBCGPGridRow* pRow = m_wndGrid.GetCurSel();
	if(!pRow)
	{
		// pFrm->MessageBox(_T("Select shot source!"),_T("Alarm"),MB_OK);
		// cxm 2012.3.7
//		theApp.WriteLog(_T("CActiveSourceView::OnBnClickedButtongo"),_T("Please first select shot source !"),LOGTYPE_WARNING,TRUE);
		return;
	}
	// 得到网格当前选择的行号
	int nRow=pRow->GetRowId();
	if(nRow>=pFrm->m_AllShotSources.GetCount())
	{
		return;
	}
	// 找到震源
	CShotSource* pSource = pFrm->m_AllShotSources.GetShotSource(nRow);	
	// 查找激活的炮点和震源对象CActiveShot,调用放炮函数
	nRow = pFrm->m_AllActiveShots.FindFirstActiveShotBySource(pSource);
	CActiveShot* pActiveShot = pFrm->m_AllActiveShots.GetActiveShot(nRow);
	if(pActiveShot!=NULL)
	{
		m_btnGo.EnableWindow(FALSE);
		pActiveShot->SendGeneralCMD(OPERATION_CMD_SHOTGO);
	}	
}
コード例 #2
0
void CComputerGrid::UpdateComputerInfoToRow(DWORD_PTR dwData, CComputerInfo& computer)
{	
	computer.SetUpdateState(CComputerInfo::EUS_NORMAL);

	CBCGPGridRow* pRow = FindRowByData(dwData);

	if (pRow != NULL) //已经存在的行
	{
		if (CheckShowCondition(computer))
		{
			UpdateRowData(pRow, computer);
		}
		else
		{
			RemoveRow(pRow->GetRowId()); //移除该行
		}		
	}
	else //添加新行
	{
		if (CheckShowCondition(computer))
		{
			pRow = CreateRow(GetColumnCount());
			pRow->SetData(dwData);
			UpdateRowData(pRow, computer);
			AddRow(pRow, FALSE);
		}
	}
}
コード例 #3
0
/**
 * @brief  按下爆炸机窗口的Stop按钮
 * @note  按下“Stop”按钮,在该爆炸机关联的炮点完成采集后,在 Impulsive 模式中,
 您可将数据转储到记录过程。在其它模式中,您可使用所提示的三个下压按钮(Go、 Cancel、End)
 来选择是继续该顺序,还是再进行一次采集,还是停止该顺序。

详细说明: 
 (一)按下Stop按钮
 按下Stop按钮后,继续完成当前放炮采集,如果是 Impulsive 模式,则保存采集数据。
 在其他模式下,弹出三个下压按钮(Go、 Cancel、End) 来选择。
 (1)Go按钮:继续该采样顺序,开始后续采集,后续采集可能是继续本次采集,
              也可能是下一次采集(根据本次采样的状态来决定,如果本次采样结束,则根据震源步进属性计算的下一次炮点编号);
 
 (2)Cancel按钮:终止本次采集,丢掉后续未采集的数据。但本次采集仍然保存选中。用户按下“Go”按钮,可以重新开始本次采集;

 (3)End按钮:将记录无保持采集的未完成震源点。然后点击 Go 将开始下一个震源点。
   
 * @param void
 * @return void
 */
void CActiveSourceView::OnBnClickedButtonstop()
{
	CMainFrame* pFrm = (CMainFrame*)AfxGetMainWnd();
	// 得到当前选择网格行
	CBCGPGridRow* pRow = m_wndGrid.GetCurSel();
	if(!pRow)
	{
		// pFrm->MessageBox(_T("Select shot source!"),_T("Alarm"),MB_OK);
		// cxm 2012.3.7
//		theApp.WriteLog(_T("CActiveSourceView::OnBnClickedButtonstop"),_T("Please first select shot source !"),LOGTYPE_WARNING,TRUE);
		return;
	}
	// 得到网格当前选择的行号
	int nRow=pRow->GetRowId();
	if(nRow>=pFrm->m_AllShotSources.GetCount())
	{
		return;
	}
	// 找到震源
	CShotSource* pSource = pFrm->m_AllShotSources.GetShotSource(nRow);	
	// 查找激活的炮点和震源对象CActiveShot,调用放炮函数
	nRow = pFrm->m_AllActiveShots.FindFirstActiveShotBySource(pSource);
	CActiveShot* pActiveShot = pFrm->m_AllActiveShots.GetActiveShot(nRow);
	if(pActiveShot==NULL)
	{
		// pActiveShot->SendGeneralCMD(OPERATION_CMD_SHOTGO);
		// cxm 2012.3.7
//		theApp.WriteLog(_T("CActiveSourceView::OnBnClickedButtonstop"),_T("The Shot Source is not activated!"),LOGTYPE_WARNING,TRUE);
		return;
	}
	CDlgAcquisitionControl		DlgCtrl;
	DlgCtrl.DoModal();
	switch(DlgCtrl.m_nSelectedButton)
	{
	case 1:			// 按下Go
		m_btnGo.EnableWindow(FALSE);
		break;
	case  2:		// Cancel
		m_btnGo.EnableWindow(TRUE);
		pActiveShot->SendGeneralCMD(OPERATION_CMD_AGAIN);
		break;
	case  3:		// End
		{
			// 调用主框架处理函数,通知服务器停止放炮,删除放炮管理对象
			m_btnGo.EnableWindow(TRUE);
			pFrm->OnDisassociatevp(pSource->m_dwSourceNb);
		}
		
		break;
	default:
		break;
	}
}
コード例 #4
0
/**
 * @brief  刷新界面上爆炸机状态显示
 * @note  将确认TB、井口时间、爆炸机状态显示在对应的控件中。
 * @param CActiveShot* pActiveShot,震源对象指针
 * @return void
 */
void  CActiveSourceView::RefreshBlasterState()
{
	CMainFrame* pFrm = (CMainFrame*)AfxGetMainWnd();
	CBCGPGridRow* pRow = m_wndGrid.GetCurSel();
	m_bShowBlasterCtrl = FALSE;
	if(!pRow)
	{		
		ShowBlasterCtrl();
		return;
	}
	// 得到网格当前选择的行号
	int nRow=pRow->GetRowId();
	if(nRow>=pFrm->m_AllShotSources.GetCount())
	{
		ShowBlasterCtrl();
		return;
	}
	// 找到震源
	CShotSource* pSource = pFrm->m_AllShotSources.GetShotSource(nRow);	
	// 查找激活的炮点和震源对象CActiveShot,调用放炮函数
	nRow = pFrm->m_AllActiveShots.FindFirstActiveShotBySource(pSource);
	if(nRow<0)
	{
		ShowBlasterCtrl();
		return;
	}
	CActiveShot* pActiveShot = pFrm->m_AllActiveShots.GetActiveShot(nRow);
	if(!pActiveShot || !pActiveShot->m_bNewBlaster)
	{
		ShowBlasterCtrl();
		return;
	}
	// 收到新的爆炸机状态参数,显示确认TB、井口时间
	m_bShowBlasterCtrl = TRUE;
	ShowBlasterCtrl();
	CString    strTemp;
	if (pActiveShot->m_bITBErr)
	{
		m_ctrlBlasterText.SetWindowText(_T("ITB"));		
	}
	else
	{
		m_ctrlBlasterText.SetWindowText(_T("Blaster"));		
	}
	// 爆炸机状态
	m_nBlasterState = pActiveShot->m_byBlasterState;
	strTemp.Format(_T("%.2f"),pActiveShot->m_fConfirmedTB);
	m_ctrlTBValue.SetWindowText(strTemp);
	strTemp.Format(_T("%.2f"),pActiveShot->m_fUpholeTime);
	m_ctrlUpholeValue.SetWindowText(strTemp);
	Invalidate();
}
コード例 #5
0
int CTabPage::GetGridListSelectRowID(CBCGPGridCtrl* pGridCtrlList)
{
	int iSelectRowIndex = -1;
	CBCGPGridRow* pRow = NULL;	// 队列行

	// 得到选中行
	pRow = pGridCtrlList->GetCurSel();
	if(NULL != pRow)
	{
		iSelectRowIndex = pRow->GetRowId();
	}
	return iSelectRowIndex;
}
コード例 #6
0
void CActiveMemberGrid::RedrawUpdateActiveMembers()
{
	while (TRUE)
	{
		UINT nMemberId = m_lpActiveMemberList->GetUpdateActiveMemberId();

		if (nMemberId > 0)
		{
			CActiveMember ActiveMember;

			if (m_lpActiveMemberList->GetActiveMember(nMemberId, ActiveMember))
			{
				CBCGPGridRow* pRow = FindRowByData(ActiveMember.GetMemberID(), FALSE);

				if (pRow != NULL)//已经存在的
				{
					UpdateRowData(pRow, ActiveMember);
				}
				else //新增加的
				{
					AddNewRow(ActiveMember);
				}
			}
			else
			{
				//已经删除了

				CBCGPGridRow* pRow = FindRowByData(nMemberId, FALSE);
				
				if (pRow != NULL)
				{
					RemoveRow(pRow->GetRowId());
				}
			}
		}
		else
		{
			//更新完毕了
			break;
		}
	}
}
コード例 #7
0
void CToolGridListDlg::OnBnClickedButtonDelSel()
{
    // TODO: 在此添加控件通知处理程序代码
    CBCGPGridRow *pSelRow = m_wndGridTools.GetCurSel();
    if (pSelRow==NULL) return;

    CBCGPGridItem * pItemId = pSelRow->GetItem(0);
    if (pItemId==NULL) return;

    CString strId = pItemId->GetValue();
    map<CString,ToolObject>::iterator iterFind = m_ToolMap.find(strId);
    if (iterFind== m_ToolMap.end()) return;

    if (MessageBox("确定要删除选中的配置?","提示",MB_YESNO|MB_ICONQUESTION)==IDNO)
        return;

    m_ToolMap.erase(iterFind);
    CToolsProUnity::DeleteToolConfigFromXml(strId);
    m_wndGridTools.RemoveRow(pSelRow->GetRowId());
    m_wndGridTools.AdjustLayout ();
}
コード例 #8
0
void CDlgJianmoLogin::OnGridButtonClicked(UINT uID)
{
	static const int BTN_OP = 0;
	uID -= ID_GRID_BUTTON_FIRST;

	CBCGPGridRow * pRow = m_wndGridHistory.GetCurSel();
	if ( pRow == NULL ) return;
	CHistoryModelData * pData = NULL;

	switch (uID)
	{
	case BTN_OP: //
		 pData = m_xhm.m_vDatas[ pRow->GetRowId() ];
		break;

	default:
		return;
	}

	if (pData != NULL)
	{
		theApp.m_processMgr.Open(pData->m_strPath);
// 		theApp.m_strXpdlName = pData->m_strName;
// 		theApp.m_strXpdlWorkPath = pData->m_strPath;
// 
// 		VIEW_DATA * pView = theViewMgr.Find( "建模环境" );
// 		if ( pView == NULL )
// 		{
// 			pView = theViewMgr.NewView("建模环境");
// 			if ( pView == NULL ) return;
// 		}
// 		CDlgSvg * pSvg = reinterpret_cast< CDlgSvg * >( pView->m_dwExData );
// 		if ( pSvg == NULL ) return;
// 		pSvg->Navigate( theGlobalConfig.m_strSvgUrl );
	}

	EndDialog(TRUE); return;
}
コード例 #9
0
/**
* @brief 得到索引队列,修改操作、删除操作、颠倒操作
* @param CBCGPGridCtrl* pGridCtrlEdit 输入行
* @param CBCGPGridCtrl* pGridCtrlList 列表
* @param CList<int, int>* pListNb Nb号队列指针
* @return bool true:成功;false:失败
*/
bool CGridCtrlOperation::GetIndexListForChangeOrDeleteOrReverse(CBCGPGridCtrl* pGridCtrlEdit, CBCGPGridCtrl* pGridCtrlList, CList<int, int>* pListNb)
{	
	pListNb->RemoveAll();	// 清空索引队列

	CString strNb =_T("");	// 索引号
	int iNbStart = 0;
	int iNbEnd = 0;
	int iRowIndexStart = -1;
	int iRowIndexEnd = -1;
	int iRowIndexStep = 1;

	CBCGPGridRow* pRowEdit = pGridCtrlEdit->GetRow(0);	// 输入行
	strNb = pRowEdit->GetItem(0)->GetValue();	// 索引号
	if(strNb == _T(""))
	{		
		return false;
	}
	
	if(strNb ==_T(""))
	{
		//AfxMessageBox("Please Input Index.", MB_OK | MB_ICONSTOP);
		return false;
	}

	int iPos;
	CString strPart;

	// 得到步长
	iPos = strNb.Find('/');
	if(iPos > 0)
	{
		try
		{
			strPart = strNb.Right(strNb.GetLength() - (iPos + 1));
			iRowIndexStep = CXMLDOMTool::ConvertStringToInt(strPart);
			strNb = strNb.Left(iPos);
		}
		catch (CException* )
		{
			//AfxMessageBox("Please Input Step.", MB_OK | MB_ICONSTOP);
			return false;
		}
	}

	// 得到起始索引号
	iPos = strNb.Find('-');
	if(iPos >= 0)
	{
		// 索引号起点
		strPart = strNb.Left(iPos);
		if(strPart == _T(""))
		{
			iRowIndexStart = 0;
		}
		else
		{
			try
			{
				iNbStart = CXMLDOMTool::ConvertStringToInt(strPart);
				CBCGPGridRow* pRow = pGridCtrlList->FindRowByData(iNbStart);
				if(NULL == pRow)
				{
					//AfxMessageBox("Start Index Not Found.", MB_OK | MB_ICONSTOP);
					return false;
				}
				iRowIndexStart = pRow->GetRowId();
			}
			catch (CException* )
			{
				//AfxMessageBox("Please Input Start Index.", MB_OK | MB_ICONSTOP);
				return false;
			}
		}		
		// 索引号终点
		strPart = strNb.Right(strNb.GetLength() - (iPos + 1));
		if(strPart == _T(""))
		{
			iRowIndexEnd = pGridCtrlList->GetRowCount() - 1;
		}
		else
		{
			try
			{
				iNbEnd = CXMLDOMTool::ConvertStringToInt(strPart);
				CBCGPGridRow* pRow = pGridCtrlList->FindRowByData(iNbEnd);
				if(NULL == pRow)
				{
					//AfxMessageBox("Stop Index Not Found.", MB_OK | MB_ICONSTOP);
					return false;
				}
				iRowIndexEnd = pRow->GetRowId();
			}
			catch (CException* )
			{
				//AfxMessageBox("Please Input Stop Index.", MB_OK | MB_ICONSTOP);
				return false;
			}
		}		
	}
	else
	{
		try
		{
			// 索引号起点
			iNbStart = CXMLDOMTool::ConvertStringToInt(strNb);
			CBCGPGridRow* pRow = pGridCtrlList->FindRowByData(iNbStart);
			if(NULL == pRow)
			{
				//AfxMessageBox("Start Index Not Found.", MB_OK | MB_ICONSTOP);
				return false;
			}
			iRowIndexStart = pRow->GetRowId();
			// 索引号终点
			iRowIndexEnd = iRowIndexStart;
		}
		catch (CException* )
		{
			//AfxMessageBox("Please Input Start Index.", MB_OK | MB_ICONSTOP);
			return false;
		}
	}

	// 确保终点不小于起点
	if(iRowIndexStart > iRowIndexEnd)
	{
		int iData = iRowIndexStart;
		iRowIndexStart = iRowIndexEnd;
		iRowIndexEnd = iData;
	}

	for(int i = iRowIndexStart; i <= iRowIndexEnd; i = i + iRowIndexStep)
	{
		pListNb->AddTail(i);
	}

	return true;
}
コード例 #10
0
//**********************************************************************
void CBCGPRibbonCustomizeRibbonPage::OnRemove() 
{
#ifndef BCGP_EXCLUDE_GRID_CTRL
	CBCGPGridRow* pRow = m_wndRibbonTreeDest.GetCurSel();
	if (pRow == NULL)
	{
		ASSERT(FALSE);
		return;
	}

	m_bDontProcessSelChanged = TRUE;

	ASSERT_VALID(pRow);

	CBCGPGridRow* pParentRow = pRow->GetParent();

	if (m_pSelCategoryDest != NULL)
	{
		ASSERT_VALID(m_pSelCategoryDest);
		ASSERT(m_pSelCategoryDest->IsCustom());

		m_pSelCategoryDest->m_bToBeDeleted = TRUE;
		m_CustomizationData.RemoveCustomTab(*m_pSelCategoryDest);
	}
	else if (m_pSelPanelDest != NULL)
	{
		ASSERT_VALID(m_pSelPanelDest);

		if (m_pSelPanelDest->IsCustom())
		{
			m_pSelPanelDest->m_bToBeDeleted = TRUE;
			m_CustomizationData.RemoveCustomPanel(*m_pSelPanelDest);
		}
		else
		{
			m_CustomizationData.ShowPanel(m_pSelPanelDest, FALSE);
		}
	}
	else if (m_pSelElemDest != NULL)
	{
		ASSERT_VALID(m_pSelElemDest);

		m_CustomizationData.RemoveCustomElement(*m_pSelElemDest);

		if (m_pSelElemDest->m_bIsNew)
		{
			CBCGPRibbonPanel* pPanel = m_pSelElemDest->GetParentPanel();
			ASSERT_VALID(pPanel);

			int nIndex = pPanel->GetIndex(m_pSelElemDest);
			ASSERT(nIndex >= 0);

			pPanel->Remove(nIndex);
		}
	}
	else
	{
		ASSERT(FALSE);
		m_bDontProcessSelChanged = FALSE;
		return;
	}

	int id = pRow->GetRowId();
	
	BOOL bDisableDown = FALSE;
	BOOL bDisableUp = FALSE;

	m_wndRibbonTreeDest.SetRedraw(FALSE);

	if (!m_wndRibbonTreeDest.MoveSelection(TRUE))
	{
		bDisableDown = TRUE;
		bDisableUp = !m_wndRibbonTreeDest.MoveSelection(FALSE);
	}

	CBCGPGridRow* pSelRow = m_wndRibbonTreeDest.GetCurSel();
	m_wndRibbonTreeDest.SetCurSel(NULL, FALSE);

	m_wndRibbonTreeDest.RemoveRow(id);
	m_wndRibbonTreeDest.AdjustLayout ();

	m_bDontProcessSelChanged = FALSE;

	if (bDisableDown && bDisableUp)
	{
		m_wndRibbonTreeDest.SetCurSel(pParentRow);
	}
	else
	{
		m_wndRibbonTreeDest.SetCurSel(pSelRow);
	}
	
	m_wndRibbonTreeDest.SetRedraw();
	m_wndRibbonTreeDest.RedrawWindow();

#endif
}