public void SetUp() { _value = 5; _fromX = 0; _fromWidth = 10; _toX = 0; _toWidth = 100; _scaler = new ValueScaler(); }
public virtual void resolveText(DataProcessor dproc, ValueScaler valueScaler) { resolvedText = text; marker = ""; if (resolvedText != null) { foreach (String mark in RrdGraphConstants.MARKERS) { if (resolvedText.EndsWith(mark)) { marker = mark; resolvedText = resolvedText.Substring(0, resolvedText.Length - marker.Length); trimIfGlue(); break; } } } enabled = resolvedText != null; }
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(); } }
private void resolveTextElements() { ValueScaler valueScaler = new ValueScaler(gdef.base_renamed); foreach (CommentText comment in gdef.comments) { comment.resolveText(dproc, valueScaler); } }