Example #1
0
	virtual void ProcessEvent(EFlowEvent event, SActivationInfo *pActInfo)
	{
		switch (event)
		{
			case eFE_Activate:
			{
				if (IsPortActive(pActInfo, EIP_Start))
				{
					m_List.clear();
					m_ListIter = m_List.end();
					m_Iter = 0;
					m_Count = 0;

					OnIterStart(pActInfo);
					m_ListIter = m_List.begin();

					if (m_Count <= 0)
					{
						// None found
						ActivateOutput(pActInfo, EOP_Done, 0);
					}
					else
					{
						const bool bImmediate = GetPortBool(pActInfo, EIP_Immediate);
						const bool bFirstResult = SendNext(pActInfo);
						if (bImmediate && bFirstResult)
						{
							pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, true);
						}
					}
				}
				else if (IsPortActive(pActInfo, EIP_Next))
				{
					const bool bImmediate = GetPortBool(pActInfo, EIP_Immediate);
					if (!bImmediate)
					{
						SendNext(pActInfo);
					}
				}
			}
			break;

			case eFE_Update:
			{
				if (!SendNext(pActInfo))
				{
					pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, false);
				}

			}
			break;
		}
	}
void ShardMigrationWriter::OnWriteReadyness()
{
    Log_Debug("ShardMigrationWriter::OnWriteReadyness()");
    
    uint64_t bytesBegin;
    
    ASSERT(quorumProcessor != NULL);
    if (!quorumProcessor->IsPrimary()
     || !shardServer->GetConfigState()->isMigrating
     || (shardServer->GetConfigState()->isMigrating &&
         (shardServer->GetConfigState()->migrateSrcShardID != srcShardID ||
          shardServer->GetConfigState()->migrateDstShardID != dstShardID ||
          shardServer->GetConfigState()->migrateQuorumID != quorumID)))
    {
        Abort();
        return;
    }

    if (sendFirst)
    {
        sendFirst = false;
        SendFirst();
    }
    else
    {
        bytesBegin = bytesSent;

        while (bytesSent < bytesBegin + SHARD_MIGRATION_WRITER_GRAN)
        {
            if (!cursor)
                break;
            SendNext();
        }
    }
}
Example #3
0
BOOL CKeyBoardDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here

	CMenu* pSysMenu = GetSystemMenu(FALSE);
	if (pSysMenu != NULL)
	{
		//pSysMenu->DeleteMenu(SC_TASKLIST, MF_BYCOMMAND);
		pSysMenu->AppendMenu(MF_SEPARATOR);
		pSysMenu->AppendMenu(MF_STRING, IDM_ENABLE_OFFLINE, "离线记录(&O)");
		pSysMenu->AppendMenu(MF_STRING, IDM_CLEAR_RECORD, "清空记录(&C)");

		if (m_bIsOfflineRecord)
			pSysMenu->CheckMenuItem(IDM_ENABLE_OFFLINE, MF_CHECKED);
	}


	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon

	m_edit.SetLimitText(MAXDWORD); // 设置最大长度
	ResizeEdit();
	UpdateTitle();
	SendNext();
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Example #4
0
void CKeyBoardDlg::AddKeyBoardData()
{
	// 最后填上0
	m_pContext->m_DeCompressionBuffer.Write((LPBYTE)"", 1);
	int	len = m_edit.GetWindowTextLength();
	m_edit.SetSel(len, len);
	m_edit.ReplaceSel((char *)m_pContext->m_DeCompressionBuffer.GetBuffer(1));
	SendNext();
}
Example #5
0
BOOL CScreenSpyDlg::OnInitDialog()
{
	CDialog::OnInitDialog();
	SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)LoadCursor(NULL, IDC_NO));
	CMenu* pSysMenu = GetSystemMenu(FALSE);
	if (pSysMenu != NULL)
	{
		pSysMenu->AppendMenu(MF_SEPARATOR);
		pSysMenu->AppendMenu(MF_STRING, IDM_CONTROL, "控制屏幕(&Y)");
		pSysMenu->AppendMenu(MF_STRING, IDM_TRACE_CURSOR, "跟踪被控端鼠标(&T)");
		pSysMenu->AppendMenu(MF_STRING, IDM_BLOCK_INPUT, "锁定被控端鼠标和键盘(&L)");
		pSysMenu->AppendMenu(MF_STRING, IDM_SAVEDIB, "保存快照(&S)");
		pSysMenu->AppendMenu(MF_SEPARATOR);
		pSysMenu->AppendMenu(MF_STRING, IDM_GET_CLIPBOARD, "获取剪贴板(&R)");
		pSysMenu->AppendMenu(MF_STRING, IDM_SET_CLIPBOARD, "设置剪贴板(&L)");
		pSysMenu->AppendMenu(MF_SEPARATOR);
	
	}

	CString str;
	str.Format("\\\\%s %d * %d", m_IPAddress, m_lpbmi->bmiHeader.biWidth, m_lpbmi->bmiHeader.biHeight);
	SetWindowText(str);

	m_HScrollPos = 0;
	m_VScrollPos = 0;
	m_hRemoteCursor = LoadCursor(NULL, IDC_ARROW);

	ICONINFO CursorInfo;
	::GetIconInfo(m_hRemoteCursor, &CursorInfo);
	if (CursorInfo.hbmMask != NULL)
		::DeleteObject(CursorInfo.hbmMask);
	if (CursorInfo.hbmColor != NULL)
		::DeleteObject(CursorInfo.hbmColor);
	m_dwCursor_xHotspot = CursorInfo.xHotspot;
	m_dwCursor_yHotspot = CursorInfo.yHotspot;

	m_RemoteCursorPos.x = 0;
	m_RemoteCursorPos.x = 0;
	m_bIsTraceCursor = false;

	//和被控端一样的位图的图像数据
	//是我们分配好的缓冲区也就是说我们可以更改这个缓冲区里的数据来改变位图图像
	m_hDC = ::GetDC(m_hWnd);
	m_hMemDC = CreateCompatibleDC(m_hDC);
	m_hFullBitmap = CreateDIBSection(m_hDC, m_lpbmi, DIB_RGB_COLORS, &m_lpScreenDIB, NULL, NULL);   //创建应用程序可以直接写入的、与设备无关的位图
	SelectObject(m_hMemDC, m_hFullBitmap);//择一对象到指定的设备上下文环境
	
	
	
	SetScrollRange(SB_HORZ, 0, m_lpbmi->bmiHeader.biWidth);  //指定滚动条范围的最小值和最大值
	SetScrollRange(SB_VERT, 0, m_lpbmi->bmiHeader.biHeight);

	InitMMI();
	SendNext();
	return TRUE; 
}
Example #6
0
BOOL CScreenSpyDlg::OnInitDialog()
{
	CDialog::OnInitDialog();
	SetIcon(m_hIcon,FALSE);


	CString strString;
	strString.Format("\\\\%s 远程桌面控制 %d×%d", m_strClientIP, m_BitmapInfor_Full->bmiHeader.biWidth, m_BitmapInfor_Full->bmiHeader.biHeight);
	SetWindowText(strString);

	
	m_hFullDC = ::GetDC(m_hWnd);
	m_hFullMemDC = CreateCompatibleDC(m_hFullDC);
	m_BitmapHandle = CreateDIBSection(m_hFullDC, m_BitmapInfor_Full, 
		DIB_RGB_COLORS, &m_BitmapData_Full, NULL, NULL);   //创建应用程序可以直接写入的、与设备无关的位图


	SelectObject(m_hFullMemDC, m_BitmapHandle);//择一对象到指定的设备上下文环境

	

	SetScrollRange(SB_HORZ, 0, m_BitmapInfor_Full->bmiHeader.biWidth);  //指定滚动条范围的最小值和最大值
	SetScrollRange(SB_VERT, 0, m_BitmapInfor_Full->bmiHeader.biHeight);//1366  768



	CMenu* SysMenu = GetSystemMenu(FALSE);
	if (SysMenu != NULL)
	{
		SysMenu->AppendMenu(MF_SEPARATOR);
		SysMenu->AppendMenu(MF_STRING, IDM_CONTROL, "控制屏幕(&Y)");
		SysMenu->AppendMenu(MF_STRING, IDM_TRACE_CURSOR, "跟踪被控端鼠标(&T)");
		SysMenu->AppendMenu(MF_STRING, IDM_BLOCK_INPUT, "锁定被控端鼠标和键盘(&L)");
		SysMenu->AppendMenu(MF_STRING, IDM_SAVEDIB, "保存快照(&S)");
		SysMenu->AppendMenu(MF_SEPARATOR);
		SysMenu->AppendMenu(MF_STRING, IDM_GET_CLIPBOARD, "获取剪贴板(&R)");
		SysMenu->AppendMenu(MF_STRING, IDM_SET_CLIPBOARD, "设置剪贴板(&L)");
		SysMenu->AppendMenu(MF_SEPARATOR);

	}


	m_bIsCtrl = FALSE;   //不是控制
	m_bIsTraceCursor = FALSE;  //不是跟踪
	m_ClientCursorPos.x = 0;
	m_ClientCursorPos.y = 0;

	SendNext();


	return TRUE;  // return TRUE unless you set the focus to a control
	// 异常: OCX 属性页应返回 FALSE
}
Example #7
0
void CMultiXL2Link::OnWriteCompleted(CMultiXMsgStack *&SentStack, MultiXError IoError)
{
	CMultiXMsgStack *pStack	=	SentStack;
	SentStack	=	NULL;
	WritePending()	=	false;
	for(TMsgQueue::iterator	I=MsgQueue().begin();I!=MsgQueue().end();I++)
	{
		if((*I)->m_pStack	==	pStack)
		{
			CMultiXL2LinkMsgQueueEntry	*Entry	=	*I;
			MsgQueue().erase(I);
			if(!Entry->m_bSSLPrivate)
			{
				Entry->m_pStack	=	NULL;
				delete	Entry;
				CMultiXL2Event	*Event	=	new	CMultiXL2Event(CMultiXEvent::L2SendCompleted,Owner(),Owner()->UpperLayer());
				Event->L2LinkID()	=	ID();
				Event->IoError()	=	IoError;
				Event->Stack()	=	pStack;
				Owner()->MultiX().QueueEvent(Event);
			}	else
			{
				CMultiXMsgStack	*S	=	NULL;
				if(Entry->m_pRefersTo	!=	NULL)
				{
					S	=	Entry->m_pRefersTo->m_pStack;
				}
				delete	Entry;

				if(S)
				{
					OnWriteCompleted(S,IoError);
				}	else	if(IoError)
				{
					if(QueueSize()	>	0)
					{
						S	=	MsgQueue().front()->m_pStack;
						OnWriteCompleted(S,IoError);
					}
				}
			}
			break;
		}
	}

	if(IoError	==	MultiXNoError)
	{
		SendNext();
	}
}
Example #8
0
bool CMultiXL2Link::Write(CMultiXMsgStack *Stack,bool	bSSLPrivate)
{
	if(!Connected())
	{
		m_LastError	=	L2ErrLinkNotConnected;
		return	false;
	}
	MsgQueue().push_back(new	CMultiXL2LinkMsgQueueEntry(Stack,bSSLPrivate));
	Stack->Owner()	=	this;
	if(WritePending())
		return	true;

	return	SendNext();
}
Example #9
0
BOOL CWebCamDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon

	SetTimer(1, 200, NULL);

	CString str;
	str.Format("\\\\%s %d * %d", m_IPAddress, m_bmih.biWidth, m_bmih.biHeight);
	SetWindowText(str);
	// 初始化窗口大小结构
	InitMMI();
	SendNext();

	m_hDD = DrawDibOpen();
	m_hDC = GetDC()->m_hDC;

	SendNext();
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
/**
 * @brief constructs a command interpreter--a class designed to handle the step-by-step
 * logic required of the commands sent to both the simulator and the robot itself.
 * @param QString
 */
