Commit bfd2774f77fdaba032f096c7159a4800ab90d4f7
Merge branch 'Bug#8127' into Develop
Showing
1 changed file
with
66 additions
and
29 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -1943,18 +1943,25 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1943 | 1943 | $scope.HighlightBodyOnExtract = function () { |
1944 | 1944 | console.log(' insode HighlightBodyOnExtract. $rootScope.MaskCanvasData length= ' + $rootScope.MaskCanvasData.length + ', $rootScope.previousHighlightList.length= ' + $rootScope.previousHighlightList.length) |
1945 | 1945 | |
1946 | + //terminate previous running workers to create space for new workers | |
1947 | + $scope.layerNumber = $('#txtlayerNumber').val(); | |
1948 | + $scope.terminateCurrentlyRunningWPs(); | |
1949 | + | |
1946 | 1950 | var multiTermList = []; |
1947 | 1951 | var CallBackBodyRegion = []; |
1952 | + var selectedAnnotation; | |
1948 | 1953 | |
1949 | 1954 | if ($rootScope.isListManagerSelected) { |
1950 | 1955 | |
1951 | 1956 | multiTermList = $scope.AllTerms; |
1957 | + selectedAnnotation = $rootScope.actualTermNumber; | |
1952 | 1958 | |
1953 | 1959 | } |
1954 | 1960 | else if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && ($rootScope.previousHighlightList.length > 0)) { |
1955 | 1961 | angular.forEach($rootScope.previousHighlightList, function (value, key) { |
1956 | 1962 | |
1957 | 1963 | var ActualTermNo = $scope.getActualTermNumber(value); |
1964 | + selectedAnnotation = ActualTermNo; | |
1958 | 1965 | if (ActualTermNo != null) { |
1959 | 1966 | var TermList = $scope.getTermNumberList(ActualTermNo); |
1960 | 1967 | if (TermList != null) { |
... | ... | @@ -1968,16 +1975,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1968 | 1975 | }); |
1969 | 1976 | } |
1970 | 1977 | |
1971 | - //2. Find Actul Term No Based on Icolor. | |
1972 | - //var ActualTermNo = $scope.getActualTermNumber(RGBColor); | |
1973 | - | |
1974 | - ////3. Find Term No List Based on ActualTermNo | |
1975 | - //var TermList = $scope.getTermNumberList(ActualTermNo); | |
1978 | + //get term list to get term coordinates | |
1979 | + $scope.TermList = $scope.getTermNumberList(selectedAnnotation); | |
1976 | 1980 | |
1977 | - | |
1978 | - //terminate previous running workers to create space for new workers | |
1979 | - $scope.layerNumber = $('#txtlayerNumber').val(); | |
1980 | - $scope.terminateCurrentlyRunningWPs(); | |
1981 | + $scope.termCoordinate = $scope.getTermCoordinate(selectedAnnotation); | |
1982 | + | |
1983 | + | |
1981 | 1984 | |
1982 | 1985 | $timeout(function () { |
1983 | 1986 | |
... | ... | @@ -2076,7 +2079,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
2076 | 2079 | |
2077 | 2080 | grayCanvasContext.putImageData(updatedData, 0, 0); |
2078 | 2081 | |
2079 | - | |
2080 | 2082 | //to resolve lateral arm black issue in highlight mode |
2081 | 2083 | |
2082 | 2084 | if ($rootScope.viewOrientationId == 5 && (bodyRegionId == 6 || bodyRegionId == 4)) { |
... | ... | @@ -2098,6 +2100,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
2098 | 2100 | grayCanvasContext.putImageData(imgData, 0, 0); |
2099 | 2101 | } |
2100 | 2102 | |
2103 | + CallBackBodyRegion.push(bodyRegionId); | |
2104 | + | |
2105 | + $scope.doAligneCanvasWithTerm = false; | |
2106 | + if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && (CallBackBodyRegion.length == 9)) { | |
2107 | + $scope.doAligneCanvasWithTerm = true; | |
2108 | + } | |
2109 | + else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && (CallBackBodyRegion.length == 5)) { | |
2110 | + $scope.doAligneCanvasWithTerm = true; | |
2111 | + } | |
2112 | + else if ((($rootScope.viewOrientationId == '5')) && (CallBackBodyRegion.length == 1)) { | |
2113 | + $scope.doAligneCanvasWithTerm = true; | |
2114 | + } | |
2115 | + else if ((($rootScope.viewOrientationId == '6')) && (CallBackBodyRegion.length == 1)) { | |
2116 | + $scope.doAligneCanvasWithTerm = true; | |
2117 | + } | |
2118 | + | |
2101 | 2119 | |
2102 | 2120 | if ($rootScope.multiAnnotationIsON == true) { |
2103 | 2121 | |
... | ... | @@ -2125,9 +2143,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
2125 | 2143 | // } |
2126 | 2144 | //} |
2127 | 2145 | |
2146 | + if ($scope.doAligneCanvasWithTerm == true) { | |
2147 | + $scope.aligneCanvasWithTerm() | |
2148 | + } | |
2128 | 2149 | |
2129 | 2150 | $timeout(function () { $scope.DisableProgressBar() }, 1000); |
2151 | + | |
2130 | 2152 | |
2153 | + | |
2131 | 2154 | }; |
2132 | 2155 | worker.onerror = function (e) { |
2133 | 2156 | alert('Error: Line ' + e.lineno + ' in ' + e.filename + ': ' + e.message); |
... | ... | @@ -3579,7 +3602,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3579 | 3602 | |
3580 | 3603 | $scope.createTransparencyBox = function () { |
3581 | 3604 | |
3582 | - $scope.isTransparencyActivated = true; | |
3605 | + | |
3606 | + $scope.isTransparencyBtnClicked = true; | |
3583 | 3607 | |
3584 | 3608 | //do not create TBOX if in extarct mode otherwise create |
3585 | 3609 | if ($rootScope.isExtract == false) { |
... | ... | @@ -3746,6 +3770,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3746 | 3770 | document.getElementById('canvasDiv').appendChild(tempCanvas); |
3747 | 3771 | } |
3748 | 3772 | |
3773 | + $scope.isTransparencyActivated = true; | |
3749 | 3774 | |
3750 | 3775 | var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData; |
3751 | 3776 | |
... | ... | @@ -4876,9 +4901,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4876 | 4901 | $rootScope.CloseListManager(); |
4877 | 4902 | // $('#btnIdentity').addClass('btn-primary'); |
4878 | 4903 | |
4879 | - if ($scope.isTransparencyActivated == true) { | |
4904 | + if ($scope.isTransparencyBtnClicked == true) { | |
4880 | 4905 | |
4881 | - $scope.isTransparencyActivated = false; | |
4906 | + $scope.isTransparencyBtnClicked = false; | |
4882 | 4907 | |
4883 | 4908 | var canvasDiv = document.getElementById('canvasDiv'); |
4884 | 4909 | canvasDiv.removeEventListener("mousedown", mouseDownListener); |
... | ... | @@ -4899,7 +4924,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4899 | 4924 | $rootScope.isTransparencyBoxActivated = false; |
4900 | 4925 | $rootScope.isNormalMode = false; |
4901 | 4926 | |
4902 | - | |
4927 | + | |
4903 | 4928 | //if listanager is visisble then close it |
4904 | 4929 | |
4905 | 4930 | $rootScope.CloseListManager(); |
... | ... | @@ -4930,21 +4955,29 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4930 | 4955 | } |
4931 | 4956 | else { |
4932 | 4957 | $scope.zoomInOut = 25; |
4958 | + | |
4959 | + | |
4933 | 4960 | } |
4934 | 4961 | |
4935 | 4962 | //2. |
4936 | 4963 | $scope.CalculateImageCordinates($rootScope.viewOrientationId); |
4937 | 4964 | |
4938 | 4965 | //3. |
4939 | - if ($scope.zoomInOut == 25) { | |
4940 | - if ($('#canvasDiv') != null) | |
4941 | - $('#canvasDiv').scrollLeft(0) | |
4942 | - } | |
4943 | - else { | |
4944 | - if ($('#canvasDiv') != null) | |
4945 | - $('#canvasDiv').scrollLeft($('#canvasDiv').width() / 2) | |
4946 | - } | |
4947 | 4966 | |
4967 | + | |
4968 | + if ($scope.zoomInOut == 25) { | |
4969 | + if ($('#canvasDiv') != null) | |
4970 | + $('#canvasDiv').scrollLeft(0) | |
4971 | + | |
4972 | + } | |
4973 | + else { | |
4974 | + if ($('#canvasDiv') != null) | |
4975 | + $('#canvasDiv').scrollLeft($('#canvasDiv').width() / 2) | |
4976 | + | |
4977 | + | |
4978 | + } | |
4979 | + | |
4980 | + | |
4948 | 4981 | //remove annotation speech bubble |
4949 | 4982 | if ($('#dot').length > 0) { |
4950 | 4983 | $('#dot').remove(); |
... | ... | @@ -5263,8 +5296,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5263 | 5296 | |
5264 | 5297 | $rootScope.CanvasDivLeftPosition = $("#canvasDiv").scrollLeft(); |
5265 | 5298 | |
5266 | - | |
5267 | - | |
5299 | + | |
5268 | 5300 | if ($scope.isTransparencyActivated == true) { |
5269 | 5301 | |
5270 | 5302 | $("#btnExtract").addClass("disabled"); |
... | ... | @@ -5857,8 +5889,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5857 | 5889 | |
5858 | 5890 | // $rootScope.isHighlightBodyByBodySystem = false; |
5859 | 5891 | |
5860 | - $rootScope.isLoading = true; | |
5861 | - $('#spinner').css('visibility', 'visible'); | |
5892 | + | |
5862 | 5893 | |
5863 | 5894 | $rootScope.isGenderChnage = true; |
5864 | 5895 | |
... | ... | @@ -5873,6 +5904,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5873 | 5904 | //2 first update the currentbodyviewid in local storage |
5874 | 5905 | localStorage.setItem("currentBodyViewId", currentBodyViewId); |
5875 | 5906 | |
5907 | + $rootScope.isLoading = true; | |
5908 | + $('#spinner').css('visibility', 'visible'); | |
5876 | 5909 | //3. |
5877 | 5910 | $scope.layerNumber = 0; |
5878 | 5911 | $scope.loadSelectedBodyView(currentBodyViewId); |
... | ... | @@ -5901,6 +5934,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5901 | 5934 | //2. first update the currentbodyviewid in local storage |
5902 | 5935 | localStorage.setItem("currentBodyViewId", currentBodyViewId); |
5903 | 5936 | |
5937 | + $rootScope.isLoading = true; | |
5938 | + $('#spinner').css('visibility', 'visible'); | |
5904 | 5939 | //3. |
5905 | 5940 | $scope.layerNumber = 0; |
5906 | 5941 | $scope.loadSelectedBodyView(currentBodyViewId); |
... | ... | @@ -6059,9 +6094,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6059 | 6094 | // $rootScope.isHighlightBodyByBodySystem = false; |
6060 | 6095 | |
6061 | 6096 | |
6062 | - $rootScope.isLoading = true; | |
6063 | - $('#spinner').css('visibility', 'visible'); | |
6064 | - | |
6065 | 6097 | |
6066 | 6098 | if ($rootScope.openViews.length > 0) { |
6067 | 6099 | $rootScope.openViews.splice($rootScope.openViews.length - 1); |
... | ... | @@ -6084,6 +6116,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6084 | 6116 | $rootScope.voId = selectedViewId; |
6085 | 6117 | $rootScope.isLoading = true; |
6086 | 6118 | |
6119 | + $rootScope.isLoading = true; | |
6120 | + $('#spinner').css('visibility', 'visible'); | |
6121 | + | |
6087 | 6122 | //1. first update the currentbodyviewid in local storage |
6088 | 6123 | localStorage.setItem("currentBodyViewId", $rootScope.voId); |
6089 | 6124 | |
... | ... | @@ -6119,6 +6154,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6119 | 6154 | $rootScope.voId = selectedViewId; |
6120 | 6155 | $rootScope.isLoading = true; |
6121 | 6156 | |
6157 | + $rootScope.isLoading = true; | |
6158 | + $('#spinner').css('visibility', 'visible'); | |
6122 | 6159 | //1. |
6123 | 6160 | $scope.loadSelectedBodyView($rootScope.voId); |
6124 | 6161 | ... | ... |