Click or drag to resize

IMcEngineMeasurementSequence Property

The current measurement sequence number

Namespace:  MediaCy.IQL.Engine
Assembly:  MediaCy.IQL.Engine (in MediaCy.IQL.Engine.dll) Version: 10.0.6912.0
Syntax
VB
ReadOnly Property MeasurementSequence ( 
	Optional IncrementSequence As Boolean = false
) As Integer
	Get

Parameters

IncrementSequence (Optional)
Type: SystemBoolean
If given and TRUE, the sequence number is incremented by one, after returning the current value. The default is to not increment the value.

Return Value

Type: Int32
The current measurement sequence number. All measurements already made will have a McMeasure.ValueSequence property of less than or equal to this number, while all measurements made in the future will have a ValueSequence property greater than this number.
Remarks
The MeasurementSequence property exposes a globally maintained sequence number that can be used to determine if you have the most recently computed Value of a measurement.
Note Note
No notifications are sent when this property changes. As illustrated in the example, you can often capture the ValueSequence number of a single measurement that you are interested in rather than capturing the Engine.MeasurementSequence property. However, if you are making a whole group of measurements, it is generally easier and faster to just capture the MeasurementSequence property after accessing the Value property of all measurements of interest. This sequence will always be greater than the ValueSequence of any of your measurements, so it is always a valid test value to see if some measurement is later recomputed.
Examples
VB
'Determine if a measurement is still valid
Public Sub MeasurementAndValueSequenceExample()
'Make a region feature
Dim myRegions As MediaCy.IQL.Features.McRegions = ThisApplication.ActiveImage.RegionFeatures
myRegions.SetEllipse(-1,100,100,90,70,45) '45degree ellipse 90x70 centered at 100,100
'measure region areas
Dim dArea As Double = myRegions.mRgnArea.Value(0) 'get the area
Dim nOurMeasSequence As Integer = ThisApplication.MeasurementSequence ' capture current sequence
'.....
'Sometime later...
If myRegions.mRgnArea.ValueSequence(nOurMeasSequence)<>0 Then
MsgBox( "Area measurement is still valid at " + CStr(dArea),,"MeasurementAndValueSequenceExample")
Else ' Need to refresh varArea
dArea = myRegions.mRgnArea.Value(0) 'get the area
nOurMeasSequence = ThisApplication.MeasurementSequence
'or equivalently we could do the following:
nOurMeasSequence = myRegions.mRgnArea.ValueSequence
MsgBox( "Area measurement was refreshed to " + CStr(dArea),,"MeasurementAndValueSequenceExample")
End If 'need to refresh
myRegions.Reset 'get rid of our ellipse
End Sub 'MeasurementAndValueSequenceExample
See Also