Пример #1
0
        private void FillDetectorsRow(string[] dets)
        {
            var chacs = new CheckedArrayControl <int> [dets.Length];

            for (int i = 0; i < chacs.Length; ++i)
            {
                chacs[i] = new CheckedArrayControl <int>(_assignedContainers.Keys.ToArray(), multiSelection: true)
                {
                    Name = dets[i], Text = dets[i]
                };
                chacs[i].SelectionChanged   += SamplesToDetectorsForm_SelectionChanged;
                chacs[i].checkedListBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            }

            _detsCheckedArray = new ControlsGroupBox(chacs, vertical: false)
            {
                Dock = DockStyle.Fill, Name = "ContToDetsGroupBox"
            };

            tableLayoutPanelMain.Controls.Add(_detsCheckedArray, 0, 1);
        }
        private void InitializeMeasurementsParamsControls()
        {
            try
            {
                DurationControl           = new DurationControl();
                CheckedHeightArrayControl = new CheckedArrayControl <float?>(new float?[] { 2.5f, 5f, 10f, 20f })
                {
                    Name = "CheckedArrayControlHeights"
                };
                CheckedHeightArrayControl.checkedListBox.ColumnWidth = 70;

                buttonShowAcqQueue = new Button()
                {
                    AutoSize = false, Dock = DockStyle.Fill, Name = "buttonShowAcqQueue", Enabled = false
                };
                controlsMeasParams = new ControlsGroupBox(new Control[] { DurationControl, CheckedHeightArrayControl, buttonShowAcqQueue })
                {
                    Name = "controlsMeasParams"
                };
                controlsMeasParams._tableLayoutPanel.RowStyles[0].Height = 37.5F;
                controlsMeasParams._tableLayoutPanel.RowStyles[1].Height = 37.5F;
                controlsMeasParams._tableLayoutPanel.RowStyles[2].Height = 25F;
                mainForm.FunctionalLayoutPanel.Controls.Add(controlsMeasParams, 1, 0);

                DurationControl.DurationChanged            += (s, e) => mainForm.MainRDGV.FillDbSetValues("Duration", (int)DurationControl.Duration.TotalSeconds);
                CheckedHeightArrayControl.SelectionChanged += (s, e) => mainForm.MainRDGV.FillDbSetValues("Height", CheckedHeightArrayControl.SelectedItem);

                buttonShowAcqQueue.Click += ButtonShowAcqQueue_Click;
            }
            catch (Exception ex)
            {
                Report.Notify(new RCM.Message(Codes.ERR_UI_WF_INI_MEAS_PARAMS)
                {
                    DetailedText = ex.ToString()
                });
            }
        }
