Skip to content

ZEISS-PiWeb/PiWeb-Formplots

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

build on develop License NuGet

PiWeb Formplot Library

Zeiss IQS Logo 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.

Overview

Introduction

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!

Installation

The PiWeb Formplot library is available via NuGet.

Versions >= 2.0.0

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

Older versions

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

Basic Usage

  1. Create a plot of the desired plot type and a list of plot points
var plot = new StraightnessPlot();
var points = new List<LinePoint>();
  1. Fill your point array
for( var i = 0; i < pointCount; i++ )
{
	points.Add( new LinePoint( segment, position, deviation ) );
}
  1. Add the point list to your plot
plot.Points = points;
  1. Write your plot file, e.g. using the PiWeb API
plot.WriteTo( outputStream );

Manual

Formplot types

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

Properties

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.

Writing plots into PiWeb

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.

Contributing

This repository makes use of resuable workflows from ZEISS-PiWeb/github-actions. Read the documentation (especially about automated semantic versioning) before committing any changes.