OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Loader: | 2 * Loader: |
3 * Reads GM result reports written out by results.py, and imports | 3 * Reads GM result reports written out by results.py, and imports |
4 * them into $scope.extraColumnHeaders and $scope.imagePairs . | 4 * them into $scope.extraColumnHeaders and $scope.imagePairs . |
5 */ | 5 */ |
6 var Loader = angular.module( | 6 var Loader = angular.module( |
7 'Loader', | 7 'Loader', |
8 ['ConstantsModule'] | 8 ['ConstantsModule'] |
9 ); | 9 ); |
10 | 10 |
(...skipping 109 matching lines...) Loading... | |
120 } | 120 } |
121 ); | 121 ); |
122 | 122 |
123 | 123 |
124 Loader.controller( | 124 Loader.controller( |
125 'Loader.Controller', | 125 'Loader.Controller', |
126 function($scope, $http, $filter, $location, $log, $timeout, constants) { | 126 function($scope, $http, $filter, $location, $log, $timeout, constants) { |
127 $scope.readyToDisplay = false; | 127 $scope.readyToDisplay = false; |
128 $scope.constants = constants; | 128 $scope.constants = constants; |
129 $scope.windowTitle = "Loading GM Results..."; | 129 $scope.windowTitle = "Loading GM Results..."; |
130 $scope.resultsToLoad = $location.search().resultsToLoad; | 130 $scope.actualsDir = $location.search().actualsDir; |
epoger
2014/07/31 15:18:31
Copied this file from the original loader.js and m
| |
131 $scope.expectationsDir = $location.search().expectationsDir; | |
131 $scope.loadingMessage = "please wait..."; | 132 $scope.loadingMessage = "please wait..."; |
132 | 133 |
133 /** | 134 /** |
134 * On initial page load, load a full dictionary of results. | 135 * On initial page load, load a full dictionary of results. |
135 * Once the dictionary is loaded, unhide the page elements so they can | 136 * Once the dictionary is loaded, unhide the page elements so they can |
136 * render the data. | 137 * render the data. |
137 */ | 138 */ |
138 $http.get($scope.resultsToLoad).success( | 139 var liveQueryUrl = "/live-results/actualsDir=" + $scope.actualsDir + |
140 » "&expectationsDir=" + $scope.expectationsDir; | |
141 $http.get(liveQueryUrl).success( | |
139 function(data, status, header, config) { | 142 function(data, status, header, config) { |
140 var dataHeader = data[constants.KEY__ROOT__HEADER]; | 143 var dataHeader = data[constants.KEY__ROOT__HEADER]; |
141 if (dataHeader[constants.KEY__HEADER__SCHEMA_VERSION] != | 144 if (dataHeader[constants.KEY__HEADER__SCHEMA_VERSION] != |
142 constants.VALUE__HEADER__SCHEMA_VERSION) { | 145 constants.VALUE__HEADER__SCHEMA_VERSION) { |
143 $scope.loadingMessage = "ERROR: Got JSON file with schema version " | 146 $scope.loadingMessage = "ERROR: Got JSON file with schema version " |
144 + dataHeader[constants.KEY__HEADER__SCHEMA_VERSION] | 147 + dataHeader[constants.KEY__HEADER__SCHEMA_VERSION] |
145 + " but expected schema version " | 148 + " but expected schema version " |
146 + constants.VALUE__HEADER__SCHEMA_VERSION; | 149 + constants.VALUE__HEADER__SCHEMA_VERSION; |
147 } else if (dataHeader[constants.KEY__HEADER__IS_STILL_LOADING]) { | 150 } else if (dataHeader[constants.KEY__HEADER__IS_STILL_LOADING]) { |
148 // Apply the server's requested reload delay to local time, | 151 // Apply the server's requested reload delay to local time, |
(...skipping 91 matching lines...) Loading... | |
240 | 243 |
241 // TODO(epoger): Special handling for RESULT_TYPE column: | 244 // TODO(epoger): Special handling for RESULT_TYPE column: |
242 // by default, show only KEY__RESULT_TYPE__FAILED results | 245 // by default, show only KEY__RESULT_TYPE__FAILED results |
243 $scope.showingColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE] = {}; | 246 $scope.showingColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE] = {}; |
244 $scope.showingColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE][ | 247 $scope.showingColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE][ |
245 constants.KEY__RESULT_TYPE__FAILED] = true; | 248 constants.KEY__RESULT_TYPE__FAILED] = true; |
246 | 249 |
247 // Set up mapping for URL parameters. | 250 // Set up mapping for URL parameters. |
248 // parameter name -> copier object to load/save parameter value | 251 // parameter name -> copier object to load/save parameter value |
249 $scope.queryParameters.map = { | 252 $scope.queryParameters.map = { |
250 'resultsToLoad': $scope.queryParameters.copiers.simple, | 253 'actualsDir': $scope.queryParameters.copiers.simple, |
254 'expectationsDir': $scope.queryParameters.copiers.simple, | |
251 'displayLimitPending': $scope.queryParameters.copiers.simple, | 255 'displayLimitPending': $scope.queryParameters.copiers.simple, |
252 'showThumbnailsPending': $scope.queryParameters.copiers.simple, | 256 'showThumbnailsPending': $scope.queryParameters.copiers.simple, |
253 'mergeIdenticalRowsPending': $scope.queryParameters.copiers.simple, | 257 'mergeIdenticalRowsPending': $scope.queryParameters.copiers.simple, |
254 'imageSizePending': $scope.queryParameters.copiers.simple, | 258 'imageSizePending': $scope.queryParameters.copiers.simple, |
255 'sortColumnSubdict': $scope.queryParameters.copiers.simple, | 259 'sortColumnSubdict': $scope.queryParameters.copiers.simple, |
256 'sortColumnKey': $scope.queryParameters.copiers.simple, | 260 'sortColumnKey': $scope.queryParameters.copiers.simple, |
257 }; | 261 }; |
258 // Some parameters are handled differently based on whether they USE_F REEFORM_FILTER. | 262 // Some parameters are handled differently based on whether they USE_F REEFORM_FILTER. |
259 angular.forEach( | 263 angular.forEach( |
260 $scope.filterableColumnNames, | 264 $scope.filterableColumnNames, |
(...skipping 14 matching lines...) Loading... | |
275 | 279 |
276 // Any image URLs which are relative should be relative to the JSON | 280 // Any image URLs which are relative should be relative to the JSON |
277 // file's source directory; absolute URLs should be left alone. | 281 // file's source directory; absolute URLs should be left alone. |
278 var baseUrlKey = constants.KEY__IMAGESETS__FIELD__BASE_URL; | 282 var baseUrlKey = constants.KEY__IMAGESETS__FIELD__BASE_URL; |
279 angular.forEach( | 283 angular.forEach( |
280 $scope.imageSets, | 284 $scope.imageSets, |
281 function(imageSet) { | 285 function(imageSet) { |
282 var baseUrl = imageSet[baseUrlKey]; | 286 var baseUrl = imageSet[baseUrlKey]; |
283 if ((baseUrl.substring(0, 1) != '/') && | 287 if ((baseUrl.substring(0, 1) != '/') && |
284 (baseUrl.indexOf('://') == -1)) { | 288 (baseUrl.indexOf('://') == -1)) { |
289 // EPOGER: we don't have resultsToLoad anymore... what should th is be set to? | |
285 imageSet[baseUrlKey] = $scope.resultsToLoad + '/../' + baseUrl; | 290 imageSet[baseUrlKey] = $scope.resultsToLoad + '/../' + baseUrl; |
286 } | 291 } |
287 } | 292 } |
288 ); | 293 ); |
289 | 294 |
290 $scope.readyToDisplay = true; | 295 $scope.readyToDisplay = true; |
291 $scope.updateResults(); | 296 $scope.updateResults(); |
292 $scope.loadingMessage = ""; | 297 $scope.loadingMessage = ""; |
293 $scope.windowTitle = "Current GM Results"; | 298 $scope.windowTitle = "Current GM Results"; |
294 } | 299 } |
(...skipping 722 matching lines...) Loading... | |
1017 */ | 1022 */ |
1018 $scope.getImageDiffRelativeUrl = function(imagePair) { | 1023 $scope.getImageDiffRelativeUrl = function(imagePair) { |
1019 var before = | 1024 var before = |
1020 imagePair[constants.KEY__IMAGEPAIRS__IMAGE_A_URL] + "-vs-" + | 1025 imagePair[constants.KEY__IMAGEPAIRS__IMAGE_A_URL] + "-vs-" + |
1021 imagePair[constants.KEY__IMAGEPAIRS__IMAGE_B_URL]; | 1026 imagePair[constants.KEY__IMAGEPAIRS__IMAGE_B_URL]; |
1022 return before.replace(/[^\w\-]/g, "_") + ".png"; | 1027 return before.replace(/[^\w\-]/g, "_") + ".png"; |
1023 } | 1028 } |
1024 | 1029 |
1025 } | 1030 } |
1026 ); | 1031 ); |
OLD | NEW |