Пример #1
0
 /**
  * InitButton
  *
  * @param mixed $Name
  * @param mixed $Group
  * @param int $T
  * @param int $L
  * @param int $W
  * @param int $H
  * @param bool $BStyle
  * @param string $Text
  * @param int $Expire
  * @access public
  * @return void
  */
 public function InitButton($Name, $Group, $T = 0, $L = 0, $W = 1, $H = 1, $BStyle = null, $Text = '', $Expire = 0)
 {
     $OldButton = ButtonManager::getButtonForKey($this->UCID, $Name);
     if (get_class($OldButton) == 'Button') {
         $Button = $OldButton;
     } else {
         $Button = new Button($this->UCID, $Name, $Group);
     }
     $Button->T($T)->L($L)->W($W)->H($H);
     $Button->BStyle($BStyle);
     if (is_array($Text)) {
         $Button->Text($Text[0]);
         $this->bTexts[$Name] = $Text;
     } else {
         $Button->Text($Text);
         $this->bTexts[$Name][0] = $Text;
     }
     $Button->Send();
     $this->bState[$Name]['ID'] = 0;
     $this->bState[$Name]['timestamp'] = time() - 1;
     $this->bState[$Name]['expire'] = -1;
     $this->bState[$Name]['override'] = false;
     if ($Expire > 0) {
         $this->bState[$Name]['expire'] = time() + $Expire;
     }
 }
Пример #2
0
 public function OSD($iUCID, $sPName, $sTime, $sΔ)
 {
     $bName = new Button($iUCID, 'PName', 'FOM');
     $bName->L(40)->T(166)->W(40)->H(8);
     $bName->BStyle |= ISB_DARK + ISB_RIGHT;
     $bName->Text($sPName)->send();
     $bTime = new Button($iUCID, 'STime', 'FOM');
     $bTime->L(40)->T(174)->W(40)->H(8);
     $bTime->BStyle |= ISB_DARK + ISB_RIGHT;
     $bTime->Text($sTime)->send();
     $bΔ = new Button($iUCID, 'Delta', 'FOM');
     $bΔ->L(40)->T(182)->W(40)->H(8);
     $bΔ->BStyle |= ISB_DARK + ISB_RIGHT;
     $bΔ->Text($sΔ)->send();
     $this->createTimer('OSR', 10, Timer::CLOSE, array($iUCID));
 }