Пример #3
0
        private void InitializeIrradiationsParamsControls()
        {
            try
            {
                DurationControl       = new DurationControl();
                TimePicker            = new DateTimePicker();
                TimePicker.Format     = DateTimePickerFormat.Time;
                TimePicker.ShowUpDown = true;
                TimePicker.Dock       = DockStyle.Fill;
                TimePicker.Font       = new Font("Microsoft Sans Serif", 14F, FontStyle.Regular, GraphicsUnit.Point);
                controlsTimeChanged   = new ControlsGroupBox(new Control[] { TimePicker })
                {
                    Name = "controlsTimeChanged"
                };
                CheckedContainerArrayControl = new CheckedArrayControl <short?>(new short?[] { 1, 2, 3, 4, 5, 6, 7, 8 }, multiSelection: false)
                {
                    Name = "CheckedArrayControlContainers"
                };
                buttonAssingNowDateTime = new Button()
                {
                    AutoSize = false, Dock = DockStyle.Fill, Name = "buttonAssingNowDateTime"
                };
                CheckedContainerArrayControl.SelectItem(1);
                CheckedContainerArrayControl.checkedListBox.ColumnWidth = 70;
                controlsIrrParams = new ControlsGroupBox(new Control[] { DurationControl, controlsTimeChanged, buttonAssingNowDateTime, CheckedContainerArrayControl })
                {
                    Name = "controlsIrrParams"
                };

                controlsIrrParams._tableLayoutPanel.RowStyles[0].Height = 30F;
                controlsIrrParams._tableLayoutPanel.RowStyles[1].Height = 25F;
                controlsIrrParams._tableLayoutPanel.RowStyles[2].Height = 30F;
                //controlsIrrParams._tableLayoutPanel.RowStyles[3].Height = 15F;

                buttonMoveUpInContainer = new Button()
                {
                    AutoSize = false, Dock = DockStyle.Fill, Name = "buttonMoveUpInContainer"
                };
                buttonMoveDownInContainer = new Button()
                {
                    AutoSize = false, Dock = DockStyle.Fill, Name = "buttonMoveDownInContainer"
                };

                buttonMoveUpInContainer.Click   += (s, e) => { ChangeIrraditionPositionInContainer(mainForm.MainRDGV.SelectedCells, Direction.Negative); };
                buttonMoveDownInContainer.Click += (s, e) => { ChangeIrraditionPositionInContainer(mainForm.MainRDGV.SelectedCells, Direction.Positive); };

                controlsMovingInContainer = new ControlsGroupBox(new Control[] { buttonMoveUpInContainer, buttonMoveDownInContainer })
                {
                    Name = "controlsMovingInContainer"
                };

                controlsMovingInContainer._tableLayoutPanel.RowStyles[0].Height = 10F;
                controlsMovingInContainer._tableLayoutPanel.RowStyles[1].Height = 10F;

                _comboBoxRepackers = new ComboBox()
                {
                    Name = "comboBoxRepackers"
                };
                _comboBoxRepackers.Dock = DockStyle.Fill;
                _comboBoxRepackers.Font = new Font("Microsoft Sans Serif", 16F, FontStyle.Regular, GraphicsUnit.Point);
                _comboBoxRepackers.SelectedIndexChanged += (s, e) => { mainForm.MainRDGV.FillDbSetValues("Rehandler", _logId[_comboBoxRepackers.SelectedItem.ToString()]); };

                controlsRepack = new ControlsGroupBox(new Control[] { _comboBoxRepackers })
                {
                    Name = "controlsRepack"
                };


                mainForm.FunctionalLayoutPanel.Controls.Add(controlsIrrParams, 1, 0);
                mainForm.FunctionalLayoutPanel.Controls.Add(controlsRepack, 2, 0);

                mainForm.buttonsRegForm._tableLayoutPanel.Controls.RemoveAt(3);;
                mainForm.buttonsRegForm._tableLayoutPanel.Controls.Add(controlsMovingInContainer);

                DurationControl.DurationChanged += (s, e) =>
                {
                    mainForm.MainRDGV.FillDbSetValues("Duration", (int)DurationControl.Duration.TotalSeconds);
                    FillDateTimeFinish();
                };


                CheckedContainerArrayControl.SelectionChanged += CheckedContainerArrayControl_SelectionChanged;
#if NETFRAMEWORK
                switch (_irrType)
                {
                case IrradiationType.sli:
                    DurationControl.Duration = TimeSpan.FromSeconds(Settings <IrradiationSettings> .CurrentSettings.DefaultSLITime);
                    break;

                case IrradiationType.lli:
                    DurationControl.Duration = TimeSpan.FromSeconds(Settings <IrradiationSettings> .CurrentSettings.DefaultLLITime);
                    break;

                default:
                    DurationControl.Duration = TimeSpan.FromSeconds(0);
                    break;
                }
                ;
#else
                DurationControl.Duration = _irrType switch
                {
                    IrradiationType.sli => TimeSpan.FromSeconds(Settings <IrradiationSettings> .CurrentSettings.DefaultSLITime),
                    IrradiationType.lli => TimeSpan.FromSeconds(Settings <IrradiationSettings> .CurrentSettings.DefaultLLITime),
                    _ => TimeSpan.FromSeconds(0),
                };
#endif

                CheckedContainerArrayControl.SelectItem(1);

                // TODO: add rehandler column and mapping from name to int
                buttonAssingNowDateTime.Click += (s, e) =>
                {
                    mainForm.MainRDGV.FillDbSetValues("DateTimeStart", DateTime.Now);
                    FillDateTimes(null);
                    mainForm.MainRDGV.FillDbSetValues("Assistant", _uid);
                    //FillDateTimeFinish();
                };
            }
            catch (Exception ex)
            {
                Report.Notify(new RCM.Message(Codes.ERR_UI_WF_INI_MEAS_PARAMS)
                {
                    DetailedText = ex.ToString()
                });
            }
        }
        private void InitializeMeasurementsControls()
        {
            try
            {
                buttonStop = new Button()
                {
                    Name = "buttonStop", Dock = DockStyle.Fill, UseVisualStyleBackColor = true, BackColor = Color.Red
                };
                buttonClear = new Button()
                {
                    Name = "buttonClear", Dock = DockStyle.Fill, UseVisualStyleBackColor = true, BackColor = Color.White
                };
                buttonPause = new Button()
                {
                    Name = "buttonPause", Dock = DockStyle.Fill, UseVisualStyleBackColor = true, BackColor = Color.Yellow
                };
                buttonStart = new Button()
                {
                    Name = "buttonStart", Dock = DockStyle.Fill, UseVisualStyleBackColor = true, BackColor = Color.Green
                };

                buttonStop.Click  += ButtonStop_Click;
                buttonStart.Click += ButtonStart_Click;
                buttonClear.Click += ButtonClear_Click;
                buttonPause.Click += ButtonPause_Click;

                MeasurementsStartPanel             = new TableLayoutPanel();
                MeasurementsStartPanel.ColumnCount = 2;
                MeasurementsStartPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
                MeasurementsStartPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
                MeasurementsStartPanel.Name     = "MeasurementsStartPanel";
                MeasurementsStartPanel.RowCount = 2;
                MeasurementsStartPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 50F));
                MeasurementsStartPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 50F));
                MeasurementsStartPanel.Dock = DockStyle.Fill;

                MeasurementsStartPanel.Controls.Add(buttonStop, 0, 0);
                MeasurementsStartPanel.Controls.Add(buttonClear, 1, 0);
                MeasurementsStartPanel.Controls.Add(buttonPause, 0, 1);
                MeasurementsStartPanel.Controls.Add(buttonStart, 1, 1);

                CheckedAvailableDetectorArrayControl = new CheckedArrayControl <string>(new string[0])
                {
                    Name = "CheckedAvailableDetectorArrayControl"
                };

                controlsMeasControl = new ControlsGroupBox(new Control[] { CheckedAvailableDetectorArrayControl, MeasurementsStartPanel })
                {
                    Name = "controlsMeasControl"
                };

                mainForm.FunctionalLayoutPanel.Controls.Add(controlsMeasControl, 2, 0);

                CheckedAvailableDetectorArrayControl.SelectionChanged += (s, e) => mainForm.MainRDGV.FillDbSetValues("Detector", CheckedAvailableDetectorArrayControl.SelectedItem);
            }
            catch (Exception ex)
            {
                Report.Notify(new RCM.Message(Codes.ERR_UI_WF_INI_MEAS_CONTR)
                {
                    DetailedText = ex.ToString()
                });
            }
        }
