2 using System.Collections;
3 using System.Collections.Generic;
4 using System.ComponentModel;
8 using System.Windows.Forms;
10 namespace Sample_Environment_Control_Interface.Dialogs.VI
18 InitializeComponent();
30 foreach (DataGridViewColumn i
in dataGridView1.Columns)
32 i.SortMode = DataGridViewColumnSortMode.NotSortable;
39 for (
int i = 0; i < tempPanels.Count; ++i)
42 String temp = tempPanels[i].PanelName;
44 dataGridView1.Rows.Add(temp.Substring(temp.LastIndexOf(
"\\") + 1), tempPanels[i].StartRunning, tempPanels[i].ShowPanel, colDelayAfter.Items[tempPanels[i].DelayAfter]);
51 if (dataGridView1.Rows.Count > 0)
53 if (dataGridView1.CurrentRow.Index != -1 && dataGridView1.CurrentRow.Index != 0)
55 int row = dataGridView1.CurrentRow.Index;
58 UpdateRowSettings(row);
59 UpdateRowSettings(row - 1);
63 tempPanels[row - 1] = tempPanels[row];
64 tempPanels[row] = temp;
67 dataGridView1.Rows.Clear();
70 dataGridView1.CurrentCell = dataGridView1.Rows[row - 1].Cells[0];
78 if (dataGridView1.Rows.Count > 0)
80 if (dataGridView1.CurrentRow.Index != -1 && dataGridView1.CurrentRow.Index != dataGridView1.Rows.Count - 1)
82 int row = dataGridView1.CurrentRow.Index;
85 UpdateRowSettings(row);
86 UpdateRowSettings(row + 1);
90 tempPanels[row + 1] = tempPanels[row];
91 tempPanels[row] = temp;
94 dataGridView1.Rows.Clear();
97 dataGridView1.CurrentCell = dataGridView1.Rows[row + 1].Cells[0];
104 for (
int i = 0; i < dataGridView1.Rows.Count; ++i)
106 UpdateRowSettings(i);
110 for (
int i = 0; i < tempPanels.Count; ++i)
113 if (tempPanels[i].ShowPanel)
115 Seci.SeciInterface.LV_ShowVI(tempPanels[i].PanelName);
119 Seci.SeciInterface.LV_HideVI(tempPanels[i].PanelName);
124 Seci.SeciInterface.LVPanelProperties = tempPanels;
126 DialogResult = DialogResult.OK;
133 tempPanels[i].StartRunning = (Boolean)dataGridView1.Rows[i].Cells[1].Value;
134 tempPanels[i].ShowPanel = (Boolean)dataGridView1.Rows[i].Cells[2].Value;
135 tempPanels[i].DelayAfter = Convert.ToInt16(dataGridView1.Rows[i].Cells[3].Value);
void SetVIProperties_Load(object sender, EventArgs e)
void btnCancel_Click(object sender, EventArgs e)
void btnUp_Click(object sender, EventArgs e)
void UpdateRowSettings(int i)
Seci.SerialisableList< Seci.LabView.LabViewPanelInfo > tempPanels
This class contains all the information about a LabVIEW VI that needs to be saved in the configuratio...
void btnDown_Click(object sender, EventArgs e)
void btnOK_Click(object sender, EventArgs e)