Data Processing Server for individual device. Handles plugins and events related to the device.
Пример #1
0
 private void UpdateLoginInformation(DeviceServer server)
 {
     if (CurrentUser != null)
     {
         server.SendPluginData("USER_LOGIN", CurrentUser);
     }
     else
     {
         server.SendPluginData("USER_LOGIN", null);
     }
 }
Пример #2
0
        private void StartDeviceServer(object obj)
        {
            var config = (DeviceConfiguration)obj;

            var plugins = new List <IServerPlugin>();

            foreach (var plugin in serverPlugins)
            {
                var newInstance = CreatePluginInstance(plugin);
                if (newInstance != null)
                {
                    plugins.Add(newInstance);
                }
            }

            var server = new DeviceServer(config, plugins);

            server.Started += Server_Started;
            server.Stopped += Server_Stopped;
            devices.Add(server);
            server.Start();

            UpdateLoginInformation(server);
        }
Пример #3
0
 private void UpdateLoginInformation(DeviceServer server)
 {
     if (CurrentUser != null) server.SendPluginData("USER_LOGIN", CurrentUser);
     else server.SendPluginData("USER_LOGIN", null);
 }
Пример #4
0
        private void StartDeviceServer(object obj)
        {
            var config = (DeviceConfiguration)obj;

            var plugins = new List<IServerPlugin>();

            foreach (var plugin in serverPlugins)
            {
                var newInstance = CreatePluginInstance(plugin);
                if (newInstance != null) plugins.Add(newInstance);
            }

            var server = new DeviceServer(config, plugins);
            server.Started += Server_Started;
            server.Stopped += Server_Stopped;
            devices.Add(server);
            server.Start();

            UpdateLoginInformation(server);
        }
Пример #5
0
 private void Server_Stopped(DeviceServer server)
 {
     Logger.Log(server.Configuration.UniqueId + " :: Device Stopped");
 }
Пример #6
0
 private void Server_Stopped(DeviceServer server)
 {
     logger.Info(server.Configuration.UniqueId + " :: Device Stopped");
 }
Пример #7
0
 private void Server_Started(DeviceServer server)
 {
     Logger.Log(server.Configuration.UniqueId + " :: Device Started");
 }