SECI  1
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events
AddEditPlot.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Drawing;
6 using System.Linq;
7 using System.Text;
8 using System.Windows.Forms;
9 
10 namespace SeciUserInterface.Dialogs.Graphs
11 {
12  public partial class AddEditPlot : Form
13  {
15 
16  public AddEditPlot()
17  {
18  InitializeComponent();
19  }
20 
21  private void AddEditPlot_Load(object sender, EventArgs e)
22  {
23  if (Seci.Managers.BlockMgr.Blocks != null)
24  {
25  for (int i = 0; i < Seci.Managers.BlockMgr.Blocks.Count; i++)
26  {
27  if (Seci.Managers.BlockMgr.Blocks[i].BlockEnabled)
28  {
29  comBlocks.Items.Add(Seci.Managers.BlockMgr.Blocks[i].BlockName);
30 
31  if (!String.IsNullOrEmpty(Seci.Managers.BlockMgr.Blocks[i].WriteControl))
32  {
33  comBlocks.Items.Add(Seci.Managers.BlockMgr.Blocks[i].BlockName + " (Setpoint)");
34  }
35  }
36 
37  }
38  }
39 
40  //Is edit?
41  if (Plot != null)
42  {
43  comBlocks.SelectedItem = Plot.BlockName;
44  chkUseY2.Checked = Plot.UseY2;
45  }
46  else
47  {
48  chkUseY2.Checked = false;
49  }
50  }
51 
52  private void btnOK_Click(object sender, EventArgs e)
53  {
54  if (comBlocks.SelectedIndex != -1)
55  {
56  Plot = new Seci.Definitions.PlotDefinition(comBlocks.SelectedItem.ToString(), chkUseY2.Checked);
57 
58  DialogResult = DialogResult.OK;
59  Close();
60  }
61  else
62  {
63  MessageBox.Show("Please select a Block.", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
64  }
65  }
66  }
67 }
Lightweight plot definition class.
void btnOK_Click(object sender, EventArgs e)
Definition: AddEditPlot.cs:52
Seci.Definitions.PlotDefinition Plot
Definition: AddEditPlot.cs:14
void AddEditPlot_Load(object sender, EventArgs e)
Definition: AddEditPlot.cs:21