public void Run(IOutputDevicePluginContext context) { if (webSocketServer == null) { webSocketServer = new WebSocketServer(webSocketIp, context.GetInput <int>("Listening port")); webSocketServer.AddWebSocketService(context.GetInput <string>("Path"), () => { return(outputData); }); webSocketServer.Start(); } if (!webSocketServer.IsListening) { throw new WebSocketConnectionException(webSocketIp, webSocketServer.Port); } outputData.SetPointsCollection(context.PointsCollection); }
public IProcessingPluginChain AddOutputDevicePlugin(IOutputDevicePlugin plugin, IOutputDevicePluginContext startingContext) { var outputDevices = OutputDevices.ToList(); outputDevices.Add(new OutputDevice(plugin, startingContext)); OutputDevices = outputDevices; return(this); }
internal OutputDevice(IOutputDevicePlugin plugin, IOutputDevicePluginContext context) { Plugin = plugin; Context = context; }