void CLocalTreeView::OnVolumesEnumerated(wxCommandEvent& event) { if (!m_pVolumeEnumeratorThread) return; std::list<CVolumeDescriptionEnumeratorThread::t_VolumeInfo> volumeInfo; volumeInfo = m_pVolumeEnumeratorThread->GetVolumes(); if (event.GetEventType() == fzEVT_VOLUMESENUMERATED) { delete m_pVolumeEnumeratorThread; m_pVolumeEnumeratorThread = 0; } for (std::list<CVolumeDescriptionEnumeratorThread::t_VolumeInfo>::const_iterator iter = volumeInfo.begin(); iter != volumeInfo.end(); iter++) { wxString drive = iter->volume; wxTreeItemIdValue tmp; wxTreeItemId item = GetFirstChild(m_drives, tmp); while (item) { wxString name = GetItemText(item); if (name == drive || name.Left(drive.Len() + 1) == drive + _T(" ")) { SetItemText(item, drive + _T(" (") + iter->volumeName + _T(")")); break; } item = GetNextChild(m_drives, tmp); } } }
void SliderBar::on_text_event (wxCommandEvent &ev) { if (ev.GetEventType() == wxEVT_COMMAND_TEXT_ENTER) { // commit change bool good = false; bool neginf = false; double newval = 0.0; if (_scale_mode == ZeroGainMode && _text_ctrl->GetValue().Strip(wxString::both) == wxT("-inf")) { newval = 0.0; good = neginf = true; } else if (_text_ctrl->GetValue().ToDouble(&newval)) { good = true; } if (good) { if (_scale_mode == ZeroGainMode && !neginf) { newval = DB_CO(newval); } set_value ((float) newval); value_changed (get_value()); // emit } hide_text_ctrl(); } }
int ctlComboBox::GuessSelection(wxCommandEvent &ev) { if (ev.GetEventType() != wxEVT_COMMAND_TEXT_UPDATED) return GetGuessedSelection(); wxString str=wxComboBox::GetValue(); if (str.Length()) { long pos=GetInsertionPoint(); long sel, count=GetCount(); int len=str.Length(); for (sel = 0 ; sel < count ; sel++) { if (str == GetString(sel).Left(len)) { SetSelection(sel); wxString current = GetString(sel); SetSelection(pos, current.Length()); return sel; } } } return -1; }
void RelationshipWindow::OnTextUpdated( wxCommandEvent& event ) { if ( event.GetEventType() == wxEVT_COMMAND_TEXT_UPDATED ) { DoSearchUser(event.GetString()); } }
void CDlgAddUser::OnTextUpdated( wxCommandEvent& event ) { if ( event.GetEventType() == wxEVT_COMMAND_TEXT_UPDATED ) { loadContacts(event.GetString()); } }
void GlobalEventManager::Send(wxCommandEvent event) { if (m_eventsDisabled) { return; } std::list<wxEvtHandler*>& evtlist = m_eventsTable[event.GetEventType()]; // assert(event.GetString() == wxEmptyString); // using strings here isn't thread safe http://docs.wxwidgets.org/trunk/classwx_evt_handler.html#a0737c6d2cbcd5ded4b1ecdd53ed0def3 for (auto evt : evtlist) { evt->AddPendingEvent(event); } if (event.GetEventType() == GlobalEventManager::OnQuit) { m_eventsDisabled = true; } }
void GlobalEvent::Send(wxCommandEvent event) { if (disabled) { return; } std::list<wxEvtHandler*>& evtlist = evts[event.GetEventType()]; // printf("AddPendingEvent %lu %lu\n", evts.size(), evtlist.size()); assert(event.GetString() == wxEmptyString); // using strings here isn't thread safe http://docs.wxwidgets.org/trunk/classwx_evt_handler.html#a0737c6d2cbcd5ded4b1ecdd53ed0def3 for(auto evt: evtlist) { // printf(" AddPendingEvent %lu \n", evt); evt->AddPendingEvent(event); } if (event.GetEventType() == GlobalEvent::OnQuit) { disabled = true; } }
void PlayerSelectionDialog::SelectCallback(wxCommandEvent& event) { if (event.GetEventType() == wxEVT_LISTBOX) { // if (event.IsSelection()) m_textField->SetValue(event.GetString()); } }
void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event ) { int* clientData; int eventId = ID_POPUP_GRID_LEVEL_100; if( event.GetEventType() == wxEVT_CHOICE ) { if( m_gridSelectBox == NULL ) // Should not happen return; /* * Don't use wxCommandEvent::GetClientData() here. It always * returns NULL in GTK. This solution is not as elegant but * it works. */ int index = m_gridSelectBox->GetSelection(); wxASSERT( index != wxNOT_FOUND ); // GerbView does not support custom grid if( m_Ident != FRAME_GERBER ) { if( index == int( m_gridSelectBox->GetCount() - 2 ) ) { // this is the separator wxUpdateUIEvent dummy; OnUpdateSelectGrid( dummy ); return; } else if( index == int( m_gridSelectBox->GetCount() - 1 ) ) { wxUpdateUIEvent dummy; OnUpdateSelectGrid( dummy ); wxCommandEvent dummy2; OnGridSettings( dummy2 ); return; } } clientData = (int*) m_gridSelectBox->wxItemContainer::GetClientData( index ); if( clientData != NULL ) eventId = *clientData; } else { eventId = event.GetId(); } int idx = eventId - ID_POPUP_GRID_LEVEL_1000; // Notify GAL TOOL_MANAGER* mgr = GetToolManager(); if( mgr ) mgr->RunAction( "common.Control.gridPreset", true, idx ); m_canvas->Refresh(); }
void GlobalEvent::Send(wxCommandEvent event) { std::list<wxEvtHandler*>& evtlist = evts[event.GetEventType()]; // printf("AddPendingEvent %lu %lu\n", evts.size(), evtlist.size()); for(auto evt: evtlist) { // printf(" AddPendingEvent %lu \n", evt); evt->AddPendingEvent(event); } }
//------------------------------------------------------------------------------ void MainPanel::OnListOrFileModified(wxCommandEvent& event) { if(event.GetEventType() == wxEVT_COMMAND_LISTBOX_SELECTED && !event.IsSelection()) // Prevent segmentation fault : list box deselection send event when the frame is destroying an half the objects are deleted { return; } m_btInstall->Enable(IsInstallOk()); }
void PHPCodeCompletion::OnRetagWorkspace(wxCommandEvent& event) { event.Skip(); if(PHPWorkspace::Get()->IsOpen()) { event.Skip(false); // Reparse the workspace PHPWorkspace::Get()->ParseWorkspace(event.GetEventType() == wxEVT_CMD_RETAG_WORKSPACE_FULL); } }
// may be removed void MutApp::PassEventToDocManagerCMD(wxCommandEvent& event) { DEBUGLOG(eventqueue,_T("Command %p, id=%d, type=%d"), static_cast<void *>(&event), event.GetId(), (int)event.GetEventType() ); if (!(document_manager->ProcessEvent(event))) event.Skip(); }
void SystemTray::OnSysTrayMenuItem(wxCommandEvent& evt) { EventHandlerDisabler ehd(this); const int id = evt.GetId(); if (IsRUECommand(id)) { RUEOperation opn = GetRUEOperation(id); if (opn == RUE_DELETERUEENTRY) { m_frame->DeleteRUEntry(GetRUEIndex(id)); } else { wxCommandEvent cmd(evt.GetEventType(), GetFrameCommandId(opn)); cmd.SetExtraLong(id); #if wxCHECK_VERSION(2,9,0) m_frame->GetEventHandler()->ProcessEvent(cmd); #else m_frame->ProcessEvent(cmd); #endif } } else { switch(id) { case ID_SYSTRAY_RESTORE: m_frame->UnlockSafe(true); // true => restore UI break; case ID_SYSTRAY_LOCK: m_frame->HideUI(true); break; case ID_SYSTRAY_UNLOCK: m_frame->UnlockSafe(false); // false => don't restore UI break; case ID_SYSTRAY_CLEAR_RUE: m_frame->ClearRUEList(); break; case wxID_EXIT: case ID_CLEARCLIPBOARD: case wxID_ABOUT: case wxID_CLOSE: m_frame->GetEventHandler()->ProcessEvent(evt); break; case wxID_ICONIZE_FRAME: m_frame->Iconize(); break; default: break; } } }
/* GfxConvDialog::sliderAlphaThresholdChanged * Called when the alpha threshold slider is changed *******************************************************************/ void GfxConvDialog::onAlphaThresholdChanged(wxCommandEvent& e) { // Ignore while slider is being dragged if (e.GetEventType() == wxEVT_SCROLL_THUMBTRACK) { e.Skip(); return; } updatePreviewGfx(); }
void MyFrame::OnComboBoxUpdate( wxCommandEvent& event ) { // Don't show messages for the log output window (it'll crash) if ( !event.GetEventObject()->IsKindOf(CLASSINFO(wxComboCtrl)) ) return; if ( event.GetEventType() == wxEVT_COMBOBOX ) { wxLogDebug(wxT("EVT_COMBOBOX(id=%i,selection=%i)"),event.GetId(),event.GetSelection()); } else if ( event.GetEventType() == wxEVT_TEXT ) { wxLogDebug(wxT("EVT_TEXT(id=%i,string=\"%s\")"),event.GetId(),event.GetString().c_str()); } else if ( event.GetEventType() == wxEVT_TEXT_ENTER ) { wxLogDebug("EVT_TEXT_ENTER(id=%i,string=\"%s\")", event.GetId(), event.GetString().c_str()); } }
void bloopFrame::OnbuttonRUNClick(wxCommandEvent& event) { if( runningThread ) { delete runningThread; runningThread = NULL; //return; } clear_output(); print("OnbuttonRUNClick: " + fstring("%d, %d", event.GetEventType(), event.GetSelection())); Notebook1->ChangeSelection(3); std::string cmmd = ""; if(checklistRunTimeOptions->IsChecked(0)) cmmd += " -debug"; if(checklistRunTimeOptions->IsChecked(1)) cmmd += " -wireframe"; if(checklistRunTimeOptions->IsChecked(2)) cmmd += " -boundingbox"; if(checklistRunTimeOptions->IsChecked(3)) cmmd += " -collisions"; if(checklistRunTimeOptions->IsChecked(4)) cmmd += " -version"; if(checklistRunTimeOptions->IsChecked(5)) cmmd += " -help"; if(checklistRunTimeOptions->IsChecked(6)) cmmd += " -trails"; if(checklistRunTimeOptions->IsChecked(7)) cmmd += " -dnrm"; if(checklistRunTimeOptions->IsChecked(8)) cmmd += " -usedirdata -dir " + str(textPathDir->GetValue()); if(checklistRunTimeOptions->IsChecked(9)) cmmd += " " + str(textOtherRunTimeOptions->GetValue()); if(!checklistRunTimeOptions->IsChecked(8)) cmmd += " -f " + str(textPathToGameFile->GetValue()) + str(textFileToSaveTo->GetValue()); std::string libpaths = "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"+str(textPathToPylonDLL->GetValue())+":/usr/lib:/usr/lib/python2.7"; cmmd = libpaths + " " + str(textPathToPylonExe->GetValue()) + cmmd; if( !runningThread ) { print("Executing Pylon with the Command:"); print("<font color='#FF8844'>" + cmmd + "</font>"); runningThread = new RunThread(cmmd); } }
void ThreadSearch::OnCboSearchExprEnter(wxCommandEvent &event) { if ( !IsAttached() ) return; // Event handler used when user clicks on enter after typing // in combo box text control. // Runs a multi threaded search with combo text const long id = controlIDs.Get(ControlIDs::idCboSearchExpr); wxComboBox* pCboBox = static_cast<wxComboBox*>(m_pToolbar->FindControl(id)); wxASSERT(pCboBox != NULL); if ( event.GetEventType() == wxEVT_COMMAND_TEXT_ENTER ) RunThreadSearch(pCboBox->GetValue()); }
void DisassemblyDialog::onDebuggerEvent(wxCommandEvent& evt) { wxEventType type = evt.GetEventType(); if (type == debEVT_SETSTATUSBARTEXT) { CtrlDisassemblyView* view = reinterpret_cast<CtrlDisassemblyView*>(evt.GetEventObject()); if (view != NULL && view == currentCpu->getDisassembly()) GetStatusBar()->SetLabel(evt.GetString()); } else if (type == debEVT_UPDATELAYOUT) { if (currentCpu != NULL) currentCpu->GetSizer()->Layout(); topSizer->Layout(); update(); } else if (type == debEVT_GOTOINMEMORYVIEW) { if (currentCpu != NULL) { currentCpu->showMemoryView(); currentCpu->getMemoryView()->gotoAddress(evt.GetInt()); currentCpu->getDisassembly()->SetFocus(); } } else if (type == debEVT_RUNTOPOS) { // todo: breakpoints for iop if (currentCpu != eeTab) return; CBreakPoints::AddBreakPoint(evt.GetInt(),true); currentCpu->getCpu()->resumeCpu(); } else if (type == debEVT_GOTOINDISASM) { if (currentCpu != NULL) { currentCpu->getDisassembly()->gotoAddress(r5900Debug.getPC()); currentCpu->getDisassembly()->SetFocus(); update(); } } else if (type == debEVT_STEPOVER) { if (currentCpu != NULL) stepOver(); } else if (type == debEVT_STEPINTO) { if (currentCpu != NULL) stepInto(); } else if (type == debEVT_UPDATE) { update(); } }
void DTSAPPToolBar::HandleEvent(wxCommandEvent& event) { int etype = event.GetEventType(), idx; struct xml_node *xn; idx = server->GetSelection(); if (etype == wxEVT_TEXT_ENTER) { DTS_C_API::dtsgui_alert(dtsgui, "Got Me Some URL ARRRRGh"); } else if (etype == wxEVT_COMBOBOX) { xn = (struct xml_node*)server->GetClientData(idx); DTS_C_API::dtsgui_alert(dtsgui, wxString("Selected IP ").Append(xml_getattr(xn, "ipaddr"))); } else if ((etype == wxEVT_COMBOBOX_DROPDOWN) && !server->HasXMLList()) { DTS_C_API::dtsgui_alert(dtsgui, "Please enter 3 or more characters to search !"); } }
void PHPCodeCompletion::OnRetagWorkspace(wxCommandEvent& event) { event.Skip(); if(PHPWorkspace::Get()->IsOpen()) { event.Skip(false); bool isFull = (event.GetEventType() == wxEVT_CMD_RETAG_WORKSPACE_FULL); if(isFull) { // Delete the file m_lookupTable.ResetDatabase(); } // Reparse the workspace PHPWorkspace::Get()->ParseWorkspace(isFull); } }
void SpectralSelectionBar::OnUpdate(wxCommandEvent &evt) { int index = evt.GetInt(); wxWindow *w = FindFocus(); bool centerFocus = (w && w == mCenterCtrl); bool widthFocus = (w && w == mWidthCtrl); bool lowFocus = (w && w == mLowCtrl); bool highFocus = (w && w == mHighCtrl); evt.Skip(false); // Save formats before recreating the controls so they resize properly wxEventType type = evt.GetEventType(); if (type == EVT_FREQUENCYTEXTCTRL_UPDATED) { NumericTextCtrl *frequencyCtrl = (mbCenterAndWidth ? mCenterCtrl : mLowCtrl); wxString frequencyFormatName = frequencyCtrl->GetBuiltinName(index); mListener->SSBL_SetFrequencySelectionFormatName(frequencyFormatName); } else if (mbCenterAndWidth && type == EVT_BANDWIDTHTEXTCTRL_UPDATED) { wxString bandwidthFormatName = mWidthCtrl->GetBuiltinName(index); mListener->SSBL_SetBandwidthSelectionFormatName(bandwidthFormatName); } // ToolBar::ReCreateButtons() will get rid of our sizers and controls // so reset pointers first. mCenterCtrl = mWidthCtrl = NULL; mLowCtrl = mHighCtrl = NULL; ToolBar::ReCreateButtons(); ValuesToControls(); if (centerFocus) { mCenterCtrl->SetFocus(); } else if (widthFocus) { mWidthCtrl->SetFocus(); } else if (lowFocus) { mLowCtrl->SetFocus(); } else if (highFocus) { mHighCtrl->SetFocus(); } Updated(); }
void MapDialog::OnListBox(wxCommandEvent& evt) { if (evt.GetInt() < 0) m_Filename = wxEmptyString; else m_Filename = evt.GetString(); wxDynamicCast(FindWindow(ID_MapDialogFilename), wxTextCtrl)->ChangeValue(m_Filename); if (evt.GetEventType() == wxEVT_COMMAND_LISTBOX_DOUBLECLICKED) { if (m_Type == MAPDIALOG_OPEN) OpenFile(); else SaveFile(); } }
void ddTableNameDialog::OnEnterPressed( wxCommandEvent& event ) { if (event.GetEventType() == wxEVT_COMMAND_TEXT_ENTER) { if ( Validate() && TransferDataFromWindow() ) { if ( IsModal() ) EndModal(wxID_OK); // If modal else { SetReturnCode(wxID_OK); this->Show(false); // If modeless } } } }
void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event ) { int* clientData; int eventId = ID_POPUP_GRID_LEVEL_100; if( event.GetEventType() == wxEVT_CHOICE ) { if( m_gridSelectBox == NULL ) // Should not happen return; /* * Don't use wxCommandEvent::GetClientData() here. It always * returns NULL in GTK. This solution is not as elegant but * it works. */ int index = m_gridSelectBox->GetSelection(); wxASSERT( index != wxNOT_FOUND ); clientData = (int*) m_gridSelectBox->wxItemContainer::GetClientData( index ); if( clientData != NULL ) eventId = *clientData; } else { eventId = event.GetId(); } int idx = eventId - ID_POPUP_GRID_LEVEL_1000; // Notify GAL TOOL_MANAGER* mgr = GetToolManager(); if( mgr && IsGalCanvasActive() ) { mgr->RunAction( "common.Control.gridPreset", true, idx ); } else SetPresetGrid( idx ); m_canvas->Refresh(); }
void dlgDatabase::OnConnLimitChange(wxCommandEvent &ev) { if (ev.GetEventType() == wxEVT_COMMAND_TEXT_UPDATED) { wxString strConnLimit = txtConnLimit->GetValue(); long val = 0; if (strConnLimit.ToLong(&val)) { CheckChange(); } else if (strConnLimit.Contains(wxT("."))) { double val; // Stop Propagation of the event to the parents ev.StopPropagation(); if (strConnLimit.ToDouble(&val)) { strConnLimit.Printf(wxT("%ld"), (long)val); txtConnLimit->SetValue(strConnLimit); txtConnLimit->SetInsertionPointEnd(); return; } } else if (strConnLimit.length() > 9) { // Maximum value support is 2147483647 wxString newVal = strConnLimit.substr(0, 10); if (!newVal.ToLong(&val)) { newVal = strConnLimit.substr(0, 9); } ev.StopPropagation(); txtConnLimit->SetValue(newVal); txtConnLimit->SetInsertionPointEnd(); return; } } }
void CLocalListView::OnVolumesEnumerated(wxCommandEvent& event) { if (!m_pVolumeEnumeratorThread) return; std::list<CVolumeDescriptionEnumeratorThread::t_VolumeInfo> volumeInfo; volumeInfo = m_pVolumeEnumeratorThread->GetVolumes(); if (event.GetEventType() == fzEVT_VOLUMESENUMERATED) { delete m_pVolumeEnumeratorThread; m_pVolumeEnumeratorThread = 0; } if (m_dir != _T("\\")) return; for (std::list<CVolumeDescriptionEnumeratorThread::t_VolumeInfo>::const_iterator iter = volumeInfo.begin(); iter != volumeInfo.end(); ++iter) { wxString drive = iter->volume; unsigned int item, index; for (item = 1; item < m_indexMapping.size(); ++item) { index = m_indexMapping[item]; if (m_fileData[index].name == drive || m_fileData[index].name.Left(drive.Len() + 1) == drive + _T(" ")) break; } if (item >= m_indexMapping.size()) continue; m_fileData[index].label = drive + _T(" (") + iter->volumeName + _T(")"); RefreshItem(item); } }
void CslDlgAddMaster::OnCommandEvent(wxCommandEvent& event) { switch (event.GetId()) { case CHOICE_CTRL_MASTERTYPE: { bool path=(wxInt32)(long)choice_mastertype->GetClientData(choice_mastertype->GetSelection()) == CslMasterConnection::CONNECTION_HTTP; text_ctrl_path->Enable(path); button_add->Enable(IsValid()); break; } case CHOICE_CTRL_GAMETYPE: case TEXT_CTRL_ADDRESS: case TEXT_CTRL_PATH: if (event.GetEventType()==wxEVT_COMMAND_TEXT_UPDATED) { button_add->Enable(IsValid()); break; } else if (event.GetEventType()!=wxEVT_COMMAND_TEXT_ENTER) break; case wxID_ADD: { // check again for empty host, since setting a default button on wxMAC // and hitting enter reaches this position, also if the the button was disabled if (!IsValid()) break; wxInt32 gameID=(wxInt32)(long)choice_gametype->GetClientData(choice_gametype->GetSelection()); wxInt32 type=(wxInt32)(long)choice_mastertype->GetClientData(choice_mastertype->GetSelection()); CslGame *game=NULL; vector<CslGame*>& games=::wxGetApp().GetCslEngine()->GetGames(); loopv(games) { if (games[i]->GetId()==gameID) { game=games[i]; *m_gameID=i; break; } } if (!game) { EndModal(wxID_CANCEL); break; } CslMasterConnection connection; wxString addr=text_ctrl_address->GetValue(); wxString path=text_ctrl_path->GetValue(); wxUint16 port=spin_ctrl_port->GetValue(); if (type==CslMasterConnection::CONNECTION_HTTP) { if (!path.StartsWith(wxT("/"))) path=wxT("/")+path; connection=CslMasterConnection(addr,path,port); } else connection=CslMasterConnection(addr,port); vector<CslMaster*>& masters=game->GetMasters(); loopv(masters) { if (masters[i]->GetConnection()==connection) { wxMessageBox(_("Master already exists!"),_("Error"),wxICON_ERROR,this); return; } } CslMaster *master=new CslMaster(connection); game->AddMaster(master); EndModal(wxID_OK); break; } default: break; } }
void LMS7SuiteAppFrame::HandleLMSevent(wxCommandEvent& event) { if (event.GetEventType() == CGEN_FREQUENCY_CHANGED) { int status = lmsControl->SetInterfaceFrequency(lmsControl->GetFrequencyCGEN(), lmsControl->Get_SPI_Reg_bits(HBI_OVR_TXTSP), lmsControl->Get_SPI_Reg_bits(HBD_OVR_RXTSP)); if (status == 0) { wxCommandEvent evt; evt.SetEventType(LOG_MESSAGE); wxString msg; msg += _("Parameters modified: "); msg += wxString::Format(_("HBI_OVR: %i "), lmsControl->Get_SPI_Reg_bits(HBI_OVR_TXTSP, false)); msg += wxString::Format(_("TXTSPCLKA_DIV: %i "), lmsControl->Get_SPI_Reg_bits(TXTSPCLKA_DIV, false)); msg += wxString::Format(_("TXDIVEN: %i "), lmsControl->Get_SPI_Reg_bits(TXDIVEN, false)); msg += wxString::Format(_("MCLK1SRC: %i "), lmsControl->Get_SPI_Reg_bits(MCLK1SRC, false)); msg += wxString::Format(_("HBD_OVR: %i "), lmsControl->Get_SPI_Reg_bits(HBD_OVR_RXTSP, false)); msg += wxString::Format(_("RXTSPCLKA_DIV: %i "), lmsControl->Get_SPI_Reg_bits(RXTSPCLKA_DIV, false)); msg += wxString::Format(_("RXDIVEN: %i "), lmsControl->Get_SPI_Reg_bits(RXDIVEN, false)); msg += wxString::Format(_("MCLK2SRC: %i "), lmsControl->Get_SPI_Reg_bits(MCLK2SRC, false)); evt.SetString(msg); wxPostEvent(this, evt); } if (streamBoardPort && streamBoardPort->IsOpen() && streamBoardPort->GetDeviceInfo().deviceName != GetDeviceName(LMS_DEV_NOVENA)) { //if decimation/interpolation is 0(2^1) or 7(bypass), interface clocks should not be divided int decimation = lmsControl->Get_SPI_Reg_bits(HBD_OVR_RXTSP); float interfaceRx_Hz = lmsControl->GetReferenceClk_TSP(LMS7002M::Rx); if (decimation != 7) interfaceRx_Hz /= pow(2.0, decimation); int interpolation = lmsControl->Get_SPI_Reg_bits(HBI_OVR_TXTSP); float interfaceTx_Hz = lmsControl->GetReferenceClk_TSP(LMS7002M::Tx); if (interpolation != 7) interfaceTx_Hz /= pow(2.0, interpolation); const int channelsCount = 2; streamBoardPort->UpdateExternalDataRate(0, interfaceTx_Hz/channelsCount, interfaceRx_Hz/channelsCount); if (status != LMS_StreamBoard::SUCCESS) wxMessageBox(_("Failed to configure Stream board PLL"), _("Warning")); else { wxCommandEvent evt; evt.SetEventType(LOG_MESSAGE); evt.SetString(wxString::Format(_("Stream board PLL configured Tx: %.3f MHz Rx: %.3f MHz Angle: %.0f deg"), interfaceTx_Hz/1e6, interfaceRx_Hz/1e6, 90.0)); wxPostEvent(this, evt); } } if (fftviewer) { int decimation = lmsControl->Get_SPI_Reg_bits(HBD_OVR_RXTSP); float samplingFreq_Hz = lmsControl->GetReferenceClk_TSP(LMS7002M::Rx); if (decimation != 7) samplingFreq_Hz /= pow(2.0, decimation+1); fftviewer->SetNyquistFrequency(samplingFreq_Hz / 2); } } //in case of Novena board, need to update GPIO if (lms7controlPort && lms7controlPort->GetDeviceInfo().deviceName != GetDeviceName(LMS_DEV_NOVENA) && (event.GetEventType() == LMS7_TXBAND_CHANGED || event.GetEventType() == LMS7_RXPATH_CHANGED)) { //update external band-selection to match lmsControl->UpdateExternalBandSelect(); if (novenaGui) novenaGui->UpdatePanel(); } if (event.GetEventType() == LMS7_TXBAND_CHANGED) { const wxObject* eventSource = event.GetEventObject(); const int bandIndex = event.GetInt(); //update HPM7 if changes were made outside of it if (lms7controlPort && lms7controlPort->GetDeviceInfo().expansionName == GetExpansionBoardName(EXP_BOARD_HPM7) && eventSource != hpm7) hpm7->SelectBand(bandIndex); if (lms7controlPort && eventSource == hpm7) { lmsControl->Modify_SPI_Reg_bits(SEL_BAND1_TRF, bandIndex == 0); lmsControl->Modify_SPI_Reg_bits(SEL_BAND2_TRF, bandIndex == 1); mContent->mTabTRF->UpdateGUI(); } } if (event.GetEventType() == LMS7_RXPATH_CHANGED) { const wxObject* eventSource = event.GetEventObject(); const int pathIndex = event.GetInt(); //update HPM7 if changes were made outside of it if (lms7controlPort && lms7controlPort->GetDeviceInfo().expansionName == GetExpansionBoardName(EXP_BOARD_HPM7) && eventSource != hpm7) hpm7->SelectRxPath(pathIndex); if (lms7controlPort && eventSource == hpm7) { lmsControl->Modify_SPI_Reg_bits(SEL_PATH_RFE, pathIndex); mContent->mTabRFE->UpdateGUI(); } } }
void MainFrame::UpdateUI(wxCommandEvent& event) { event.Skip(); bool is_running, is_stopped, is_ready; if(event.GetEventType() == wxEVT_DBG_COMMAND) { switch(event.GetId()) { case DID_START_EMU: case DID_STARTED_EMU: is_running = true; is_stopped = false; is_ready = false; break; case DID_STOP_EMU: case DID_STOPPED_EMU: is_running = false; is_stopped = true; is_ready = false; m_sys_menu_opened = false; break; case DID_PAUSE_EMU: case DID_PAUSED_EMU: is_running = false; is_stopped = false; is_ready = false; break; case DID_RESUME_EMU: case DID_RESUMED_EMU: is_running = true; is_stopped = false; is_ready = false; break; case DID_READY_EMU: is_running = false; is_stopped = false; is_ready = true; break; case DID_REGISTRED_CALLBACK: is_running = Emu.IsRunning(); is_stopped = Emu.IsStopped(); is_ready = Emu.IsReady(); break; default: return; } } else { is_running = Emu.IsRunning(); is_stopped = Emu.IsStopped(); is_ready = Emu.IsReady(); } // Update menu items based on the state of the emulator wxMenuBar& menubar( *GetMenuBar() ); // Emulation wxMenuItem& pause = *menubar.FindItem(id_sys_pause); wxMenuItem& stop = *menubar.FindItem(id_sys_stop); pause.SetItemLabel(is_running ? "&Pause\tCtrl + P" : is_ready ? "&Start\tCtrl + E" : "&Resume\tCtrl + E"); pause.Enable(!is_stopped); stop.Enable(!is_stopped); // PS3 Commands wxMenuItem& send_exit = *menubar.FindItem(id_sys_send_exit); wxMenuItem& send_open_menu = *menubar.FindItem(id_sys_send_open_menu); bool enable_commands = !is_stopped; send_open_menu.SetItemLabel(wxString::Format("Send &%s system menu cmd", (m_sys_menu_opened ? "close" : "open"))); send_open_menu.Enable(enable_commands); send_exit.Enable(enable_commands); // Tools wxMenuItem& kernel_explorer = *menubar.FindItem(id_tools_kernel_explorer); wxMenuItem& memory_viewer = *menubar.FindItem(id_tools_memory_viewer); wxMenuItem& rsx_debugger = *menubar.FindItem(id_tools_rsx_debugger); wxMenuItem& string_search = *menubar.FindItem(id_tools_string_search); kernel_explorer.Enable(!is_stopped); memory_viewer.Enable(!is_stopped); rsx_debugger.Enable(!is_stopped); string_search.Enable(!is_stopped); }