diff --git a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/chartresourceusagecontroller.js b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/chartresourceusagecontroller.js index 4408acee34822413ee363c3e18d55ac3cb1c41ee..8d561e85be224421435fe0dee47d09a82fc9b4ba 100644 --- a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/chartresourceusagecontroller.js +++ b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/chartresourceusagecontroller.js @@ -61,12 +61,14 @@ chartResourceUsageControllerMod.controller('ChartResourceUsageController', ['$sc function updateChartLofarTime() { var lofarTime = $scope.dataService.lofarTime; - $scope.chartConfig.xAxis.plotLines = [{ - width: 3, - color: '#222222', - zIndex: 100, - value: lofarTime.getTime() - }]; + if(lofarTime.getSeconds() % 5 == 0) { + $scope.chartConfig.xAxis.plotLines = [{ + width: 3, + color: '#222222', + zIndex: 100, + value: lofarTime.getTime() + }]; + } }; $scope.$watch('dataService.lofarTime', updateChartLofarTime); @@ -239,6 +241,5 @@ chartResourceUsageControllerMod.controller('ChartResourceUsageController', ['$sc $scope.$watch('dataService.resources', updateChartData, true); $scope.$watch('dataService.resourceUsagesDict', updateChartData, true); $scope.$watch('dataService.viewTimeSpan', updateChartData, true); -// $scope.$watch('dataService.lofarTime', function() {$scope.options.currentDateValue= $scope.dataService.lofarTime;}); } ]); diff --git a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/datacontroller.js b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/datacontroller.js index b56052d410dbf90240d496afab26e799c7fb4daa..4a579bd00e576c4ea2be5a6d5b5edcb20d2d070f 100644 --- a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/datacontroller.js +++ b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/datacontroller.js @@ -36,6 +36,8 @@ angular.module('raeApp').factory("dataService", ['$http', '$q', function($http, self.selected_resourceClaim_id; self.initialLoadComplete = false; + self.taskChangeCntr = 0; + self.claimChangeCntr = 0; self.viewTimeSpan = {from: new Date(), to: new Date() }; @@ -141,6 +143,7 @@ angular.module('raeApp').factory("dataService", ['$http', '$q', function($http, self.filteredTasks = self.tasks; self.filteredTaskDict = self.taskDict; + self.taskChangeCntr++; self.computeMinMaxTaskTimes(); @@ -420,6 +423,7 @@ angular.module('raeApp').factory("dataService", ['$http', '$q', function($http, } } + self.taskChangeCntr++; self.computeMinMaxTaskTimes(); } else if(change.objectType == 'resourceClaim') { anyResourceClaims = true; @@ -447,6 +451,7 @@ angular.module('raeApp').factory("dataService", ['$http', '$q', function($http, } } + self.claimChangeCntr++; self.computeMinMaxResourceClaimTimes(); } else if(change.objectType == 'resourceCapacity') { if(change.changeType == 'update') { @@ -505,8 +510,8 @@ dataControllerMod.controller('DataController', $scope.openViewFromDatePopup = function() { $scope.viewFromDatePopupOpened = true; }; $scope.openViewToDatePopup = function() { $scope.viewToDatePopupOpened = true; }; - $scope.jumpTimespanWidths = [{value:60, name:'1 Hour'}, {value:3*60, name:'3 Hours'}, {value:6*60, name:'6 Hours'}, {value:12*60, name:'12 Hours'}, {value:24*60, name:'1 Day'}, {value:2*24*60, name:'2 Days'}, {value:5*24*60, name:'5 Days'}, {value:7*24*60, name:'1 Week'}, {value:14*24*60, name:'2 Weeks'}, {value:28*24*60, name:'4 Weeks'}]; - $scope.jumpTimespanWidth = $scope.jumpTimespanWidths[7]; + $scope.jumpTimespanWidths = [{value:30, name:'30 Minutes'}, {value:60, name:'1 Hour'}, {value:3*60, name:'3 Hours'}, {value:6*60, name:'6 Hours'}, {value:12*60, name:'12 Hours'}, {value:24*60, name:'1 Day'}, {value:2*24*60, name:'2 Days'}, {value:5*24*60, name:'5 Days'}, {value:7*24*60, name:'1 Week'}, {value:14*24*60, name:'2 Weeks'}, {value:28*24*60, name:'4 Weeks'}]; + $scope.jumpTimespanWidth = $scope.jumpTimespanWidths[8]; $scope.jumpToNow = function() { var floorLofarTime = dataService.floorDate(dataService.lofarTime, 1, 5); dataService.viewTimeSpan = { diff --git a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/ganttprojectcontroller.js b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/ganttprojectcontroller.js index b700480e87555344eb963fac388ee5ce3c0c4bdd..4ad95c83910933dd21a1f5097587c66e45dbf12a 100644 --- a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/ganttprojectcontroller.js +++ b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/ganttprojectcontroller.js @@ -126,7 +126,9 @@ ganttProjectControllerMod.controller('GanttProjectController', ['$scope', 'dataS $scope.options.toDate = $scope.dataService.viewTimeSpan.to; var fullTimespanInMinutes = ($scope.options.toDate - $scope.options.fromDate) / (60 * 1000); - if(fullTimespanInMinutes > 14*24*60) { + if(fullTimespanInMinutes > 28*24*60) { + $scope.options.viewScale = '7 days'; + } else if(fullTimespanInMinutes > 14*24*60) { $scope.options.viewScale = '1 day'; } else if(fullTimespanInMinutes > 7*24*60) { $scope.options.viewScale = '6 hours'; @@ -221,14 +223,17 @@ ganttProjectControllerMod.controller('GanttProjectController', ['$scope', 'dataS $scope.$watch('dataService.initialLoadComplete', updateGanttData); $scope.$watch('dataService.selected_task_id', updateGanttData); - $scope.$watch('dataService.tasks', updateGanttData, true); + $scope.$watch('dataService.tasks', updateGanttData); $scope.$watch('dataService.resources', updateGanttData); - $scope.$watch('dataService.resourceClaims', updateGanttData, true); + $scope.$watch('dataService.resourceClaims', updateGanttData); $scope.$watch('dataService.resourceGroups', updateGanttData); $scope.$watch('dataService.resourceGroupMemberships', updateGanttData); $scope.$watch('dataService.filteredTaskDict', updateGanttData); - $scope.$watch('dataService.momProjectsDict', updateGanttData, true); + $scope.$watch('dataService.momProjectsDict', updateGanttData); $scope.$watch('dataService.viewTimeSpan', updateGanttData, true); - $scope.$watch('dataService.lofarTime', function() {$scope.options.currentDateValue= $scope.dataService.lofarTime;}); + $scope.$watch('dataService.taskChangeCntr', updateGanttData); + $scope.$watch('dataService.lofarTime', function() { + if($scope.dataService.lofarTime.getSeconds() % 5 == 0) { + $scope.options.currentDateValue= $scope.dataService.lofarTime;}}); } ]); diff --git a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/ganttresourcecontroller.js b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/ganttresourcecontroller.js index 9b496cadb9a5740491682603ec6675b11f7718a6..f75da077ea7866cc24a0e95f18236f33202dca55 100644 --- a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/ganttresourcecontroller.js +++ b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/ganttresourcecontroller.js @@ -415,13 +415,16 @@ ganttResourceControllerMod.controller('GanttResourceController', ['$scope', 'dat $scope.$watch('dataService.initialLoadComplete', updateGanttData); $scope.$watch('dataService.selected_task_id', updateGanttData); - $scope.$watch('dataService.tasks', updateGanttData, true); + $scope.$watch('dataService.tasks', updateGanttData); $scope.$watch('dataService.resources', updateGanttData); - $scope.$watch('dataService.resourceClaims', updateGanttData, true); + $scope.$watch('dataService.resourceClaims', updateGanttData); $scope.$watch('dataService.resourceGroups', updateGanttData); $scope.$watch('dataService.resourceGroupMemberships', updateGanttData); $scope.$watch('dataService.filteredTaskDict', updateGanttData); $scope.$watch('dataService.viewTimeSpan', updateGanttData, true); - $scope.$watch('dataService.lofarTime', function() {$scope.options.currentDateValue= $scope.dataService.lofarTime;}); + $scope.$watch('dataService.claimChangeCntr', updateGanttData); + $scope.$watch('dataService.lofarTime', function() { + if($scope.dataService.lofarTime.getSeconds() % 5 == 0) { + $scope.options.currentDateValue= $scope.dataService.lofarTime;}}); } ]); diff --git a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/gridcontroller.js b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/gridcontroller.js index 421275af2ee5835ef47045a4d583fd2810a6c851..dcf194bd7255923f34ae97c76048a45e868f67d2 100644 --- a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/gridcontroller.js +++ b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/gridcontroller.js @@ -138,9 +138,25 @@ gridControllerMod.controller('GridController', ['$scope', 'dataService', 'uiGrid }; $scope.$watch('dataService.tasks', function() { - if('tasks' in $scope.dataService && $scope.dataService.tasks.length > 0) - $scope.gridOptions.data = $scope.dataService.tasks; - else + if('tasks' in $scope.dataService && $scope.dataService.tasks.length > 0) { + var tasks = []; + for(var task of $scope.dataService.tasks) { + var gridTask = { + id: task.id, + name: task.name, + project_name: task.project_name, + mom_id: task.mom_id, + otdb_id: task.otdb_id, + starttime: task.starttime, + endtime: task.endtime, + status: task.status, + type: task.type + }; + tasks.push(gridTask); + } + + $scope.gridOptions.data = tasks; + } else $scope.gridOptions.data = [] fillProjectsColumFilterSelectOptions();