325 |
richard |
1 |
<?php
|
|
|
2 |
//
|
|
|
3 |
// phpSysInfo - A PHP System Information Script
|
|
|
4 |
// http://phpsysinfo.sourceforge.net/
|
|
|
5 |
//
|
|
|
6 |
// This program is free software; you can redistribute it and/or
|
|
|
7 |
// modify it under the terms of the GNU General Public License
|
|
|
8 |
// as published by the Free Software Foundation; either version 2
|
|
|
9 |
// of the License, or (at your option) any later version.
|
|
|
10 |
//
|
|
|
11 |
// This program is distributed in the hope that it will be useful,
|
|
|
12 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
13 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
14 |
// GNU General Public License for more details.
|
|
|
15 |
//
|
|
|
16 |
// You should have received a copy of the GNU General Public License
|
|
|
17 |
// along with this program; if not, write to the Free Software
|
|
|
18 |
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
19 |
//
|
|
|
20 |
// $Id: class.mbm5.inc.php,v 1.7 2007/02/18 19:11:31 bigmichi1 Exp $
|
|
|
21 |
|
|
|
22 |
class mbinfo {
|
|
|
23 |
var $buf_label;
|
|
|
24 |
var $buf_value;
|
|
|
25 |
|
|
|
26 |
function mbinfo() {
|
|
|
27 |
$buffer = rfts( APP_ROOT . "/data/MBM5.csv" );
|
|
|
28 |
if( strpos( $buffer, ";") === false ) {
|
|
|
29 |
$delim = ",";
|
|
|
30 |
} else {
|
|
|
31 |
$delim = ";";
|
|
|
32 |
}
|
|
|
33 |
$buffer = explode( "\n", $buffer );
|
|
|
34 |
$this->buf_label = explode( $delim, $buffer[0] );
|
|
|
35 |
$this->buf_value = explode( $delim, $buffer[1] );
|
|
|
36 |
}
|
|
|
37 |
|
|
|
38 |
function temperature() {
|
|
|
39 |
$results = array();
|
|
|
40 |
$intCount = 0;
|
|
|
41 |
|
|
|
42 |
for( $intPosi = 3; $intPosi < 6; $intPosi++ ) {
|
|
|
43 |
$results[$intCount]['label'] = $this->buf_label[$intPosi];
|
|
|
44 |
$results[$intCount]['value'] = $this->buf_value[$intPosi];
|
|
|
45 |
$results[$intCount]['limit'] = '70.0';
|
|
|
46 |
$intCount++;
|
|
|
47 |
}
|
|
|
48 |
return $results;
|
|
|
49 |
}
|
|
|
50 |
|
|
|
51 |
function fans() {
|
|
|
52 |
$results = array();
|
|
|
53 |
$intCount = 0;
|
|
|
54 |
|
|
|
55 |
for( $intPosi = 13; $intPosi < 16; $intPosi++ ) {
|
|
|
56 |
$results[$intCount]['label'] = $this->buf_label[$intPosi];
|
|
|
57 |
$results[$intCount]['value'] = $this->buf_value[$intPosi];
|
|
|
58 |
$results[$intCount]['min'] = '3000';
|
|
|
59 |
$intCount++;
|
|
|
60 |
}
|
|
|
61 |
return $results;
|
|
|
62 |
}
|
|
|
63 |
|
|
|
64 |
function voltage() {
|
|
|
65 |
$results = array();
|
|
|
66 |
$intCount = 0;
|
|
|
67 |
|
|
|
68 |
for( $intPosi = 6; $intPosi < 13; $intPosi++ ) {
|
|
|
69 |
$results[$intCount]['label'] = $this->buf_label[$intPosi];
|
|
|
70 |
$results[$intCount]['value'] = $this->buf_value[$intPosi];
|
|
|
71 |
$results[$intCount]['min'] = '0.00';
|
|
|
72 |
$results[$intCount]['max'] = '0.00';
|
|
|
73 |
$intCount++;
|
|
|
74 |
}
|
|
|
75 |
return $results;
|
|
|
76 |
}
|
|
|
77 |
}
|
|
|
78 |
|
|
|
79 |
?>
|