Load saved muway and set to muways soft threshold.
[mussa.git] / qui / ThresholdWidget.hpp
1 #ifndef _THRESHOLD_WIDGET_H_ 
2 #define _THRESHOLD_WIDGET_H_
3
4 #include <QHBoxLayout>
5 #include <QLabel>
6 #include <QSpinBox>
7 #include <QWidget>
8
9 class ThresholdWidget : public QWidget
10 {
11   Q_OBJECT 
12
13 public: 
14   ThresholdWidget(QWidget *parent = 0, int min=20, int max=30);
15   
16   //! is the widget in read only mode
17   bool isReadOnly() const;
18   //! set the widget to specified read only state
19   void setReadOnly(bool);
20
21   //! return min_threshold/max_threshold
22   double min_ratio() const;
23   //! return current_threshold/maximum_threshold
24   double ratio() const;
25   //! return our current threshold
26   int threshold() const;
27   //! update percent threshold
28   void updatePercentThreshold();
29   
30   void reset(int min, int max, int threshold);
31
32 public slots:
33   void setBasepairThreshold(int threshold);
34   //void setPercentThreshold(int percent_threshold);
35   //! set the min and max base pair range
36   void setRange(int min, int max);
37
38 signals:
39   //! the current number of base pairs needed for a window of conservation
40   void thresholdChanged(int new_threshold);
41
42 protected:
43   void setupWidgets();
44   QHBoxLayout *layout;
45   QSpinBox *basepair_spinner;
46   QLabel *window_size_label;
47   QLabel *percent_label;
48
49   int cur_bp_threshold;
50   int cur_percent_threshold;
51 };
52 const int threshold_max_display_digits = 2;
53
54 #endif