Exemple #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 &)));


}
Histogram_control_panel::
Histogram_control_panel( GsTL_project* proj,
                         QWidget* parent, const char* name ) 
  : Histogram_control_panel_base( parent, name ) {
  
  property_selector_box_->setOrientation( Qt::Vertical );
  property_selector_box_->setColumns( 1 );
  property_selector_box_->setInsideMargin( 0 );
  property_selector_box_->setInsideSpacing( 0 );
  object_selector_ = new PropertySelector( property_selector_box_,
                                           "object_selector_" );

  //TL modified
  _curves_box->setOrientation( Qt::Vertical );
  _curves_box->setColumns( 1 );
  _combo = new QComboBox(_curves_box, "combo");
  _combo->insertItem("pdf");
  _combo->insertItem("cdf");
  _combo->insertItem("pdf+cdf");

  init( proj );

  // forward signals
   QObject::connect( object_selector_,
                    SIGNAL( property_changed( const QString& ) ),
                    this,
                    SLOT( forward_var_changed( const QString& ) ) );

  QObject::connect( (QObject*) minval_edit_, SIGNAL( returnPressed() ),
                    this, SLOT( forward_low_clip_changed() ) );
  QObject::connect( (QObject*) maxval_edit_, SIGNAL( returnPressed() ),
                    this, SLOT( forward_high_clip_changed() ) );
  QObject::connect( (QObject*) reset_clips_button_, SIGNAL( clicked() ),
                    SIGNAL( reset_clipping_values_clicked() ) );

  QObject::connect( bins_spinbox_, SIGNAL( valueChanged( int ) ),
                    SIGNAL( bins_count_changed( int ) ) );

  QObject::connect( _combo, SIGNAL( activated( const QString & ) ),
                    SIGNAL( comboChanged( const QString & ) ) );


}