Пример #1
0
    SpectrogramData()
    {
//         setInterval( Qt::XAxis, QwtInterval( -1.5, 1.5 ) );
        setInterval( Qt::XAxis, QwtInterval( -1.5, 1.5 ) );
        setInterval( Qt::YAxis, QwtInterval( -1.5, 1.5 ) );
        setInterval( Qt::ZAxis, QwtInterval( 0.0, 10.0 ) );
    }
Пример #2
0
PlotRasterData::PlotRasterData()
{
    setInterval( Qt::XAxis, QwtInterval( -100, 100, QwtInterval::ExcludeMaximum ) );
    setInterval( Qt::YAxis, QwtInterval( -100, 100, QwtInterval::ExcludeMaximum ) );
    setInterval( Qt::ZAxis, QwtInterval( 0.1, 2.0 ) );
    setResampleMode( static_cast<QwtMatrixRasterData::ResampleMode>( 1 ) );     // Сглаживание
}
Пример #3
0
SaxsviewFrameData::SaxsviewFrameData(const QSize& size)
  : QwtRasterData(), p(new Private) {

  p->data = saxs_image_create();
  saxs_image_set_size(p->data, size.width(), size.height(), 1, 1);

  setInterval(Qt::XAxis, QwtInterval(0.0, size.width() - 1.0));
  setInterval(Qt::YAxis, QwtInterval(0.0, size.height() - 1.0));
  setInterval(Qt::ZAxis, QwtInterval(0.0, 1.0));
}
Пример #4
0
void DragNDropResponse::execute(int call) {
    switch (call) {
    case 0: // pre-phase : ensure widgets are painted in order to mapToGlobal to work
        m_src->repaint ();
        m_dest->repaint ();
        setInterval(100);
        break;
    case 1: // 1: press event
        m_srcPosGlobal = m_src->mapToGlobal(m_srcPos);
        m_destPosGlobal = m_dest->mapToGlobal(m_destPos);

        qApp->postEvent(m_src,
            new QMouseEvent(QEvent::MouseButtonPress,
                            m_srcPos,
                            m_srcPosGlobal,
                            Qt::LeftButton,
                            Qt::NoButton,
                            Qt::NoModifier));
        break;
    case 2: { // 2: WaitForDragStart
        setInterval(qApp->startDragTime() + 20);
        break;
    }
    case 3: { // 3: do some move event
        setInterval(0);
        QList<QPoint> moves;
        calculate_drag_n_drop_moves(moves, m_srcPosGlobal, m_destPosGlobal, 4);
        foreach (const QPoint & move, moves) {
            QWidget * widgetUnderCursor = qApp->widgetAt(move);
            if (widgetUnderCursor) {
                qApp->postEvent(widgetUnderCursor,
                    new QMouseEvent(QEvent::MouseMove,
                                    widgetUnderCursor->mapFromGlobal(move),
                                    move,
                                    Qt::LeftButton,
                                    Qt::NoButton,
                                    Qt::NoModifier));
            }
        }
        break;
    }
    case 4: { // 4: now release the button
        qApp->postEvent(m_dest,
            new QMouseEvent(QEvent::MouseButtonRelease,
                            m_destPos,
                            m_destPosGlobal,
                            Qt::LeftButton,
                            Qt::NoButton,
                            Qt::NoModifier));
    }
    case 5: // and reply
        writeResponse(QtJson::JsonObject());
        break;
    }
Пример #5
0
    SpectrogramData()
    {
        // some minor performance improvements wgen the spectrogram item
        // does not need to check for NaN values

        setAttribute( QwtRasterData::WithoutGaps, true );

        setInterval( Qt::XAxis, QwtInterval( -1.5, 1.5 ) );
        setInterval( Qt::YAxis, QwtInterval( -1.5, 1.5 ) );
        setInterval( Qt::ZAxis, QwtInterval( 0.0, 10.0 ) );
    }
Пример #6
0
RasterData::RasterData(MouseSpectrogram *spectrogram) :
    s(spectrogram),
    max(0)
{
  memset(d, 0, Statistic::SCREEN_SIZE * Statistic::SCREEN_SIZE * sizeof(int));
  setInterval(Qt::XAxis,
              QwtInterval(0.0, Statistic::SCREEN_SIZE));
  setInterval(Qt::YAxis,
              QwtInterval(0.0, Statistic::SCREEN_SIZE));

  s->setAxisScale(QwtPlot::xBottom, 0, Statistic::SCREEN_SIZE);
  s->setAxisScale(QwtPlot::yLeft, Statistic::SCREEN_SIZE, 0);
  s->setAxisScale(QwtPlot::yRight, 0.0, 1.0);
}
Пример #7
0
static void
cacheTrim (
  sTimer	*tp
)
{
  static time_tClock	cycle;
  static pwr_tBoolean   first = 1;

  if (first) {
#ifdef OS_LINUX
    cycle = 1 * sysconf(_SC_CLK_TCK);
#else
    cycle = 1 * CLK_TCK;
#endif
    setInterval(&cycle, gdbroot->db->cache_trim_int);
    first = 0;
  }

  if (gdbroot->db->log.b.tmon)
    errh_Info("cacheTrim: %u", tp->clock);

  cvolcm_TrimOld();
  cvol_Qtrim(&gdbroot->db->cacheNew);

  setTimer(tp, cycle);

  insertTimer(tp);
}
Пример #8
0
/**
 * Creates instances of BasicBehaviours, needed according to the PlanRepository, with the help of the given
 * BehaviourCreator. If a BasicBehaviour cannot be instantiated, the Initialisation of the Pool is cancelled.
 * @param bc A BehaviourCreator.
 * @return True, if all necessary BasicBehaviours could be constructed. False, if the Initialisation was cancelled.
 */
bool BehaviourPool::init(IBehaviourCreator* bc)
{
    if (_behaviourCreator != nullptr) {
        delete _behaviourCreator;
    }

    _behaviourCreator = bc;

    const PlanRepository::Accessor<BehaviourConfiguration>& behaviourConfs = _ae->getPlanRepository()->getBehaviourConfigurations();
    for (const BehaviourConfiguration* beh : behaviourConfs) {
        auto basicBeh = _behaviourCreator->createBehaviour(beh->getId());
        if (basicBeh != nullptr) {
            // set stuff from behaviour configuration in basic behaviour object
            basicBeh->setConfiguration(beh);
            basicBeh->setDelayedStart(beh->getDeferring());
            basicBeh->setInterval(1000 / beh->getFrequency());
            basicBeh->setEngine(_ae);
            basicBeh->init();

            _availableBehaviours.insert(make_pair(beh, basicBeh));
        } else {
            return false;
        }
    }
    return true;
}
Пример #9
0
SaxsviewFrameData::SaxsviewFrameData(const QString& fileName)
 : QwtRasterData(), p(new Private) {

  p->data = saxs_image_create();
  if (saxs_image_read(p->data, qPrintable(fileName), 0L) == 0) {

    setInterval(Qt::XAxis, QwtInterval(0.0, saxs_image_width(p->data) - 1.0));
    setInterval(Qt::YAxis, QwtInterval(0.0, saxs_image_height(p->data) - 1.0));
    setInterval(Qt::ZAxis, QwtInterval(saxs_image_value_min(p->data),
                                       saxs_image_value_max(p->data)));

  } else {
    saxs_image_free(p->data);
    p->data = 0L;
  }
}
Пример #10
0
/**
 * \brief Constructs the controller.
 */
WinAmpTuneController::WinAmpTuneController()
: PollingTuneController(),
  antiscrollCounter_(0)
{
	startPoll();
	setInterval(NormInterval);
}
Пример #11
0
void PausableTimer::pause() {
	if (isActive()) {
		stop();
		time_t elapsedTime = time(NULL) - startTime;
		setInterval(interval() - elapsedTime*1000);
	}
}
Пример #12
0
TestWindow::TestWindow() {
    setSurfaceType(QSurface::OpenGLSurface);


    auto timer = new QTimer(this);
    timer->setInterval(5);
    connect(timer, &QTimer::timeout, [&] { draw(); });
    timer->start();

    connect(qApp, &QCoreApplication::aboutToQuit, [this, timer] {
        timer->stop();
        _aboutToQuit = true;
    });

#ifdef DEFERRED_LIGHTING
    _light->setType(model::Light::SUN);
    _light->setAmbientSpherePreset(gpu::SphericalHarmonics::Preset::OLD_TOWN_SQUARE);
    _light->setIntensity(1.0f);
    _light->setAmbientIntensity(0.5f);
    _light->setColor(vec3(1.0f));
    _light->setPosition(vec3(1, 1, 1));
    _renderContext->args = _renderArgs;
#endif

    QSurfaceFormat format = getDefaultOpenGLSurfaceFormat();
    format.setOption(QSurfaceFormat::DebugContext);
    //format.setSwapInterval(0);
    setFormat(format);
    _glContext.setFormat(format);
    _glContext.create();
    _glContext.makeCurrent(this);
    show();
}
Пример #13
0
void Playlist::clear(uint8_t clearFlags) {
    if(clearFlags & CLEAR_SCRIPT_URL) {
        WRITE_STRING_TO_PLAYLIST(script, (char *) "");
    }

    if(clearFlags & CLEAR_SETTINGS) {
        setPlayOrder(FORWARDS_ORDER);
        setPortamento(true);
        setVolume(DEFAULT_VOLUME);
        setUpdateFlags(0);
        setInterval(DEFAULT_INTERVAL);
        setAutoplayTimes(0, 0, 0);
        setAutoplayChirpLimit(PLAYLIST_CAPACITY);
    }

    if(clearFlags & CLEAR_LIST) {
        WRITE_TO_PLAYLIST(addIndex, 0);

        // codes starting with 0 byte are considered empty
        uint8_t *addr = PLAYLIST_FIELD_ADDR(codes);
        for(uint8_t i = 0; i < PLAYLIST_CAPACITY; i++) {
            Store::writeValue(addr, 0, 1);
            addr += CODE_LENGTH;
        }

        nChirps = 0;
        playIndex = 0;
        isFirst = true;
    }
}
Пример #14
0
  HelpText(MyScene *scene){
    QFont font = g_editor->main_window->font();
    font.setPointSize(15);
    font.setPixelSize(15);

    // When is this text shown?
    _text = scene->addText(
                           // "* Add objects with right mouse button\n"
                           "* Move objects with right mouse button.\n"
                           "\n"
                           "* Double-click the name of an object to open GUI. (only if there is one)\n"
                           "\n"
                           "* Delete objects or connections by pressing SHIFT and click left.\n"
                           "  - Alternatively, click with middle mouse button.\n"
                           "\n"
                           "* Select more than one object by holding CTRL when clicking.\n"
                           "  - Alternatively, mark an area of objects with left mouse button.\n"
                           "\n"
                           "* To autoconnect a new object to an existing object, right click at the input or output of an existing object.\n"
                           "\n"
                           "* Zoom in and out by pressing CTRL and using the scroll wheel.\n"
                           ,
                           font);

    _text->setDefaultTextColor(get_qcolor(HIGH_BACKGROUND_COLOR_NUM).light(70));
    _text->setPos(-150,-150);
    _text->setZValue(-1000);

    setSingleShot(true);
    setInterval(1000*60);
    start();
  }
Пример #15
0
void EditStaff::updateInstrument()
      {
      setInterval(instrument.transpose());

      QList<StaffNameDoc>& nl = instrument.shortNames();
      QTextDocumentFragment df = nl.isEmpty() ? QTextDocumentFragment() : nl[0].name;
      shortName->setHtml(df.toHtml());

      nl = instrument.longNames();
      df = nl.isEmpty() ? QTextDocumentFragment() : nl[0].name;
      longName->setHtml(df.toHtml());

      if (partName->text() == instrumentName->text())    // Updates part name is no custom name has been set before
            partName->setText(instrument.trackName());

      instrumentName->setText(instrument.trackName());

      _minPitchA = instrument.minPitchA();
      _maxPitchA = instrument.maxPitchA();
      _minPitchP = instrument.minPitchP();
      _maxPitchP = instrument.maxPitchP();
      minPitchA->setText(midiCodeToStr(_minPitchA));
      maxPitchA->setText(midiCodeToStr(_maxPitchA));
      minPitchP->setText(midiCodeToStr(_minPitchP));
      maxPitchP->setText(midiCodeToStr(_maxPitchP));

      int numStr = instrument.stringData() ? instrument.stringData()->strings() : 0;
      numOfStrings->setText(QString::number(numStr));
      }
Пример #16
0
Tune WinAmpTuneController::getTune(const HWND &hWnd)
{
	Tune tune = Tune();
	int position = (int)SendMessage(hWnd, WM_WA_IPC, 0, IPC_GETLISTPOS);
	if (position != -1) {
		if (hWnd && SendMessage(hWnd,WM_WA_IPC,0,IPC_ISPLAYING) == 1) {
			QPair<bool, QString> trackpair(getTrackTitle(hWnd));
			if (!trackpair.first) {
				// getTrackTitle wants us to retry in a few ms...
				int interval = AntiscrollInterval;
				if (++antiscrollCounter_ > 10) {
					antiscrollCounter_ = 0;
					interval = NormInterval;
				}
				setInterval(interval);
				return Tune();
			}
			antiscrollCounter_ = 0;
			tune.setName(trackpair.second);
			tune.setURL(trackpair.second);
			tune.setTrack(QString::number(position + 1));
			tune.setTime(SendMessage(hWnd, WM_WA_IPC, 1, IPC_GETOUTPUTTIME));
		}
	}
	return tune;
}
Пример #17
0
Config::Config()
{
    auto configPath = QStandardPaths::standardLocations(QStandardPaths::ConfigLocation).first();
    configPath = configPath
                 + "/" + QApplication::organizationName()
                 + "/" + QApplication::applicationName()
                 + "/" + QApplication::applicationName() + ".conf";

    qDebug() << configPath;

    QFileInfo configFile(configPath);
    if (!configFile.exists()) {
        configFile.absoluteDir().mkpath(".");
    }
    m_settings = new DFMDesktopSettings(configPath);
    auto work = new QThread(this);
    this->moveToThread(work);
    work->start();

    auto syncTimer = new QTimer();
    syncTimer->setInterval(2000);
    connect(syncTimer, &QTimer::timeout, this, [ = ]() {
        if (needSync) {
            needSync = false;
            QtConcurrent::run([ = ](){
                m_settings->sync();
            });
        }
    }, Qt::QueuedConnection);
    syncTimer->start();
}
Пример #18
0
void ICACHE_FLASH_ATTR user_events_init() {
	wifi_set_event_handler_cb(user_event_wifi);
	webserver_register_handler_callback(EVENTS_URL, events_handler);
#if EVENTS_SYS_TIMER
	setInterval(user_event_system_timer, NULL, 1000);
#endif
}
Пример #19
0
void Hdd::configChanged()
{
    KConfigGroup cg = config();
    QStringList sources = cg.readEntry("uuids", mounted());
    setSources(sources);
    setInterval(cg.readEntry("interval", 2) * 60 * 1000);
    connectToEngine();
}
Пример #20
0
bool TargetData::setSlotInterval(const Basic::Time* const msg)
{
   bool ok = false;
   if (msg != 0) {
      ok = setInterval( Basic::MilliSeconds::convertStatic(*msg) );
   }
   return ok;
}
Пример #21
0
 TweenAnim::TweenAnim(const ResAnim* resAnim, int startFrame, int endFrame):
     _resAnim(resAnim),
     _row(-1),
     _start(0),
     _end(0)
 {
     setInterval(startFrame, endFrame);
 }
Пример #22
0
DateInterval::DateInterval(const String& date_interval,
                           bool date_string /*= false */) {
  if (date_string) {
    setDateString(date_interval);
  } else {
    setInterval(date_interval);
  }
}
Пример #23
0
bool TargetData::setSlotInterval(const Basic::Number* const msg)
{
   bool ok = false;
   if (msg != 0) {
      ok = setInterval(msg->getDouble());
   }
   return ok;
}
Пример #24
0
// could have just connected signal to slot
// but might want to be more sophisticated in future
void WSModel::onDataChanged() 
{ 
    // calc tau etc and make sure the interval is
    // set correctly - i.e. 'domain of validity'
    deriveCPParameters(4); 
    setInterval(QwtInterval(tau, PDMODEL_MAXT));

}
Пример #25
0
void Timelapse::start(){
    LOG_TIMELAPSE_DEBUG << "Timelapse::start: ";
    //timer->setInterval(timerresolution);
    setInterval(*intervalTime);
    _remote->setTimeLapsMode(true);
    timer->start();
    time->start();
}
Пример #26
0
NotificationTimeout::NotificationTimeout(NotificationModel *m, int id, int timeout)
:QTimer(m), m_id(id), m_model(m) {
		setInterval(timeout);
		setSingleShot(true);
		connect(this, SIGNAL(timeout()),
				this, SLOT(timedOut()));
		start();
}
Пример #27
0
void PausableTimer::pause()
{
    if (isActive()) {
        stop();
        timePaused+=elapsedTimer.elapsed();
        setInterval(interval() - timePaused);
    }
}
int CommonView::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 9)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 9;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< Interval*>(_v) = interval(); break;
        case 1: *reinterpret_cast< ProtConf*>(_v) = getProtSubmit(); break;
        case 2: *reinterpret_cast< bool*>(_v) = showSource(); break;
        case 3: *reinterpret_cast< bool*>(_v) = selectParamsEnabled(); break;
        case 4: *reinterpret_cast< QString*>(_v) = dateTimeFormat(); break;
        case 5: *reinterpret_cast< QFont*>(_v) = font(); break;
        case 6: *reinterpret_cast< QString*>(_v) = printTitle(); break;
        case 7: *reinterpret_cast< QFont*>(_v) = printTitleFont(); break;
        case 8: *reinterpret_cast< QFont*>(_v) = printFont(); break;
        case 9: *reinterpret_cast< bool*>(_v) = getSaveChanges(); break;
        }
        _id -= 10;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setInterval(*reinterpret_cast< Interval*>(_v)); break;
        case 1: setProtConf(*reinterpret_cast< ProtConf*>(_v)); break;
        case 2: setShowSource(*reinterpret_cast< bool*>(_v)); break;
        case 3: setSelectParamsEnabled(*reinterpret_cast< bool*>(_v)); break;
        case 4: setDateTimeFormat(*reinterpret_cast< QString*>(_v)); break;
        case 5: setFont(*reinterpret_cast< QFont*>(_v)); break;
        case 6: setPrintTitle(*reinterpret_cast< QString*>(_v)); break;
        case 7: setPrintTitleFont(*reinterpret_cast< QFont*>(_v)); break;
        case 8: setPrintFont(*reinterpret_cast< QFont*>(_v)); break;
        case 9: setSaveChanges(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 10;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 10;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 10;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 10;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 10;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 10;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 10;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Пример #29
0
int Color_create(lua_State *L)
{
	int argc = lua_gettop(L);
	if (argc != 3 && argc != 4) return luaL_error(L, "Color.create(r,g,b [,a]): wrong number of arguments");
	
	unsigned r,g,b,a = 255;
	
	r = setInterval(luaL_checkint(L, 1), 0, 255);
	g = setInterval(luaL_checkint(L, 2), 0, 255);
	b = setInterval(luaL_checkint(L, 3), 0, 255);
	
	if (argc == 4)
		a = setInterval(luaL_checkint(L, 4), 0, 255);
	
	lua_pushnumber(L, G2D_RGBA(r,g,b,a));
	
	return 1;
}
Пример #30
0
void
PDModel::setMinutes(bool x)
{
    minutes = x;
    if (minutes) {
        setInterval(QwtInterval(1.00f / 60.00f, double(PDMODEL_MAXT)/ 60.00f));
        setSize(PDMODEL_MAXT);
    }
}