Skip to content

Commit

Permalink
fix jobs display when a new build is started
Browse files Browse the repository at this point in the history
  • Loading branch information
hillin committed Aug 31, 2017
1 parent c59d443 commit 2014a11
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
19 changes: 12 additions & 7 deletions Source/Views/Build/BuildJobsView.JobManagement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,7 @@ private void TryAddJob(BuildJobViewModel job)

private void UpdateJobs()
{
var buildViewportService = IoC.Get<IBuildViewportService>();

_startTimeOffset = buildViewportService.ViewStartTimeOffsetSeconds
+ (_headerViewWidth - 8) / buildViewportService.Scaling; // minus 8px to make the jobs looks like being covered under the header panel

_endTimeOffset = buildViewportService.ViewEndTimeOffsetSeconds;
_wasNowInTimeFrame = _endTimeOffset >= _currentTimeOffset && _startTimeOffset <= _currentTimeOffset;
this.UpdateTimeFrame();

var jobs = new HashSet<BuildJobViewModel>(_jobManager.EnumerateJobs(_startTimeOffset, _endTimeOffset, _visibleCores));

Expand All @@ -59,5 +53,16 @@ private void UpdateJobs()
this.InvalidateVisual();
}

private void UpdateTimeFrame()
{
_startTimeOffset = _buildViewportService.ViewStartTimeOffsetSeconds
+
(_headerViewWidth - 8) /
_buildViewportService
.Scaling; // minus 8px to make the jobs looks like being covered under the header panel

_endTimeOffset = _buildViewportService.ViewEndTimeOffsetSeconds;
_wasNowInTimeFrame = _endTimeOffset >= _currentTimeOffset && _startTimeOffset <= _currentTimeOffset;
}
}
}
2 changes: 2 additions & 0 deletions Source/Views/Build/BuildJobsView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ private void FastBuildJobsView_DataContextChanged(object sender, DependencyPrope
_jobManager.OnJobStarted += this.JobManager_OnJobStarted;
_jobManager.OnJobFinished += this.JobManager_OnJobFinished;

this.UpdateTimeFrame();

this.InvalidateCores();
this.InvalidateJobs();
}
Expand Down

0 comments on commit 2014a11

Please sign in to comment.