Beispiel #1
0
        public void btReMeasuringSpectr_Click(object sender, EventArgs e)
        {
            try
            {
                if (Selected == null)
                {
                    MessageBox.Show(MainForm.MForm,
                                    Common.MLS.Get(MLSConst, "Выберите спектр который нужно перемерить"),
                                    Common.MLS.Get(MLSConst, "Предупреждение"),
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Warning
                                    );
                    return;
                }

                //LastName = (string)Selected.Text;
                LastPath = SelectedTag.GetPath();
                //LastName

                DialogResult dr = MessageBox.Show(MainForm.MForm,
                                                  Common.MLS.Get(MLSConst, "Вы действительно хотите перемерить спектр: ") + LastPath,
                                                  Common.MLS.Get(MLSConst, "Осторожно!!!"),
                                                  MessageBoxButtons.YesNo,
                                                  MessageBoxIcon.Warning);

                if (dr == DialogResult.No)
                {
                    return;
                }

                CurSp = new Spectr(LastPath);//(Folder, LastName);

                SpectrCondition cond;
                if (DefaultCondition == null)
                {
                    SpectrCondition spc = CurSp.GetMeasuringCondition();
                    cond = SpectrCondEditor.GetCond(MainForm.MForm, spc);
                    if (cond == null)
                    {
                        return;
                    }
                }
                else
                {
                    cond = DefaultCondition;
                }

                Dev.MeasuringResultFinalCall final_call = new Dev.MeasuringResultFinalCall(btReMeasuringSpectr_Click_Final);
                Common.Dev.Measuring(cond, final_call);
            }
            catch (Exception ex)
            {
                Common.Log(ex);
            }
        }
Beispiel #2
0
        public void btMeasuringNewSpectr_Click(object sender, EventArgs e)
        {
            try
            {
                string          name = null;
                SpectrCondition spc;
                if (FirstFileName != null && clSpList.Nodes[0].Nodes.Count == 0)
                {
                    name = FirstFileName;
                    spc  = null;
                }
                else
                {
                    name = util.StringDialog.GetString(MainForm.MForm,
                                                       Common.MLS.Get(MLSConst, "Создание пробы"),
                                                       Common.MLS.Get(MLSConst, "Введите имя новой пробы"),
                                                       "", true);
                }

                if (name == null)
                {
                    return;
                }

                //DbFolder dbf;
                //CSTreeNodeTag selected;
                if (Selected == null)
                {
                    CurTag = new CSTreeNodeTag(Folder, name);
                }
                else
                {
                    CurTag = new CSTreeNodeTag(((CSTreeNodeTag)(Selected.Tag)).Folder, name);
                }
                //List<TreeNode> items = GetItemsList();
                //for (int i = 0; i < clSpList.Items.Count;i++ )
                if (CurTag.IsSpectrExists(name))//clSpList.Items[i].Equals(name))
                {
                    MessageBox.Show(MainForm.MForm,
                                    Common.MLS.Get(MLSConst, "Проба с таким именнем уже сужествует."),
                                    Common.MLS.Get(MLSConst, "Предупреждение"),
                                    MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    return;
                }

                LastPath = CurTag.GetPath();

                if (FirstFileName != null && clSpList.Nodes[0].Nodes.Count != 0)
                {
                    //string path = selected.Folder.CreateRecordPath(name);
                    Spectr sp = new Spectr(CurTag.Folder, FirstFileName);
                    spc = sp.GetMeasuringCondition();
                }
                else
                {
                    spc = null;
                }

                SpectrCondition cond;
                if (DefaultCondition == null)
                {
                    cond = SpectrCondEditor.GetCond(MainForm.MForm, spc);
                    if (cond == null)
                    {
                        return;
                    }
                }
                else
                {
                    cond = DefaultCondition;
                }

                //Spectr sp = new Spectr(cond,Common.Env.DefaultDisp,Common.Env.DefaultOpticFk);
                Dev.MeasuringResultFinalCall final_call = new Dev.MeasuringResultFinalCall(btMeasuringNewSpectr_Click_Final);
                Common.Dev.Measuring(cond, final_call);
            }
            catch (Exception ex)
            {
                Common.Log(ex);
            }
        }