public MultiBoardSyncDialog(Bonsai.ONIX.ONIContextConfiguration configuration) { InitializeComponent(); Configuration = configuration; using (var c = Bonsai.ONIX.ONIContextManager.ReserveContext(Configuration.Slot)) { int addr = c.Context.HardwareAddress; int sync_channel = addr & 0x000000FF; int sync_mode = (addr & 0x00FF0000) >> 16; groupMode.Controls.Cast <RadioButton>().Where(b => b.TabIndex == sync_mode).ToList().ForEach(b => b.Checked = true); groupChannel.Controls.Cast <RadioButton>().Where(b => b.TabIndex == sync_channel).ToList().ForEach(b => b.Checked = true); } }
public HubConfigurationEditor(Bonsai.ONIX.ONIContextConfiguration configuraiton) { InitializeComponent(); Configuration = configuraiton; using (var c = Bonsai.ONIX.ONIContextManager.ReserveContext(Configuration.Slot)) { hub_state = c.Context.HubState; } radioButtonAStandard.Checked = (hub_state & 0x0001) == 0; radioButtonAPassthrough.Checked = (hub_state & 0x0001) == 1; radioButtonBStandard.Checked = (hub_state & 0x0004) == 0; radioButtonBPassthrough.Checked = (hub_state & 0x0004) == 1; }