Subversion Repositories ALCASAR

Rev

Rev 2976 | Details | Compare with Previous | Last modification | View Log

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