io commander
This commit is contained in:
38
VisionBuilder.UI.IOCommander/Settings/IOCommanderSettings.cs
Normal file
38
VisionBuilder.UI.IOCommander/Settings/IOCommanderSettings.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using Inspectron.Settings;
|
||||
using Inspectron.Settings.Attributes;
|
||||
using VisionBuilder.UI.Common;
|
||||
|
||||
namespace VisionBuilder.UI.IOCommander.Settings;
|
||||
|
||||
public class IOCommanderSettings: ISettings
|
||||
{
|
||||
public IOCommanderCameraSettings[] Cameras { get; }
|
||||
public int PulseLength { get; set; } = 100;
|
||||
public bool EmulationMode { get; set; } = true;
|
||||
public bool ShowDebugView { get; set; } = false;
|
||||
public string Port { get; set; }="COM3";
|
||||
|
||||
public List<IOCommanderProcessingEvent> GlobalEvents { get; set; } =
|
||||
[
|
||||
new(EProcessingEvent.ProgramStarted),
|
||||
new(EProcessingEvent.ProgramEnded),
|
||||
];
|
||||
|
||||
public IOCommanderSettings(IOCommanderCameraSettings[] cameras)
|
||||
{
|
||||
Cameras = cameras;
|
||||
}
|
||||
|
||||
public void RegisterSettings(InspectronSettings settings)
|
||||
{
|
||||
settings.RegisterSimple(this, () => Port, "IOCommander", nameof(Port));
|
||||
settings.RegisterSimple(this, () => PulseLength, "IOCommander", nameof(PulseLength));
|
||||
settings.RegisterSimple(this, () => EmulationMode, "IOCommander", nameof(EmulationMode));
|
||||
settings.RegisterSimple(this, () => ShowDebugView, "IOCommander", nameof(ShowDebugView));
|
||||
|
||||
foreach (IOCommanderProcessingEvent @event in GlobalEvents)
|
||||
{
|
||||
settings.RegisterSimple(@event, () => @event.Actions, "IOCommander/Global outputs/" + @event.Event.ToString(), nameof(@event.Actions));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user