diff options
| author | Georgios Andreadis <G.Andreadis@student.tudelft.nl> | 2017-01-27 10:26:54 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-01-27 10:26:54 +0100 |
| commit | 50fcb0634c9ebe894988103184d50d372bc76907 (patch) | |
| tree | 5af172c03599f7c680cd32205eab5329b841c85c /src/scripts/controllers/simulation/timeline.ts | |
| parent | 3ad08353d289720cf8f43e1dba078da43c35e97d (diff) | |
| parent | b462c9183ec7c2e41f14daad49f03d8afaa4ec59 (diff) | |
Merge pull request #4 from tudelft-atlarge/states-batch-fetch
Fetch experiment states in one batch
Diffstat (limited to 'src/scripts/controllers/simulation/timeline.ts')
| -rw-r--r-- | src/scripts/controllers/simulation/timeline.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/scripts/controllers/simulation/timeline.ts b/src/scripts/controllers/simulation/timeline.ts index a558afe1..ec3d8cb4 100644 --- a/src/scripts/controllers/simulation/timeline.ts +++ b/src/scripts/controllers/simulation/timeline.ts @@ -45,8 +45,8 @@ export class TimelineController { }); $(".timeline-container .timeline").on("click", (event: JQueryEventObject) => { - let parentOffset = $(event.target).closest(".timeline").offset(); - let clickX = event.pageX - parentOffset.left; + const parentOffset = $(event.target).closest(".timeline").offset(); + const clickX = event.pageX - parentOffset.left; let newTick = Math.round(clickX / (this.timelineWidth * this.timeUnitFraction)); @@ -111,7 +111,7 @@ export class TimelineController { private updateTaskIndicators(): void { $(".task-indicator").remove(); - let tickStateTypes = { + const tickStateTypes = { "queueEntryTick": "task-queued", "startTick": "task-started", "finishedTick": "task-finished" @@ -121,7 +121,7 @@ export class TimelineController { return; } - let indicatorCountList = new Array(this.simulationController.stateCache.lastCachedTick); + const indicatorCountList = new Array(this.simulationController.stateCache.lastCachedTick); let indicator; this.simulationController.currentExperiment.trace.tasks.forEach((task: ITask) => { for (let tickStateType in tickStateTypes) { @@ -153,9 +153,9 @@ export class TimelineController { let correction = 0; if (this.timeUnitFraction * this.timelineWidth > this.timeMarkerWidth) { correction = (this.timeUnitFraction * this.timelineWidth - this.timeMarkerWidth) * - (tick / this.simulationController.lastSimulatedTick); + ((tick - 1) / this.simulationController.lastSimulatedTick); } - return (100 * (this.timeUnitFraction * tick + correction / this.timelineWidth)) + "%"; + return (100 * (this.timeUnitFraction * (tick - 1) + correction / this.timelineWidth)) + "%"; } -}
\ No newline at end of file +} |
