Exemplo n.º 1
0
        /// <summary>
        /// добавляем новый цифровой параметр
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonNewParameter_Click(object sender, EventArgs e)
        {
            try
            {
                SelectParameterForm frm = new SelectParameterForm();
                if (frm.ShowDialog(this) == DialogResult.OK)
                {
                    Parameter sel_parameter = frm.SelectedParameter;
                    if (sel_parameter != null && sel_parameter.Channel != null)
                    {
                        VPanelParameter vp_parameter = new VPanelParameter();
                        //vp_parameter.PNumber = sel_parameter.Channel.Number;
                        vp_parameter.Identifier = sel_parameter.Identifier;
                        n_panel.Items.Add(vp_parameter);

                        InsertNumericParameter(vp_parameter);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message, "Ошибка",
                                MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Exemplo n.º 2
0
        private void buttonSelectFontParameter_Click(object sender, EventArgs e)
        {
            try
            {
                if (listView1.SelectedItems != null && listView1.SelectedItems.Count > 0)
                {
                    ListViewItem selected = listView1.SelectedItems[0];
                    if (selected != null)
                    {
                        VPanelParameter parameter = selected.Tag as VPanelParameter;
                        if (parameter != null)
                        {
                            fontDialog.Font  = parameter.Font;
                            fontDialog.Color = parameter.Color;

                            if (fontDialog.ShowDialog(this) == DialogResult.OK)
                            {
                                parameter.Font  = fontDialog.Font;
                                parameter.Color = fontDialog.Color;
                            }
                        }
                    }
                }
            }
            catch { }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Добавить цифровой параметр в список
        /// </summary>
        /// <param name="parameter">Добавляемый параметр</param>
        protected void InsertNumericParameter(VPanelParameter parameter)
        {
            try
            {
                ListViewItem item = new ListViewItem((listView1.Items.Count + 1).ToString());

                //Parameter par = _app.GetParameter(parameter.PNumber);
                Parameter par = _app.GetParameter(parameter.Identifier);

                if (par != null)
                {
                    ListViewItem.ListViewSubItem name = new ListViewItem.ListViewSubItem(item, par.Name);

                    item.Tag = parameter;
                    item.SubItems.Add(name);

                    listView1.Items.Add(item);
                }
                else
                {
                    /*MessageBox.Show(this, "Данный параметр не может быть добавлен на панель", "Сообщение",
                        MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

                    return;*/
                }

            }
            catch { }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Загрузить числовые параметры
        /// </summary>
        /// <param name="root">Узел в котором числовые параметры</param>
        protected void LoadNumeric(XmlNode root)
        {
            if (root != null && root.HasChildNodes)
            {
                foreach (XmlNode child in root.ChildNodes)
                {
                    switch (child.Name)
                    {
                    case VPanelParameter.rootName:

                        try
                        {
                            VPanelParameter parameter = new VPanelParameter();
                            parameter.Load(child);

                            items.Add(parameter);
                        }
                        catch { }
                        break;

                    default:
                        break;
                    }
                }
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// изменяем параметр
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonEditParameter_Click(object sender, EventArgs e)
        {
            try
            {
                if (listView1.SelectedItems != null && listView1.SelectedItems.Count > 0)
                {
                    VPanelParameter sel_parameter = listView1.SelectedItems[0].Tag as VPanelParameter;
                    if (sel_parameter != null)
                    {
                        SelectParameterForm frm = new SelectParameterForm();
                        if (frm.ShowDialog(this) == DialogResult.OK)
                        {
                            Parameter sel_par = frm.SelectedParameter;
                            if (sel_par != null && sel_par.Channel != null)
                            {
                                //sel_parameter.PNumber = sel_par.Channel.Number;
                                sel_parameter.Identifier = sel_par.Identifier;

                                listView1.SelectedItems[0].SubItems[1].Text = sel_par.Name;
                            }
                        }
                    }
                }
            }
            catch { }
        }
Exemplo n.º 6
0
        /// <summary>
        /// Добавить цифровой параметр в список
        /// </summary>
        /// <param name="parameter">Добавляемый параметр</param>
        protected void InsertNumericParameter(VPanelParameter parameter)
        {
            try
            {
                ListViewItem item = new ListViewItem((listView1.Items.Count + 1).ToString());

                //Parameter par = _app.GetParameter(parameter.PNumber);
                Parameter par = _app.GetParameter(parameter.Identifier);

                if (par != null)
                {
                    ListViewItem.ListViewSubItem name = new ListViewItem.ListViewSubItem(item, par.Name);

                    item.Tag = parameter;
                    item.SubItems.Add(name);

                    listView1.Items.Add(item);
                }
                else
                {
                    /*MessageBox.Show(this, "Данный параметр не может быть добавлен на панель", "Сообщение",
                     *  MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                     *
                     * return;*/
                }
            }
            catch { }
        }
Exemplo n.º 7
0
        protected VPanelParameter v_parameter;  // базовая информация о параметре

        /// <summary>
        /// инициализирует новый экземпляр класса
        /// </summary>
        public VPanelGraphic()
        {
            v_parameter = new VPanelParameter();
            slim        = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);

            units = "[]";
            desc  = "параметр";

            color = SystemColors.Control;//Color.Black;

            _min = 0;
            _max = 65535;
        }
Exemplo n.º 8
0
 private void listView1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (listView1.SelectedItems != null && listView1.SelectedItems.Count > 0)
     {
         ListViewItem sel = listView1.SelectedItems[0];
         if (sel != null)
         {
             VPanelParameter par = sel.Tag as VPanelParameter;
             if (par != null)
             {
                 textBox1.Text = string.Format("{0};{1} pt", par.Font.Name, par.Font.SizeInPoints);
             }
         }
     }
 }
Exemplo n.º 9
0
        /// <summary>
        /// Инициализирует новый экземпляр класса
        /// </summary>
        /// <param name="app">Контекст в котором работает панель</param>
        public DrillingPanel(SgtApplication app)
            : base("Буровая площадка", VPanelType.DrillingFloor)
        {
            _app = app;

            svp = new VPanelParameter();
            m_svp = new VPanelParameter();

            kmb = new VPanelParameter();
            rotor = new VPanelParameter();

            mom1 = new VPanelParameter();
            mom2 = new VPanelParameter();

            app.Technology.onComplete += new EventHandler(Technology_onComplete);
        }
Exemplo n.º 10
0
        protected float splitterDistance = 321;     // геометрия панели

        /// <summary>
        /// Инициализирует новый экземпляр класса
        /// </summary>
        /// <param name="app">Контекст в котором работает панель</param>
        public SolutionPanel(SgtApplication app)
            : base("Параметры бурового раствора", VPanelType.SolutionPanel)
        {
            _app   = app;
            setter = new SetterValue(setterValue);

            plPriemna = new VPanelParameter();
            plBlocka  = new VPanelParameter();

            plEmkOts2 = new VPanelParameter();
            tempVihod = new VPanelParameter();

            temVhod = new VPanelParameter();

            app.Technology.onComplete += new EventHandler(Technology_onComplete);
        }
Exemplo n.º 11
0
        protected float splitterDistance = 324;     // геометрия панели

        /// <summary>
        /// Инициализирует новый экземпляр класса
        /// </summary>
        /// <param name="app">Контекст в котором работает панель</param>
        public DrillingPanel(SgtApplication app)
            : base("Буровая площадка", VPanelType.DrillingFloor)
        {
            _app = app;

            svp   = new VPanelParameter();
            m_svp = new VPanelParameter();

            kmb   = new VPanelParameter();
            rotor = new VPanelParameter();

            mom1 = new VPanelParameter();
            mom2 = new VPanelParameter();

            app.Technology.onComplete += new EventHandler(Technology_onComplete);
        }
Exemplo n.º 12
0
        /// <summary>
        /// удаляем параметр
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                if (listView1.SelectedItems != null && listView1.SelectedItems.Count > 0)
                {
                    VPanelParameter sel_parameter = listView1.SelectedItems[0].Tag as VPanelParameter;
                    if (sel_parameter != null)
                    {
                        n_panel.Items.Remove(sel_parameter);
                        listView1.Items.Remove(listView1.SelectedItems[0]);

                        int number = 1;
                        foreach (ListViewItem item in listView1.Items)
                        {
                            item.Text = number.ToString();
                            number    = number + 1;
                        }
                    }
                }
            }
            catch { }
        }
Exemplo n.º 13
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonNewParameter_Click(object sender, EventArgs e)
        {
            try
            {
                SelectParameterForm frm = new SelectParameterForm();
                if (frm.ShowDialog(this) == DialogResult.OK)
                {
                    Parameter sel_parameter = frm.SelectedParameter;
                    if (sel_parameter != null && sel_parameter.Channel != null)
                    {
                        VPanelParameter vp_parameter = new VPanelParameter();
                        vp_parameter.Identifier = sel_parameter.Identifier;

                        area.Items.Add(vp_parameter);
                        InsertNumericParameter(vp_parameter);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message, "Ошибка",
                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Exemplo n.º 14
0
        /// <summary>
        /// сохранем и принимаем
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void accept_Click(object sender, EventArgs e)
        {
            if (fullPanel == null)
            {
                fullPanel = new FullPanel();
            }

            if (fullPanel != null)
            {
                CopyTo(area.GraphicsGroup_1[0], fullPanel.GPanel_1.Graphic_1);
                CopyTo(area.GraphicsGroup_1[1], fullPanel.GPanel_1.Graphic_2);
                CopyTo(area.GraphicsGroup_1[2], fullPanel.GPanel_1.Graphic_3);
                CopyTo(area.GraphicsGroup_1[3], fullPanel.GPanel_1.Graphic_4);
                CopyTo(area.GraphicsGroup_1[4], fullPanel.GPanel_1.Graphic_5);

                CopyTo(area.GraphicsGroup_2[0], fullPanel.GPanel_2.Graphic_1);
                CopyTo(area.GraphicsGroup_2[1], fullPanel.GPanel_2.Graphic_2);
                CopyTo(area.GraphicsGroup_2[2], fullPanel.GPanel_2.Graphic_3);
                CopyTo(area.GraphicsGroup_2[3], fullPanel.GPanel_2.Graphic_4);
                CopyTo(area.GraphicsGroup_2[4], fullPanel.GPanel_2.Graphic_5);

                CopyTo(area.GraphicsGroup_3[0], fullPanel.GPanel_3.Graphic_1);
                CopyTo(area.GraphicsGroup_3[1], fullPanel.GPanel_3.Graphic_2);
                CopyTo(area.GraphicsGroup_3[2], fullPanel.GPanel_3.Graphic_3);
                CopyTo(area.GraphicsGroup_3[3], fullPanel.GPanel_3.Graphic_4);
                CopyTo(area.GraphicsGroup_3[4], fullPanel.GPanel_3.Graphic_5);

                if (area.Items != null && area.Items.Count > 0)
                {
                    fullPanel.Items.Clear();
                    foreach (VPanelParameter item in area.Items)
                    {
                        if (item != null)
                        {
                            VPanelParameter n_item = new VPanelParameter();

                            n_item.Color = item.Color;
                            n_item.Font = item.Font;

                            n_item.Identifier = item.Identifier;
                            n_item.PNumber = item.PNumber;

                            n_item.Tag = item.Tag;

                            fullPanel.Items.Add(n_item);
                        }
                    }
                }

                fullPanel.VPanelName = textBox31.Text;

                fullPanel.Show_gr1 = area.Show_gr1 = checkBox1.Checked;
                fullPanel.Show_gr2 = area.Show_gr2 = checkBox2.Checked;
                fullPanel.Show_gr3 = area.Show_gr3 = checkBox3.Checked;
            }
        }
Exemplo n.º 15
0
        public FullPanelForm(FullPanel _panel)
        {
            InitializeComponent();

            area = new bufferArea();
            _app = SgtApplication.CreateInstance();

            if (_panel == null)
            {
            }
            else
            {
                fullPanel = _panel;
                fullPanel.UpdateNumeric();

                CopyTo(fullPanel.GPanel_1.Graphic_1, area.GraphicsGroup_1[0]);
                CopyTo(fullPanel.GPanel_1.Graphic_2, area.GraphicsGroup_1[1]);
                CopyTo(fullPanel.GPanel_1.Graphic_3, area.GraphicsGroup_1[2]);
                CopyTo(fullPanel.GPanel_1.Graphic_4, area.GraphicsGroup_1[3]);
                CopyTo(fullPanel.GPanel_1.Graphic_5, area.GraphicsGroup_1[4]);

                CopyTo(fullPanel.GPanel_2.Graphic_1, area.GraphicsGroup_2[0]);
                CopyTo(fullPanel.GPanel_2.Graphic_2, area.GraphicsGroup_2[1]);
                CopyTo(fullPanel.GPanel_2.Graphic_3, area.GraphicsGroup_2[2]);
                CopyTo(fullPanel.GPanel_2.Graphic_4, area.GraphicsGroup_2[3]);
                CopyTo(fullPanel.GPanel_2.Graphic_5, area.GraphicsGroup_2[4]);

                CopyTo(fullPanel.GPanel_3.Graphic_1, area.GraphicsGroup_3[0]);
                CopyTo(fullPanel.GPanel_3.Graphic_2, area.GraphicsGroup_3[1]);
                CopyTo(fullPanel.GPanel_3.Graphic_3, area.GraphicsGroup_3[2]);
                CopyTo(fullPanel.GPanel_3.Graphic_4, area.GraphicsGroup_3[3]);
                CopyTo(fullPanel.GPanel_3.Graphic_5, area.GraphicsGroup_3[4]);

                area.Items.Clear();
                if (fullPanel.Items != null && fullPanel.Items.Count > 0)
                {
                    foreach (VPanelParameter item in fullPanel.Items)
                    {
                        if (item != null)
                        {
                            VPanelParameter n_item = new VPanelParameter();

                            n_item.Color = item.Color;
                            n_item.Font = item.Font;

                            n_item.Identifier = item.Identifier;
                            n_item.PNumber = item.PNumber;

                            n_item.Tag = item.Tag;

                            area.Items.Add(n_item);
                        }
                    }
                }

                checkBox1.Checked = area.Show_gr1 = fullPanel.Show_gr1;
                checkBox2.Checked = area.Show_gr2 = fullPanel.Show_gr2;
                checkBox3.Checked = area.Show_gr3 = fullPanel.Show_gr3;

                numericUpDown1.Value = area.GraphicsGroup_1[0].Width;
                numericUpDown2.Value = area.GraphicsGroup_1[1].Width;
                numericUpDown4.Value = area.GraphicsGroup_1[2].Width;
                numericUpDown3.Value = area.GraphicsGroup_1[3].Width;
                numericUpDown5.Value = area.GraphicsGroup_1[4].Width;

                numericUpDown15.Value = area.GraphicsGroup_2[0].Width;
                numericUpDown14.Value = area.GraphicsGroup_2[1].Width;
                numericUpDown13.Value = area.GraphicsGroup_2[2].Width;
                numericUpDown12.Value = area.GraphicsGroup_2[3].Width;
                numericUpDown11.Value = area.GraphicsGroup_2[4].Width;

                numericUpDown10.Value = area.GraphicsGroup_3[0].Width;
                numericUpDown9.Value = area.GraphicsGroup_3[1].Width;
                numericUpDown8.Value = area.GraphicsGroup_3[2].Width;
                numericUpDown7.Value = area.GraphicsGroup_3[3].Width;
                numericUpDown6.Value = area.GraphicsGroup_3[4].Width;

                textBox31.Text = fullPanel.VPanelName;
            }
        }
Exemplo n.º 16
0
Arquivo: VPanel.cs Projeto: slawer/sgt
        protected float _min; // минимальное значение диапазона

        #endregion Fields

        #region Constructors

        /// <summary>
        /// инициализирует новый экземпляр класса
        /// </summary>
        public VPanelGraphic()
        {
            v_parameter = new VPanelParameter();
            slim = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);

            units = "[]";
            desc = "параметр";

            color = SystemColors.Control;//Color.Black;

            _min = 0;
            _max = 65535;
        }
Exemplo n.º 17
0
        protected TextBox _p9; // Суммарные объем в емкостях

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Инициализирует новый экземпляр класса
        /// </summary>
        /// <param name="app">Контекст в котором работает панель</param>
        public SolutionPanel(SgtApplication app)
            : base("Параметры бурового раствора", VPanelType.SolutionPanel)
        {
            _app = app;
            setter = new SetterValue(setterValue);

            plPriemna = new VPanelParameter();
            plBlocka = new VPanelParameter();

            plEmkOts2 = new VPanelParameter();
            tempVihod = new VPanelParameter();

            temVhod = new VPanelParameter();

            app.Technology.onComplete += new EventHandler(Technology_onComplete);
        }
Exemplo n.º 18
0
        /// <summary>
        /// Загрузить числовые параметры
        /// </summary>
        /// <param name="root">Узел в котором числовые параметры</param>
        protected void LoadNumeric(XmlNode root)
        {
            if (root != null && root.HasChildNodes)
            {
                foreach (XmlNode child in root.ChildNodes)
                {
                    switch (child.Name)
                    {
                        case VPanelParameter.rootName:

                            try
                            {
                                VPanelParameter parameter = new VPanelParameter();
                                parameter.Load(child);

                                items.Add(parameter);
                            }
                            catch { }
                            break;

                        default:
                            break;
                    }
                }
            }
        }