示例#1
0
        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);
        }
示例#2
0
        public IProcessingPluginChain AddOutputDevicePlugin(IOutputDevicePlugin plugin, IOutputDevicePluginContext startingContext)
        {
            var outputDevices = OutputDevices.ToList();

            outputDevices.Add(new OutputDevice(plugin, startingContext));
            OutputDevices = outputDevices;

            return(this);
        }
示例#3
0
 internal OutputDevice(IOutputDevicePlugin plugin, IOutputDevicePluginContext context)
 {
     Plugin  = plugin;
     Context = context;
 }