61d890042dc213f7d4694791d27e7ffdc9c4038d
[mussa.git] / qui / ThresholdWidget.hpp
1 #ifndef _THRESHOLD_WIDGET_H_ 
2 #define _THRESHOLD_WIDGET_H_
3
4 #include <QLabel>
5 #include <QSpinBox>
6 #include <QWidget>
7
8 class ThresholdWidget : public QWidget
9 {
10   Q_OBJECT 
11
12 public: 
13   ThresholdWidget(QWidget *parent = 0, int min=20, int max=30);
14
15   //! return min_threshold/max_threshold
16   double min_ratio() const;
17   //! return current_threshold/maximum_threshold
18   double ratio() const;
19   //! return our current threshold
20   int threshold() const;
21   //! update percent threshold
22   void updatePercentThreshold();
23
24 public slots:
25   void setBasepairThreshold(int threshold);
26   //void setPercentThreshold(int percent_threshold);
27   //! set the min and max base pair range
28   void setRange(int min, int max);
29
30 signals:
31   //! the current number of base pairs needed for a window of conservation
32   void thresholdChanged(int new_threshold);
33
34 protected:
35   QSpinBox basepair_spinner;
36   QLabel window_size_label;
37   QLabel percent_label;
38
39   int cur_bp_threshold;
40   int cur_percent_threshold;
41 };
42 const int threshold_max_display_digits = 2;
43
44 #endif