public function getGDImageOfMemoryLine(Watcher $Watcher, $width, $height, $y_scale = 1, $memory_size_scale = 1048576) { $points = $Watcher->getPointsArray(); if (empty($points) || empty($y_scale) || empty($memory_size_scale)) { return false; } $max_y = $height; $max_x = $width; $img = imagecreatetruecolor($max_x, $max_y); $point_color = imagecolorallocate($img, 0, 0, 255); $line_color = imagecolorallocate($img, 0, 255, 0); $string_color = imagecolorallocate($img, 0, 0, 0); $white = imagecolorallocate($img, 255, 255, 255); imagefill($img, 10, 10, $white); $x = 0; $y = 0; $x_step = intval($max_x / 100); foreach ($points as $point) { $value = round($point[$Watcher::point_memory] / $memory_size_scale, 2); $new_x = $x + $x_step; $new_y = $value * $y_scale; imageline($img, $x + 1, $max_y - $y, $new_x, $max_y - $new_y, $line_color); $x = $new_x; $y = $new_y; imagesetpixel($img, $x, $max_y - $y, $point_color); imagestringup($img, 1, $x, $max_y - $y - 5, $point[$Watcher::point_name], $string_color); imagestringup($img, 1, $x, $max_y - $y + 30, $value, $string_color); } return $img; }
/** * remove deleted files in $path from the cache * * @param string $path */ public function cleanFolder($path) { if ($path != '') { parent::cleanFolder($path); } }
public function check() { if (!$this->downloaded) { return parent::check(); } }
/** * @return \yii\db\ActiveQuery */ public function getWatchers() { return $this->hasMany(Watcher::className(), ['issue_id' => 'id']); }
public function __construct($id = null, $name = null, array $language = array("English"), array $format = array("x264"), array $source = array()) { parent::__construct($id, $name, $language, $format, $source, 8); }
require_once 'language_' . getSMSLanguagePostFix($l) . '.php'; } else { require_once 'language_en.php'; // fall back on english language file } $_SESSION['SYSTEM_ENTRY'] = USCIC_SURVEY; // switch back to survey $page = getFromSessionParams('testpage'); if (getFromSessionParams('type') != "2") { $_SESSION[SURVEY_EXECUTION_MODE] = SURVEY_EXECUTION_MODE_TEST; } $engine = null; // needed for updater switch ($page) { case "watch": $watch = new Watcher(); $watch->watch(); break; case "report": $reportissue = new ReportIssue(); $reportissue->report(); break; case "reportRes": $reportissue = new ReportIssue(); $reportissue->reportRes(); break; case "jumpback": $jumper = new JumpBack(); $jumper->jump(); break; case "jumpbackRes":