use of net.sourceforge.processdash.data.StringData in project processdash by dtuma.
the class ProbeData method markExclusions.
private void markExclusions(DataRepository data, String prefix, boolean clearOutlierMarks) {
SimpleData d = null;
ListData l = null;
if (!clearOutlierMarks) {
String dataName = DataRepository.createDataName(prefix, PROBE_LIST_NAME);
d = data.getSimpleValue(dataName);
if (d instanceof ListData)
l = (ListData) d;
else if (d instanceof StringData)
l = ((StringData) d).asList();
}
if (clearOutlierMarks || l == null) {
for (int row = resultSet.numRows(); row > 0; row--) resultSet.setData(row, EXCLUDE, null);
} else {
for (int row = resultSet.numRows(); row > 0; row--) {
prefix = getRowId(row);
resultSet.setData(row, EXCLUDE, l.contains(prefix) ? null : TagData.getInstance());
}
}
}
use of net.sourceforge.processdash.data.StringData in project processdash by dtuma.
the class DataNameCollector method getList.
private static List getList(DataContext data, String prefix, String name) {
name = DataRepository.createDataName(prefix, name);
SimpleData phaseDataElem = data.getSimpleValue(name);
if (phaseDataElem instanceof ListData)
return ((ListData) phaseDataElem).asList();
else if (phaseDataElem instanceof StringData)
return ((StringData) phaseDataElem).asList().asList();
return Collections.EMPTY_LIST;
}
use of net.sourceforge.processdash.data.StringData in project processdash by dtuma.
the class EstErrorScatterChartSnippet method buildData.
private void buildData(Resources res) throws IOException {
// query data from the database
String[] hql = getTinyWebServer().getRequestAsString("/dash/snippets/estErrorScatter.hql").split(";\\s*");
PDashQuery query = getPdash().getQuery();
List enactmentKeys = query.query(hql[0], getProjectKeys(), CURRENT);
List<Object[]> taskStatus = query.query(hql[1], enactmentKeys, CURRENT);
List<Object[]> sizeData = query.query(hql[2], enactmentKeys, CURRENT);
// create a result set to hold the data
ResultSet data = new ResultSet(taskStatus.size(), 7);
data.setColName(0, res.getString("Component"));
data.setColName(1, res.getString("Size_Units"));
data.setColName(2, res.getString("Plan_Size"));
data.setColName(3, res.getString("Actual_Size"));
data.setColName(4, res.getString("Size_Est_Error"));
data.setColName(5, res.getString("Plan_Time"));
data.setColName(6, res.getString("Actual_Time"));
data.setColName(7, res.getString("Time_Est_Error"));
data.setFormat(4, "100%");
data.setFormat(7, "100%");
// load time data into the result set
for (int i = 0; i < taskStatus.size(); i++) {
Object[] oneTask = taskStatus.get(i);
int row = i + 1;
data.setRowName(row, (String) oneTask[1]);
double planTime = ((Number) oneTask[2]).doubleValue();
double actualTime = ((Number) oneTask[3]).doubleValue();
data.setData(row, 5, StringData.create(formatTime(planTime)));
data.setData(row, 6, StringData.create(formatTime(actualTime)));
if (planTime > 0) {
double timeErr = (actualTime - planTime) / planTime;
data.setData(row, 7, new DoubleData(timeErr));
}
}
// load size data into the result set
for (Object[] oneSize : sizeData) {
int row = getRow(taskStatus, oneSize[0]);
if (row != -1) {
String units = (String) oneSize[1];
StringData currentUnits = (StringData) data.getData(row, 1);
if (currentUnits == null)
data.setData(row, 1, StringData.create(units));
else if (!units.equals(currentUnits.format()))
continue;
int col = "Plan".equals(oneSize[2]) ? 2 : 3;
double size = ((Number) oneSize[3]).doubleValue();
data.setData(row, col, new DoubleData(size));
}
}
// go back and calculate size estimating errors
boolean requireSize = parameters.containsKey("RequireSize");
for (int i = data.numRows(); i > 0; i--) {
DoubleData plan = (DoubleData) data.getData(i, 2);
DoubleData actual = (DoubleData) data.getData(i, 3);
if (hasValue(plan) && hasValue(actual)) {
double sizeError = (actual.getDouble() - plan.getDouble()) / plan.getDouble();
data.setData(i, 4, new DoubleData(sizeError));
} else if (requireSize) {
data.removeRow(i);
}
}
// store the result set into the repository
ListData l = new ListData();
l.add(data);
getDataContext().putValue(DATA_NAME, l);
}
use of net.sourceforge.processdash.data.StringData in project processdash by dtuma.
the class AnalysisPage method saveSizeUnits.
protected void saveSizeUnits(HttpServletRequest req, String units) {
WorkflowHistDataHelper histData = getChartData(req, false).histData;
DataRepository data = (DataRepository) PDashServletUtils.buildEnvironment(req).get(TinyCGI.DATA_REPOSITORY);
StringData sd = StringData.create(units);
data.putValue("/Workflow_Prefs/" + histData.getWorkflowID() + "/Size_Units", sd);
data.putValue("/Workflow_Prefs/" + histData.getWorkflowName() + "/Size_Units", sd);
}
use of net.sourceforge.processdash.data.StringData in project processdash by dtuma.
the class SelectWBSFilterTeamData method putValue.
private void putValue(String name, String value) {
String dataName = DataRepository.createDataName(getPrefix(), name);
// save the value of the new filter
StringData val = (value == null ? null : StringData.create(value));
getDataRepository().putValue(dataName, val);
// add a listener to prevent the data element from being disposed
getDataRepository().addDataListener(dataName, WBS_FILTER_KEEPER, false);
}
Aggregations