예제 #1
0
	public override void resolveText(DataProcessor dproc, ValueScaler valueScaler){
		base.resolveText(dproc, valueScaler);
		if (resolvedText != null) {
			double value = dproc.GetAggregate(srcName, consolFun);
			Match matcher = UNIT_PATTERN.Match(resolvedText);
			if (matcher.Success) {
				// unit specified
				ValueScaler.Scaled scaled = valueScaler.scale(value, matcher.Groups[2].Equals("s"));
				resolvedText = resolvedText.Substring(0, matcher.Index) +
						matcher.Groups[1] + scaled.unit + resolvedText.Substring(matcher.Index + matcher.Length);
				value = scaled.value;
			}
			resolvedText = String.Format(resolvedText, value);
			trimIfGlue();
		}
	}