Class Simulator
Namespace: ABB.Robotics.RobotStudio.Stations
Assembly: ABB.Robotics.RobotStudio.Stations.dll
Syntax
public sealed class Simulator
Properties
View SourceActiveConfiguration
Gets or sets the SimulationConfiguration that should be used for the next simulation.
Declaration
public static SimulationConfiguration ActiveConfiguration { get; set; }
Property Value
| Type | Description |
|---|---|
| SimulationConfiguration |
CurrentTime
Gets the current simulation time (in milliseconds).
Declaration
public static double CurrentTime { get; }
Property Value
| Type | Description |
|---|---|
| double |
DataRecorder
Gets the data recorder that records simulation data.
Declaration
public static SimulationDataRecorder DataRecorder { get; }
Property Value
| Type | Description |
|---|---|
| SimulationDataRecorder |
FullSpeed
Gets or sets a value indicating if the simulation should run at maximum possible speed.
Declaration
public static bool FullSpeed { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
If this is true, SimulationSpeed is ignored.
ProcessTimerEnabled
Declaration
[Obsolete("No longer supported")]
public static bool ProcessTimerEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
RecordingEnabled
ABB internal use.
Declaration
public static bool RecordingEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Resolution
Gets or sets the desired virtual time step (in milliseconds).
Declaration
public static double Resolution { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Remarks
Actual virtual time step may differ from the set value depending on controller configuration.
SimulationSpeed
Gets or sets the desired simulation speed, defined as the ratio between virtual time and real time.
Declaration
public static double SimulationSpeed { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Remarks
Actual simulation speed may be slower depending on resolution and system performance.
State
Gets the SimulationState of the current simulation.
Declaration
public static SimulationState State { get; }
Property Value
| Type | Description |
|---|---|
| SimulationState |
Methods
View SourcePause()
Declaration
[Obsolete("Use PauseAsync() instead")]
public static void Pause()
PauseAsync()
Pauses the running simulation.
Declaration
public static Task PauseAsync()
Returns
| Type | Description |
|---|---|
| Task |
ResetProcessTimer()
Declaration
[Obsolete("No longer supported")]
public static void ResetProcessTimer()
Resume()
Declaration
[Obsolete("Use ResumeAsync() instead")]
public static void Resume()
ResumeAsync()
Resumes the simulation if paused.
Declaration
public static Task ResumeAsync()
Returns
| Type | Description |
|---|---|
| Task |
Start()
Declaration
[Obsolete("Use StartAsync() instead")]
public static void Start()
StartAsync()
Starts the simulation.
Declaration
public static Task StartAsync()
Returns
| Type | Description |
|---|---|
| Task |
Remarks
If the InitialState of the ActiveConfiguration is set to the name of a SavedState in the active station, it will be loaded automatically before simulation starts. If DataRecordingEnabled is true, the SimulationDataRecorder will be started automatically before simulation starts.
StartAsync(bool)
Starts the simulation.
Declaration
public static Task StartAsync(bool paused)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | paused | If true, the simulation will immediately go to paused state and will not run automatically. |
Returns
| Type | Description |
|---|---|
| Task |
Remarks
If the InitialState of the ActiveConfiguration is set to the name of a SavedState in the active station, it will be loaded automatically before simulation starts. If DataRecordingEnabled is true, the SimulationDataRecorder will be started automatically before simulation starts.
Step()
Declaration
[Obsolete("Use StepAsync() instead")]
public static void Step()
StepAsync()
Advances the current simulation one time step.
Declaration
public static Task StepAsync()
Returns
| Type | Description |
|---|---|
| Task |
Stop()
Declaration
[Obsolete("Use StopAsync() instead")]
public static void Stop()
StopAsync()
Stops the running simulation.
Declaration
public static Task StopAsync()
Returns
| Type | Description |
|---|---|
| Task |
WaitForState(SimulationState)
Returns a Task that completes when simulation changes to a specified state.
Declaration
public static Task WaitForState(SimulationState state)
Parameters
| Type | Name | Description |
|---|---|---|
| SimulationState | state |
Returns
| Type | Description |
|---|---|
| Task |
Remarks
Do not call Wait() on this task (may deadlock), await it instead.
Events
View SourceActiveConfigurationChanged
Raised when the ActiveConfiguration property changes.
Declaration
public static event EventHandler ActiveConfigurationChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |
EvaluateTrigger
Occurs when an event table trigger should be evaluated
Declaration
public static event EvaluateTriggerEventHandler EvaluateTrigger
Event Type
| Type | Description |
|---|---|
| EvaluateTriggerEventHandler |
Remarks
Only occurs for actions that are not evaluated by the internal simulation engine.
ExecuteAction
Occurs when an event table action should be executed
Declaration
public static event ExecuteActionEventHandler ExecuteAction
Event Type
| Type | Description |
|---|---|
| ExecuteActionEventHandler |
Remarks
Only occurs for actions that are not executed by the internal simulation engine.
ProcessTimerEnableChanged
Declaration
[Obsolete("No longer supported")]
public static event EventHandler ProcessTimerEnableChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |
ProcessTimerReset
Declaration
[Obsolete("No longer supported")]
public static event EventHandler ProcessTimerReset
Event Type
| Type | Description |
|---|---|
| EventHandler |
Starting
Raised before the simulation starts, giving clients a chance to abort the start
Declaration
public static event CancelEventHandler Starting
Event Type
| Type | Description |
|---|---|
| CancelEventHandler |
StateChanged
Occurs when the state of the simulator has changed, such as when started or stopped.
Declaration
public static event EventHandler StateChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |
Tick
Occurs when the simulation advances one tick.
Declaration
public static event EventHandler Tick
Event Type
| Type | Description |
|---|---|
| EventHandler |