Skip to content

Commit

Permalink
Changed the regex that parses scientific notation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Grendstad committed Jul 8, 2024
1 parent 7209a91 commit cfffeea
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.2.0")]
[assembly: AssemblyFileVersion("1.0.2.0")]
[assembly: AssemblyVersion("1.0.3.0")]
[assembly: AssemblyFileVersion("1.0.3.0")]
10 changes: 5 additions & 5 deletions TeradyneConverter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="WATS.Client">
<Version>6.1.101</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<None Include="Examples\43420_BIO2_Extended.LOG">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand All @@ -68,5 +63,10 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="WATS.Client">
<Version>6.1.116</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
3 changes: 2 additions & 1 deletion TeradyneICT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,8 @@ public TeradyneICT(IDictionary<string, string> args)
//K500_RLY1_NO=62.532611M(-500M,500M)V
//K500_CLEAR#(,)VS
//V404=6.96336(0,20)RP
const string regMeasure = @"^(?<CompRef>[^=<>#%]+)(?<Result>[=<>#%])(?<meas>[0-9.E+-]*)(?<measU>(?:MEG*)|(?:[NPUMK]*))\x28*(?<LowLim>[0-9.E+-]*)(?<LowLimU>(?:MEG*)|(?:[NPUMK]*)),*(?<HighLim>[0-9.E+-]*)(?<HighLimU>(?:MEG*)|(?:[NPUMK]*))\x29*(?<Type>\w*) *=*(?<Message>.*)";
// Scientific notation regex taken from: https://stackoverflow.com/questions/638565/parsing-scientific-notation-sensibly
const string regMeasure = @"^(?<CompRef>[^=<>#%]+)(?<Result>[=<>#%])(?<meas>([+\-]?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+\-]?\d+)?)*)(?<measU>(?:MEG*)|(?:[NPUMK]*))\x28*(?<LowLim>([+\-]?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+\-]?\d+)?)*)(?<LowLimU>(?:MEG*)|(?:[NPUMK]*)),*(?<HighLim>([+\-]?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+\-]?\d+)?)*)(?<HighLimU>(?:MEG*)|(?:[NPUMK]*))\x29*(?<Type>\w*) *=*(?<Message>.*)";
fmt = searchFields.AddRegExpField("Measure", ReportReadState.InTest, regMeasure, null, typeof(string));
fmt.AddSubField("CompRef", typeof(string));
fmt.AddSubField("Result", typeof(string));
Expand Down

0 comments on commit cfffeea

Please sign in to comment.