public void SetChannel(DmxFramework.Channels.Channel pPan, DmxFramework.Channels.Channel pTilt) { mPanChannel = pPan; mTiltChannel = pTilt; if (mPanChannel.IsForced || mTiltChannel.IsForced) { this.checkBox1.Checked = true; } else { this.checkBox1.Checked = false; } mPanChannel_OnValueChanged(mPanChannel, mPanChannel.Value); mTiltChannel_OnValueChanged(mTiltChannel, mTiltChannel.Value); if (Main.Options.Visualize) { mPanChannel.OnValueChanged += new DmxFramework.Channels.OnValueChangedHandler(mPanChannel_OnValueChanged); mTiltChannel.OnValueChanged += new DmxFramework.Channels.OnValueChangedHandler(mTiltChannel_OnValueChanged); } mPanChannel.OnForcedStateChanged += new DmxFramework.Channels.OnForcedStateChangedHandler(mChannel_OnForcedStateChanged); mTiltChannel.OnForcedStateChanged += new DmxFramework.Channels.OnForcedStateChangedHandler(mChannel_OnForcedStateChanged); }
public DmxOutputCtrl(int pNum) { InitializeComponent(); mChannel = null; this.label1.Text = pNum + ""; myForceStateDelegate = new delegate_ForcedStateChange(ChangeForcedState); myChannelValueChangedDelegate = new delegate_ChannelValueChanged(ChangeChannelValue); }
public void SetChannel(DmxFramework.Channels.Channel pChannel) { float pourcentage = 0; mChannel = pChannel; this.checkBox1.Checked = mChannel.IsForced; this.checkBox1.Text = mChannel.Name; this.tableLayoutPanel1.Controls.Clear(); this.tableLayoutPanel1.RowCount = 0; this.tableLayoutPanel1.ColumnCount = 0; //set row ... pourcentage = 100 / mChannel.RowCount; this.tableLayoutPanel1.RowStyles.Clear(); this.tableLayoutPanel1.RowCount = mChannel.RowCount; for (int i = 0; i < mChannel.RowCount; i++) { this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, pourcentage)); } //set columns ... pourcentage = 100 / mChannel.ColumnCount; this.tableLayoutPanel1.ColumnStyles.Clear(); this.tableLayoutPanel1.ColumnCount = mChannel.ColumnCount; for (int i = 0; i < mChannel.ColumnCount; i++) { this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, pourcentage)); } int count = 0; for (int i = 0; i < mChannel.RowCount; i++) { for (int j = 0; j < mChannel.ColumnCount; j++) { if (count >= mChannel.DmxValues.Count) { break; } ValueButton btn = new ValueButton((DmxFramework.Channels.DmxValue)mChannel.DmxValues[count]); btn.OnNewBtnValue += new OnNewBtnValueHandler(btn_OnNewBtnValue); btn.Dock = System.Windows.Forms.DockStyle.Fill; btn.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.tableLayoutPanel1.Controls.Add(btn, j, i); count++; } } mChannel_OnValueChanged(mChannel, mChannel.Value); if (Main.Options.Visualize) { mChannel.OnValueChanged += new DmxFramework.Channels.OnValueChangedHandler(mChannel_OnValueChanged); } mChannel.OnForcedStateChanged += new DmxFramework.Channels.OnForcedStateChangedHandler(mChannel_OnForcedStateChanged); }
void mPanChannel_OnValueChanged(DmxFramework.Channels.Channel pChannel, int pValue) { if (this.InvokeRequired) { this.BeginInvoke(this.myChanPanDelegate, pChannel, pValue); } else { ChangePanValue(pChannel, pValue); } }
void ChangeForcedState(DmxFramework.Channels.Channel pChannel, bool pIsForced) { if (mPanChannel.IsForced || mTiltChannel.IsForced) { this.checkBox1.Checked = true; } else { this.checkBox1.Checked = false; } }
void mChannel_OnForcedStateChanged(DmxFramework.Channels.Channel pChannel, bool pIsForced) { if (this.InvokeRequired) { this.BeginInvoke(myForceStateDelegate, pChannel, pIsForced); } else { ChangeForcedState(pChannel, pIsForced); } }
void ChangeChannelValue(DmxFramework.Channels.Channel pChannel, int pValue) { try { mFromFramework = true; this.textBox1.Text = pValue.ToString(); this.trackBar1.Value = pValue; } catch { } }
void ChangeChannelValue(DmxFramework.Channels.Channel pChannel, int pValue) { for (int i = 0; i < this.tableLayoutPanel1.Controls.Count; i++) { ValueButton btn = (ValueButton)this.tableLayoutPanel1.Controls[i]; if (btn.IsConcerned(pValue)) { btn.SetSelectedMode(true); } else { btn.SetSelectedMode(false); } } }
public DmxOutputCtrl(DmxFramework.Channels.Channel pChannel) { mChannel = pChannel; InitializeComponent(); mFromFramework = true; this.label1.Text = mChannel.Name; this.trackBar1.Value = pChannel.Value; this.checkBox1.Checked = mChannel.IsForced; mChannel_OnValueChanged(null, mChannel.Value); mChannel.OnForcedStateChanged += new DmxFramework.Channels.OnForcedStateChangedHandler(mChannel_OnForcedStateChanged); mChannel.OnValueChanged += new DmxFramework.Channels.OnValueChangedHandler(mChannel_OnValueChanged); }
void mChannel_OnValueChanged(DmxFramework.Channels.Channel pChannel, int pValue) { if (mSelectedValue != null) { if (pValue >= mSelectedValue.StartValue && pValue < mSelectedValue.EndValue) { return; } } foreach (DmxFramework.Channels.DmxValue val in mChannel.DmxValues) { if (pValue >= val.StartValue && pValue < val.EndValue) { mSelectedValue = val; this.listBox1.SelectedItem = val; return; } } }
public void SetChannel(DmxFramework.Channels.Channel pChannel) { mChannel = pChannel; this.checkBox1.Text = mChannel.Name; this.checkBox1.Checked = mChannel.IsForced; this.listBox1.Items.Clear(); foreach (DmxFramework.Channels.DmxValue val in mChannel.DmxValues) { this.listBox1.Items.Add(val); if (pChannel.Value >= val.StartValue && pChannel.Value < val.EndValue) { mSelectedValue = val; this.listBox1.SelectedItem = val; } } if (Main.Options.Visualize) { mChannel.OnValueChanged += new DmxFramework.Channels.OnValueChangedHandler(mChannel_OnValueChanged); } mChannel.OnForcedStateChanged += new DmxFramework.Channels.OnForcedStateChangedHandler(mChannel_OnForcedStateChanged); }
public PoursuitEditor(DmxFramework.Fixtures.RealFixture pRealFixture) { mFixture = pRealFixture; foreach (DmxFramework.Channels.Channel chan in pRealFixture.Channels) { if (chan.Function == DmxFramework.Channels.ChannelFunction.Pan) { mPanCHannel = chan; } else if (chan.Function == DmxFramework.Channels.ChannelFunction.Tilt) { mTiltChannel = chan; } } InitializeComponent(); this.txt_A_X.Text = "" + mFixture.Poursuite.PointA.iX; this.txt_A_Y.Text = "" + mFixture.Poursuite.PointA.iY; this.txt_B_X.Text = "" + mFixture.Poursuite.PointB.iX; this.txt_B_Y.Text = "" + mFixture.Poursuite.PointB.iY; this.txt_C_X.Text = "" + mFixture.Poursuite.PointC.iX; this.txt_C_Y.Text = "" + mFixture.Poursuite.PointC.iY; this.txt_D_X.Text = "" + mFixture.Poursuite.PointD.iX; this.txt_D_Y.Text = "" + mFixture.Poursuite.PointD.iY; this.txt_intersection_X.Text = "" + mFixture.Poursuite.PointIntersection.iX; this.txt_intersection_Y.Text = "" + mFixture.Poursuite.PointIntersection.iY; this.chk_Enabled.Checked = mFixture.Poursuite.IsActive; }
void mChannel_OnForcedStateChanged(DmxFramework.Channels.Channel pChannel, bool pIsForced) { this.checkBox1.Checked = pIsForced; }
void ChangePanValue(DmxFramework.Channels.Channel pChannel, int pValue) { this.label1.Left = (pValue * this.panel1.Width) / 255 - (this.label1.Width) / 2; }
void ChangeTiltValue(DmxFramework.Channels.Channel pChannel, int pValue) { this.label1.Top = (pValue * this.panel1.Height) / 255 - (this.label1.Height) / 2; }
void ChangeForcedState(DmxFramework.Channels.Channel pChannel, bool pIsForced) { this.checkBox1.Checked = pIsForced; }