'use strict';

/* Controllers */

angular.module('myApp.controllers', [])
.controller('MainController', ['LinpackWorker','$scope','$rootScope' , function(LinpackWorker,$scope, $rootScope) {
	$scope.testLaunched = false;
	$scope.alreadyRunned = false;

	$scope.score = 0;

	$scope.startWork = function(){
		$scope.testLaunched = true;
		LinpackWorker.doWork("Linpack"); 
	}

	$scope.$on('workerend', function(data){
		$scope.testLaunched = false;
		if(LinpackWorker.getResult()){
			$scope.score = LinpackWorker.getResult()[0];
			$scope.alreadyRunned = true;
		}
		$scope.$apply();
	});
}])
.controller('AppController', ['$scope','$rootScope','$location', function($scope, $rootScope, $location) {
	
}]);