Exemplo n.º 1
0
 public async Task <IActionResult> GetChannelTask([FromRoute] string id, [FromRoute] int portNumber)
 {
     return(await ExecFunction(id, device =>
     {
         var chanel = _deviceQueries.GetChannelAsync(device.Id, portNumber).Result;
         ChannelTypeEnum type = (ChannelTypeEnum)chanel.PortType;
         return _skynetTerminalClient.RdChannelTask(type, device.EquipNum);
     }, "task"));
 }
Exemplo n.º 2
0
        public Channel(string name, ushort maxPlayers, ChannelTypeEnum typechannel, byte id)
        {
            Name       = name;
            MaxPlayers = maxPlayers;
            Id         = id;
            Flag       = typechannel;

            //Games = new GameCollection(this);
            Players = new GenericDisposableCollection <Player>();
            Lobby   = new LobbyManager(this);
        }
        public RegisteredChannel(IChannel channel)
        {
            this.Channel = channel ?? throw new ArgumentNullException(nameof(channel));

            if (channel is IChannelSender)
            {
                flags |= ChannelTypeEnum.Sender;
            }

            if (channel is IChannelReciever)
            {
                flags |= ChannelTypeEnum.Reciever;
            }
        }
Exemplo n.º 4
0
 public static CommonParser<CanonChannelMonitor> GetParser(ChannelTypeEnum type,
                                                            int channelId,
                                                            string url,
                                                            string uploadDir,
                                                            string additional)
 {
     switch (type)
     {
         case ChannelTypeEnum.XML:
             CanonChannelImportXml<CanonChannelMonitor> parser = new CanonChannelImportXml<CanonChannelMonitor>(channelId,
                                                                   url,
                                                                   uploadDir);
             parser.AdditionalCommand = additional;
             return parser;
         case ChannelTypeEnum.CSV:
             throw new NotSupportedException("Requested type of parser is not supported. Please see Enums table is DB.");
         default:
             throw new NotSupportedException("Requested type of parser is not supported. Please see Enums table is DB.");
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// Set up simple channel
 /// </summary>
 /// <param name="channelId">Id of the channel, default 1</param>
 /// <param name="distributorId">Id of the distributor, default 1</param>
 /// <param name="channelType">The channel type, default Channel</param>
 /// <param name="name">The name of the channel, default "Expedia Gold"</param>
 /// <param name="shortName">The short name of the channel, default "exp-gold"</param>
 /// <param name="commission">The amount of commission, default 15.00</param>
 /// <param name="allowProviderOptOut">True if provider can opt out, default true</param>
 /// <param name="displaySequence">The display order of channels, default 1</param>
 /// <param name="requiresMembership">True is channel requires membership, default false</param>
 /// <param name="channelStatus">The status of the channel, default Active</param>
 /// <returns>A new channel object</returns>
 public static Channel BuildChannel(int channelId = 1, long distributorId = 1, ChannelTypeEnum channelType = ChannelTypeEnum.Channel,
                                   string name = "Expedia Gold", string shortName = "exp-gold", decimal commission = 15,
                                   bool allowProviderOptOut = true, int displaySequence = 1, bool requiresMembership = false,
                                   ChannelStatusEnum channelStatus = ChannelStatusEnum.Active)
 {
     return new Channel
     {
         Id = channelId,
         DistributorId = distributorId,
         EcomBusinessAccountId = Guid.NewGuid(),
         AllowProviderOptOut = allowProviderOptOut,
         Name = name,
         ShortName = shortName,
         Commission = commission,
         DisplaySequence = displaySequence,
         RequiresMembership = requiresMembership,
         ChannelType = channelType,
         ChannelStatus = channelStatus
     };
 }
Exemplo n.º 6
0
        public static CommonParser <CanonChannelMonitor> GetParser(ChannelTypeEnum type,
                                                                   int channelId,
                                                                   string url,
                                                                   string uploadDir,
                                                                   string additional)
        {
            switch (type)
            {
            case ChannelTypeEnum.XML:
                CanonChannelImportXml <CanonChannelMonitor> parser = new CanonChannelImportXml <CanonChannelMonitor>(channelId,
                                                                                                                     url,
                                                                                                                     uploadDir);
                parser.AdditionalCommand = additional;
                return(parser);

            case ChannelTypeEnum.CSV:
                throw new NotSupportedException("Requested type of parser is not supported. Please see Enums table is DB.");

            default:
                throw new NotSupportedException("Requested type of parser is not supported. Please see Enums table is DB.");
            }
        }
Exemplo n.º 7
0
        public async Task <IActionResult> SetChannelTask([FromRoute] string id, [FromRoute] int portNumber, [FromBody] List <ChannelTask> setting)
        {
            //return await ExecFunction(id, device => _skynetTerminalClient.WdChannelTask(type, taskPlan, device.EquipNum), "task");

            return(await ExecFunction(id, device =>
            {
                List <Common.ConfigModel.SkynetTerminal.SkynetTerminalTaskplanDto> taskPlan = new List <Common.ConfigModel.SkynetTerminal.SkynetTerminalTaskplanDto>();
                foreach (var oo in setting)
                {
                    Common.ConfigModel.SkynetTerminal.SkynetTerminalTaskplanDto task = new Common.ConfigModel.SkynetTerminal.SkynetTerminalTaskplanDto()
                    {
                        Number = oo.Index,
                        Enable = oo.Enable,
                        TaskType = oo.Onece ? Common.ConfigModel.Enums.TaskPlanTypeEnum.Once : Common.ConfigModel.Enums.TaskPlanTypeEnum.Evenyday,
                        StartTime = Convert.ToDateTime(oo.Start),
                        EndTime = Convert.ToDateTime(oo.End)
                    };
                    taskPlan.Add(task);
                }
                var chanel = _deviceQueries.GetChannelAsync(device.Id, portNumber).Result;
                ChannelTypeEnum type = (ChannelTypeEnum)chanel.PortType;
                return _skynetTerminalClient.WdChannelTask(type, taskPlan, device.EquipNum);
            }, "task"));
        }
 public ChannelIteratorImpl(ChannelTypeEnum type, List <Channel> channelsList)
 {
     this.type     = type;
     this.channels = channelsList;
 }
 public IChannelIterator iterator(ChannelTypeEnum type)
 {
     return(new ChannelIteratorImpl(type, this.channelsList));
 }
Exemplo n.º 10
0
 public Channel(double freq, ChannelTypeEnum type)
 {
     this.frequency = freq;
     this.TYPE      = type;
 }