RegisterReaders.SerialStream : Bug fix in DatastreamFrame in case of TiemFieldFormat == FieldFormat.None, ver. 2.18.916

This commit is contained in:
Milan Hanajik 2018-06-06 10:18:39 +02:00
parent baa67cfe02
commit 2a622d4aa2
3 changed files with 16 additions and 11 deletions

View File

@ -121,20 +121,22 @@ namespace TBF.BenchControl.RegisterReaders.SerialStream
Int64 uncorrected = (Int64)(((UInt64)volumeRawExtLast & ff.VolumeWindowMask) | VolumeRaw);
if (Math.Abs(uncorrected - volumeRawExtLast) <= ff.VolumeWrapThreshold)
{
VolumeRawExt = volumeRawExtLast = uncorrected;
VolumeRawExt = uncorrected;
}
else if (Math.Abs(uncorrected + ff.VolumeWrapIncrement - volumeRawExtLast) <= ff.VolumeWrapThreshold)
{
VolumeRawExt = volumeRawExtLast = uncorrected + ff.VolumeWrapIncrement;
VolumeRawExt = uncorrected + ff.VolumeWrapIncrement;
}
else if (Math.Abs(uncorrected - ff.VolumeWrapIncrement - volumeRawExtLast) <= ff.VolumeWrapThreshold)
{
VolumeRawExt = volumeRawExtLast = uncorrected - ff.VolumeWrapIncrement;
VolumeRawExt = uncorrected - ff.VolumeWrapIncrement;
}
else
{
VolumeRawExt = volumeRawExtLast = uncorrected;
VolumeRawExt = uncorrected;
}
volumeRawExtLast = VolumeRawExt; /// Update referenced value from calling routine
}
if (ff.TimeFieldFormat == FieldFormat.HexadecimalWindow)
@ -147,24 +149,27 @@ namespace TBF.BenchControl.RegisterReaders.SerialStream
Int64 uncorrected = (Int64)(((UInt64)timestampExtLast & ff.TimeWindowMask) | Timestamp);
if (Math.Abs(uncorrected - timestampExtLast) <= ff.TimeWrapThreshold)
{
TimestampExt = timestampExtLast = uncorrected;
TimestampExt = uncorrected;
}
else if (Math.Abs(uncorrected + ff.TimeWrapIncrement - timestampExtLast) <= ff.TimeWrapThreshold)
{
TimestampExt = timestampExtLast = uncorrected + ff.TimeWrapIncrement;
TimestampExt = uncorrected + ff.TimeWrapIncrement;
}
else if (Math.Abs(uncorrected - ff.TimeWrapIncrement - timestampExtLast) <= ff.TimeWrapThreshold)
{
TimestampExt = timestampExtLast = uncorrected - ff.TimeWrapIncrement;
TimestampExt = uncorrected - ff.TimeWrapIncrement;
}
else
{
TimestampExt = timestampExtLast = uncorrected;
TimestampExt = uncorrected;
}
timestampExtLast = TimestampExt; /// Update referenced value from calling routine
}
else if (ff.TimeFieldFormat == FieldFormat.None)
{
TimestampExt = ff.RawTimeIncrementPerFrame * counter;
timestampExtLast = TimestampExt; /// Update referenced value from calling routine
}
f3 = byte.TryParse(frame.Substring(ff.FrameLength - 4, 2), NumberStyles.HexNumber, CultureInfo.CurrentCulture, out CheckSum);

View File

@ -41,7 +41,7 @@ namespace TBF.BenchControl.RegisterReaders.SerialStream
public Config.Unit TimeUnits { get { return (myCfg.ProcParams != null) ? myCfg.ProcParams.TimeUnits : Config.Unit.s; } }
public double TimeScaleFactor { get { return (myCfg.ProcParams != null) ? myCfg.ProcParams.TimeScaleFactor : 1; } }
public int TimeFieldStart { get { return (myCfg.ProcParams != null) ? myCfg.ProcParams.TimeFieldStart : 0; } }
public int TimeFieldStart { get { return (myCfg.ProcParams != null) ? myCfg.ProcParams.TimeFieldStart : 0; } }
public int TimeFieldEnd { get { return (myCfg.ProcParams != null) ? myCfg.ProcParams.TimeFieldEnd : 0; } }
public FieldFormat TimeFieldFormat { get { return (myCfg.ProcParams != null) ? myCfg.ProcParams.TimeFieldFormat : FieldFormat.None; } }

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.18.915.0")]
[assembly: AssemblyFileVersion("2.18.915.0")]
[assembly: AssemblyVersion("2.18.916.0")]
[assembly: AssemblyFileVersion("2.18.916.0")]