Subversion Repositories ALCASAR

Rev

Rev 2788 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log

Rev 2788 Rev 2976
1
<?php
1
<?php
2
/**
2
/**
3
 * SensorDevice TO class
3
 * SensorDevice TO class
4
 *
4
 *
5
 * PHP version 5
5
 * PHP version 5
6
 *
6
 *
7
 * @category  PHP
7
 * @category  PHP
8
 * @package   PSI_TO
8
 * @package   PSI_TO
9
 * @author    Michael Cramer <BigMichi1@users.sourceforge.net>
9
 * @author    Michael Cramer <BigMichi1@users.sourceforge.net>
10
 * @copyright 2009 phpSysInfo
10
 * @copyright 2009 phpSysInfo
11
 * @license   http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
11
 * @license   http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
12
 * @version   SVN: $Id: class.SensorDevice.inc.php 592 2012-07-03 10:55:51Z namiltd $
12
 * @version   SVN: $Id: class.SensorDevice.inc.php 592 2012-07-03 10:55:51Z namiltd $
13
 * @link      http://phpsysinfo.sourceforge.net
13
 * @link      http://phpsysinfo.sourceforge.net
14
 */
14
 */
15
 /**
15
 /**
16
 * SensorDevice TO class
16
 * SensorDevice TO class
17
 *
17
 *
18
 * @category  PHP
18
 * @category  PHP
19
 * @package   PSI_TO
19
 * @package   PSI_TO
20
 * @author    Michael Cramer <BigMichi1@users.sourceforge.net>
20
 * @author    Michael Cramer <BigMichi1@users.sourceforge.net>
21
 * @copyright 2009 phpSysInfo
21
 * @copyright 2009 phpSysInfo
22
 * @license   http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
22
 * @license   http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
23
 * @version   Release: 3.0
23
 * @version   Release: 3.0
24
 * @link      http://phpsysinfo.sourceforge.net
24
 * @link      http://phpsysinfo.sourceforge.net
25
 */
25
 */
