diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index 7e48a14..5913e15 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -59,8 +59,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.openModuleItemView = function (event) { - debugger; - //0. Get selected Image Id var moduleItemDataToBeSaved = event.target.id; @@ -144,6 +142,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //0.5 create canvas on the top of image so that I can draw a line over the canvas. var canvas = document.createElement('canvas'); + canvas.id = 'aaDetailViewCanvas'; canvas.height = parseInt(($scope.imageHeight)); canvas.width = parseInt($scope.imageWidth); canvas.style.left = '0px'; @@ -184,7 +183,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo .then( function (result) { $scope.aaPinData = result.data.Root.Item; - debugger; angular.forEach($scope.aaPinData, function (value, key) { $scope.context.beginPath(); @@ -259,7 +257,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var promise = ModuleService.loadModuleDataBasedOnModuleName($scope.moduleName) .then( function (result) { - alert("mukul"); // alert(JSON.stringify($scope.moduleLandingData)); $scope.moduleLandingData = result; $scope.selectedAAListViewData = new jinqJs() @@ -412,4 +409,58 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.FilterByImage(1, query); } + + $scope.showSelectedSystemPins = function (event) { + + //1.Remove all the pins first + var canvasHeight = document.getElementById('aaDetailViewCanvas').height; + var canvasWidth = document.getElementById('aaDetailViewCanvas').width; + + $scope.context.clearRect(0, 0, canvasWidth, canvasHeight) + + var selectedSystemName = event.currentTarget.title; + alert('inside showSelectedSystemPins selectedSystemName:' + selectedSystemName); + var promise = ModuleService.getPinDataForImage($rootScope.imageName) + + .then( + function (result) { + $scope.aaPinData = result.data.Root.Item; + var selectedSystemPinData = new jinqJs() + .from($scope.aaPinData) + .where("_BodySystemName == " + selectedSystemName) + .select(); + angular.forEach(selectedSystemPinData, function (value, key) { + + $scope.context.beginPath(); + $scope.context.moveTo(value._PinX, value._PinY); + $scope.context.lineTo(value._HeadX, value._HeadY); + $scope.context.stroke(); + + var headX = (parseInt(value._HeadX)) - 20; + var headY = (parseInt(value._HeadY)) - 15; + + var img = new Image(); + img.src = "~/../../../content/images/noraml-pin.png"; + img.onload = function () { + $scope.context.drawImage(img, headX, headY); + } + + }) + + console.log(JSON.stringify(result, null, 4)); + }, + function (error) { + // handle errors here + console.log(' error: ' + error.statusText); + } + ) + } }]); + +function showSelectedSystemPins(event) { + console.log('OnBodySystem chnaged is called outside '); + var scope = angular.element(document.getElementById("aaDetailPageDiv")).scope(); + scope.$apply(function () { + scope.showSelectedSystemPins(event); + }); +} \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js b/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js index e048785..afd072c 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js @@ -74,7 +74,7 @@ AIA.service('ModuleService', function($http, DataService) { getPinDataForImage: function (imageName) { - debugger; + var pindataFileNamePart1 = imageName.replace("aa_img_", ""); var pinFileNamePart2 = pindataFileNamePart1.replace(".jpg", ""); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html b/400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html index 147300a..3076ecf 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html @@ -11,7 +11,7 @@
-
+
@@ -155,3 +155,4 @@ }); +