* Mon May 12 2025 Brian Read <brianr@koozali.org> 11.0.0-1.sme

- Adding SM2 panel [SME: 13004]
- Upgrade to phpsysinfo 3.4.4
- Add code to delete inline styles and add css to make it look better.
- version saved / built uses the static version, which means no drops downs and choices.
This commit is contained in:
2025-05-14 16:14:01 +01:00
parent 80b1da5fa5
commit c8ce77259d
952 changed files with 51341 additions and 28699 deletions

View File

@@ -8,7 +8,7 @@
* @package PSI_UPS
* @author Mieczyslaw Nalewaj <namiltd@users.sourceforge.net>
* @copyright 2014 phpSysInfo
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
* @version SVN: $Id: class.powersoftplus.inc.php 661 2014-06-13 11:26:39Z namiltd $
* @link http://phpsysinfo.sourceforge.net
*/
@@ -19,7 +19,7 @@
* @package PSI_UPS
* @author Mieczyslaw Nalewaj <namiltd@users.sourceforge.net>
* @copyright 2014 phpSysInfo
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
* @version Release: 3.0
* @link http://phpsysinfo.sourceforge.net
*/
@@ -28,7 +28,7 @@ class PowerSoftPlus extends UPS
/**
* internal storage for all gathered data
*
* @var Array
* @var array
*/
private $_output = array();
@@ -38,16 +38,23 @@ class PowerSoftPlus extends UPS
public function __construct()
{
parent::__construct();
CommonFunctions::executeProgram('powersoftplus', '-p', $temp);
if (! empty($temp)) {
$this->_output[] = $temp;
if (defined('PSI_UPS_POWERSOFTPLUS_ACCESS') && (strtolower(trim(PSI_UPS_POWERSOFTPLUS_ACCESS))==='data')) {
CommonFunctions::rftsdata('upspowersoftplus.tmp', $temp);
if (! empty($temp)) {
$this->_output[] = $temp;
}
} elseif (PSI_OS == 'Linux') {
CommonFunctions::executeProgram('powersoftplus', '-p', $temp);
if (! empty($temp)) {
$this->_output[] = $temp;
}
}
}
/**
* parse the input and store data in resultset for xml generation
*
* @return Void
* @return void
*/
private function _info()
{
@@ -69,18 +76,18 @@ class PowerSoftPlus extends UPS
if (preg_match('/^Current UPS state\s*:\s*(.*)$/m', $ups, $data)) {
$dev->setStatus(trim($data[1]));
}
if (preg_match('/^Output load\s*:\s*(.*)\s\[\%\]$/m', $ups, $data)) {
if (preg_match('/^Output load\s*:\s*(.*)\s\[\%\]\r?$/m', $ups, $data)) {
$load = trim($data[1]);
}
//wrong Output load issue
if (($load == 0) && ($maxpwr != 0) && preg_match('/^Effective power\s*:\s*(.*)\s\[W\]$/m', $ups, $data)) {
if (($load == 0) && ($maxpwr != 0) && preg_match('/^Effective power\s*:\s*(.*)\s\[W\]\r?$/m', $ups, $data)) {
$load = 100.0*trim($data[1])/$maxpwr;
}
if ($load != null) {
$dev->setLoad($load);
}
// Battery
if (preg_match('/^Battery voltage\s*:\s*(.*)\s\[Volt\]$/m', $ups, $data)) {
if (preg_match('/^Battery voltage\s*:\s*(.*)\s\[Volt\]\r?$/m', $ups, $data)) {
$dev->setBatteryVoltage(trim($data[1]));
}
if (preg_match('/^Battery state\s*:\s*(.*)$/m', $ups, $data)) {
@@ -91,10 +98,10 @@ class PowerSoftPlus extends UPS
}
}
// Line
if (preg_match('/^Input voltage\s*:\s*(.*)\s\[Volt\]$/m', $ups, $data)) {
if (preg_match('/^Input voltage\s*:\s*(.*)\s\[Volt\]\r?$/m', $ups, $data)) {
$dev->setLineVoltage(trim($data[1]));
}
if (preg_match('/^Input frequency\s*:\s*(.*)\s\[Hz\]$/m', $ups, $data)) {
if (preg_match('/^Input frequency\s*:\s*(.*)\s\[Hz\]\r?$/m', $ups, $data)) {
$dev->setLineFrequency(trim($data[1]));
}
$this->upsinfo->setUpsDevices($dev);
@@ -106,7 +113,7 @@ class PowerSoftPlus extends UPS
*
* @see PSI_Interface_UPS::build()
*
* @return Void
* @return void
*/
public function build()
{