From a15252891d9b99f79e200ec66bc9229692b8d5fc Mon Sep 17 00:00:00 2001 From: nikita Date: Thu, 1 Sep 2016 18:27:44 +0530 Subject: [PATCH] 1. bug 7245-list manager close on other button. 2. code of extract after list manger sleection. 3. crash issue logs and trial code --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js | 136 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------- 400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js | 2 +- 400-SOURCECODE/AIAHTML5.Web/index.html | 2 +- 3 files changed, 111 insertions(+), 29 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 2edf433..599d4d5 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -662,6 +662,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //calculate coordinates for body region images $scope.CalculateImageCordinates = function (viewOrientationId) { + console.log('CalculateImageCordinates is called') + $scope.terminateCurrentlyRunningWPs(); var drawnBodyRegionCount = []; @@ -690,7 +692,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $('#leftToolBar').css('height', $('#daImagePanel').outerHeight()) - + $scope.counter = 0; + $scope.MCounter = 0; //calculate image coordinates and draw image var bodyRegionCoordinates = $rootScope.BodyRegionData.BodyRegionViews; // var viewOrientationId = String($rootScope.voId); @@ -709,18 +712,20 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo .where('_ViewOrientationId == ' + viewOrientationId) .select(); - if ($scope.ColoredImageSRC != null && $scope.ColoredImageSRC.length > 0) { - $scope.ColoredImageSRC = null; + if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined) && $scope.ColoredImageSRC.length > 0) { + $scope.ColoredImageSRC.length = 0; + // $scope.ColoredImageSRC = undefined; $scope.ColoredImageSRC = []; $scope.flushCanvas(); } else { $scope.ColoredImageSRC = []; } - + var counter = 0; if ($scope.bodyRegionCoordinates != null || $scope.bodyRegionCoordinates != undefined) { angular.forEach($scope.bodyRegionCoordinates, function (value, key) { - + counter++; + console.log('loop call=' + counter) if (value._HaveMirrorImage == 'Y') { //DrawMirroredImage @@ -1006,6 +1011,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.one = 1; $scope.userInput = parseInt($scope.layerNumber); + $scope.skinTone = $rootScope.globalSetting.ethnicity; var SelectedLayerData = []; @@ -1112,6 +1118,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.DrawMirroredImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) { + + + var FlipedImgCanvas = document.createElement('canvas'); FlipedImgCanvas.height = h; FlipedImgCanvas.width = w; @@ -1327,18 +1336,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var cw, ch, imgW, imgH, mouseX, mouseY; var scaleFactor = 1.00; - //$scaler = $("#scaler"); - //$scaler.val(scaleFactor); - //$scaler.hide(); - var img = new Image(); img.onload = start; - // img.src = "~/../content/images/" + src;; img.src = src; function start() { + context.save(); context.translate(w, 0); context.scale(-1, 1); @@ -1347,6 +1352,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if (isMaskImage == 'N') { + $scope.MCounter++; + + console.log('$scope.ColoredImageSRC.length inside flipped = ' + $scope.ColoredImageSRC.length + ', for $scope.layerNumber= ' + $scope.layerNumber); $scope.ColoredImageSRC.push( { "bodyRegionId": bodyRegionId, "SRC": src, @@ -1426,6 +1434,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.DrawImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) { + //console.log('DrawImage called for bodyRegionId= ' + bodyRegionId); + + var imgCanvas = document.createElement('canvas'); imgCanvas.height = h; @@ -1661,7 +1672,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo img.src = src; function start() { - //debugger; + context.drawImage(img, 0, 0); if (isMaskImage == 'N') { @@ -1669,6 +1680,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //do nothing } else { + $scope.counter++; + console.log('$scope.ColoredImageSRC.length inside normal = ' + $scope.ColoredImageSRC.length + ', for $scope.layerNumber= '+ $scope.layerNumber); + + $scope.ColoredImageSRC.push( { "bodyRegionId": bodyRegionId, "SRC": src, @@ -1766,11 +1781,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.HighlightBodyOnExtract = function () { - var multiTermList = []; var CallBackBodyRegion = []; - if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && ($rootScope.previousHighlightList.length > 0)) { + if ($rootScope.isListManagerSelected) { + multiTermList = $scope.AllTerms; + } + + else if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && ($rootScope.previousHighlightList.length > 0)) { angular.forEach($rootScope.previousHighlightList, function (value, key) { var ActualTermNo = $scope.getActualTermNumber(value); @@ -2328,10 +2346,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //layer change function $scope.LayerChange = function () { - //remove annotation + console.log('$scope.ColoredImageSRC.length OUTSIDE= ' + $scope.ColoredImageSRC.length) - + //if listanager is visisble then close it + $rootScope.isListManagerSelected = false; + $rootScope.CloseListManager(); + + $scope.isLayerChange = true; $rootScope.isLoading = true; @@ -2406,7 +2428,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // alert(' $.each(BodyRegionDictionary3. bodyRegionRight: ' + bodyRegionRight + ', bodyRegionBottom: ' + bodyRegionBottom) if (TransparencyBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && TransparencyBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) { //var transNumber = parseInt(document.getElementById("txtTransparencyChange").value); - // debugger; + $scope.layerNumber = parseInt(txtlayerNumber.value); @@ -2423,6 +2445,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if (parseInt($('#txtlayerNumber').val()) > (dataLength - 1)) { $('#txtlayerNumber').val(dataLength - 1); $scope.currentLayerNumber = parseInt(dataLength - 1); + $scope.layerNumber = parseInt(dataLength - 1); } else @@ -2437,6 +2460,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } //2. + //existing data + if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined) && $scope.ColoredImageSRC.length > 0) { + $scope.ColoredImageSRC.length = 0; + // $scope.ColoredImageSRC = undefined; + $scope.ColoredImageSRC = []; + + } + + $scope.CalculateImageCordinates($rootScope.viewOrientationId); //3. @@ -3270,6 +3302,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.createTransparencyBox = function () { + //if listanager is visisble then close it + $rootScope.isListManagerSelected = false; + $rootScope.CloseListManager(); + + $scope.isTransparencyActivated = true; // alert('transparencyClicked' + $scope.isTransparencyActivated) $('#btnTranparency').addClass('tButtonActive'); @@ -3673,7 +3710,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //do nothing } else if (isLayerChanged) { - // debugger + $scope.layerNumber = parseInt($('#txtlayerNumber').val()); } @@ -3681,6 +3718,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var currentLayer = parseInt($('#txtlayerNumber').val()); var tranparencyLayer = currentLayer + 1; + $scope.layerNumber = tranparencyLayer; } @@ -4404,6 +4442,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //$("canvas[name*='transparencyTempCanvas']").nextUntil($("canvas[name*='transparencyTempCanvas']")) //.remove(); + $scope.layerNumber = $scope.currentLayerNumber; $scope.transNumber = 50; $(".slider").slider({ value: 50 }) @@ -4468,6 +4507,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.OnIdentityClick = function () { // $('#btnIdentity').addClass('btn-primary'); + //if listanager is visisble then close it + $rootScope.isListManagerSelected = false; + $rootScope.CloseListManager(); + if ($scope.isTransparencyActivated == true) { @@ -4487,6 +4530,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.enableZoom = function () { + //if listanager is visisble then close it + $rootScope.isListManagerSelected = false; + $rootScope.CloseListManager(); + //remove speech bubble $('#sppeachBubble').css('display', 'none'); @@ -4647,6 +4694,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.enableHighlight = function () { + //if listanager is visisble then close it + // $rootScope.isListManagerSelected = false; + $rootScope.CloseListManager(); + console.log('enableHighlight is called') if ($rootScope.isHighLight == true) { @@ -4685,6 +4736,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.enableNormalMode = function () { + //if listanager is visisble then close it + // $rootScope.isListManagerSelected = false; + $rootScope.CloseListManager(); + if ($rootScope.isNormalMode == true) { } @@ -4718,6 +4773,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.enableExtract = function () { + //if listanager is visisble then close it + // $rootScope.isListManagerSelected = false; + $rootScope.CloseListManager(); + //1. $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -4758,6 +4817,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.enableShowHideStructureBox = function () { + //if listanager is visisble then close it + $rootScope.isListManagerSelected = false; + $rootScope.CloseListManager(); + + $(".com").toggle(); $('#dot').toggle(); $('#sppeachBubble').toggle() @@ -4966,6 +5030,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); } + else if ($rootScope.isListManagerSelected == true) { + $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); + + } } //else { // // this code is for the case where user first clcik on normal mode then extract then again highlight then we need to call highlight body in gray mode @@ -5022,7 +5090,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo else { // This code will execute when user will select normal Mode but this time isHighlight will be false - angular.forEach($scope.ColoredImageSRC, function (value, key) { var id; if (value.haveMirror == 'true') { @@ -5117,7 +5184,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); - // to do + } + else if ($rootScope.isListManagerSelected == true) { + $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); } } @@ -5199,6 +5268,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.OnGenderChange = function (event) { + //if listanager is visisble then close it + $rootScope.isListManagerSelected = false; + $rootScope.CloseListManager(); + + $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -5343,6 +5417,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.OnViewChange = function (event) { + + //if listanager is visisble then close it + $rootScope.isListManagerSelected = false; + $rootScope.CloseListManager(); + $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -5352,6 +5431,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } $rootScope.isViewChange = true; + $scope.layerNumber = 0; // debugger; var selectedViewId = $scope.bodyViews[event.currentTarget.attributes[1].value]; @@ -5490,6 +5570,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //Reload DA controller Body View after setting Change $scope.$on('reloadDABodyViewEvent', function (event, data) { //console.log('reloadDABodyViewEvent'); + $scope.layerNumber = parseInt($('#txtlayerNumber').val()); $scope.ReloadBodyViewId = data.reloadDABodyViewId; // $scope.layerNumber = 0; @@ -6398,7 +6479,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.HighlightBodysystem = function (event) { - //NIKITA + + + //if listanager is visisble then close it + $rootScope.isListManagerSelected = false; + $rootScope.CloseListManager(); + + $scope.isHighlightBodysystem = true; $scope.systemMatchedTermList = new jinqJs() .from($rootScope.BodySystemData.BodySystem.BodySystemTerm) @@ -6417,13 +6504,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //$rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); - //NIKITA - // $scope.isHighlightBodysystem = true; - - //if (systemMatchedTermList != null || systemMatchedTermList != undefined) { - - // $timeout(function () { $scope.HighlightBodyByTermList(systemMatchedTermList) }, 100); - //} + var viewtarget_highlightbody = angular.element(event.currentTarget); @@ -6853,6 +6934,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo layerNumber = parseInt(layerNumber) - 1; } + $scope.layerNumber = layerNumber; //4.get scroll position diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index e63a75e..42e8fa4 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -379,7 +379,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $rootScope.CloseListManager = function () { console.log('close') - $rootScope.isListManagerSelected = false; + //$rootScope.isListManagerSelected = false; $('#listManager').css('display', 'none'); $("#listManager").css("visibility", "hidden"); // $rootScope.isAnnotationWindowClose = true; diff --git a/400-SOURCECODE/AIAHTML5.Web/index.html b/400-SOURCECODE/AIAHTML5.Web/index.html index 790a659..e560d8a 100644 --- a/400-SOURCECODE/AIAHTML5.Web/index.html +++ b/400-SOURCECODE/AIAHTML5.Web/index.html @@ -1,7 +1,7 @@  - + -- libgit2 0.21.4