Show / Hide Table of Contents

Class ScanHead

An interface to a physical scan head.

Inheritance
System.Object
ScanHead
Namespace: JoeScan.Pinchot
Assembly: JoeScan.Pinchot.dll
Syntax
public class ScanHead : IDisposable
Remarks

The ScanHead class provides an interface to a physical scan head by providing properties and methods for configuration, status retrieval, and profile data retrieval. A ScanHead must belong to a ScanSystem and is created using CreateScanHead(UInt32, UInt32).

Properties

ID

Gets the unique ID of the ScanHead. The value is set when the ScanHead is created using CreateScanHead(UInt32, UInt32).

Declaration
public uint ID { get; }
Property Value
Type Description
System.UInt32

The unique ID of the ScanHead.

IPAddress

Gets the of the physical scan head. The value is determined automatically via network discovery according to the SerialNumber.

Declaration
public IPAddress IPAddress { get; }
Property Value
Type Description
IPAddress

The of the physical scan head.

IsConnected

Gets a value indicating whether the network connection to the physical scan head is established.

Declaration
public bool IsConnected { get; }
Property Value
Type Description
System.Boolean

A value indicating whether the network connection to the physical scan head is established.

NumberOfProfilesAvailable

Gets the number of Profiles available in the local buffer for the ScanHead.

Declaration
public int NumberOfProfilesAvailable { get; }
Property Value
Type Description
System.Int32

The number of Profiles available in the local buffer for the ScanHead.

Remarks

All existing Profiles are cleared from the local buffer when StartScanning(Double, DataFormat) is called successfully.

ProfileBufferOverflowed

Gets a value indicating whether the ScanHead profile buffer overflowed.

Declaration
public bool ProfileBufferOverflowed { get; }
Property Value
Type Description
System.Boolean

A value indicating whether the ScanHead profile buffer overflowed.

Remarks

Resets to false when StartScanning(Double, DataFormat) is called successfully.

SerialNumber

Gets the serial number of the physical scan head. The value is set when the ScanHead is created using CreateScanHead(UInt32, UInt32).

Declaration
public uint SerialNumber { get; }
Property Value
Type Description
System.UInt32

The serial number of the physical scan head.

Status

Gets the most recent ScanHeadStatus received from the physical scan head.

Declaration
public ScanHeadStatus Status { get; }
Property Value
Type Description
ScanHeadStatus

The most recent ScanHeadStatus received from the physical scan head.

Remarks

Status messages are not sent from the scan head while scanning.

Methods

ClearProfiles()

Empties the internal client side software buffers used to store profiles received from a given scan head.

Under normal scanning conditions where the application consumes profiles as they become available, this function will not be needed. Its use is to be found in cases where the application fails to consume profiles after some time and the number of buffered profiles, as indicated by the NumberOfProfilesAvailable property, becomes more than the application can consume and only the most recent scan data is desired.

Declaration
public void ClearProfiles()

Configure(ScanHeadConfiguration)

Configure the physical scan head according to the provided ScanHeadConfiguration parameter.

Declaration
public void Configure(ScanHeadConfiguration configuration)
Parameters
Type Name Description
ScanHeadConfiguration configuration

The ScanHeadConfiguration to use for configuration of the physical scan head.

Remarks

The ScanHeadConfiguration parameters are only sent to the scan head when StartScanning(Double, DataFormat) is called.
A clone of configuration is created and assigned to JoeScan.Pinchot.ScanHead.Configuration, so a reference to a single ScanHeadConfiguration cannot be shared amongst ScanHeads.

Dispose()

Releases the managed and unmanaged resources used by the ScanHead

Declaration
public void Dispose()

Dispose(Boolean)

Releases the unmanaged resources used by the ScanHead and optionally releases the managed resources.

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing

Whether being disposed explicitly (true) or due to a finalizer (false).

Finalize()

Declaration
protected void Finalize()

GetCameraImage(Camera, Boolean)

Captures an image from the specified Camera.

