Showing basic plans info in session title
This commit is contained in:
parent
f3dae81643
commit
7a000fb820
|
@ -93,7 +93,8 @@ class Session
|
|||
|
||||
function getTitle() : string
|
||||
{
|
||||
return "Session ({$this->id}) '{$this->name}' (devices:".sizeof($this->getDevices())." ?:".sizeof($this->ignored_devices) .
|
||||
$finished_plans = $this->countFinishedPlans();
|
||||
return "Session ({$this->id}) '{$this->name}' (plans:$finished_plans/".sizeof($this->plans)." devices:".sizeof($this->getDevices())." ?:".sizeof($this->ignored_devices) .
|
||||
') (' . round($this->getDuration()/60, 1) . ' min)';
|
||||
}
|
||||
|
||||
|
@ -367,6 +368,15 @@ class Session
|
|||
return true;
|
||||
}
|
||||
|
||||
function countFinishedPlans() : int
|
||||
{
|
||||
$n = 0;
|
||||
foreach($this->plans as $plan)
|
||||
if(!$plan->isOver())
|
||||
$n++;
|
||||
return $n;
|
||||
}
|
||||
|
||||
function trySendStatsFromJzonAsync(Task $task, string $jzon) : Amp\Promise
|
||||
{
|
||||
return Amp\call(function() use($task, $jzon) {
|
||||
|
|
Loading…
Reference in New Issue