Пример #1
0
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
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
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
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
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
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
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
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
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
void MyFrame::OnExposeComplete(wxThreadEvent& event)
{
    usImage *image = event.GetPayload<usImage *>();
    bool err = event.GetInt() != 0;
    OnExposeComplete(image, err);
}
Пример #12
0
void MyImageDialog::OnGUIThreadEvent(wxThreadEvent& event)
{
    m_nCurrentProgress = int(((float)event.GetInt()*100)/GUITHREAD_NUM_UPDATES);

    Refresh();
}
Пример #13
0
void CreatePatchFrame::OnFileProcessedProgressUpdate(wxThreadEvent& evt)
{
	m_progressFileProccess->SetValue(evt.GetInt());
}
Пример #14
0
void CreatePatchFrame::OnComparisonProgressUpdate(wxThreadEvent& evt)
{
	m_progressComparison->SetValue(evt.GetInt());
}
Пример #15
0
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
void ZLauncherFrame::OnEnableLaunchButton(wxThreadEvent& evt)
{
	m_btnLaunch->Enable(evt.GetInt() != 0);
}
Пример #18
0
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();
    }
}