Subversion Repositories ALCASAR

Rev

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

Rev Author Line No. Line
2788 rexy 1
<?php
2
/**
3
 * CpuDevice 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.CpuDevice.inc.php 411 2010-12-28 22:32:52Z Jacky672 $
13
 * @link      http://phpsysinfo.sourceforge.net
14
 */
15
 /**
16
 * CpuDevice 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 CpuDevice
27
{
28
    /**
29
     * model of the cpu
30
     *
3037 rexy 31
     * @var string
2788 rexy 32
     */
33
    private $_model = "";
34
 
35
    /**
3037 rexy 36
     * cpu voltage
37
     *
38
     * @var Float
39
     */
40
    private $_voltage = 0;
41
 
42
    /**
2788 rexy 43
     * speed of the cpu in hertz
44
     *
3037 rexy 45
     * @var int
2788 rexy 46
     */
47
    private $_cpuSpeed = 0;
48
 
49
    /**
50
     * max speed of the cpu in hertz
51
     *
3037 rexy 52
     * @var int
2788 rexy 53
     */
54
    private $_cpuSpeedMax = 0;
55
 
56
    /**
57
     * min speed of the cpu in hertz
58
     *
3037 rexy 59
     * @var int
2788 rexy 60
     */
61
    private $_cpuSpeedMin = 0;
62
 
63
    /**
64
     * cache size in bytes, if available
65
     *
3037 rexy 66
     * @var int
2788 rexy 67
     */
68
    private $_cache = null;
69
 
70
    /**
71
     * virtualization, if available
72
     *
3037 rexy 73
     * @var string
2788 rexy 74
     */
75
    private $_virt = null;
76
 
77
    /**
78
     * busspeed in hertz, if available
79
     *
3037 rexy 80
     * @var int
2788 rexy 81
     */
82
    private $_busSpeed = null;
83
 
84
    /**
85
     * bogomips of the cpu, if available
86
     *
3037 rexy 87
     * @var int
2788 rexy 88
     */
89
    private $_bogomips = null;
90
 
91
    /**
92
     * temperature of the cpu, if available
93
     *
3037 rexy 94
     * @var int
2788 rexy 95
     */
96
    private $_temp = null;
97
 
98
    /**
99
     * vendorid, if available
100
     *
3037 rexy 101
     * @var string
2788 rexy 102
     */
103
    private $_vendorid = null;
104
 
105
    /**
106
     * current load in percent of the cpu, if available
107
     *
3037 rexy 108
     * @var int
2788 rexy 109
     */
110
    private $_load = null;
111
 
112
    /**
113
     * Returns $_model.
114
     *
115
     * @see Cpu::$_model
116
     *
117
     * @return String
118
     */
119
    public function getModel()
120
    {
121
        return $this->_model;
122
    }
123
 
124
    /**
125
     * Sets $_model.
126
     *
127
     * @param String $model cpumodel
128
     *
129
     * @see Cpu::$_model
130
     *
3037 rexy 131
     * @return void
2788 rexy 132
     */
133
    public function setModel($model)
134
    {
135
        $this->_model = $model;
136
    }
137
 
138
    /**
3037 rexy 139
     * Returns $_voltage.
140
     *
141
     * @see Cpu::$_voltage
142
     *
143
     * @return Float
144
     */
145
    public function getVoltage()
146
    {
147
        return $this->_voltage;
148
    }
149
 
150
    /**
151
     * Sets $_voltage.
152
     *
153
     * @param int $voltage voltage
154
     *
155
     * @see Cpu::$_voltage
156
     *
157
     * @return void
158
     */
159
    public function setVoltage($voltage)
160
    {
161
        $this->_voltage = $voltage;
162
    }
163
 
164
    /**
2788 rexy 165
     * Returns $_cpuSpeed.
166
     *
167
     * @see Cpu::$_cpuSpeed
168
     *
3037 rexy 169
     * @return int
2788 rexy 170
     */
171
    public function getCpuSpeed()
172
    {
173
        return $this->_cpuSpeed;
174
    }
175
 
176
    /**
177
     * Sets $_cpuSpeed.
178
     *
3037 rexy 179
     * @param int $cpuSpeed cpuspeed
2788 rexy 180
     *
181
     * @see Cpu::$_cpuSpeed
182
     *
3037 rexy 183
     * @return void
2788 rexy 184
     */
185
    public function setCpuSpeed($cpuSpeed)
186
    {
187
        $this->_cpuSpeed = $cpuSpeed;
188
    }
189
 
190
    /**
191
     * Returns $_cpuSpeedMax.
192
     *
193
     * @see Cpu::$_cpuSpeedMAx
194
     *
3037 rexy 195
     * @return int
2788 rexy 196
     */
197
    public function getCpuSpeedMax()
198
    {
199
        return $this->_cpuSpeedMax;
200
    }
201
 
202
    /**
203
     * Sets $_cpuSpeedMax.
204
     *
3037 rexy 205
     * @param int $cpuSpeedMax cpuspeedmax
2788 rexy 206
     *
207
     * @see Cpu::$_cpuSpeedMax
208
     *
3037 rexy 209
     * @return void
2788 rexy 210
     */
211
    public function setCpuSpeedMax($cpuSpeedMax)
212
    {
213
        $this->_cpuSpeedMax = $cpuSpeedMax;
214
    }
215
 
