| @@ 39-51 (lines=13) @@ | ||
| 36 | { |
|
| 37 | parent::__construct(); |
|
| 38 | switch (defined('PSI_SENSOR_SPEEDFAN_ACCESS')?strtolower(PSI_SENSOR_SPEEDFAN_ACCESS):'command') { |
|
| 39 | case 'command': |
|
| 40 | if (CommonFunctions::executeProgram("SpeedFanGet.exe", "", $buffer, PSI_DEBUG) && (strlen($buffer) > 0)) { |
|
| 41 | if (preg_match("/^Temperatures:\s+(.+)$/m", $buffer, $out)) { |
|
| 42 | $this->_filecontent["temp"] = $out[1]; |
|
| 43 | } |
|
| 44 | if (preg_match("/^Fans:\s+(.+)$/m", $buffer, $out)) { |
|
| 45 | $this->_filecontent["fans"] = $out[1]; |
|
| 46 | } |
|
| 47 | if (preg_match("/^Voltages:\s+(.+)$/m", $buffer, $out)) { |
|
| 48 | $this->_filecontent["volt"] = $out[1]; |
|
| 49 | } |
|
| 50 | } |
|
| 51 | break; |
|
| 52 | case 'data': |
|
| 53 | if (CommonFunctions::rfts(APP_ROOT.'/data/speedfan.txt', $buffer) && (strlen($buffer) > 0)) { |
|
| 54 | if (preg_match("/^Temperatures:\s+(.+)$/m", $buffer, $out)) { |
|
| @@ 52-64 (lines=13) @@ | ||
| 49 | } |
|
| 50 | } |
|
| 51 | break; |
|
| 52 | case 'data': |
|
| 53 | if (CommonFunctions::rfts(APP_ROOT.'/data/speedfan.txt', $buffer) && (strlen($buffer) > 0)) { |
|
| 54 | if (preg_match("/^Temperatures:\s+(.+)$/m", $buffer, $out)) { |
|
| 55 | $this->_filecontent["temp"] = $out[1]; |
|
| 56 | } |
|
| 57 | if (preg_match("/^Fans:\s+(.+)$/m", $buffer, $out)) { |
|
| 58 | $this->_filecontent["fans"] = $out[1]; |
|
| 59 | } |
|
| 60 | if (preg_match("/^Voltages:\s+(.+)$/m", $buffer, $out)) { |
|
| 61 | $this->_filecontent["volt"] = $out[1]; |
|
| 62 | } |
|
| 63 | } |
|
| 64 | break; |
|
| 65 | default: |
|
| 66 | $this->error->addConfigError('__construct()', 'PSI_SENSOR_SPEEDFAN_ACCESS'); |
|
| 67 | break; |
|