Class SmartComponentCodeBehind
Base class for code-behind that implements behavior of a Smart
Namespace: ABB.Robotics.RobotStudio .Stations
Assembly: ABB.Robotics.RobotStudio.Stations.dll
Syntax
public abstract class SmartComponentCodeBehind
Remarks
If the derived class implements IDisposable, Dispose() will be called when
the object is no longer needed.
If Per
Constructors
SmartComponentCodeBehind()
Declaration
protected SmartComponentCodeBehind()
Methods
OnIOSignalValueChanged(SmartComponent, IOSignal)
Called when the value of an I/O signal changes.
Declaration
public virtual void OnIOSignalValueChanged(SmartComponent component, IOSignal changedSignal)
Parameters
Type | Name | Description |
---|---|---|
Smart |
component | Component that owns the changed signal. |
IOSignal | changedSignal | Changed signal. |
OnInitialize(SmartComponent)
Called from Initialize
Declaration
public virtual void OnInitialize(SmartComponent component)
Parameters
Type | Name | Description |
---|---|---|
Smart |
component | Smart Component |
OnLibraryReplaced(SmartComponent)
Called if the library containing the SmartComponent has been replaced
Declaration
public virtual void OnLibraryReplaced(SmartComponent component)
Parameters
Type | Name | Description |
---|---|---|
Smart |
component | Smart Component |
OnLoad(SmartComponent)
Called when the library or station containing the SmartComponent has been loaded
Declaration
public virtual void OnLoad(SmartComponent component)
Parameters
Type | Name | Description |
---|---|---|
Smart |
component | Smart Component |
OnPropertyValueChanged(SmartComponent, DynamicProperty, object)
Called when the value of a dynamic property changes.
Declaration
public virtual void OnPropertyValueChanged(SmartComponent component, DynamicProperty changedProperty, object oldValue)
Parameters
Type | Name | Description |
---|---|---|
Smart |
component | Component that owns the changed property. |
Dynamic |
changedProperty | Changed property. |
object | oldValue | Previous value of the changed property. |
OnSimulationStart(SmartComponent)
Called when simulation is started.
Declaration
public virtual void OnSimulationStart(SmartComponent component)
Parameters
Type | Name | Description |
---|---|---|
Smart |
component | Simulated component. |
OnSimulationStep(SmartComponent, double, double)
Called when simulation steps to a new time.
Declaration
public virtual void OnSimulationStep(SmartComponent component, double simulationTime, double previousTime)
Parameters
Type | Name | Description |
---|---|---|
Smart |
component | Simulated component. |
double | simulationTime | Time (in ms) for the current simulation step. |
double | previousTime | Time (in ms) for the previous simulation step. |
Remarks
This method is called before the Virtual Controller time step and before robots are moved.
OnSimulationStepEndAsync(SmartComponent, double)
Called after simulation steps to a new time.
Declaration
public virtual Task OnSimulationStepEndAsync(SmartComponent component, double simulationTime)
Parameters
Type | Name | Description |
---|---|---|
Smart |
component | Simulated component. |
double | simulationTime | Time (in ms) for the current simulation step. |
Returns
Type | Description |
---|---|
Task |
Remarks
This method is called after the Virtual Controller time step and after robots are moved. It is allowed to return null if the method executes synchronously.
OnSimulationStop(SmartComponent)
Called when simulation is stopped.
Declaration
public virtual void OnSimulationStop(SmartComponent component)
Parameters
Type | Name | Description |
---|---|---|
Smart |
component | Simulated component. |
QueryCollection(SmartComponent)
Called to determine the objects contained by a SmartComponent that represents a collection.
Declaration
public virtual IEnumerable<ProjectObject> QueryCollection(SmartComponent component)
Parameters
Type | Name | Description |
---|---|---|
Smart |
component | Component |
Returns
Type | Description |
---|---|
IEnumerable<Project |
Objects in the collection, or the component itself if it is not a collection. |
QueryInternalConnections(SmartComponent, IOSignal)
Called to determine the output signals affected by an input signal.
Declaration
public virtual IEnumerable<IOSignal> QueryInternalConnections(SmartComponent component, IOSignal input)
Parameters
Type | Name | Description |
---|---|---|
Smart |
component | Component |
IOSignal | input | Input signal |
Returns
Type | Description |
---|---|
IEnumerable<IOSignal> | Returns the output signals that are directly affected by the value of the input signal. |
Remarks
This method is used to determine if an I/O connection can cause illegal cyclic behavior.
QueryPropertyAttributeValue(SmartComponent, DynamicProperty, string)
Called to retrieve the actual value of a property attribute with the dummy value '?'.
Declaration
public virtual string QueryPropertyAttributeValue(SmartComponent component, DynamicProperty owningProperty, string attributeName)
Parameters
Type | Name | Description |
---|---|---|
Smart |
component | Component that owns the property. |
Dynamic |
owningProperty | Property that owns the attribute. |
string | attributeName | Name of the attribute to query. |
Returns
Type | Description |
---|---|
string | Value of the attribute. |
QueryPropertyValueValid(SmartComponent, DynamicProperty, object)
Called to validate the value of a dynamic property with the CustomValidation attribute.
Declaration
public virtual ValueValidationInfo QueryPropertyValueValid(SmartComponent component, DynamicProperty owningProperty, object newValue)
Parameters
Type | Name | Description |
---|---|---|
Smart |
component | Component that owns the changed property. |
Dynamic |
owningProperty | Property that owns the value to be validated. |
object | newValue | Value to validate. |
Returns
Type | Description |
---|---|
Value |
Result of the validation. |
QuerySimulationState(SmartComponent)
Called to determine the state of a simulated component.
Declaration
public virtual SimulationActorState QuerySimulationState(SmartComponent component)
Parameters
Type | Name | Description |
---|---|---|
Smart |
component | Simulated component. |
Returns
Type | Description |
---|---|
Simulation |
Simulation state of the component. |
QuerySimulationStep(SmartComponent, double)
Called to determine the duration of the next time step during simulation.
Declaration
public virtual double QuerySimulationStep(SmartComponent component, double previousTime)
Parameters
Type | Name | Description |
---|---|---|
Smart |
component | Simulated component. |
double | previousTime | Simulation time (in ms) for the previous step. |
Returns
Type | Description |
---|---|
double | Returns the desired duration (in ms) of the next step, or 0 to use the default duration. |