コード例 #1
0
ファイル: DStarRepeaterApp.cpp プロジェクト: dg0tm/OpenDV
void CDStarRepeaterApp::OnRemoteCmd(wxThreadEvent& event)
{
	wxLogMessage("Request to execute command %s (%d)",
		m_commandLine[event.GetInt()], event.GetInt());
	// XXX sanity check the command line here.
	wxShell(m_commandLine[event.GetInt()]);
}
コード例 #2
0
ファイル: mainapp.cpp プロジェクト: Sonderstorch/c-mon
void CMainApp::OnResolverResponse(wxThreadEvent& event)
{
  unsigned key = event.GetInt();
  unsigned data = event.GetExtraLong();
  CContact c = event.GetPayload<CContact>();
  CJournalEntry *pE = findActiveEntry(key);
  if (pE != NULL) {
    if (data == RESOLVE_CALLER) {
      pE->setCallerName(c.getSN());
      if (pE->getType() == CJournalEntry::J_INCOMING) {
        pE->setImage(c.getImage());
      }
    } else if (data == RESOLVE_CALLED) {
      pE->setCalledName(c.getSN());
      if (pE->getType() == CJournalEntry::J_OUTGOING) {
        pE->setImage(c.getImage());
      }
    }
    m_pJournalModel->insertUpdateEntry(*pE);
  }
  else {
    CJournalEntry e;
    if (findJournalEntry(key, e)) {
      if (data == RESOLVE_CALLER) e.setCallerName(c.getSN());
      if (data == RESOLVE_CALLED) e.setCalledName(c.getSN());
      m_pJournalModel->insertUpdateEntry(e);
    }
  }
}
コード例 #3
0
ファイル: myframe_events.cpp プロジェクト: xeqtr1982/phd2
void MyFrame::OnMoveComplete(wxThreadEvent& event)
{
    try
    {
        Mount *pThisMount = event.GetPayload<Mount *>();
        assert(pThisMount->IsBusy());
        pThisMount->DecrementRequestCount();

        Mount::MOVE_RESULT moveResult = static_cast<Mount::MOVE_RESULT>(event.GetInt());

        pMount->LogGuideStepInfo();

        if (moveResult != Mount::MOVE_OK)
        {
            if (moveResult == Mount::MOVE_STOP_GUIDING)
            {
                Debug.Write("mount move error indicates guiding should stop\n");
                pGuider->StopGuiding();
            }

            throw ERROR_INFO("Error reported moving");
        }
    }
    catch (wxString Msg)
    {
        POSSIBLY_UNUSED(Msg);
    }
}
コード例 #4
0
ファイル: mainapp.cpp プロジェクト: Sonderstorch/c-mon
void CMainApp::OnNewCall(wxThreadEvent& event)
{
  unsigned pid = event.GetInt();
  TEventInfoNewCall info = event.GetPayload<TEventInfoNewCall>();
  CJournalEntry *pCall = new CJournalEntry(pid, info.cid, CallType2JournalType(info.type));
  pCall->setState(CallState2JournalState(info.status));
  m_pJournalModel->insertUpdateEntry(*pCall);
  m_ActiveCalls.insert(std::make_pair(TJournalKey(pid, info.cid), pCall));
  displayNotification(*pCall);
}
コード例 #5
0
ファイル: MainFrame.cpp プロジェクト: pinetum/Ann545
void MainFrame::OnRBFUpdatePg(wxThreadEvent& evt)
{
    int iteration = evt.GetInt() + 1 ;
    int total = m_RBF->m_nTotalIteration;
    
    m_gaugePg->SetValue(100*iteration/total);
    m_staticTextPg->SetLabel(wxString::Format("%d/%d", iteration, total));
    m_staticTextTimer->SetLabel(getTimer());

    
    
}
コード例 #6
0
void PMBUSQUERYProgressDialog::OnQUERYSequenceEnd(wxThreadEvent& event){
	PSU_DEBUG_PRINT(MSG_DEBUG, "OnQUERYSequenceEnd");

	int HasError = event.GetInt();

	if (HasError == 1){
		PSU_DEBUG_PRINT(MSG_ERROR, "Query Commands Failed ! Please Check PSU Device Status !");
	}

	// Close Dialog
	this->EndModal(wxID_OK);
}
コード例 #7
0
ファイル: mainapp.cpp プロジェクト: Sonderstorch/c-mon
void CMainApp::OnCallStateUpdate(wxThreadEvent& event)
{
  unsigned pid = event.GetInt();
  TEventInfoCallStatus info = event.GetPayload<TEventInfoCallStatus>();
  TJournalMap::iterator it = m_ActiveCalls.find(TJournalKey(pid, info.cid));
  if (it != m_ActiveCalls.end()) {
    if (info.status == TCALL_IDLE) {
      delete (it->second);
      m_ActiveCalls.erase(it);
    } else {
      it->second->setState(CallState2JournalState(info.status));
      m_pJournalModel->insertUpdateEntry(*(it->second));
    }
  }
}
コード例 #8
0
ファイル: myframe_events.cpp プロジェクト: agalasso/phd2_qhy
void MyFrame::OnMoveComplete(wxThreadEvent& event)
{
    try
    {
        Mount *mount = event.GetPayload<Mount *>();
        assert(mount->IsBusy());
        mount->DecrementRequestCount();

        Mount::MOVE_RESULT moveResult = static_cast<Mount::MOVE_RESULT>(event.GetInt());

        mount->LogGuideStepInfo();

        // deliver the outstanding GuidingStopped notification if this is a late-arriving
        // move completion event
        if (!pGuider->IsCalibratingOrGuiding() &&
            (!pMount || !pMount->IsBusy()) &&
            (!pSecondaryMount || !pSecondaryMount->IsBusy()))
        {
            pFrame->NotifyGuidingStopped();
        }

        if (moveResult != Mount::MOVE_OK)
        {
            mount->IncrementErrorCount();

            if (moveResult == Mount::MOVE_STOP_GUIDING)
            {
                Debug.Write("mount move error indicates guiding should stop\n");
                pGuider->StopGuiding();
            }

            throw ERROR_INFO("Error reported moving");
        }
    }
    catch (const wxString& Msg)
    {
        POSSIBLY_UNUSED(Msg);
    }
}
コード例 #9
0
ファイル: thread.cpp プロジェクト: ruifig/nutcracker
void MyFrame::OnWorkerEvent(wxThreadEvent& event)
{
    int n = event.GetInt();
    if ( n == -1 )
    {
        m_dlgProgress->Destroy();
        m_dlgProgress = (wxProgressDialog *)NULL;

        // the dialog is aborted because the event came from another thread, so
        // we may need to wake up the main event loop for the dialog to be
        // really closed
        wxWakeUpIdle();
    }
    else
    {
        if ( !m_dlgProgress->Update(n) )
        {
            wxCriticalSectionLocker lock(m_csCancelled);

            m_cancelled = true;
        }
    }
}
コード例 #10
0
ファイル: mainapp.cpp プロジェクト: Sonderstorch/c-mon
void CMainApp::OnCallInfoUpdate(wxThreadEvent& event)
{
  unsigned pid = event.GetInt();
  TEventInfoCallInfo info = event.GetPayload<TEventInfoCallInfo>();
  TJournalMap::iterator it = m_ActiveCalls.find(TJournalKey(pid, info.cid));
  if (it != m_ActiveCalls.end())
  {
    CJournalEntry *pJ = it->second;
    if (pJ->getCalledName().IsEmpty()) {
      pJ->setCalledName(info.info.m_strCalledName);
    }
    if (pJ->getCallerName().IsEmpty()) {
      pJ->setCallerName(info.info.m_strCallerName);
    }
    if (pJ->getCalledAddress().IsEmpty() && !info.info.m_strCalledAddress.empty()) {
      ResolveCalled(info.info.m_strCalledAddress, pJ);
    }
    if (pJ->getCallerAddress().IsEmpty() && !info.info.m_strCallerAddress.empty()) {
      ResolveCaller(info.info.m_strCallerAddress, pJ);
    }
    m_pJournalModel->insertUpdateEntry(*pJ);
  }
}
コード例 #11
0
ファイル: myframe_events.cpp プロジェクト: xeqtr1982/phd2
void MyFrame::OnExposeComplete(wxThreadEvent& event)
{
    usImage *image = event.GetPayload<usImage *>();
    bool err = event.GetInt() != 0;
    OnExposeComplete(image, err);
}
コード例 #12
0
ファイル: thread.cpp プロジェクト: ruifig/nutcracker
void MyImageDialog::OnGUIThreadEvent(wxThreadEvent& event)
{
    m_nCurrentProgress = int(((float)event.GetInt()*100)/GUITHREAD_NUM_UPDATES);

    Refresh();
}
コード例 #13
0
ファイル: CreatePatchFrame.cpp プロジェクト: gOreteQ/ZPatcher
void CreatePatchFrame::OnFileProcessedProgressUpdate(wxThreadEvent& evt)
{
	m_progressFileProccess->SetValue(evt.GetInt());
}
コード例 #14
0
ファイル: CreatePatchFrame.cpp プロジェクト: gOreteQ/ZPatcher
void CreatePatchFrame::OnComparisonProgressUpdate(wxThreadEvent& evt)
{
	m_progressComparison->SetValue(evt.GetInt());
}
コード例 #15
0
ファイル: ZLauncherFrame.cpp プロジェクト: TheZoc/ZPatcher
void ZLauncherFrame::OnProgressBarUpdate(wxThreadEvent& evt)
{
	m_progress->SetValue(evt.GetInt());
}
コード例 #16
0
void PMBUSQUERYProgressDialog::OnQUERYSequenceUpdate(wxThreadEvent& event){
	PSU_DEBUG_PRINT(MSG_DEBUG, "OnQUERYSequenceUpdate : %d", event.GetInt());

	this->m_infoST->SetLabel(wxString::Format("%3d/%3d", event.GetInt()+1, PMBUSHelper::GetCurrentCMDTableSize()));

}
コード例 #17
0
ファイル: ZLauncherFrame.cpp プロジェクト: TheZoc/ZPatcher
void ZLauncherFrame::OnEnableLaunchButton(wxThreadEvent& evt)
{
	m_btnLaunch->Enable(evt.GetInt() != 0);
}
コード例 #18
0
ファイル: CMakeHelpTab.cpp プロジェクト: 292388900/codelite
void CMakeHelpTab::OnThreadUpdate(wxThreadEvent& event)
{
    // Notify about update
    m_gaugeLoad->SetValue(event.GetInt());
    m_gaugeLoad->Update();
}
コード例 #19
0
/*
 * OnExposeComplete is the dispatch routine that is called when an image has been taken
 * by the background thread.
 *
 * It:
 * - causes the image to be redrawn by calling pGuider->UpateImageDisplay()
 * - calls the routine to update the guider state (which may do nothing)
 * - calls any other appropriate state update routine depending upon the current state
 * - updates button state based on appropriate state variables
 * - schedules another exposure if CaptureActive is stil true
 *
 */
