Scripting API / inspection/subinspections/SubInspectionApi
inspection/subinspections/SubInspectionApi
Modules
| Module | Description |
|---|---|
| External | - |
Classes
SubInspectionApi
Allows modification, retrieval, and event binding of a subinspection with the given id.
Implements
TestContainer
Extends
Type Parameters
| Type Parameter |
|---|
T extends string |
Implements
Methods
addAttachment()
addAttachment(
attachment):Promise<void>
Attaches a file to the sub-inspection. The ownership of this object is transferred, and the underlying Blob may no longer be accessed once this function has been called.
This may only be called on the currently running sub-inspection.
Parameters
| Parameter | Type |
|---|---|
attachment |
DataAttachment |
Returns
Promise<void>
addButtonTest()
addButtonTest<
U>(testProperties):Promise<void>
Adds a button test with the given properties to this sub-inspection
Type Parameters
| Type Parameter | Default type |
|---|---|
U extends string | undefined |
undefined |
Parameters
| Parameter | Type | Description |
|---|---|---|
testProperties |
ButtonCopyableCreate<T, U> |
The properties with which the test will be initialized |
Returns
Promise<void>
addChartTest()
addChartTest<
U>(testProperties):Promise<void>
Adds a Chart test with the given properties to this sub-inspection
Type Parameters
| Type Parameter | Default type |
|---|---|
U extends string | undefined |
undefined |
Parameters
| Parameter | Type | Description |
|---|---|---|
testProperties |
ChartCopyableCreate<T, U> |
The properties with which the test will be initialized |
Returns
Promise<void>
addDataCanvasTest()
addDataCanvasTest<
U>(testProperties):Promise<void>
Adds a Data Canvas test with the given properties to this sub-inspection
Type Parameters
| Type Parameter | Default type |
|---|---|
U extends string | undefined |
undefined |
Parameters
| Parameter | Type | Description |
|---|---|---|
testProperties |
DataCanvasCopyableCreate<T, U> |
The properties with which the test will be initialized |
Returns
Promise<void>
addDateTimeTest()
addDateTimeTest(
testProperties):Promise<void>
Adds a Date/Time test with the given properties to this sub-inspection
Parameters
| Parameter | Type | Description |
|---|---|---|
testProperties |
DateTimeTestWorkerCreate |
The properties with which the test will be initialized |
Returns
Promise<void>
Implementation of
addDefectListTest()
addDefectListTest<
U>(testProperties):Promise<void>
Adds a Defect List test with the given properties to this sub-inspection
Type Parameters
| Type Parameter | Default type |
|---|---|
U extends string | undefined |
undefined |
Parameters
| Parameter | Type | Description |
|---|---|---|
testProperties |
DefectListCopyableCreate<T, U> |
The properties with which the test will be initialized |
Returns
Promise<void>
addFileTest()
addFileTest<
U>(testProperties):Promise<void>
Adds a File/URL test with the given properties to this sub-inspection
Type Parameters
| Type Parameter | Default type |
|---|---|
U extends string | undefined |
undefined |
Parameters
| Parameter | Type | Description |
|---|---|---|
testProperties |
FileCopyableCreate<T, U> |
The properties with which the test will be initialized |
Returns
Promise<void>
addGroupTest()
addGroupTest<
U>(testProperties):Promise<void>
Adds a Group test with the given properties to this sub-inspection
Type Parameters
| Type Parameter | Default type |
|---|---|
U extends string | undefined |
undefined |
Parameters
| Parameter | Type | Description |
|---|---|---|
testProperties |
GroupCopyableCreate<T, U> |
The properties with which the test will be initialized |
Returns
Promise<void>
addInputTest()
addInputTest<
U>(testProperties):Promise<void>
Adds an Input test with the given properties to this sub-inspection
Type Parameters
| Type Parameter | Default type |
|---|---|
U extends string | undefined |
undefined |
Parameters
| Parameter | Type | Description |
|---|---|---|
testProperties |
InputCopyableCreate<T, U> |
The properties with which the test will be initialized |
Returns
Promise<void>
addLabelTest()
addLabelTest<
U>(testProperties):Promise<void>
Adds a Label test with the given properties to this sub-inspection
Type Parameters
| Type Parameter | Default type |
|---|---|
U extends string | undefined |
undefined |
Parameters
| Parameter | Type | Description |
|---|---|---|
testProperties |
LabelCopyableCreate<T, U> |
The properties with which the test will be initialized |
Returns
Promise<void>
addOEETest()
addOEETest<
U>(testProperties):Promise<void>
Adds an OEE test with the given properties to this sub-inspection
Type Parameters
| Type Parameter | Default type |
|---|---|
U extends string | undefined |
undefined |
Parameters
| Parameter | Type | Description |
|---|---|---|
testProperties |
OEECopyableCreate<T, U> |
The properties with which the test will be initialized |
Returns
Promise<void>
addPartTest()
addPartTest(
testProperties):Promise<void>
Adds a Part test with the given properties to this sub-inspection
Parameters
| Parameter | Type | Description |
|---|---|---|
testProperties |
PartTestWorkerCreate |
The properties with which the test will be initialized |
Returns
Promise<void>
addPassFailTest()
addPassFailTest<
U>(testProperties):Promise<void>
Adds a Pass/Fail test with the given properties to this sub-inspection
Type Parameters
| Type Parameter | Default type |
|---|---|
U extends string | undefined |
undefined |
Parameters
| Parameter | Type | Description |
|---|---|---|
testProperties |
PassFailCopyableCreate<T, U> |
The properties with which the test will be initialized |
Returns
Promise<void>
addProcessTest()
addProcessTest(
testProperties):Promise<void>
Adds a Process test with the given properties to this sub-inspection
Parameters
| Parameter | Type | Description |
|---|---|---|
testProperties |
ProcessTestWorkerCreate |
The properties with which the test will be initialized |
Returns
Promise<void>
Implementation of
addRatingTest()
addRatingTest<
U>(testProperties):Promise<void>
Adds a Rating test with the given properties to this sub-inspection
Type Parameters
| Type Parameter | Default type |
|---|---|
U extends string | undefined |
undefined |
Parameters
| Parameter | Type | Description |
|---|---|---|
testProperties |
RatingCopyableCreate<T, U> |
The properties with which the test will be initialized |
Returns
Promise<void>
addSPCTest()
addSPCTest<
U>(testProperties):Promise<void>
Adds an SPC test with the given properties to this sub-inspection
Type Parameters
| Type Parameter | Default type |
|---|---|
U extends string | undefined |
undefined |
Parameters
| Parameter | Type | Description |
|---|---|---|
testProperties |
SPCCopyableCreate<T, U> |
The properties with which the test will be initialized |
Returns
Promise<void>
addTaskTest()
addTaskTest<
U>(testProperties):Promise<void>
Adds a Task test with the given properties to this sub-inspection
Type Parameters
| Type Parameter | Default type |
|---|---|
U extends string | undefined |
undefined |
Parameters
| Parameter | Type | Description |
|---|---|---|
testProperties |
TaskCopyableCreate<T, U> |
The properties with which the test will be initialized |
Returns
Promise<void>
addTraceabilityTest()
addTraceabilityTest<
U>(testProperties):Promise<void>
Adds a Traceability test with the given properties to this sub-inspection
Type Parameters
| Type Parameter | Default type |
|---|---|
U extends string | undefined |
undefined |
Parameters
| Parameter | Type | Description |
|---|---|---|
testProperties |
TraceabilityCopyableCreate<T, U> |
The properties with which the test will be initialized |
Returns
Promise<void>
Implementation of
TestContainer.addTraceabilityTest
allTestEvents()
allTestEvents():
AllTestEventsApi
Allows event binding to all tests on this sub-inspection.
Returns
An object which allows access to test event bindings.
Implementation of
button()
button(
scriptId):ButtonTestApi
Allows modification, retrieval, and event binding of a Button test with the given id.
Parameters
| Parameter | Type | Description |
|---|---|---|
scriptId |
string |
Unique id of the test. |
Returns
An object which allows access to the test methods
Implementation of
chart()
chart(
scriptId):ChartTestApi
Allows modification and retrieval of a Chart test with the given id.
Parameters
| Parameter | Type | Description |
|---|---|---|
scriptId |
string |
Unique id of the test. |
Returns
An object which allows access to the test methods
dataCanvas()
dataCanvas(
scriptId):DataCanvasTestApi<T>
Allows modification, retrieval, and event binding of a data canvas test with the given id.
Parameters
| Parameter | Type | Description |
|---|---|---|
scriptId |
string |
Unique id of the test. |
Returns
An object which allows access to the test methods
dateTime()
dateTime(
scriptId):DateTimeTestApi
Parameters
| Parameter | Type | Description |
|---|---|---|
scriptId |
string |
Unique id of the test. |
Returns
Implementation of
defectList()
defectList(
scriptId):DefectListTestApi
Allows modification, retrieval, and event binding of a Defect List test with the given id.
Parameters
| Parameter | Type | Description |
|---|---|---|
scriptId |
string |
Unique id of the test. |
Returns
An object which allows access to the test methods
file()
file(
scriptId):FileTestApi
Allows modification, retrieval, and event binding of a File/URL test with the given id.
Parameters
| Parameter | Type | Description |
|---|---|---|
scriptId |
string |
Unique id of the test. |
Returns
An object which allows access to the test methods
Implementation of
getAttachments()
getAttachments():
Promise<DataAttachment[]>
Gets the files that are attached to this sub-inspection.
This may only be called on the currently running sub-inspection.
Returns
Promise<DataAttachment[]>
getProperties()
getProperties():
Promise<SubInspectionWorkerGet>
Retrieves the properties from the given sub-inspection.
Returns
Promise<SubInspectionWorkerGet>
getTests()
getTests():
Promise<TestsInInspectionWorkerGet[]>
Gets a list of tests inside of this sub-inspection.
Returns
Promise<TestsInInspectionWorkerGet[]>
A list of all tests, including those in groups, in this sub-inspection.
Implementation of
group()
group(
scriptId):GroupTestApi<T>
Allows modification, retrieval, and event binding of a Group test with the given id.
Parameters
| Parameter | Type | Description |
|---|---|---|
scriptId |
string |
Unique id of the test. |
Returns
GroupTestApi<T>
An object which allows access to the test methods
input()
input(
scriptId):InputTestApi
Parameters
| Parameter | Type | Description |
|---|---|---|
scriptId |
string |
Unique id of the test. |
Returns
Implementation of
label()
label(
scriptId):LabelTestApi
Allows modification, retrieval, and event binding of a Label test with the given id.
Parameters
| Parameter | Type | Description |
|---|---|---|
scriptId |
string |
Unique id of the test. |
Returns
An object which allows access to the test methods
Implementation of
oee()
oee(
scriptId):OEETestApi
Allows modification, retrieval, and event binding of an OEE test with the given id.
Parameters
| Parameter | Type | Description |
|---|---|---|
scriptId |
string |
Unique id of the test. |
Returns
An object which allows access to the test methods
onAfterEnd()
onAfterEnd(
fn):ScriptEventSubscription
Bind a function to fire after a sub-inspection has ended.
Updates made to the sub-inspection or tests inside of the sub-inspection will persist after the sub-inspection has finished running.
Parameters
| Parameter | Type | Description |
|---|---|---|
fn |
(event) => void |
The function to fire. |
Returns
ScriptEventSubscription
Inherited from
CoreSubInspectionApi.onAfterEnd
onAfterStart()
onAfterStart(
fn):ScriptEventSubscription
Bind a function to fire after a sub-inspection has begun.
Updates made to the sub-inspection or tests inside of the sub-inspection will not persist after the sub-inspection has finished running.
Parameters
| Parameter | Type | Description |
|---|---|---|
fn |
(event) => void |
The function to fire. |
Returns
ScriptEventSubscription
Inherited from
CoreSubInspectionApi.onAfterStart
onBeforeDataSubmit()
onBeforeDataSubmit(
fn):ScriptEventSubscription
Bind a function to fire before a sub-inspection submits data. The dataSet property may be modified to change the data being submitted. Note that Real-Time Failures will not be re-checked after the data is modified, and may no longer be valid.
Updates made to the sub-inspection or tests inside of the sub-inspection will not persist after the sub-inspection has finished running.
Parameters
| Parameter | Type | Description |
|---|---|---|
fn |
(event) => void |
The function to fire. |
Returns
ScriptEventSubscription
Inherited from
CoreSubInspectionApi.onBeforeDataSubmit
onBeforeEnd()
onBeforeEnd(
fn):ScriptEventSubscription
Bind a function to fire before a sub-inspection ends. preventDefault can be called on the event to prevent the sub inspection from ending.
Updates made to the sub-inspection or tests inside of the sub-inspection will not persist after the sub-inspection has finished running.
Parameters
| Parameter | Type | Description |
|---|---|---|
fn |
(event) => void |
The function to fire. |
Returns
ScriptEventSubscription
Inherited from
CoreSubInspectionApi.onBeforeEnd
part()
part(
scriptId):PartTestApi
Allows modification and retrieval of a Part test with the given id.
Parameters
| Parameter | Type | Description |
|---|---|---|
scriptId |
string |
Unique id of the test. |
Returns
An object which allows access to the test methods
passFail()
passFail(
scriptId):PassFailTestApi
Allows modification, retrieval, and event binding of a Pass/Fail test with the given id.
Parameters
| Parameter | Type | Description |
|---|---|---|
scriptId |
string |
Unique id of the test. |
Returns
An object which allows access to the test methods
process()
process(
scriptId):ProcessTestApi
Parameters
| Parameter | Type | Description |
|---|---|---|
scriptId |
string |
Unique id of the test. |
Returns
Implementation of
rating()
rating(
scriptId):RatingTestApi
Allows modification, retrieval, and event binding of a Rating test with the given id.
Parameters
| Parameter | Type | Description |
|---|---|---|
scriptId |
string |
Unique id of the test. |
Returns
An object which allows access to the test methods
removeAttachment()
removeAttachment(
fileName):Promise<void>
Removes all attachments with the given name from the sub-inspection.
This may only be called on the currently running sub-inspection.
Parameters
| Parameter | Type |
|---|---|
fileName |
string |
Returns
Promise<void>
removeTest()
removeTest(
scriptId,testType?):Promise<void>
Parameters
| Parameter | Type | Description |
|---|---|---|
scriptId |
string |
The id of the test to remove. |
testType? |
InspectionTest |
The type of the test to remove. If not provided, the first test with the given script ID will be removed. |
Returns
Promise<void>
Implementation of
spc()
spc(
scriptId):SPCTestApi
Allows modification, retrieval, and event binding of a SPC test with the given id.
Parameters
| Parameter | Type | Description |
|---|---|---|
scriptId |
string |
Unique id of the test. |
Returns
An object which allows access to the test methods
task()
task(
scriptId):TaskTestApi
Allows modification, retrieval, and event binding of a Task test with the given id.
Parameters
| Parameter | Type | Description |
|---|---|---|
scriptId |
string |
Unique id of the test. |
Returns
An object which allows access to the test methods
traceability()
traceability(
scriptId):TraceabilityTestApi
Parameters
| Parameter | Type | Description |
|---|---|---|
scriptId |
string |
Unique id of the test. |
Returns
Implementation of
updateProperties()
updateProperties(
newProps):Promise<void>
Updates the inspection with new values.
Parameters
| Parameter | Type | Description |
|---|---|---|
newProps |
SubInspectionWorkerUpdate |
Object with new properties to use |
Returns
Promise<void>