Esempio n. 1
0
        /// <summary>
        /// настраиваем график
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            if (listViewGraphics.SelectedItems != null && listViewGraphics.SelectedItems.Count > 0)
            {
                VPanelGraphic sel_gr = listViewGraphics.SelectedItems[0].Tag as VPanelGraphic;
                if (sel_gr != null)
                {
                    SelectParameterForm frm = new SelectParameterForm();
                    if (frm.ShowDialog(this) == DialogResult.OK)
                    {
                        Parameter sel_par = frm.SelectedParameter;
                        if (sel_par != null)
                        {
                            sel_gr.Identifier  = sel_par.Identifier;
                            sel_gr.Description = sel_par.Description;

                            //sel_gr.Min = sel_par.Range.Min;
                            //sel_gr.Max = sel_par.Range.Max;

                            sel_gr.Units = sel_par.Units;

                            listViewGraphics.SelectedItems[0].SubItems[1].Text = sel_par.Name;
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        public EditNumericPanelForm(NumericPanel edited)
        {
            InitializeComponent();

            _app = SgtApplication.CreateInstance();
            if (edited != null)
            {
                n_panel = edited;

                copy_panelName = n_panel.VPanelName;
                copy_items     = new List <VPanelParameter>();

                foreach (VPanelParameter par in n_panel.Items)
                {
                    copy_items.Add(par);
                }

                copy_gr1 = new VPanelGraphic();
                copy_gr2 = new VPanelGraphic();
                copy_gr3 = new VPanelGraphic();
                copy_gr4 = new VPanelGraphic();
                copy_gr5 = new VPanelGraphic();

                copy_graphic(n_panel.Graphic_1, copy_gr1);
                copy_graphic(n_panel.Graphic_2, copy_gr2);
                copy_graphic(n_panel.Graphic_3, copy_gr3);
                copy_graphic(n_panel.Graphic_4, copy_gr4);
                copy_graphic(n_panel.Graphic_5, copy_gr5);
            }
            else
            {
                n_panel = new NumericPanel(_app);
            }
        }
Esempio n. 3
0
        public EditNumericPanelForm(NumericPanel edited)
        {
            InitializeComponent();

            _app = SgtApplication.CreateInstance();
            if (edited != null)
            {
                n_panel = edited;

                copy_panelName = n_panel.VPanelName;
                copy_items = new List<VPanelParameter>();

                foreach (VPanelParameter par in n_panel.Items)
                {
                    copy_items.Add(par);
                }

                copy_gr1 = new VPanelGraphic();
                copy_gr2 = new VPanelGraphic();
                copy_gr3 = new VPanelGraphic();
                copy_gr4 = new VPanelGraphic();
                copy_gr5 = new VPanelGraphic();

                copy_graphic(n_panel.Graphic_1, copy_gr1);
                copy_graphic(n_panel.Graphic_2, copy_gr2);
                copy_graphic(n_panel.Graphic_3, copy_gr3);
                copy_graphic(n_panel.Graphic_4, copy_gr4);
                copy_graphic(n_panel.Graphic_5, copy_gr5);
            }
            else
                n_panel = new NumericPanel(_app);
        }
Esempio n. 4
0
 /// <summary>
 /// Инициализирует новый экземпляр класса
 /// </summary>
 public GraphicPanel()
 {
     graphic_1 = new VPanelGraphic();
     graphic_2 = new VPanelGraphic();
     graphic_3 = new VPanelGraphic();
     graphic_4 = new VPanelGraphic();
     graphic_5 = new VPanelGraphic();
 }
Esempio n. 5
0
 /// <summary>
 /// Инициализирует новый экземпляр класса
 /// </summary>
 public GraphicPanel()
 {
     graphic_1 = new VPanelGraphic();
     graphic_2 = new VPanelGraphic();
     graphic_3 = new VPanelGraphic();
     graphic_4 = new VPanelGraphic();
     graphic_5 = new VPanelGraphic();
 }
Esempio n. 6
0
        protected int splitterDistance = 325;       // геометрия окна

        /// <summary>
        /// Инициализирует новый экземпляр класса
        /// </summary>
        /// <param name="app">Контекст в котором работает панель</param>
        public NumericPanel(SgtApplication app)
            : base("Цифровая панель", VPanelType.NumericPanel)
        {
            _app  = app;
            items = new List <VPanelParameter>();

            graphic_1 = new VPanelGraphic();
            graphic_2 = new VPanelGraphic();
            graphic_3 = new VPanelGraphic();
            graphic_4 = new VPanelGraphic();
            graphic_5 = new VPanelGraphic();

            _app.Technology.onComplete += new EventHandler(Technology_onComplete);
        }
Esempio n. 7
0
        protected int splitterDistance = 325; // геометрия окна

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Инициализирует новый экземпляр класса
        /// </summary>
        /// <param name="app">Контекст в котором работает панель</param>
        public NumericPanel(SgtApplication app)
            : base("Цифровая панель", VPanelType.NumericPanel)
        {
            _app = app;
            items = new List<VPanelParameter>();

            graphic_1 = new VPanelGraphic();
            graphic_2 = new VPanelGraphic();
            graphic_3 = new VPanelGraphic();
            graphic_4 = new VPanelGraphic();
            graphic_5 = new VPanelGraphic();

            _app.Technology.onComplete += new EventHandler(Technology_onComplete);
        }
Esempio n. 8
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="gr_source"></param>
        /// <param name="gr_destiny"></param>
        protected void copy_graphic(VPanelGraphic gr_source, VPanelGraphic gr_destiny)
        {
            gr_destiny.Color       = gr_source.Color;
            gr_destiny.Description = gr_source.Description;

            gr_destiny.Identifier = gr_source.Identifier;
            gr_destiny.Max        = gr_source.Max;

            gr_destiny.Min       = gr_source.Min;
            gr_destiny.Parameter = gr_source.Parameter;

            gr_destiny.Tag   = gr_source.Tag;
            gr_destiny.Units = gr_source.Units;
        }
Esempio n. 9
0
        /// <summary>
        /// очищаем график
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button4_Click(object sender, EventArgs e)
        {
            if (listViewGraphics.SelectedItems != null && listViewGraphics.SelectedItems.Count > 0)
            {
                VPanelGraphic sel_gr = listViewGraphics.SelectedItems[0].Tag as VPanelGraphic;
                if (sel_gr != null)
                {
                    sel_gr.Identifier  = Guid.Empty;
                    sel_gr.Description = string.Empty;

                    sel_gr.Units = string.Empty;
                }

                listViewGraphics.SelectedItems[0].SubItems[1].Text = string.Empty;
            }
        }
Esempio n. 10
0
        /// <summary>
        /// Скопировать данные
        /// </summary>
        /// <param name="source">Источник</param>
        /// <param name="destination">Приемник</param>
        protected void CopyTo(VPanelGraphic source, VPanelGraphic destination)
        {
            if (source != null && destination != null)
            {
                destination.Color = source.Color;
                destination.Description = source.Description;

                destination.Font = source.Font;
                destination.Identifier = source.Identifier;

                destination.Max = source.Max;
                destination.Min = source.Min;

                destination.Parameter = source.Parameter;
                destination.Tag = source.Tag;

                destination.Units = source.Units;
                destination.Width = source.Width;
            }
        }
Esempio n. 11
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="gr_source"></param>
        /// <param name="gr_destiny"></param>
        protected void copy_graphic(VPanelGraphic gr_source, VPanelGraphic gr_destiny)
        {
            gr_destiny.Color = gr_source.Color;
            gr_destiny.Description = gr_source.Description;

            gr_destiny.Identifier = gr_source.Identifier;
            gr_destiny.Max = gr_source.Max;

            gr_destiny.Min = gr_source.Min;
            gr_destiny.Parameter = gr_source.Parameter;

            gr_destiny.Tag = gr_source.Tag;
            gr_destiny.Units = gr_source.Units;
        }