Ejemplo n.º 1
0
 public HarvardSyringePumpConfigPanel()
 {
     COMPort = new LabeledControl <ComboBox>(new ComboBox(), "COM Port:");
     Util.EnumerateSerialPorts().ForEach(x => COMPort.Control.Items.Add(x));
     COMPort.Control.SelectedIndexChanged += (s, e) => OnOptionsChanged(s, e);
     Controls.Add(COMPort);
 }
Ejemplo n.º 2
0
        public AndorCameraConfigPanel()
        {
            Dir = new LabeledControl <TextBox>(new TextBox(), "Andor INI Dir:");
            Dir.Control.TextChanged += OnOptionsChanged;
            Dir.Control.TextChanged += (s, e) => Dir.Control.AutoResize();
            Dir.Control.
            Size             = new Size(40, 0);
            Dir.Control.Text = "./";
            var Browse = new Button
            {
                Text         = "...",
                AutoSize     = true,
                AutoSizeMode = AutoSizeMode.GrowAndShrink
            };

            Browse.Click += BrowseDir_Click;
            Dir.Controls.Add(Browse);
            Controls.Add(Dir);

            InitialGain = new LabeledControl <NumericUpDown>(new NumericUpDown(), "Initial Gain:");
            InitialGain.Control.Minimum       = 0;
            InitialGain.Control.Increment     = 1;
            InitialGain.Control.Maximum       = 1024;
            InitialGain.Control.Value         = AndorCamera.DefaultMCPGain;
            InitialGain.Control.ValueChanged += OnOptionsChanged;
            InitialGain.Control.Width         = 54;
            Controls.Add(InitialGain);
        }
Ejemplo n.º 3
0
        public ObjectCommandPanel()
        {
            SuspendLayout();

            AutoSize      = true;
            AutoSizeMode  = AutoSizeMode.GrowAndShrink;
            AutoScaleMode = AutoScaleMode.Inherit;

            Group = new GroupBox
            {
                AutoSize     = true,
                AutoSizeMode = AutoSizeMode.GrowAndShrink,
                Dock         = DockStyle.Fill
            };

            Flow = new FlowLayoutPanel
            {
                FlowDirection = FlowDirection.TopDown,
                AutoSize      = true,
                AutoSizeMode  = AutoSizeMode.GrowAndShrink,
                Dock          = DockStyle.Fill
            };

            _Objects = new LabeledControl <ComboBox>(new ComboBox(), "Device:");
            Objects.DropDownStyle         = ComboBoxStyle.DropDownList;
            Objects.DisplayMember         = "Name";
            Objects.SelectedIndexChanged += OnObjectChanged;
            Flow.Controls.Add(_Objects);

            Group.Controls.Add(Flow);

            Controls.Add(Group);

            ResumeLayout();
        }
Ejemplo n.º 4
0
 public NIConfigPanel()
 {
     NIBoardNumber = new LabeledControl <ComboBox>(new ComboBox(), "Board:");
     NIBoardNumber.Control.DropDownStyle = ComboBoxStyle.DropDownList;
     NIBoardNumber.Control.Items.Add(0);
     NIBoardNumber.Control.SelectedIndexChanged += (s, e) => OnOptionsChanged(s, e);
     Controls.Add(NIBoardNumber);
 }
 public CameraTempControlledConfigPanel()
 {
     Temperature = new LabeledControl <NumericUpDown>(new NumericUpDown(), "Temperature (C):");
     Temperature.Control.Increment     = 1;
     Temperature.Control.Minimum       = -30;
     Temperature.Control.Maximum       = 25;
     Temperature.Control.Value         = LuiHardware.Constants.DefaultTemperature;
     Temperature.Control.ValueChanged += (s, e) => OnOptionsChanged(s, e);
     Controls.Add(Temperature);
 }
