Subversion Repositories ALCASAR

Rev

Rev 2788 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
2788 rexy 1
<?php
2
/**
3
 * UPSDevice 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.UPSDevice.inc.php 262 2009-06-22 10:48:33Z bigmichi1 $
13
 * @link      http://phpsysinfo.sourceforge.net
14
 */
15
 /**
16
 * UPSDevice 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 UPSDevice
27
{
28
    /**
29
     * name of the ups
30
     *
3037 rexy 31
     * @var string
2788 rexy 32
     */
33
    private $_name = "";
34
 
35
    /**
36
     * model of the ups
37
     *
3037 rexy 38
     * @var string
2788 rexy 39
     */
40
    private $_model = "";
41
 
42
    /**
43
     * mode of the ups
44
     *
3037 rexy 45
     * @var string
2788 rexy 46
     */
47
    private $_mode = "";
48
 
49
    /**
50
     * last start time
51
     *
3037 rexy 52
     * @var string
2788 rexy 53
     */
54
    private $_startTime = "";
55
 
56
    /**
57
     * status of the ups
58
     *
3037 rexy 59
     * @var string
2788 rexy 60
     */
61
    private $_status = "";
62
 
63
    /**
64
     * temperature of the ups
65
     *
3037 rexy 66
     * @var int
2788 rexy 67
     */
68
    private $_temperatur = null;
69
 
70
    /**
71
     * outages count
72
     *
3037 rexy 73
     * @var int
2788 rexy 74
     */
75
    private $_outages = null;
76
 
77
    /**
78
     * date of last outtage
79
     *
3037 rexy 80
     * @var string
2788 rexy 81
     */
82
    private $_lastOutage = null;
83
 
84
    /**
85
     * date of last outage finish
86
     *
3037 rexy 87
     * @var string
2788 rexy 88
     */
89
    private $_lastOutageFinish = null;
90
 
91
    /**
92
     * line volt
93
     *
3037 rexy 94
     * @var int
2788 rexy 95
     */
96
    private $_lineVoltage = null;
97
 
98
    /**
99
     * line freq
100
     *
3037 rexy 101
     * @var int
2788 rexy 102
     */
103
    private $_lineFrequency = null;
104
 
105
    /**
106
     * current load of the ups in percent
107
     *
3037 rexy 108
     * @var int
2788 rexy 109
     */
110
    private $_load = null;
111
 
112
    /**
113
     * battery installation date
114
     *
3037 rexy 115
     * @var string
2788 rexy 116
     */
117
    private $_batteryDate = null;
118
 
119
    /**
120
     * current battery volt
121
     *
3037 rexy 122
     * @var int
2788 rexy 123
     */
124
    private $_batteryVoltage = null;
125
 
126
    /**
127
     * current charge in percent of the battery
128
     *
3037 rexy 129
     * @var int
2788 rexy 130
     */
131
    private $_batterCharge = null;
132
 
133
    /**
134
     * time left
135
     *
3037 rexy 136
     * @var string
2788 rexy 137
     */
138
    private $_timeLeft = null;
139
 
140
    /**
3037 rexy 141
     * beeper enabled or disabled
142
     *
143
     * @var string
144
     */
145
    private $_beeperStatus = null;
146
 
147
    /**
2788 rexy 148
     * Returns $_batterCharge.
149
     *
150
     * @see UPSDevice::$_batterCharge
151
     *
152
     * @return integer
153
     */
154
    public function getBatterCharge()
155
    {
156
        return $this->_batterCharge;
157
    }
158
 
159
    /**
160
     * Sets $_batterCharge.
161
     *
3037 rexy 162
     * @param int $batterCharge battery charge
2788 rexy 163
     *
164
     * @see UPSDevice::$_batterCharge
165
     *
166
     * @return void
167
     */
168
    public function setBatterCharge($batterCharge)
169
    {
170
        $this->_batterCharge = $batterCharge;
171
    }
172
 
173
    /**
174
     * Returns $_batteryDate.
175
     *
176
     * @see UPSDevice::$_batteryDate
177
     *
178
     * @return String
179
     */
180
    public function getBatteryDate()
181
    {
182
        return $this->_batteryDate;
183
    }
184
 
185
    /**
186
     * Sets $_batteryDate.
187
     *
188
     * @param object $batteryDate battery date
189
     *
190
     * @see UPSDevice::$_batteryDate
191
     *
3037 rexy 192
     * @return void
2788 rexy 193
     */
194
    public function setBatteryDate($batteryDate)
195
    {
196
        $this->_batteryDate = $batteryDate;
197
    }
198
 
199
    /**
200
     * Returns $_batteryVoltage.
201
     *
202
     * @see UPSDevice::$_batteryVoltage
203
     *
3037 rexy 204
     * @return int
2788 rexy 205
     */
206
    public function getBatteryVoltage()