Пример #5
0
 private void InitializeComponents()
 {
     listView1            = new ListView();
     chooseFilesButton    = new ToolStripMenuItem();
     uploadAllButton      = new ToolStripMenuItem();
     uploadNotExistButton = new ToolStripMenuItem();
     openFileDialog1      = new OpenFileDialog();
     CancelMenuButton     = new ToolStripMenuItem();
     groupBoxMain         = new ControlsGroupBox(new Control[] { listView1 });
     SuspendLayout();
     //
     // listView1
     //
     listView1.Anchor = ((AnchorStyles)((((AnchorStyles.Top | AnchorStyles.Bottom)
                                          | AnchorStyles.Left)
                                         | AnchorStyles.Right)));
     listView1.HideSelection = false;
     listView1.Location      = new Point(12, 76);
     listView1.Name          = "listView1";
     listView1.Size          = new Size(1020, 368);
     listView1.TabIndex      = 0;
     listView1.UseCompatibleStateImageBehavior = false;
     //
     // chooseFilesButton
     //
     chooseFilesButton.Name = "chooseFilesButton";
     chooseFilesButton.Size = new Size(194, 58);
     //chooseFilesButton.Text = "Выбрать файлы для загрузки";
     chooseFilesButton.Click += new System.EventHandler(chooseFilesButton_Click);
     //
     // uploadAllButton
     //
     uploadAllButton.Name = "uploadAllButton";
     uploadAllButton.Size = new Size(344, 58);
     //uploadAllButton.Text = "Загрузить и перезаписать все выбранные файлы в облачное хранилище";
     uploadAllButton.Click += new System.EventHandler(uploadAllButton_Click);
     //
     // uploadNotExistButton
     //
     uploadNotExistButton.Name = "uploadNotExistButton";
     uploadNotExistButton.Size = new Size(226, 58);
     //uploadNotExistButton.Text = "Загрузить только недостающие файлы";
     uploadNotExistButton.Click += new System.EventHandler(uploadNotExistButton_Click);
     //
     // openFileDialog1
     //
     openFileDialog1.FileName         = "openFileDialog1";
     openFileDialog1.Filter           = "Spectra files|*.cnf";
     openFileDialog1.Multiselect      = true;
     openFileDialog1.RestoreDirectory = true;
     //
     // CancelMenuButton
     //
     CancelMenuButton.Name = "CancelMenuButton";
     CancelMenuButton.Size = new Size(238, 58);
     //CancelMenuButton.Text = "Отменить загрузку";
     CancelMenuButton.Click += new System.EventHandler(CancelMenuButton_Click);
     //
     // FaceForm
     //
     AutoScaleDimensions = new SizeF(6F, 13F);
     AutoScaleMode       = AutoScaleMode.Font;
     ClientSize          = new Size(1044, 450);
     MenuStrip.Items.Insert(0, CancelMenuButton);
     MenuStrip.Items.Insert(0, uploadNotExistButton);
     MenuStrip.Items.Insert(0, uploadAllButton);
     MenuStrip.Items.Insert(0, chooseFilesButton);
     Controls.Add(groupBoxMain);
     Name = "ShareSpectraForm";
     //Text = "Загрузка спектров в облачное хранилище";
     ResumeLayout(false);
 }
