Plugins architecture
ReplicANT Studio allows the development and integration of custom plugins. For that you have to create a .NET project which implements the interface provided by ReplicANTPlugin library. Basically a plugin has the following parts: a Project Item class, a serializable configuration model class, a Designer Control (inherits from WPF UserControl) and a Process class.
Project Item
A project item is an element you can include in the project explorer hierarchy. For example a workflow, a shared memory configuration, a VirtualScene element are different kind of project items you can add to the project hierarchy.
When you need to add a new feature represented through a plugin you have to create a class which implements ReplicANTPlugin.IProjectItem. This interface gives to Replicant Studio the accurate information to allow working with this new kind of elements in the system. For example gives the icon associated with it, the instance to the visual element to configure it and the reference to the serializable model.
Configuration Model
The configuration model represents a simple serializable class with the properties required for the custom implementation. ReplicANT Studio uses it for persist and load from a file the configuration set by the user.
Designer
The designer is basically a WPF user control which also implements the interface ReplicANTPlugin.IConfigurationControl. That interface is used to notify to ReplicANT Studio if any field changed inside the control in order to ask the user to save the configuration when the user closes the window, also provides the method to fill the fields in the control from a configuration model and a method to save the values from the user control to the configuration model object.
Process
The process class, which is optional, allows to the system executes the runtime logic in the simulation based on the configuration given for that element. It implements the interface ReplicANTPlugin.IProcess, which provides the method Start/Stop to allow the processes by managed from the ReplicANT Studio.
Host
The host is the Replicant Studio itself, exposed as an interface IHost. Is used from your plugin in order to access the Replicant Studio services.
Host Services
Replicant exposes the different services as interfaces derived from IHostService.
ISharedMemoryService
This service allows access to the SharedMemory tag configuration. You can read/write the tags defined in the project.
ITraceService
Gives integration to the trace windows, in addition also binds automatically the ProjectItem with the each log entry. For example you can navigate to the projectitem doing double-click in the trace log entry.
ICodeEditorService
Gives integration to the internal source code intellisence control editor.
ICompilerService
Gives access to the dynamically Assembly generated by Replicant.