/// <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; } } } } }
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); } }
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); }
/// <summary> /// Инициализирует новый экземпляр класса /// </summary> public GraphicPanel() { graphic_1 = new VPanelGraphic(); graphic_2 = new VPanelGraphic(); graphic_3 = new VPanelGraphic(); graphic_4 = new VPanelGraphic(); graphic_5 = new VPanelGraphic(); }
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); }
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); }
/// <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; }
/// <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; } }
/// <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; } }