CommandInterpreter::CommandInterpreter(int width, int height)
{
	printf("CommandInterpreter loading\n");
    //painter work//
	picasso = new DrawWindow(width , height, "Painter");

    stopped = true;
	paused = false;
	finished = false;
	connect(&updateTimer, SIGNAL(timeout()), this, SLOT(SendNext()));
	projectLocation = "ProjectFiles/Temp";
    //robot work//
	prevContinuous = false;
	connected = false;
    //robot work//
}
Example #11
0
bool CMultiXL2Link::Read()
{
	if(ReadPending())
	{
		m_LastError	=	L2ErrReadPending;
		return	false;
	}
	if(!Connected())
	{
		m_LastError	=	L2ErrLinkNotConnected;
		return	false;
	}

	CMultiXL1ReadReq	L1Req(Owner(),Owner()->LowerLayer());
	L1Req.m_L1LinkID		=	m_L1LinkID;
	if(!Owner()->LowerLayer()->RequestHandler(L1Req))
	{
		m_LastError	=	Owner()->LowerLayer()->GetLastError();
		return	false;
	}
	ReadPending()	=	true;
	return	SendNext();
}
Example #12
0
BOOL CScreenSpyDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();

	// Set the icon for this dialog.  The framework does this automatically
	// when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon
	
	SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)LoadCursor(NULL, IDC_NO));
	CMenu* pSysMenu = GetSystemMenu(FALSE);
	if (pSysMenu != NULL)
	{
		pSysMenu->AppendMenu(MF_SEPARATOR);
		pSysMenu->AppendMenu(MF_STRING, IDM_CONTROL, "控制屏幕(&Y)");
		pSysMenu->AppendMenu(MF_STRING, IDM_SEND_CTRL_ALT_DEL, "发送Ctrl-Alt-Del(&K)");
		pSysMenu->AppendMenu(MF_STRING, IDM_TRACE_CURSOR, "跟踪服务端鼠标(&T)");
		pSysMenu->AppendMenu(MF_STRING, IDM_BLOCK_INPUT, "锁定服务端鼠标和键盘(&L)");
		pSysMenu->AppendMenu(MF_STRING, IDM_BLANK_SCREEN, "服务端黑屏(&B)");
		pSysMenu->AppendMenu(MF_STRING, IDM_CAPTURE_LAYER, "捕捉层(导致鼠标闪烁)(&L)");
		pSysMenu->AppendMenu(MF_STRING, IDM_SAVEDIB, "保存快照(&S)");
		pSysMenu->AppendMenu(MF_SEPARATOR);
		pSysMenu->AppendMenu(MF_STRING, IDM_GET_CLIPBOARD, "获取剪贴板(&R)");
		pSysMenu->AppendMenu(MF_STRING, IDM_SET_CLIPBOARD, "设置剪贴板(&L)");
		pSysMenu->AppendMenu(MF_SEPARATOR);
		pSysMenu->AppendMenu(MF_STRING, IDM_ALGORITHM_SCAN, "隔行扫描算法(&S)");
		pSysMenu->AppendMenu(MF_STRING, IDM_ALGORITHM_DIFF, "差异比较算法(&X)");
		pSysMenu->AppendMenu(MF_SEPARATOR);
		pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_1, "1 位黑白(&A)");
		pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_4_GRAY, "4 位灰度(&B)");
		pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_4_COLOR, "4 位彩色(&C)");
		pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_8_GRAY,  "8 位灰度(&D)");
		pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_8_COLOR, "8 位彩色(&E)");
		pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_16, "16位高彩(&F)");
		pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_32, "32位真彩(&G)");		
		
		pSysMenu->CheckMenuRadioItem(IDM_ALGORITHM_SCAN, IDM_ALGORITHM_DIFF, IDM_ALGORITHM_SCAN, MF_BYCOMMAND);
		pSysMenu->CheckMenuRadioItem(IDM_DEEP_4_GRAY, IDM_DEEP_32, IDM_DEEP_8_COLOR, MF_BYCOMMAND);
	}
	
	// TODO: Add extra initialization here
	CString str;
	str.Format("\\\\%s %d * %d", m_IPAddress, m_lpbmi->bmiHeader.biWidth, m_lpbmi->bmiHeader.biHeight);
	SetWindowText(str);

	m_HScrollPos = 0;
	m_VScrollPos = 0;
	m_hRemoteCursor = LoadCursor(NULL, IDC_ARROW);

	ICONINFO CursorInfo;
	::GetIconInfo(m_hRemoteCursor, &CursorInfo);
	if (CursorInfo.hbmMask != NULL)
		::DeleteObject(CursorInfo.hbmMask);
	if (CursorInfo.hbmColor != NULL)
		::DeleteObject(CursorInfo.hbmColor);
	m_dwCursor_xHotspot = CursorInfo.xHotspot;
	m_dwCursor_yHotspot = CursorInfo.yHotspot;

	m_RemoteCursorPos.x = 0;
	m_RemoteCursorPos.x = 0;
	m_bIsTraceCursor = false;

	// 初始化窗口大小结构
	m_hDC = ::GetDC(m_hWnd);
	m_hMemDC = CreateCompatibleDC(m_hDC);
	m_hFullBitmap = CreateDIBSection(m_hDC, m_lpbmi, DIB_RGB_COLORS, &m_lpScreenDIB, NULL, NULL);
	SelectObject(m_hMemDC, m_hFullBitmap);
	SetScrollRange(SB_HORZ, 0, m_lpbmi->bmiHeader.biWidth);  
	SetScrollRange(SB_VERT, 0, m_lpbmi->bmiHeader.biHeight);

	InitMMI();
	SendNext();
	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
Example #13
0
int CAsyncSocketExLayer::Send(const void* lpBuf, int nBufLen, int nFlags /*=0*/)
{
  int Result = SendNext(lpBuf, nBufLen, nFlags);
  return Result;
}
int CAsyncSocketExLayer::Send(const void* lpBuf, int nBufLen, int nFlags /*=0*/)
{
	return SendNext(lpBuf, nBufLen, nFlags);
}