void Dlg_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify) {

   switch (id) {
      case IDOK:
      case IDCANCEL:
         EndDialog(hwnd, id);
         break;

      case IDC_BTN_START_BATCH:
         OnStartBatch();
         break;

      case IDC_BTN_CREATE_POOL:
         OnCreatePool();
         break;

      case IDC_BTN_RUN:
         OnRun();
         break;

      case IDC_BTN_DELETE_POOL:
         OnDeletePool();
         break;
   }
}
void CCWidget::Run(){
	OnRun();

	for(int i=0; i<m_Children.GetCount(); i++){
		CCWidget* pCurWnd = m_Children.Get(i);
		pCurWnd->Run();
	}
}
Exemple #3
0
void ZBirdDummyAI::Run()
{
	if (!m_bCreated) return;

	OnRun();


}
void CBatchRunBtn::OnHotkey(UINT hkID)
{
	switch(hkID)
	{
	case HOTKEY_RUN:
		OnRun();
		break;
	}
}
Exemple #5
0
BOOL P2PConnection::OnRead()
{
	ENTER_METHOD;

	OnRun();

	LEAVE_METHOD;

	return TRUE;
}
Exemple #6
0
void ParamBox::OnFlag(wxCommandEvent& event)
{
	int id = event.GetId();
	wxString flag = flagrefs->GetRef(id);

	if((*modflags)[flag] == 0) (*modflags)[flag] = 1;
	else (*modflags)[flag] = 0;

	if(autorun) OnRun(event);
}
Exemple #7
0
    void CJob::Run()
    {
        m_RunResult = IZ_FALSE;

        {
            std::lock_guard<std::mutex> lock(m_Mutex);
            {
                if (m_IsCanceled) {
                    return;
                }
                m_State = State_Running;
            }
        }

        m_RunResult = OnRun();

        {
			std::lock_guard<std::mutex> lock(m_Mutex);
            {
                m_State = State_WillFinish;
            }
        }
    }
Exemple #8
0
void Transfers::OnTimeOut(OpTimer* timer)
{
	ENTER_METHOD;

	OnRun();

	time_t now = op_time(NULL);

	if(now > m_last_resource_check + 5)
	{
		// do resource cleanup every 5 seconds
		Clear();
		m_last_resource_check = now;
	}

	CalculateTransferRates();

	BT_RESOURCE_CHECKPOINT(FALSE);

	m_check_timer.Start(CHECK_INTERVAL_BT);

	LEAVE_METHOD;
}
Exemple #9
0
bool HeeksCADapp::InputLength(const wxChar* prompt, const wxChar* value_name, double &value)
{
	if(m_input_uses_modal_dialog)
	{
		HDialog dlg(m_frame);
		wxBoxSizer *sizerMain = new wxBoxSizer(wxVERTICAL);
		wxStaticText *static_label = new wxStaticText(&dlg, wxID_ANY, prompt);
		sizerMain->Add( static_label, 0, wxALL | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, dlg.control_border );
		CLengthCtrl* value_control = new CLengthCtrl(&dlg);
		dlg.AddLabelAndControl(sizerMain, value_name, value_control);
		sizerMain->Add( dlg.MakeOkAndCancel(wxHORIZONTAL), 0, wxALL | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, dlg.control_border );
		dlg.SetSizer( sizerMain );
		sizerMain->SetSizeHints(&dlg);
		sizerMain->Fit(&dlg);
		value_control->SetFocus();
		if(dlg.ShowModal() == wxID_OK)
		{
			value = value_control->GetValue();
			return true;
		}
		return false;
	}
	else
	{
		CInputMode* save_mode = input_mode_object;
		CLengthInput length_input(prompt, value_name, value);
		SetInputMode(&length_input);

		OnRun();

		SetInputMode(save_mode);

		if(CLengthInput::m_success)value = length_input.m_value;

		return CLengthInput::m_success;
	}
}
Exemple #10
0
// Talk to the other computer, write the output buffer to the socket and read from the socket to the input buffer
// Return true if this worked, false if we've lost the connection
BOOL CConnection::DoRun()
{
	// If this socket is invalid, call OnRun and return the result (do)
	if ( ! IsValid() )
		return OnRun();

	// Setup pEvents to store the socket's internal information about network events
	WSANETWORKEVENTS pEvents = {};
	if ( WSAEnumNetworkEvents( m_hSocket, NULL, &pEvents ) != 0 )
		return FALSE;

	// If the FD_CONNECT network event has occurred
	if ( pEvents.lNetworkEvents & FD_CONNECT )
	{
		// If there is a nonzero error code for the connect operation, this connection was dropped
		if ( pEvents.iErrorCode[ FD_CONNECT_BIT ] != 0 )
		{
			Statistics.Current.Connections.Errors++;

			OnDropped();
			return FALSE;
		}

		// The socket is now connected
		m_bConnected = TRUE;
		m_tConnected = m_mInput.tLast = m_mOutput.tLast = GetTickCount();	// Store the time 3 places

		// Call CShakeNeighbour::OnConnected to start reading the handshake
		if ( ! OnConnected() )
			return FALSE;

		Network.AcquireLocalAddress( m_hSocket );
	}

	// If the FD_CLOSE network event has occurred, set bClosed to true, otherwise set it to false
	BOOL bClosed = ( pEvents.lNetworkEvents & FD_CLOSE ) ? TRUE : FALSE;

	// If the close event happened, null a pointer within the TCP bandwidth meter for input (do)
	if ( bClosed )
		m_mInput.pLimit = NULL;

	// Change the queued run state to 1 (do)
	m_nQueuedRun = 1;

	// Write the contents of the output buffer to the remote computer, and read in data it sent us
	if ( ! OnWrite() )
		return FALSE;
	if ( ! OnRead() )
		return FALSE;

	// If the close event happened
	if ( bClosed )
	{
		// theApp.Message( MSG_DEBUG, _T("socket close() error %i"), pEvents.iErrorCode[ FD_CLOSE_BIT ] );
		// Call OnDropped, telling it true if there is a close error
		OnDropped();	// True if there is an nonzero error code for the close bit
		return FALSE;
	}

	// Make sure the handshake doesn't take too long
	if ( ! OnRun() )
		return FALSE;

	// If the queued run state is 2 and OnWrite returns false, leave here with false also
	if ( m_nQueuedRun == 2 && ! OnWrite() )
		return FALSE;

	// Change the queued run state back to 0 and report success (do)
	m_nQueuedRun = 0;
	return TRUE;
}
Exemple #11
0
void CEasyThread::Execute()
{
	while((!IsTerminate())&&(OnRun()))
	{
	}	
}
Exemple #12
0
ZTaskResult ZTask::Run(float fDelta)
{
	return OnRun(fDelta);
}
Exemple #13
0
	virtual void Run(uint32_t now) { OnRun(now); }
