private void addSeveralRowToolStripMenuItem_Click(object sender, EventArgs e) { AddSeveralValuesDlg dlg = new AddSeveralValuesDlg(); dlg.StartValue = GetNewAdress(); DialogResult res = dlg.ShowDialog(this); if (res != DialogResult.OK) { return; } int difference = GetDifference(dlg.StartValue, dlg.EndValue, dlg.Number); int startValue = dlg.StartValue; for (int i = 0; i < dlg.Number; i++) { DmxValue val = new DmxValue(); val.StartValue = startValue; val.Value = startValue; val.EndValue = startValue + difference - 1; val.Text = "Value " + this.mChannel.DmxValues.Count; this.mChannel.DmxValues.Add(val); AddValueInGrid(val); startValue = startValue + difference; } }
private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) { return; } try { DataGridViewRow row = dataGridView1.Rows[e.RowIndex]; DmxValue value = (DmxValue)row.Tag; if (dataGridView1.Columns[e.ColumnIndex].Name == "col_Min") { value.StartValue = Convert.ToInt32((string)row.Cells[e.ColumnIndex].Value); value.Value = Convert.ToInt32((string)row.Cells[e.ColumnIndex].Value); } else if (dataGridView1.Columns[e.ColumnIndex].Name == "col_Max") { value.EndValue = Convert.ToInt32((string)row.Cells[e.ColumnIndex].Value); } else if (dataGridView1.Columns[e.ColumnIndex].Name == "col_Text") { value.Text = (string)row.Cells[e.ColumnIndex].Value; } else if (dataGridView1.Columns[e.ColumnIndex].Name == "col_Image") { //value.Image } } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void addRowToolStripMenuItem_Click(object sender, EventArgs e) { //int index = this.dataGridView1.Rows.Add(); DmxValue val = new DmxValue(); val.StartValue = GetNewAdress(); val.Value = GetNewAdress(); this.mChannel.DmxValues.Add(val); AddValueInGrid(val); }
public SelectSubChannelDlg(VirtualFixture pFixture, VirtualChannel pChannel, DmxValue pDmxValue) { mFixture = pFixture; mChannel = pChannel; mDmxValue = pDmxValue; //mDmxValue. InitializeComponent(); this.treeView1.ImageList = new ImageList(); string FilePath = System.Environment.CurrentDirectory + "\\icons\\white.ico"; Icon ico = new Icon(FilePath); this.treeView1.ImageList.Images.Add(ico); LoadTree(); }
public ValueButton(DmxFramework.Channels.DmxValue pValue) : base() { mValue = pValue; mDefaultColor = this.BackColor; if (mValue.Image != null && mValue.Image != "" && File.Exists(mValue.Image)) { System.Drawing.Image img = Image.FromFile(mValue.Image); this.BackgroundImage = img; this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; } else { this.Text = mValue.Text; } this.MouseClick += new MouseEventHandler(ValueButton_MouseClick); }
private void AddValueInGrid(DmxValue pValue) { int index = this.dataGridView1.Rows.Add(1); DataGridViewRow row = this.dataGridView1.Rows[index]; row.Tag = pValue; row.Cells["col_Min"].Value = Convert.ToString(pValue.StartValue); row.Cells["col_Max"].Value = Convert.ToString(pValue.EndValue); row.Cells["col_Text"].Value = pValue.Text; row.Cells["col_Image"].ToolTipText = pValue.Image; if (pValue.Image != null && pValue.Image != "") { ((DataGridViewImageCell)(row.Cells["col_Image"])).Value = Image.FromFile(pValue.Image); } if (mChannel.Type == ChannelType.Virtual) { row.Cells["col_Copy"].Value = "Select ..."; } }
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0 || e.ColumnIndex < 0) { return; } if (dataGridView1.Columns[e.ColumnIndex].Name == "col_Image") { string ImagePath = this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].ToolTipText; Dialog.ImageBrowser Browser = new DmxCreator.Dialog.ImageBrowser(ImagePath); //Browser.SelectImage(ImagePath); DialogResult res = Browser.ShowDialog(); if (res != DialogResult.OK) { return; } string DestFile = Browser.SelectedImage; if (mFixture is RealFixture) { FileInfo Info = new FileInfo(Browser.SelectedImage); string DestDir = Constant.FixtureDir + "\\" + ((RealFixture)mFixture).LightConstructor + "\\" + ((RealFixture)mFixture).LightName + "\\img"; if (!Directory.Exists(DestDir)) { Directory.CreateDirectory(DestDir); } DestFile = DestDir + "\\" + Info.Name; if (!File.Exists(DestFile)) { File.Copy(Browser.SelectedImage, DestFile); } } else { FileInfo Info = new FileInfo(Browser.SelectedImage); DestFile = Constant.VirtualDir + "\\" + Info.Name; if (!File.Exists(DestFile)) { File.Copy(Browser.SelectedImage, DestFile); } } DmxValue val = (DmxValue)this.dataGridView1.Rows[e.RowIndex].Tag; val.Image = DestFile; this.dataGridView1.Rows[e.RowIndex].Cells["col_Image"].ToolTipText = val.Image; if (val.Image != null && val.Image != "") { ((DataGridViewImageCell)(this.dataGridView1.Rows[e.RowIndex].Cells["col_Image"])).Value = Image.FromFile(val.Image); } } else if (dataGridView1.Columns[e.ColumnIndex].Name == "col_Copy") { SelectSubChannelDlg dlg = new SelectSubChannelDlg((VirtualFixture)mFixture, (VirtualChannel)mChannel, (DmxValue)dataGridView1.Rows[e.RowIndex].Tag); dlg.ShowDialog(this); } }
private bool HasToBeChecked(Channel pChannel, DmxValue pValue) { return(mDmxValue.SubChannels.Contains(pChannel) && mDmxValue.SubDmxValues.Contains(pValue)); }
public DmxValue GetDmxValue(DmxValue value) => GetDmxValue(value.Channel.Value, value.Value);
public bool ContainsDmxValue(DmxValue value) => ContainsDmxValue(value.Channel.Value, value.Value);
public void SetDmxValue(Guid queueId, DmxValue value, int priority) { DmxController <DMXProUSB> .SetDmxValue(queueId, value.Channel.Value, priority, value.Value); }