Beispiel #1
0
            public CopyPasteData(CompWirelessPower comp)
            {
                ChannelId   = comp?.Channel?.Id ?? -1;
                TargetPower = comp?.TargetWatts ?? 0;
                Type        = comp?.Type ?? WirelessType.None;

                channel = ChannelId == -1 ? null : comp?.Manager?.TryGetChannel(ChannelId);
            }
Beispiel #2
0
        public int CreateNewChannel(string name)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                Core.Error($"Null or blank name in WirelessPower.CreateNewChannel(): {name ?? "<null>"}");
                return(-1);
            }

            int newId = maxId + 1;

            maxId++;
            var channel = new PowerChannel {
                Id = newId, Name = name.Trim()
            };

            channels.Add(channel.Id, channel);
            return(newId);
        }