get voltage information

@return void
770694
private function _voltage()
    {
        for ($intPosi = 6; $intPosi < 13; $intPosi++) {
            if ($this->_buf_value[$intPosi] == 0) {
                continue;
            }
            preg_match("/([0-9\.])*/", str_replace(",", ".", $this->_buf_value[$intPosi]), $hits);
            $dev = new SensorDevice();
            $dev->setName($this->_buf_label[$intPosi]);
            $dev->setValue($hits[0]);
            $this->mbinfo->setMbVolt($dev);
        }
    }
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);
        }
    }
614868
def _get_voltage_angle_var(self, refs, buses):
        
        Va = array([b.v_angle * (pi / 180.0) for b in buses])

        Vau = Inf * ones(len(buses))
        Val = -Vau
        Vau[refs] = Va[refs]
        Val[refs] = Va[refs]

        return Variable("Va", len(buses), Va, Val, Vau)
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;
        }
    }
749552
protected function cpu_info()
    {

        $this->cpu_info = array();
        if (!stristr(PHP_OS, 'win')) {
            exec("cat /proc/cpuinfo", $output);
            foreach ($output as $line) {
                $parts = explode(':', $line);

                if (empty($parts[0])) continue;

                $this->cpu_info[trim($parts[0])] = (!empty($parts[1])) ? trim($parts[1]) : null;
            }
        }

        return true;
    }
1169840
protected function cpuinfo()
    {
        $dev = new CpuDevice();
        $dev->setModel($this->grabkey('hw.model'));
        $dev->setCpuSpeed($this->grabkey('hw.cpuspeed'));
        $was = false;
        foreach ($this->readdmesg() as $line) {
            if (preg_match("/^cpu[0-9]+: (.*)/", $line, $ar_buf)) {
                $was = true;
                if (preg_match("/^cpu[0-9]+: (\d+)([KM])B (.*) L2 cache/", $line, $ar_buf2)) {
                    if ($ar_buf2[2]=="M") {
                        $dev->setCache($ar_buf2[1]*1024*1024);
                    } elseif ($ar_buf2[2]=="K") {
                        $dev->setCache($ar_buf2[1]*1024);
                    }
                } else {
                    $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);
                        }
                    }
                }
            } elseif ($was) {
                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);
        }
    }
371043
public function info()
    {
        $info = [
            'id' => $this->id,
            'action' => $this->action,
            'condition' => $this->condition,
            'expressions' => $this->expressions,
            'logMessageFormat' => $this->logMessageFormat,
            'logLevel' => $this->logLevel,
            'isFinalState' => $this->isFinalState,
            'createTime' => $this->createTime,
            'finalTime' => $this->finalTime,
            'stackFrames' => array_map(function ($sf) {
                return $sf->info();
            }, $this->stackFrames),
            'evaluatedExpressions' => $this->evaluatedExpressions
        ];
        if ($this->labels) {
            $info['labels'] = $this->labels;
        }
        if ($this->userEmail) {
            $info['userEmail'] = $this->userEmail;
        }
        if ($this->location) {
            $info['location'] = $this->location->info();
        }
        if ($this->status) {
            $info['status'] = $this->status->info();
        }
        if ($this->variableTable) {
            $info['variableTable'] = $this->variableTable->info();
        }
        return $info;
    }
971289
private function _cpuinfo()
    {
        if (CommonFunctions::rfts('/proc/cpuinfo', $bufr)) {
            $processors = preg_split('/\s?\n\s?\n/', trim($bufr));
            foreach ($processors as $processor) {
                $dev = new CpuDevice();
                $details = preg_split("/\n/", $processor, -1, PREG_SPLIT_NO_EMPTY);
                foreach ($details as $detail) {
                    $arrBuff = preg_split('/\s+:\s+/', trim($detail));
                    if (count($arrBuff) == 2) {
                        switch (strtolower($arrBuff[0])) {
                        case 'model name':
                        case 'cpu':
                            $dev->setModel($arrBuff[1]);
                            break;
                        case 'cpu mhz':
                        case 'clock':
                            $dev->setCpuSpeed($arrBuff[1]);
                            break;
                        case 'cycle frequency [hz]':
                            $dev->setCpuSpeed($arrBuff[1] / 1000000);
                            break;
                        case 'cpu0clktck':
                            $dev->setCpuSpeed(hexdec($arrBuff[1]) / 1000000); // Linux sparc64
                            break;
                        case 'l2 cache':
                        case 'cache size':
                            $dev->setCache(preg_replace("/[a-zA-Z]/", "", $arrBuff[1]) * 1024);
                            break;
                        case 'bogomips':
                        case 'cpu0bogo':
                            $dev->setBogomips($arrBuff[1]);
                            break;
                        }
                    }
                }
            }
        }
    }
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
		));
	}
