예제 #1
0
파일: situazione.php 프로젝트: balucio/smac
 public function render()
 {
     $situazione = new StatoSensoriView($this->model->sensor);
     $programmi = new StatoSistemaView($this->model->program);
     $this->addData(['situazione' => $situazione->render(), 'programmazione' => $programmi->render()]);
     return parent::render();
 }
예제 #2
0
 public function render()
 {
     $stati = ['acceso' => 0, 'spento' => 0, 'indeterminato' => 0];
     foreach ($this->model->result as $v) {
         if ($v === true) {
             $stati['acceso'] += $v['durata'];
         } else {
             if ($v === false) {
                 $stati['spento'] += $v['durata'];
             } else {
                 $stati['indeterminato'] += $v['durata'];
             }
         }
     }
     $commutazioni = ['elenco' => $this->model->result, 'totale' => $stati];
     $this->addData(['commutazioni' => $commutazioni]);
     return parent::render();
 }
예제 #3
0
 public function render()
 {
     $this->addData(['sensori' => $this->model->list, 'antigelo' => $this->model->antifreezeTemp, 'manuale' => $this->model->manualTemp, 'santigelo' => $this->model->antifreezeSensor, 'smanuale' => $this->model->manualSensor, 'pin_rele' => $this->model->pinRele]);
     return parent::render();
 }
예제 #4
0
	public function render($directOutput = true)
	{
		parent::render($directOutput);
	}
예제 #5
0
 public function render()
 {
     $this->addData(['sensori' => $this->model->get('listnoavg'), 'sensore' => $this->model->get('data')]);
     return parent::render();
 }
예제 #6
0
            $log = \file_get_contents($logfilename);
            $content .= "<pre>" . \htmlspecialchars($log) . "</pre>";
            $content .= $tpl->render('foot');
            header('Content-Type: text/html; charset=utf-8');
            header('Content-Length: ' . strlen($content));
            echo $content;
            break;
        default:
            $logger->error('Unknown action.');
            $m->addLastInfoMessage('error', 'Error!');
            // TODO Improve message
            $mainView = new MainView();
            $mainView->render();
            break;
    }
    // switch($action)
} catch (\Exception $e) {
    $pageTitle = 'Microblog: Error';
    $logger->error($e->__toString());
    if (isset($m)) {
        if ($m->isLogin()) {
            $m->addLastInfoMessage('error', $e->getMessage());
        } else {
            $m->addLastInfoMessage('error', 'Error!');
        }
        $mainView = new MainView();
        $mainView->render();
    } else {
        echo "Error";
    }
}
예제 #7
0
 public function render()
 {
     $this->addData(['commutazioni' => $this->renderSwitching()]);
     return parent::render();
 }
예제 #8
0
 public function render()
 {
     $this->addData(['programmi' => $this->model->list, 'programma' => $this->model, 'temperature' => isset($this->model->temperature) ? $this->model->temperature : null]);
     return parent::render();
 }