void MyFrame::OnExposeComplete(wxThreadEvent& event)
{
    try
    {
        Debug.AddLine("Processing an image");

        m_exposurePending = false;

        usImage *pNewFrame = event.GetPayload<usImage *>();

        if (pGuider->GetPauseType() == PAUSE_FULL)
        {
            delete pNewFrame;
            Debug.AddLine("guider is paused, ignoring frame, not scheduling exposure");
            return;
        }

        if (event.GetInt())
        {
            delete pNewFrame;

            StopCapturing();
            if (pGuider->IsCalibratingOrGuiding())
            {
                pGuider->StopGuiding();
                pGuider->UpdateImageDisplay();
            }
            pGuider->Reset(false);
            CaptureActive = m_continueCapturing;
            UpdateButtonsStatus();
            PhdController::AbortController("Error reported capturing image");
            SetStatusText(_("Stopped."));

            Debug.Write("OnExposeComplete(): Capture Error reported\n");

            // some camera drivers disconnect the camera on error
            if (!pCamera->Connected)
                SetStatusText(wxEmptyString, 2);

            throw ERROR_INFO("Error reported capturing image");
        }
        ++m_frameCounter;

        if (m_rawImageMode && !m_rawImageModeWarningDone)
        {
            WarnRawImageMode();
            m_rawImageModeWarningDone = true;
        }

        pGuider->UpdateGuideState(pNewFrame, !m_continueCapturing);
        pNewFrame = NULL; // the guider owns it now

        PhdController::UpdateControllerState();

        Debug.AddLine(wxString::Format("OnExposeCompete: CaptureActive=%d m_continueCapturing=%d",
            CaptureActive, m_continueCapturing));

        CaptureActive = m_continueCapturing;

        if (CaptureActive)
        {
            ScheduleExposure();
        }
        else
        {
            FinishStop();
        }
    }
    catch (wxString Msg)
    {
        POSSIBLY_UNUSED(Msg);
        UpdateButtonsStatus();
    }
}