Ejemplo n.º 6
0
 public DG535ConfigPanel(LuiOptionsListDialog <IGpibProvider, GpibProviderParameters> GpibOptionsList)
     : this()
 {
     GpibProvider = new LabeledControl <ComboBox>(new ComboBox(), "GPIB Provider:");
     GpibProvider.Control.DisplayMember         = "Name";
     GpibProvider.Control.DropDownStyle         = ComboBoxStyle.DropDownList;
     GpibOptionsList.OptionsChanged            += (s, e) => UpdateProviders(GpibOptionsList);
     GpibOptionsList.ConfigMatched             += (s, e) => UpdateProviders(GpibOptionsList);
     GpibProvider.Control.SelectedIndexChanged += OnOptionsChanged;
     Controls.Add(GpibProvider);
 }
Ejemplo n.º 7
0
 public DG535ConfigPanel()
 {
     GpibAddress = new LabeledControl <ComboBox>(new ComboBox(), "GPIB Address:");
     GpibAddress.Control.DropDownStyle = ComboBoxStyle.DropDownList;
     for (byte b = 0; b < 32; b++)
     {
         GpibAddress.Control.Items.Add(b);
     }
     GpibAddress.Control.SelectedIndexChanged += (s, e) => OnOptionsChanged(s, e);
     Controls.Add(GpibAddress);
 }
Ejemplo n.º 8
0
 public PrologixConfigPanel()
 {
     PrologixCOMPort = new LabeledControl <ComboBox>(new ComboBox(), "COM Port:");
     Util.EnumerateSerialPorts().ForEach(x => PrologixCOMPort.Control.Items.Add(x));
     PrologixCOMPort.Control.SelectedIndexChanged += (s, e) => OnOptionsChanged(s, e);
     PrologixTimeout = new LabeledControl <NumericUpDown>(new NumericUpDown(), "Timeout (ms):");
     PrologixTimeout.Control.Maximum       = 999;
     PrologixTimeout.Control.Increment     = 1;
     PrologixTimeout.Control.ValueChanged += (s, e) => OnOptionsChanged(s, e);
     Controls.Add(PrologixCOMPort);
     Controls.Add(PrologixTimeout);
 }
Ejemplo n.º 9
0
        public BeamFlagsConfigPanel()
        {
            COMPort = new LabeledControl <ComboBox>(new ComboBox(), "COM Port:");
            Util.EnumerateSerialPorts().ForEach(x => COMPort.Control.Items.Add(x));
            COMPort.Control.SelectedIndexChanged += OnOptionsChanged;
            Controls.Add(COMPort);

            Delay = new LabeledControl <NumericUpDown>(new NumericUpDown(), "Delay after open (ms):");
            Delay.Control.Minimum       = 300;
            Delay.Control.Maximum       = 1000;
            Delay.Control.Value         = BeamFlags.DefaultDelay;
            Delay.Control.ValueChanged += OnOptionsChanged;
            Controls.Add(Delay);
        }
Ejemplo n.º 10
0
        public PolarizerConfigPanel()
        {
            COMPort = new LabeledControl <ComboBox>(new ComboBox(), "COM Port:");
            Util.EnumerateSerialPorts().ForEach(x => COMPort.Control.Items.Add(x));
            COMPort.Control.SelectedIndexChanged += OnOptionsChanged;
            Controls.Add(COMPort);

            Delay = new LabeledControl <NumericUpDown>(new NumericUpDown(), "Delay while moving (ms):");
            Delay.Control.Minimum       = 1;
            Delay.Control.Maximum       = 100000; // 2 minute maximum
            Delay.Control.Value         = Polarizer.DefaultDelay;
            Delay.Control.ValueChanged += OnOptionsChanged;
            Controls.Add(Delay);
        }
