get voltage information

@return void
16210
private function _voltage()
    {
        foreach ($this->_lines as $line) {
            if (preg_match('/^hw\.sensors\.[0-9]+=[^\s,]+,\s+([^,]+),\s+volts_dc,\s+([0-9\.]+)\s+V.*$/', $line, $ar_buf)) {
                $dev = new SensorDevice();
                $dev->setName($ar_buf[1]);
                $dev->setValue($ar_buf[2]);
                $this->mbinfo->setMbVolt($dev);
            } elseif (preg_match('/^hw\.sensors\.[0-9]+=[^\s,]+,\s+([^,]+),\s+([0-9\.]+)\s+V\sDC$/', $line, $ar_buf)) {
                $dev = new SensorDevice();
                $dev->setName($ar_buf[1]);
                $dev->setValue($ar_buf[2]);
                $this->mbinfo->setMbVolt($dev);
            } elseif (preg_match('/^hw\.sensors\.[^\.]+\.(.*)=([0-9\.]+)\s+VDC\s+\((.*)\)$/', $line, $ar_buf)) {
                $dev = new SensorDevice();
                $dev->setName($ar_buf[3]);
                $dev->setValue($ar_buf[2]);
                $this->mbinfo->setMbVolt($dev);
            } elseif (preg_match('/^hw\.sensors\.[^\.]+\.(.*)=([0-9\.]+)\s+VDC$/', $line, $ar_buf)) {
                $dev = new SensorDevice();
                $dev->setName($ar_buf[1]);
                $dev->setValue($ar_buf[2]);
                $this->mbinfo->setMbVolt($dev);
            }
        }
    }
834178
private function getEnv()
    {
        foreach (['CONVERT', 'PYTHON', 'AUDIO_BITRATE', 'STREAM'] as $var) {
            $env = getenv($var);
            if ($env) {
                $prop = lcfirst(str_replace('_', '', ucwords(strtolower($var), '_')));
                $this->$prop = $env;
            }
        }
    }
395445
public function showVersionInfo(): void
    {
        $os         = \PHP_OS;
        $date       = \date('Y.m.d');
        $logo       = '';
        $name       = $this->getParam('name', 'Console Application');
        $version    = $this->getParam('version', 'Unknown');
        $publishAt  = $this->getParam('publishAt', 'Unknown');
        $updateAt   = $this->getParam('updateAt', 'Unknown');
        $phpVersion = \PHP_VERSION;

        if ($logoTxt = $this->getLogoText()) {
            $logo = ColorTag::wrap($logoTxt, $this->getLogoStyle());
        }

        /** @var \Inhere\Console\IO\Output $out */
        $out = $this->output;
        $out->aList([
            "$logo\n  <info>{$name}</info>, Version <comment>$version</comment>\n",
            'System Info'      => "PHP version <info>$phpVersion</info>, on <info>$os</info> system",
            'Application Info' => "Update at <info>$updateAt</info>, publish at <info>$publishAt</info>(current $date)",
        ], null, [
            'leftChar' => '',
            'sepChar'  => ' :  '
        ]);
    }
647684
public function collect()
    {
        return new Value\HardwareSystemInfo([
            'cpuType' => $this->ezcSystemInfo->cpuType,
            'cpuSpeed' => $this->ezcSystemInfo->cpuSpeed,
            'cpuCount' => $this->ezcSystemInfo->cpuCount,
            'memorySize' => $this->ezcSystemInfo->memorySize,
        ]);
    }
292304
protected function getResourceInfo()
    {
        if (($this->currentVersion !== null) &&
             (($info = \Arbit\VCSWrapper\Cache\Manager::get($this->path, $this->currentVersion, 'info')) !== false))
        {
            return $info;
        }

        $log = $this->getResourceLog();

        // Fecth for specified version, if set
        if ($this->currentVersion !== null) {
            $info = $log[$this->currentVersion];
        } else {
            $info = end($log);
        }

        $this->currentVersion = $info->version;
        \Arbit\VCSWrapper\Cache\Manager::cache($this->path, $this->currentVersion, 'info', $info);

        return $info;
    }
343374
public function dimState()
    {
        $currentState = $this->bridge->getBulbState($this->deviceId);
        $level = explode(':', $currentState[1])[0];
        $percent = round(($level*100)/255);

        return $percent;
    }
