public interface IHpDPluginOccTask : EPLAN.Harness.API.Plugins.Core.IHpDPluginTaskInfo, EPLAN.Harness.API.Plugins.Core.IPluginDisplayInfo
public interface IHpDPluginOccTask : EPLAN.Harness.API.Plugins.Core.IHpDPluginTaskInfo, EPLAN.Harness.API.Plugins.Core.IPluginDisplayInfo
Use this interface to implement your own plugin tasks for the Tasks panel of EPLAN Harness proD Studio.
This special type of Harness proD plugins is registered only into the task view control of a designer.
Each plugin task must have unique EPLAN.Harness.API.Plugins.Core.IPluginDisplayInfo.Name. Plugin with the same name as one already loaded won't be loaded (see HStudio logs).
The EPLAN.Harness.API.Plugins.Core.IPluginDisplayInfo.Name of the plugin task must not starts with the character '@'! Such a plugin won't be loaded (see HStudio logs).
public class EmptyImprintRapidWire : IHpDPluginOccTask { public string Name => "Empty imprint - rapid wire"; public string Author => "Author"; public string Description => "Task that checking empty imprint property of a rapid wire."; public Version Version => new Version(0, 1); public bool IsResolvable => false; public string Message => "Rapid wire has empty imprint."; public Stream ImageStream { get { Bitmap bitmap = Resources._16x16_icon; MemoryStream ms = new MemoryStream(); bitmap.Save(ms, ImageFormat.Png); return ms; } } public void Initialize(Studio api) { } public bool IsActive(Studio api, I3DOccurrence occurrence, out string message) { // All tasks uses the default Message. message = null; if (occurrence is IRapidWire rapidWire) { return string.IsNullOrWhiteSpace(rapidWire.Imprint); } return false; } public void Resolve(Studio api, I3DOccurrence occurrence) { } public void Terminate() { } }
public class FillEmptyImprintRapidWire : IHpDPluginOccTask { public string Name => "Fill empty imprint - rapid wire"; public string Author => "Author"; public string Description => "Task that resolving empty imprint property of a rapid wire."; public Version Version => new Version(0, 1); public bool IsResolvable => true; public string Message => "Rapid wire has empty imprint."; public Stream ImageStream { get { Bitmap bitmap = Resources._16x16_icon; MemoryStream ms = new MemoryStream(); bitmap.Save(ms, ImageFormat.Png); return ms; } } public void Initialize(Studio api) { } public bool IsActive(Studio api, I3DOccurrence occurrence, out string message) { // Customized message for each task. message = $"Rapid wire '{occurrence.Name}' has empty imprint."; if (occurrence is IRapidWire rapidWire) { return string.IsNullOrWhiteSpace(rapidWire.Imprint); } return false; } public void Resolve(Studio api, I3DOccurrence occurrence) { if (occurrence is IRapidWire rapidWire) { rapidWire.Imprint = occurrence.Name; } } public void Terminate() { } }
Name | Description | |
---|---|---|
![]() | Author | Author of this plugin and copyright information. (Inherited from EPLAN.Harness.API.Plugins.Core.IPluginDisplayInfo) |
![]() | Description | Description of this plugin. (Inherited from EPLAN.Harness.API.Plugins.Core.IPluginDisplayInfo) |
![]() | ImageStream | Image to be displayed in button if plugin successfully loaded. (Inherited from EPLAN.Harness.API.Plugins.Core.IPluginDisplayInfo) |
![]() | IsResolvable | Is this task resolvable? (Inherited from EPLAN.Harness.API.Plugins.Core.IHpDPluginTaskInfo) |
![]() | Message | Message of the task, shown when this task is active. (Inherited from EPLAN.Harness.API.Plugins.Core.IHpDPluginTaskInfo) |
![]() | Name | Unique name of this plugin. (Inherited from EPLAN.Harness.API.Plugins.Core.IPluginDisplayInfo) |
![]() | Version | Version of this plugin. (Inherited from EPLAN.Harness.API.Plugins.Core.IPluginDisplayInfo) |
Name | Description | |
---|---|---|
![]() | Initialize | Initialization of this plugin. |
![]() | IsActive | Is the task still active for occurrence? Return True for showing this task in the task view. |
![]() | Resolve | Method that resolves the problem causing this task. After calling this method, the IsActive method should return False. |
![]() | Terminate | Termination of this plugin. (Inherited from EPLAN.Harness.API.Plugins.Core.IHpDPluginTaskInfo) |