本文整理汇总了C#中DataValue类的典型用法代码示例。如果您正苦于以下问题:C#DataValue类的具体用法?C#DataValue怎么用?C#DataValue使用的例子?这里精选的类代码示例或许可以为您提供帮助。
示例1:Compute
publicoverrideDataValueCompute(IAggregationContextcontext,TimeSlicebucket,AggregateStatestate)
{
intnumGood=0;
intnumBad=0;
doubletotal=0.0;
foreach(DataValuevinbucket.Values)
{
if(state.RawValueIsGood(v))
{
numGood+=1;
total+=Convert.ToDouble(v.Value,CultureInfo.InvariantCulture);
}
else
{
numBad+=1;
}
}
DataValueretval=newDataValue{SourceTimestamp=bucket.From};
StatusCodecode=ComputeStatus(context,numGood,numBad,bucket).Code;
code.AggregateBits=AggregateBits.Calculated;
if(bucket.Incomplete)code.AggregateBits|=AggregateBits.Partial;
if(StatusCode.IsNotBad(code))
retval.Value=total;
retval.StatusCode=code;
GoodDataCount=numGood;
returnretval;
}
原文链接:
http://www.jxszl.com/biancheng/C/556888.html