Ejemplo n.º 11
0
        public ObjectSelectPanel()
        {
            FlowDirection = FlowDirection.LeftToRight;
            AutoSize      = true;
            AutoSizeMode  = AutoSizeMode.GrowAndShrink;

            _Cameras = new LabeledControl <ComboBox>(new ComboBox(), "Camera:");
            Cameras.DropDownStyle         = ComboBoxStyle.DropDownList;
            Cameras.DisplayMember         = "Name";
            Cameras.SelectedIndexChanged += (s, e) => CameraChanged.Raise(s, e);
            Controls.Add(_Cameras);

            _BeamFlags = new LabeledControl <ComboBox>(new ComboBox(), "Beam Flags:");
            BeamFlags.DropDownStyle         = ComboBoxStyle.DropDownList;
            BeamFlags.DisplayMember         = "Name";
            BeamFlags.SelectedIndexChanged += (s, e) => BeamFlagsChanged.Raise(s, e);
            Controls.Add(_BeamFlags);
        }
Ejemplo n.º 12
0
        void Init()
        {
            SuspendLayout();

            LogLevel = new LabeledControl <ComboBox>(new ComboBox(), "Log Level");
            LogLevel.Control.DropDownStyle = ComboBoxStyle.DropDownList;

            var h = (Hierarchy)LogManager.GetRepository();

            foreach (var l in h.LevelMap.AllLevels)
            {
                LogLevel.Control.Items.Add(l.DisplayName);
            }

            LogLevel.Control.SelectedIndexChanged += (s, e) => OnOptionsChanged(s, e);

            Controls.Add(LogLevel);

            ConfigChanged += (s, e) => HandleConfigChanged(s, e);

            ResumeLayout(false);
        }
Ejemplo n.º 13
0
        void Init()
        {
            SuspendLayout();

            #region Object list and configuration panel setup

            var ConfigPanel = new Panel
            {
                Dock = DockStyle.Fill
            };
            Controls.Add(ConfigPanel);

            var ListPanel = new Panel
            {
                Dock = DockStyle.Left
            };
            Controls.Add(ListPanel);

            ObjectView = new OptionsListView
            {
                HeaderStyle = ColumnHeaderStyle.None,
                View = View.Details,
                ShowGroups = false,
                Dock = DockStyle.Top,
                HideSelection = false,
                MultiSelect = false
            };
            ObjectView.Columns.Add(new ColumnHeader());
            ObjectView.Columns[0].Width = ObjectView.Width;
            ObjectView.SelectedIndexChanged += SelectedObjectChanged;
            //ObjectView.ItemSelectionChanged += SelectedObjectChanged;
            AddDummyItem(); // Add the "New..." row.

            var ListControlsPanel = new Panel
            {
                Dock = DockStyle.Top
            };

            #region Buttons

            Add = new Button
            {
                Dock = DockStyle.Left,
                Text = "Add"
            };
            Add.Click += Add_Click;
            Add.Click += (s, e) => OnOptionsChanged(s, e);

            Remove = new Button
            {
                Dock = DockStyle.Left,
                Text = "Remove"
            };
            Remove.Click += Remove_Click;
            Remove.Click += (s, e) => OnOptionsChanged(s, e);

            ListControlsPanel.Controls.Add(Remove);
            ListControlsPanel.Controls.Add(Add);

            #endregion Buttons

            ListPanel.Controls.Add(ListControlsPanel);
            ListPanel.Controls.Add(ObjectView);

            #endregion Object list and configuration panel setup

            #region Configuration panel

            ConfigSubPanel = new Panel
            {
                Dock = DockStyle.Fill
            };
            ConfigPanel.Controls.Add(ConfigSubPanel);

            ObjectTypes = new LabeledControl<ComboBox>(new ComboBox(), "Type:")
            {
                Dock = DockStyle.Top
            };
            ObjectTypes.Control.DropDownStyle = ComboBoxStyle.DropDownList;
            ObjectTypes.Control.DisplayMember = "Name";

            var AvailableTypes = typeof(T).GetSubclasses(true);
            AvailableTypes.Sort((x, y) => x.Name.CompareTo(y.Name));
            AvailableTypes.ForEach(x => { ObjectTypes.Control.Items.Add(x); });
            ObjectTypes.Control.SelectedIndex = 0;
            ObjectTypes.Control.SelectedIndexChanged += SelectedObjectTypeChanged;
            ObjectTypes.Control.SelectionChangeCommitted += OnOptionsChanged; // Caused by user input.

            ObjectName = new LabeledControl<TextBox>(new TextBox(), "Name:")
            {
                Dock = DockStyle.Top
            };
            ObjectName.Control.TextChanged += SelectedObjectNameChanged;
            ObjectName.Control.KeyDown += OnOptionsChanged; // Caused by user input.
            ConfigPanel.Controls.Add(ObjectName);
            ConfigPanel.Controls.Add(ObjectTypes);

            #endregion Configuration panel

            ConfigPanels = new Dictionary<Type, LuiObjectConfigPanel<P>>();

            ConfigChanged += HandleConfigChanged;

            ResumeLayout(false);
        }
