예제 #1
0
/*!
  Recalculate the scale division and update the scale.

  \param lowerBound Lower limit of the scale interval
  \param upperBound Upper limit of the scale interval
  \param stepSize Major step size

  \sa scaleChange()
*/
void QwtAbstractScale::rescale(
    double lowerBound, double upperBound, double stepSize )
{
    const QwtScaleDiv scaleDiv = d_data->scaleEngine->divideScale(
        lowerBound, upperBound, d_data->maxMajor, d_data->maxMinor, stepSize );

    if ( scaleDiv != d_data->scaleDraw->scaleDiv() )
    {
#if 1
        d_data->scaleDraw->setTransformation(
            d_data->scaleEngine->transformation() );
#endif

        d_data->scaleDraw->setScaleDiv( scaleDiv );
        scaleChange();
    }
}
예제 #2
0
/*!
  \brief Specify a scale.

  scaleMaxMinor(), scaleMaxMajor() and scaleStepSize() and have no effect.

  \param scaleDiv Scale division
  \sa setAutoScale()
*/
void QwtAbstractScale::setScale( const QwtScaleDiv &scaleDiv )
{
    if ( scaleDiv != d_data->scaleDraw->scaleDiv() )
    {
#if 1
        if ( d_data->scaleEngine )
        {
            d_data->scaleDraw->setTransformation(
                d_data->scaleEngine->transformation() );
        }
#endif

        d_data->scaleDraw->setScaleDiv( scaleDiv );

        scaleChange();
    }
}
MotionBase::MotionBase(FilmParameters* c_film, OMdeviceInfo* c_dev, AxisOptions *c_aopts, GlobalOptions *c_gopts, QWidget *parent) : QWidget(parent), ui(new Ui::MotionBase) {
    ui->setupUi(this);

    m_area = new MotionArea(c_film, c_dev, c_aopts, c_gopts, this);
    ui->gridLayout->addWidget(m_area, 0, 2, 1, 1);

    m_opts = c_aopts;
    m_film = c_film;
     m_dev = c_dev;
    m_addr = m_dev->device->address();


    // OSX has issues laying out these buttons w/o overlap,
    // this is a work-around
#ifdef Q_WS_MAC
    ui->scaleButton->setAttribute(Qt::WA_LayoutUsesWidgetRect);
    ui->resButton->setAttribute(Qt::WA_LayoutUsesWidgetRect);
    ui->easeButton->setAttribute(Qt::WA_LayoutUsesWidgetRect);
    ui->muteButton->setAttribute(Qt::WA_LayoutUsesWidgetRect);
    ui->delButton->setAttribute(Qt::WA_LayoutUsesWidgetRect);
    ui->errorButton->setAttribute(Qt::WA_LayoutUsesWidgetRect);
    ui->masterButton->setAttribute(Qt::WA_LayoutUsesWidgetRect);
#endif

    ui->nameButton->setText(c_dev->name);
    ui->resButton->setText(" R "); // default is rapid mode
    ui->scaleButton->setText(" P ");

    ui->dispLCD->setToolTip(MB_STR_POS);

        // by default this is hidden
    ui->errorButton->hide();

        // set correct state for master button
    OMaxisOptions* opts = m_opts->getOptions(m_addr);

    if( opts->master == true ) {
        ui->masterButton->setState(1);
        ui->masterButton->setToolTip(MB_STR_ISM);
    }
    else {
        ui->masterButton->setState(0);
        ui->masterButton->setToolTip(MB_STR_NTM);
    }

        // pass through click signal
    connect(ui->scaleButton, SIGNAL(clicked()), m_area, SLOT(scaleChange()));
    connect(ui->muteButton, SIGNAL(clicked()), m_area, SLOT(mute()));

    connect(m_area, SIGNAL(scaleChanged(bool)), this, SLOT(curScale(bool)));
    connect(m_area, SIGNAL(muted(int)), this, SLOT(muted(int)));

    connect(m_area, SIGNAL(globalPosition(int,int)), this, SIGNAL(areaBorders(int,int)));
    connect(this, SIGNAL(playStatus(bool)), m_area, SLOT(playStatus(bool)));

    connect(m_opts, SIGNAL(deviceOptionsChanged(OMaxisOptions*,unsigned short)), this, SLOT(deviceOptionsChanged(OMaxisOptions*,unsigned short)));

    // theming

    Themer* theme = &Singleton<Themer>::Instance();
    connect(theme, SIGNAL(themeChanged()), this, SLOT(_themeChanged()));

    setStyleSheet(theme->getThemeCSS("motionbase"));

}