Subversion Repositories ALCASAR

Rev

Rev 2788 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

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