private void GetUpdatedPrinterStats() { var selectedPrinter = (IPrinter)spooler_connection.SelectedPrinter; if (selectedPrinter != null) { ZO_Text.Text = selectedPrinter.Info.calibration.ENTIRE_Z_HEIGHT_OFFSET >= 3.0 ? M3DGlobalization.ToLocalString(3f, "F2") : selectedPrinter.Info.calibration.ENTIRE_Z_HEIGHT_OFFSET.ToString(); ZO_Text.Text = float.Parse(ZO_Text.Text.ToString()).ToString("F2"); FRO_Text.Text = selectedPrinter.Info.calibration.CORNER_HEIGHT_FRONT_RIGHT_OFFSET >= 3.0 ? M3DGlobalization.ToLocalString(3f, "F2") : selectedPrinter.Info.calibration.CORNER_HEIGHT_FRONT_RIGHT_OFFSET.ToString(); FRO_Text.Text = float.Parse(FRO_Text.Text.ToString()).ToString("F2"); FLO_Text.Text = selectedPrinter.Info.calibration.CORNER_HEIGHT_FRONT_LEFT_OFFSET >= 3.0 ? M3DGlobalization.ToLocalString(3f, "F2") : selectedPrinter.Info.calibration.CORNER_HEIGHT_FRONT_LEFT_OFFSET.ToString(); FLO_Text.Text = float.Parse(FLO_Text.Text.ToString()).ToString("F2"); BRO_Text.Text = selectedPrinter.Info.calibration.CORNER_HEIGHT_BACK_RIGHT_OFFSET >= 3.0 ? M3DGlobalization.ToLocalString(3f, "F2") : selectedPrinter.Info.calibration.CORNER_HEIGHT_BACK_RIGHT_OFFSET.ToString(); BRO_Text.Text = float.Parse(BRO_Text.Text.ToString()).ToString("F2"); BLO_Text.Text = selectedPrinter.Info.calibration.CORNER_HEIGHT_BACK_LEFT_OFFSET >= 3.0 ? M3DGlobalization.ToLocalString(3f, "F2") : selectedPrinter.Info.calibration.CORNER_HEIGHT_BACK_LEFT_OFFSET.ToString(); BLO_Text.Text = float.Parse(BLO_Text.Text.ToString()).ToString("F2"); } else { ZO_Text.Text = M3DGlobalization.ToLocalString(0.0f, "F2"); FRO_Text.Text = M3DGlobalization.ToLocalString(0.0f, "F2"); FLO_Text.Text = M3DGlobalization.ToLocalString(0.0f, "F2"); BRO_Text.Text = M3DGlobalization.ToLocalString(0.0f, "F2"); BLO_Text.Text = M3DGlobalization.ToLocalString(0.0f, "F2"); } }
private void GetUpdatedPrinterStats() { var selectedPrinter = (IPrinter)m_oSpoolerConnection.SelectedPrinter; if (selectedPrinter != null) { if (m_oebwBacklashX_edit != null) { m_oebwBacklashX_edit.Text = selectedPrinter.Info.calibration.BACKLASH_X.ToString(); } if (m_oebwBacklashY_edit != null) { m_oebwBacklashY_edit.Text = selectedPrinter.Info.calibration.BACKLASH_Y.ToString(); } if (m_oebwBacklashSpeed_edit != null) { m_oebwBacklashSpeed_edit.Text = selectedPrinter.Info.calibration.BACKLASH_SPEED.ToString(); } if (m_oebwCalibrationOffset_edit == null) { return; } m_oebwCalibrationOffset_edit.Text = selectedPrinter.Info.calibration.CALIBRATION_OFFSET.ToString(); } else { if (m_oebwBacklashX_edit != null) { m_oebwBacklashX_edit.Text = M3DGlobalization.ToLocalString(0.0f, "F2"); } if (m_oebwBacklashY_edit != null) { m_oebwBacklashY_edit.Text = M3DGlobalization.ToLocalString(0.0f, "F2"); } if (m_oebwBacklashSpeed_edit != null) { m_oebwBacklashSpeed_edit.Text = M3DGlobalization.ToLocalString(0.0f, "F2"); } if (m_oebwCalibrationOffset_edit == null) { return; } m_oebwCalibrationOffset_edit.Text = M3DGlobalization.ToLocalString(0.0f, "F2"); } }
public void MyButtonCallback(ButtonWidget button) { PrinterObject selectedPrinter = spooler_connection.SelectedPrinter; switch (button.ID) { case 100: BLO_Text.Text = M3DGlobalization.ToLocalString(0.0f, "F2"); BRO_Text.Text = M3DGlobalization.ToLocalString(0.0f, "F2"); FRO_Text.Text = M3DGlobalization.ToLocalString(0.0f, "F2"); FLO_Text.Text = M3DGlobalization.ToLocalString(0.0f, "F2"); ZO_Text.Text = M3DGlobalization.ToLocalString(0.0f, "F2"); m_bhasUnsavedChanges = true; break; case 101: ApplyCalibrationSettings(selectedPrinter, GetCalibrationSettingsFromOptions(selectedPrinter.Info), true); break; case 102: var num1 = float.Parse(ZO_Text.Text) + 0.01f; if (num1 > 3.0) { num1 = 3f; } ZO_Text.Text = num1.ToString("F2"); OnOffsetChanged(CatScreenTab.ProbeLocation.Center); break; case 103: var num2 = float.Parse(ZO_Text.Text) - 0.01f; if (num2 < -3.0) { num2 = -3f; } ZO_Text.Text = num2.ToString("F2"); OnOffsetChanged(CatScreenTab.ProbeLocation.Center); break; case 104: var num3 = float.Parse(BLO_Text.Text) + 0.05f; if (num3 > 3.0) { num3 = 3f; } BLO_Text.Text = num3.ToString("F2"); OnOffsetChanged(CatScreenTab.ProbeLocation.BackLeft); break; case 105: var num4 = float.Parse(BLO_Text.Text) - 0.05f; if (num4 < -3.0) { num4 = -3f; } BLO_Text.Text = num4.ToString("F2"); OnOffsetChanged(CatScreenTab.ProbeLocation.BackLeft); break; case 106: var num5 = float.Parse(BRO_Text.Text) + 0.05f; if (num5 > 3.0) { num5 = 3f; } BRO_Text.Text = num5.ToString("F2"); OnOffsetChanged(CatScreenTab.ProbeLocation.BackRight); break; case 107: var num6 = float.Parse(BRO_Text.Text) - 0.05f; if (num6 < -3.0) { num6 = -3f; } BRO_Text.Text = num6.ToString("F2"); OnOffsetChanged(CatScreenTab.ProbeLocation.BackRight); break; case 108: var num7 = float.Parse(FLO_Text.Text) + 0.05f; if (num7 > 3.0) { num7 = 3f; } FLO_Text.Text = num7.ToString("F2"); OnOffsetChanged(CatScreenTab.ProbeLocation.FrontLeft); break; case 109: var num8 = float.Parse(FLO_Text.Text) - 0.05f; if (num8 < -3.0) { num8 = -3f; } FLO_Text.Text = num8.ToString("F2"); OnOffsetChanged(CatScreenTab.ProbeLocation.FrontLeft); break; case 110: var num9 = float.Parse(FRO_Text.Text) + 0.05f; if (num9 > 3.0) { num9 = 3f; } FRO_Text.Text = num9.ToString("F2"); OnOffsetChanged(CatScreenTab.ProbeLocation.FrontRight); break; case 111: var num10 = float.Parse(FRO_Text.Text) - 0.05f; if (num10 < -3.0) { num10 = -3f; } FRO_Text.Text = num10.ToString("F2"); OnOffsetChanged(CatScreenTab.ProbeLocation.FrontRight); break; case 112: MoveToPoint(CatScreenTab.ProbeLocation.Center, true); break; case 113: MoveToPoint(CatScreenTab.ProbeLocation.BackLeft, true); break; case 114: MoveToPoint(CatScreenTab.ProbeLocation.BackRight, true); break; case 115: MoveToPoint(CatScreenTab.ProbeLocation.FrontLeft, true); break; case 116: MoveToPoint(CatScreenTab.ProbeLocation.FrontRight, true); break; } }