Пример #1
0
//右键弹出处理
void CComputerListView::OnContextMenu(CWnd*, CPoint point)
{
	m_SelectRows.RemoveAll();

	CMenu menu;

	CBCGPGridRow* pRow = GetGridCtrl()->GetCurSel();

	if (pRow != NULL)//存在选中的子行
	{
		CList<CBCGPGridItem*, CBCGPGridItem*> lstSelected;
		GetGridCtrl()->GetSelectedItems(lstSelected);//多重选择队列

		POSITION pos = lstSelected.GetHeadPosition();//第一个

		while (pos != NULL)
		{
			CBCGPGridItem* pItem = lstSelected.GetNext(pos);//下一个			
			m_SelectRows.Add((UINT)pItem->GetParentRow()->GetData());//保存选中的序号			
		}

		SendMessage(WM_LBUTTONUP);//弹起

		VERIFY(menu.LoadMenu(IDR_COMPUTER_MENU));//载入
		CMenu* pPopup = menu.GetSubMenu(0);//第一个子菜单
		ASSERT(pPopup != NULL);

#ifndef __USING_INTER_RESOURCE
		HMENU hTmp = pPopup->GetSubMenu(6)->GetSafeHmenu();
		pPopup->ModifyMenu((UINT_PTR)hTmp,MF_POPUP,(UINT_PTR)hTmp,LOAD_STRING(IDS_REMOTE_OPERATION));
#endif

		//弹出菜单
		theApp.GetContextMenuManager()->ShowPopupMenu(pPopup->Detach(), point.x, point.y, this, TRUE);
	}
	else
	{
		//扫描鼠标位置,点击在列栏上,才弹出此菜单
		CRect rect;
		m_pWndGridCtrl->GetClientRect(rect);
		rect.bottom = 21; //栏高度大概为21个像素
		ClientToScreen(rect);

		if (rect.PtInRect(point))//点击在栏上
		{
			VERIFY(menu.LoadMenu(IDR_MENU_COLUMN));//载入列菜单

			CMenu* pPopup = menu.GetSubMenu(0);
			ASSERT(pPopup != NULL);

			for (INT i = 0; i < GetGridCtrl()->GetColumnCount(); i++)//列枚举
			{//动态插入与列项有关的菜单
				pPopup->InsertMenu(i, MF_BYPOSITION, IDM_MINCOLUMNCMD + i, GetGridCtrl()->GetColumnName(i));
				pPopup->CheckMenuItem(i, MF_BYPOSITION | (GetGridCtrl()->GetColumnVisible(i) ? MF_CHECKED : MF_UNCHECKED));
			}

			theApp.GetContextMenuManager()->ShowPopupMenu(pPopup->Detach(), point.x, point.y, this, TRUE);
		}
	}
}
Пример #2
0
void CComputerListView::OnUnlockScreen()
{
	CUnlockScreenDlg dlg;
	
	if (dlg.DoModal() != IDOK)
	{
		return;
	}

	for (INT i = 0; i < GetGridCtrl()->GetRowCount(); i++)
	{
		if (!GetGridCtrl()->IsRowSelected(i))
		{
			continue;
		}

		CBCGPGridRow* pRow = GetGridCtrl()->GetRow(i);

		if (!CLocalServer::GetInstance()->ComputerList.IsInvaildIndex(pRow->GetData()))
		{
			CComputerInfo& ComputerInfo = CLocalServer::GetInstance()->ComputerList.GetComputer(pRow->GetData());

			if (ComputerInfo.GetComputerStatus() == CComputerInfo::ECS_LOCKED)
			{
				CLocalServer::GetInstance()->LocalUnlockScreen(pRow->GetData(), dlg.GetPwd());
			}
		}
	}
}
Пример #3
0
void CComputerListView::AdjustLayout()
{//重新更新位置
	if (GetGridCtrl()->GetSafeHwnd() != NULL)
	{
		CRect rectClient;
		GetClientRect(rectClient);
		GetGridCtrl()->SetWindowPos (NULL, 0, 0,  rectClient.Width(), rectClient.Height(), SWP_NOACTIVATE | SWP_NOZORDER);
	}
}
Пример #4
0
//显示列
void CComputerListView::OnShowColumn(UINT id)
{
	INT nIndex = id - IDM_MINCOLUMNCMD;//列号

	if (nIndex >= 0 && nIndex < GetGridCtrl()->GetColumnCount())
	{//设置列的显示
		GetGridCtrl()->SetColumnVisible(nIndex, !GetGridCtrl()->GetColumnVisible(nIndex));
		GetGridCtrl()->AdjustLayout();//更新
	}
}
Пример #5
0
void CActiveMemberView::OnUpdateRebilling(CCmdUI *pCmdUI)
{
	CList <CBCGPGridItem*,CBCGPGridItem*> arrMember;
	GetGridCtrl()->GetSelectedItems(arrMember);

	pCmdUI->Enable(arrMember.GetCount() > 0);
}
Пример #6
0
void CMailView::UpdateCaptionText ()
{
	CBCGPOrganizerDoc* pDoc = GetDocument ();
	if (pDoc == NULL || pDoc->GetMode () != CBCGPOrganizerDoc::e_ModeMail)
	{
		return;
	}

	CMainFrame* pFrame = DYNAMIC_DOWNCAST(CMainFrame, AfxGetMainWnd ());

	if (pFrame != NULL)
	{
		CString str;
		CBCGPGridCtrl* pGridCtrl = GetGridCtrl ();
		if (pGridCtrl != NULL)
		{
			CBCGPGridRow* pRow = pGridCtrl->GetCurSel ();
			if (pRow != NULL && !pRow->IsGroup ())
			{
				str = _T("From: ") + pRow->GetItem (3)->FormatItem ();
				str += _T("; Subject: ") + pRow->GetItem (4)->FormatItem ();
			}
		}

		if (str.IsEmpty ())
		{
			str = _T(" ");
		}

		pFrame->SetCaptionText (str);
	}
}
Пример #7
0
void CActiveMemberView::OnContextMenu(CWnd* /*pWnd*/, CPoint point)
{
	CMenu menu;
	VERIFY(menu.LoadMenu(IDR_ACTIVEMEMBER_MENU));//载入
	
	CBCGPGridRow* pRow = GetGridCtrl()->GetCurSel();

	if (pRow != NULL)//存在选中的子行
	{
		SendMessage(WM_LBUTTONUP);

		CMenu* pPopup = menu.GetSubMenu(0);//第一个子菜单

		if (pPopup)
		{
			// 2012/03/21-8238-gxx: 
			if (CNetBarConfig::GetInstance()->GetRealNamePassword() == 4 )
			{
				pPopup->RemoveMenu(IDM_CHECKIN, MF_BYCOMMAND);
			}

			theApp.GetContextMenuManager()->ShowPopupMenu(pPopup->Detach(), point.x, point.y, this, TRUE);
		}

		
	}
	else
	{
		CMenu* pPopup = menu.GetSubMenu(1);//第2个子菜单
		theApp.GetContextMenuManager()->ShowPopupMenu(pPopup->Detach(), point.x, point.y, this, TRUE);
	}
}
Пример #8
0
void CActiveMemberView::OnModifyRemark()
{

	CBCGPGridRow* pRow = GetGridCtrl()->GetCurSel();
	if (!pRow)
	{
		return;
	}

	UINT nMemberID = pRow->GetData();

	CActiveMember ActiveMember;
	if (!CLocalServer::GetInstance()->ActiveMemberList.GetActiveMember(nMemberID, ActiveMember))
	{
		return;
	}
	
	CDlgInputParam dlgInput(this);
	dlgInput.InitParam(LOAD_STRING(IDS_MODIFY_REMARK),LOAD_STRING(IDS_REMARK),ActiveMember.GetRemark());
	if (dlgInput.DoModal() == IDOK)
	{
		ActiveMember.SetRemark( dlgInput.m_strParam );
		CLocalServer::GetInstance()->ActiveMemberList.UpdateActiveMember(ActiveMember,TRUE);
		pRow->GetItem(14)->SetValue(ActiveMember.GetRemark().GetString(), TRUE);
	}
}
Пример #9
0
void CComputerListView::OnPowerOn()
{
	//多选启动
	for (INT ii = 0; ii <  GetGridCtrl()->GetRowCount(); ii++)
	{
		if (GetGridCtrl()->IsRowSelected(ii))
		{
			CComputerInfo ComputerInfo;
			GetComputerInfoFromRow(ComputerInfo, ii);
			if (!ComputerInfo.HasClient())
			{
				CBCGPGridRow* pRow = GetGridCtrl()->GetRow(ii);
				CLocalServer::GetInstance()->LocalStartupComputer(pRow->GetData());
			}
		}
	}
}
Пример #10
0
//拷屏
void CComputerListView::OnSnapScreen()
{
	if (CNetBarConfig::GetInstance()->GetForbidCaptureScreen())
	{
		CDlgBossPwd dlg;
		if (dlg.DoModal() != IDOK)
			return;
	}
	CBCGPGridRow* pRow = GetGridCtrl()->GetCurSel();
	if (pRow != NULL) CLocalServer::GetInstance()->LocalCaptureScreen(pRow->GetData());
}
Пример #11
0
void CComputerListView::OnReboot()
{//重新启动
	CComputerInfo ComputerInfo;

	if (GetCurComputerInfo(ComputerInfo))
	{
		for (INT ii = 0; ii <  GetGridCtrl()->GetRowCount(); ii++)
		{
			if (GetGridCtrl()->IsRowSelected(ii))
			{
				CComputerInfo ComputerInfo;
				GetComputerInfoFromRow(ComputerInfo, ii);
				if (ComputerInfo.HasClient())
				{
					CBCGPGridRow* pRow = GetGridCtrl()->GetRow(ii);
					CLocalServer::GetInstance()->LocalShutdownComputer(pRow->GetData(), TRUE);
				}
			}
		}
	}
}
Пример #12
0
void CComputerListView::OnPowerOff()
{
	//多选关闭
	for (INT ii = 0; ii <  GetGridCtrl()->GetRowCount(); ii++)
	{
		if (GetGridCtrl()->IsRowSelected(ii))
		{
			CBCGPGridRow* pRow = GetGridCtrl()->GetRow(ii);
			if (pRow != NULL)
			{
				CComputerInfo ComputerInfo;
				GetComputerInfoFromRow(ComputerInfo, ii);
				if (ComputerInfo.HasClient())
				{
					INT_PTR nIndex = pRow->GetData();

					CLocalServer::GetInstance()->LocalShutdownComputer(pRow->GetData(), FALSE);
				}
			}
		}
	}
}
Пример #13
0
BOOL CActiveMemberView::GetCurActiveMember(CActiveMember& ActiveMember)
{
	CBCGPGridRow* pRow = GetGridCtrl()->GetCurSel();

	if (pRow != NULL)
	{
		UINT nMemberId = pRow->GetData();

		return ((CActiveMemberGrid*)m_pWndGridCtrl)->GetActiveMemberList()->GetActiveMember(nMemberId, ActiveMember);
	}

	return FALSE;
}
/**
 * @brief "Associate VP",为震源分配炮点
 * @note  打开一个可指定要(通过输入其 Shot Number)分配给该震源的 VP 的对话框。这与用鼠标右键点击放炮表内
部所调出的“Start Seismonitor with Vib Source”命令效果基本相同。
 * @param  void
 * @return void
 */
