Commit a15252891d9b99f79e200ec66bc9229692b8d5fc

Authored by Nikita Kulshreshtha
1 parent 06dca758

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
... ... @@ -662,6 +662,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
662 662 //calculate coordinates for body region images
663 663 $scope.CalculateImageCordinates = function (viewOrientationId) {
664 664  
  665 + console.log('CalculateImageCordinates is called')
  666 +
665 667 $scope.terminateCurrentlyRunningWPs();
666 668  
667 669 var drawnBodyRegionCount = [];
... ... @@ -690,7 +692,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
690 692 $('#leftToolBar').css('height', $('#daImagePanel').outerHeight())
691 693  
692 694  
693   -
  695 + $scope.counter = 0;
  696 + $scope.MCounter = 0;
694 697 //calculate image coordinates and draw image
695 698 var bodyRegionCoordinates = $rootScope.BodyRegionData.BodyRegionViews;
696 699 // var viewOrientationId = String($rootScope.voId);
... ... @@ -709,18 +712,20 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
709 712 .where('_ViewOrientationId == ' + viewOrientationId)
710 713 .select();
711 714  
712   - if ($scope.ColoredImageSRC != null && $scope.ColoredImageSRC.length > 0) {
713   - $scope.ColoredImageSRC = null;
  715 + if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined) && $scope.ColoredImageSRC.length > 0) {
  716 + $scope.ColoredImageSRC.length = 0;
  717 + // $scope.ColoredImageSRC = undefined;
714 718 $scope.ColoredImageSRC = [];
715 719 $scope.flushCanvas();
716 720 }
717 721 else {
718 722 $scope.ColoredImageSRC = [];
719 723 }
720   -
  724 + var counter = 0;
