diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 084f23e..71cb673 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -438,23 +438,25 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } // 0.2 getting corresponding body view title - var counter = 1; + //var counter = 1; var tittle = localStorage.getItem("currentViewTitleFromJson"); + localStorage.setItem("currentViewTitle", tittle); - if (openViews != null && openViews != undefined) { - angular.forEach(openViews, function (value, key) { + //WILL BE USED WHEN MULTI VIEWOPEN FUNCTIONALITY IS IMPELMNETD + //if (openViews != null && openViews != undefined) { + // angular.forEach(openViews, function (value, key) { - if (value.bodyView == tittle) { - tittle = localStorage.getItem("currentViewTitleFromJson") + counter++; - $rootScope.currentActiveViewTitle = tittle; - localStorage.setItem("currentViewTitle", tittle); - } + // if (value.bodyView == tittle) { + // tittle = localStorage.getItem("currentViewTitleFromJson") + counter++; + // $rootScope.currentActiveViewTitle = tittle; + // localStorage.setItem("currentViewTitle", tittle); + // } - }); - } - else { - localStorage.setItem("currentViewTitle", tittle); - } + // }); + //} + //else { + // localStorage.setItem("currentViewTitle", tittle); + //} //0.3 @@ -468,6 +470,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo url: 'app/views/da/da-view.html' }, title: localStorage.getItem("currentViewTitle"), + position: { top: 70, left: 1, @@ -735,6 +738,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //calculate coordinates for body region images $scope.CalculateImageCordinates = function (viewOrientationId) { + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); + // annotation toolbar canvas if ($("#canvasDiv").find("canvas[id='canvasPaint']").length == 0) { @@ -744,6 +750,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } + + $scope.terminateCurrentlyRunningWPs(); var drawnBodyRegionCount = []; @@ -948,8 +956,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo }); - $rootScope.isLoading = false; - $('#spinner').css('visibility', 'hidden'); + //$rootScope.isLoading = false; + //$('#spinner').css('visibility', 'hidden'); } if (($rootScope.globalSetting.modesty == 'Y')) { @@ -1205,6 +1213,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.DrawMirroredImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) { + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); + var FlipedImgCanvas = document.createElement('canvas'); FlipedImgCanvas.height = h; FlipedImgCanvas.width = w; @@ -1532,6 +1543,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //}, 500); } } + else { + $rootScope.isLoading = false; + $('#spinner').css('visibility', 'hidden'); + } } // console.log('ColoredImageSRC. pushed and length: ' + $scope.ColoredImageSRC.length); @@ -1564,6 +1579,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.DrawImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) { + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); + var imgCanvas = document.createElement('canvas'); imgCanvas.height = h; @@ -1895,6 +1913,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } + else { + $rootScope.isLoading = false; + $('#spinner').css('visibility', 'hidden'); + } } console.log('ColoredImageSRC. pushed and length: ' + $scope.ColoredImageSRC.length); @@ -1969,6 +1991,26 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var CallBackBodyRegion = []; var selectedAnnotation; + if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && ($rootScope.previousHighlightList.length > 0) && $rootScope.isListManagerSelected) { + + multiTermList = $scope.AllTerms; + angular.forEach($rootScope.previousHighlightList, function (value, key) { + + var ActualTermNo = $scope.getActualTermNumber(value); + selectedAnnotation = ActualTermNo; + if (ActualTermNo != null) { + var TermList = $scope.getTermNumberList(ActualTermNo); + if (TermList != null) { + for (var i = 0; i < TermList.length; i++) { + multiTermList.push(TermList[i]); + } + } + } + + // to do + }); + } + if ($rootScope.isListManagerSelected) { multiTermList = $scope.AllTerms; @@ -2165,7 +2207,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.aligneCanvasWithTerm() } - $timeout(function () { $scope.DisableProgressBar() }, 1000); + // $timeout(function () { $scope.DisableProgressBar() }, 1000); @@ -2399,16 +2441,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if ($scope.doAligneCanvasWithTerm == true) { - if ($rootScope.isHighlightBodyByBodySystem == true || $rootScope.isListManagerSelected == true) + if ($rootScope.isListManagerSelected == true) + $scope.aligneCanvasWithTerm(); + + else if ($rootScope.isHighlightBodyByBodySystem == true || $rootScope.isListManagerSelected == true) { $rootScope.isLoading = false; - $('#spinner').css('visibility', 'hidden'); + $('#spinner').css('visibility', 'hidden'); + } // $rootScope.isHighlightBodyByBodySystem = false; - if ($rootScope.isListManagerSelected == true) - $scope.aligneCanvasWithTerm(); + } } // @@ -5018,56 +5063,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.flushCanvas = function () { - //if ($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined) { - // angular.forEach($scope.ColoredImageSRC, function (value, key) { - // var id; - // var maskId; - // if (value.haveMirror == 'true') { - // id = 'imageCanvas' + value.bodyRegionId + '_MR'; - // maskId = 'imageCanvas' + value.bodyRegionId + '_MR_mci' - // } - // else { - // id = 'imageCanvas' + value.bodyRegionId; - // maskId = 'imageCanvas' + value.bodyRegionId + '_mci'; - // } - - // var canvas = document.getElementById(id); - // if (canvas != null || canvas != undefined) { - // document.getElementById('canvasDiv').removeChild(canvas); - // } - - // var maskcanvas = document.getElementById(maskId); - // if (maskcanvas != null || maskcanvas != undefined) { - // document.getElementById('canvasDiv').removeChild(maskcanvas); + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); - // } - // if (i == 4 || i == 5 || i == 6) { - // id = 'imageCanvas' + i + '_MR'; - // maskId = 'imageCanvas' + i + '_MR_mci'; - - // var canvas = document.getElementById(id); - // if (canvas != null || canvas != undefined) - // document.getElementById('canvasDiv').removeChild(canvas); - - // var maskcanvas = document.getElementById(maskId); - // if (maskcanvas != null || maskcanvas != undefined) - // document.getElementById('canvasDiv').removeChild(maskcanvas); - // } - - // var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']"); - // for (var i = 0; i < modestyCanvases.length; i++) { - // modestyCanvases[i].remove(); - // } - // }); - // //remove modesty canavs - // var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']"); - // if (modestyCanvases != null || modestyCanvases != undefined && modestyCanvases.length > 0) { - // for (var j = 0; j < modestyCanvases.length; j++) { - // modestyCanvases[j].remove(); - // } - // } - //} var endIndex = 0; var startIndex = 0; if (($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) { @@ -5123,7 +5122,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']"); if (modestyCanvases != null || modestyCanvases != undefined && modestyCanvases.length > 0) { for (var j = 0; j < modestyCanvases.length; j++) { - modestyCanvases[j].remove(); + + modestyCanvases[j].parentNode.removeChild(modestyCanvases[j]); } } } @@ -5625,9 +5625,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if ($scope.isEligibleForHighlightBodyByTermList == true) { //DISABLE PROGERSS BAR FOR GENDER OR VIEW CHANGE // if ($rootScope.isGenderChnage == true || $rootScope.isViewChange == true) { - $scope.isLoading = false; + //$scope.isLoading = false; - $('#spinner').css('visibility', 'hidden'); + //$('#spinner').css('visibility', 'hidden'); //} if (($rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) { @@ -5929,7 +5929,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var currentBodyViewId = $scope.correspondingBodyViewIds[$rootScope.voId]; - if ((event.currentTarget.attributes[1].value == 'Male') && (localStorage.getItem("genderId") == 'Female')) { + if ((event.currentTarget.title == 'Male') && (localStorage.getItem("genderId") == 'Female')) { //1. localStorage.setItem("genderId", 'Male'); @@ -5961,7 +5961,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } - else if ((event.currentTarget.attributes[1].value == 'Female') && (localStorage.getItem("genderId") == 'Male')) { + else if ((event.currentTarget.title == 'Female') && (localStorage.getItem("genderId") == 'Male')) { //1. localStorage.setItem("genderId", 'Female'); @@ -6145,7 +6145,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.layerNumber = 0; // debugger; - var selectedViewId = $scope.bodyViews[event.currentTarget.attributes[1].value]; + //var selectedViewId = $scope.bodyViews[event.currentTarget.attributes[1].value]; + var selectedViewId = $scope.bodyViews[event.currentTarget.title]; + $rootScope.viewOrientationId = selectedViewId; if (localStorage.getItem("genderId") == 'Male') { if ($rootScope.voId != selectedViewId) { @@ -6210,8 +6212,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("genderId") + " " + $scope.bodyViews[event.currentTarget.attributes[1].value; } - $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("genderId") + " " + event.currentTarget.attributes[1].value; - localStorage.setItem("currentViewTitle", localStorage.getItem("genderId") + " " + event.currentTarget.attributes[1].value); + $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("genderId") + " " + event.currentTarget.title; + localStorage.setItem("currentViewTitle", localStorage.getItem("genderId") + " " + event.currentTarget.title); $rootScope.openViews.push( @@ -6977,7 +6979,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo for (var j = 0; j < $scope.VocabTermTxt.length; j++) { - var $el = $('').appendTo('#termList') + var $el = $('').appendTo('#termList') $compile($el)($scope); } @@ -7003,6 +7005,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $('#spinner').css('visibility', 'hidden'); } else { + + $rootScope.isLoading = true; + + $('#spinner').css('visibility', 'visible'); + + $rootScope.prevId = event.currentTarget.id; $("#termList").find("option").attr('selected', false); $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); @@ -7025,10 +7033,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } //--- - $rootScope.isLoading = true; - - $('#spinner').css('visibility', 'visible'); - + $rootScope.isHighlightBodyByBodySystem = false; //1. @@ -7134,8 +7139,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //8.remove current layer canavses $scope.flushCanvas(); - - + //9. $timeout(function () { @@ -7150,6 +7154,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //DA > Annotation's Line should not displayed. $("#bord").css("display", "none"); + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); + //redraw body of respective layer $scope.CalculateImageCordinates($rootScope.viewOrientationId) }, 500);