Re-format code

This commit is contained in:
2017-03-23 04:29:34 +00:00
parent fd68d340bd
commit ebc10d1b84
85 changed files with 8092 additions and 4419 deletions
+20 -9
View File
@@ -92,16 +92,20 @@ PlotSubWindow::PlotSubWindow( const QString& windowTitle, QWidget* parent )
m_cPlotArea->xAxis2->setTickLabels( false );
m_cPlotArea->yAxis2->setVisible( true );
m_cPlotArea->yAxis2->setTickLabels( false );
// make left and bottom axes always transfer their ranges to right and top axes:
connect( m_cPlotArea->xAxis, SIGNAL( rangeChanged( QCPRange ) ), m_cPlotArea->xAxis2, SLOT( setRange( QCPRange ) ) );
connect( m_cPlotArea->yAxis, SIGNAL( rangeChanged( QCPRange ) ), m_cPlotArea->yAxis2, SLOT( setRange( QCPRange ) ) );
// make left and bottom axes always transfer their ranges to right and top
// axes:
connect( m_cPlotArea->xAxis, SIGNAL( rangeChanged( QCPRange ) ), m_cPlotArea->xAxis2,
SLOT( setRange( QCPRange ) ) );
connect( m_cPlotArea->yAxis, SIGNAL( rangeChanged( QCPRange ) ), m_cPlotArea->yAxis2,
SLOT( setRange( QCPRange ) ) );
QFont legendFont = font(); // start out with MainWindow's font..
legendFont.setPointSize( 9 ); // and make a bit smaller for legend
m_cPlotArea->legend->setFont( legendFont );
m_cPlotArea->legend->setBrush( backgroundBrush );
m_cPlotArea->legend->setTextColor( palette().text().color() );
m_cPlotArea->legend->setBorderPen( QPen( palette().brush( QPalette::Active, QPalette::Shadow ), 1 ) );
m_cPlotArea->legend->setBorderPen(
QPen( palette().brush( QPalette::Active, QPalette::Shadow ), 1 ) );
m_cPlotArea->legend->setVisible( false );
m_cPlotArea->setInteractions( QCP::iRangeZoom | QCP::iRangeDrag ); // QCP::iSelectPlottables
@@ -148,8 +152,10 @@ Void PlotSubWindow::scaleView( Double scale, QPoint center )
// for( UInt dim = 0; dim < 2; dim++ )
// aNewAxisRange[axis][dim] = m_aAxisRange[axis][dim] / m_dScaleFactor;
//
// m_cPlotArea->xAxis->setRange( aNewAxisRange[HORIZONTAL][0], aNewAxisRange[HORIZONTAL][1] );
// m_cPlotArea->yAxis->setRange( aNewAxisRange[VERTICAL][0], aNewAxisRange[VERTICAL][1] );
// m_cPlotArea->xAxis->setRange( aNewAxisRange[HORIZONTAL][0],
// aNewAxisRange[HORIZONTAL][1] );
// m_cPlotArea->yAxis->setRange( aNewAxisRange[VERTICAL][0],
// aNewAxisRange[VERTICAL][1] );
m_cPlotArea->xAxis->scaleRange( scale, 0 );
m_cPlotArea->yAxis->scaleRange( scale, 0 );
@@ -188,7 +194,9 @@ Void PlotSubWindow::setAxisRange( const QLine& axisLimits )
setAxisRange( VERTICAL, axisLimits.y1(), axisLimits.y2() );
}
Void PlotSubWindow::setAxisRange( PlotSubWindow::Axis eAxis, const Int& axisStart, const Int& axisEnd )
Void PlotSubWindow::setAxisRange( PlotSubWindow::Axis eAxis,
const Int& axisStart,
const Int& axisEnd )
{
if( eAxis == HORIZONTAL )
{
@@ -207,7 +215,9 @@ Void PlotSubWindow::setAxisRange( PlotSubWindow::Axis eAxis, const Int& axisStar
m_cPlotArea->replot();
}
Void PlotSubWindow::addPlot( const QVector<Double>& arrayX, const QVector<Double>& arrayY, const QString& key )
Void PlotSubWindow::addPlot( const QVector<Double>& arrayX,
const QVector<Double>& arrayY,
const QString& key )
{
QCPGraph* newPlot = m_cPlotArea->addGraph();
QColor plotColor = m_arrayColorList.at( 0 );
@@ -219,7 +229,8 @@ Void PlotSubWindow::addPlot( const QVector<Double>& arrayX, const QVector<Double
newPlot->setPen( m_cPlotPen ); // line style
// pass data points to graphs:
newPlot->setData( arrayX, arrayY );
// let the ranges scale themselves so graph 0 fits perfectly in the visible area:
// let the ranges scale themselves so graph 0 fits perfectly in the visible
// area:
newPlot->rescaleAxes( m_iNumberPlots > 1 ? true : false );
if( !key.isEmpty() )