Declaration
public CameraImage GetCameraImage(Camera camera, bool enableLasers)
Parameters
Type Name Description
Camera camera

The Camera from which to capture the image.

System.Boolean enableLasers

A value indicating whether to enable the Laser(s) during the image capture.

Returns
Type Description
CameraImage

The CameraImage.

GetConfigurationClone()

Gets a clone of the ScanHeadConfiguration used to configure the physical scan head. Use Configure(ScanHeadConfiguration) to set the ScanHeadConfiguration.

Declaration
public ScanHeadConfiguration GetConfigurationClone()
Returns
Type Description
ScanHeadConfiguration

A clone of the ScanHeadConfiguration used to configure the physical scan head.

SetAlignment(Camera, Double, Double, Double, ScanHeadOrientation)

Sets the spatial transform parameters of the ScanHead in order to properly transform the data from a scan head based coordinate system to one based on mill placement. Parameters are applied only to specified Camera. This method should not be used in most cases as all cameras should be aligned to each other by factory calibration. In most cases SetAlignment(Double, Double, Double, ScanHeadOrientation) should be used instead.

Declaration
public void SetAlignment(Camera camera, double rollDegrees, double shiftX, double shiftY, ScanHeadOrientation orientation)
Parameters
Type Name Description
Camera camera

The Camera which to set the alignment of.

System.Double rollDegrees

The rotation around the Z axis in the mill coordinate system in degrees.

System.Double shiftX

The shift along the X axis in the mill coordinate system in inches.

System.Double shiftY

The shift along the Y axis in the mill coordinate system in inches.

ScanHeadOrientation orientation

The ScanHeadOrientation.

SetAlignment(Double, Double, Double, ScanHeadOrientation)

Sets the spatial transform parameters of the ScanHead in order to properly transform the data from a scan head based coordinate system to one based on mill placement. Parameters are applied to all Cameras.

Declaration
public void SetAlignment(double rollDegrees, double shiftX, double shiftY, ScanHeadOrientation orientation)
Parameters
Type Name Description
System.Double rollDegrees

The rotation around the Z axis in the mill coordinate system in degrees.

System.Double shiftX

The shift along the X axis in the mill coordinate system in inches.

System.Double shiftY

The shift along the Y axis in the mill coordinate system in inches.

ScanHeadOrientation orientation

The ScanHeadOrientation.

SetWindow(ScanWindow)

Sets the ScanWindow, in mill coordinates, within which a camera will look for the laser. Default is an unconstrained window.

Declaration
public void SetWindow(ScanWindow window)
Parameters
Type Name Description
ScanWindow window

The ScanWindow to use for the ScanHead.

Remarks

The ScanWindow constraints are only sent to the scan head when Connect(TimeSpan) is called.

TakeNextProfile()

Removes a Profile.

Declaration
public Profile TakeNextProfile()
Returns
Type Description
Profile

The Profile removed.

TakeNextProfile(CancellationToken)

Removes a Profile while observing a .

Declaration
public Profile TakeNextProfile(CancellationToken token)
Parameters
Type Name Description
CancellationToken token

to observe.

Returns
Type Description
Profile

The Profile removed.

TryTakeNextProfile(out Profile)

Tries to remove a Profile.

Declaration
public bool TryTakeNextProfile(out Profile profile)
Parameters
Type Name Description
Profile profile

The Profile to be removed.

Returns
Type Description
System.Boolean

Whether a Profile was successfully taken.

TryTakeNextProfile(out Profile, TimeSpan, CancellationToken)

Tries to remove a Profile in the specified time period while observing a .

Declaration
public bool TryTakeNextProfile(out Profile profile, TimeSpan timeout, CancellationToken token)
Parameters
Type Name Description
Profile profile

The Profile to be removed.

TimeSpan timeout

A that represents the time to wait, or a that represents -1 milliseconds to wait indefinitely.

CancellationToken token

to observe.

Returns
Type Description
System.Boolean

Whether a Profile was successfully taken.

Back to top Copyright JoeScan, Inc.
Generated by DocFX