Creating the conductive probe wizard procedure

This commit is contained in:
Lars Brubaker 2022-03-31 17:40:54 -07:00
parent 96e46be04d
commit 68d361c2da
10 changed files with 141 additions and 24730 deletions

View file

@ -54,7 +54,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
{
return (printer.Settings.Helpers.ProbeBeingUsed
&& !printer.Settings.GetValue<bool>(SettingsKey.has_hardware_leveling))
|| printer.Settings.GetValue<int>(SettingsKey.extruder_count) > 1;
|| printer.Settings.GetInt(SettingsKey.extruder_count) > 1;
}
}
@ -121,14 +121,20 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
autoProbePositions.Add(new PrintLevelingWizard.ProbePosition());
var zCalibrationMeasuresMassage = "Z Calibration measures the z position of the nozzle.".Localize();
if (printer.Settings.GetInt(SettingsKey.extruder_count) > 1)
{
zCalibrationMeasuresMassage = "Z Calibration measures the z position of the nozzles.".Localize();
}
// show what steps will be taken
yield return new WizardPage(
this,
string.Format("{0} {1}", this.Title, "Overview".Localize()),
string.Format(
"{0}\n\n{1}\n\n{2}\n\n",
"Z Calibration measures the z position of the nozzles.".Localize(),
"This data is required for software print leveling and ensures good first layer adhesion.".Localize(),
zCalibrationMeasuresMassage,
"This data is required for print leveling and ensures good first layer adhesion.".Localize(),
"Click 'Next' to continue.".Localize()))
{
WindowTitle = Title,
@ -242,29 +248,28 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
{
int hotendCount = Math.Min(2, printer.Settings.Helpers.HotendCount());
if (printer.Settings.Helpers.ProbeBeingUsed)
{
// do the automatic probing of the center position
yield return new AutoProbeFeedback(
this,
ProbeStartPosition,
"Probe at bed center".Localize(),
"Sample the bed center position to determine the probe distance to the bed".Localize(),
autoProbePositions,
0);
}
if (hotendCount == 1
&& printer.Settings.Helpers.ProbeBeingUsed
&& printer.Settings.GetValue<bool>(SettingsKey.has_conductive_nozzle)
&& printer.Settings.GetValue<bool>(SettingsKey.measure_probe_offset_conductively))
{
yield return new CleanNozzleBeforeConductiveProbe(printer, this, PageTitle);
yield return new AutoProbeFeedback(
this,
ProbeStartPosition,
"Probe on conductive pad".Localize(),
"Sampling the conductive pad position to determine the probe distance to the bed".Localize(),
autoProbePositions,
0);
var conductiveProbeFeedback = new ConductiveProbeFeedback(
this,
ProbeStartPosition,
"Conductive Probing".Localize(),
"Measure the nozzle to probe offset using the conductive pad.".Localize(),
manualProbePositions[0]);
yield return conductiveProbeFeedback;
if (conductiveProbeFeedback.MovedBelowMinZ)
@ -279,9 +284,24 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
{
SetExtruderOffset(autoProbePositions, manualProbePositions, 0);
}
// let the user know we are done with the automatic probing
yield return new ConductiveProbeCalibrateComplete(printer, this, PageTitle);
}
else // collect the probe information manually
{
if (printer.Settings.Helpers.ProbeBeingUsed)
{
// do the automatic probing of the center position
yield return new AutoProbeFeedback(
this,
ProbeStartPosition,
"Probe at bed center".Localize(),
"Sample the bed center position to determine the probe distance to the bed".Localize(),
autoProbePositions,
0);
}
// show what steps will be taken
yield return new WizardPage(
this,
@ -337,10 +357,10 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
SetExtruderOffset(autoProbePositions, manualProbePositions, extruderIndex);
}
}
// let the user know we are done with the manual part
yield return new CalibrateProbeRemovePaperInstructions(this, PageTitle, false);
// let the user know we are done with the manual part
yield return new CalibrateProbeRemovePaperInstructions(this, PageTitle, false);
}
}
private void SetExtruderOffset(List<PrintLevelingWizard.ProbePosition> autoProbePositions, List<List<PrintLevelingWizard.ProbePosition>> manualProbePositions, int extruderIndex)

View file