void CActiveSourceWnd::OnActivesourceAssociatevp()
{
	CBCGPGridCtrl* pGridCtrl = GetGridCtrl();
	if(NULL==pGridCtrl)
		return;
	// 如果没有选择震源或者网格中某一行,则不处理
	CBCGPGridRow* pRow= pGridCtrl->GetCurSel();
	if(NULL==pRow)
		return;

	CMainFrame* pFrm = (CMainFrame*)AfxGetMainWnd();
	pFrm->OnAssociatevp(pRow->GetData());
}
/**
 * @brief "Associate SPL & SPN",为震源分配炮点
 * @note  与 Associate VP 命令效果基本相同,但您不必输入要分配给该震源的 VP Shot Number,而是必须输
 入其 SPL (震源点测线) 和 SPN (震源点号)。
 * @param  void
 * @return void
 */
void CActiveSourceWnd::OnActivesourceAssociatesplspn()
{
	CBCGPGridCtrl* pGridCtrl = GetGridCtrl();
	if(NULL==pGridCtrl)
		return;
	// 如果没有选择震源或者网格中某一行,则不处理
	CBCGPGridRow* pRow= pGridCtrl->GetCurSel();
	if(NULL==pRow)
		return;

	CMainFrame* pFrm = (CMainFrame*)AfxGetMainWnd();
	// 调用主框架处理函数,通过SPL和SPN找到响应的炮点
	pFrm->OnAssociateSPLSPN(pRow->GetData());
}
/**
 * @brief 响应鼠标在震源网格中右键消息,显示右键菜单
 * @note  如果选中某一个震源,则响应消息,显示右键菜单。菜单内容包括停止某一震源、为震源分配炮点编号、
 为某震源通过震源点测线号及道号来确定炮点、清除Ready状态等
 * @param CWnd* pWnd,窗口指针
 * @param CPoint point,鼠标坐标
 * @return void
 */