721 725 if ($scope.bodyRegionCoordinates != null || $scope.bodyRegionCoordinates != undefined) {
722 726 angular.forEach($scope.bodyRegionCoordinates, function (value, key) {
723   -
  727 + counter++;
  728 + console.log('loop call=' + counter)
724 729 if (value._HaveMirrorImage == 'Y') {
725 730  
726 731 //DrawMirroredImage
... ... @@ -1006,6 +1011,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1006 1011 $scope.one = 1;
1007 1012  
1008 1013 $scope.userInput = parseInt($scope.layerNumber);
  1014 +
1009 1015 $scope.skinTone = $rootScope.globalSetting.ethnicity;
1010 1016  
1011 1017 var SelectedLayerData = [];
... ... @@ -1112,6 +1118,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1112 1118  
1113 1119 $scope.DrawMirroredImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) {
1114 1120  
  1121 +
  1122 +
  1123 +
1115 1124 var FlipedImgCanvas = document.createElement('canvas');
1116 1125 FlipedImgCanvas.height = h;
1117 1126 FlipedImgCanvas.width = w;
... ... @@ -1327,18 +1336,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1327 1336 var cw, ch, imgW, imgH, mouseX, mouseY;
1328 1337 var scaleFactor = 1.00;
1329 1338  
1330   - //$scaler = $("#scaler");
1331   - //$scaler.val(scaleFactor);
1332   - //$scaler.hide();
1333   -
1334 1339 var img = new Image();
1335 1340 img.onload = start;
1336 1341  
1337   - // img.src = "~/../content/images/" + src;;
1338 1342 img.src = src;
1339 1343  
1340 1344  
1341 1345 function start() {
  1346 +
1342 1347 context.save();
1343 1348 context.translate(w, 0);
1344 1349 context.scale(-1, 1);
... ... @@ -1347,6 +1352,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1347 1352  
1348 1353  
1349 1354 if (isMaskImage == 'N') {
  1355 + $scope.MCounter++;
  1356 +
  1357 + console.log('$scope.ColoredImageSRC.length inside flipped = ' + $scope.ColoredImageSRC.length + ', for $scope.layerNumber= ' + $scope.layerNumber);
1350 1358 $scope.ColoredImageSRC.push(
1351 1359 {
1352 1360 "bodyRegionId": bodyRegionId, "SRC": src,
... ... @@ -1426,6 +1434,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1426 1434  
1427 1435 $scope.DrawImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) {
1428 1436  
  1437 + //console.log('DrawImage called for bodyRegionId= ' + bodyRegionId);
  1438 +
  1439 +
1429 1440 var imgCanvas = document.createElement('canvas');
1430 1441  
1431 1442 imgCanvas.height = h;
... ... @@ -1661,7 +1672,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1661 1672 img.src = src;
1662 1673  
1663 1674 function start() {
1664   - //debugger;
  1675 +
1665 1676 context.drawImage(img, 0, 0);
1666 1677  
1667 1678 if (isMaskImage == 'N') {
... ... @@ -1669,6 +1680,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1669 1680 //do nothing
1670 1681 }
1671 1682 else {
  1683 + $scope.counter++;
  1684 + console.log('$scope.ColoredImageSRC.length inside normal = ' + $scope.ColoredImageSRC.length + ', for $scope.layerNumber= '+ $scope.layerNumber);
  1685 +
  1686 +
1672 1687 $scope.ColoredImageSRC.push(
1673 1688 {
1674 1689 "bodyRegionId": bodyRegionId, "SRC": src,
... ... @@ -1766,11 +1781,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1766 1781  
1767 1782 $scope.HighlightBodyOnExtract = function () {
1768 1783  
1769   -
1770 1784 var multiTermList = [];
1771 1785 var CallBackBodyRegion = [];
1772 1786  
1773   - if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && ($rootScope.previousHighlightList.length > 0)) {
  1787 + if ($rootScope.isListManagerSelected) {
  1788 + multiTermList = $scope.AllTerms;
  1789 + }
  1790 +
  1791 + else if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && ($rootScope.previousHighlightList.length > 0)) {
1774 1792 angular.forEach($rootScope.previousHighlightList, function (value, key) {
1775 1793  
1776 1794 var ActualTermNo = $scope.getActualTermNumber(value);
... ... @@ -2328,10 +2346,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2328 2346 //layer change function
2329 2347 $scope.LayerChange = function () {
2330 2348  
2331   - //remove annotation
  2349 + console.log('$scope.ColoredImageSRC.length OUTSIDE= ' + $scope.ColoredImageSRC.length)
2332 2350  
2333   -
2334 2351  
  2352 + //if listanager is visisble then close it
  2353 + $rootScope.isListManagerSelected = false;
  2354 + $rootScope.CloseListManager();
  2355 +
  2356 +
2335 2357  
2336 2358 $scope.isLayerChange = true;
2337 2359 $rootScope.isLoading = true;
... ... @@ -2406,7 +2428,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2406 2428 // alert(' $.each(BodyRegionDictionary3. bodyRegionRight: ' + bodyRegionRight + ', bodyRegionBottom: ' + bodyRegionBottom)
2407 2429 if (TransparencyBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && TransparencyBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) {
2408 2430 //var transNumber = parseInt(document.getElementById("txtTransparencyChange").value);
2409   - // debugger;
  2431 +
2410 2432 $scope.layerNumber = parseInt(txtlayerNumber.value);
2411 2433  
2412 2434  
... ... @@ -2423,6 +2445,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2423 2445 if (parseInt($('#txtlayerNumber').val()) > (dataLength - 1)) {
2424 2446 $('#txtlayerNumber').val(dataLength - 1);
2425 2447 $scope.currentLayerNumber = parseInt(dataLength - 1);
  2448 +
2426 2449 $scope.layerNumber = parseInt(dataLength - 1);
2427 2450 }
2428 2451 else
... ... @@ -2437,6 +2460,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2437 2460 }
2438 2461  
2439 2462 //2.
  2463 + //existing data
  2464 + if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined) && $scope.ColoredImageSRC.length > 0) {
  2465 + $scope.ColoredImageSRC.length = 0;
  2466 + // $scope.ColoredImageSRC = undefined;
  2467 + $scope.ColoredImageSRC = [];
  2468 +
  2469 + }
  2470 +
  2471 +
2440 2472 $scope.CalculateImageCordinates($rootScope.viewOrientationId);
2441 2473  
2442 2474 //3.
... ... @@ -3270,6 +3302,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3270 3302 $scope.createTransparencyBox = function () {
3271 3303  
3272 3304  
  3305 + //if listanager is visisble then close it
  3306 + $rootScope.isListManagerSelected = false;
  3307 + $rootScope.CloseListManager();
  3308 +
  3309 +
3273 3310 $scope.isTransparencyActivated = true;
3274 3311 // alert('transparencyClicked' + $scope.isTransparencyActivated)
3275 3312 $('#btnTranparency').addClass('tButtonActive');
... ... @@ -3673,7 +3710,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3673 3710 //do nothing
3674 3711 }
3675 3712 else if (isLayerChanged) {
3676   - // debugger
  3713 +
3677 3714 $scope.layerNumber = parseInt($('#txtlayerNumber').val());
3678 3715  
3679 3716 }
... ... @@ -3681,6 +3718,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3681 3718 var currentLayer = parseInt($('#txtlayerNumber').val());
3682 3719  
3683 3720 var tranparencyLayer = currentLayer + 1;
  3721 +
3684 3722 $scope.layerNumber = tranparencyLayer;
3685 3723 }
3686 3724  
... ... @@ -4404,6 +4442,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4404 4442  
4405 4443 //$("canvas[name*='transparencyTempCanvas']").nextUntil($("canvas[name*='transparencyTempCanvas']"))
4406 4444 //.remove();
  4445 +
4407 4446 $scope.layerNumber = $scope.currentLayerNumber;
4408 4447 $scope.transNumber = 50;
4409 4448 $(".slider").slider({ value: 50 })
... ... @@ -4468,6 +4507,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4468 4507 $scope.OnIdentityClick = function () {
4469 4508  
4470 4509 // $('#btnIdentity').addClass('btn-primary');
  4510 + //if listanager is visisble then close it
  4511 + $rootScope.isListManagerSelected = false;
  4512 + $rootScope.CloseListManager();
  4513 +
4471 4514  
4472 4515 if ($scope.isTransparencyActivated == true) {
4473 4516  
... ... @@ -4487,6 +4530,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4487 4530  
4488 4531 $scope.enableZoom = function () {
4489 4532  
  4533 + //if listanager is visisble then close it
  4534 + $rootScope.isListManagerSelected = false;
  4535 + $rootScope.CloseListManager();
  4536 +
4490 4537 //remove speech bubble
4491 4538 $('#sppeachBubble').css('display', 'none');
4492 4539  
... ... @@ -4647,6 +4694,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4647 4694  
4648 4695 $scope.enableHighlight = function () {
4649 4696  
  4697 + //if listanager is visisble then close it
  4698 + // $rootScope.isListManagerSelected = false;
  4699 + $rootScope.CloseListManager();
  4700 +
4650 4701 console.log('enableHighlight is called')
4651 4702  
4652 4703 if ($rootScope.isHighLight == true) {
... ... @@ -4685,6 +4736,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4685 4736  
4686 4737 $scope.enableNormalMode = function () {
4687 4738  
  4739 + //if listanager is visisble then close it
  4740 + // $rootScope.isListManagerSelected = false;
  4741 + $rootScope.CloseListManager();
  4742 +
4688 4743 if ($rootScope.isNormalMode == true) {
4689 4744  
4690 4745 }
... ... @@ -4718,6 +4773,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4718 4773  
4719 4774 $scope.enableExtract = function () {
4720 4775  
  4776 + //if listanager is visisble then close it
  4777 + // $rootScope.isListManagerSelected = false;
  4778 + $rootScope.CloseListManager();
  4779 +
4721 4780 //1.
4722 4781 $rootScope.isLoading = true;
4723 4782 $('#spinner').css('visibility', 'visible');
... ... @@ -4758,6 +4817,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4758 4817  
4759 4818 $scope.enableShowHideStructureBox = function () {
4760 4819  
  4820 + //if listanager is visisble then close it
  4821 + $rootScope.isListManagerSelected = false;
  4822 + $rootScope.CloseListManager();
  4823 +
  4824 +
4761 4825 $(".com").toggle();
4762 4826 $('#dot').toggle();
4763 4827 $('#sppeachBubble').toggle()
... ... @@ -4966,6 +5030,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4966 5030  
4967 5031 $timeout(function () { $scope.HighlightBodyOnExtract() }, 50);
4968 5032 }
  5033 + else if ($rootScope.isListManagerSelected == true) {
  5034 + $timeout(function () { $scope.HighlightBodyOnExtract() }, 50);
  5035 +
  5036 + }
4969 5037 }
4970 5038 //else {
4971 5039 // // 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
5022 5090  
5023 5091 else {
5024 5092 // This code will execute when user will select normal Mode but this time isHighlight will be false
5025   -
5026 5093 angular.forEach($scope.ColoredImageSRC, function (value, key) {
5027 5094 var id;
5028 5095 if (value.haveMirror == 'true') {
... ... @@ -5117,7 +5184,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5117 5184  
5118 5185 $timeout(function () { $scope.HighlightBodyOnExtract() }, 50);
5119 5186  
5120   - // to do
  5187 + }
  5188 + else if ($rootScope.isListManagerSelected == true) {
  5189 + $timeout(function () { $scope.HighlightBodyOnExtract() }, 50);
5121 5190  
5122 5191 }
5123 5192 }
... ... @@ -5199,6 +5268,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5199 5268  
5200 5269 $scope.OnGenderChange = function (event) {
5201 5270  
  5271 + //if listanager is visisble then close it
  5272 + $rootScope.isListManagerSelected = false;
  5273 + $rootScope.CloseListManager();
  5274 +
  5275 +
5202 5276 $rootScope.isLoading = true;
5203 5277 $('#spinner').css('visibility', 'visible');
5204 5278  
... ... @@ -5343,6 +5417,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5343 5417  
5344 5418 $scope.OnViewChange = function (event) {
5345 5419  
  5420 +
  5421 + //if listanager is visisble then close it
  5422 + $rootScope.isListManagerSelected = false;
  5423 + $rootScope.CloseListManager();
  5424 +
5346 5425 $rootScope.isLoading = true;
5347 5426 $('#spinner').css('visibility', 'visible');
5348 5427  
... ... @@ -5352,6 +5431,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5352 5431 }
5353 5432  
5354 5433 $rootScope.isViewChange = true;
  5434 +
5355 5435 $scope.layerNumber = 0;
5356 5436 // debugger;
5357 5437 var selectedViewId = $scope.bodyViews[event.currentTarget.attributes[1].value];
... ... @@ -5490,6 +5570,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5490 5570 //Reload DA controller Body View after setting Change
5491 5571 $scope.$on('reloadDABodyViewEvent', function (event, data) {
5492 5572 //console.log('reloadDABodyViewEvent');
  5573 +
5493 5574 $scope.layerNumber = parseInt($('#txtlayerNumber').val());
5494 5575 $scope.ReloadBodyViewId = data.reloadDABodyViewId;
5495 5576 // $scope.layerNumber = 0;
... ... @@ -6398,7 +6479,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6398 6479  
6399 6480 $scope.HighlightBodysystem = function (event) {
6400 6481  
6401   - //NIKITA
  6482 +
  6483 +
  6484 + //if listanager is visisble then close it
  6485 + $rootScope.isListManagerSelected = false;
  6486 + $rootScope.CloseListManager();
  6487 +
  6488 +
6402 6489 $scope.isHighlightBodysystem = true;
6403 6490 $scope.systemMatchedTermList = new jinqJs()
6404 6491 .from($rootScope.BodySystemData.BodySystem.BodySystemTerm)
... ... @@ -6417,13 +6504,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6417 6504 //$rootScope.isLoading = true;
6418 6505 $('#spinner').css('visibility', 'visible');
6419 6506  
6420   - //NIKITA
6421   - // $scope.isHighlightBodysystem = true;
6422   -
6423   - //if (systemMatchedTermList != null || systemMatchedTermList != undefined) {
6424   -
6425   - // $timeout(function () { $scope.HighlightBodyByTermList(systemMatchedTermList) }, 100);
6426   - //}
  6507 +
6427 6508  
6428 6509  
6429 6510 var viewtarget_highlightbody = angular.element(event.currentTarget);
... ... @@ -6853,6 +6934,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6853 6934 layerNumber = parseInt(layerNumber) - 1;
6854 6935 }
6855 6936  
  6937 +
6856 6938 $scope.layerNumber = layerNumber;
6857 6939  
6858 6940 //4.get scroll position
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -379,7 +379,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
379 379  
380 380 $rootScope.CloseListManager = function () {
381 381 console.log('close')
382   - $rootScope.isListManagerSelected = false;
  382 + //$rootScope.isListManagerSelected = false;
383 383 $('#listManager').css('display', 'none');
384 384 $("#listManager").css("visibility", "hidden");
385 385 // $rootScope.isAnnotationWindowClose = true;
... ...
400-SOURCECODE/AIAHTML5.Web/index.html
1 1 <!DOCTYPE html>
2 2 <html lang="en" ng-cloak ng-app="AIA">
3 3 <head>
4   - <base href="/AIA/" />
  4 + <base href="/AIAHTML5/" />
5 5 <meta charset="utf-8">
6 6 <meta http-equiv="X-UA-Compatible" content="IE=edge">
7 7 <!--<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">-->
... ...