bug fixing CORRELATION

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/performfish-analytics-portlet@178521 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2019-03-08 16:38:40 +00:00
parent daecdba666
commit 459e7d52d1
3 changed files with 88 additions and 21 deletions

View File

@ -164,10 +164,12 @@ public class PerformFishAnalyticsController {
viewController.manageKPI(selectedKPI.getKpi(), selectedKPI.isChecked(), selectedKPI.getSelectedPopulationType()); viewController.manageKPI(selectedKPI.getKpi(), selectedKPI.isChecked(), selectedKPI.getSelectedPopulationType());
int selectedKPIsSize = viewController.getSelectedKPIs().size(); int selectedKPIsSize = viewController.getSelectedKPIs().size();
boolean isValidForm = viewController.validatePerformFishInputFields(); //viewController.manageAlgorithmsSubmit(selectedKPIsSize);
if(isValidForm) { List<String> batchIds = viewController.getSelectedBatchID();
if(batchIds==null || batchIds.size()==0) {
viewController.enableAllAlgorithmsForSubmit(false);
}else
viewController.manageAlgorithmsSubmit(selectedKPIsSize); viewController.manageAlgorithmsSubmit(selectedKPIsSize);
}
} }
}); });
@ -446,7 +448,8 @@ public class PerformFishAnalyticsController {
case SCATTER: case SCATTER:
if(inputKPI.get(0)==null || inputKPI.get(1)==null){ if(inputKPI.get(0)==null || inputKPI.get(1)==null){
submitRequestPanel.setTheTitle("Something seems wrong, one or more of the selected KPIs are not valid. Please try again"); submitRequestPanel.setTheTitle("Sorry, something seems wrong, the selected KPIs are not valid. Please try again");
checkTabSpinner(submitRequestPanel, tab);
return; return;
// Window.alert("Something seems wrong, no selected BatchID, try again"); // Window.alert("Something seems wrong, no selected BatchID, try again");
} }

View File

@ -312,23 +312,46 @@ public class AnalyticsPanelResult extends Composite {
} }
/** // /**
* Gets the KPI for name. // * Gets the KPI for name.
* // *
* @param name the name // * @param name the name
* @return the KPI for name // * @return the KPI for name
*/ // */
// public KPI getKPIForName(String name){
//
// //GWT.log("Selected KPIs: "+selectedKPIs);
// GWT.log("Searching KPI name: "+name);
// KPI foundKPI = null;
// //String purgedName = name.replaceAll("\\%", "").trim();
// String purgedName = name.trim();
// for (KPI kpi : selectedKPIs) {
// //String purgedKPIName = kpi.getName().replaceAll("\\%", "").trim();
// String purgedKPIName = kpi.getName().trim();
// if(purgedKPIName.compareToIgnoreCase(purgedName)==0) {
// foundKPI = kpi;
// break;
// }
//
// }
// GWT.log("FOUND KPI: "+foundKPI);
// return foundKPI;
// }
public KPI getKPIForName(String name){ public KPI getKPIForName(String name){
System.out.println("Selected KPIs: "+selectedKPIs); GWT.log("Searching KPI name: "+name);
String purgedName = name.replaceAll("\\%", "").trim(); KPI foundKPI = null;
String purgedName = name.trim();
for (KPI kpi : selectedKPIs) { for (KPI kpi : selectedKPIs) {
String purgedKPIName = kpi.getName().replaceAll("\\%", "").trim(); String purgedKPIName = kpi.getName().trim();
if(purgedKPIName.compareToIgnoreCase(purgedName)==0) if(purgedKPIName.compareToIgnoreCase(purgedName)==0) {
return kpi; foundKPI = kpi;
break;
}
} }
GWT.log("FOUND KPI: "+foundKPI);
return null; return foundKPI;
} }
/** /**
@ -461,6 +484,10 @@ public class AnalyticsPanelResult extends Composite {
flexTable.setWidget(0, 0,new Label("")); flexTable.setWidget(0, 0,new Label(""));
// for (KPI kpi : selectedKPIs) {
// GWT.log("Selected KPIs are: "+kpi);
// }
CSVRow headerRow = result.getHeaderRow(); CSVRow headerRow = result.getHeaderRow();
//HEADER //HEADER
for (int i=1; i<headerRow.getListValues().size(); i++) { for (int i=1; i<headerRow.getListValues().size(); i++) {
@ -613,7 +640,7 @@ public class AnalyticsPanelResult extends Composite {
*/ */
private void fillKPIReferenceForIndex(int rowIndex, int columnIndex, List<KPI> listKPI){ private void fillKPIReferenceForIndex(int rowIndex, int columnIndex, List<KPI> listKPI){
String key = rowIndex+","+columnIndex; String key = generateKey(rowIndex, columnIndex);
kpiMapPointers.put(key, listKPI); kpiMapPointers.put(key, listKPI);
// String kpiNames = ""; // String kpiNames = "";
@ -641,10 +668,14 @@ public class AnalyticsPanelResult extends Composite {
* @return the KPI for indexes * @return the KPI for indexes
*/ */
public List<KPI> getKPIForIndexes(int rowIndex, int columnIndex){ public List<KPI> getKPIForIndexes(int rowIndex, int columnIndex){
String key = rowIndex+","+columnIndex; String key = generateKey(rowIndex, columnIndex);
return kpiMapPointers.get(key); return kpiMapPointers.get(key);
} }
private String generateKey(int rowIndex, int columnIndex) {
return rowIndex+"-"+columnIndex;
}
/** /**
* Call box plot and speedo meter. * Call box plot and speedo meter.

View File

@ -2,6 +2,7 @@
package org.gcube.portlets.user.performfishanalytics.client.viewbinder; package org.gcube.portlets.user.performfishanalytics.client.viewbinder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -11,6 +12,7 @@ import org.gcube.portlets.user.performfishanalytics.client.event.LoadPopulationT
import org.gcube.portlets.user.performfishanalytics.client.event.PerformFishFieldFormChangedEvent; import org.gcube.portlets.user.performfishanalytics.client.event.PerformFishFieldFormChangedEvent;
import org.gcube.portlets.user.performfishanalytics.client.event.SelectedPopulationTypeEvent; import org.gcube.portlets.user.performfishanalytics.client.event.SelectedPopulationTypeEvent;
import org.gcube.portlets.user.performfishanalytics.shared.Area; import org.gcube.portlets.user.performfishanalytics.shared.Area;
import org.gcube.portlets.user.performfishanalytics.shared.KPI;
import org.gcube.portlets.user.performfishanalytics.shared.Period; import org.gcube.portlets.user.performfishanalytics.shared.Period;
import org.gcube.portlets.user.performfishanalytics.shared.Population; import org.gcube.portlets.user.performfishanalytics.shared.Population;
import org.gcube.portlets.user.performfishanalytics.shared.PopulationType; import org.gcube.portlets.user.performfishanalytics.shared.PopulationType;
@ -209,8 +211,39 @@ public class PerformFishAnalitycsFormView extends Composite {
selectAllFields(field_select_area, isChecked); selectAllFields(field_select_area, isChecked);
} }
}); });
// KPI kpi = new KPI("", "", "Number fish/FTE employees in 2nd year", "", null, null, 1);
// getKPIForName("Number fish/FTE employees in 2nd year", Arrays.asList(kpi));
} }
// /**
// * Gets the KPI for name.
// *
// * @param name the name
// * @return the KPI for name
// */
// public KPI getKPIForName(String name, List<KPI> selectedKPIs){
//
// //GWT.log("Selected KPIs: "+selectedKPIs);
// GWT.log("Searching name: "+name);
// KPI foundKPI = null;
// String purgedName = name.replace("\\", "\\\\");
// GWT.log("Purged name: "+purgedName);
// //String purgedName = name.trim();
// for (KPI kpi : selectedKPIs) {
// String purgedKPIName = kpi.getName().replace("\\", "\\\\");
// GWT.log("Purged Selected KPI name: "+purgedName);
// //String purgedKPIName = kpi.getName().trim();
// if(purgedKPIName.compareToIgnoreCase(purgedName)==0) {
// foundKPI = kpi;
// break;
// }
//
// }
// GWT.log("FOUND KPI: "+foundKPI);
// return foundKPI;
// }
/** /**
* Select all fields. * Select all fields.
* *