Inheritance: System.Configuration.ConfigurationElement
        private async void SendRequestsToDisplay(DisplayConfig display)
        {
            try
            {
                var lines = GetLinesForDisplay(display);

                logger.Debug("show lines [device: {0}; lines: {1}]",
                    display.DeviceId,
                    String.Join(", ", lines.Select(l => String.Format("[{0}: {1}]", l[0], l[1]))));

                using (var channel = DisplayChannelManager.CreateChannel())
                {
                    await channel.Service.ShowLines(display.DeviceId, lines);
                }
            }
            catch (Exception e)
            {
                logger.Error(e);
            }
        }
        private ushort[][] GetLinesForDisplay(DisplayConfig display)
        {
            var toSend = new List<ushort[]>();
            var workplaces = display.Workplaces
                                    .Cast<WorkplaceConfig>()
                                    .Select(c => c.Number);
            logger.Debug("workplaces: " + String.Join(", ", workplaces));

            foreach (var req in Requests.Where(r => r.Request.State == ClientRequestState.Calling))
            {
                logger.Debug("req.Request.Operator.Workplace.Number: " + req.Request.Operator.Workplace.Number);
                if (display.Workplaces.Count > 0 && !workplaces.Contains(req.Request.Operator.Workplace.Number))
                {
                    continue;
                }

                toSend.Add(new[] { (ushort)req.Request.Operator.Workplace.Number, (ushort)req.Request.Number });
            }

            logger.Debug("GetLinesForDisplay: " + toSend.Count);

            return toSend.ToArray();
        }
Ejemplo n.º 3
0
 public void Add(DisplayConfig element)
 {
     LockItem = false;
     BaseAdd(element);
 }