Commit 09472e8d31f07b69281bcf98338411e6e29db709

Authored by Amrita Vishnoi
1 parent 598c0f4c

POC is going on for Pin

400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
@@ -56,9 +56,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -56,9 +56,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
56 if ($rootScope.moduleName == ATLAS_ANATOMY) { 56 if ($rootScope.moduleName == ATLAS_ANATOMY) {
57 57
58 jsContentURL = 'app/views/aa/atlas-anatomy-detail.html'; 58 jsContentURL = 'app/views/aa/atlas-anatomy-detail.html';
59 - moduleItemViewDivId = 'aaDetailPageDiv';  
60 -  
61 - //$scope.showAllPins(); 59 + moduleItemViewDivId = 'aaDetailPageDiv';
62 } 60 }
63 else if ($rootScope.moduleName == CLINICAL_ANIMATION) { 61 else if ($rootScope.moduleName == CLINICAL_ANIMATION) {
64 //to do, in next phase of project 62 //to do, in next phase of project
@@ -96,9 +94,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -96,9 +94,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
96 94
97 $timeout(function () { 95 $timeout(function () {
98 $compile(aaViewElement.contents())($scope); 96 $compile(aaViewElement.contents())($scope);
99 -  
100 - alert('aaView val: ' + document.getElementById(moduleItemViewDivId));  
101 - //console.log('html is compiled' + document.getElementById('daView')) 97 +
102 if (document.getElementById('aaDetailPageDiv') != null) { 98 if (document.getElementById('aaDetailPageDiv') != null) {
103 ////0.4 added some stylesheets 99 ////0.4 added some stylesheets
104 $('#aaBodyView').css("height", $(window).outerHeight()); 100 $('#aaBodyView').css("height", $(window).outerHeight());
@@ -110,11 +106,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -110,11 +106,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
110 106
111 $("#modItemImage").attr('src', $rootScope.OpenItemImagePath); 107 $("#modItemImage").attr('src', $rootScope.OpenItemImagePath);
112 108
113 - //$('#aaBodyView').css("height", $(window).outerHeight());  
114 -  
115 - //$('#aaBodyView').css("width", $(window).outerWidth()); 109 + $scope.getAllPinData();
116 } 110 }
117 - }, 250); 111 + }, 550);
118 } 112 }
119 113
120 114
@@ -127,6 +121,76 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -127,6 +121,76 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
127 121
128 }) 122 })
129 123
  124 + $scope.getAllPinData = function () {
  125 +
  126 + var promise = ModuleService.getPinDataForImage($rootScope.imageName)
  127 +
  128 + .then(
  129 + function (result) {
  130 + $scope.aaPinData = result.data.Root.Item;
  131 + debugger;
  132 + angular.forEach($scope.aaPinData, function (value, key)
  133 + {
  134 +
  135 + var pinLength1 = Math.sqrt((value._PinX - value._HeadX) * (value._PinX - value._HeadX) + (value._PinY - value._HeadY) * (value._PinY - value._HeadY));
  136 + var pinLength = pinLength1.toPrecision(2);
  137 +
  138 + var pinData = '<div class="pin" style="border:1px dashed #000;position:absolute;left:604px;top:120px;width:' + pinLength + 'px;"><div style="border:1px dashed #000;position:absolute;left:604px;"><img src="~/content/images/img181.png"/></div></div>';
  139 +
  140 + // <div class="pin" style="border:1px dashed #000;position:absolute;left:604px;top:120px;width:50px;"><div style="/* border:1px dashed #000; */position:absolute;left: -22px;/* width: 0px; */top: -11px;"><img src="~/content/images/img181.png"></div></div>
  141 +
  142 +
  143 + //var divReference = document.getElementById("imageDiv");
  144 +
  145 + $("#imageDiv").append(pinData);
  146 + })
  147 + // $scope.showAllPins();
  148 +
  149 + console.log(JSON.stringify(result, null, 4));
  150 + },
  151 + function (error) {
  152 + // handle errors here
  153 + console.log(' error: ' + error.statusText);
  154 + }
  155 + )
  156 +
  157 + }
  158 +
  159 + $scope.showAllPins = function ()
  160 + {
  161 + //debugger;
  162 + //alert('showAllPins is called');
  163 +
  164 + if ($scope.aaPinData = null || $scope.aaPinData != (undefined))
  165 + {
  166 +
  167 + angular.forEach($scope.aaPinData, function (value, key)
  168 + {
  169 + debugger;
  170 +
  171 + // alert('NO null pin data');
  172 + // var pinLength1 = Math.sqrt((638 - 604) * (638 - 604) + (83 - 120) * (83 - 120));
  173 + var pinLength1 = Math.sqrt((value._PinX - value[key]._HeadX) * (value._PinX - value._HeadX) + (value._PinY - value._HeadY) * (value._PinY - value._HeadY));
  174 + var pinLength = pinLength1.toPrecision(2);
  175 +
  176 + var pinData = '<div class="pin" style="border:1px dashed #000;position:absolute;left:604px;top:120px;width:' + pinLength + 'px;"><div style="border:1px dashed #000;position:absolute;left:604px;"><img src="~/content/images/img181.png"/></div></div>';
  177 +
  178 + // <div class="pin" style="border:1px dashed #000;position:absolute;left:604px;top:120px;width:50px;"><div style="/* border:1px dashed #000; */position:absolute;left: -22px;/* width: 0px; */top: -11px;"><img src="~/content/images/img181.png"></div></div>
  179 +
  180 +
  181 + // var divReference = document.getElementById("imageDiv");
  182 + // divReference.appendChild(pinData);
  183 + // alert(pinData);
  184 + $("#imageDiv").append(pinData);
  185 + })
  186 + }
  187 + else
  188 + {
  189 + // alert('null pin data');
  190 + }
  191 +
  192 + }
  193 +