Пример #6
0
        private void Initialize()
        {
            InitializeComponent();
            InitializeMainTable();

            ProgressBar          = new ToolStripProgressBar();
            groupBoxMainRDGV     = new GroupBox();
            MainTableLayoutPanel = new TableLayoutPanel();
            BottomLayoutPanel    = new TableLayoutPanel();

            MainTableLayoutPanel.SuspendLayout();
            BottomLayoutPanel.SuspendLayout();
            groupBoxMainRDGV.SuspendLayout();
            base.SuspendLayout();
            SuspendLayout();

            //
            // MainTableLayoutPanel
            //
            MainTableLayoutPanel.ColumnCount = 1;
            MainTableLayoutPanel.Name        = "MainTableLayoutPanel";
            MainTableLayoutPanel.RowCount    = 2;
            MainTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 60F));
            MainTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 40F));
            MainTableLayoutPanel.TabIndex = 25;
            MainTableLayoutPanel.Dock     = DockStyle.Fill;
            MainTableLayoutPanel.Controls.Add(groupBoxMainRDGV, 0, 0);
            MainTableLayoutPanel.AutoScroll = true;


            //
            // groupBoxMainRDGV
            //
            groupBoxMainRDGV.Dock     = DockStyle.Fill;
            groupBoxMainRDGV.Font     = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point);
            groupBoxMainRDGV.Name     = "groupBoxMainRDGV";
            groupBoxMainRDGV.TabIndex = 0;
            groupBoxMainRDGV.TabStop  = false;
            groupBoxMainRDGV.Text     = "groupBoxMainRDGV";
            groupBoxMainRDGV.Controls.Add(MainRDGV);

            //
            // ProgressBar
            //
            ProgressBar.Name      = "ProgressBar";
            ProgressBar.Size      = new Size(150, 22);
            ProgressBar.Alignment = ToolStripItemAlignment.Right;
            ProgressBar.Minimum   = 0;
            ProgressBar.Step      = 1;

            FunctionalLayoutPanel = new TableLayoutPanel();
            FunctionalLayoutPanel.SuspendLayout();
            FunctionalLayoutPanel.ColumnCount = 3;
            FunctionalLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33F));
            FunctionalLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33F));
            FunctionalLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33F));
            FunctionalLayoutPanel.Dock     = DockStyle.Fill;
            FunctionalLayoutPanel.Name     = "FunctionalLayoutPanel";
            FunctionalLayoutPanel.TabIndex = 25;

            buttonRemoveSelectedSamples = new Button()
            {
                AutoSize = false, Dock = DockStyle.Fill, Name = "buttonRemoveSelectedSamples", Enabled = false
            };
            buttonAddSelectedSamplesToReg = new Button()
            {
                AutoSize = false, Dock = DockStyle.Fill, Name = "buttonAddSelectedSamplesToReg", Enabled = false
            };
            buttonClearRegister = new Button()
            {
                AutoSize = false, Dock = DockStyle.Fill, Name = "buttonClearRegister", Enabled = false
            };
            buttonAddAllSamples = new Button()
            {
                AutoSize = false, Dock = DockStyle.Fill, Name = "buttonAddAllSamples", Enabled = false
            };
            buttonsRegForm = new ControlsGroupBox(new Button[] { buttonAddSelectedSamplesToReg, buttonAddAllSamples, buttonRemoveSelectedSamples, buttonClearRegister })
            {
                Name = "buttonsRegFormBox"
            };
            buttonsRegForm.groupBoxTitle.Dock = DockStyle.Fill;

            FunctionalLayoutPanel.Controls.Add(buttonsRegForm, 0, 0);


            //
            // BottomLayoutPanel
            //
            BottomLayoutPanel.ColumnCount = 2;
            BottomLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
            BottomLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
            BottomLayoutPanel.Dock     = DockStyle.Fill;
            BottomLayoutPanel.Name     = "BottomLayoutPanel";
            BottomLayoutPanel.RowCount = 1;
            BottomLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent));
            BottomLayoutPanel.TabIndex = 26;
            BottomLayoutPanel.Controls.Add(FunctionalLayoutPanel, 1, 0);
            BottomLayoutPanel.Margin = new Padding(5, 5, 5, StatusStrip.Height);
            MainTableLayoutPanel.Controls.Add(BottomLayoutPanel, 0, 1);

            //
            // RegisterForm
            //
            AutoScaleDimensions = new SizeF(7F, 15F);
            AutoScaleMode       = AutoScaleMode.Font;
            MinimumSize         = new Size(2300, 1300);
            base.MinimumSize    = MinimumSize;
            StartPosition       = FormStartPosition.CenterScreen;
            Margin     = new Padding(4, 3, 4, 3);
            AutoScroll = true;

            Controls.Add(MainTableLayoutPanel);

            MainMenuStrip = MenuStrip;

            Name = "RegisterForm";
            Text = "RegisterForm";

            groupBoxMainRDGV.ResumeLayout(false);
            MainTableLayoutPanel.ResumeLayout(false);
            FunctionalLayoutPanel.ResumeLayout(false);
            BottomLayoutPanel.ResumeLayout(false);

            ResumeLayout(false);
            PerformLayout();
            base.ResumeLayout(false);
            base.PerformLayout();
        }