Commit 628c74c5488d93b650692683373ba54a9946eefa

Authored by Nikita Kulshreshtha
1 parent c9702e56

added select system functionality. need to chekc if all pins are visible when we…

… select the system and also need to show the annotations on first 2 pins in pindata of selected system with green pin head.
400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
@@ -59,8 +59,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -59,8 +59,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
59 59
60 $scope.openModuleItemView = function (event) { 60 $scope.openModuleItemView = function (event) {
61 61
62 - debugger;  
63 -  
64 //0. Get selected Image Id 62 //0. Get selected Image Id
65 var moduleItemDataToBeSaved = event.target.id; 63 var moduleItemDataToBeSaved = event.target.id;
66 64
@@ -144,6 +142,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -144,6 +142,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
144 142
145 //0.5 create canvas on the top of image so that I can draw a line over the canvas. 143 //0.5 create canvas on the top of image so that I can draw a line over the canvas.
146 var canvas = document.createElement('canvas'); 144 var canvas = document.createElement('canvas');
  145 + canvas.id = 'aaDetailViewCanvas';
147 canvas.height = parseInt(($scope.imageHeight)); 146 canvas.height = parseInt(($scope.imageHeight));
148 canvas.width = parseInt($scope.imageWidth); 147 canvas.width = parseInt($scope.imageWidth);
149 canvas.style.left = '0px'; 148 canvas.style.left = '0px';
@@ -184,7 +183,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -184,7 +183,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
184 .then( 183 .then(
185 function (result) { 184 function (result) {
186 $scope.aaPinData = result.data.Root.Item; 185 $scope.aaPinData = result.data.Root.Item;
187 - debugger;  
188 angular.forEach($scope.aaPinData, function (value, key) { 186 angular.forEach($scope.aaPinData, function (value, key) {
189 187
190 $scope.context.beginPath(); 188 $scope.context.beginPath();
@@ -259,7 +257,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -259,7 +257,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
259 var promise = ModuleService.loadModuleDataBasedOnModuleName($scope.moduleName) 257 var promise = ModuleService.loadModuleDataBasedOnModuleName($scope.moduleName)
260 .then( 258 .then(
261 function (result) { 259 function (result) {
262 - alert("mukul");  
263 // alert(JSON.stringify($scope.moduleLandingData)); 260 // alert(JSON.stringify($scope.moduleLandingData));
264 $scope.moduleLandingData = result; 261 $scope.moduleLandingData = result;
265 $scope.selectedAAListViewData = new jinqJs() 262 $scope.selectedAAListViewData = new jinqJs()
@@ -412,4 +409,58 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -412,4 +409,58 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
412 $scope.FilterByImage(1, query); 409 $scope.FilterByImage(1, query);
413 410
414 } 411 }
  412 +
  413 + $scope.showSelectedSystemPins = function (event) {
  414 +
  415 + //1.Remove all the pins first
  416 + var canvasHeight = document.getElementById('aaDetailViewCanvas').height;
  417 + var canvasWidth = document.getElementById('aaDetailViewCanvas').width;
  418 +
  419 + $scope.context.clearRect(0, 0, canvasWidth, canvasHeight)
  420 +
  421 + var selectedSystemName = event.currentTarget.title;
  422 + alert('inside showSelectedSystemPins selectedSystemName:' + selectedSystemName);
  423 + var promise = ModuleService.getPinDataForImage($rootScope.imageName)
  424 +
  425 + .then(
  426 + function (result) {
  427 + $scope.aaPinData = result.data.Root.Item;
  428 + var selectedSystemPinData = new jinqJs()
  429 + .from($scope.aaPinData)
  430 + .where("_BodySystemName == " + selectedSystemName)
  431 + .select();
  432 + angular.forEach(selectedSystemPinData, function (value, key) {
  433 +
  434 + $scope.context.beginPath();
  435 + $scope.context.moveTo(value._PinX, value._PinY);
  436 + $scope.context.lineTo(value._HeadX, value._HeadY);
  437 + $scope.context.stroke();
  438 +
  439 + var headX = (parseInt(value._HeadX)) - 20;
  440 + var headY = (parseInt(value._HeadY)) - 15;
  441 +
  442 + var img = new Image();
  443 + img.src = "~/../../../content/images/noraml-pin.png";
  444 + img.onload = function () {
  445 + $scope.context.drawImage(img, headX, headY);
  446 + }
  447 +
  448 + })
  449 +
  450 + console.log(JSON.stringify(result, null, 4));
  451 + },
  452 + function (error) {
  453 + // handle errors here
  454 + console.log(' error: ' + error.statusText);
  455 + }
  456 + )
  457 + }
415 }]); 458 }]);
  459 +
  460 +function showSelectedSystemPins(event) {
  461 + console.log('OnBodySystem chnaged is called outside ');
  462 + var scope = angular.element(document.getElementById("aaDetailPageDiv")).scope();
  463 + scope.$apply(function () {
  464 + scope.showSelectedSystemPins(event);
  465 + });
  466 +}
416 \ No newline at end of file 467 \ No newline at end of file
400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js
@@ -74,7 +74,7 @@ AIA.service('ModuleService', function($http, DataService) { @@ -74,7 +74,7 @@ AIA.service('ModuleService', function($http, DataService) {
74 74
75 getPinDataForImage: function (imageName) 75 getPinDataForImage: function (imageName)
76 { 76 {
77 - debugger; 77 +
78 var pindataFileNamePart1 = imageName.replace("aa_img_", ""); 78 var pindataFileNamePart1 = imageName.replace("aa_img_", "");
79 var pinFileNamePart2 = pindataFileNamePart1.replace(".jpg", ""); 79 var pinFileNamePart2 = pindataFileNamePart1.replace(".jpg", "");
80 80
400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 <div class="tools pull-left" style="top:44px;"> 11 <div class="tools pull-left" style="top:44px;">
12 <div class="toggle-icon toggleBar toggleHeadingButton" data-toggle="tooltip" data-placement="top" title="Show/Hide Sidebar"></div> 12 <div class="toggle-icon toggleBar toggleHeadingButton" data-toggle="tooltip" data-placement="top" title="Show/Hide Sidebar"></div>
13 <div class=""> 13 <div class="">
14 - <div class="col-sm-6" title="Hide Pins"><button class="btn btn-black btn-sm" > <img src="../../../content/images/aa/LeftMenu/hide-pin.png" alt="" title=""></button> </div> 14 + <div class="col-sm-6" title="Hide Pins"><button class="btn btn-black btn-sm" ng-click="alert('hi pin')"> <img src="../../../content/images/aa/LeftMenu/hide-pin.png" alt="" title=""></button> </div>
15 <div class="col-sm-6" title="Show Selected Pins"><button class="btn btn-black btn-sm pull-right"><img src="../../../content/images/aa/LeftMenu/draw-pin.png" alt="" title=""></button></div> 15 <div class="col-sm-6" title="Show Selected Pins"><button class="btn btn-black btn-sm pull-right"><img src="../../../content/images/aa/LeftMenu/draw-pin.png" alt="" title=""></button></div>
16 <div class="col-sm-6" title="Show All Pins in System(s)"><button class="btn btn-primary btn-sm marginTop5"><img src="../../../content/images/aa/LeftMenu/all-pin.png" alt="" title=""></button></div> 16 <div class="col-sm-6" title="Show All Pins in System(s)"><button class="btn btn-primary btn-sm marginTop5"><img src="../../../content/images/aa/LeftMenu/all-pin.png" alt="" title=""></button></div>
17 <div class="col-sm-6" title="Select System"> 17 <div class="col-sm-6" title="Select System">
@@ -19,18 +19,18 @@ @@ -19,18 +19,18 @@
19 <ul class="dropdown-menu" aria-labelledby="dropdownMenu221"> 19 <ul class="dropdown-menu" aria-labelledby="dropdownMenu221">
20 <li><a href="#" title="Current Structure">All</a></li> 20 <li><a href="#" title="Current Structure">All</a></li>
21 <li role="separator" class="divider"></li> 21 <li role="separator" class="divider"></li>
22 - <li><a href="#" title="Cardiovascular">Cardiovascular</a></li>  
23 - <li><a href="#" title="Digestive">Digestive</a></li>  
24 - <li class="disabled"><a href="#" title="Endocrine">Endocrine</a></li>  
25 - <li class="disabled"><a href="#" title="Immune">Immune</a></li>  
26 - <li class="disabled"><a href="#" title="Integumentary">Integumentary</a></li>  
27 - <li class="disabled"><a href="#" title="Lymphatic">Lymphatic</a></li>  
28 - <li><a href="#" title="Muscular">Muscular</a></li>  
29 - <li class="disabled"><a href="#" title="Nervous">Nervous</a></li>  
30 - <li class="disabled"><a href="#" title="Reproductive">Reproductive</a></li>  
31 - <li class="disabled"><a href="#" title="Respiratory">Respiratory</a></li>  
32 - <li><a href="#" title="Skeletal">Skeletal</a></li>  
33 - <li class="disabled"><a href="#" title="Urinary">Urinary</a></li> 22 + <li><a id="1" href="#" title="Cardiovascular" onclick="showSelectedSystemPins(event)">Cardiovascular</a></li>
  23 + <li><a id="2" href="#" title="Digestive" onclick="showSelectedSystemPins(event)">Digestive</a></li>
  24 + <li class="disabled"><a id="3" href="#" title="Endocrine" onclick="showSelectedSystemPins(event)">Endocrine</a></li>
  25 + <li ><a id="4" href="#" title="Immune" onclick="showSelectedSystemPins(event)">Immune</a></li>
  26 + <li class="disabled"><a id="5" href="#" title="Integumentary" onclick="showSelectedSystemPins(event)">Integumentary</a></li>
  27 + <li class="disabled"><a id="6" href="#" title="Lymphatic" onclick="showSelectedSystemPins(event)">Lymphatic</a></li>
  28 + <li><a id="7" href="#" title="Muscular" onclick="showSelectedSystemPins(event)">Muscular</a></li>
  29 + <li class="disabled"><a id="8" href="#" title="Nervous" onclick="showSelectedSystemPins(event)">Nervous</a></li>
  30 + <li class="disabled"><a id="9" href="#" title="Reproductive" onclick="showSelectedSystemPins(event)">Reproductive</a></li>
  31 + <li class="disabled"><a id="10" href="#" title="Respiratory" onclick="showSelectedSystemPins(event)">Respiratory</a></li>
  32 + <li><a id="11" href="#" title="Skeletal" onclick="showSelectedSystemPins(event)">Skeletal</a></li>
  33 + <li class="disabled"><a id="12" href="#" title="Urinary" onclick="showSelectedSystemPins(event)">Urinary</a></li>
34 </ul> 34 </ul>
35 35
36 </div> 36 </div>
@@ -155,3 +155,4 @@ @@ -155,3 +155,4 @@
155 }); 155 });
156 </script> 156 </script>
157 157
  158 +<script src="app/controllers/TileViewListController.js"></script>