private void BR_CheckedChanged(object sender, EventArgs e) { if (BR.Checked) { SetAnchorValue(3); } PositionPanel.Refresh(); }
private void XNumeric_ValueChanged(object sender, EventArgs e) { if (!_programmaticallyChangingValues) { _messagePosition.X = (int)XNumeric.Value; PositionPanel.Refresh(); } }
private void YNumeric_Changed(object sender, EventArgs e) { if (!_programmaticallyChangingValues) { _py = (int)YNumeric.Value; SetPositionLabels(); PositionPanel.Refresh(); } }
private void BR_CheckedChanged(object sender, EventArgs e) { if (BR.Checked) { SetAnchorValue(MessagePosition.AnchorType.BottomRight); } PositionPanel.Refresh(); }
private void TL_CheckedChanged(object sender, EventArgs e) { if (TL.Checked) { SetAnchorValue(MessagePosition.AnchorType.TopLeft); } PositionPanel.Refresh(); }
private void TR_CheckedChanged(object sender, EventArgs e) { if (TR.Checked) { SetAnchor(MessagePosition.AnchorType.TopRight); } PositionPanel.Refresh(); }
private void BL_CheckedChanged(object sender, EventArgs e) { if (BL.Checked) { SetAnchor(MessagePosition.AnchorType.BottomLeft); } PositionPanel.Refresh(); }
private void SetNewPosition(int mx, int my) { _programmaticallyChangingValues = true; if (mx < 0) { mx = 0; } if (my < 0) { my = 0; } if (mx > XNumeric.Maximum) { mx = (int)XNumeric.Maximum; } if (my > YNumeric.Maximum) { my = (int)YNumeric.Maximum; } if (TL.Checked) { // Do nothing } else if (TR.Checked) { mx = (int)XNumeric.Maximum - mx; } else if (BL.Checked) { my = (int)YNumeric.Maximum - my; } else if (BR.Checked) { mx = (int)XNumeric.Maximum - mx; my = (int)YNumeric.Maximum - my; } XNumeric.Value = mx; YNumeric.Value = my; _px = mx; _py = my; PositionPanel.Refresh(); SetPositionLabels(); _programmaticallyChangingValues = false; }
private void SetPosition(int mx, int my) { _programmaticallyChangingValues = true; if (mx < 0) { mx = 0; } if (my < 0) { my = 0; } if (mx > XNumeric.Maximum) { mx = (int)XNumeric.Maximum; } if (my > YNumeric.Maximum) { my = (int)YNumeric.Maximum; } if (TL.Checked) { // Do nothing } else if (TR.Checked) { mx = (int)XNumeric.Maximum - mx; } else if (BL.Checked) { my = (int)YNumeric.Maximum - my; } else if (BR.Checked) { mx = (int)XNumeric.Maximum - mx; my = (int)YNumeric.Maximum - my; } XNumeric.Value = mx; YNumeric.Value = my; _messagePosition.X = mx; _messagePosition.Y = my; _changeCallback?.Invoke(); PositionPanel.Refresh(); _programmaticallyChangingValues = false; }
private void SetPositionInfo() { if (FPSRadio.Checked) { SetFromOption(_fps); } else if (FrameCounterRadio.Checked) { SetFromOption(_frameCounter); } else if (LagCounterRadio.Checked) { SetFromOption(_lagCounter); } else if (InputDisplayRadio.Checked) { SetFromOption(_inputDisplay); } else if (WatchesRadio.Checked) { SetFromOption(_ramWatches); } else if (MessagesRadio.Checked) { SetFromOption(_messages); } else if (RerecordsRadio.Checked) { SetFromOption(_reRecordCounter); } else if (MultitrackRadio.Checked) { SetFromOption(_multitrackRecorder); } else if (AutoholdRadio.Checked) { SetFromOption(_autohold); } PositionPanel.Refresh(); XNumeric.Refresh(); YNumeric.Refresh(); SetPositionLabels(); }
/// <summary> /// Main Test Process, Start in a new thread. /// </summary> private void testProcess() { try { testFunction.BridgePowerOff(); } //try to stop the bridge if it's in use. catch { } try { testFunction.idacErased = false; testFunction.IDACItem = false; testFunction.RawCountItem = false; testFunction.FWVersionItem = false; //power on trackpad and enter into test mode. testFunction.BridgePowerOn(); System.Threading.Thread.Sleep(500); testFunction.ExitBootloader(); System.Threading.Thread.Sleep(100); testFunction.Enter_TestMode(); System.Threading.Thread.Sleep(100); // System.Threading.Thread.Sleep(1000); //clear text box message, show "testing". //testFunction.dut.ErrorCode = ErrorCode.EEROR_SYSTEM_ERROR; //SetTxtBoxStatus(testFunction.dut.ErrorCode); // FW check if (tpConfigTestItems.ReadFW) { testFunction.I2C_Read_FW_Rev_Test(); } testFunction.BridgePowerOff(); testFunction.BridgePowerOn(); System.Threading.Thread.Sleep(500); testFunction.ExitBootloader(); if (checkBoxRecal.Checked & !testFunction.I2C_Check_RawCount_Value()) { testFunction.I2C_Calibrate_IDAC(); testFunction.BridgePowerOff(); testFunction.BridgePowerOn(); System.Threading.Thread.Sleep(500); testFunction.ExitBootloader(); testFunction.I2C_Check_RawCount_Value(); } //Position test SetTabControlIndex(1); SetTabPassFocus(); while (testFunction.readPositionStop) { testFunction.ReadPosition(); PositionPanel.Invalidate(); } testFunction.BridgePowerOff(); SetTxtBoxStatus(testFunction.dut.ErrorCode); if (testFunction.dut.ErrorCode == 0) { System.Threading.Thread.Sleep(500); testFunction.BridgePowerOn(); System.Threading.Thread.Sleep(1000); testFunction.ExitBootloader(); // System.Threading.Thread.Sleep(1000); //clear text box message, show "testing". SetTxtBoxStatus(testFunction.dut.ErrorCode); if (checkBoxRecal.Checked & !testFunction.I2C_Check_RawCount_Value()) { testFunction.I2C_Calibrate_IDAC(); testFunction.BridgePowerOff(); testFunction.BridgePowerOn(); System.Threading.Thread.Sleep(1000); testFunction.ExitBootloader(); testFunction.I2C_Check_RawCount_Value(); } testFunction.BridgePowerOff(); } test_running = false; //stop test SetTxtBoxStatus(testFunction.dut.ErrorCode); } catch (Exception ex) { test_running = false; SetTxtBoxStatus(ErrorCode.EEROR_SYSTEM_ERROR); MessageBox.Show(ex.Message, "Error: ", MessageBoxButtons.OK, MessageBoxIcon.Error); Log.error(ex.Message); bridge.PowerOff(); //bridge.ClosePort(); } finally { } }
private void YNumericChange() { _py = (int)YNumeric.Value; SetPositionLabels(); PositionPanel.Refresh(); }
private void SetPositionInfo() { if (FPSRadio.Checked) { XNumeric.Value = _dispFpSx; YNumeric.Value = _dispFpSy; _px = _dispFpSx; _py = _dispFpSy; SetAnchorRadio(_dispFpSanchor); } else if (FrameCounterRadio.Checked) { XNumeric.Value = _dispFrameCx; YNumeric.Value = _dispFrameCy; _px = _dispFrameCx; _py = _dispFrameCy; SetAnchorRadio(_dispFrameanchor); } else if (LagCounterRadio.Checked) { XNumeric.Value = _dispLagx; YNumeric.Value = _dispLagy; _px = _dispLagx; _py = _dispLagy; SetAnchorRadio(_dispLaganchor); } else if (InputDisplayRadio.Checked) { XNumeric.Value = _dispInpx; XNumeric.Value = _dispInpy; _px = _dispInpx; _py = _dispInpy; SetAnchorRadio(_dispInputanchor); } else if (WatchesRadio.Checked) { XNumeric.Value = _dispWatchesx; XNumeric.Value = _dispWatchesy; _px = _dispWatchesx; _py = _dispWatchesy; SetAnchorRadio(_dispWatchesanchor); } else if (MessagesRadio.Checked) { XNumeric.Value = _dispMessagex; YNumeric.Value = _dispMessagey; _px = _dispMessagex; _py = _dispMessagey; SetAnchorRadio(_dispMessageAnchor); } else if (RerecordsRadio.Checked) { XNumeric.Value = _dispRecx; YNumeric.Value = _dispRecy; _px = _dispRecx; _py = _dispRecy; SetAnchorRadio(_dispRecanchor); } else if (MultitrackRadio.Checked) { XNumeric.Value = _dispMultix; YNumeric.Value = _dispMultiy; _px = _dispMultix; _py = _dispMultiy; SetAnchorRadio(_dispMultiAnchor); } else if (AutoholdRadio.Checked) { XNumeric.Value = _dispAutoholdx; YNumeric.Value = _dispAutoholdy; _px = _dispAutoholdx; _py = _dispAutoholdy; SetAnchorRadio(_dispAutoholdAnchor); } PositionPanel.Refresh(); XNumeric.Refresh(); YNumeric.Refresh(); SetPositionLabels(); }
private void trackPad_MessageChangeEvent(object sender, MessageChangeEventArgs e) { SetListBoxStatus(e.Message); PositionPanel.Invalidate(); }