@ -71,4 +71,63 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
base.OnLoad(args);
}
}
public class ConductiveProbeCalibrateComplete : WizardPage
{
public ConductiveProbeCalibrateComplete(PrinterConfig printer, ISetupWizard setupWizard, string headerText)
: base(setupWizard, headerText, "")
{
var completedText = "Conductive Z Calibration complete.".Localize();
if (printer.Settings.GetBool(SettingsKey.has_swappable_bed))
{
completedText += "\n\n • " + "Place the bed back on the printer".Localize();
}
completedText += "\n\n" + "Click 'Done'".Localize();
contentRow.AddChild(this.CreateTextField(completedText));
contentRow.BackgroundColor = theme.MinimalShade;
this.ShowWizardFinished();
}
public override void OnLoad(EventArgs args)
{
printer.Connection.QueueLine("T0");
printer.Connection.MoveRelative(PrinterConnection.Axis.X, .1, printer.Settings.Helpers.ManualMovementSpeeds().X);
if (printer.Settings.GetValue<bool>(SettingsKey.z_homes_to_max))
{
printer.Connection.HomeAxis(PrinterConnection.Axis.XYZ);
}
else if (!printer.Settings.GetValue<bool>(SettingsKey.has_z_probe))
{
// Lift the hotend off the bed - at the conclusion of the wizard, make sure we lift the heated nozzle off the bed
printer.Connection.MoveRelative(PrinterConnection.Axis.Z, 30, printer.Settings.Helpers.ManualMovementSpeeds().Z);
}
base.OnLoad(args);
}
}
public class CleanNozzleBeforeConductiveProbe : WizardPage
{
public CleanNozzleBeforeConductiveProbe(PrinterConfig printer, ISetupWizard setupWizard, string headerText)
: base(setupWizard, headerText, "")
{
var completedText = "Before Z-Calibration can begin you need to:".Localize();
if (printer.Settings.GetBool(SettingsKey.has_swappable_bed))
{
completedText += "\n\n • " + "Remove the bed from the printer so the nozzle can get low enough to touch the pad".Localize();
}
completedText += "\n • " + "Ensure the nozzle is clear of any debri or filament".Localize();
completedText += "\n\n" + "Click 'Next' to continue.".Localize();
contentRow.AddChild(this.CreateTextField(completedText));
contentRow.BackgroundColor = theme.MinimalShade;
}
}
}

View file

@ -33,12 +33,9 @@ using MatterHackers.Agg;
using MatterHackers.Agg.Image;
using MatterHackers.Agg.Transform;
using MatterHackers.Agg.UI;
using MatterHackers.Agg.VertexSource;
using MatterHackers.GCodeVisualizer;
using MatterHackers.ImageProcessing;
using MatterHackers.MatterControl.SlicerConfiguration;
using MatterHackers.RenderOpenGl;
using MatterHackers.RenderOpenGl.OpenGl;
using MatterHackers.VectorMath;
namespace MatterHackers.MatterControl.PartPreviewWindow

View file