Ejemplo n.º 14
0
        public CameraConfigPanel()
        {
            SuspendLayout();
            CalFile = new LabeledControl <TextBox>(new TextBox(), "Calibration file:");
            CalFile.Control.MinimumSize  = new Size(40, 0);
            CalFile.Control.Text         = "";
            CalFile.Control.TextChanged += OnOptionsChanged;
            CalFile.Control.TextChanged += (s, e) => CalFile.Control.AutoResize();
            var Browse = new Button
            {
                Text         = "...",
                AutoSize     = true,
                AutoSizeMode = AutoSizeMode.GrowAndShrink
            };

            Browse.Click += Browse_Click;
            CalFile.Controls.Add(Browse);
            Controls.Add(CalFile);

            SaturationLevel = new LabeledControl <NumericUpDown>(new NumericUpDown(), "Saturation level:");
            SaturationLevel.Control.Minimum       = 0;
            SaturationLevel.Control.Maximum       = (int)Math.Pow(2, 16);
            SaturationLevel.Control.ValueChanged += OnOptionsChanged;
            Controls.Add(SaturationLevel);

            var ImagePanel = new FlowLayoutPanel
            {
                FlowDirection = FlowDirection.LeftToRight,
                AutoSize      = true,
                WrapContents  = false
            };

            VBin = new LabeledControl <NumericUpDown>(new NumericUpDown(), "Vertical bin size:");
            VBin.Control.Minimum = -1;
            VBin.Control.Width   = 54;
            VStart = new LabeledControl <NumericUpDown>(new NumericUpDown(), "First row:");
            VStart.Control.Minimum = -1;
            VStart.Control.Width   = VBin.Control.Width;
            //VStart.Control.ValueChanged += VStart_ValueChanged;
            VStart.Control.ValueChanged += OnOptionsChanged;
            VEnd = new LabeledControl <NumericUpDown>(new NumericUpDown(), "Last row:");
            VEnd.Control.Minimum = -1;
            VEnd.Control.Maximum = int.MaxValue;
            VEnd.Control.Width   = VBin.Control.Width;
            //VEnd.Control.ValueChanged += VEnd_ValueChanged;
            VEnd.Control.ValueChanged += OnOptionsChanged;
            ImagePanel.Controls.Add(VBin);
            ImagePanel.Controls.Add(VStart);
            ImagePanel.Controls.Add(VEnd);
            Controls.Add(ImagePanel);

            ReadMode = new LabeledControl <ComboBox>(new ComboBox(), "Read Mode:");
            ReadMode.Control.DropDownStyle = ComboBoxStyle.DropDownList;
            ReadMode.Control.DisplayMember = "Item1";
            ReadMode.Control.ValueMember   = "Item2";
            ReadMode.Control.Items.Add(new Tuple <string, int>("Full Vertical Binning", AndorCamera.ReadModeFVB));
            ReadMode.Control.Items.Add(new Tuple <string, int>("Image", AndorCamera.ReadModeImage));
            ReadMode.Control.SelectedIndex         = 0;
            ReadMode.Control.SelectedIndexChanged += OnOptionsChanged;
            Controls.Add(ReadMode);
            ResumeLayout();
        }