use of net.sourceforge.processdash.data.SimpleData in project processdash by dtuma.
the class PercentSpentIndicator method shouldBeVisible.
private boolean shouldBeVisible(String path) {
if (path == null)
return false;
SaveableData enabledVal = dashCtx.getData().getInheritableValue(path, ENABLED_DATA_NAME);
if (enabledVal == null)
return Settings.getBool(ENABLED_SETTING_NAME, true);
SimpleData enabled = enabledVal.getSimpleValue();
return (enabled != null && enabled.test());
}
use of net.sourceforge.processdash.data.SimpleData in project processdash by dtuma.
the class PercentSpentIndicator method dataValueChanged.
public void dataValueChanged(DataEvent e) throws RemoteException {
forecastDateHTML = null;
String name = e.getName();
SimpleData value = e.getValue();
if (name.equals(estTimeDataName)) {
estTime = getDouble(value, Double.NaN);
estTimeEditable = (value == null || value.isEditable()) && Settings.isReadWrite();
recalc();
} else if (name.equals(actTimeDataName)) {
actTime = getDouble(value, 0.0);
recalc();
} else if (name.equals(actDateDateName)) {
actDate = value;
recalc();
}
}
use of net.sourceforge.processdash.data.SimpleData in project processdash by dtuma.
the class Sumfor method call.
/** Perform a procedure call.
*
* This method <b>must</b> be thread-safe.
*/
public Object call(List arguments, ExpressionContext context) {
double result = 0.0, val;
String name = asString(getArg(arguments, 0));
if (name == null)
return null;
Iterator i = collapseLists(arguments, 1).iterator();
String path, dataName, alias;
alias = NO_ALIAS_YET;
SimpleData sVal = null;
while (i.hasNext()) {
path = asStringVal(i.next());
if (path == null)
continue;
dataName = DataRepository.createDataName(path, name);
if (alias == NO_ALIAS_YET)
alias = dataName;
else
alias = null;
sVal = context.get(dataName);
val = asDouble(sVal);
if (!Double.isNaN(val) && !Double.isInfinite(val))
result += val;
}
if (alias != null && alias != NO_ALIAS_YET && sVal != null)
return new DescribedValue(sVal, context.resolveName(alias));
else if (result == 0)
return ImmutableDoubleData.READ_ONLY_ZERO;
else
return new DoubleData(result);
}
use of net.sourceforge.processdash.data.SimpleData in project processdash by dtuma.
the class DataMessageHandler method handle.
public void handle(MessageEvent message) {
String prefix = getPrefix(message);
if (prefix == null)
return;
Map<String, SimpleData> dataValues = parseData(message);
if (dataValues == null || dataValues.isEmpty())
return;
Date editTimestamp = XMLUtils.getXMLDate(message.getMessageXml(), "editTimestamp");
for (Entry<String, SimpleData> e : dataValues.entrySet()) {
String dataName = DataRepository.createDataName(prefix, e.getKey());
maybeSaveValue(message, dataName, e.getValue(), editTimestamp);
}
}
use of net.sourceforge.processdash.data.SimpleData in project processdash by dtuma.
the class EVReportSettings method lookupPathFilter.
private void lookupPathFilter() {
SaveableData sval = data.getInheritableValue(prefix, "Earned_Value//Path_Filter");
if (sval == null)
sval = data.getInheritableValue(prefix, "Earned_Value_Path_Filter");
SimpleData val = (sval == null ? null : sval.getSimpleValue());
parameters.put(PATH_FILTER_PARAM, val == null ? "" : val.format());
sval = data.getInheritableValue(prefix, "Earned_Value//Merged_Path_Filter");
if (sval == null)
sval = data.getInheritableValue(prefix, "Earned_Value_Merged_Path_Filter");
val = (sval == null ? null : sval.getSimpleValue());
parameters.put(MERGED_PATH_FILTER_PARAM, val == null ? "" : val.format());
}
Aggregations