314523
protected function _cpuinfo()
    {

        if (CommonFunctions::executeProgram('sysinfo', '-cpu', $bufr, PSI_DEBUG)) {
            $cpus = preg_split("/\nCPU #\d+/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
            $cpuspeed = "";
            foreach ($cpus as $cpu) {
                if (preg_match("/^.*running at (\d+)MHz/", $cpu, $ar_buf)) {
                    $cpuspeed = $ar_buf[1];
                } elseif (preg_match("/^: \"(.*)\"/", $cpu, $ar_buf)) {
                    $dev = new CpuDevice();
                    $dev->setModel($ar_buf[1]);
                    $arrLines = preg_split("/\n/", $cpu, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($arrLines as $Line) {
                        if (preg_match("/^\s+Data TLB:\s+(.*)K-byte/", $Line, $Line_buf)) {
                            $dev->setCache(max($Line_buf[1]*1024, $dev->getCache()));
                        } elseif (preg_match("/^\s+Data TLB:\s+(.*)M-byte/", $Line, $Line_buf)) {
                            $dev->setCache(max($Line_buf[1]*1024*1024, $dev->getCache()));
                        } elseif (preg_match("/^\s+Data TLB:\s+(.*)G-byte/", $Line, $Line_buf)) {
                            $dev->setCache(max($Line_buf[1]*1024*1024*1024, $dev->getCache()));
                        } elseif (preg_match("/\s+VMX/", $Line, $Line_buf)) {
                            $dev->setVirt("vmx");
                        } elseif (preg_match("/\s+SVM/", $Line, $Line_buf)) {
                            $dev->setVirt("svm");
                        }
                    }
                    if ($cpuspeed != "") {
                        $dev->setCpuSpeed($cpuspeed);
                    }
                    $this->sys->setCpus($dev);
                }
            }
        }
    }
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);
            }
        }
    }
1261577
public function getBattery()
    {

        // Time?
        if (!empty($this->settings['timer'])) {
            $t = new Timer('Batteries');
        }

        // Store them here
        $batts = [];

        // Get result of program
        try {
            $res = $this->exec->exec('apm', '-abl');
        } catch (Exception $e) {
            Errors::add('Linfo Core', 'Error using `apm` battery info');

            return $batts;
        }

        // Values from program
        list(, $bat_status, $percentage) = explode("\n", $res);

        // Interpret status code
        switch ($bat_status) {
            case 0:
                $status = 'High';
            break;
            case 1:
                $status = 'Low';
            break;
            case 2:
                $status = 'Critical';
            break;
            case 3:
                $status = 'Charging';
            break;
            default:
                $status = 'Unknown';
            break;
        }

        // Save battery
        $batts[] = array(
            'percentage' => $percentage.'%',
            'state' => $status,
            'device' => 'battery',
        );

        // Return
        return $batts;
    }
1238842
public function current()
    {
        $consumeValue = $this->valueConsumer;
        $current = parent::current();
        $consumeValue($current);
        return $current;
    }
166455
public function getSwapTotal()
    {
        if (count($this->_swapDevices) > 0) {
            $total = 0;
            foreach ($this->_swapDevices as $dev) {
                $total += $dev->getTotal();
            }

            return $total;
        } else {
            return null;
        }
    }
176929
public function getSysReqStatus()
    {
        if ($this->_blSysReqStatus == null) {
            $this->_blSysReqStatus = true;
            $this->getSystemInfo();
            $this->checkCollation();
        }

        return $this->_blSysReqStatus;
    }
300632
function uagent_info()
   { 
	 $this->useragent = isset($_SERVER['HTTP_USER_AGENT'])?strtolower($_SERVER['HTTP_USER_AGENT']):'';
	 $this->httpaccept = isset($_SERVER['HTTP_ACCEPT'])?strtolower($_SERVER['HTTP_ACCEPT']):'';
		
	 //Let's initialize some values to save cycles later.
	 $this->InitDeviceScan();
   }
1104739
def getChargingVoltage(self):
    """"""
    command = '$GG'
    currentAndVoltage = self.sendCommand(command)
    volts = float(currentAndVoltage[2])/1000
    return volts