void TodoItemsProvider::startupProjectChanged(ProjectExplorer::Project *project) { m_startupProject = project; updateList(); }
//------------------------------------------------------------------------------ // Name: on_btnImport_clicked() // Desc: Opens a file selection window to choose a file with newline-separated, // hex address breakpoints. //------------------------------------------------------------------------------ void DialogBreakpoints::on_btnImport_clicked() { //Let the user choose the file; get the file name. QString home_directory = QDir::homePath(); QString file_name = QFileDialog::getOpenFileName(this, tr("Breakpoint Import File"), home_directory, NULL); if (file_name.isEmpty()) { return; } //Open the file; fail if error or it doesn't exist. QFile file(file_name); if (!file.open(QIODevice::ReadOnly)) { QMessageBox::critical(this, tr("Error Opening File"), tr("Unable to open breakpoint file: %1").arg(file_name)); return; } //Keep a list of any lines in the file that don't make valid breakpoints. QStringList errors; //Iterate through each line; attempt to make a breakpoint for each line. //Addreses should be prefixed with 0x, i.e. a hex number. //Count each breakpoint successfully made. int count = 0; Q_FOREVER { //Get the address QString line = file.readLine(); if(line.isNull()) { break; } bool ok; int base = 16; edb::address_t address = line.toULong(&ok, base); //Skip if there's an issue. if (!ok) { errors.append(line); continue; } //If there's an issue with the line or address isn't in any region, //add to error list and skip. edb::v1::memory_regions().sync(); IRegion::pointer p = edb::v1::memory_regions().find_region(address); if (!p) { errors.append(line); continue; } //If the bp already exists, skip. No error. if (edb::v1::debugger_core->find_breakpoint(address)) { continue; } //If the line was converted to an address, try to create the breakpoint. //Access debugger_core directly to avoid many possible error windows by edb::v1::create_breakpoint() if (const IBreakpoint::pointer bp = edb::v1::debugger_core->add_breakpoint(address)) { count++; } else{ errors.append(line); } } //Report any errors to the user if (errors.size() > 0) { QMessageBox::warning(this, tr("Invalid Breakpoints"), tr("The following breakpoints were not made:\n%1").arg(errors.join(""))); } //Report breakpoints successfully made QMessageBox::information(this, tr("Breakpoint Import"), tr("Imported %1 breakpoints.").arg(count)); updateList(); }
void DkHistoryDock::updateImage(QSharedPointer<DkImageContainerT> img) { updateList(img); mImg = img; }
void Editor::rimuoviTesserato(){ Squadra* squadra = squadre->at(squadreComboBox->currentIndex()); int index = listView->selectionModel()->currentIndex().row(); squadra->removeTesserato(squadra->at(index)); updateList(squadreComboBox->currentIndex()); }
void Editor::rimuoviArbitro(){ int index = listView->selectionModel()->currentIndex().row(); arbitri->removeArbitro(arbitri->at(index)); updateList(INT_MIN); }
void Display::Receive() { char buff[PLAYBUFFER+25],str[PLAYBUFFER+60]; int size=PLAYBUFFER+20,rcount,index,i,j,length; CString mesg,header,disp; rcount=sockclt.Receive(buff,size); if(rcount==SOCKET_ERROR) { log.WriteString("\nError in Receiving the data"); return; } if(rcount>(PLAYBUFFER+20)) { log.WriteString("\nMesg size exceeded buffer capacity"); return; } buff[rcount]=NULL; mesg=buff; // sprintf(str,"Received data len= %d , %s ",rcount,&buff[20]); // log.WriteString(str); index=mesg.Find(':'); //Invalid message Format --must have atleast one tag if(index==-1) return; header=mesg.Left(index); //Check if server has sent the list of clients if(header=="USER") { mesg=mesg.Right(mesg.GetLength()-index-1); updateList(mesg); return; } if(header=="WAIT") { if(isstart==0) //stop the chat OnStop(); start->EnableWindow(FALSE); mesg=mesg.Right(mesg.GetLength()-index-1); showFlash(); //disp=" Please wait....\n "+mesg+" is broadcasting"; //SetDlgItemText(6051,(char*)(LPCTSTR)disp); MessageBox("Please wait....\n "+mesg+" is broadcasting"); return; } if(header=="RESUME") { start->EnableWindow(TRUE); showFlash(); disp=" Broadcasting is over \n Now You can continue..."; SetDlgItemText(6051,(char*)(LPCTSTR)disp); // MessageBox(" Broadcasting is over \n Now You can continue..."); log.WriteString("\n****Received the resume message****"); return; } else //play the voice data { //No of messages received //*** Part of this code has to be removed later ***\\ //Get the legth of buffer length=0; sscanf(&buff[15],"%d",&length); if(length<1 || length>PLAYBUFFER) return; //If audio is not playing, start playing if(play->Playing==FALSE) play->PostThreadMessage(WM_PLAYSOUND_STARTPLAYING,0,0); LPWAVEHDR lpHdr=playhead[curhead]; curhead=(curhead+1)%MAXBUFFER; // playmesg=new char[2020]; for(i=20,j=0;j<length;i++,j++) lpHdr->lpData[j]=buff[i]; lpHdr->dwBufferLength=length; lpHdr->dwFlags=0; play->PostThreadMessage(WM_PLAYSOUND_PLAYBLOCK,0,(LPARAM)lpHdr); //If Save button is pressed.... //Save the Voice data from perticular user if(isSave==TRUE && writeuser.CompareNoCase(header)==0) { write->PostThreadMessage(WM_WRITESOUND_WRITEDATA,0,(LPARAM)lpHdr); log.WriteString("\n Writing to store"); } // log.WriteString("\nPlaying......"); disp=" "+header+" is talking..."; SetDlgItemText(6051,(char*)(LPCTSTR)disp); /* if(from->FindStringExact(-1,header)==LB_ERR) { from->ResetContent(); from->AddString(header); } */ // reccount++; // sprintf(str,"\n No of Messages received = %d ",reccount); // log.WriteString(str); } }
// ---------------------------------------------------------------------------- // ArchiveEntryList::applyFilter // // Applies the current filter(s) to the list // ---------------------------------------------------------------------------- void ArchiveEntryList::applyFilter() { // Clear current filter list items.clear(); // Check if any filters were given if (filter_text.IsEmpty() && filter_category.IsEmpty()) { // No filter, just refresh the list unsigned count = current_dir->numEntries() + current_dir->nChildren(); for (unsigned a = 0; a < count; a++) items.push_back(a); updateList(); return; } // Filter by category unsigned index = 0; ArchiveEntry* entry = getEntry(index, false); while (entry) { if (filter_category.IsEmpty() || entry->getType() == EntryType::folderType()) items.push_back(index); // If no category specified, just add all entries to the filter else { // Check for category match if (S_CMPNOCASE(entry->getType()->getCategory(), filter_category)) items.push_back(index); } entry = getEntry(++index, false); } // Now filter by name if needed if (!filter_text.IsEmpty()) { // Split filter by , wxArrayString terms = wxSplit(filter_text, ','); // Process filter strings for (unsigned a = 0; a < terms.size(); a++) { // Remove spaces terms[a].Replace(" ", ""); // Set to lowercase and add * to the end if (!terms[a].IsEmpty()) terms[a] = terms[a].Lower() + "*"; } // Go through filtered list for (unsigned a = 0; a < items.size(); a++) { entry = getEntry(items[a], false); // Don't filter folders if !elist_filter_dirs if (!elist_filter_dirs && entry->getType() == EntryType::folderType()) continue; // Check for name match with filter bool match = false; for (unsigned b = 0; b < terms.size(); b++) { if (entry == entry_dir_back || entry->getName().Lower().Matches(terms[b])) { match = true; continue; } } if (match) continue; // No match, remove from filtered list items.erase(items.begin() + a); a--; } } // Update the list updateList(); }
LRESULT PublicHubsFrame::onCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled) { CreateSimpleStatusBar(ATL_IDS_IDLEMESSAGE, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | SBARS_SIZEGRIP); ctrlStatus.Attach(m_hWndStatusBar); int w[3] = { 0, 0, 0 }; ctrlStatus.SetParts(3, w); m_ctrlHubs.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_HSCROLL | WS_VSCROLL | LVS_REPORT | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS, // https://github.com/pavel-pimenov/flylinkdc-r5xx/issues/1611 WS_EX_CLIENTEDGE, IDC_HUBLIST); SET_EXTENDENT_LIST_VIEW_STYLE(m_ctrlHubs); // Create listview columns WinUtil::splitTokens(columnIndexes, SETTING(PUBLICHUBSFRAME_ORDER), COLUMN_LAST); WinUtil::splitTokensWidth(columnSizes, SETTING(PUBLICHUBSFRAME_WIDTHS), COLUMN_LAST); BOOST_STATIC_ASSERT(_countof(columnSizes) == COLUMN_LAST); BOOST_STATIC_ASSERT(_countof(columnNames) == COLUMN_LAST); for (int j = 0; j < COLUMN_LAST; j++) { const int fmt = (j == COLUMN_USERS) ? LVCFMT_RIGHT : LVCFMT_LEFT; m_ctrlHubs.InsertColumn(j, CTSTRING_I(columnNames[j]), fmt, columnSizes[j], j); } m_ctrlHubs.SetColumnOrderArray(COLUMN_LAST, columnIndexes); SET_LIST_COLOR(m_ctrlHubs); m_ctrlHubs.SetImageList(g_flagImage.getIconList(), LVSIL_SMALL); /* extern HIconWrapper g_hOfflineIco; extern HIconWrapper g_hOnlineIco; m_onlineStatusImg.Create(16, 16, ILC_COLOR32 | ILC_MASK, 0, 2); m_onlineStatusImg.AddIcon(g_hOnlineIco); m_onlineStatusImg.AddIcon(g_hOfflineIco); m_ctrlHubs.SetImageList(m_onlineStatusImg, LVSIL_SMALL); */ ClientManager::getOnlineClients(m_onlineHubs); m_ctrlHubs.SetFocus(); m_ctrlTree.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | TVS_HASBUTTONS | TVS_LINESATROOT | TVS_HASLINES | TVS_SHOWSELALWAYS | TVS_DISABLEDRAGDROP, WS_EX_CLIENTEDGE, IDC_ISP_TREE); m_ctrlTree.SetBkColor(Colors::g_bgColor); m_ctrlTree.SetTextColor(Colors::g_textColor); WinUtil::SetWindowThemeExplorer(m_ctrlTree.m_hWnd); m_treeContainer.SubclassWindow(m_ctrlTree); SetSplitterExtendedStyle(SPLIT_PROPORTIONAL); // При изменении размеров окна-контейнера размеры разделяемых областей меняются пропорционально. SetSplitterPanes(m_ctrlTree.m_hWnd, m_ctrlHubs.m_hWnd); m_nProportionalPos = SETTING(FLYSERVER_HUBLIST_SPLIT); ctrlConfigure.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | BS_PUSHBUTTON , 0, IDC_PUB_LIST_CONFIG); ctrlConfigure.SetWindowText(CTSTRING(CONFIGURE)); ctrlConfigure.SetFont(Fonts::g_systemFont); ctrlFilter.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | ES_AUTOHSCROLL, WS_EX_CLIENTEDGE); m_filterContainer.SubclassWindow(ctrlFilter.m_hWnd); ctrlFilter.SetFont(Fonts::g_systemFont); ctrlFilterSel.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_HSCROLL | WS_VSCROLL | CBS_DROPDOWNLIST, WS_EX_CLIENTEDGE); ctrlFilterSel.SetFont(Fonts::g_systemFont, FALSE); //populate the filter list with the column names for (int j = 0; j < COLUMN_LAST; j++) { ctrlFilterSel.AddString(CTSTRING_I(columnNames[j])); } ctrlFilterSel.AddString(CTSTRING(ANY)); ctrlFilterSel.SetCurSel(COLUMN_LAST); ctrlFilterDesc.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | BS_GROUPBOX, WS_EX_TRANSPARENT); ctrlFilterDesc.SetWindowText(CTSTRING(FILTER)); ctrlFilterDesc.SetFont(Fonts::g_systemFont); SettingsManager::getInstance()->addListener(this); updateList(); loadISPHubs(); m_ctrlHubs.setSort(COLUMN_USERS, ExListViewCtrl::SORT_INT, false); /* const int l_sort = SETTING(HUBS_PUBLIC_COLUMNS_SORT); int l_sort_type = ExListViewCtrl::SORT_STRING_NOCASE; if (l_sort == 2 || l_sort > 4) l_sort_type = ExListViewCtrl::SORT_INT; if (l_sort == 5) l_sort_type = ExListViewCtrl::SORT_BYTES; m_ctrlHubs.setSort(SETTING(HUBS_PUBLIC_COLUMNS_SORT), l_sort_type, BOOLSETTING(HUBS_PUBLIC_COLUMNS_SORT_ASC)); */ hubsMenu.CreatePopupMenu(); hubsMenu.AppendMenu(MF_STRING, IDC_CONNECT, CTSTRING(CONNECT)); hubsMenu.AppendMenu(MF_STRING, IDC_ADD, CTSTRING(ADD_TO_FAVORITES_HUBS)); hubsMenu.AppendMenu(MF_STRING, IDC_REM_AS_FAVORITE, CTSTRING(REMOVE_FROM_FAVORITES_HUBS)); hubsMenu.AppendMenu(MF_STRING, IDC_COPY_HUB, CTSTRING(COPY_HUB)); hubsMenu.SetMenuDefaultItem(IDC_CONNECT); bHandled = FALSE; return TRUE; }
void structArtwordEditor :: v_dataChanged () { updateList (this); Graphics_updateWs (graphics.get()); }
LogView::LogView(TQWidget *parent,TDEConfig *config, const char *name) : TQWidget (parent, name) ,configFile(config) ,filesCount(0) ,connectionsCount(0) ,logFileName("/var/log/samba.log",this) ,label(&logFileName,i18n("Samba log file: "),this) ,viewHistory(this) ,showConnOpen(i18n("Show opened connections"),this) ,showConnClose(i18n("Show closed connections"),this) ,showFileOpen(i18n("Show opened files"),this) ,showFileClose(i18n("Show closed files"),this) ,updateButton(i18n("&Update"),this) { TQVBoxLayout *mainLayout=new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); TQHBoxLayout *leLayout=new TQHBoxLayout(mainLayout); leLayout->addWidget(&label); leLayout->addWidget(&logFileName,1); mainLayout->addWidget(&viewHistory,1); TQGridLayout *subLayout=new TQGridLayout(mainLayout,2,2); subLayout->addWidget(&showConnOpen,0,0); subLayout->addWidget(&showConnClose,1,0); subLayout->addWidget(&showFileOpen,0,1); subLayout->addWidget(&showFileClose,1,1); mainLayout->addWidget(&updateButton,0,Qt::AlignLeft); TQWhatsThis::add( &logFileName, i18n("This page presents the contents of" " your samba log file in a friendly layout. Check that the correct log" " file for your computer is listed here. If you need to, correct the name" " or location of the log file, and then click the \"Update\" button.") ); TQWhatsThis::add( &showConnOpen, i18n("Check this option if you want to" " view the details for connections opened to your computer.") ); TQWhatsThis::add( &showConnClose, i18n("Check this option if you want to" " view the events when connections to your computer were closed.") ); TQWhatsThis::add( &showFileOpen, i18n("Check this option if you want to" " see the files which were opened on your computer by remote users." " Note that file open/close events are not logged unless the samba" " log level is set to at least 2 (you cannot set the log level" " using this module).") ); TQWhatsThis::add( &showFileClose, i18n("Check this option if you want to" " see the events when files opened by remote users were closed." " Note that file open/close events are not logged unless the samba" " log level is set to at least 2 (you cannot set the log level" " using this module).") ); TQWhatsThis::add( &updateButton, i18n("Click here to refresh the information" " on this page. The log file (shown above) will be read to obtain the" " events logged by samba.") ); logFileName.setURL("/var/log/samba.log"); viewHistory.setAllColumnsShowFocus(TRUE); viewHistory.setFocusPolicy(TQ_ClickFocus); viewHistory.setShowSortIndicator(true); viewHistory.addColumn(i18n("Date & Time"),130); viewHistory.addColumn(i18n("Event"),150); viewHistory.addColumn(i18n("Service/File"),210); viewHistory.addColumn(i18n("Host/User"),150); TQWhatsThis::add( &viewHistory, i18n("This list shows details of the events" " logged by samba. Note that events at the file level are not logged" " unless you have configured the log level for samba to 2 or greater.<p>" " As with many other lists in TDE, you can click on a column heading" " to sort on that column. Click again to change the sorting direction" " from ascending to descending or vice versa.<p>" " If the list is empty, try clicking the \"Update\" button. The samba" " log file will be read and the list refreshed.") ); showConnOpen.setChecked(TRUE); showConnClose.setChecked(TRUE); showFileOpen.setChecked(FALSE); showFileClose.setChecked(FALSE); connect(&updateButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(updateList())); emit contentsChanged(&viewHistory,0,0); label.setMinimumSize(label.sizeHint()); logFileName.setMinimumSize(250,logFileName.sizeHint().height()); viewHistory.setMinimumSize(425,200); showConnOpen.setMinimumSize(showConnOpen.sizeHint()); showConnClose.setMinimumSize(showConnClose.sizeHint()); showFileOpen.setMinimumSize(showFileOpen.sizeHint()); showFileClose.setMinimumSize(showFileClose.sizeHint()); updateButton.setFixedSize(updateButton.sizeHint()); }
LRESULT PublicHubsFrame::onSelChangedISPTree(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/) { NMTREEVIEW* p = (NMTREEVIEW*) pnmh; if (p->itemNew.state & TVIS_SELECTED) { CWaitCursor l_cursor_wait; //-V808 m_ctrlHubs.DeleteAllItems(); if (p->itemNew.lParam == e_HubListItem) { tstring buf; buf.resize(100); if (m_ctrlTree.GetItemText(p->itemNew.hItem, &buf[0], buf.size())) { const string l_url = Text::fromT(buf.c_str()); CFlyLog l_log("Download Hub List"); std::vector<byte> l_data; l_log.step("URL = " + l_url); CFlyHTTPDownloader l_http_downloader; //l_http_downloader.setInetFlag(INTERNET_FLAG_RESYNCHRONIZE); l_http_downloader.m_is_use_cache = true; if (l_http_downloader.getBinaryDataFromInet(l_url, l_data, 1000)) { const string ext = Util::getFileExt(l_url); if (stricmp(ext, ".bz2") == 0) { std::vector<byte> l_out(l_data.size() * 20); size_t outSize = l_out.size(); size_t sizeRead = l_data.size(); UnBZFilter unbzip; try { unbzip(l_data.data(), (size_t &)sizeRead, &l_out[0], outSize); l_out[outSize] = 0; HubEntryList& l_list = m_publicListMatrix[l_url]; l_list.clear(); try { PubHubListXmlListLoader loader(l_list); SimpleXMLReader(&loader).parse((const char*)l_out.data(), outSize, false); m_hubs = l_list; updateList(); } catch (const Exception& e) { l_log.step("XML parse error = " + e.getError()); } } catch (const Exception& e) { l_log.step("Unpack error = " + e.getError()); } } } } } else { TStringSet l_items; LoadTreeItems(l_items, p->itemNew.hItem); int cnt = 0; for (auto i = l_items.cbegin(); i != l_items.end(); ++i) { TStringList l; l.resize(COLUMN_LAST); l[COLUMN_SERVER] = *i; m_ctrlHubs.insert(cnt++, l, I_IMAGECALLBACK); // !SMT!-IP } } m_ctrlHubs.resort(); updateStatus(); } return 0; }
void SeparatorListControl::updateSeparatorProperties() { updateList(); }
void TodoItemsProvider::currentEditorChanged(Core::IEditor *editor) { m_currentEditor = editor; if (m_settings.scanningScope == ScanningScopeCurrentFile) updateList(); }
void TodoItemsProvider::projectsFilesChanged() { updateList(); }
void PluginListComponent::changeListenerCallback (ChangeBroadcaster*) { table.getHeader().reSortTable(); updateList(); }
static void gui_radiobutton_cb_toggle (ArtwordEditor me, GuiRadioButtonEvent event) { my feature = event -> position; Melder_assert (my feature > 0); Melder_assert (my feature <= kArt_muscle_MAX); updateList (me); }
void TestPage::searchChanged (const QString &d) { idir.setNameFilter(d); updateList(); }
inline void add() { updateList(); }
void ClipListEdit::songChanged(MusECore::SongChangedStruct_t type) { if(type._flags & (SC_CLIP_MODIFIED | SC_TRACK_INSERTED | SC_TRACK_REMOVED | SC_PART_INSERTED | SC_PART_REMOVED | SC_PART_MODIFIED)) updateList(); }
void PageNet::updateServersList() { tvServersList->setModel(new HWNetUdpModel(tvServersList)); tvServersList->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch); static_cast<HWNetServersModel *>(tvServersList->model())->updateList(); connect(BtnUpdateSList, SIGNAL(clicked()), static_cast<HWNetServersModel *>(tvServersList->model()), SLOT(updateList())); connect(tvServersList, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(slotConnect())); }
// ---------------------------------------------------------------------------- // ArchiveEntryList::handleAction // // Handles the action [id]. // Returns true if the action was handled, false otherwise // ---------------------------------------------------------------------------- bool ArchiveEntryList::handleAction(string id) { // Don't handle action if hidden if (!IsShown()) return false; // Only interested in actions beginning with aelt_ if (!id.StartsWith("aelt_")) return false; if (id == "aelt_sizecol") { elist_colsize_show = !elist_colsize_show; setupColumns(); updateWidth(); updateList(); if (GetParent()) GetParent()->Layout(); } else if (id == "aelt_typecol") { elist_coltype_show = !elist_coltype_show; setupColumns(); updateWidth(); updateList(); if (GetParent()) GetParent()->Layout(); } else if (id == "aelt_indexcol") { elist_colindex_show = !elist_colindex_show; setupColumns(); updateWidth(); updateList(); if (GetParent()) GetParent()->Layout(); } else if (id == "aelt_hrules") { elist_hrules = !elist_hrules; SetSingleStyle(wxLC_HRULES, elist_hrules); Refresh(); } else if (id == "aelt_vrules") { elist_vrules = !elist_vrules; SetSingleStyle(wxLC_VRULES, elist_vrules); Refresh(); } else if (id == "aelt_bgcolour") { elist_type_bgcol = !elist_type_bgcol; Refresh(); } else if (id == "aelt_bgalt") { elist_alt_row_colour = !elist_alt_row_colour; Refresh(); } // Unknown action else return false; // Action handled, return true return true; }
UI_Annotationswindow::UI_Annotationswindow(int file_number, QWidget *w_parent) { QPalette palette; mainwindow = (UI_Mainwindow *)w_parent; file_num = file_number; docklist = new QDockWidget("Annotations", w_parent); docklist->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); docklist->setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable); palette.setColor(QPalette::Text, mainwindow->maincurve->text_color); palette.setColor(QPalette::Base, mainwindow->maincurve->backgroundcolor); relative = 1; mainwindow->annotations_onset_relative = 1; selected = -1; invert_filter = 0; hide_nk_triggers = 0; hide_bs_triggers = 0; dialog1 = new QDialog; checkbox1 = new QCheckBox("Relative "); checkbox1->setGeometry(2, 2, 10, 10); checkbox1->setTristate(false); checkbox1->setCheckState(Qt::Checked); label1 = new QLabel; label1->setText(" Filter:"); lineedit1 = new QLineEdit; lineedit1->setMaxLength(16); checkbox2 = new QCheckBox("Inv."); checkbox2->setGeometry(2, 2, 10, 10); checkbox2->setTristate(false); checkbox2->setCheckState(Qt::Unchecked); list = new QListWidget(dialog1); list->setFont(*mainwindow->monofont); list->setAutoFillBackground(true); list->setPalette(palette); show_between_act = new QAction("Set timescale from here to next annotation", list); hide_annot_act = new QAction("Hide", list); unhide_annot_act = new QAction("Unhide", list); hide_same_annots_act = new QAction("Hide similar", list); unhide_same_annots_act = new QAction("Unhide similar", list); unhide_all_annots_act = new QAction("Unhide all", list); average_annot_act = new QAction("Average", list); hide_all_NK_triggers_act = new QAction("Hide all Nihon Kohden triggers", list); hide_all_BS_triggers_act = new QAction("Hide all Biosemi triggers", list); unhide_all_NK_triggers_act = new QAction("Unhide all Nihon Kohden triggers", list); unhide_all_BS_triggers_act = new QAction("Unhide all Biosemi triggers", list); list->setContextMenuPolicy(Qt::ActionsContextMenu); list->insertAction(NULL, show_between_act); list->insertAction(NULL, hide_annot_act); list->insertAction(NULL, hide_same_annots_act); list->insertAction(NULL, unhide_annot_act); list->insertAction(NULL, unhide_same_annots_act); list->insertAction(NULL, unhide_all_annots_act); list->insertAction(NULL, average_annot_act); list->insertAction(NULL, hide_all_NK_triggers_act); list->insertAction(NULL, unhide_all_NK_triggers_act); list->insertAction(NULL, hide_all_BS_triggers_act); list->insertAction(NULL, unhide_all_BS_triggers_act); h_layout = new QHBoxLayout; h_layout->addWidget(checkbox1); h_layout->addWidget(label1); h_layout->addWidget(lineedit1); h_layout->addWidget(checkbox2); v_layout = new QVBoxLayout(dialog1); v_layout->addLayout(h_layout); v_layout->addWidget(list); v_layout->setSpacing(1); docklist->setWidget(dialog1); updateList(); QObject::connect(list, SIGNAL(itemPressed(QListWidgetItem *)), this, SLOT(annotation_selected(QListWidgetItem *))); QObject::connect(docklist, SIGNAL(visibilityChanged(bool)), this, SLOT(hide_editdock(bool))); QObject::connect(checkbox1, SIGNAL(stateChanged(int)), this, SLOT(checkbox1_clicked(int))); QObject::connect(checkbox2, SIGNAL(stateChanged(int)), this, SLOT(checkbox2_clicked(int))); QObject::connect(hide_annot_act, SIGNAL(triggered(bool)), this, SLOT(hide_annot(bool))); QObject::connect(unhide_annot_act, SIGNAL(triggered(bool)), this, SLOT(unhide_annot(bool))); QObject::connect(hide_same_annots_act, SIGNAL(triggered(bool)), this, SLOT(hide_same_annots(bool))); QObject::connect(unhide_same_annots_act, SIGNAL(triggered(bool)), this, SLOT(unhide_same_annots(bool))); QObject::connect(unhide_all_annots_act, SIGNAL(triggered(bool)), this, SLOT(unhide_all_annots(bool))); QObject::connect(average_annot_act, SIGNAL(triggered(bool)), this, SLOT(average_annot(bool))); QObject::connect(show_between_act, SIGNAL(triggered(bool)), this, SLOT(show_between(bool))); QObject::connect(hide_all_NK_triggers_act, SIGNAL(triggered(bool)), this, SLOT(hide_all_NK_triggers(bool))); QObject::connect(hide_all_BS_triggers_act, SIGNAL(triggered(bool)), this, SLOT(hide_all_BS_triggers(bool))); QObject::connect(unhide_all_NK_triggers_act, SIGNAL(triggered(bool)), this, SLOT(unhide_all_NK_triggers(bool))); QObject::connect(unhide_all_BS_triggers_act, SIGNAL(triggered(bool)), this, SLOT(unhide_all_BS_triggers(bool))); QObject::connect(lineedit1, SIGNAL(textEdited(const QString)), this, SLOT(filter_edited(const QString))); }
void Editor::rimuoviSquadra(){ int index = listView->selectionModel()->currentIndex().row(); squadre->removeSquadra(squadre->at(index)); updateList(INT_MIN); emit squadraChanged(); }
void PluginListComponent::changeListenerCallback (ChangeBroadcaster*) { updateList(); }
LRESULT AutoSearchFrame::onCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled) { ctrlAutoSearch.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_HSCROLL | WS_VSCROLL | LVS_REPORT | LVS_SHOWSELALWAYS, WS_EX_CLIENTEDGE, IDC_AUTOSEARCH); ctrlAutoSearch.SetExtendedListViewStyle(LVS_EX_LABELTIP | LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES | LVS_EX_HEADERDRAGDROP | LVS_EX_DOUBLEBUFFER | LVS_EX_INFOTIP); ctrlAutoSearch.SetBkColor(WinUtil::bgColor); ctrlAutoSearch.SetTextBkColor(WinUtil::bgColor); ctrlAutoSearch.SetTextColor(WinUtil::textColor); // Insert columns WinUtil::splitTokens(columnIndexes, SETTING(AUTOSEARCHFRAME_ORDER), COLUMN_LAST); WinUtil::splitTokens(columnSizes, SETTING(AUTOSEARCHFRAME_WIDTHS), COLUMN_LAST); for(int j=0; j<COLUMN_LAST; j++) { int fmt = LVCFMT_LEFT; ctrlAutoSearch.InsertColumn(j, CTSTRING_I(columnNames[j]), fmt, columnSizes[j], j); } ctrlAutoSearch.SetColumnOrderArray(COLUMN_LAST, columnIndexes); /*AutoSearch every time */ ctrlAsTime.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | ES_RIGHT | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | ES_AUTOHSCROLL | ES_NUMBER, WS_EX_CLIENTEDGE,IDC_AUTOSEARCH_ENABLE_TIME ); ctrlAsTime.SetFont(WinUtil::systemFont); Timespin.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | WS_CLIPSIBLINGS | WS_CLIPCHILDREN); Timespin.SetRange(1, 999); ctrlAsTimeLabel.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | SS_RIGHT | WS_CLIPSIBLINGS | WS_CLIPCHILDREN); ctrlAsTimeLabel.SetFont(WinUtil::systemFont, FALSE); ctrlAsTimeLabel.SetWindowText(CTSTRING(AUTOSEARCH_ENABLE_TIME)); ctrlAsTime.SetWindowText(Text::toT(Util::toString(SETTING(AUTOSEARCH_EVERY))).c_str()); /*AutoSearch reched items time */ ctrlAsRTime.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | ES_RIGHT | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | ES_AUTOHSCROLL | ES_NUMBER, WS_EX_CLIENTEDGE,IDC_AUTOSEARCH_RECHECK_TIME ); ctrlAsRTime.SetFont(WinUtil::systemFont); RTimespin.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | WS_CLIPSIBLINGS | WS_CLIPCHILDREN); RTimespin.SetRange(30, 999); ctrlAsRTimeLabel.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | SS_RIGHT | WS_CLIPSIBLINGS | WS_CLIPCHILDREN); ctrlAsRTimeLabel.SetFont(WinUtil::systemFont, FALSE); ctrlAsRTimeLabel.SetWindowText(CTSTRING(AUTOSEARCH_RECHECK_TEXT)); ctrlAsRTime.SetWindowText(Text::toT(Util::toString(SETTING(AUTOSEARCH_RECHECK_TIME))).c_str()); //create buttons ctrlAdd.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | BS_PUSHBUTTON , 0, IDC_ADD); ctrlAdd.SetWindowText(CTSTRING(ADD)); ctrlAdd.SetFont(WinUtil::systemFont); ctrlRemove.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | BS_PUSHBUTTON , 0, IDC_REMOVE); ctrlRemove.SetWindowText(CTSTRING(REMOVE)); ctrlRemove.SetFont(WinUtil::systemFont); ctrlChange.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | BS_PUSHBUTTON , 0, IDC_CHANGE); ctrlChange.SetWindowText(CTSTRING(SETTINGS_CHANGE)); ctrlChange.SetFont(WinUtil::systemFont); ctrlDown.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | BS_PUSHBUTTON , 0, IDC_MOVE_DOWN); ctrlDown.SetWindowText(CTSTRING(SETTINGS_BTN_MOVEDOWN )); ctrlDown.SetFont(WinUtil::systemFont); ctrlUp.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | BS_PUSHBUTTON , 0, IDC_MOVE_UP); ctrlUp.SetWindowText(CTSTRING(SETTINGS_BTN_MOVEUP)); ctrlUp.SetFont(WinUtil::systemFont); AutoSearchManager::getInstance()->addListener(this); SettingsManager::getInstance()->addListener(this); //fill the list updateList(); WinUtil::SetIcon(m_hWnd, _T("autosearch.ico")); loading = false; bHandled = FALSE; return TRUE; }
RadWidget::RadWidget(Rad *_rad, QWidget *parent, const char *name) : QWidget(parent, name) { hotlistNum = 3; rad = _rad; QHBoxLayout *hlayout = new QHBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); QVBoxLayout *vlayout = new QVBoxLayout(hlayout, KDialog::spacingHint()); hotlistGroup = new QButtonGroup(1, Horizontal, i18n("Hotlist"), this); //hotlistGroup->setRadioButtonExclusive(true); vlayout->addWidget(hotlistGroup); Config* config = Config::self(); hotlist = config->hotlist(); while (hotlist.size() > hotlistNum) hotlist.pop_front(); for (unsigned int i = 0; i < hotlistNum; ++i) { if (i >= hotlistNum) break; hotlistGroup->insert(new KPushButton(*hotlist.at(i), hotlistGroup), i); } connect(hotlistGroup, SIGNAL(clicked(int)), SLOT(hotlistClicked(int))); QVBoxLayout *layout = new QVBoxLayout(vlayout, KDialog::spacingHint()); totalStrokes = new QCheckBox(i18n("Search by total strokes"), this); connect(totalStrokes, SIGNAL(clicked()), this, SLOT(totalClicked())); layout->addWidget(totalStrokes); QHBoxLayout *strokesLayout = new QHBoxLayout(layout, KDialog::spacingHint()); totalSpin = new QSpinBox(1, 30, 1, this); strokesLayout->addWidget(totalSpin); strokesLayout->addStretch(); totalErrLabel = new QLabel(i18n("+/-"), this); strokesLayout->addWidget(totalErrLabel); totalErrSpin = new QSpinBox(0, 15, 1, this); strokesLayout->addWidget(totalErrSpin); ok = new KPushButton(i18n("&Look Up"), this); ok->setEnabled(false); connect(ok, SIGNAL(clicked()), SLOT(apply())); layout->addWidget(ok); cancel = new KPushButton( KStdGuiItem::cancel(), this ); connect(cancel, SIGNAL(clicked()), SLOT(close())); layout->addWidget(cancel); QVBoxLayout *middlevLayout = new QVBoxLayout(hlayout, KDialog::spacingHint()); strokesSpin = new QSpinBox(1, 17, 1, this); QToolTip::add(strokesSpin, i18n("Show radicals having this number of strokes")); middlevLayout->addWidget(strokesSpin); List = new KListBox(this); middlevLayout->addWidget(List); connect(List, SIGNAL(executed(QListBoxItem *)), this, SLOT(executed(QListBoxItem *))); connect(strokesSpin, SIGNAL(valueChanged(int)), this, SLOT(updateList(int))); QVBoxLayout *rightvlayout = new QVBoxLayout(hlayout, KDialog::spacingHint()); selectedList = new KListBox(this); rightvlayout->addWidget(selectedList); connect(selectedList, SIGNAL(selectionChanged()), this, SLOT(selectionChanged())); remove = new KPushButton(i18n("&Remove"), this); rightvlayout->addWidget(remove); connect(remove, SIGNAL(clicked()), this, SLOT(removeSelected())); remove->setEnabled(false); clear = new KPushButton(KStdGuiItem::clear(), this); rightvlayout->addWidget(clear); connect(clear, SIGNAL(clicked()), this, SLOT(clearSelected())); clear->setEnabled(false); setCaption(kapp->makeStdCaption(i18n("Radical Selector"))); strokesSpin->setValue(config->strokes()); strokesSpin->setFocus(); totalSpin->setValue(config->totalStrokes()); totalErrSpin->setValue(config->totalStrokesErrorMargin()); totalStrokes->setChecked(config->searchByTotal()); // make sure the right parts of the total stroke // selection system are enabled totalClicked(); // initially show the list of radicals to choose from updateList(strokesSpin->value()); }
void DialogBreakpoints::hideEvent(QHideEvent *) { disconnect(edb::v1::disassembly_widget(), SIGNAL(signal_updated()), this, SLOT(updateList())); }
void AnimationExplorer::onOwnedCheckToggled() { update(); updateList(LLTimer::getElapsedSeconds()); }
void UI_Annotationswindow::filter_edited(const QString text) { int i, cnt, n, len; char filter_str[32]; struct annotationblock *annot; annot = mainwindow->annotationlist[file_num]; cnt = edfplus_annotation_count(&annot); if(cnt < 1) { return; } if(text.length() < 1) { while(annot != NULL) { if(!(((annot->ident & (1 << ANNOT_ID_NK_TRIGGER)) && hide_nk_triggers) || ((annot->ident & (1 << ANNOT_ID_BS_TRIGGER)) && hide_bs_triggers))) { annot->hided_in_list = 0; annot->hided = 0; } annot = annot->next_annotation; } updateList(); mainwindow->maincurve->update(); return; } strcpy(filter_str, lineedit1->text().toUtf8().data()); len = strlen(filter_str); if(invert_filter == 0) { while(annot != NULL) { if(!(((annot->ident & (1 << ANNOT_ID_NK_TRIGGER)) && hide_nk_triggers) || ((annot->ident & (1 << ANNOT_ID_BS_TRIGGER)) && hide_bs_triggers))) { annot->hided_in_list = 1; n = strlen(annot->annotation) - len + 1; for(i=0; i<n; i++) { if(!(strncmp(filter_str, annot->annotation + i, len))) { annot->hided_in_list = 0; annot->hided = 0; break; } } } annot = annot->next_annotation; } } else { while(annot != NULL) { if(!(((annot->ident & (1 << ANNOT_ID_NK_TRIGGER)) && hide_nk_triggers) || ((annot->ident & (1 << ANNOT_ID_BS_TRIGGER)) && hide_bs_triggers))) { annot->hided_in_list = 0; n = strlen(annot->annotation) - len + 1; for(i=0; i<n; i++) { if(!(strncmp(filter_str, annot->annotation + i, len))) { annot->hided_in_list = 1; annot->hided = 1; break; } } } annot = annot->next_annotation; } } updateList(); mainwindow->maincurve->update(); }
void update(monitor_odometry_target_data &data, monitor_odometry_target_config config) { /* protected region user update on begin */ //Abstand des neue KS vom Roboter (bei Nullgeschwindigkeit). // config.kindOf_primary_filter = 1; // config.kindOf_secondary_filter = 5; // config.kindOf_target_alignment = 0; // config.noise_threshold = 0.02; // config.mean_time_threshold = 2; // config.vel_time_threshold = 2; // config.vel_threshold = 0.05; // config.kindOf_stagnancy_override = 0; // config.mean_vel_threshold = 0.01; // config.inner_radius = 1.0; // config.outer_radius = 2.0; // config.max_vel = 0.30; // config.min_vel = 0.1; double output_z = 0; double radius_of_robot = 1; ROS_INFO("********************* stage I ***********************"); /* * stage: (I) * input odometry data: * velocity in x; * velocity in y; * header: * timestamp stamp; * frame_id; * */ x_ = data.in_odometry.twist.twist.linear.x; y_ = data.in_odometry.twist.twist.linear.y; header.frame_id = config.base_frame_id; header.stamp = data.in_odometry.header.stamp; /* * info: */ //TODO: delete this: ROS_INFO("input:"); ROS_INFO("x_ = %f",x_); ROS_INFO("y_ = %f",y_); //end delete this; // std::fstream f; // f.open("testlog_x.dat", std::ios::out | std::ios::app); // f << x_ << std::endl; // f.close(); // // f.open("testlog_y.dat", std::ios::out | std::ios::app); // f << y_ << std::endl; // f.close(); //TODO: ROS_INFO("not good for performace but do anyway!"); velocity_ = calcAbsVec(x_, y_); //TODO: just for now: if (velocity_ > config.max_vel) { ROS_INFO("ERROR vel > max_vel"); } // velocity_ = calcVel(x_, y_, config.max_vel); velList = updateVelList(velList, velocity_, header.stamp.toSec(), config.vel_time_threshold); double meanVel = calcMeanVel(velList); ROS_INFO("********************* stage II **********************"); /* * stage: (II) * primary filters: */ if (config.kindOf_primary_filter == 0) { ROS_INFO("no primary filter active ..."); // velocity_ = calcVel(x_, y_, config.max_vel); } else if (config.kindOf_primary_filter == 1) { ROS_INFO("noise suppression filter active ..."); x_ = noiseSuppression(x_ , config.noise_threshold); y_ = noiseSuppression(y_ , config.noise_threshold); // velocity_ = calcVel(x_,y_, config.max_vel); } else if (config.kindOf_primary_filter == 2) { ROS_INFO("velocity based suppression filter active ..."); // velocity_ = calcVel(x_,y_, config.max_vel); if (velocity_ < config.vel_threshold) { x_ = 0.0; y_ = 0.0; velocity_ = 0.0; } } else if (config.kindOf_primary_filter == 3) { ROS_INFO("combined suppression filter active ..."); x_ = noiseSuppression(x_ , config.noise_threshold); y_ = noiseSuppression(y_ , config.noise_threshold); velocity_ = calcVel(x_,y_, config.max_vel); if (velocity_ < config.vel_threshold) { x_ = 0.0; y_ = 0.0; velocity_ = 0.0; //TODO: Ist das nicht gefährlich??? Der Roboter könnte sich bewegen aber die Durchschnittsgeschw. // über 2-3 Sekunden trotzdem immer null sein??? } } else ROS_WARN("Error - 0001 - primary filter parameter out of bounds!"); ROS_INFO("after primary filters:"); ROS_INFO("x_ = %f",x_); ROS_INFO("y_ = %f",y_); //save velocity data // std::fstream f; // f.open("testlog_velocity.dat", std::ios::out | std::ios::app); // f << velocity_ << std::endl; // f.close(); ROS_INFO("********************* stage III *********************"); /* * stage: (III) * target alignment: */ //TODO: if (config.kindOf_target_alignment == 0) { ROS_INFO("no target alignment active ..."); z_ = (double) hight; } else { //for all cases: int overrideZ = checkForOverrideZ(config.min_vel, config.max_vel, velocity_); if (config.kindOf_target_alignment == 1) { ROS_INFO("vertical target alignment active ..."); z_ = (velocity_ / config.max_vel) * (double) hight; } else if (config.kindOf_target_alignment == 2) { ROS_INFO("linear target alignment active ..."); z_ = (velocity_ / config.max_vel) * (double) hight; d_ = z_ * ((config.outer_radius - config.inner_radius) / (double) hight); } else if (config.kindOf_target_alignment == 3) { ROS_INFO("elliptical target aligment active ..."); z_ = -1 * sqrt( 1 - (((velocity_ / config.max_vel) / (config.outer_radius - config.inner_radius)) * ((velocity_ / config.max_vel) / (config.outer_radius - config.inner_radius)))) * (double) hight + hight; d_ = (velocity_ / config.max_vel) * (config.outer_radius - config.inner_radius); } else if (config.kindOf_target_alignment == 4) { ROS_INFO("elliptical target alignment with mean velocity active..."); z_ = -1 * sqrt( 1 - (((meanVel / config.max_vel) / (config.outer_radius - config.inner_radius)) * ((meanVel / config.max_vel) / (config.outer_radius - config.inner_radius)))) * (double) hight + hight; d_ = (meanVel / config.max_vel) * (config.outer_radius - config.inner_radius); } else { ROS_WARN("Error - 0002 - target alignment parameter out of bounds!"); } ROS_INFO("OVERRIDE BEFORE IF_ = %u",overrideZ); if (overrideZ == 0) { z_ = 0.0; ROS_INFO("OVI 0"); } else if (overrideZ == 1) { z_ = (double) hight; ROS_INFO("OVI 1=hight"); } else if (overrideZ == 3) { ROS_ERROR("Error - 0003 - override parameter out of bounds!"); } else { ROS_INFO("OVI wahrscheinlich 2 also nix tun!"); } } /* * stage: (IV) * secondary filters: */ ROS_INFO("********************* stage IV **********************"); if (config.kindOf_secondary_filter == 0) { ROS_INFO("no secondary filter active ..."); } else if (config.kindOf_secondary_filter == 1) { ROS_INFO("mean filter active ..."); list_of_values_xystamp_ = updateList(list_of_values_xystamp_, x_, y_, header.stamp.toSec(), config.mean_time_threshold); std::vector<double> meanXY = calcMeanXY(list_of_values_xystamp_); x_ = meanXY.at(0); y_ = meanXY.at(1); // ROS_INFO("Anzahl Elemente: %lu", list_of_values_xystamp_.size()); // ROS_INFO("meanX %f und meanY %f", meanXY.at(0), meanXY.at(1)); } else if (config.kindOf_secondary_filter == 2) { ROS_INFO("median filter active ..."); list_of_values_xystamp_ = updateList(list_of_values_xystamp_, x_, y_, header.stamp.toSec(), config.mean_time_threshold); std::vector<double> medianXY = calcMedianXY(list_of_values_xystamp_); x_ = medianXY.at(0); y_ = medianXY.at(1); } else if (config.kindOf_secondary_filter == 3) { ROS_INFO("quantified mean filter slope active ..."); list_of_values_xystamp_ = updateList(list_of_values_xystamp_, x_, y_, header.stamp.toSec(), config.mean_time_threshold); std::vector<double> meanSlope = calcQuantifiedMeanSlope(list_of_values_xystamp_); x_ = meanSlope.at(0); y_ = meanSlope.at(1); } else if (config.kindOf_secondary_filter == 4) { ROS_INFO("quantified mean filter stairs active ..."); list_of_values_xystamp_ = updateList(list_of_values_xystamp_, x_, y_, header.stamp.toSec(), config.mean_time_threshold); std::vector<double> meanStairs = calcQuantifiedMeanStairs(list_of_values_xystamp_); x_ = meanStairs.at(0); y_ = meanStairs.at(1); } else if (config.kindOf_secondary_filter == 5) { ROS_INFO("quantified mean filter square active"); list_of_values_xystamp_ = updateList(list_of_values_xystamp_, x_, y_, header.stamp.toSec(), config.mean_time_threshold); std::vector<double> meanSquare = calcQuantifiedMeanSquare(list_of_values_xystamp_); x_ = meanSquare.at(0); y_ = meanSquare.at(1); } else if (config.kindOf_secondary_filter == 6) { ROS_INFO("quantified median filter slope active"); list_of_values_xystamp_ = updateList(list_of_values_xystamp_, x_, y_, header.stamp.toSec(), config.mean_time_threshold); std::vector<double> medianSlope = calcQuantifiedMedianSlope(list_of_values_xystamp_); x_ = medianSlope.at(0); y_ = medianSlope.at(1); } else ROS_WARN("Error - 0003 - secondary filter parameter out of bounds!"); ROS_INFO("after secondary filters:"); ROS_INFO("x_ = %f",x_); ROS_INFO("y_ = %f",y_); /* * stage: (V) * output production: */ // yaw_ = noZeroArcTan(y_,x_); //for stag test: //listOfValuesForMeanYaw_ = updateListOfDouble(listOfValuesForMeanYaw_, yaw_, 100); //end of stag test // yaw_ = noZeroArcTan(y_,x_); /* * stage: (V) * stagnancy override: */ ROS_INFO("********************* stage V ***********************"); if (config.kindOf_stagnancy_override == 0) { ROS_INFO("no stagnancyoverride active ..."); } else if (config.kindOf_stagnancy_override == 1) { ROS_INFO("stagnancy override active ..."); // velList = updateVelList(velList, velocity_, header.stamp.toSec()); // double meanVel = calcMeanVel(velList); if (meanVel < config.mean_vel_threshold) { stagnancy_override_counter++; z_ = (double) hight; d_ = 0.0; //wieder zurück drehen??? } } else if (config.kindOf_stagnancy_override == 2) { ROS_INFO("stagnancy override: twist back torso"); if (meanVel < config.mean_vel_threshold) { // yaw_ = calcMean(listOfValuesForMeanYaw_); // ROS_INFO("Mean yaw_ %f",yaw_); } } else ROS_ERROR("Error - 0004 - stagnancy override parameter out of bounds!"); /* * stage: (VI) * output calculator: */ ROS_INFO("********************* stage VI **********************"); yaw_ = newArcTan(x_,y_); // ROS_INFO("d_ = %f",d_); x_ = calcX(yaw_, (config.outer_radius - config.inner_radius) + d_); y_ = calcY(yaw_, (config.outer_radius - config.inner_radius) + d_); // x_ = calcX(yaw_, (config.outer_radius - config.inner_radius) + d_); // y_ = calcY(yaw_, (config.outer_radius - config.inner_radius) + d_); ROS_INFO("Output: ---------------------"); ROS_INFO("x_ = %f",x_); ROS_INFO("y_ = %f",y_); ROS_INFO("yaw_ = %f",yaw_); ROS_INFO("END ...................."); ROS_INFO("Schwellwert: %f", config.noise_threshold); if (config.testbool) { ROS_INFO("testbool is true"); } else { ROS_INFO("testbool is false"); } /* * stage: (VII) * tf */ ROS_INFO("********************* stage VII *********************"); frame_transform_output(tf::Vector3(x_,y_,z_)); stamped_transform_output.stamp_ = header.stamp; stamped_transform_output.frame_id_ = config.base_frame_id; stamped_transform_output.child_frame_id_ = config.lookat_frame_id; tf::Quaternion q; q.setRPY(0, 0, yaw_); stamped_transform_output.setRotation(q); stamped_transform_output.setOrigin(tf::Vector3(x_,y_,z_)); static tf::TransformBroadcaster br; br.sendTransform(stamped_transform_output); // /* // * evaluations: // */ // if (active_) { // tf::Vector3 newOrigin; // newOrigin.setX(x_); // newOrigin.setY(y_); // newOrigin.setZ(z_); // double distance = calcEuklidianDistance(newOrigin,oldOrigin); // quickAndDirty++; // //Problem: Sprung von Null auf den Startwert wieder löschen! // if (quickAndDirty > 4 ) { // distances_list.push_back(distance); // } // // double max_value = calcMax(distances_list); // double sum_value = calcSum(distances_list); // ROS_INFO("+++++++++++++++++++++++++++++++++++++++"); // ROS_INFO("Auswertung: ");/ // ROS_INFO("Distance = %f",distance); // ROS_INFO("MAX = %f ", max_value); // ROS_INFO("SUM = %f", sum_value); // // showList(distances_list); // oldOrigin = newOrigin; // // //TODO: // //eval: yaw: // double yawDistance = calcYawDistance(yaw_, oldYaw); // if (quickAndDirty > 4) { // yaw_distances_list.push_back(yawDistance); // } // double yaw_max_value = calcMax(yaw_distances_list); // double yaw_sum_value = calcSum(yaw_distances_list); // ROS_INFO("++++++++++++++++++++++++++++++++++++++++"); // ROS_INFO("YawDistance = %f", yawDistance); // ROS_INFO("MAX YAW = %f", yaw_max_value); // ROS_INFO("SUM YAW = %f ", yaw_sum_value); // oldYaw = yaw_; // // ROS_INFO("stagnacy_override_counter = %u", stagnancy_override_counter); // } /* protected region user update end */ }