Return-Path: X-Original-To: apmail-climate-commits-archive@minotaur.apache.org Delivered-To: apmail-climate-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 86639DB19 for ; Wed, 29 May 2013 16:59:16 +0000 (UTC) Received: (qmail 81717 invoked by uid 500); 29 May 2013 16:59:16 -0000 Delivered-To: apmail-climate-commits-archive@climate.apache.org Received: (qmail 81683 invoked by uid 500); 29 May 2013 16:59:16 -0000 Mailing-List: contact commits-help@climate.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@climate.apache.org Delivered-To: mailing list commits@climate.apache.org Received: (qmail 81675 invoked by uid 99); 29 May 2013 16:59:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 May 2013 16:59:16 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 May 2013 16:59:14 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 3953C23888E3; Wed, 29 May 2013 16:58:55 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1487542 - /incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers.js Date: Wed, 29 May 2013 16:58:55 -0000 To: commits@climate.incubator.apache.org From: joyce@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130529165855.3953C23888E3@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: joyce Date: Wed May 29 16:58:54 2013 New Revision: 1487542 URL: http://svn.apache.org/r1487542 Log: Resolves CLIMATE-33 - Add modal for metric selection - Adds the evaluationSettings service to ParameterSelectCtrl. When running an evaluation only the first option that the user selected is used. This will be changed later once we have decided how we're going to support workflows/multiple runs. Modified: incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers.js Modified: incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers.js URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers.js?rev=1487542&r1=1487541&r2=1487542&view=diff ============================================================================== --- incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers.js (original) +++ incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers.js Wed May 29 16:58:54 2013 @@ -76,7 +76,8 @@ function WorldMapCtrl($rootScope, $scope }; // Controller for dataset parameter selection/modification -function ParameterSelectCtrl($rootScope, $scope, $http, $timeout, selectedDatasetInformation, regionSelectParams) { +function ParameterSelectCtrl($rootScope, $scope, $http, $timeout, selectedDatasetInformation, + regionSelectParams, evaluationSettings) { $scope.datasets = selectedDatasetInformation.getDatasets(); // The min/max lat/lon values from the selected datasets @@ -210,6 +211,20 @@ function ParameterSelectCtrl($rootScope, modelIndex = i; } + // TODO At the moment we aren't running all the metrics that the user selected. We're only + // running the first available metric that the user provides. If the user un-checks all + // metrics then the default of 'bias' is used. + var metricToRun = 'bias'; + var settings = evaluationSettings.getSettings().metrics; + for (var i = 0; i < settings.length; i++) { + var setting = settings[i]; + + if (setting.select) { + metricToRun = setting.name; + break; + } + }; + // You might wonder why this is using a jQuery ajax call instead of a built // in $http.post call. The reason would be that it wasn't working with the // $http.post call but it is with this. So...there you go! This should be @@ -233,7 +248,7 @@ function ParameterSelectCtrl($rootScope, 'modelLonVarName' : $scope.datasets[modelIndex]['lon'], 'regridOption' : 'model', 'timeRegridOption' : 'monthly', - 'metricOption' : 'bias', + 'metricOption' : metricToRun, }, success: function(data) { var comp = data['comparisonPath'].split('/');