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);
     }
 }
Beispiel #2
0
        public ONIContextConfigurationEditorDialog(Bonsai.ONIX.ONIContextConfiguration configuration)
        {
            InitializeComponent();

            Configuration = configuration;

            numericUpDownReadSize.DataBindings.Add("Value", Configuration, "ReadSize", false, DataSourceUpdateMode.OnValidation);
            numericUpDownWriteAlloc.DataBindings.Add("Value", Configuration, "WriteSize", false, DataSourceUpdateMode.OnValidation);

            comboBoxDriver.SelectedItem  = Configuration.Slot.Driver;
            numericUpDownPCIeIndex.Value = Configuration.Slot.Index;

            TypeDescriptor.GetProperties(typeof(ONIDevice))[nameof(ONIDevice.DeviceAddress)].SetReadOnlyAttribute(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;
        }