2 using System.Collections.Generic;
3 using System.ComponentModel;
8 using System.Windows.Forms;
10 namespace SeciUserInterface.Forms
16 private delegate
void UpdateGuiDelegate();
20 InitializeComponent();
26 foreach (DataGridViewColumn i
in dgv1.Columns)
28 i.SortMode = DataGridViewColumnSortMode.NotSortable;
36 _tempBlocks = Seci.Managers.BlockMgr.GetBlocksClone();
39 if (_tempBlocks != null && _tempBlocks.Count > 0)
41 while (dgv1.Rows.Count > _tempBlocks.Count)
44 dgv1.Rows.RemoveAt(dgv1.Rows.Count - 1);
47 while (dgv1.Rows.Count < _tempBlocks.Count)
54 for (
int i = 0; i < _tempBlocks.Count; ++i)
58 String runstatus =
"N/A";
59 String setpoint =
"N/A";
60 Color rowColour = Color.Black;
62 if (temp.UnderRunControl)
71 rowColour = Color.Red;
75 if (temp.WriteControl != null)
77 setpoint = temp.SetPointValue;
82 if (type == Seci.Definitions.ControlType.STRING || type == Seci.Definitions.ControlType.BOOLEAN)
84 dgv1.Rows[i].Cells[0].Value = temp.BlockName;
85 dgv1.Rows[i].Cells[1].Value = temp.CurrentValue.Trim() +
" " + temp.
BlockUnits;
86 dgv1.Rows[i].Cells[2].Value = setpoint;
87 dgv1.Rows[i].Cells[3].Value = temp.UnderRunControl;
88 dgv1.Rows[i].Cells[4].Value = temp.RunControlValue;
89 dgv1.Rows[i].Cells[5].Value =
"";
90 dgv1.Rows[i].Cells[6].Value = runstatus;
91 dgv1.Rows[i].DefaultCellStyle.ForeColor = rowColour;
95 dgv1.Rows[i].Cells[0].Value = temp.BlockName;
96 dgv1.Rows[i].Cells[1].Value = temp.CurrentValue.Trim() +
" " + temp.BlockUnits;
97 dgv1.Rows[i].Cells[2].Value = setpoint;
98 dgv1.Rows[i].Cells[3].Value = temp.UnderRunControl;
99 dgv1.Rows[i].Cells[4].Value = temp.LowerLimit;
100 dgv1.Rows[i].Cells[5].Value = temp.UpperLimit;
101 dgv1.Rows[i].Cells[6].Value = runstatus;
102 dgv1.Rows[i].DefaultCellStyle.ForeColor = rowColour;
114 if (dgv1.CurrentRow != null)
117 EditRunControl edit =
new EditRunControl((Seci.Definitions.BlockInfo)_tempBlocks[dgv1.CurrentRow.Cells[colName.Name].Value.ToString()]);
118 if (edit.ShowDialog() == DialogResult.OK)
120 _tempBlocks[dgv1.CurrentRow.Cells[colName.Name].Value.ToString()] = edit.
Block;
121 Seci.Managers.SeciMgr.PauseThreads();
122 System.Threading.Thread.Sleep(1000);
125 Seci.Managers.BlockMgr.SetBlocks(_tempBlocks);
127 if (Seci.Definitions.Status.UseDaeMonitorVI)
129 Seci.Standard.DaeMonitor.WriteBlockList();
133 Seci.Managers.SeciMgr.ResumeThreads();
135 this.Invoke(
new UpdateGuiDelegate(updateValues), null);
148 if (!backgroundWorker1.IsBusy)
150 backgroundWorker1.RunWorkerAsync();
156 this.Invoke(
new UpdateGuiDelegate(updateValues), null);
166 btnSet_Click(sender, e);
This class is used for storing the information for any blocks that are created and provides methods f...
Specialised version of the Dictionary class which can be converted to XML. Also has some additional s...