Exemple #14
0
void ParamBox::OnSpin(wxSpinEvent& event)
{
	if(mainwin->diagnostic) mainwin->SetStatusText("on spin");
	if(autorun) OnRun(event);
}
Exemple #15
0
void ParamBox::OnDefault(wxCommandEvent& event)
{
	ParamLoad("default");
	if(autorun) OnRun(event);
}
void MCommandCommunicator::Run()
{
	OnPrepareRun();

	while(1){
		MCommand* pCommand = GetCommandSafe();

		if(pCommand==NULL) break;

		OnPrepareCommand(pCommand);

		if ((pCommand->m_pCommandDesc->IsFlag(MCDT_PEER2PEER)==true))
		{
			if (pCommand->m_Sender != m_This)
			{
				#ifdef _CMD_PROFILE
					m_CommandProfiler.OnRecv(pCommand);
					m_CommandProfiler.OnCommandBegin(pCommand, GetGlobalTimeMS());
				#endif
				OnCommand(pCommand);

				#ifdef _CMD_PROFILE
					m_CommandProfiler.OnCommandEnd(pCommand, GetGlobalTimeMS());
				#endif
			}
			else
			{
				#ifdef _CMD_PROFILE
					m_CommandProfiler.OnSend(pCommand);
				#endif

				SendCommand(pCommand);

				#ifdef _CMD_PROFILE
					m_CommandProfiler.OnCommandBegin(pCommand, GetGlobalTimeMS());
				#endif

				OnCommand(pCommand);

				#ifdef _CMD_PROFILE
					m_CommandProfiler.OnCommandEnd(pCommand, GetGlobalTimeMS());
				#endif
			}
		}
		else if (pCommand->m_pCommandDesc->IsFlag(MCDT_LOCAL)==true || 
			    (m_This.IsValid() && pCommand->m_Receiver==m_This))
		{
			#ifdef _CMD_PROFILE
				m_CommandProfiler.OnRecv(pCommand);
				m_CommandProfiler.OnCommandBegin(pCommand, GetGlobalTimeMS());
			#endif

			OnCommand(pCommand);	// Local Command면 로컬에서 처리

			#ifdef _CMD_PROFILE
				m_CommandProfiler.OnCommandEnd(pCommand, GetGlobalTimeMS());
			#endif
		}
		else 
		{
			#ifdef _CMD_PROFILE
				m_CommandProfiler.OnSend(pCommand);
			#endif

			SendCommand(pCommand);	// 그외에는 설정된 Receiver로 전송
		}

		delete pCommand;
		pCommand = NULL;
	}

	OnRun();
}