コード例 #1
0
ファイル: qwt_plot.cpp プロジェクト: ahinoamp/Research
//! Initialize axes
void QwtPlot::initAxes()
{
    int i;

    QFont fscl("Helvetica", 10);
    QFont fttl("Helvetica", 12, QFont::Bold);


    for(i=0;i<axisCnt;i++)
    {
        d_scale[i]->setFont(fscl);
        d_scale[i]->setTitleFont(fttl);
    }

    d_axisEnabled[yLeft] = TRUE;
    d_axisEnabled[yRight] = FALSE;
    d_axisEnabled[xBottom] = TRUE;
    d_axisEnabled[xTop] = FALSE;

    for (i=0;i<axisCnt;i++)
    {
        d_as[i].adjust(0.0,1000.0,TRUE);
        d_sdiv[i] = d_as[i].scaleDiv();
        d_scale[i]->setScaleDiv(d_sdiv[i]);
    }
}
コード例 #2
0
ファイル: qwt_plot.cpp プロジェクト: jiajw0426/easyscada
//! Initialize axes
void QwtPlot::initAxes()
{
    int axis;

    QFont fscl(fontInfo().family(), 10);
    QFont fttl(fontInfo().family(), 12, QFont::Bold);

    for(axis = 0; axis < axisCnt; axis++)
    {
        d_scale[axis]->setFont(fscl);
        d_scale[axis]->setTitleFont(fttl);
        d_scale[axis]->setBaselineDist(2);
    }

    d_axisEnabled[yLeft] = TRUE;
    d_axisEnabled[yRight] = FALSE;
    d_axisEnabled[xBottom] = TRUE;
    d_axisEnabled[xTop] = FALSE;

    for (axis=0; axis < axisCnt; axis++)
    {
        d_as[axis].adjust(0.0,1000.0,TRUE);
        d_scale[axis]->setScaleDiv(d_as[axis].scaleDiv());
    }
}
コード例 #3
0
//! Initialize axes
void QwtPlot::initAxesData()
{
    int axisId;

    for( axisId = 0; axisId < axisCnt; axisId++)
        d_axisData[axisId] = new AxisData;

    d_axisData[yLeft]->scaleWidget = 
        new QwtScaleWidget(QwtScaleDraw::LeftScale, this);
    d_axisData[yRight]->scaleWidget = 
        new QwtScaleWidget(QwtScaleDraw::RightScale, this);
    d_axisData[xTop]->scaleWidget = 
        new QwtScaleWidget(QwtScaleDraw::TopScale, this);
    d_axisData[xBottom]->scaleWidget = 
        new QwtScaleWidget(QwtScaleDraw::BottomScale, this);


    QFont fscl(fontInfo().family(), 10);
    QFont fttl(fontInfo().family(), 12, QFont::Bold);

    for(axisId = 0; axisId < axisCnt; axisId++)
    {
        AxisData &d = *d_axisData[axisId];

        d.scaleWidget->setFont(fscl);
        d.scaleWidget->setMargin(2);

        QwtText text;
        text.setFont(fttl);
        d.scaleWidget->setTitle(text);

        d.doAutoScale = true;

        d.minValue = 0.0;
        d.maxValue = 1000.0;
        d.stepSize = 0.0;

        d.maxMinor = 5;
        d.maxMajor = 8;

        d.scaleEngine = new QwtLinearScaleEngine;

        d.scaleDiv.invalidate();
    }

    d_axisData[yLeft]->isEnabled = true;
    d_axisData[yRight]->isEnabled = false;
    d_axisData[xBottom]->isEnabled = true;
    d_axisData[xTop]->isEnabled = false;
}
コード例 #4
0
ファイル: qwt_plot_axis.cpp プロジェクト: 0vermind/NeoLoader
//! Initialize axes
void QwtPlot::initAxesData()
{
    int axisId;

    for ( axisId = 0; axisId < axisCnt; axisId++ )
        d_axisData[axisId] = new AxisData;

    d_axisData[yLeft]->scaleWidget =
        new QwtScaleWidget( QwtScaleDraw::LeftScale, this );
    d_axisData[yRight]->scaleWidget =
        new QwtScaleWidget( QwtScaleDraw::RightScale, this );
    d_axisData[xTop]->scaleWidget =
        new QwtScaleWidget( QwtScaleDraw::TopScale, this );
    d_axisData[xBottom]->scaleWidget =
        new QwtScaleWidget( QwtScaleDraw::BottomScale, this );

    d_axisData[yLeft]->scaleWidget->setObjectName( "QwtPlotAxisYLeft" );
    d_axisData[yRight]->scaleWidget->setObjectName( "QwtPlotAxisYRight" );
    d_axisData[xTop]->scaleWidget->setObjectName( "QwtPlotAxisXTop" );
    d_axisData[xBottom]->scaleWidget->setObjectName( "QwtPlotAxisXBottom" );

#if 1
    // better find the font sizes from the application font
    QFont fscl( fontInfo().family(), 10 );
    QFont fttl( fontInfo().family(), 12, QFont::Bold );
#endif

    for ( axisId = 0; axisId < axisCnt; axisId++ )
    {
        AxisData &d = *d_axisData[axisId];

        d.scaleEngine = new QwtLinearScaleEngine;

        d.scaleWidget->setTransformation( 
            d.scaleEngine->transformation() );

        d.scaleWidget->setFont( fscl );
        d.scaleWidget->setMargin( 2 );

        QwtText text = d.scaleWidget->title();
        text.setFont( fttl );
        d.scaleWidget->setTitle( text );

        d.doAutoScale = true;

        d.minValue = 0.0;
        d.maxValue = 1000.0;
        d.stepSize = 0.0;

        d.maxMinor = 5;
        d.maxMajor = 8;


        d.isValid = false;
    }

    d_axisData[yLeft]->isEnabled = true;
    d_axisData[yRight]->isEnabled = false;
    d_axisData[xBottom]->isEnabled = true;
    d_axisData[xTop]->isEnabled = false;
}