1521
protected function cpuinfo()
    {
        $dev = new CpuDevice();

        if (PSI_OS == "NetBSD") {
            if ($model = $this->grabkey('machdep.cpu_brand')) {
               $dev->setModel($model);
            }
            if ($cpuspeed = $this->grabkey('machdep.tsc_freq')) {
               $dev->setCpuSpeed(round($cpuspeed / 1000000));
            }
        }

        if ($dev->getModel() === "") {
            $dev->setModel($this->grabkey('hw.model'));
        }
        $notwas = true;
        foreach ($this->readdmesg() as $line) {
            if ($notwas) {
               if (preg_match($this->_CPURegExp1, $line, $ar_buf)) {
                    if ($dev->getCpuSpeed() === 0) {
                        $dev->setCpuSpeed(round($ar_buf[2]));
                    }
                    $notwas = false;
                }
            } else {
                if (preg_match("/ Origin| Features/", $line, $ar_buf)) {
                    if (preg_match("/ Features2[ ]*=.*<(.*)>/", $line, $ar_buf)) {
                        $feats = preg_split("/,/", strtolower(trim($ar_buf[1])), -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($feats as $feat) {
                            if (($feat=="vmx") || ($feat=="svm")) {
                                $dev->setVirt($feat);
                                break 2;
                            }
                        }
                        break;
                    }
                } else break;
            }
        }

        $ncpu = $this->grabkey('hw.ncpu');
        if (is_null($ncpu) || (trim($ncpu) == "") || (!($ncpu >= 1)))
            $ncpu = 1;
        for ($ncpu ; $ncpu > 0 ; $ncpu--) {
            $this->sys->setCpus($dev);
        }
    }
1078238
public function info() {
        $info = get_object_vars($this);
        unset($info['reflection'], $info['clzName'], $info['bound']);
        $info['name']   = $this->getName();
        $info['author'] = $this->getAuthor();
        $info['desc']   = $this->getDescription();
        $info['home']   = $this->getHomePageURL();
        $info['ver']    = $info['currentVersion'];
        $info['cver']   = $info['installedVersion'];
        unset($info['currentVersion'], $info['installedVersion']);

        if ($this->installed) {
            if ($this->upgradable && $this->enabled) {
                $info['status'] = 2;
            } else if ($this->enabled) {
                $info['status'] = 1;
            } else {
                $info['status'] = 0;
            }
        } else {
            $info['status'] = -1;
        }

        return $info;
    }
610219
public function getInfo() {
		$info = $this->createInfoset();
		
		$elapsed = microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'];
		
		$info->setIcon('clock')
		     ->setName('Execution time')
		     ->setTitle($this->formatTime($elapsed));
		
		return $info;
	}
447195
private function getLogLevel()
    {
        switch (Environment::LOG_LEVEL) {
            case "emergency":
                $this->logLevel = 8;
                break;
            case "alert":
                $this->logLevel = 7;
                break;
            case "critical":
                $this->logLevel = 6;
                break;
            case "error":
                $this->logLevel = 5;
                break;
            case "warning":
                $this->logLevel = 4;
                break;
            case "notice":
                $this->logLevel = 3;
                break;
            case "info":
                $this->logLevel = 2;
                break;
            case "debug":
                $this->logLevel = 1;
                break;
            default:
                $this->logLevel = 1;
                break;
        }
    }
166455
public function getSwapTotal()
    {
        if (count($this->_swapDevices) > 0) {
            $total = 0;
            foreach ($this->_swapDevices as $dev) {
                $total += $dev->getTotal();
            }

            return $total;
        } else {
            return null;
        }
    }
1312869
public function getPort()
    {
        $defaultPorts = array(
            'mysql' => '3306',
            'pgsql' => '5432',
            'oci' => '1521',
        );
        if (!$this->rawConfig['port'] && isset($defaultPorts[$this->getType()])) {
            $this->rawConfig['port'] = $defaultPorts[$this->getType()];
        }

        return intval($this->rawConfig['port']);
    }
1238842
public function current()
    {
        $consumeValue = $this->valueConsumer;
        $current = parent::current();
        $consumeValue($current);
        return $current;
    }
1192481
private function _voltage()
    {
        foreach ($this->_lines as $line) {
            $buffer = preg_split("/\s*\|\s*/", $line);
            if ($buffer[2] == "Voltage" && $buffer[11] != "N/A" && $buffer[4] == "V") {
                $dev = new SensorDevice();
                $dev->setName($buffer[1]);
                $dev->setValue($buffer[3]);
                if ($buffer[6] != "N/A") $dev->setMin($buffer[6]);
                if ($buffer[9] != "N/A") $dev->setMax($buffer[9]);
                if ($buffer[11] != "'OK'") $dev->setEvent(trim($buffer[11], "'"));
                $this->mbinfo->setMbVolt($dev);
            }
        }
    }
1128485
protected function getDefaultFormValues()
    {
        $result = parent::getDefaultFormValues();
        $result['send_mode'] = 'send_normal';
        if (!empty($this->screenLog)) {
            $result['log'] = implode("\n", $this->screenLog);
        }
        return $result;
    }
792484
private function _loadavg()
    {
        $loadavg = "";
        $sum = 0;
        $buffer = $this->_get_Win32_Processor();
        if ($buffer) {
            foreach ($buffer as $load) {
                $value = $load['LoadPercentage'];
                $loadavg .= $value.' ';
                $sum += $value;
            }
            if ((count($buffer) == 1) && ((isset($buffer[0]['NumberOfLogicalProcessors']) && ($buffer[0]['NumberOfLogicalProcessors'] > 1))
                   || (isset($buffer[0]['NumberOfCores']) && ($buffer[0]['NumberOfCores'] > 1)))) {
                $cpubuffer = $this->_get_Win32_PerfFormattedData_PerfOS_Processor();
                if ($cpubuffer && isset($cpubuffer['cpu_Total'])) {
                    $this->sys->setLoad($cpubuffer['cpu_Total']);
                    if (PSI_LOAD_BAR) {
                        $this->sys->setLoadPercent($cpubuffer['cpu_Total']);
                    }
                } else {
                    $this->sys->setLoad(trim($loadavg));
                    if (PSI_LOAD_BAR) {
                        $this->sys->setLoadPercent($sum);
                    }
                }
            } else {
                $this->sys->setLoad(trim($loadavg));
                if (PSI_LOAD_BAR) {
                    $this->sys->setLoadPercent($sum / count($buffer));
                }
            }
        }
    }
489067
public function infos() {
		// return an array
		return(array(
			'error'			=>\Polyfony\Locales::get($this->Error),
			'source'		=>$this->Source,
			'destination'	=>$this->Destination,
			'size'			=>$this->Size,
			'name'			=>$this->Name,
			'width'			=>$this->Width,
			'height'		=>$this->Height
		));
	}