207
    {
208
        return $this->_batteryVoltage;
209
    }
210
 
211
    /**
212
     * Sets $_batteryVoltage.
213
     *
3037 rexy 214
     * @param int $batteryVoltage battery volt
2788 rexy 215
     *
216
     * @see UPSDevice::$_batteryVoltage
217
     *
3037 rexy 218
     * @return void
2788 rexy 219
     */
220
    public function setBatteryVoltage($batteryVoltage)
221
    {
222
        $this->_batteryVoltage = $batteryVoltage;
223
    }
224
 
225
    /**
226
     * Returns $_lastOutage.
227
     *
228
     * @see UPSDevice::$_lastOutage
229
     *
230
     * @return String
231
     */
232
    public function getLastOutage()
233
    {
234
        return $this->_lastOutage;
235
    }
236
 
237
    /**
238
     * Sets $_lastOutage.
239
     *
240
     * @param String $lastOutage last Outage
241
     *
242
     * @see UPSDevice::$lastOutage
243
     *
3037 rexy 244
     * @return void
2788 rexy 245
     */
246
    public function setLastOutage($lastOutage)
247
    {
248
        $this->_lastOutage = $lastOutage;
249
    }
250
 
251
    /**
252
     * Returns $_lastOutageFinish.
253
     *
254
     * @see UPSDevice::$_lastOutageFinish
255
     *
256
     * @return String
257
     */
258
    public function getLastOutageFinish()
259
    {
260
        return $this->_lastOutageFinish;
261
    }
262
 
263
    /**
264
     * Sets $_lastOutageFinish.
265
     *
266
     * @param String $lastOutageFinish last outage finish
267
     *
268
     * @see UPSDevice::$_lastOutageFinish
269
     *
3037 rexy 270
     * @return void
2788 rexy 271
     */
272
    public function setLastOutageFinish($lastOutageFinish)
273
    {
274
        $this->_lastOutageFinish = $lastOutageFinish;
275
    }
276
 
277
    /**
278
     * Returns $_lineVoltage.
279
     *
280
     * @see UPSDevice::$_lineVoltage
281
     *
3037 rexy 282
     * @return int
2788 rexy 283
     */
284
    public function getLineVoltage()
285
    {
286
        return $this->_lineVoltage;
287
    }
288
 
289
    /**
290
     * Sets $_lineVoltage.
291
     *
3037 rexy 292
     * @param int $lineVoltage line voltage
2788 rexy 293
     *
294
     * @see UPSDevice::$_lineVoltage
295
     *
3037 rexy 296
     * @return void
2788 rexy 297
     */
298
    public function setLineVoltage($lineVoltage)
299
    {
300
        $this->_lineVoltage = $lineVoltage;
301
    }
302
 
303
    /**
304
     * Returns $_lineFrequency.
305
     *
306
     * @see UPSDevice::$_lineFrequency
307
     *
3037 rexy 308
     * @return int
2788 rexy 309
     */
310
    public function getLineFrequency()
311
    {
312
        return $this->_lineFrequency;
313
    }
314
 
315
    /**
316
     * Sets $_lineFrequency.
317
     *
3037 rexy 318
     * @param int $lineFrequency line frequency
2788 rexy 319
     *
320
     * @see UPSDevice::$_lineFrequency
321
     *
3037 rexy 322
     * @return void
2788 rexy 323
     */
324
    public function setLineFrequency($lineFrequency)
325
    {
326
        $this->_lineFrequency = $lineFrequency;
327
    }
328
 
329
    /**
330
     * Returns $_load.
331
     *
332
     * @see UPSDevice::$_load
333
     *
3037 rexy 334
     * @return int
2788 rexy 335
     */
336
    public function getLoad()
337
    {
338
        return $this->_load;
339
    }
340
 
341
    /**
342
     * Sets $_load.
343
     *
3037 rexy 344
     * @param int $load current load
2788 rexy 345
     *
346
     * @see UPSDevice::$_load
347
     *
3037 rexy 348
     * @return void
2788 rexy 349
     */
350
    public function setLoad($load)
351
    {
352
        $this->_load = $load;
353
    }
354
 
355
    /**
356
     * Returns $_mode.
357
     *
358
     * @see UPSDevice::$_mode
359
     *
360
     * @return String
361
     */
362
    public function getMode()
363
    {
364
        return $this->_mode;
365
    }
366
 
367
    /**
368
     * Sets $_mode.
369
     *
370
     * @param String $mode mode
371
     *
372
     * @see UPSDevice::$_mode
373
     *
3037 rexy 374
     * @return void
2788 rexy 375
     */
376
    public function setMode($mode)
377
    {
378
        $this->_mode = $mode;
379
    }
380
 
381
    /**
382
     * Returns $_model.
383
     *
384
     * @see UPSDevice::$_model
385
     *
386
     * @return String
387
     */
388
    public function getModel()