void CActiveSourceWnd::OnContextMenu(CWnd* pWnd, CPoint point)
{
	// TODO: 在此处添加消息处理程序代码
	CBCGPGridCtrl* pGridCtrl = GetGridCtrl();
	if(NULL==pGridCtrl)
		return;
	// 如果没有选择震源或者网格中某一行,则不弹出菜单
	CBCGPGridRow* pRow= pGridCtrl->GetCurSel();
	if(NULL==pRow)
		return;
	CMenu menu;
	// 加载右击菜单
	VERIFY(menu.LoadMenu (IDR_POPUP_ACTIVESOURCE));
	CMenu* pPopup = menu.GetSubMenu(0);
	ASSERT(pPopup != NULL);	
	// CMainFrame* pFrm = (CMainFrame*)AfxGetMainWnd();
	CString  strTemp;
	// 每一行的数据等于震源的编号
	strTemp.Format(_T("Source %d"),pRow->GetData());
	
	// pPopup->ModifyMenu(MF_BYCOMMAND,MF_STRING,ID_ACTIVESOURCE_SOURCE,strTemp);
	// pPopup->ModifyMenu(MF_BYPOSITION,MF_STRING,0,_T("AAAAA"));
	// 更改第一个菜单的标题,显示为“Source”+震源编号
	MENUITEMINFO info;
	info.cbSize = sizeof (MENUITEMINFO);		// must fill up this field
	info.fMask = MIIM_STRING;					// get the state of the menu item
	info.dwTypeData = strTemp.GetBuffer();
	info.cch = strTemp.GetLength();
	VERIFY(pPopup->SetMenuItemInfo(ID_ACTIVESOURCE_SOURCE, &info,FALSE));
	strTemp.ReleaseBuffer();
	/*
	int  nSourceState = pRow->GetItem(0)->GetImage();
	if(nSourceState==SHOTSOURCE_FOCUS)
	{	
		info.cbSize = sizeof (MENUITEMINFO);		// must fill up this field
		info.fMask = MIIM_STATE;
		info.fState = MFS_DISABLED;
		// 如果正处于采集过程中,禁止更改放炮点
		pPopup->SetMenuItemInfo(ID_ACTIVESOURCE_DISASSOCIATEVP, &info,FALSE);
		pPopup->SetMenuItemInfo(ID_ACTIVESOURCE_ASSOCIATEVP, &info,FALSE);
		pPopup->SetMenuItemInfo(ID_ACTIVESOURCE_ASSOCIATESPLSPN, &info,FALSE);
		
		// pPopup->EnableMenuItem(ID_ACTIVESOURCE_DISASSOCIATEVP,MF_BYCOMMAND|MF_DISABLED);
		// pPopup->EnableMenuItem(ID_ACTIVESOURCE_ASSOCIATEVP,MF_BYCOMMAND|MF_DISABLED);
		// pPopup->EnableMenuItem(ID_ACTIVESOURCE_ASSOCIATESPLSPN,MF_BYCOMMAND|MF_DISABLED);
	}*/
	CBCGPPopupMenu* pPopupMenu = new CBCGPPopupMenu;
	pPopupMenu->Create(this, point.x, point.y,pPopup->Detach(),FALSE,TRUE);

}
Пример #17
0
//通过行序号得到终端信息
BOOL CComputerListView::GetComputerInfoFromRow(CComputerInfo & ComputerInfo, INT RowIndex)
{
	CBCGPGridRow* pRow = GetGridCtrl()->GetRow(RowIndex);

	if (pRow != NULL) 
	{
		if (!CLocalServer::GetInstance()->ComputerList.IsInvaildIndex(pRow->GetData()))
		{
			ComputerInfo = CLocalServer::GetInstance()->ComputerList.GetComputer(pRow->GetData());

			return TRUE;
		}
	}

	return FALSE;
}
Пример #18
0
void CComputerListView::OnBundtimeonline()
{
	CBCGPGridRow* pRow = GetGridCtrl()->GetCurSel();

	if (pRow != NULL) 
	{
		if (!CLocalServer::GetInstance()->ComputerList.IsInvaildIndex(pRow->GetData()))
		{
			CComputerInfo ComputerInfo = CLocalServer::GetInstance()->ComputerList.GetComputer(pRow->GetData());
			
			CDlgBundleTime BundleTimeDlg;
			BundleTimeDlg.SetNetId(ComputerInfo.GetNetId(), TRUE);
			BundleTimeDlg.DoModal();
		}
	}
}
/**
 * @brief "Disassociate VP",暂停震源使用
 * @note  不再希望继续使用某一震源,或想要将其置入待命状态,或想要手工分配给它另一
 个 VP,则在Active Source窗口右键菜单中选择Disassociate VP,暂停该震源的施工。
 在滑动扫描等模式下以前分配给该未用震源的剩余 VP 将被忽略。
 * @param  void
 * @return void
 */
