Exemplo n.º 1
0
/*!
    \fn void QtopiaPowerManager::setDefaultIntervals()

    Resets the intervals to the default configuration for the power manager.
    The default values are defined in configuration files and can be edited
    by the user using the Power Management application.
*/
void QtopiaPowerManager::setDefaultIntervals() {
    int v[3];
    v[0]=-1;
    v[1]=-1;
    v[2]=-1;
    setIntervals(v, sizeof(v)/sizeof(int));
}
Exemplo n.º 2
0
void Plot::add() {
    Q_ASSERT(plotWidget && x && y && x->size()==y->size());
    setIntervals();
    for (int i = 0; i < intervals.size(); ++i) {
        QwtPlotCurve *curve = new QwtPlotCurve(yLegend);
        curve->setItemAttribute(QwtPlotItem::Legend, showLegend && i==0);
        plotWidget->addCurve(curve);

        if (type == Trace::Symbols) {
            curve->setStyle(QwtPlotCurve::NoCurve);
        }
        if (type == Trace::Symbols || type == Trace::Both) {
            Q_ASSERT(symbol);
            curve->setSymbol(symbol);
        }
        if (type == Trace::Line || type == Trace::Both) {
            curve->setPen(pen);
        }
        Interval iv = intervals[i];
        int numPoints = iv.second - iv.first + 1;
        if (numPoints <=0 )
        Q_ASSERT(numPoints > 0);
        curve->setSamples(x->data() + iv.first, y->data() + iv.first, numPoints);
    }

}
Exemplo n.º 3
0
void FractalControl::setIntervals()
{
  const QStringList sl(m_intervalsEdit->text().split(","));
  
  if (sl.size() == 4)
  {
    setIntervals(
      QwtInterval(sl[0].toDouble(), sl[1].toDouble()),    
      QwtInterval(sl[2].toDouble(), sl[3].toDouble()));
      
    emit changedIntervals();
  }
}
Exemplo n.º 4
0
IntervalEdit::IntervalEdit( CalendarDay *day, QWidget *parent)
    : IntervalEditImpl(parent)
{
    //kDebug(planDbg());
    if ( day ) {
        const QList<TimeInterval*> &intervals = day->timeIntervals();
        setIntervals( intervals );
        if ( ! intervals.isEmpty() ) {
            startTime->setTime( intervals.last()->endTime() );
            qreal l = ( intervals.last()->endTime().msecsTo( QTime().addMSecs( -1 ) ) + 1 )  / (1000.0*60.0*60.0);
            length->setValue( qMin( l, (qreal) 8.0 ) );
        }
    }
    enableButtons();
    startTime->setFocus();
}
Exemplo n.º 5
0
void FractalControl::addControls(QToolBar* toolbar)
{
  m_coloursEdit = new QSpinBox();
  m_coloursEdit->setMaximum(8192);
  m_coloursEdit->setMinimum(2);
  m_coloursEdit->setValue(m_geo.colours().size());
  m_coloursEdit->setToolTip("colours");
  
  m_coloursMinWaveEdit = new QSpinBox();
  m_coloursMinWaveEdit->setMinimum(min_wave);
  m_coloursMinWaveEdit->setMaximum(max_wave);
  m_coloursMinWaveEdit->setToolTip("min wavelength colour");
  m_coloursMinWaveEdit->setValue(m_geo.m_coloursMinWave);
  
  m_coloursMaxWaveEdit = new QSpinBox();
  m_coloursMaxWaveEdit->setMinimum(min_wave);
  m_coloursMaxWaveEdit->setMaximum(max_wave);
  m_coloursMaxWaveEdit->setToolTip("max wavelength colour");
  m_coloursMaxWaveEdit->setValue(m_geo.m_coloursMaxWave);
  
  m_depthEdit = new QSpinBox();
  m_depthEdit->setRange(1, 999999);
  m_depthEdit->setValue(m_geo.m_depth);
  m_depthEdit->setToolTip("depth");
  
  m_imagesSizeEdit = new QLineEdit();
  m_imagesSizeEdit->setToolTip("images max size");
  m_imagesSizeEdit->setValidator(new QRegExpValidator(QRegExp(size_regexp)));
  m_imagesSizeEdit->setEnabled(false);
  m_imagesSizeEdit->setText(
    QString::number(m_geo.m_imagesSize.width()) + "," + QString::number(m_geo.m_imagesSize.height()));

  m_intervalsEdit = new QLineEdit();
  m_intervalsEdit->setToolTip("interval x,y");
  m_intervalsEdit->setValidator(new QRegExpValidator(QRegExp(intervals_regexp)));
  m_intervalsEdit->setText(
    QString::number(m_geo.m_intervalX.minValue()) + "," + QString::number(m_geo.m_intervalX.maxValue()) + "," +
    QString::number(m_geo.m_intervalY.minValue()) + "," + QString::number(m_geo.m_intervalY.maxValue()));
  
  m_useImagesEdit = new QCheckBox("Images");
  m_useImagesEdit->setToolTip("use images");

  connect(m_colourDialog, SIGNAL(colorSelected(const QColor&)),
    this, SLOT(setColour(const QColor&)));
  connect(m_coloursEdit, SIGNAL(valueChanged(int)),
    this, SLOT(setColoursMax(int)));
  connect(m_coloursMinWaveEdit, SIGNAL(valueChanged(int)),
    this, SLOT(setColoursMinWave(int)));
  connect(m_coloursMaxWaveEdit, SIGNAL(valueChanged(int)),
    this, SLOT(setColoursMaxWave(int)));
  connect(m_depthEdit, SIGNAL(valueChanged(int)),
    this, SLOT(setDepth(int)));
  connect(m_imagesSizeEdit, SIGNAL(returnPressed()),
    this, SLOT(setImagesSize()));
  connect(m_intervalsEdit, SIGNAL(returnPressed()),
    this, SLOT(setIntervals()));
  connect(m_useImagesEdit, SIGNAL(stateChanged(int)),
    this, SLOT(setUseImages(int)));
    
  toolbar->addWidget(m_depthEdit);
  toolbar->addWidget(m_intervalsEdit);
  toolbar->addSeparator();
  toolbar->addWidget(m_coloursEdit);
  toolbar->addWidget(m_coloursMinWaveEdit);
  toolbar->addWidget(m_coloursMaxWaveEdit);
  toolbar->addSeparator();
  toolbar->addWidget(m_useImagesEdit);
  toolbar->addWidget(m_imagesSizeEdit);
}