The PiWeb formplot library provides an easy to use interface for reading and especially writing formplot data for the quality data management system ZEISS PiWeb. |
---|
PiWeb formplot files are zip-compressed archives, containing three files:
- fileversion.txt: Contains the formplot file version.
- header.xml: Contains structural information, such as geometry, tolerances, segments and the plots element system.
- plotpoints.dat: Contains binary plot ploints, composed from position, normal, deviations and others, depending on the plot type.
To simplify and shorten the progress of writing formplot files, we published the formplot library!
The PiWeb Formplot library is available via NuGet.
Get it at NuGet.org.
PM> Install-Package Zeiss.PiWeb.Formplot
Or compile the library by yourself. Requirements:
- Microsoft Visual Studio 2019
- Microsoft .NET Standard 2.0
Get it at NuGet.
PM> Install-Package Zeiss.IMT.PiWeb.Formplots
Or compile the library by yourself. Requirements:
- Microsoft Visual Studio 2015
- Microsoft .NET Framework v4.5
- Create a plot of the desired plot type and a list of plot points
var plot = new StraightnessPlot();
var points = new List<LinePoint>();
- Fill your point array
for( var i = 0; i < pointCount; i++ )
{
points.Add( new LinePoint( segment, position, deviation ) );
}
- Add the point list to your plot
plot.Points = points;
- Write your plot file, e.g. using the PiWeb API
plot.WriteTo( outputStream );
Following element types with their respective formplot types are supported by the library. Please use the links in the table for detailed information about certain plot types:
Element type | Formplot type | |
---|---|---|
Axiality | Cylindricity |
|
Circle in profile | CircleInProfile |
|
Cylindricity | Cylindricity |
|
Fourier | Fourier |
|
Generatrix | Cylindricity |
|
Line profile | CurveProfile |
|
Pattern | BorePattern |
|
Pitch | Pitch |
|
Plane | Flatness |
|
Roughness | Straightness |
|
Roundness | Roundness |
|
Straightness | Straightness |
|
Defect | Defect |
Formplots may contain additional properties that are accessible by PiWeb. You can add properties to your plot like the following:
plot.Properties.Add( Property.Create( "myPropertyKey", "myPropertyValue", "propertyDescription" ) );
The available datatypes are string
, long
, double
, DateTime
and TimeSpan
. The description is optional.
You can access the properties in PiWeb by using the following expression.
${Qdb.Property("My property")}
The element must have its databinding set to the measurement value containing the formplot.
You can either upload formplot files manually by using the PiWeb Planner, or by using the PiWeb API like the following:
public static async Task WriteToDatabase(
Formplot plot,
RawDataServiceRestClient rawClient,
Guid measurementUuid,
Guid characteristicUuid )
{
using( var stream = new MemoryStream() )
{
plot.WriteTo( stream );
var data = stream.ToArray();
var target = RawDataTargetEntity.CreateForValue( measurementUuid, characteristicUuid );
await rawClient.CreateRawData( new RawDataInformation
{
FileName = "plot.pltx",
MimeType = "application/x-zeiss-piweb-formplot",
Key = -1,
Created = DateTime.Now,
LastModified = DateTime.Now,
MD5 = new Guid( MD5.Create().ComputeHash( data ) ),
Size = data.Length,
Target = target
}, data );
}
}
Please note that, in any case, The file extension and the mimetype are mandatory. Files with other mimetypes or extensions will not be recognized as formplot data.
This repository makes use of resuable workflows from ZEISS-PiWeb/github-actions. Read the documentation (especially about automated semantic versioning) before committing any changes.