From 09596c3c5a6a2a44675f170106bb38746229e02a Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Sat, 23 Sep 2017 09:48:38 +0200 Subject: Remove old frontend --- src/scripts/controllers/simulation/taskview.ts | 64 -------------------------- 1 file changed, 64 deletions(-) delete mode 100644 src/scripts/controllers/simulation/taskview.ts (limited to 'src/scripts/controllers/simulation/taskview.ts') diff --git a/src/scripts/controllers/simulation/taskview.ts b/src/scripts/controllers/simulation/taskview.ts deleted file mode 100644 index d989e103..00000000 --- a/src/scripts/controllers/simulation/taskview.ts +++ /dev/null @@ -1,64 +0,0 @@ -import * as $ from "jquery"; -import {SimulationController} from "../simulationcontroller"; -import {Util} from "../../util"; - - -export class TaskViewController { - private simulationController: SimulationController; - - - constructor(simulationController: SimulationController) { - this.simulationController = simulationController; - } - - /** - * Populates and displays the list of tasks with their current state. - */ - public update() { - const container = $(".task-list"); - container.children().remove(".task-element"); - - this.simulationController.stateCache.stateList[this.simulationController.currentTick].taskStates - .forEach((taskState: ITaskState) => { - const html = this.generateTaskElementHTML(taskState); - container.append(html); - }); - } - - private generateTaskElementHTML(taskState: ITaskState) { - let iconType, timeInfo; - - if (taskState.task.startTick > this.simulationController.currentTick) { - iconType = "glyphicon-time"; - timeInfo = "Not started yet"; - } else if (taskState.task.startTick <= this.simulationController.currentTick && taskState.flopsLeft > 0) { - iconType = "glyphicon-refresh"; - timeInfo = "Started at " + Util.convertSecondsToFormattedTime(taskState.task.startTick); - } else if (taskState.flopsLeft === 0) { - iconType = "glyphicon-ok"; - timeInfo = "Started at " + Util.convertSecondsToFormattedTime(taskState.task.startTick); - } - - // Calculate progression ratio - const progress = 1 - (taskState.flopsLeft / taskState.task.totalFlopCount); - - // Generate completion text - const flopsCompleted = taskState.task.totalFlopCount - taskState.flopsLeft; - const completionInfo = "Completed: " + flopsCompleted + " / " + taskState.task.totalFlopCount + " FLOPS"; - - return '
' + - '
' + - '
' + - '
' + timeInfo + - '
' + - '
' + - '
' + - '
' + - '
' + - '
' + completionInfo + '
' + - '
' + - '
'; - } -} -- cgit v1.2.3