130 194
131 }]); 195 }]);
132 196
400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js
@@ -13,7 +13,7 @@ AIA.service(&#39;ModuleService&#39;, function($http, DataService) { @@ -13,7 +13,7 @@ AIA.service(&#39;ModuleService&#39;, function($http, DataService) {
13 13
14 modName = moduleName; 14 modName = moduleName;
15 15
16 - debugger; 16 + //debugger;
17 if (moduleName == ATLAS_ANATOMY) { 17 if (moduleName == ATLAS_ANATOMY) {
18 jsonPath = '~/../content/data/json/aa/aa_dat_contentlist.json'; 18 jsonPath = '~/../content/data/json/aa/aa_dat_contentlist.json';
19 19
@@ -45,7 +45,7 @@ AIA.service(&#39;ModuleService&#39;, function($http, DataService) { @@ -45,7 +45,7 @@ AIA.service(&#39;ModuleService&#39;, function($http, DataService) {
45 45
46 if (modName == ATLAS_ANATOMY) 46 if (modName == ATLAS_ANATOMY)
47 { 47 {
48 - debugger; 48 + //debugger;
49 49
50 var AADataForSelectedItem = []; 50 var AADataForSelectedItem = [];
51 51
@@ -72,9 +72,8 @@ AIA.service(&#39;ModuleService&#39;, function($http, DataService) { @@ -72,9 +72,8 @@ AIA.service(&#39;ModuleService&#39;, function($http, DataService) {
72 }, 72 },
73 73
74 getPinDataForImage: function (imageName) 74 getPinDataForImage: function (imageName)
75 - { 75 + {
76 debugger; 76 debugger;
77 -  
78 var pindataFileNamePart1 = imageName.replace("aa_img_", ""); 77 var pindataFileNamePart1 = imageName.replace("aa_img_", "");
79 var pinFileNamePart2 = pindataFileNamePart1.replace(".jpg", ""); 78 var pinFileNamePart2 = pindataFileNamePart1.replace(".jpg", "");
80 79
@@ -86,7 +85,7 @@ AIA.service(&#39;ModuleService&#39;, function($http, DataService) { @@ -86,7 +85,7 @@ AIA.service(&#39;ModuleService&#39;, function($http, DataService) {
86 var pinData = new jinqJs() 85 var pinData = new jinqJs()
87 .from(response.data.Root.Item) 86 .from(response.data.Root.Item)
88 .select(); 87 .select();
89 - 88 + // alert(pinData.Root.Item);
90 return pinData; 89 return pinData;
91 }); 90 });
92 91