void Main::cmdReceivedCB(const std_msgs::CharConstPtr & cmd) { switch (cmd->data) { case 'b': clearBackground(); break; case 'c': stopTracking(); break; case 'l': toggleLearning(); break; case 'a': alternatingMode(); break; case 'e': exportModel(); break; case 'i': importModel(); break; case 'r': reset(); break; case 'v': sendCenterView(); break; default: break; } }
//void Main::cmdReceivedCB(const std_msgs::CharConstPtr & cmd) void Main::cmdReceivedCB(const std_msgs::StringConstPtr & cmd) { char cd=cmd->data.c_str()[0]; //switch (cmd->data) switch (cd) { case 'b': clearBackground(); break; case 'c': stopTracking(); break; case 'l': toggleLearning(); break; case 'a': alternatingMode(); break; case 'e': exportModel(); break; case 'i': importModel(); break; case 'r': reset(); break; default: break; } }
void SkyMap::mouseReleaseEvent( QMouseEvent * ) { if ( ZoomRect.isValid() ) { stopTracking(); SkyPoint newcenter = projector()->fromScreen( ZoomRect.center(), data->lst(), data->geo()->lat() ); setFocus( &newcenter ); setDestination( newcenter ); //Zoom in on center of Zoom Circle, by a factor equal to the ratio //of the sky pixmap's width to the Zoom Circle's diameter float factor = float(width()) / float(ZoomRect.width()); setZoomFactor( Options::zoomFactor() * factor ); } setDefaultMouseCursor(); ZoomRect = QRect(); //invalidate ZoomRect if(m_previewLegend) { slotCancelLegendPreviewMode(); } //false if double-clicked, because it's unset there. if (mouseButtonDown) { mouseButtonDown = false; if ( slewing ) { slewing = false; if ( Options::useAltAz() ) setDestinationAltAz( focus()->alt(), focus()->az() ); else setDestination( *focus() ); } forceUpdate(); // is needed because after moving the sky not all stars are shown } // if middle button was pressed unset here midMouseButtonDown = false; }
void MainWindow::toggleTracking() { if (isTracking) stopTracking(); else startTracking(); }
void SensorFileSysWalker::closeWaitHandle() { if( changeHandle != NULL ) { HANDLE h = changeHandle; changeHandle = NULL; stopTracking( h ); } }
NokiaMaemoLocationInterfaceImpl::~NokiaMaemoLocationInterfaceImpl() { if (m_registeredAndTracking) { // Try to stop tracking and deregister client. stopTracking(); deregisterLbsClient(); } }
void TransFunc1DRampEditor::createConnections() { // Buttons connect(clearButton_, SIGNAL(clicked()), this, SLOT(clearButtonClicked())); connect(loadButton_, SIGNAL(clicked()), this, SLOT(loadTransferFunction())); connect(saveButton_, SIGNAL(clicked()), this, SLOT(saveTransferFunction())); // signals from transferMappingCanvas connect(transCanvas_, SIGNAL(changed()), this, SLOT(updateTransferFunction())); connect(transCanvas_, SIGNAL(loadTransferFunction()), this, SLOT(loadTransferFunction())); connect(transCanvas_, SIGNAL(saveTransferFunction()), this, SLOT(saveTransferFunction())); connect(transCanvas_, SIGNAL(resetTransferFunction()), this, SLOT(clearButtonClicked())); connect(transCanvas_, SIGNAL(toggleInteractionMode(bool)), this, SLOT(toggleInteractionMode(bool))); // signals for colorPicker connect(transCanvas_, SIGNAL(colorChanged(const QColor&)), colorPicker_, SLOT(setCol(const QColor))); connect(transCanvas_, SIGNAL(colorChanged(const QColor&)), colorLumPicker_, SLOT(setCol(const QColor))); connect(colorPicker_, SIGNAL(newCol(int,int)), colorLumPicker_, SLOT(setCol(int,int))); connect(colorLumPicker_, SIGNAL(newHsv(int,int,int)), this, SLOT(markerColorChanged(int,int,int))); connect(colorPicker_, SIGNAL(toggleInteractionMode(bool)), this, SLOT(toggleInteractionMode(bool))); connect(colorLumPicker_, SIGNAL(toggleInteractionMode(bool)), this, SLOT(toggleInteractionMode(bool))); // doubleslider connect(doubleSlider_, SIGNAL(valuesChanged(float, float)), this, SLOT(thresholdChanged(float, float))); connect(doubleSlider_, SIGNAL(toggleInteractionMode(bool)), this, SLOT(toggleInteractionMode(bool))); // threshold spinboxes connect(lowerThresholdSpin_, SIGNAL(valueChanged(int)), this, SLOT(lowerThresholdSpinChanged(int))); connect(upperThresholdSpin_, SIGNAL(valueChanged(int)), this, SLOT(upperThresholdSpinChanged(int))); connect(checkClipThresholds_, SIGNAL(toggled(bool)), transCanvas_, SLOT(toggleClipThresholds(bool))); //ramp slider and spinboxes connect(sliderRampCenter_, SIGNAL(valueChanged(int)), this, SLOT(updateRampCenter(int))); connect(spinRampCenter_, SIGNAL(valueChanged(int)), this, SLOT(updateRampCenter(int))); connect(spinRampWidth_, SIGNAL(valueChanged(int)), this, SLOT(updateRampWidth(int))); connect(sliderRampWidth_, SIGNAL(valueChanged(int)), this, SLOT(updateRampWidth(int))); connect(sliderRampCenter_, SIGNAL(sliderPressed()), this, SLOT(startTracking())); connect(sliderRampWidth_, SIGNAL(sliderPressed()), this, SLOT(startTracking())); connect(sliderRampCenter_, SIGNAL(sliderReleased()), this, SLOT(stopTracking())); connect(sliderRampWidth_, SIGNAL(sliderReleased()), this, SLOT(stopTracking())); }
void InspectorMemoryAgent::willDestroyFrontendAndBackend(DisconnectReason) { m_instrumentingAgents.setInspectorMemoryAgent(nullptr); ErrorString ignored; stopTracking(ignored); disable(ignored); }
VRGenericHeadTracker::~VRGenericHeadTracker() { #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) stopTracking(); #endif #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) [(CMMotionManager*)_motionMgr release]; #endif }
MainWindow::~MainWindow() { stopTracking(); preferences->savePreferences(); delete ui; delete trayIcon; delete trayIconMenu; delete preferences; commands->clear(); delete commands; delete minimizeAction; delete restoreAction; delete quitAction; }
void TransFuncEditorIntensityGradient::createConnections() { if (!supported_) return; // buttons connect(loadButton_, SIGNAL(clicked()), this, SLOT(loadTransferFunction())); connect(saveButton_, SIGNAL(clicked()), this, SLOT(saveTransferFunction())); connect(clearButton_, SIGNAL(clicked()), painter_, SLOT(resetTransferFunction())); connect(gridEnabledButton_, SIGNAL(clicked()), this, SLOT(toggleShowGrid())); connect(histogramEnabledButton_, SIGNAL(clicked()), this, SLOT(toggleShowHistogram())); connect(quadButton_, SIGNAL(clicked()), painter_, SLOT(addQuadPrimitive())); connect(bananaButton_, SIGNAL(clicked()), painter_, SLOT(addBananaPrimitive())); connect(deleteButton_, SIGNAL(clicked()), painter_, SLOT(deletePrimitive())); connect(colorButton_, SIGNAL(clicked()), painter_, SLOT(colorizePrimitive())); connect(histogramBrightness_, SIGNAL(sliderMoved(int)), painter_, SLOT(histogramBrightnessChanged(int))); connect(histogramLog_, SIGNAL(stateChanged(int)), painter_, SLOT(toggleHistogramLogarithmic(int))); // slider connect(fuzziness_, SIGNAL(valueChanged(int)), painter_, SLOT(fuzzinessChanged(int))); connect(transparency_, SIGNAL(valueChanged(int)), painter_, SLOT(transparencyChanged(int))); connect(fuzziness_, SIGNAL(sliderPressed()), this, SLOT(startTracking())); connect(transparency_, SIGNAL(sliderPressed()), this, SLOT(startTracking())); connect(fuzziness_, SIGNAL(sliderReleased()), this, SLOT(stopTracking())); connect(transparency_, SIGNAL(sliderReleased()), this, SLOT(stopTracking())); connect(painter_, SIGNAL(setTransparencySlider(int)), this, SLOT(setTransparency(int))); connect(painter_, SIGNAL(primitiveDeselected()), this, SLOT(primitiveDeselected())); connect(painter_, SIGNAL(primitiveSelected()), this, SLOT(primitiveSelected())); connect(painter_, SIGNAL(toggleInteractionMode(bool)), this, SLOT(toggleInteractionMode(bool))); connect(painter_, SIGNAL(repaintSignal()), this, SLOT(repaintSignal())); }
SynchronousStatus NokiaMaemoLocationInterfaceImpl::stopLbs() { if (m_registeredAndTracking) { // Try to stop the tracking. bool stopTrackingStatus = stopTracking(); // Try to deregister the client. We try to do this no matter // the status of stopTracking. bool closeGpsConStatus = deregisterLbsClient(); if (!stopTrackingStatus || !closeGpsConStatus) { return SynchronousStatus(LBS_STOP_FAILED, "", ""); } } m_registeredAndTracking = false; isab::GenericGuiMess message(isab::GuiProtEnums::DISCONNECT_GPS); sendAsynchronousRequestToNav2(&message); return SynchronousStatus(OK, "", ""); }
serialThread::~serialThread() { stopTracking(); // Make sure everything has stopped when we exit }
void MainWindow::switchProject(Project *older) { if (isTracking) createNewTimeSession(older); stopTracking(); }
void SkyMap::keyPressEvent( QKeyEvent *e ) { KStars* kstars = KStars::Instance(); QString s; bool arrowKeyPressed( false ); bool shiftPressed( false ); float step = 1.0; if ( e->modifiers() & Qt::ShiftModifier ) { step = 10.0; shiftPressed = true; } //If the DBus resume key is not empty, then DBus processing is //paused while we wait for a keypress if ( ! data->resumeKey.isEmpty() && QKeySequence(e->key()) == data->resumeKey ) { //The resumeKey was pressed. Signal that it was pressed by //resetting it to empty; this will break the loop in //KStars::waitForKey() data->resumeKey = QKeySequence(); return; } if(m_previewLegend) { slotCancelLegendPreviewMode(); } switch ( e->key() ) { case Qt::Key_Left : if ( Options::useAltAz() ) { focus()->setAz( dms( focus()->az().Degrees() - step * MINZOOM/Options::zoomFactor() ).reduce() ); focus()->HorizontalToEquatorial( data->lst(), data->geo()->lat() ); } else { focus()->setRA( focus()->ra().Hours() + 0.05*step * MINZOOM/Options::zoomFactor() ); focus()->EquatorialToHorizontal( data->lst(), data->geo()->lat() ); } arrowKeyPressed = true; slewing = true; break; case Qt::Key_Right : if ( Options::useAltAz() ) { focus()->setAz( dms( focus()->az().Degrees() + step * MINZOOM/Options::zoomFactor() ).reduce() ); focus()->HorizontalToEquatorial( data->lst(), data->geo()->lat() ); } else { focus()->setRA( focus()->ra().Hours() - 0.05*step * MINZOOM/Options::zoomFactor() ); focus()->EquatorialToHorizontal( data->lst(), data->geo()->lat() ); } arrowKeyPressed = true; slewing = true; break; case Qt::Key_Up : if ( Options::useAltAz() ) { focus()->setAlt( focus()->alt().Degrees() + step * MINZOOM/Options::zoomFactor() ); if ( focus()->alt().Degrees() > 90.0 ) focus()->setAlt( 90.0 ); focus()->HorizontalToEquatorial( data->lst(), data->geo()->lat() ); } else { focus()->setDec( focus()->dec().Degrees() + step * MINZOOM/Options::zoomFactor() ); if (focus()->dec().Degrees() > 90.0) focus()->setDec( 90.0 ); focus()->EquatorialToHorizontal( data->lst(), data->geo()->lat() ); } arrowKeyPressed = true; slewing = true; break; case Qt::Key_Down: if ( Options::useAltAz() ) { focus()->setAlt( focus()->alt().Degrees() - step * MINZOOM/Options::zoomFactor() ); if ( focus()->alt().Degrees() < -90.0 ) focus()->setAlt( -90.0 ); focus()->HorizontalToEquatorial(data->lst(), data->geo()->lat() ); } else { focus()->setDec( focus()->dec().Degrees() - step * MINZOOM/Options::zoomFactor() ); if (focus()->dec().Degrees() < -90.0) focus()->setDec( -90.0 ); focus()->EquatorialToHorizontal( data->lst(), data->geo()->lat() ); } arrowKeyPressed = true; slewing = true; break; case Qt::Key_Plus: //Zoom in case Qt::Key_Equal: zoomInOrMagStep( e->modifiers() ); break; case Qt::Key_Minus: //Zoom out case Qt::Key_Underscore: zoomOutOrMagStep( e->modifiers() ); break; case Qt::Key_0: //center on Sun setClickedObject( data->skyComposite()->planet( KSPlanetBase::SUN ) ); setClickedPoint( clickedObject() ); slotCenter(); break; case Qt::Key_1: //center on Mercury setClickedObject( data->skyComposite()->planet( KSPlanetBase::MERCURY ) ); setClickedPoint( clickedObject() ); slotCenter(); break; case Qt::Key_2: //center on Venus setClickedObject( data->skyComposite()->planet( KSPlanetBase::VENUS ) ); setClickedPoint( clickedObject() ); slotCenter(); break; case Qt::Key_3: //center on Moon setClickedObject( data->skyComposite()->planet( KSPlanetBase::MOON ) ); setClickedPoint( clickedObject() ); slotCenter(); break; case Qt::Key_4: //center on Mars setClickedObject( data->skyComposite()->planet( KSPlanetBase:: MARS) ); setClickedPoint( clickedObject() ); slotCenter(); break; case Qt::Key_5: //center on Jupiter setClickedObject( data->skyComposite()->planet( KSPlanetBase::JUPITER ) ); setClickedPoint( clickedObject() ); slotCenter(); break; case Qt::Key_6: //center on Saturn setClickedObject( data->skyComposite()->planet( KSPlanetBase::SATURN ) ); setClickedPoint( clickedObject() ); slotCenter(); break; case Qt::Key_7: //center on Uranus setClickedObject( data->skyComposite()->planet( KSPlanetBase::URANUS ) ); setClickedPoint( clickedObject() ); slotCenter(); break; case Qt::Key_8: //center on Neptune setClickedObject( data->skyComposite()->planet( KSPlanetBase::NEPTUNE ) ); setClickedPoint( clickedObject() ); slotCenter(); break; case Qt::Key_9: //center on Pluto setClickedObject( data->skyComposite()->planet( KSPlanetBase::PLUTO ) ); setClickedPoint( clickedObject() ); slotCenter(); break; case Qt::Key_BracketLeft: // Begin measuring angular distance if( !rulerMode ) slotBeginAngularDistance(); break; case Qt::Key_Escape: // Cancel angular distance measurement { if( rulerMode ) slotCancelRulerMode(); if( m_fovCaptureMode ) slotFinishFovCaptureMode(); break; } case Qt::Key_C: //Center clicked object if ( clickedObject() ) slotCenter(); break; case Qt::Key_D: //Details window for Clicked/Centered object { SkyObject *orig = 0; if ( shiftPressed ) { orig = clickedObject(); setClickedObject( focusObject() ); } if ( clickedObject() ) { slotDetail(); } if ( orig ) { setClickedObject( orig ); } break; } case Qt::Key_P: //Show Popup menu for Clicked/Centered object if ( shiftPressed ) { if ( focusObject() ) focusObject()->showPopupMenu( pmenu, QCursor::pos() ); } else { if ( clickedObject() ) clickedObject()->showPopupMenu( pmenu, QCursor::pos() ); } break; case Qt::Key_O: //Add object to Observing List { SkyObject *orig = 0; if ( shiftPressed ) { orig = clickedObject(); setClickedObject( focusObject() ); } if ( clickedObject() ) { kstars->observingList()->slotAddObject(); } if ( orig ) { setClickedObject( orig ); } break; } case Qt::Key_L: //Toggle User label on Clicked/Centered object { SkyObject *orig = 0; if ( shiftPressed ) { orig = clickedObject(); setClickedObject( focusObject() ); } if ( clickedObject() ) { if ( isObjectLabeled( clickedObject() ) ) slotRemoveObjectLabel(); else slotAddObjectLabel(); } if ( orig ) { setClickedObject( orig ); } break; } case Qt::Key_T: //Toggle planet trail on Clicked/Centered object (if solsys) { SkyObject *orig = 0; if ( shiftPressed ) { orig = clickedObject(); setClickedObject( focusObject() ); } KSPlanetBase* planet = dynamic_cast<KSPlanetBase*>( clickedObject() ); if( planet ) { if( planet->hasTrail() ) slotRemovePlanetTrail(); else slotAddPlanetTrail(); } if ( orig ) { setClickedObject( orig ); } break; } case Qt::Key_R: { // Toggle relativistic corrections Options::setUseRelativistic( ! Options::useRelativistic() ); kDebug() << "Relativistc corrections: " << Options::useRelativistic(); forceUpdate(); break; } case Qt::Key_A: Options::setUseAntialias( ! Options::useAntialias() ); kDebug() << "Use Antialiasing: " << Options::useAntialias(); forceUpdate(); break; case Qt::Key_K: { if(m_fovCaptureMode) slotCaptureFov(); break; } case Qt::Key_PageUp: { KStars::Instance()->selectPreviousFov(); break; } case Qt::Key_PageDown: { KStars::Instance()->selectNextFov(); break; } default: // We don't want to do anything in this case. Key is unknown return; } if ( arrowKeyPressed ) { stopTracking(); setDestination( *focus() ); } forceUpdate(); //need a total update, or slewing with the arrow keys doesn't work. }
void Tracker::handleInput(const Input &input, const Hotspot *) { if (stopTrackingInput(input)) stopTracking(input); else if (isTracking()) continueTracking(input); }
void SkyMap::mouseMoveEvent( QMouseEvent *e ) { if ( Options::useHoverLabel() ) { //Start a single-shot timer to monitor whether we are currently hovering. //The idea is that whenever a moveEvent occurs, the timer is reset. It //will only timeout if there are no move events for HOVER_INTERVAL ms m_HoverTimer.start( HOVER_INTERVAL ); QToolTip::hideText(); } //Are we defining a ZoomRect? if ( ZoomRect.center().x() > 0 && ZoomRect.center().y() > 0 ) { //cancel operation if the user let go of CTRL if ( !( e->modifiers() & Qt::ControlModifier ) ) { ZoomRect = QRect(); //invalidate ZoomRect update(); } else { //Resize the rectangle so that it passes through the cursor position QPoint pcenter = ZoomRect.center(); int dx = abs(e->x() - pcenter.x()); int dy = abs(e->y() - pcenter.y()); if ( dx == 0 || float(dy)/float(dx) > float(height())/float(width()) ) { //Size rect by height ZoomRect.setHeight( 2*dy ); ZoomRect.setWidth( 2*dy*width()/height() ); } else { //Size rect by height ZoomRect.setWidth( 2*dx ); ZoomRect.setHeight( 2*dx*height()/width() ); } ZoomRect.moveCenter( pcenter ); //reset center update(); return; } } if ( projector()->unusablePoint( e->pos() ) ) return; // break if point is unusable //determine RA, Dec of mouse pointer m_MousePoint = projector()->fromScreen( e->pos(), data->lst(), data->geo()->lat() ); double dyPix = 0.5*height() - e->y(); if ( midMouseButtonDown ) { //zoom according to y-offset float yoff = dyPix - y0; if (yoff > 10 ) { y0 = dyPix; slotZoomIn(); } if (yoff < -10 ) { y0 = dyPix; slotZoomOut(); } } if ( mouseButtonDown ) { // set the mouseMoveCursor and set slewing=true, if they are not set yet if( !mouseMoveCursor ) setMouseMoveCursor(); if( !slewing ) { slewing = true; stopTracking(); //toggle tracking off } //Update focus such that the sky coords at mouse cursor remain approximately constant if ( Options::useAltAz() ) { m_MousePoint.EquatorialToHorizontal( data->lst(), data->geo()->lat() ); clickedPoint()->EquatorialToHorizontal( data->lst(), data->geo()->lat() ); dms dAz = m_MousePoint.az() - clickedPoint()->az(); dms dAlt = m_MousePoint.alt() - clickedPoint()->alt(); focus()->setAz( focus()->az().Degrees() - dAz.Degrees() ); //move focus in opposite direction focus()->setAz( focus()->az().reduce() ); focus()->setAlt( KSUtils::clamp( focus()->alt().Degrees() - dAlt.Degrees() , -90.0 , 90.0 ) ); focus()->HorizontalToEquatorial( data->lst(), data->geo()->lat() ); } else { dms dRA = m_MousePoint.ra() - clickedPoint()->ra(); dms dDec = m_MousePoint.dec() - clickedPoint()->dec(); focus()->setRA( focus()->ra().Hours() - dRA.Hours() ); //move focus in opposite direction focus()->setRA( focus()->ra().reduce() ); focus()->setDec( KSUtils::clamp( focus()->dec().Degrees() - dDec.Degrees() , -90.0 , 90.0 ) ); focus()->EquatorialToHorizontal( data->lst(), data->geo()->lat() ); } showFocusCoords(); //redetermine RA, Dec of mouse pointer, using new focus m_MousePoint = projector()->fromScreen( e->pos(), data->lst(), data->geo()->lat() ); setClickedPoint( &m_MousePoint ); forceUpdate(); // must be new computed } else { //mouse button not down emit mousePointChanged( &m_MousePoint ); } }
DLS::~DLS() { stopTracking(); close(fd_); }
void InspectorScriptProfilerAgent::willDestroyFrontendAndBackend(DisconnectReason) { ErrorString ignored; stopTracking(ignored); }
void InspectorHeapAgent::willDestroyFrontendAndBackend(DisconnectReason) { ErrorString ignored; stopTracking(ignored); disable(ignored); }
void MockupEyetracker::shutdown() { stopTracking(); m_initialized = false; emit shutdownCompleted(true, QString()); }