Exemplo n.º 1
0
Histogram_gui::Histogram_gui( GsTL_project* project, 
                              QWidget* parent, const char* name )
: Data_analysis_gui( parent, name ),
  histogram_( 0 ) {

  //TL modified
  _cdfCurve = new QwtPlotCurve("cdfcurve");
  _cdfCurve->setAxis(QwtPlot::xBottom, QwtPlot::yRight);
  _cdfCurve->attach(plot_);

  plot_->enableAxis(QwtPlot::yRight);
  plot_->setAxisAutoScale(QwtPlot::yRight);


  setWindowTitle( "Histogram" );
 
  histogram_ = new Histogram;

  enable_y_log_scaling( false );

  control_panel_ = 
    new Histogram_control_panel( project, controls_box_, "control_panel" );

  QStringList stats_labels;
  stats_labels << "Number of Data" << "  " << "Mean" << "Variance" << "  ";
  stats_labels << "   " << "  " << "   " << "   " << "  ";
  stats_labels << "Maximum" << "Upper Quartile" << "Median" 
               << "Lower Quartile" << "Minimum";
  set_stats_labels( stats_labels, 5 );


  // set the plotting style (curve style, etc)
  curve_id_->setStyle(QwtPlotCurve::Histogram );


  // Signal-slot connections
  QObject::connect( control_panel_, 
                    SIGNAL( var_changed(  GsTLGridProperty*,  const GsTLGridRegion* ) ),
                    this,
                    SLOT( get_data_from(  GsTLGridProperty*,  const GsTLGridRegion* ) ) );


  QObject::connect( control_panel_, SIGNAL( low_clip_changed(float) ),
                    this, SLOT( update_low_clip(float) ) );
  QObject::connect( control_panel_, SIGNAL( high_clip_changed(float) ),
                    this, SLOT( update_high_clip(float) ) );
  QObject::connect( control_panel_,
                    SIGNAL( reset_clipping_values_clicked() ),
                    this, SLOT( reset_clipping_values() ) );

  QObject::connect( control_panel_,
                    SIGNAL( bins_count_changed( int ) ),
                    this, SLOT( update_bins( int ) ) );

  //TL modified
  QObject::connect(control_panel_, SIGNAL(comboChanged(const QString &)), this, 
				   SLOT(changeCurve(const QString &)));


}
Exemplo n.º 2
0
QPplot_gui::QPplot_gui( GsTL_project* project,
                        QWidget* parent, const char* name ) 
  : Data_analysis_gui( parent, name ){
 
  setCaption( "QQ/PP Plot" );

  qpploter_ = new QPplot();

/*
  QScrollView* scrollview = new QScrollView( controls_box_, "scrollview" );
  scrollview->setFrameShape( QFrame::Panel );
  scrollview->setFrameShadow( QFrame::Sunken );
  scrollview->setLineWidth( 1 );
  scrollview->setMidLineWidth( 0 );
  control_panel_ = 
    new QPplot_control_panel( project, scrollview->viewport(), "control_panel" );
  scrollview->addChild( control_panel_ );
  scrollview->setResizePolicy( QScrollView::AutoOneFit );
*/
  init_scrollview();
  control_panel_ = 
    new QPplot_control_panel( project, scrollview_->viewport(), "control_panel" );
  scrollview_->addChild( control_panel_ );


  // Set up the statitics labels
  QStringList stats_labels;
  stats_labels << "X variable" << " " << "Number of data"
               << "Mean" << "Variance" 
               << "  " << "  " << "  " << "  " << "   "
               << "Y variable" << " " << "Number of data"
               << "Mean" << "Variance";
  set_stats_labels( stats_labels, 5 );


  plot_->setAxisOptions( QwtPlot::yLeft, QwtAutoScale::Floating );

  // set the plotting style (curve style, etc)
  QwtSymbol sym( QwtSymbol::Ellipse, QBrush( Qt::black ), QPen( Qt::black ),
                 QSize( 6,6 ) );
  plot_->setCurveSymbol( curve_id_, sym );
  plot_->setCurveStyle( curve_id_, QwtCurve::Dots );


  // Signal-slot connections
  QObject::connect( control_panel_, 
                    SIGNAL( var1_changed( const GsTLGridProperty* ) ),
                    this,
                    SLOT( get_var1_data_from( const GsTLGridProperty* ) ) );
  
  QObject::connect( control_panel_, 
                    SIGNAL( var2_changed( const GsTLGridProperty* ) ),
                    this,
                    SLOT( get_var2_data_from( const GsTLGridProperty* ) ) );
   
  QObject::connect( control_panel_, 
                    SIGNAL( analysis_type_changed( const QString& ) ),
                    this, SLOT( set_analysis_type( const QString& ) ) );
  
  QObject::connect( control_panel_, SIGNAL( var1_low_clip_changed(float) ),
                    this, SLOT( update_var1_low_clip(float) ) );
  QObject::connect( control_panel_, SIGNAL( var1_high_clip_changed(float) ),
                    this, SLOT( update_var1_high_clip(float) ) );
  QObject::connect( control_panel_,
                    SIGNAL( reset_var1_clipping_values_clicked() ),
                    this, SLOT( reset_var1_clipping_values() ) );

  QObject::connect( control_panel_, SIGNAL( var2_low_clip_changed(float) ),
                    this, SLOT( update_var2_low_clip(float) ) );
  QObject::connect( control_panel_, SIGNAL( var2_high_clip_changed(float) ),
                    this, SLOT( update_var2_high_clip(float) ) );
  QObject::connect( control_panel_,
                    SIGNAL( reset_var2_clipping_values_clicked() ),
                    this, SLOT( reset_var2_clipping_values() ) );

}