389
    {
390
        return $this->_model;
391
    }
392
 
393
    /**
394
     * Sets $_model.
395
     *
396
     * @param String $model model
397
     *
398
     * @see UPSDevice::$_model
399
     *
3037 rexy 400
     * @return void
2788 rexy 401
     */
402
    public function setModel($model)
403
    {
404
        $this->_model = $model;
405
    }
406
 
407
    /**
408
     * Returns $_name.
409
     *
410
     * @see UPSDevice::$_name
411
     *
412
     * @return String
413
     */
414
    public function getName()
415
    {
416
        return $this->_name;
417
    }
418
 
419
    /**
420
     * Sets $_name.
421
     *
422
     * @param String $name name
423
     *
424
     * @see UPSDevice::$_name
425
     *
3037 rexy 426
     * @return void
2788 rexy 427
     */
428
    public function setName($name)
429
    {
430
        $this->_name = $name;
431
    }
432
 
433
    /**
434
     * Returns $_outages.
435
     *
436
     * @see UPSDevice::$_outages
437
     *
3037 rexy 438
     * @return int
2788 rexy 439
     */
440
    public function getOutages()
441
    {
442
        return $this->_outages;
443
    }
444
 
445
    /**
446
     * Sets $_outages.
447
     *
3037 rexy 448
     * @param int $outages outages count
2788 rexy 449
     *
450
     * @see UPSDevice::$_outages
451
     *
3037 rexy 452
     * @return void
2788 rexy 453
     */
454
    public function setOutages($outages)
455
    {
456
        $this->_outages = $outages;
457
    }
458
 
459
    /**
460
     * Returns $_startTime.
461
     *
462
     * @see UPSDevice::$_startTime
463
     *
464
     * @return String
465
     */
466
    public function getStartTime()
467
    {
468
        return $this->_startTime;
469
    }
470
 
471
    /**
472
     * Sets $_startTime.
473
     *
474
     * @param String $startTime startTime
475
     *
476
     * @see UPSDevice::$_startTime
477
     *
3037 rexy 478
     * @return void
2788 rexy 479
     */
480
    public function setStartTime($startTime)
481
    {
482
        $this->_startTime = $startTime;
483
    }
484
 
485
    /**
486
     * Returns $_status.
487
     *
488
     * @see UPSDevice::$_status
489
     *
490
     * @return String
491
     */
492
    public function getStatus()
493
    {
494
        return $this->_status;
495
    }
496
 
497
    /**
498
     * Sets $_status.
499
     *
500
     * @param String $status status
501
     *
502
     * @see UPSDevice::$_status
503
     *
3037 rexy 504
     * @return void
2788 rexy 505
     */
506
    public function setStatus($status)
507
    {
508
        $this->_status = $status;
509
    }
510
 
511
    /**
512
     * Returns $_temperatur.
513
     *
514
     * @see UPSDevice::$_temperatur
515
     *
3037 rexy 516
     * @return int
2788 rexy 517
     */
518
    public function getTemperatur()
519
    {
520
        return $this->_temperatur;
521
    }
522
 
523
    /**
524
     * Sets $_temperatur.
525
     *
3037 rexy 526
     * @param int $temperatur temperature
2788 rexy 527
     *
528
     * @see UPSDevice::$_temperatur
529
     *
3037 rexy 530
     * @return void
2788 rexy 531
     */
532
    public function setTemperatur($temperatur)
533
    {
534
        $this->_temperatur = $temperatur;
535
    }
536
 
537
    /**
538
     * Returns $_timeLeft.
539
     *
540
     * @see UPSDevice::$_timeLeft
541
     *
542
     * @return String
543
     */
544
    public function getTimeLeft()
545
    {
546
        return $this->_timeLeft;
547
    }
548
 
549
    /**
550
     * Sets $_timeLeft.
551
     *
552
     * @param String $timeLeft time left
553
     *
554
     * @see UPSDevice::$_timeLeft
555
     *
3037 rexy 556
     * @return void
2788 rexy 557
     */
558
    public function setTimeLeft($timeLeft)
559
    {
560
        $this->_timeLeft = $timeLeft;
561
    }
3037 rexy 562
 
563
    /**
564
     * Returns $_beeperStatus.
565
     *
566
     * @see UPSDevice::$_beeperStatus
567
     *
568
     * @return String
569
     */
570
    public function getBeeperStatus()
571
    {
572
        return $this->_beeperStatus;
573
    }
574
 
575
    /**
576
     * Sets $_beeperStatus.
577
     *
578
     * @param String $beeperStatus beeper status
579
     *
580
     * @see UPSDevice::$_beeperStatus
581
     *
582
     * @return void
583
     */
584
    public function setBeeperStatus($beeperStatus)
585
    {
586
        $this->_beeperStatus = $beeperStatus;
587
    }
2788 rexy 588
}