diff --git a/350-UTILITIES/Parser/XMLtoJSON_utility/XMLtoJSON_utility.v12.suo b/350-UTILITIES/Parser/XMLtoJSON_utility/XMLtoJSON_utility.v12.suo index d58872a..2d5b389 100644 --- a/350-UTILITIES/Parser/XMLtoJSON_utility/XMLtoJSON_utility.v12.suo +++ b/350-UTILITIES/Parser/XMLtoJSON_utility/XMLtoJSON_utility.v12.suo diff --git a/400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj b/400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj index ce5703b..c090573 100644 --- a/400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj +++ b/400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj @@ -74,6 +74,8 @@ + + @@ -42902,6 +42904,7 @@ + @@ -42998,7 +43001,7 @@ - + diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 924d720..694a14d 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -32,7 +32,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.isHighLight = false; $rootScope.coloredImageCanvasList = []; $rootScope.coloredImageMRCanvasList = []; - $rootScope.ColoredCanvasData= []; + $rootScope.ColoredCanvasData = []; $rootScope.grayImageDataList = []; $rootScope.grayImageMRDataList = []; @@ -1175,13 +1175,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, x, y); if ($rootScope.isHighLight) { - - if ($scope.machedIcolorInBodyRegion.length > 0) - { - if ($scope.multiAnnotationIsON == false) - { - for (var i = 0; i < $scope.machedIcolorInBodyRegion.length; i++) - { + + if ($scope.machedIcolorInBodyRegion.length > 0) { + if ($scope.multiAnnotationIsON == false) { + for (var i = 0; i < $scope.machedIcolorInBodyRegion.length; i++) { var bodyRegionId = $scope.machedIcolorInBodyRegion[i]; var grayCanvasID = 'imageCanvas' + bodyRegionId; @@ -1310,7 +1307,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if ($('#sppeachBubble').length > 0) { $('#sppeachBubble').remove(); } - + $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top); @@ -1379,7 +1376,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //4. $scope.machedTermNoLocation = []; - console.log(' TermList.length= ' + TermList.length) + // console.log(' TermList.length= ' + TermList.length) @@ -1390,9 +1387,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var coloredImageData = dataForthisBR.coloredImageData; var worker = new Worker('term-number-wp.js'); - for (var i = 0; i < TermList.length; i++) { - console.log('Start time taken for term: ' + TermList[i]._TermNumber + 'in posting: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")); worker.postMessage({ 'termNumber': TermList[i]._TermNumber, 'maskCanvasData': $scope.MaskCanvasData, @@ -1403,24 +1398,27 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo }); - } - //var candata = e.value; - //var grayCanvasID = 'imageCanvas1' - //var grayCanvas = document.getElementById(grayCanvasID); - //var grayCanvasContext = grayCanvas.getContext("2d"); - //var imageData = grayCanvasContext.getImageData(0, 0 ,348,507); + var dataForthisBR = new jinqJs() + .from($scope.ColoredCanvasData) + .where('bodyRegionId == ' + 1) + .select(); + var coloredImageData = dataForthisBR.coloredImageData; + //for (var i = 0; i < TermList.length; i++) { + var worker = new Worker('term-number-wp.js'); - // worker.postMessage({ candata: coloredImageData }); + // console.log('Start time taken for term: ' + TermList[i]._TermNumber + 'in posting: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")); + worker.postMessage({ - worker.onmessage = function (e) { - var candata = e.data.value; - var grayCanvasID = 'imageCanvas1' - var grayCanvas = document.getElementById(grayCanvasID); - var grayCanvasContext = grayCanvas.getContext("2d"); + 'termList': TermList, + 'maskCanvasData': $scope.MaskCanvasData, + 'coloredImageCanvasList': $rootScope.coloredImageCanvasList, + 'coloredImageMRCanvasList': $rootScope.coloredImageMRCanvasList, + 'grayImageDataList': $rootScope.grayImageDataList, + 'grayImageMRDataList': $rootScope.grayImageMRDataList - // var tempCanvas = document.createElement('canvas'); + }); // tempCanvas.id = 'tempCanvas'; // $scope.tempCanvas = tempCanvas.id; // tempCanvas.height = 507; @@ -1429,15 +1427,34 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // tempCanvas.style.left = 200 + 'px'; // tempCanvas.style.top = 100 + 'px'; - //// tempCanvas.style.backgroundColor = "transparent"; + //} // tempCanvas.style.visibility = 'visible'; // document.getElementById('canvasDiv').appendChild(tempCanvas); - // var tempCanvas1 = document.getElementById('tempCanvas'); - // var Context = tempCanvas1.getContext("2d"); + worker.onmessage = function (e) { + console.log('callback: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")); - grayCanvasContext.putImageData(e.data.value, 0, 0); + // alert(e.data.value + '....name= ' + e.data.name) + var updatedData = e.data.value; + // debugger; + for (var i = 1; i <= updatedData.length; i++) { + var grayCanvasID = 'imageCanvas' +i; + var grayCanvas = document.getElementById(grayCanvasID); + var grayCanvasContext = grayCanvas.getContext("2d"); + + + + grayCanvasContext.putImageData(updatedData[i], 0, 0); + } + //var upadteddata = e.data.value; + //var bodyRegionId = e.data.bodyRegionId; + + + //$scope.highLightBodyBasedOnIcolor = function (RGBColor) { + + + // $rootScope.grayImageDataList[bodyRegionId - 1] = upadteddata; }; worker.onerror = function (e) { @@ -1452,6 +1469,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // $scope.previousSelectedTermList.length = 0; // var RGBColor = $scope.previousSelectedTermList[i]; + // $scope.machedTermNoLocation = []; + // for (var i = 0; i < TermList.length; i++) { // //2. Find Actul Term No Based on Icolor. // var ActualTermNo = $scope.getActualTermNumber(RGBColor); @@ -1460,27 +1479,45 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // var TermList = $scope.getTermNumberList(ActualTermNo); // if ($scope.previousSelectedTermList.length > 0) { - + // 'cmd': 'abc', + // 'value': termNumber + // }); + // } + // var worker = new Worker('term-number-wp.js'); + // var msg = e.data.msg1; + // }; + // worker.onerror = function (e) { + // alert('Error: Line ' + e.lineno + ' in ' + e.filename + ': ' + e.message); + // }; + // } + // else { // for (var i = 0; i < $scope.previousSelectedTermList.length; i++) { // $scope.machedTermNoLocation = []; // for (var i = 0; i < TermList.length; i++) { - + // var termNumber = parseInt(TermList[i]._TermNumber); + // var termNumber = parseInt(TermList[i]._TermNumber); // // //Match Term No List in each bodyRegion // // $scope.getLocationsForMatchedTermsInWholeBody(termNumber); + // 'value': termNumber + // }); // worker.postMessage({ // 'cmd': 'abc', // 'value': termNumber // }); // } - + // }; + // //Match Term No List in each bodyRegion + // //$scope.getLocationsForMatchedTermsInWholeBody(termNumber); // } + // } + // worker.onmessage = function (e) { // var msg = e.data.msg1; // }; @@ -1494,8 +1531,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // for (var i = 0; i < TermList.length; i++) { // var termNumber = parseInt(TermList[i]._TermNumber); - + // var worker = new Worker('term-number-wp.js'); + { + console.log('Start time taken in fillMatchedTerm: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")); // //start the worker // worker.postMessage({ @@ -1513,14 +1552,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // //$scope.getLocationsForMatchedTermsInWholeBody(termNumber); // } - + // } //} + // var coloredImg = $scope.ColoredImageSRC[x].SRC; - $scope.fillMatchedTerm = function (grayImageDataVar, BrId) - { + $scope.fillMatchedTerm = function (grayImageDataVar, BrId) { console.log('Start time taken in fillMatchedTerm: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")); //for (var x = 0; x < $scope.ColoredImageSRC.length; x++) { @@ -1532,7 +1571,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // var scaledWidth = $scope.ColoredImageSRC[x].Width; // var scaledHeight = $scope.ColoredImageSRC[x].Height; // //var maskImg = $scope.ColoredImageSRC[x].SRC; + // // maskCanvasID = 'imageCanvas' + bodyRegionId + '_MR_mci'; + // //} + // //else { + // // maskCanvasID = 'imageCanvas' + bodyRegionId + '_mci'; + // //var maskCanvasContext = maskCanvas.getContext("2d"); + // //var maskImgData = maskCanvasContext.getImageData(0, 0, scaledWidth, scaledHeight); // var coloredImg = $scope.ColoredImageSRC[x].SRC; @@ -1542,6 +1587,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // var scledX = $scope.ColoredImageSRC[x].x; // var scledY = $scope.ColoredImageSRC[x].y; + // } + // else { + // coloredImageDataVar = $rootScope.coloredImageCanvasList[parseInt(bodyRegionId - 1)]; + // } + // var grayImageDataVar; + // var grayCanvas; + // if ($scope.ColoredImageSRC[x].haveMirror == 'true') { // // 1. get mask canvas for this body region. // //var maskCanvasID; @@ -1555,8 +1607,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // //var maskCanvas = document.getElementById(maskCanvasID); // //var maskCanvasContext = maskCanvas.getContext("2d"); // //var maskImgData = maskCanvasContext.getImageData(0, 0, scaledWidth, scaledHeight); + // var grayImageData = grayCanvasContext.getImageData(0, 0, scaledWidth, scaledHeight); + // grayImageDataVar = grayImageData.data; + // } // // 2. get coloured canvas for this body region. + // var coloredImageDataMR // var coloredImageDataVar; @@ -1604,7 +1660,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // for (var z = 0; z < dataForthisBR.length; z++) // { // var location = parseInt(dataForthisBR[z].location); - + // var RED_coloredImage = coloredImageDataVar[location]; @@ -1622,29 +1678,27 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // grayImageDataVar[location + 3] = ALPHA_coloredImage; // } - var grayCanvasID = 'imageCanvas' + BrId; - var grayCanvas = document.getElementById(grayCanvasID); - var grayCanvasContext = grayCanvas.getContext("2d"); + var grayCanvasID = 'imageCanvas' + BrId; + var grayCanvas = document.getElementById(grayCanvasID); + var grayCanvasContext = grayCanvas.getContext("2d"); - debugger; - var garyDatalength = grayImageDataVar.length; - var pixelData = new Uint8ClampedArray(garyDatalength); - for (var i = 0; i < garyDatalength; i++) { - pixelData[i] = grayImageDataVar[i]; + var garyDatalength = grayImageDataVar.length; + var pixelData = new Uint8ClampedArray(garyDatalength); + for (var i = 0; i < garyDatalength; i++) { + pixelData[i] = grayImageDataVar[i]; } - var imgDta = grayCanvasContext.getImageData(0, 0, 348, 507); - imgDta.data.set - grayCanvasContext.putImageData(imgDta, 0, 0); - //} + var imgDta = grayCanvasContext.getImageData(0, 0, 348, 507); + imgDta.data.set + grayCanvasContext.putImageData(imgDta, 0, 0); + //} - // } + // } console.log('End time taken in fillMatchedTerm: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")); } $scope.GetRGBColor = function (maskCanvasContext, actulalX, actualY, x, y) { - debugger; var pixelData = maskCanvasContext.getImageData(Math.round(actulalX - x), Math.round(actualY - y), 1, 1); pixelData.data[0] = pixelData.data[0] - 9; @@ -1847,15 +1901,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.DisableProgressBar = function () { // alert('Disabled wait cursor is called'); - - + + if ($rootScope.isHighLight) { //alert('isHighlight: ' + $scope.isHighLight); $('#btnHighLight').removeClass('btn btn-black'); $('#btnHighLight').addClass('btn-primary'); - $scope.highLightBody() ; + $scope.highLightBody(); @@ -1943,7 +1997,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $(".com").css("display", "none"); $("#bord").css({ "width": "0px", "display": "none" }); - + $('' + '