@ -304,7 +304,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|| settingsKey == SettingsKey.bed_size
|| settingsKey == SettingsKey.print_center
|| settingsKey == SettingsKey.extruder_count
|| settingsKey == SettingsKey.bed_shape)
|| settingsKey == SettingsKey.bed_shape
|| settingsKey == SettingsKey.build_height)
{
activeBedToolClippingImage = int.MinValue;

View file

@ -32,14 +32,10 @@ using System.IO;
using MatterHackers.Agg;
using MatterHackers.Agg.Image;
using MatterHackers.Agg.Platform;
using MatterHackers.Agg.UI;
using MatterHackers.Agg.VertexSource;
using MatterHackers.DataConverters3D;
using MatterHackers.MatterControl.SlicerConfiguration;
using MatterHackers.MeshVisualizer;
using MatterHackers.PolygonMesh;
using MatterHackers.PolygonMesh.Processors;
using MatterHackers.RenderOpenGl;
using MatterHackers.VectorMath;
namespace MatterHackers.MatterControl

View file

@ -15,6 +15,7 @@
"disable_fan_first_layers": "5",
"filament_cost": "42",
"filament_density": "1.24",
"infill_type": "GYROID",
"layer_id": "42348031-fadf-4e93-bfbc-6b5e78a9ad39",
"layer_name": "BASF PRO1 Tough PLA",
"material_sku": "MZ2HXEPK",

View file

@ -574,6 +574,9 @@ Translated:Before Tool Change G-Code 3
English:Before Tool Change G-Code 4
Translated:Before Tool Change G-Code 4
English:Before Z-Calibration can begin you need to:
Translated:Before Z-Calibration can begin you need to:
English:Behavior
Translated:Behavior
@ -817,6 +820,9 @@ Translated:Clear ZOffset
English:Clearance
Translated:Clearance
English:Click 'Done'
Translated:Click 'Done'
English:Click 'Next' to continue.
Translated:Click 'Next' to continue.
@ -904,6 +910,9 @@ Translated:Conductive Probe Min Z
English:Conductive Probing
Translated:Conductive Probing
English:Conductive Z Calibration complete.
Translated:Conductive Z Calibration complete.
English:Cone
Translated:Cone
@ -1459,6 +1468,9 @@ Translated:End Height Percent
English:Ending Angle
Translated:Ending Angle
English:Ensure the nozzle is clear of any debri or filament
Translated:Ensure the nozzle is clear of any debri or filament
English:Enter a Design Name Here
Translated:Enter a Design Name Here
@ -3421,6 +3433,9 @@ Translated:Pixels Per mm
English:PLA Temperature Tower
Translated:PLA Temperature Tower
English:Place the bed back on the printer
Translated:Place the bed back on the printer
English:Place the paper under the extruder
Translated:Place the paper under the extruder
@ -3736,6 +3751,9 @@ Translated:Probe Has Been Calibrated
English:Probe Offset
Translated:Probe Offset
English:Probe on conductive pad
Translated:Probe on conductive pad
English:Processing
Translated:Processing
@ -3904,6 +3922,9 @@ Translated:Remove Mode
English:Remove Subtract Objects
Translated:Remove Subtract Objects
English:Remove the bed from the printer so the nozzle can get low enough to touch the pad
Translated:Remove the bed from the printer so the nozzle can get low enough to touch the pad
English:Remove the calibration part from the bed and compare the sides of the pads in each axis.
Translated:Remove the calibration part from the bed and compare the sides of the pads in each axis.
@ -4165,6 +4186,9 @@ Translated:Sample the bed center position to determine the probe distance to the
English:Sampled Positions
Translated:Sampled Positions
English:Sampling the conductive pad position to determine the probe distance to the bed
Translated:Sampling the conductive pad position to determine the probe distance to the bed
English:Save
Translated:Save
@ -5497,6 +5521,9 @@ Translated:This data compensates for machine misalignment and bed distortion, an
English:This data improves the alignment of dual extrusion prints.
Translated:This data improves the alignment of dual extrusion prints.
English:This data is required for print leveling and ensures good first layer adhesion.
Translated:This data is required for print leveling and ensures good first layer adhesion.
English:This data is required for software print leveling and ensures good first layer adhesion.
Translated:This data is required for software print leveling and ensures good first layer adhesion.
@ -6271,6 +6298,9 @@ Translated:Your Start G-Code should not contain a G30 if you are planning on usi
English:Z Calibration
Translated:Z Calibration
English:Z Calibration measures the z position of the nozzle.
Translated:Z Calibration measures the z position of the nozzle.
English:Z Calibration measures the z position of the nozzles.
Translated:Z Calibration measures the z position of the nozzles.

@ -1 +1 @@
Subproject commit 94699de914b0582456dd8eadbc004c33b94b4fba
Subproject commit cf9cf3cd84dbfadf1ba221700ac269667cc5c27d

View file

@ -78,7 +78,7 @@ M300 S3000 P30 ; Resume Tone";
}
[Test, RunInApplicationDomain]
public void ModifyPrinterProfiles()
public void ModifyPulsePrinterProfilesSettings()
{
// This is not really a test. It updaets our profiles with new settings.
return;
@ -133,13 +133,13 @@ M300 S3000 P30 ; Resume Tone";
printerSettings.SetValue(SettingsKey.pause_gcode, ConvertString(pauseGCode));
printerSettings.SetValue(SettingsKey.resume_gcode, ConvertString(resumeGCode));
printerSettings.SetValue(SettingsKey.support_material_create_perimeter, "1");
// e series settings
if (printerModel.Contains('E'))
{
// load the materials settings that we want to add
var materialsProfilePath = @"C:\Temp\E_Pulse_Materials.json";
var pulseMaterials = PrinterSettings.LoadFile(materialsProfilePath);
printerSettings.MaterialLayers = pulseMaterials.MaterialLayers;
// clear all material settings
printerSettings.MaterialLayers = new List<PrinterSettingsLayer>();
printerSettings.ActiveMaterialKey = "";
printerSettings.SetValue(SettingsKey.has_swappable_bed, "1");
@ -162,6 +162,11 @@ M300 S3000 P30 ; Resume Tone";
}
printerSettings.SetValue(SettingsKey.build_height, zHeight.ToString());
// make sure the start gcode travels fast to priming line
var startGCode = printerSettings.GetValue(SettingsKey.start_gcode);
startGCode = startGCode.Replace("G1 Y5 X5 Z0.8 F1800 ; Purge line", "G1 Y5 X5 [travel_speed] ; Purge line\\nG1 Z0.8 F1800");
printerSettings.SetValue(SettingsKey.start_gcode, startGCode);
}
// 32 bit settings

File diff suppressed because it is too large Load diff