public Channel(ChannelParams args) { mapping = new Dictionary <string, string>(args.mapping); speed = args.speed; string[] splitters = { @" ", @"\n", @"\r", "\t" }; string[] w = args.text.Split(splitters, System.StringSplitOptions.RemoveEmptyEntries); words = new Word[w.Length]; for (int i = 0; i < wordCount; ++i) { Word word = new Word(); word.success = 0; word.skip = false; word.check = true; word.text = w[i].Trim(); word.originalText = word.text; word.invalid = mapping.ContainsKey(word.text.ToLower()); words[i] = word; } for (int i = 0; i < Math.Min(wordCount, 5); ++i) { words[i].check = false; } //Debug.Log(TAG + "word count: " + words.Length); }
public ChannelEditorWnd(ChannelParams channel) { this.InitializeComponent(); this.channel.Frequency = channel.Frequency; this.channel.DatarateRange = channel.DatarateRange; this.channel.Band = channel.Band; this.channelView.Channel = this.channel; }
public AI_Channel(AnalogInChannelsEnum channelName, ref AgilentU254x Driver, ChannelModeSwitch ModeSwitch, Filter ChannelFilter, ProgrammableGainAmplifier ChannelPGA, AnalogInLatch CommonLatch) { _channelName = channelName; _driver = Driver; _modeSwitch = ModeSwitch; Parameters = new ChannelParams(_channelName, ChannelFilter, ChannelPGA, CommonLatch); InitDriverChannel(_channelName, out _channel); ChannelData = new ConcurrentQueue <Point[]>(); }
public void SerializesMessageParamsCorrectly() { ChannelParams channelParams = new ChannelParams { { "rewind", "1" }, { "delta", "delta" } }; ProtocolMessage message = new ProtocolMessage(ProtocolMessage.MessageAction.Attach) { Params = channelParams }; var serialized = Serialize(message); var deserialized = Deserialize(serialized); deserialized.Params.Should().HaveCount(2); deserialized.Params.First().Should().Be(new KeyValuePair <string, string>("rewind", "1")); }
void Start() { randomize = false; media = GetComponent <AudioSource>(); channels = new ChannelParams[files.Length]; for (int i = 0; i < channels.Length; ++i) { ChannelParams pars = new ChannelParams(); pars.speed = speeds[i]; pars.text = files[i].text; pars.mapping = readMapping(mappings[i]); channels[i] = pars; } currentChannel = 1; changeChannel(currentChannel); }