26
class SensorDevice
26
class SensorDevice
27
{
27
{
28
    /**
28
    /**
29
     * name of the sensor
29
     * name of the sensor
30
     *
30
     *
31
     * @var String
31
     * @var String
32
     */
32
     */
33
    private $_name = "";
33
    private $_name = "";
34
 
34
 
35
    /**
35
    /**
36
     * current value of the sensor
36
     * current value of the sensor
37
     *
37
     *
38
     * @var Integer
38
     * @var Integer
39
     */
39
     */
40
    private $_value = 0;
40
    private $_value = 0;
41
 
41
 
42
    /**
42
    /**
43
     * maximum value of the sensor
43
     * maximum value of the sensor
44
     *
44
     *
45
     * @var Integer
45
     * @var Integer
46
     */
46
     */
47
    private $_max = null;
47
    private $_max = null;
48
 
48
 
49
    /**
49
    /**
50
     * minimum value of the sensor
50
     * minimum value of the sensor
51
     *
51
     *
52
     * @var Integer
52
     * @var Integer
53
     */
53
     */
54
    private $_min = null;
54
    private $_min = null;
55
 
55
 
56
    /**
56
    /**
57
     * event of the sensor
57
     * event of the sensor
58
     *
58
     *
59
     * @var String
59
     * @var String
60
     */
60
     */
61
    private $_event = "";
61
    private $_event = "";
62
 
62
 
63
    /**
63
    /**
-
 
64
     * unit of values of the sensor
-
 
65
     *
-
 
66
     * @var String
-
 
67
     */
-
 
68
    private $_unit = "";
-
 
69
 
-
 
70
    /**
64
     * Returns $_max.
71
     * Returns $_max.
65
     *
72
     *
66
     * @see Sensor::$_max
73
     * @see Sensor::$_max
67
     *
74
     *
68
     * @return Integer
75
     * @return Integer
69
     */
76
     */
70
    public function getMax()
77
    public function getMax()
71
    {
78
    {
72
        return $this->_max;
79
        return $this->_max;
73
    }
80
    }
74
 
81
 
75
    /**
82
    /**
76
     * Sets $_max.
83
     * Sets $_max.
77
     *
84
     *
78
     * @param Integer $max maximum value
85
     * @param Integer $max maximum value
79
     *
86
     *
80
     * @see Sensor::$_max
87
     * @see Sensor::$_max
81
     *
88
     *
82
     * @return Void
89
     * @return Void
83
     */
90
     */
84
    public function setMax($max)
91
    public function setMax($max)
85
    {
92
    {
86
        $this->_max = $max;
93
        $this->_max = $max;
87
    }
94
    }
88
 
95
 
89
    /**
96
    /**
90
     * Returns $_min.
97
     * Returns $_min.
91
     *
98
     *
92
     * @see Sensor::$_min
99
     * @see Sensor::$_min
93
     *
100
     *
94
     * @return Integer
101
     * @return Integer
95
     */
102
     */
96
    public function getMin()
103
    public function getMin()
97
    {
104
    {
98
        return $this->_min;
105
        return $this->_min;
99
    }
106
    }
100
 
107
 
101
    /**
108
    /**
102
     * Sets $_min.
109
     * Sets $_min.
103
     *
110
     *
104
     * @param Integer $min minimum value
111
     * @param Integer $min minimum value
105
     *
112
     *
106
     * @see Sensor::$_min
113
     * @see Sensor::$_min
107
     *
114
     *
108
     * @return Void
115
     * @return Void
109
     */
116
     */
110
    public function setMin($min)
117
    public function setMin($min)
111
    {
118
    {
112
        $this->_min = $min;
119
        $this->_min = $min;
113
    }
120
    }
114
 
121
 
115
    /**
122
    /**
116
     * Returns $_name.
123
     * Returns $_name.
117
     *
124
     *
118
     * @see Sensor::$_name
125
     * @see Sensor::$_name
119
     *
126
     *
120
     * @return String
127
     * @return String
121
     */
128
     */
122
    public function getName()
129
    public function getName()
123
    {
130
    {
124
        return $this->_name;
131
        return $this->_name;
125
    }
132
    }
126
 
133
 
127
    /**
134
    /**
128
     * Sets $_name.
135
     * Sets $_name.
129
     *
136
     *
130
     * @param String $name sensor name
137
     * @param String $name sensor name
131
     *
138
     *
132
     * @see Sensor::$_name
139
     * @see Sensor::$_name
133
     *
140
     *
134
     * @return Void
141
     * @return Void
135
     */
142
     */
136
    public function setName($name)
143
    public function setName($name)
137
    {
144
    {
138
        $this->_name = $name;
145
        $this->_name = $name;
139
    }
146
    }
140
 
147
 
141
    /**
148
    /**
142
     * Returns $_value.
149
     * Returns $_value.
143
     *
150
     *
144
     * @see Sensor::$_value
151
     * @see Sensor::$_value
145
     *
152
     *
146
     * @return Integer
153
     * @return Integer
147
     */
154
     */
148
    public function getValue()
155
    public function getValue()
149
    {
156
    {
150
        return $this->_value;
157
        return $this->_value;
151
    }
158
    }
152
 
159
 
153
    /**
160
    /**
154
     * Sets $_value.
161
     * Sets $_value.
155
     *
162
     *
156
     * @param Integer $value current value
163
     * @param Integer $value current value
157
     *
164
     *
158
     * @see Sensor::$_value
165
     * @see Sensor::$_value
159
     *
166
     *
160
     * @return Void
167
     * @return Void
161
     */
168
     */
162
    public function setValue($value)
169
    public function setValue($value)
163
    {
170
    {
164
        $this->_value = $value;
171
        $this->_value = $value;
165
    }
172
    }
166
 
173
 
167
    /**
174
    /**
168
     * Returns $_event.
175
     * Returns $_event.
169
     *
176
     *
170
     * @see Sensor::$_event
177
     * @see Sensor::$_event
171
     *
178
     *
172
     * @return String
179
     * @return String
173
     */
180
     */
174
    public function getEvent()
181
    public function getEvent()
175
    {
182
    {
176
        return $this->_event;
183
        return $this->_event;
177
    }
184
    }
178
 
185
 
179
    /**
186
    /**
180
     * Sets $_event.
187
     * Sets $_event.
181
     *
188
     *
182
     * @param String $event sensor event
189
     * @param String $event sensor event
183
     *
190
     *
184
     * @see Sensor::$_event
191
     * @see Sensor::$_event
185
     *
192
     *
186
     * @return Void
193
     * @return Void
187
     */
194
     */
188
    public function setEvent($event)
195
    public function setEvent($event)
189
    {
196
    {
190
        $this->_event = $event;
197
        $this->_event = $event;
191
    }
198
    }
-
 
199
 
-
 
200
    /**
-
 
201
     * Returns $_unit.
-
 
202
     *
-
 
203
     * @see Sensor::$_unit
-
 
204
     *
-
 
205
     * @return String
-
 
206
     */
-
 
207
    public function getUnit()
-
 
208
    {
-
 
209
        return $this->_unit;
-
 
210
    }
-
 
211
 
-
 
212
    /**
-
 
213
     * Sets $_unit.
-
 
214
     *
-
 
215
     * @param String $unit sensor unit
-
 
216
     *
-
 
217
     * @see Sensor::$_unit
-
 
218
     *
-
 
219
     * @return Void
-
 
220
     */
-
 
221
    public function setUnit($unit)
-
 
222
    {
-
 
223
        $this->_unit = $unit;
-
 
224
    }
192
}
225
}
193
 
226