2 using System.Collections;
3 using System.Collections.Generic;
4 using System.ComponentModel;
8 using System.Windows.Forms;
10 namespace SeciUserInterface.Dialogs.VIs
14 private Boolean _isSubconfig =
false;
17 public SetVIProperties(Seci.SerialisableList<Seci.LabView.LabViewPanelInfo> panels, Boolean isSubconfig)
19 InitializeComponent();
21 _isSubconfig = isSubconfig;
30 foreach (DataGridViewColumn i
in dataGridView1.Columns)
32 i.SortMode = DataGridViewColumnSortMode.NotSortable;
38 for (
int i = 0; i < Panels.Count; ++i)
41 String temp = Panels[i].FilePath;
43 if (String.IsNullOrEmpty(Panels[i].OwningComponent) || _isSubconfig)
45 dataGridView1.Rows.Add(temp.Substring(temp.LastIndexOf(
"\\") + 1), Panels[i].StartRunning, Panels[i].ShowPanel, colDelayAfter.Items[Panels[i].DelayAfter], i);
53 if (dataGridView1.Rows.Count > 0)
55 if (dataGridView1.CurrentRow.Index != -1 && dataGridView1.CurrentRow.Index != 0)
57 int row = dataGridView1.CurrentRow.Index;
59 int vi = (int)dataGridView1.CurrentRow.Cells[4].Value;
60 int viAbove = (
int)dataGridView1.Rows[dataGridView1.CurrentRow.Index -1].Cells[4].Value;
63 UpdateRowSettings(row, vi);
64 UpdateRowSettings(row - 1, viAbove);
68 Panels[viAbove] = Panels[vi];
72 dataGridView1.Rows.Clear();
75 dataGridView1.CurrentCell = dataGridView1.Rows[row - 1].Cells[0];
83 if (dataGridView1.Rows.Count > 0)
85 if (dataGridView1.CurrentRow.Index != -1 && dataGridView1.CurrentRow.Index != dataGridView1.Rows.Count - 1)
87 int row = dataGridView1.CurrentRow.Index;
89 int vi = (int)dataGridView1.CurrentRow.Cells[4].Value;
90 int viBelow = (
int)dataGridView1.Rows[dataGridView1.CurrentRow.Index + 1].Cells[4].Value;
93 UpdateRowSettings(row, vi);
94 UpdateRowSettings(row + 1, viBelow);
98 Panels[viBelow] = Panels[vi];
102 dataGridView1.Rows.Clear();
105 dataGridView1.CurrentCell = dataGridView1.Rows[row + 1].Cells[0];
112 for (
int i = 0; i < dataGridView1.Rows.Count; ++i)
114 int viIndex = (int)dataGridView1.Rows[i].Cells[4].Value;
115 UpdateRowSettings(i, viIndex);
118 DialogResult = DialogResult.OK;
125 Panels[vi].StartRunning = (Boolean)dataGridView1.Rows[row].Cells[1].Value;
126 if (String.IsNullOrEmpty(Panels[dataGridView1.CurrentCell.RowIndex].Group))
128 Panels[vi].ShowPanel = (Boolean)dataGridView1.Rows[row].Cells[2].Value;
132 Panels[vi].ShowPanel =
true;
134 Panels[vi].DelayAfter = Convert.ToInt16(dataGridView1.Rows[row].Cells[3].Value);
139 DialogResult = DialogResult.Cancel;
145 if (dataGridView1.CurrentCell.ColumnIndex == dataGridView1.Columns[
"colVisible"].Index)
147 if (!String.IsNullOrEmpty(Panels[dataGridView1.CurrentCell.RowIndex].Group) && !((bool)dataGridView1.CurrentCell.EditedFormattedValue))
149 MessageBox.Show(
"This VI is currently in a tab and cannot be hidden",
"Invalid Action", MessageBoxButtons.OK, MessageBoxIcon.Information);
151 dataGridView1.CurrentCell.Value =
true;
void btnDown_Click(object sender, EventArgs e)
void btnOK_Click(object sender, EventArgs e)
void btnUp_Click(object sender, EventArgs e)
SetVIProperties(Seci.SerialisableList< Seci.LabView.LabViewPanelInfo > panels, Boolean isSubconfig)
void btnCancel_Click(object sender, EventArgs e)
void UpdateRowSettings(int row, int vi)
This class contains all the information about a LabVIEW VI that needs to be saved in the configuratio...
void SetVIProperties_Load(object sender, EventArgs e)
void dataGridView1_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)