diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index e111654..dd531b1 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -1,9 +1,7 @@ 'use strict'; AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$log", "$location", "$timeout", "DA", "Modules", "$routeParams", "DataService", "TermService", "AIAConstants", "ModuleService","$interval","$q", - function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Modules, $routeParam, DataService, TermService, AIAConstants, ModuleService,$interval,$q) { - - + function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Modules, $routeParam, DataService, TermService, AIAConstants, ModuleService,$interval,$q) { $scope.ScopeVariablesDeclare = function () { @@ -51,102 +49,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //common field data - // $scope.genderId = ""; - // $scope.selectedGenderBodyViewData; - // $scope.imagePath = ""; - // $rootScope.BodyRegionData; - // $rootScope.BodyRegionCordinatesData; - // $rootScope.isTransparencyActivated = false; - // $scope.isTransparencyBtnClicked = false; - // $rootScope.BodyLayerData; - //$rootScope.VocabTermData; - //$scope.ColoredImageSRC = []; - - - //for modesty image layers - // $scope.lowerlayerNumberForModesty; - // $scope.HigherlayerNumberForModesty; - // $scope.layerInfoForModesty; - - // $scope.VocabTermTxt; - - // $rootScope.TermNumberData = null; - // $rootScope.BodySystemData - // $scope.bodyViewId = 0; - // $rootScope.bgartData; - - //view specific constants - - // $scope.bagartDetails; - // $scope.transNumber = 100; - - - - // $scope.isTBDrawnOnBodyRegion; - - // $rootScope.isHighLight = false; - - // $rootScope.grayImageDataList = []; - // $rootScope.grayImageMRDataList = []; - - - // $rootScope.updatedGrayDataList = []; - // $rootScope.updatedGrayMRDataList = []; - //$scope.isEligibleForHighlight = false; - // $scope.doHighlightOrExtract = false; - // $scope.isClickedOnBodyForHighlight; - // $scope.isSearchClicked = false; - // $scope.isEligibleForHighlightBodyByTermList = false; - - // $scope.AnteriorView = "active"; - - // $rootScope.zoomInOut = 75; - //$scope.speechBubbleCounter = 0; - // $scope.j = 0; - - // $scope.speachBubbleArrayAnnotation = []; - //$rootScope.multiAnnotationIsON = false; - - - - - // $rootScope.MaskCanvasData = []; - - //extract - // $rootScope.isExtract = false; - //$rootScope.UIWrapperZIndex = 12000; - - //$rootScope.whiteImageDataList = []; - //$rootScope.whiteImageMRDataList = []; - - - // $rootScope.isViewChange = false; - // $rootScope.isGenderChnage = false; - - // to do it is setting but not using. need to check - // $rootScope.updatedWhiteImageDataList = []; - // $rootScope.updatedWhiteImageMRDataList = []; - - //normal mode - // $scope.SetwindowStoreData(windowviewid,'isNormalMode',true); - // $rootScope.isZoomed = false; - - //navigator man functionality - // $scope.navigatorImage; - // $rootScope.NavigatorData; - - // $scope.dragdivleft; - // $scope.dragdivtop = 0; - - // $rootScope.systemNumber = 0; - - - - //currentTitleFromJson shows the current BodyView Title - // $scope.currentTitleFromJson; - - - } $scope.initializeWindowData = function(windowviewid,isfirsttimecall,cbwindowid){ @@ -685,34 +587,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l }, 100); - // let promise = $timeout(); - // var timeint=null; - // angular.forEach($scope.DAModuleData, function (value, key) { - // $scope.settime=100000; - // promise= promise.then(function () { - // $scope.counter=0; - // $scope.openBodyView(value); - // timeint = $interval(function() { - // $scope.counter = $scope.counter + 1; - // if($scope.counter>=10) - // { - // $timeout.cancel(promise); - // $scope.stopInterval(); - - // } - // // if($rootScope.CBWindowLoadComplete==true) - // // { - // // $scope.stopInterval(promise); - // // $timeout.cancel(promise); - // // } - // }, 1000); - - // return $timeout($scope.settime); - - // }); - - // }); - $scope.stopInterval = function() { if (angular.isDefined(timeint)) { $interval.cancel(timeint); @@ -742,9 +616,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.initializeWindowData($rootScope.MULTI_VIEW_ID,false,$scope.daOpenInOtherModules.currentWindowId); } - - // alert($rootScope.MULTI_VIEW_ID); - + if ($rootScope.isCallFromOtherModule) { //$scope.daOpenInOtherModules = ModuleService.getModuleData("DISSECTIBLE_ANATOMY"); @@ -829,8 +701,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.jsPanelID = 'daImagePanel' + '_' + $rootScope.MULTI_VIEW_ID; $scope.viewID = 'daViewDA' + '_' + $rootScope.MULTI_VIEW_ID; $scope.SetwindowStoreData($rootScope.MULTI_VIEW_ID,'parentSlugName','da-view-list'); - // $rootScope.DaWindowData.find(v => v.multiwinid == $rootScope.MULTI_VIEW_ID).parentSlugName = 'da-view-list'; - + $scope.loadBodyView($rootScope.MULTI_VIEW_ID); } @@ -1112,8 +983,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var layerNum = $scope.GetwindowStoreData(windviewid,'totalLayers'); - // var daViewScope = angular.element(document.getElementsByClassName("daBodyView")).scope(); - //layerNum = parseInt(daViewScope.totalLayers) //- parseInt(scope.layerNumber); var sliderVal = layerNum - ui.value; $("#txtLayerNumberDA_" + windviewid).val(sliderVal); }, @@ -1166,7 +1035,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // } // , stop: function (event, ui) { - //alert('trans changed') var targetid = event.target.id; var windviewid = targetid.split('_')[1]; var scope = angular.element(document.getElementById("daViewDA_" + windviewid)).scope(); @@ -1523,15 +1391,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l searchWorker.onmessage = function (e) { console.log('callback searchWorker , time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")); - //$rootScope.TermNumberData = e.data.TermNumberData; + $scope.SetwindowStoreData(windowviewid,'TermNumberData',e.data.TermNumberData); console.log("$rootScope.TermNumberData = " + e.data.TermNumberData.TermData.Term.length); - // $rootScope.VocabTermData = e.data.VocabTermData,//same - // $scope.vocabTermTxt = e.data.vocabTermTxt, - // $scope.vocabLanguage = e.data.language, - //$scope.BodyViewIDs = e.data.bodyViewID; - + console.log("$scope.BodyViewIDs" + e.data.bodyViewID); $scope.vocabTempTermArray = []; if ($rootScope.isOpenResourceBtnClicked) { @@ -1654,10 +1518,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l bodyViewWorker.onmessage = function (e) { //console.log('callback in extr'); $scope.SetwindowStoreData(windowviewid,'BodyRegionData',e.data.bodyRegionData); - // $rootScope.BodyRegionData = e.data.bodyRegionData; + $scope.SetwindowStoreData(windowviewid,'bgartData',e.data.bodyArtData); - // $rootScope.bgartData = e.data.bodyArtData; - //$rootScope.BodyLayerData = e.data.bodyLayerData; + $scope.SetwindowStoreData(windowviewid,'BodyLayerData',e.data.bodyLayerData); var totalLayer = e.data.bodyLayerData.Layers.DataLayer.length-1; @@ -1856,14 +1719,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } - // var isFound = jQuery.inArray(serachTerm, fullTermlist) - // if (isFound == -1) { - // fullTermlist.push(serachTerm); - - // AllTerms.push({ '_TermNumber': serachTerm }) - - // } - } var totalayer=$scope.GetwindowStoreData(windowviewid,'totalLayers'); var nlayer=$scope.GetwindowStoreData(windowviewid,'layerNumber'); @@ -1926,14 +1781,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.terminateCurrentlyRunningWPs(); $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); - - // $scope.layerInfoForModesty = []; + $scope.SetwindowStoreData(windowviewid,'layerInfoForModesty',[]); - //$scope.modestyImageInfo = []; $scope.SetwindowStoreData(windowviewid,'modestyImageInfo',[]); - - // store colorimagecanvaslist + $scope.coloredImageCanvasList = []; $scope.SetwindowStoreData(windowviewid,'coloredImageCanvasList',[]); @@ -1941,7 +1793,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.coloredImageMRCanvasList = []; $scope.SetwindowStoreData(windowviewid,'coloredImageMRCanvasList',[]); - //$scope.MaskCanvasData = []; $scope.SetwindowStoreData(windowviewid,'MaskCanvasData',[]); //set height of canvas div and left tool bar as per window size @@ -1998,19 +1849,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.SetwindowStoreData(windowviewid,'updatedGrayDataList',[]); $scope.SetwindowStoreData(windowviewid,'updatedGrayMRDataList',[]); - - // if ($rootScope.updatedGrayDataList != null && $rootScope.updatedGrayDataList != undefined) { - // $rootScope.updatedGrayDataList = []; - // } - // if ($rootScope.updatedGrayMRDataList != null && $rootScope.updatedGrayMRDataList != undefined) { - // $rootScope.updatedGrayMRDataList = []; - // } - // if ($rootScope.grayImageDataList != null && $rootScope.grayImageDataList != undefined) { - // $rootScope.grayImageDataList = []; - // } - // if ($rootScope.grayImageMRDataList != null && $rootScope.grayImageMRDataList != undefined) { - // $rootScope.grayImageMRDataList = []; - // } + //history code if ($("#canvasDivDA_" + windowviewid).find("canvas[id='canvasPaint']").length == 0) { @@ -2501,6 +2340,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if ($scope.isLayerChange == true) { $scope.isLayerChange = false; } + $scope.SetwindowStoreData(windowviewid,'isListManagerSelected',false); + $('#typedTermName_' + windowviewid).val(''); if (evt.ctrlKey) { $scope.SetwindowStoreData(windowviewid,'multiAnnotationIsON',true); @@ -2992,7 +2833,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if ($scope.isLayerChange == true) { $scope.isLayerChange = false; } - + $scope.SetwindowStoreData(windowviewid,'isListManagerSelected',false); + $('#typedTermName_' + windowviewid).val(''); if (evt.ctrlKey) { $scope.SetwindowStoreData(windowviewid,'multiAnnotationIsON',true); @@ -3557,7 +3399,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } } - else { var coloredImageCanvasList=$scope.GetwindowStoreData(windowviewid,'coloredImageCanvasList'); @@ -3571,7 +3412,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } } - var worker = new Worker('extract-wp.js'); //push workers in array to further used the refernece to delete the workers @@ -3601,10 +3441,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var bodyRegionId = e.data.bodyRegionId; - var canvasId = (e.data.canvasId).replace('_mci', ''); - //for (var i = 1; i <= updatedData.length; i++) { var grayCanvasID = canvasId; var grayCanvas = document.getElementById(grayCanvasID); @@ -3682,6 +3520,19 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.aligneCanvasWithTerm(windowviewid); $scope.EnableUI(); + + if ($scope.runningWorkers != null || $scope.runningWorkers != undefined) { + + var workerCount = $scope.runningWorkers.length; + if (workerCount > 0) { + for (var i = workerCount - 1; i >= 0; i--) { + + var runningWorker = $scope.runningWorkers[i].workerName; + runningWorker.terminate(); + $scope.runningWorkers.splice(i, 1); + } + } + } } }; @@ -4434,11 +4285,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l .where('_TermNumber == ' + termNumber) .select(); - //$scope.matchedTermNoData = new jinqJs() - // .from($rootScope.TermNumberData.TermData.Term) - // .where('_TermNumber == ' + termNumber) - // .select(); - if ($scope.matchedTermNoData != null || $scope.matchedTermNoData != undefined) { //1. var actualTermNo = 0; @@ -4467,7 +4313,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l .then( function (result) { $scope.SetwindowStoreData(windowviewid,'TermNumberData',result); - //$rootScope.TermNumberData = result; + $scope.GetAnnotationText(termNumber,windowviewid); }) } @@ -4848,11 +4694,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if (isClickedOnSamePoint == 0) { console.log('not clicked on same point') $scope.createSpeechBubbleBasedOnAnnotationLength(pointClicked, x, y, id, tipx, tipy,windowviewid,speechBubbleCounter); - - - // $scope.speechList=[]; + $scope.speechbubbleList.push({ xaxis: x, yaxis: y, ids: id }); - // $scope.SetwindowStoreData(windowviewid,'speechbubbleList',$scope.speechList); } $('.appendDragg').draggable({ drag: function (evt) { @@ -4863,7 +4706,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var canvasDiv = document.getElementById('canvasDivDA_' + windid); var verticalScrollPosition = canvasDiv.scrollTop; var horizontlScrollPosition = canvasDiv.scrollLeft; - // var speechbubbleList=$scope.GetwindowStoreData(windid,'speechbubbleList'); if ( $scope.speechbubbleList != null || $scope.speechbubbleList != undefined) { for (var m = 0; m <= $scope.speechbubbleList.length - 1; m++) { if ( $scope.speechbubbleList[m].ids == sub_id1) { @@ -4932,7 +4774,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var pointClicked_annotation = parseInt(x) + parseInt(y); var Exists_annotation = $('#canvasDivDA_' + windowviewid).find("div[id=" + pointClicked_annotation + "]").length; $scope.createSpeechBubbleBasedOnTransparencyWithCtrl(pointClicked_annotation, Exists_annotation, x, y, sub_id_annotation,windowviewid,TPspeechBubbleCounter); - // $scope.speechList1=[]; $scope.speechbubbleList.push({ xaxis: x, yaxis: y, ids: sub_id_annotation }); $scope.SetwindowStoreData(windowviewid,'speachBubbleArrayAnnotation',$scope.speechList1); $('.appendDragg_annotation').draggable({ @@ -4944,7 +4785,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var canvasDiv = document.getElementById('canvasDivDA_' + windid); var verticalScrollPosition = canvasDiv.scrollTop; var horizontlScrollPosition = canvasDiv.scrollLeft; - //var speachBubbleArrayAnnotation=$scope.GetwindowStoreData(windid,'speachBubbleArrayAnnotation'); if ( $scope.speechbubbleList != null || $scope.speechbubbleList != undefined) { for (var m = 0; m <= $scope.speechbubbleList.length - 1; m++) { if ( $scope.speechbubbleList[m].ids == sub_id1_anno) { @@ -5687,7 +5527,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.TransparencyBoxEndY = TransparencyBoxEndY; if ($scope.TransparencyBoxStartX == $scope.TransparencyEndX && $scope.TransparencyBoxStartY == $scope.TransparencyBoxEndY) { - // $('#transparencyScale').css('visibility', 'hidden'); + } else { if (previewRectangleWidth == 0 && previewRectangleHeight == 0) { @@ -5698,8 +5538,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.DisableUI(); $scope.SetwindowStoreData(windowviewid,'layerNumberBeforeTBDraw',parseInt($('#txtLayerNumberDA_' + windowviewid).val())); - // $scope.layerNumberBeforeTBDraw = parseInt($('#txtLayerNumberDA_' + windowviewid).val()); - + //draw temp box to store the canvas data with original transparecy if (document.getElementById('tempCanvas_' + windowviewid) != null) { $('#tempCanvas_' + windowviewid).remove(); @@ -5719,10 +5558,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } $scope.SetwindowStoreData(windowviewid,'isTransparencyActivated',true); - // $rootScope.isTransparencyActivated = true; $scope.SetwindowStoreData(windowviewid,'isTransparencyBtnClicked',false); - // var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData; var BodyRegionDictionary = $scope.GetwindowStoreData(windowviewid,'BodyRegionCordinatesData'); $scope.IncludedBodyRegions = []; @@ -6220,7 +6057,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l tempCtx.drawImage(tempImg, 0, 0); if ($scope.GetwindowStoreData(windowviewid,'isHighLight') == true) { - // var tempCanvasID = 'transparencyTempCanvas_MR_' + bodyRegionId; $scope.highlightTempTransparencyCanvas(tempCanvasID, XforCopyImage, YforCopyImage, WidthforCopyImage, HeightforCopyImage, XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage, Height, Width, bodyRegionId, windowviewid); } @@ -6893,7 +6729,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $rootScope.setSelectedBodyRegionData = function (windowviewid) { - // var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData; var BodyRegionDictionary = $scope.GetwindowStoreData(windowviewid,'BodyRegionCordinatesData'); var bodyVid= $scope.GetwindowStoreData(windowviewid,'voId') $.each(BodyRegionDictionary, function (index, value) { @@ -7018,7 +6853,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l document.getElementById('canvasDivDA_' + windowviewid).appendChild(tempCanvas); - //var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData; var BodyRegionDictionary = $scope.GetwindowStoreData(windowviewid,'BodyRegionCordinatesData'); $scope.IncludedBodyRegions = []; @@ -7406,9 +7240,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } - // if ($('#sppeachBubble_'+windowviewid).length > 0) - // $('#sppeachBubble_'+windowviewid).remove(); - var tCanvasTopPos = $(".ui-wrapper").css("top"); var tCanvasTopPosAftrSplit = tCanvasTopPos.split("p"); var tCanvasHeight = $(".ui-wrapper").css("height"); @@ -7451,10 +7282,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // console.log('at the time' + pixelData.data[0]) var annotations = $scope.getAnnotationForTransparencyBox(pixelData, pixelDataTrans, $scope,windowviewid); - // if ($('#sppeachBubble_'+windowviewid).length > 0) - // $('#sppeachBubble_'+windowviewid).remove(); - - + $scope.annotationTextArrayT1 = []; $scope.annotationTextArrayT2 = []; for (var i = 0; i <= $rootScope.annotationTextForTrans1.length - 1; i++) { @@ -7654,8 +7482,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $("#OnIdentify").addClass('annotationtoolbartab'); $("#DrawMode").removeClass('annotationtoolbartab'); } - - // $rootScope.switchCanvas(); //To enable extract button $scope.SetwindowStoreData(windowviewid,'isTransparencyActivated',false); // $rootScope.isTransparencyActivated = false; @@ -8244,7 +8070,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } //// #7972 Mozilla Firefox> Incorrect navigation - // $("#" + $scope.canvasDivID).scroll(function (event) { + $("#canvasDiv").scroll(function (event) { var windowviewid = (event.currentTarget.id).split("_")[1]; @@ -9149,11 +8975,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $rootScope.isLoading = false; $('#spinner').css('visibility', 'hidden'); - //To fix issue of gray maintained in after closing jspanel after listmanager selection - // $rootScope.isListManagerSelected = false; - // $rootScope.isHighLight = false; - //$rootScope.isNormalMode = false; - // $rootScope.isHighlightBodyByBodySystem = false; $rootScope.CloseListManager(); }) @@ -9568,41 +9389,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } - - // //body highlight options functinality - // $scope.LoadBodySystemData = function (event) { - // var windowviewid = (event.currentTarget.id).split("_")[1]; - // event.stopPropagation(); - // $("#structureDropdownDA_" + windowviewid).toggle(); - // $("#genderChangeIdDA_" + windowviewid).css("display", "none"); - // $("#viewChangeIDDA_" + windowviewid).css("display", "none"); - // var $ua = navigator.userAgent; - // if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { - // $(".custom-tooltip").toggle(); - // } - // // var currentBodyViewId = $scope.GetwindowStoreData(windowviewid,'voId') ; - // // var systemListHtml = '
'; - // // $('#bodySystem').append(systemListHtml); - - - // } - $scope.GetBodySystemData = function (currentBodyViewId,windowviewid) { var bodySystemDataPath = '~/../content/data/json/da/body-views/' + currentBodyViewId + '/da_dat_body_system_term_' + currentBodyViewId + '.json'; DataService.getJson(bodySystemDataPath) .then( function (result) { $scope.SetwindowStoreData(windowviewid,'BodySystemData',result); - // $rootScope.BodySystemData = result; - + }, function (error) { console.log(error.statusText) @@ -9656,11 +9449,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.SetwindowStoreData(windowviewid,'isHighlightBodyByBodySystem',true); // no $scope.systemMatchedTermList using ,getting from service // birendra - // var BodySystemData=$scope.GetwindowStoreData(windowviewid,'BodySystemData'); - // $scope.systemMatchedTermList = new jinqJs() - // .from(BodySystemData.BodySystem.BodySystemTerm) - // .where('_SystemNumber == ' + event.currentTarget.id) - // .select(); + // var BodySystemData=$scope.GetwindowStoreData(windowviewid,'BodySystemData'); + // $scope.systemMatchedTermList = new jinqJs() + // .from(BodySystemData.BodySystem.BodySystemTerm) + // .where('_SystemNumber == ' + event.currentTarget.id) + // .select(); if ($scope.GetwindowStoreData(windowviewid,'isHighLight') == false) { //color the body gray @@ -9979,7 +9772,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //this check is for log only because we are writing length so need to check if its not null or undefined if (vocabTermDataArray[primaryLexiconIndx].vocabTermTxt != null || vocabTermDataArray[primaryLexiconIndx].vocabTermTxt != undefined) console.log('$scope.VocabTermTxt.length= ' + vocabTermDataArray[primaryLexiconIndx].vocabTermTxt.length) - // $scope.SetwindowStoreData(windowviewid,'IsSearchVisible',true); + $scope.IsSearchVisible = true; $timeout(function () { var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId'); @@ -10669,7 +10462,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $("#bodySystems").find("option[id=" + bodysystemId + "]").css({ "background-color": "#3399FF", "color": "#ffffff" }); $('#termList').empty(); - // $('#termList').innerHTML = ''; if (bodysystemId == 0) { $scope.loadListManger(windowviewid); @@ -10680,7 +10472,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l .then( function (result) { $scope.SetwindowStoreData(windowviewid,'BodySystemData',result); - // $rootScope.BodySystemData = result; var systemMatchedTermList = new jinqJs() .from(result.BodySystem.BodySystemTerm) .where('_SystemNumber == ' + bodysystemId) @@ -10761,8 +10552,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var termsTotal = '' + VocabTermTxtfilter.length + ' Structures'; $("#totalTerms").empty(); - //$('#totalTerms').innerHTML = ''; - + $('#totalTerms').append(termsTotal); $rootScope.isLoading = false; $('#spinner').css('visibility', 'hidden'); @@ -10870,7 +10660,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.resetSearchListView = function () { - // $scope.ShowSearch(); $scope.showFilteredTerms() } diff --git a/400-SOURCECODE/AIAHTML5.Web/extract-wp.js b/400-SOURCECODE/AIAHTML5.Web/extract-wp.js index 528b0fd..ec8103e 100644 --- a/400-SOURCECODE/AIAHTML5.Web/extract-wp.js +++ b/400-SOURCECODE/AIAHTML5.Web/extract-wp.js @@ -1,109 +1,92 @@ -var UpdatedGrayImageDataList = []; -var doneBRID = []; -var abc = 'hello'; -previousGrayImageDataList = []; -getLocationForMatchedTermsInWholeBody = function (termList, maskCanvasData, coloredImageData, grayImageData, bodyRegionId, canvasId) { - console.log('for bodyRegionId: ' + bodyRegionId + ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")) - console.log('imagredata= ' + grayImageData) - - var matchedRGBLocationInBodyRegion = []; - var matched; - - console.log(grayImageData) - var n = maskCanvasData.data.length; - var maskData = maskCanvasData.data; - for (var z = 0; z < termList.length; z++) { - - if (previousGrayImageDataList[parseInt(bodyRegionId - 1)] != null) { - grayImageData = previousGrayImageDataList[parseInt(bodyRegionId - 1)]; - - } - - if (grayImageData != null) { - var grayImageDataVar = grayImageData.data; - var coloredImageDataVar = coloredImageData.data; - - for (var i = 0; i < n; i += 4) { - - - var RED = maskData[i] - 9; - var GREEN = maskData[i + 1] - 9; - var BLUE = maskData[i + 2] - 9; - - var Red; - var Green; - var Blue; - var zero = "0"; - - if ((RED).toString().length != 2) { - Red = zero.concat((RED).toString()) - } - else { - Red = (RED).toString() - } - if ((GREEN).toString().length != 2) { - Green = zero.concat((GREEN).toString()) - } - else { - Green = (GREEN).toString() - - } - if ((BLUE).toString().length != 2) { - Blue = zero.concat((BLUE).toString()) - } - else { - Blue = (BLUE).toString() - - } - - var Icolor = (Red + Green + Blue); - // alert('Icolor: ' + Icolor) - - if (parseInt(termList[z]._TermNumber) == parseInt(Icolor)) { - - // debugger; - - - // matchedRGBLocationInBodyRegion.push({ "BRId": bodyRegionId, "location": i }); - - - // matched = true; - - var RED_coloredImage = coloredImageDataVar[i]; - - grayImageDataVar[i] = RED_coloredImage; - - - var GREEN_coloredImage = coloredImageDataVar[i + 1]; - grayImageDataVar[i + 1] = GREEN_coloredImage; - - var BLUE_coloredImage = coloredImageDataVar[i + 2]; - grayImageDataVar[i + 2] = BLUE_coloredImage; - - - var ALPHA_coloredImage = coloredImageDataVar[i + 3]; - grayImageDataVar[i + 3] = ALPHA_coloredImage; - - } - - - } - // debugger; - previousGrayImageDataList[parseInt(bodyRegionId - 1)] = grayImageData; - - } - } - - self.postMessage({ - 'bodyRegionId': bodyRegionId, - 'value': grayImageData, - 'canvasId': canvasId - - }); -} - -self.onmessage = function (e) { - getLocationForMatchedTermsInWholeBody(e.data.termList, e.data.maskCanvasData, e.data.coloredImageData, - e.data.grayImageData, e.data.bodyRegionId, e.data.canvasId); - -} +previousGrayImageDataList = []; +getLocationForMatchedTermsInWholeBody = function (termList, maskCanvasData, coloredImageData, grayImageData, bodyRegionId, canvasId) { + console.log('for bodyRegionId: ' + bodyRegionId + ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")) + + var masklen = maskCanvasData.data.length; + var maskData = maskCanvasData.data; + var nextStep=4; + var zero = "0"; + for (var z = 0; z < termList.length; z++) { + var termnumber=termList[z]._TermNumber; + if(termnumber.length<6) + { + continue; + } + if (previousGrayImageDataList[parseInt(bodyRegionId - 1)] != null) { + grayImageData = previousGrayImageDataList[parseInt(bodyRegionId - 1)]; + + } + + if (grayImageData != null) { + var grayImageDataVar = grayImageData.data; + var coloredImageDataVar = coloredImageData.data; + + for (var i = 0; i < masklen; i += nextStep) { + + var RED = maskData[i] - 9; + if (RED <0) { continue; } + + var GREEN = maskData[i + 1] - 9; + if (GREEN <0) { continue; } + + var BLUE = maskData[i + 2] - 9; + if (BLUE <0) { continue; } + + BLUE=BLUE.toString(); + if (BLUE.length !=2) + { + BLUE = zero.concat(BLUE); + } + if(termnumber.startsWith(BLUE,4)) { + GREEN=GREEN.toString(); + if (GREEN.length !=2) + { + GREEN = zero.concat(GREEN); + } + + if(termnumber.startsWith(GREEN,2)) { + RED=RED.toString(); + if (RED.length !=2) + { + RED = zero.concat(RED); + } + if(termnumber.startsWith(RED,0)) { + + var Icolor = (RED + GREEN + BLUE); + + if (termnumber == Icolor) { + + for (var index = i; index < i+nextStep; index += 1) { + + grayImageDataVar[index]=coloredImageDataVar[index]; + + } + } + } + else{continue;} + + } + else{continue;} + + } + else{continue;} + } + // debugger; + previousGrayImageDataList[parseInt(bodyRegionId - 1)] = grayImageData; + + } + } + + self.postMessage({ + 'bodyRegionId': bodyRegionId, + 'value': grayImageData, + 'canvasId': canvasId + + }); +} + +self.onmessage = function (e) { + getLocationForMatchedTermsInWholeBody(e.data.termList, e.data.maskCanvasData, e.data.coloredImageData, + e.data.grayImageData, e.data.bodyRegionId, e.data.canvasId); + +} diff --git a/400-SOURCECODE/AIAHTML5.Web/term-number-wp.js b/400-SOURCECODE/AIAHTML5.Web/term-number-wp.js index 2abbc0e..e17ef50 100644 --- a/400-SOURCECODE/AIAHTML5.Web/term-number-wp.js +++ b/400-SOURCECODE/AIAHTML5.Web/term-number-wp.js @@ -5,7 +5,7 @@ getLocationForMatchedTermsInWholeBody = function (termList, maskCanvasData, colo var masklen = maskCanvasData.data.length; var maskData = maskCanvasData.data; - var nextStep=4; + var nextStep=8; var zero = "0"; for (var z = 0; z < termList.length; z++) { @@ -31,14 +31,13 @@ getLocationForMatchedTermsInWholeBody = function (termList, maskCanvasData, colo var BLUE = maskData[i + 2] - 9; if (BLUE <0) { continue; } - - RED=RED.toString(); - if (RED.length !=2) + + BLUE=BLUE.toString(); + if (BLUE.length !=2) { - RED = zero.concat(RED); + BLUE = zero.concat(BLUE); } - - if(termnumber.startsWith(RED,0)) { + if(termnumber.startsWith(BLUE,4)) { GREEN=GREEN.toString(); if (GREEN.length !=2) { @@ -46,20 +45,20 @@ getLocationForMatchedTermsInWholeBody = function (termList, maskCanvasData, colo } if(termnumber.startsWith(GREEN,2)) { - BLUE=BLUE.toString(); - if (BLUE.length !=2) - { - BLUE = zero.concat(BLUE); - } - if(termnumber.startsWith(BLUE,4)) { + RED=RED.toString(); + if (RED.length !=2) + { + RED = zero.concat(RED); + } + if(termnumber.startsWith(RED,0)) { var Icolor = (RED + GREEN + BLUE); if (termnumber == Icolor) { - for (var range = i; range < i+nextStep; range += 1) { + for (var index = i; index < i+nextStep; index += 1) { - grayImageDataVar[range]=coloredImageDataVar[range]; + grayImageDataVar[index]=coloredImageDataVar[index]; } }