void CActiveSourceWnd::OnActivesourceDisassociatevp()
{
	CBCGPGridCtrl* pGridCtrl = GetGridCtrl();
	if(NULL==pGridCtrl)
		return;
	// 如果没有选择震源或者网格中某一行,则不处理
	CBCGPGridRow* pRow= pGridCtrl->GetCurSel();
	if(NULL==pRow)
		return;

	CMainFrame* pFrm = (CMainFrame*)AfxGetMainWnd();
	// 调用主框架处理函数,通知服务器停止放炮,删除放炮管理对象
	CShotSource* pSource = pFrm->OnDisassociatevp(pRow->GetData());
	// 重新加载震源,并删除对应的炮点属性
	if(pSource)
		LoadShotSource(pSource,pRow->GetRowId());
}
Пример #20
0
void CActiveMemberView::OnRebilling()
{
	CIBAString str;
	str.LoadString(IDS_ENSURE_REBILLING);
	if (theApp.IBAMsgBox(str,MB_OKCANCEL|MB_ICONQUESTION)!=IDOK)
	{
		return;
	}
	
	CList <CBCGPGridItem*,CBCGPGridItem*> arrMember;
	GetGridCtrl()->GetSelectedItems(arrMember);

	if( arrMember.GetCount() > 0)
	{
		CShortMsgDlg dlg;
		int nValid = 0;

		POSITION pos = arrMember.GetHeadPosition();
		while(pos!=NULL)
		{
			const CBCGPGridItem* &pItem = arrMember.GetNext(pos);
			CBCGPGridRow *pRow = pItem->GetParentRow();


			UINT nMemberId = pRow->GetData();
			INT_PTR nIn = CLocalServer::GetInstance()->ComputerList.Find(nMemberId);
			if ( nIn!=-1 )
			{
				CActiveMember Act;
				if (CLocalServer::GetInstance()->ActiveMemberList.GetActiveMember(nMemberId,Act))
				{
					// 发送给指定客户端
					CLocalServer::GetInstance()->LocalCheckOutUser(nIn, nMemberId, 3);
					CIBALog::GetInstance()->WriteFormat(_T("客户端重新计费->PC=%s, memberId=%d"),Act.GetTerminalID(),nMemberId);

					Act.SetActivationTime(COleDateTime::GetCurrentTime());
					CLocalServer::GetInstance()->ActiveMemberList.UpdateActiveMember(Act,TRUE);
					Refresh(FALSE);
				}
				
			}


		}
	}
}
Пример #21
0
//换机
void CComputerListView::OnChangeComputer()
{	////////////////查询是否有用户////////////
	CBCGPGridRow* pRow = GetGridCtrl()->GetCurSel();

	if (pRow == NULL) return;

	INT_PTR nIndex = pRow->GetData();

	if (CLocalServer::GetInstance()->ComputerList.IsInvaildIndex(nIndex)) return;

	CComputerInfo &ComputerInfo = CLocalServer::GetInstance()->ComputerList.GetComputer(pRow->GetData());

	CNDCheckInDlg dlg;
	dlg.SetCheckIn(FALSE);
	dlg.SetNetId(ComputerInfo.GetNetId());
	dlg.DoModal();

}
/**
 * @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);
		}
	}
}
/******************************************************************************
    函    数:
    
    输    入:
    
    输    出:
  
    返 回 值:
    
    功    能: 将震源表加载到网格中

    修改历史:

*******************************************************************************/
void CActiveSourceWnd::LoadShotSources(CShotSources* pShotSrcs)
{
	if(NULL==pShotSrcs)
		return;
	CBCGPGridCtrl* pGridCtrl = GetGridCtrl();
	if(NULL==pGridCtrl)
		return;
	int nCount = pShotSrcs->GetCount();
	pGridCtrl->RemoveAll();
	CShotSource* pSrc = NULL;
	for (int nRow = 0; nRow < nCount; nRow++)
	{
		pSrc=pShotSrcs->GetShotSource(nRow);
		if(!pSrc )
			continue;
		LoadShotSource(pSrc);
	}
	pGridCtrl->AdjustLayout ();
	return;
}
Пример #24
0
LRESULT CMailView::OnOpen (WPARAM /*wParam*/, LPARAM /*lParam*/)
{
	CBCGPGridRow* pRow = GetGridCtrl ()->GetCurSel ();

	if (pRow == NULL || pRow->IsGroup ())
	{
		return 0L;
	}

	CMailFrame frame (*pRow, TRUE, this);
	if (frame.DoModal () != IDOK)
	{
		if (frame.IsDeleted ())
		{
			PostMessage (WM_COMMAND, ID_MAIL_REMOVE, 0);
		}
	}

	return 0L;
}
/**
 * @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);	
}
Пример #26
0
void CActiveMemberView::OnSendShortMessage()
{
	CList <CBCGPGridItem*,CBCGPGridItem*> arrMember;
	GetGridCtrl()->GetSelectedItems(arrMember);

	if( arrMember.GetCount() > 0)
	{
		CShortMsgDlg dlg;
		int nValid = 0;

		POSITION pos = arrMember.GetHeadPosition();
		while(pos!=NULL)
		{
			const CBCGPGridItem* &pItem = arrMember.GetNext(pos);
			CBCGPGridRow *pRow = pItem->GetParentRow();
			

			UINT nMemberId = pRow->GetData();
			INT_PTR nIn = CLocalServer::GetInstance()->ComputerList.Find(nMemberId);
			if ( nIn!=-1 )
			{
				// 发送给指定客户端
				nValid++;		
				dlg.AddReceiver( (UINT)nIn );
			}

			
		}
		dlg.SetSendType(1);
		dlg.DoModal();
	}
	else
	{
		CShortMsgDlg dlg;
		dlg.DoModal();
	}
}
Пример #27
0
void CComputerListView::OnPing()
{
	CBCGPGridRow* pRow = GetGridCtrl()->GetCurSel();

	if (pRow != NULL) 
	{
		if (!CLocalServer::GetInstance()->ComputerList.IsInvaildIndex(pRow->GetData()))
		{
			CComputerInfo ComputerInfo;

			if (GetCurComputerInfo(ComputerInfo))
			{
				if (ComputerInfo.HasUser()) //有用户则上报金额
				{
					CLocalServer::GetInstance()->LocalForceUpdateData(pRow->GetData());

					return ;
				}
			}

			CLocalServer::GetInstance()->LocalPingClient(pRow->GetData());
		}
	}
}
Пример #28
0
void CMailView::OnUpdateDelete(CCmdUI* pCmdUI)
{
	CBCGPGridRow* pRow = GetGridCtrl ()->GetCurSel ();
	pCmdUI->Enable (pRow != NULL && !pRow->IsGroup ());
}
/******************************************************************************
    函    数:
    
    输    入:
    
    输    出:
  
    返 回 值:
    
    功    能: 用户选择震源、炮号准备放炮时,将炮号的信息(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;

}
Пример #30
0
void CComputerListView::OnGetLog()
{
	CBCGPGridRow* pRow = GetGridCtrl()->GetCurSel();
	if (pRow != NULL) CLocalServer::GetInstance()->LocalGetLog(pRow->GetData());
}