216
    /**
217
     * Returns $_cpuSpeedMin.
218
     *
219
     * @see Cpu::$_cpuSpeedMin
220
     *
3037 rexy 221
     * @return int
2788 rexy 222
     */
223
    public function getCpuSpeedMin()
224
    {
225
        return $this->_cpuSpeedMin;
226
    }
227
 
228
    /**
229
     * Sets $_cpuSpeedMin.
230
     *
3037 rexy 231
     * @param int $cpuSpeedMin cpuspeedmin
2788 rexy 232
     *
233
     * @see Cpu::$_cpuSpeedMin
234
     *
3037 rexy 235
     * @return void
2788 rexy 236
     */
237
    public function setCpuSpeedMin($cpuSpeedMin)
238
    {
239
        $this->_cpuSpeedMin = $cpuSpeedMin;
240
    }
241
 
242
    /**
243
     * Returns $_cache.
244
     *
245
     * @see Cpu::$_cache
246
     *
3037 rexy 247
     * @return int
2788 rexy 248
     */
249
    public function getCache()
250
    {
251
        return $this->_cache;
252
    }
253
 
254
    /**
255
     * Sets $_cache.
256
     *
3037 rexy 257
     * @param int $cache cache size
2788 rexy 258
     *
259
     * @see Cpu::$_cache
260
     *
3037 rexy 261
     * @return void
2788 rexy 262
     */
263
    public function setCache($cache)
264
    {
265
        $this->_cache = $cache;
266
    }
267
 
268
    /**
269
     * Returns $_virt.
270
     *
271
     * @see Cpu::$_virt
272
     *
273
     * @return String
274
     */
275
    public function getVirt()
276
    {
277
        return $this->_virt;
278
    }
279
 
280
    /**
281
     * Sets $_virt.
282
     *
283
     * @param string $virt
284
     *
285
     * @see Cpu::$_virt
286
     *
3037 rexy 287
     * @return void
2788 rexy 288
     */
289
    public function setVirt($virt)
290
    {
291
        $this->_virt = $virt;
292
    }
293
 
294
    /**
295
     * Returns $_busSpeed.
296
     *
297
     * @see Cpu::$_busSpeed
298
     *
3037 rexy 299
     * @return int
2788 rexy 300
     */
301
    public function getBusSpeed()
302
    {
303
        return $this->_busSpeed;
304
    }
305
 
306
    /**
307
     * Sets $_busSpeed.
308
     *
3037 rexy 309
     * @param int $busSpeed busspeed
2788 rexy 310
     *
311
     * @see Cpu::$_busSpeed
312
     *
3037 rexy 313
     * @return void
2788 rexy 314
     */
315
    public function setBusSpeed($busSpeed)
316
    {
317
        $this->_busSpeed = $busSpeed;
318
    }
319
 
320
    /**
321
     * Returns $_bogomips.
322
     *
323
     * @see Cpu::$_bogomips
324
     *
3037 rexy 325
     * @return int
2788 rexy 326
     */
327
    public function getBogomips()
328
    {
329
        return $this->_bogomips;
330
    }
331
 
332
    /**
333
     * Sets $_bogomips.
334
     *
3037 rexy 335
     * @param int $bogomips bogompis
2788 rexy 336
     *
337
     * @see Cpu::$_bogomips
338
     *
3037 rexy 339
     * @return void
2788 rexy 340
     */
341
    public function setBogomips($bogomips)
342
    {
343
        $this->_bogomips = $bogomips;
344
    }
345
 
346
    /**
347
     * Returns $_temp.
348
     *
349
     * @see Cpu::$_temp
350
     *
3037 rexy 351
     * @return int
2788 rexy 352
     */
353
/*
354
    public function getTemp()
355
    {
356
        return $this->_temp;
357
    }
358
*/
359
 
360
    /**
361
     * Sets $_temp.
362
     *
3037 rexy 363
     * @param int $temp temperature
2788 rexy 364
     *
365
     * @see Cpu::$_temp
366
     *
3037 rexy 367
     * @return void
2788 rexy 368
     */
369
/*
370
    public function setTemp($temp)
371
    {
372
        $this->_temp = $temp;
373
    }
374
*/
375
 
376
    /**
377
     * Returns $_vendorid.
378
     *
379
     * @see Cpu::$_vendorid
380
     *
381
     * @return String
382
     */
383
    public function getVendorId()
384
    {
385
        return $this->_vendorid;
386
    }
387
 
388
    /**
389
     * Sets $_vendorid.
390
     *
391
     * @param string $vendorid
392
     *
393
     * @see Cpu::$_vendorid
394
     *
3037 rexy 395
     * @return void
2788 rexy 396
     */
397
    public function setVendorId($vendorid)
398
    {
3037 rexy 399
        $this->_vendorid = trim(preg_replace('/[\s!]/', '', $vendorid));
2788 rexy 400
    }
401
 
402
    /**
403
     * Returns $_load.
404
     *
405
     * @see CpuDevice::$_load
406
     *
3037 rexy 407
     * @return int
2788 rexy 408
     */
409
    public function getLoad()
410
    {
411
        return $this->_load;
412
    }
413
 
414
    /**
415
     * Sets $_load.
416
     *
3037 rexy 417
     * @param int $load load percent
2788 rexy 418
     *
419
     * @see CpuDevice::$_load
420
     *
3037 rexy 421
     * @return void
2788 rexy 422
     */
423
    public function setLoad($load)
424
    {
425
        $this->_load = $load;
426
    }
427
}