Cognex.VisionPro.ToolGroup A VisionPro tool that contains a set of VisionPro tools. Running the CogToolGroup implicitly runs each of the tools it contains. The run status and records of the CogToolGroup are based on the aggregate of all its contained tools. A base class for tools that have a collection of other tools. State flag for the AbortRunOnToolFailure property. State flag for the LastRunRecordEnable property. State flag for the Script property. Next state flag to be used in derived classes. Cognex internal use only. Cognex internal use only. Cognex internal use only. Allows a derived class to be notified when a user requests the auto-genereated portion of the script to be refreshed. Called from a script's initialize() funciton to define a tool group terminal associated with the script. The data type associated with the terminal An initial copy of the object The name of the terminal, also used to access the value of the terminal True to create an input terminal, false for an output terminal True if terminal is successfully created. Called from a script's initialize() funciton to define a tool group terminal associated with the script. An object which provides the initial contents of the terminal, and is also used to determine the type of data which is stored in the terminal. A key value used to identify the terminal when setting or getting terminal data, also used as the name of the teriminal in the GUI. True to define an input terminal, False to define an output terminal. True if the terminal was successfully created. Retrieves the data associated with a terminal. Can be called on both input and output terminals. The name of the terminal A System.Object that should be cast to a more specific type, or null if no terminal could be found matching "key". Retrieves the data associated with a terminal. Can be called on both input and output terminals. The name of the terminal An object to receive the contents of the terminal. True if successful, False if key does not exist. Sets the data associated with a terminal. The name of the terminal The data to associate with the terminal true if successful, false if no terminal matching "key" could be found, or if "data" is inappropriate. Constructs a new instance of the CogUserTool class. Constructs a new instance of the CogUserTool class. A CogUserTool to copy. Constructs a new instance of the CogUserTool class. The object that holds the serialized object data. The contextual information about the SerializationInfo. Creates a deep copy of the user tool. A deep copy of the cloned user tool. Releases the resources used by the CogUserTool instance. true to release both managed and unmanaged resources; false to release only unmanaged resources. Adds all of the contained tools' last run records to the supplied record. The record to append the contained tools' last run records to. Shares all graphics between image records with the same space tree in the passed ICogRecord The record containing the other records Called by the CreateCurrentRecord method to create a record containing the current state of the tool. A newly-created Current record, to which the derived tool may add new sub-records. The value of the CurrentRecordEnable property. Called by the CreateLastRunRecord method to create a record containing the state of the tool after the last call to its Run method. A newly-created LastRun record, to which the derived tool may add new sub-records. The value of the LastRunRecordEnable property during the last call to its Run method. The value of the LastRunRecordDiagEnable property during the last call to its Run method. Finds a specific run record in a tree of run records Base of the tree to search Name of the record to look for A reference to the found record, or null if none found Should only be called from tool group script. Adds a graphic to a specified run record. A CogGraphic object to add A tree of CogRecords The name of the specific record where the graphic should be added A key string used to identify your graphic True if the desired record was found and the graphic successfully added. Called by the Run method to perform the main processing of the tool. Can be set in the InternalRun function in order to save a message in the RunStatus object. CogToolResultConstant indicating overall tool run result. Should only be called from tool group script. Runs a single tool. Will not run the tool if it is currently disabled. The tool to run. This is the message corresponding to the worst tool result encountered during the current run of the tool group. Here an Error result is considered worse than Reject, which is considered worse than Warning, which is considered worse than Accept. So if the result from running the supplied (sub) tool is worse than the value of the result argument, then this message argument is overwritten to reflect this tool's run. This is the value of the worst tool result encountered during the current run of the tool group. Here an Error result is considered worse than Reject, which is considered worse than Warning, which is considered worse than Accept. So if the result from running the supplied (sub) tool is worse than the input value of this argument, then this argument is overwritten with the new, worse result value. Thrown when this (sub) tool returns an Error result and the tool group's AbortRunOnToolFailure property is True. Called when one of the contained tools raises its Changed event. Returns the publicly visible collection of tools. The containing tool. A CogToolCollection of contained tools. Returns null (Nothing in Visual Basic) if the containing tool is not a CogUserTool subclass or does not expose a public Tools property. Returns the publicly visible collection of disabled tools. The containing tool. A CogToolCollection of disabled tools. Returns null (Nothing in Visual Basic) if the containing tool is not a CogUserTool subclass or does not expose a public DisabledTools property. Determines if a tool is the same as or is contained by another tool or one of the other tool's descendents. The potentially contained tool. The potentially containing tool. Should we decend into tool blocks? Determines if a tool or one of its descendents ownes a specific scope. The potentially owned scope. The potentially owning tool. Cognex Internal Use Only. Cognex Internal Use Only. Cognex Internal Use Only. Cognex Internal Use Only. Cognex Internal Use Only. Cognex Internal Use Only. Signals the object that initialization is starting. Signals the object that initialization is complete. Runs when the entire object graph has been deserialized. The object that initiated the callback. Cognex Internal Use Only. Cognex Internal Use Only. Cognex Internal Use Only. Gets or sets a flag indicating if the Run invocation should abort if the Run method of any of its contained tools fails. True means only tools upto the first failing tool are run; false means all tools are run regardless of failures. Enable creation of records by bitwise ORing the appropriate CogUserToolLastRunRecordConstants. This read/write property is a bitwise combination of CogUserToolLastRunRecordConstants. /// Default value is CompositeSubToolGraphics. Fires when this property changes. The following state flags may be affected: SfLastRunRecordEnable SfCreateLastRunRecord Gets the collection of tools within this user tool. The collection of VisionPro tools contained within this CogUserTool. This collection may even contain one or more CogUserTools. Gets the collection of tools that are omitted from those run by this user tool. The collection of VisionPro tools omitted from those run by this CogUserTool. This collection is a subset of that of the Tools property. Tools that aren't part of the main tools collection but are still tools owned by this user tool... like ToolBlock Inputs and Outputs. These tools may or may not show up in main ToolTreeView. All the Tools owned by this user tool, includes tools that aren't part of the main tools collection but are still tools owned by this user tool... like ToolBlock Inputs and Outputs. Implemented by CogToolPalette clients to allow the palette to query if a persisted file contains a tool supported by the client. Determines if file contains a tool supported by the client. A FileInfo for a persisted tool file. True if the client supports the persisted tool; false otherwise. State flag for the GarbageCollectionEnabled property. State flag for the GarbageCollectionFrequency property. State flag for terminal data associated with a script Next state flag to be used in derived classes. Constructs a new instance of the CogToolGroup class. Constructs a new instance of the CogToolGroup class. A CogToolGroup to copy. Cognex recommends using instead of this copy constructor. Constructs a new instance of the CogToolGroup class. The object that holds the serialized object data. The contextual information about the SerializationInfo. Creates a deep copy of the tool group. A deep copy of the cloned tool group. Cognex recommends using instead of this method. Called by the Run method to perform the main processing of the tool. Can be set in the InternalRun function in order to save a message in the RunStatus object. CogToolResultConstant indicating overall tool run result. Raises the Ran event. For internal use only. Gets the collection of tools within this tool group. The collection of VisionPro tools contained within this CogToolGroup. This collection may even contain one or more CogToolGroup tools. Gets the collection of tools that are omitted from those run by this tool group. The collection of VisionPro tools omitted from those run by this CogToolGroup. This collection is a subset of that of the Tools property. Gets or sets the flag indicating that garbage collection is to be run periodically. Boolean flag indicating that garbage collection is to be run periodically. The frequency of the garbage collection invocation is specified using the GarbageCollectionFrequency property. Gets or sets the frequency at which garbage collection is to be run. Number of Run method invocations at which garbage collection is to be invoked. This value is ignored if the GarbageCollectionEnabled property is false. Cognex internal use only. Enumerates options data that can be included in the tool's LastRunRecord. Do not include the LastRunRecords of this tool's contained sub-tools. Include the LastRunRecords of this tool's contained sub-tools. Share the graphics between image records of this tool's LastRunRecord Defines the interface to be implemented by user script, so that it can be called from VisionPro at the appropriate time. Normally the user script will inherit the CogToolGroupBaseScript class rather than implement ICogToolGroupScript directly. Called when the tool group is run. Result message for the tool group. Should be used as an argument when calling RunTool in script. Can also be overwritten with a script specific result message. Result value for the tool group. Should be used as an argument when calling RunTool from script. Can also be overwritten if the script "calculates" the final result. True if VisionPro should run the tool group, False if VisionPro should not run the tool group because the script is running the tools. Called when the LastRunRecord is created. Allow scripts to modify the contents of the run record. Base ICogRecord of the LastRunRecord tree. Called when the CurrentRunRecord is created. Allow scripts to modify the contents of the run record. Base ICogRecord of the CurrentRunRecord tree. Called when the script is initialized by VisionPro. Any one-time initialization should be performed here. A reference to the CogToolGroup hosting this script. Base class which user script will override. Called when the tool group is run. This function should be overridden to provide custom tool group behavior in script. Result message for the tool group. Should be used as an argument when calling RunTool in script. Can also be overwritten with a script specific result message. Result value for the tool group. Should be used as an argument when calling RunTool from script. Can also be overwritten if the script "calculates" the final result. True if VisionPro should run the tool group, False if VisionPro should not run the tool group because the script is running the tools. Called when the CurrentRunRecord is created. Allow scripts to modify the contents of the run record. Base ICogRecord of the CurrentRunRecord tree. Called when the LastRunRecord is created. Allow scripts to modify the contents of the run record. Base ICogRecord of the LastRunRecord tree. Called when the script is initialized by VisionPro. If you override this function, you must make sure to call the base class' Initialize function. Any one-time initialization should be performed here. A reference to the CogToolGroup hosting this script. This parameter should be passed to the base class' initialize function. A stored reference to the CogToolGroup which is hosting this script. Called when the tool group is run. This function should be overridden to provide custom tool block behavior in script. Result message for the tool block. Result value for the tool block. True if VisionPro should run the tool block as it normally would, False if VisionPro should not run the tool block because the script is running the tools. Called when the CurrentRunRecord is created. Allow scripts to modify the contents of the run record. Base ICogRecord of the CurrentRunRecord tree. Called when the LastRunRecord is created. Allow scripts to modify the contents of the run record. Base ICogRecord of the LastRunRecord tree. Called when the script is initialized by VisionPro. If you override this function, you must make sure to call the base class' Initialize function. Any one-time initialization should be performed here. A reference to the CogToolGroup hosting this script. This parameter should be passed to the base class' initialize function. A stored reference to the CogToolGroup which is hosting this script. Similar to CogToolGroup, A VisionPro tool that contains a set of VisionPro tools. Running the CogToolBlock runs each of the tools it contains. The run status and records of the CogToolBlock are based on the aggregate of all its contained tools. Exposed Inputs and Outputs collection properties provide customization and storage for graphically linked terminals. CogToolBlock does not support copy construction. Please use to copy a CogToolBlock. CogToolBlock does not support Clone(). It's not well defined if Clone should return a deep or shallow copy. Please use to create a copy of a CogToolBlock. Handles changed events from the inputs collection. Responsible for keeping the actual ToolTeminals (Displayed in the GUI) in sync with the inputs collection. Handles changed events from the outputs collection. Responsible for keeping the actual ToolTeminals (Displayed in the GUI) in sync with the output collection. This API is obsolete, CogToolBlock does not support Script Only Terminals. Use CogToolBlock.Inputs and CogToolBlock.Outputs collections instead. The data type associated with the terminal An initial copy of the object The name of the terminal, also used to access the value of the terminal True to create an input terminal, false for an output terminal True if terminal is successfully created. This API is obsolete, CogToolBlock does not support Script Only Terminals. Use CogToolBlock.Inputs and CogToolBlock.Outputs collections instead. An object which provides the initial contents of the terminal, and is also used to determine the type of data which is stored in the terminal. A key value used to identify the terminal when setting or getting terminal data, also used as the name of the teriminal in the GUI. True to define an input terminal, False to define an output terminal. True if the terminal was successfully created. This API is obsolete, CogToolBlock does not support Script Only Terminals. Use CogToolBlock.Inputs and CogToolBlock.Outputs collections instead. The name of the terminal A System.Object that should be cast to a more specific type, or null if no terminal could be found matching "key". This API is obsolete, CogToolBlock does not support Script Only Terminals. Use CogToolBlock.Inputs and CogToolBlock.Outputs collections instead. The name of the terminal An object to receive the contents of the terminal. True if successful, False if key does not exist. This API is obsolete, CogToolBlock does not support Script Only Terminals. Use CogToolBlock.Inputs and CogToolBlock.Outputs collections instead. The name of the terminal The data to associate with the terminal true if successful, false if no terminal matching "key" could be found, or if "data" is inappropriate. Creates a new ToolBlock script using the specified language and type. The langugage of the script to create (VB.NET or C#). The type of the script to create (simple or advanced). Refreshes the auto-generated section of the script (if any exist) to update for changes made to the ToolBlock. Should only be called from the ScriptEditor, as this only updates the text... The script editor still needs to recompile and replace the actual script object. Gets an ArrayList populated with a CogReferencedAssembly for each assembly a ToolBlock script will reference (based on contianed tools, inputs, and outputs). Merges the existing referenced assemblies with an other assemblies this ToolBlock may need (based on contianed tools, inputs, and outputs). Adds the reference to the list if it is not allready present. Returns true if there is allready a reference to in , otherwise returns false. Tools that aren't part of the main tools collection but are still tools owned by this user tool... like ToolBlock Inputs and Outputs. Gets the collection of tools within this tool block. The collection of VisionPro tools contained within this CogToolBlock. A CogToolBlockTerminalCollection of input terminals. The default is an empty collection. Changing the Inputs collection automatically refreshes the the Tool terminals such that: An (external) Tool input terminal is added to the ToolBlock for every CogToolTerminal in the Inputs collection. The CogToolTerminal name and the path to the CogToolTerminal Value property are used to construct the Tool terminals. Any DataBindings contained in ToolBlock.DataBindings which are linked to terminals that are no longer in the collection are removed. A (internal) Tool output terminal is added to the ToolBlock.Inputs collection (which is also a tool) for every CogToolTerminal in the Inputs collection. The CogToolTerminal name and the path to the CogToolTerminal Value property are used to construct the Tool terminals. Any DataBindings contained in ToolBlock.Inputs.DataBindings which are linked to CogToolTerminals terminals that are no longer in the collection are removed. CogToolBlockTerminalCollection of output terminals. The default is an empty collection. Changing the Outputs collection automatically refreshes the Tool terminals such that: An (external) Tool output terminal is added to the ToolBlock for every CogToolTerminal in the Outputs collection. The CogToolTerminal name and the path to the CogToolTerminal Value property are used to construct the Tool terminals. Any DataBindings contained in ToolBlock.DataBindings which are linked to terminals that are no longer in the collection are removed. An (internal) Tool input terminal is added to the ToolBlock.Inputs collection (which is also a tool) for every CogToolTerminal in the Outputs collection. The CogToolTerminal name and the path to the CogToolTerminal Value property are used to construct the Tool terminals. Any DataBindings contained in ToolBlock.Outputs.DataBindings which are linked to CogToolTerminals terminals that are no longer in the collection are removed. A collection of CogToolBlockTerminals Used by as a container for input and output property collections. Note that CogToolBlockTerminal also implements ICogTool (even though the run method does not do anything). This allows DataBindings to the terminal values via the CogDataBinding mechanism supported by all VisionPro tools. State flag for the FailOnInvalidDataBinding property. Not Supported, use CogSerializer to Copy an instance of CogToolBlockTerminalCollection. Serialization Constructor - necessary for save/restore. Gets a list of specially formatted strings that represent the names and paths to all the CogToolBlockTerminals in this collection. These strings are formatted such that they can be passed directly to ToolTerminals.SetToolInputTerminals(ICogTool tool, string[] terminals) or ToolTerminals.SetToolOutputTerminals(ICogTool tool, string[] terminals) Intended for Cognex Internal Use only... this API is subject to change. A path to prepend to the returned terminal paths, Used to create Tool terminal strings for items of the collection when the collection is a property of a Tool. Intended for Cognex Internal Use Gets a list of specially formatted strings that represent the names and paths to all the CogToolBlockTerminals in this collection. These strings are formatted such that they can be passed directly to ToolTerminals.SetToolInputTerminals(ICogTool tool, string[] terminals) or ToolTerminals.SetToolOutputTerminals(ICogTool tool, string[] terminals) Intended for Cognex Internal Use only... this API is subject to change. The CreateCurrentRecord Method for CogToolBlockTerminalCollection does not do anything. The CreateLastRunRecord Method for CogToolBlockTerminalCollection does not do anything. The Run Method for CogToolBlockTerminalCollection does not do anything. Raises the Disposed event. Runs when the entire object graph has been deserialized. The object that initiated the callback. Specifies that the Run method is to fail if executed while one or more data bindings are invalid. Returns the Parent CogToolBlock. This event is raised when the Dispose method is called. It gets called before any disposing is done so the properties of this object are still valid at this point. Enumeration of different ToolBlock Script types. Advanced script with 4 default entry points provided. Tools, Inputs, and Outputs can be accessed by normal ToolBlock API. A simple script with a single entry point. Simple scripts contian auto-generated code which provides easy access to ToolBlock Tools, Inputs, and Outputs by name. Gets an ArrayList populated with a String for each using/imports statement a ToolBlock script will want to include. Merges the existing imports with imports this ToolBlock may need (based on contianed tools, inputs, and outputs). Adds the reference to the list if it is not allready present.