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 56 if ($rootScope.moduleName == ATLAS_ANATOMY) {
57 57  
58 58 jsContentURL = 'app/views/aa/atlas-anatomy-detail.html';
59   - moduleItemViewDivId = 'aaDetailPageDiv';
60   -
61   - //$scope.showAllPins();
  59 + moduleItemViewDivId = 'aaDetailPageDiv';
62 60 }
63 61 else if ($rootScope.moduleName == CLINICAL_ANIMATION) {
64 62 //to do, in next phase of project
... ... @@ -96,9 +94,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
96 94  
97 95 $timeout(function () {
98 96 $compile(aaViewElement.contents())($scope);
99   -
100   - alert('aaView val: ' + document.getElementById(moduleItemViewDivId));
101   - //console.log('html is compiled' + document.getElementById('daView'))
  97 +
102 98 if (document.getElementById('aaDetailPageDiv') != null) {
103 99 ////0.4 added some stylesheets
104 100 $('#aaBodyView').css("height", $(window).outerHeight());
... ... @@ -110,11 +106,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
110 106  
111 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 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 13  
14 14 modName = moduleName;
15 15  
16   - debugger;
  16 + //debugger;
17 17 if (moduleName == ATLAS_ANATOMY) {
18 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 45  
46 46 if (modName == ATLAS_ANATOMY)
47 47 {
48   - debugger;
  48 + //debugger;
49 49  
50 50 var AADataForSelectedItem = [];
51 51  
... ... @@ -72,9 +72,8 @@ AIA.service(&#39;ModuleService&#39;, function($http, DataService) {
72 72 },
73 73  
74 74 getPinDataForImage: function (imageName)
75   - {
  75 + {
76 76 debugger;
77   -
78 77 var pindataFileNamePart1 = imageName.replace("aa_img_", "");
79 78 var pinFileNamePart2 = pindataFileNamePart1.replace(".jpg", "");
80 79  
... ... @@ -86,7 +85,7 @@ AIA.service(&#39;ModuleService&#39;, function($http, DataService) {
86 85 var pinData = new jinqJs()
87 86 .from(response.data.Root.Item)
88 87 .select();
89   -
  88 + // alert(pinData.Root.Item);
90 89 return pinData;
91 90 });
92 91  
... ...