author | sandman <sandman> | 2002-10-28 23:46:23 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-10-28 23:46:23 (UTC) |
commit | 4251429b30aaf4175c74f714ee01d59368c950f4 (patch) (unidiff) | |
tree | 717fb8fd8f17780c86b4bca84acd490f3191d0bf /core/settings/light-and-power/sensor.cpp | |
parent | a775c3be38fc7fbd5d120e7e3c1dd3a80a250293 (diff) | |
download | opie-4251429b30aaf4175c74f714ee01d59368c950f4.zip opie-4251429b30aaf4175c74f714ee01d59368c950f4.tar.gz opie-4251429b30aaf4175c74f714ee01d59368c950f4.tar.bz2 |
- some minor UI fixes
- parameters for sensor light range were reversed
- added reasonable calibration default values (at least on my 3870)
- l&p now automatically shows the 'right' (Batt/AC) tab when started
Diffstat (limited to 'core/settings/light-and-power/sensor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/settings/light-and-power/sensor.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/core/settings/light-and-power/sensor.cpp b/core/settings/light-and-power/sensor.cpp index ddd71d6..c1df04d 100644 --- a/core/settings/light-and-power/sensor.cpp +++ b/core/settings/light-and-power/sensor.cpp | |||
@@ -33,53 +33,53 @@ | |||
33 | #include "calibration.h" | 33 | #include "calibration.h" |
34 | #include "sensor.h" | 34 | #include "sensor.h" |
35 | 35 | ||
36 | Sensor::Sensor ( QStringList ¶ms, QWidget *parent, const char *name ) | 36 | Sensor::Sensor ( QStringList ¶ms, QWidget *parent, const char *name ) |
37 | : SensorBase ( parent, name, true, WStyle_ContextHelp ), m_params ( params ) | 37 | : SensorBase ( parent, name, true, WStyle_ContextHelp ), m_params ( params ) |
38 | { | 38 | { |
39 | int steps = 5; | 39 | int steps = 12; |
40 | int inter = 5; | 40 | int inter = 2; |
41 | 41 | ||
42 | int smin = 0; | 42 | int smin = 40; |
43 | int smax = 255; | 43 | int smax = 215; |
44 | int lmin = 0; | 44 | int lmin = 1; |
45 | int lmax = 255; | 45 | int lmax = 255; |
46 | 46 | ||
47 | switch ( params. count ( )) { | 47 | switch ( params. count ( )) { |
48 | case 6: lmax = params [5]. toInt ( ); | 48 | case 6: lmax = params [5]. toInt ( ); |
49 | case 5: lmin = params [4]. toInt ( ); | 49 | case 5: lmin = params [4]. toInt ( ); |
50 | case 4: smax = params [3]. toInt ( ); | 50 | case 4: smax = params [3]. toInt ( ); |
51 | case 3: smin = params [2]. toInt ( ); | 51 | case 3: smin = params [2]. toInt ( ); |
52 | case 2: steps = params [1]. toInt ( ); | 52 | case 2: steps = params [1]. toInt ( ); |
53 | case 1: inter = params [0]. toInt ( ); | 53 | case 1: inter = params [0]. toInt ( ) / 1000; |
54 | } | 54 | } |
55 | 55 | ||
56 | QVBoxLayout *lay = new QVBoxLayout ( frame ); | 56 | QVBoxLayout *lay = new QVBoxLayout ( frame ); |
57 | lay-> setMargin ( 2 ); | 57 | lay-> setMargin ( 2 ); |
58 | m_calib = new Calibration ( frame ); | 58 | m_calib = new Calibration ( frame ); |
59 | lay-> add ( m_calib ); | 59 | lay-> add ( m_calib ); |
60 | 60 | ||
61 | m_calib-> setScale ( QSize ( 256, 256 )); | 61 | m_calib-> setScale ( QSize ( 256, 256 )); |
62 | m_calib-> setLineSteps ( steps ); | 62 | m_calib-> setLineSteps ( steps ); |
63 | m_calib-> setInterval ( inter ); | 63 | m_calib-> setInterval ( inter ); |
64 | m_calib-> setStartPoint ( QPoint ( smin, lmin )); | 64 | m_calib-> setStartPoint ( QPoint ( smin, lmax )); |
65 | m_calib-> setEndPoint ( QPoint ( smax, lmax )); | 65 | m_calib-> setEndPoint ( QPoint ( smax, lmin )); |
66 | 66 | ||
67 | interval-> setValue ( inter ); | 67 | interval-> setValue ( inter ); |
68 | linesteps-> setValue ( steps ); | 68 | linesteps-> setValue ( steps ); |
69 | 69 | ||
70 | connect ( interval, SIGNAL( valueChanged ( int )), m_calib, SLOT( setInterval ( int ))); | 70 | connect ( interval, SIGNAL( valueChanged ( int )), m_calib, SLOT( setInterval ( int ))); |
71 | connect ( linesteps, SIGNAL( valueChanged ( int )), m_calib, SLOT( setLineSteps ( int ))); | 71 | connect ( linesteps, SIGNAL( valueChanged ( int )), m_calib, SLOT( setLineSteps ( int ))); |
72 | } | 72 | } |
73 | 73 | ||
74 | void Sensor::accept ( ) | 74 | void Sensor::accept ( ) |
75 | { | 75 | { |
76 | m_params. clear ( ); | 76 | m_params. clear ( ); |
77 | m_params << QString::number ( m_calib-> interval ( )) | 77 | m_params << QString::number ( m_calib-> interval ( ) * 1000 ) |
78 | << QString::number ( m_calib-> lineSteps ( )) | 78 | << QString::number ( m_calib-> lineSteps ( )) |
79 | << QString::number ( m_calib-> startPoint ( ). x ( )) | 79 | << QString::number ( m_calib-> startPoint ( ). x ( )) |
80 | << QString::number ( m_calib-> endPoint ( ). x ( )) | 80 | << QString::number ( m_calib-> endPoint ( ). x ( )) |
81 | << QString::number ( m_calib-> startPoint ( ). y ( )) | 81 | << QString::number ( m_calib-> endPoint ( ). y ( )) |
82 | << QString::number ( m_calib-> endPoint ( ). y ( )); | 82 | << QString::number ( m_calib-> startPoint ( ). y ( )); |
83 | 83 | ||
84 | QDialog::accept ( ); | 84 | QDialog::accept ( ); |
85 | } | 85 | } |