//! We update the UI here to reflect the device configuration. void radio_ConfigChanged(object sender, SerialNetConfigEventArgs e) { SerialNetConfig config = e.SerialNetConfig; //! update the UI now that we have a nice config! String hello = ""; RoleComboBox.SelectedIndex = (int)config.role; if (config.autonet) AutoNetworkComboBox.SelectedIndex = 0; else AutoNetworkComboBox.SelectedIndex = 1; PANIDTextBox.Text = config.panIDLong.ToString(); SPANIDTextBox.Text = config.panID.ToString(); ChannelMaskTextBox.Text = config.chMask.ToString(); ChannelTextBox.Text = config.channel.ToString(); ShortAddressTextBox.Text = config.src.ToString(); SNTextBox.Text = config.sn.ToString(); TXPowerTextBox.Text = config.sn.ToString(); //! Update the UI to match the config }
void radio_ConfigChangedSafe(object sender, SerialNetConfigEventArgs e) { this.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, UpdateRadioConfigHandler, this, e); }
void parser_ConfigReceived(object sender, SerialNetConfigEventArgs e) { this.config = e.SerialNetConfig; if (ConfigChanged != null) ConfigChanged(this, new SerialNetConfigEventArgs(this.config)); //!< bubble up the config changed event so the UI can subscribe too. }