Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Merge branch 'CLIMATE-374' of https://github.com/MichaelArthurAnderso…
Browse files Browse the repository at this point in the history
  • Loading branch information
lewismc committed Jan 17, 2018
2 parents 59dbe80 + 4a64b62 commit a9fbf74
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions ocw-ui/frontend/app/scripts/controllers/parameterselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
* Controller of the ocwUiApp
*/
angular.module('ocwUiApp')
.controller('ParameterSelectCtrl', ['$rootScope', '$scope', '$http', '$timeout',
'selectedDatasetInformation', 'regionSelectParams', 'evaluationSettings',
function($rootScope, $scope, $http, $timeout, selectedDatasetInformation, regionSelectParams, evaluationSettings) {
.controller('ParameterSelectCtrl', ['$rootScope', '$scope', '$http', '$timeout', '$location',
'selectedDatasetInformation', 'regionSelectParams', 'evaluationSettings',
function($rootScope, $scope, $http, $timeout, $location, selectedDatasetInformation, regionSelectParams, evaluationSettings) {
$scope.datasets = selectedDatasetInformation.getDatasets();

// The min/max lat/lon values from the selected datasets
Expand Down Expand Up @@ -145,6 +145,8 @@ angular.module('ocwUiApp')
data['temporal_resolution'] = 30;
}

data['temporal_resolution_type'] = temporal_res;

// Load the Metrics for the evaluation
data['metrics'] = []
var metrics = settings.metrics
Expand All @@ -171,13 +173,9 @@ angular.module('ocwUiApp')
$scope.runningEval = false;

$timeout(function() {
if (evalWorkDir !== undefined) {
window.location = "#/results/" + evalWorkDir;
} else {
window.location = "#/results";
}
var url = (evalWorkDir) ? '/results/' + evalWorkDir : '/results';
$location.url(url)
}, 100);

}).error(function() {
$scope.runningEval = false;
});
Expand All @@ -192,13 +190,13 @@ angular.module('ocwUiApp')
if (parseFloat($scope.displayParams.latMax) > parseFloat($scope.latMax))
$scope.displayParams.latMax = $scope.latMax;

if (parseFloat($scope.displayParams.lonMin) < parseFloat($scope.lonMin))
if (parseFloat($scope.displayParams.lonMin) < parseFloat($scope.lonMin))
$scope.displayParams.lonMin = $scope.lonMin;

if (parseFloat($scope.displayParams.lonMax) > parseFloat($scope.lonMax))
if (parseFloat($scope.displayParams.lonMax) > parseFloat($scope.lonMax))
$scope.displayParams.lonMax = $scope.lonMax;

if ($scope.displayParams.start < $scope.start)
if ($scope.displayParams.start < $scope.start)
$scope.displayParams.start = $scope.start;

if ($scope.displayParams.end > $scope.end)
Expand All @@ -213,8 +211,8 @@ angular.module('ocwUiApp')
$rootScope.$broadcast('redrawOverlays', []);
}

$scope.unwatchDatasets = $scope.$watch('datasets',
function() {
$scope.unwatchDatasets = $scope.$watch('datasets',
function() {
var numDatasets = $scope.datasets.length;
$scope.displayParams.areValid = false;
$scope.areInUserRegridState = false;
Expand All @@ -230,7 +228,7 @@ angular.module('ocwUiApp')
// Get the valid lat/lon range in the selected datasets.
for (var i = 0; i < numDatasets; i++) {
var curDataset = $scope.datasets[i];

latMin = (curDataset['latlonVals']['latMin'] > latMin) ? curDataset['latlonVals']['latMin'] : latMin;
latMax = (curDataset['latlonVals']['latMax'] < latMax) ? curDataset['latlonVals']['latMax'] : latMax;
lonMin = (curDataset['latlonVals']['lonMin'] > lonMin) ? curDataset['latlonVals']['lonMin'] : lonMin;
Expand Down

0 comments on commit a9fbf74

Please sign in to comment.