Merge pull request #3685 from larsbrubaker/master
Make it possible to set the probe calibration position
This commit is contained in:
commit
0c7fac04da
12 changed files with 99 additions and 18 deletions
|
|
@ -49,6 +49,16 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
|
|||
this.printer = printer;
|
||||
}
|
||||
|
||||
public static Vector2 ProbeOffsetSamplePosition(PrinterConfig printer)
|
||||
{
|
||||
if (printer.Settings.GetValue<LevelingSystem>(SettingsKey.print_leveling_solution) == LevelingSystem.ProbeCustom)
|
||||
{
|
||||
return printer.Settings.GetValue<Vector2>(SettingsKey.probe_offset_sample_point);
|
||||
}
|
||||
|
||||
return printer.Settings.GetValue<Vector2>(SettingsKey.print_center);
|
||||
}
|
||||
|
||||
public IEnumerable<Vector2> GetSampleRing(int numberOfSamples, double ratio, double phase)
|
||||
{
|
||||
double bedRadius = Math.Min(printer.Settings.GetValue<Vector2>(SettingsKey.bed_size).X, printer.Settings.GetValue<Vector2>(SettingsKey.bed_size).Y) / 2;
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
|
|||
targetHotendTemp);
|
||||
|
||||
double startProbeHeight = printer.Settings.GetValue<double>(SettingsKey.print_leveling_probe_start);
|
||||
Vector2 probePosition = printer.Settings.GetValue<Vector2>(SettingsKey.print_center);
|
||||
Vector2 probePosition = LevelingPlan.ProbeOffsetSamplePosition(printer);
|
||||
|
||||
int i = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ either expressed or implied, of the FreeBSD Project.
|
|||
using System;
|
||||
using MatterHackers.Agg.UI;
|
||||
using MatterHackers.MatterControl.PrinterCommunication;
|
||||
using MatterHackers.MatterControl.SlicerConfiguration;
|
||||
|
||||
namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
|
||||
{
|
||||
|
|
@ -59,6 +60,12 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
|
|||
|
||||
printer.Connection.HomeAxis(PrinterConnection.Axis.XYZ);
|
||||
|
||||
if(!printer.Settings.GetValue<bool>(SettingsKey.z_homes_to_max))
|
||||
{
|
||||
// move so we don't heat the printer while the nozzle is touching the bed
|
||||
printer.Connection.MoveAbsolute(PrinterConnection.Axis.Z, 10, printer.Settings.Helpers.ManualMovementSpeeds().Z);
|
||||
}
|
||||
|
||||
if (autoAdvance)
|
||||
{
|
||||
nextButton.Enabled = false;
|
||||
|
|
|
|||
|
|
@ -140,19 +140,28 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
scene.SelectedItem = selectedItem;
|
||||
// No further processing needed, nothing to ungroup
|
||||
return Task.CompletedTask;
|
||||
|
||||
}
|
||||
|
||||
// build the ungroup list
|
||||
List<IObject3D> addItems = new List<IObject3D>(discreetMeshes.Select(mesh => new Object3D()
|
||||
{
|
||||
Mesh = mesh,
|
||||
Matrix = selectedItem.Matrix,
|
||||
}));
|
||||
|
||||
foreach(var item in addItems)
|
||||
{
|
||||
item.CopyProperties(selectedItem, Object3DPropertyFlags.All);
|
||||
item.Visible = true;
|
||||
}
|
||||
|
||||
// add and do the undo data
|
||||
scene.UndoBuffer.AddAndDo(new ReplaceCommand(new List<IObject3D> { selectedItem }, addItems));
|
||||
|
||||
foreach (var item in addItems)
|
||||
{
|
||||
item.MakeNameNonColliding();
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -168,6 +168,23 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
sliceSettingValue = this.GetValue(splitOnEquals[0], layerCascade);
|
||||
matchString = splitOnEquals[1];
|
||||
}
|
||||
else if (orItem.Contains(">"))
|
||||
{
|
||||
matchString = "no_match";
|
||||
string[] splitOnGreater = orItem.Split('>');
|
||||
|
||||
sliceSettingValue = this.GetValue(splitOnGreater[0], layerCascade);
|
||||
if (double.TryParse(sliceSettingValue, out double doubleValue))
|
||||
{
|
||||
if (double.TryParse(splitOnGreater[1], out double greater))
|
||||
{
|
||||
if (doubleValue > greater)
|
||||
{
|
||||
matchString = sliceSettingValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sliceSettingValue = this.GetValue(orItem, layerCascade);
|
||||
|
|
|
|||
|
|
@ -124,6 +124,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
public const string print_leveling_required_to_print = nameof(print_leveling_required_to_print);
|
||||
public const string print_leveling_solution = nameof(print_leveling_solution);
|
||||
public const string leveling_sample_points = nameof(leveling_sample_points);
|
||||
public const string probe_offset_sample_point = nameof(probe_offset_sample_point);
|
||||
public const string printer_name = nameof(printer_name);
|
||||
public const string progress_reporting = nameof(progress_reporting);
|
||||
public const string publish_bed_image = nameof(publish_bed_image);
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
SettingsKey.print_leveling_required_to_print,
|
||||
SettingsKey.print_leveling_solution,
|
||||
SettingsKey.leveling_sample_points,
|
||||
SettingsKey.probe_offset_sample_point,
|
||||
SettingsKey.recover_first_layer_speed,
|
||||
SettingsKey.number_of_first_layers,
|
||||
SettingsKey.recover_is_enabled,
|
||||
|
|
|
|||
|
|
@ -165,6 +165,7 @@ Printer
|
|||
Print Leveling
|
||||
print_leveling_solution
|
||||
leveling_sample_points
|
||||
probe_offset_sample_point
|
||||
print_leveling_required_to_print
|
||||
Leveling Probe
|
||||
print_leveling_probe_start
|
||||
|
|
|
|||
|
|
@ -730,12 +730,22 @@
|
|||
{
|
||||
"SlicerConfigName": "leveling_sample_points",
|
||||
"PresentationName": "Sample Points",
|
||||
"HelpText": "A comma separated list of sample points to probje the bed at. You must specify an x and y position for each point. For example: '20,20,100,180,180,20' will saple the bad at 3 points.",
|
||||
"HelpText": "A comma separated list of sample points to probe the bed at. You must specify an x and y position for each point. For example: '20,20,100,180,180,20' will saple the bad at 3 points.",
|
||||
"DataEditType": "MULTI_LINE_TEXT",
|
||||
"DefaultValue": "20,20,100,180,180,20",
|
||||
"ShowIfSet": "!sla_printer&!has_hardware_leveling&print_leveling_solution=Custom Points",
|
||||
"RebuildGCodeOnChange": false
|
||||
},
|
||||
{
|
||||
"SlicerConfigName": "probe_offset_sample_point",
|
||||
"PresentationName": "Probe Offset Sample Point",
|
||||
"HelpText": "The position to measure the probe offset.",
|
||||
"Units": "mm",
|
||||
"DataEditType": "VECTOR2",
|
||||
"DefaultValue": "100,100",
|
||||
"ShowIfSet": "!sla_printer&!has_hardware_leveling&print_leveling_solution=Custom Points&use_z_probe",
|
||||
"RebuildGCodeOnChange": false
|
||||
},
|
||||
{
|
||||
"SlicerConfigName": "print_leveling_required_to_print",
|
||||
"PresentationName": "Require Leveling To Print",
|
||||
|
|
@ -1189,7 +1199,7 @@
|
|||
"PresentationName": "Length on Tool Change",
|
||||
"HelpText": "When using multiple extruders, the distance filament will reverse before changing to a different extruder.",
|
||||
"DataEditType": "POSITIVE_DOUBLE",
|
||||
"ShowIfSet": "!sla_printer",
|
||||
"ShowIfSet": "!sla_printer&extruder_count>1",
|
||||
"Units": "mm",
|
||||
"EnableIfSet": "enable_retractions",
|
||||
"DefaultValue": "10"
|
||||
|
|
@ -1218,7 +1228,7 @@
|
|||
"PresentationName": "Extra Length After Tool Change",
|
||||
"HelpText": "Length of extra filament to extrude after a complete tool change (in addition to the re-extrusion of the tool change retraction distance).",
|
||||
"DataEditType": "POSITIVE_DOUBLE",
|
||||
"ShowIfSet": "!sla_printer",
|
||||
"ShowIfSet": "!sla_printer&extruder_count>1",
|
||||
"EnableIfSet": "enable_retractions",
|
||||
"Units": "mm zero to disable",
|
||||
"DefaultValue": "0"
|
||||
|
|
@ -1505,7 +1515,7 @@
|
|||
{
|
||||
"SlicerConfigName": "support_material_extruder",
|
||||
"PresentationName": "Support Material Extruder",
|
||||
"ShowIfSet": "!sla_printer",
|
||||
"ShowIfSet": "!sla_printer&extruder_count>1",
|
||||
"HelpText": "The index of the extruder to use for printing support material. Applicable only when Extruder Count is set to a value more than 1.",
|
||||
"DataEditType": "INT",
|
||||
"DefaultValue": "1"
|
||||
|
|
@ -1514,7 +1524,7 @@
|
|||
"SlicerConfigName": "raft_extruder",
|
||||
"PresentationName": "Raft Extruder",
|
||||
"HelpText": "The index of the extruder to use to print the raft. Set to 0 to use the support extruder index.",
|
||||
"ShowIfSet": "!sla_printer",
|
||||
"ShowIfSet": "!sla_printer&extruder_count>1",
|
||||
"EnableIfSet": "create_raft",
|
||||
"DataEditType": "INT",
|
||||
"DefaultValue": "0"
|
||||
|
|
@ -1523,7 +1533,7 @@
|
|||
"SlicerConfigName": "support_material_interface_extruder",
|
||||
"PresentationName": "Support Interface Extruder",
|
||||
"HelpText": "The index of the extruder to use for support material interface layer(s).",
|
||||
"ShowIfSet": "!sla_printer",
|
||||
"ShowIfSet": "!sla_printer&extruder_count>1",
|
||||
"DataEditType": "INT",
|
||||
"DefaultValue": "1"
|
||||
},
|
||||
|
|
@ -1655,14 +1665,14 @@
|
|||
"PresentationName": "Before Tool Change G-Code",
|
||||
"HelpText": "G-Code to be run before every tool change. You can use [wipe_tower_x] & [wipe_tower_y] to set the extruder position if needed.",
|
||||
"DataEditType": "MULTI_LINE_TEXT",
|
||||
"ShowIfSet": "!sla_printer",
|
||||
"ShowIfSet": "!sla_printer&extruder_count>1",
|
||||
"DefaultValue": ""
|
||||
},
|
||||
{
|
||||
"SlicerConfigName": "toolchange_gcode",
|
||||
"PresentationName": "After Tool Change G-Code",
|
||||
"HelpText": "G-Code to be run after every tool change. You can use [wipe_tower_x] & [wipe_tower_y] to set the extruder position if needed.",
|
||||
"ShowIfSet": "!sla_printer",
|
||||
"ShowIfSet": "!sla_printer&extruder_count>1",
|
||||
"DataEditType": "MULTI_LINE_TEXT",
|
||||
"DefaultValue": ""
|
||||
},
|
||||
|
|
@ -1671,14 +1681,14 @@
|
|||
"PresentationName": "Before Tool Change G-Code 2",
|
||||
"HelpText": "G-Code to be run before switching to extruder 2. Will use standard before G-Code if not set. You can use [wipe_tower_x] & [wipe_tower_y] to set the extruder position if needed.",
|
||||
"DataEditType": "MULTI_LINE_TEXT",
|
||||
"ShowIfSet": "!sla_printer",
|
||||
"ShowIfSet": "!sla_printer&extruder_count>1",
|
||||
"DefaultValue": ""
|
||||
},
|
||||
{
|
||||
"SlicerConfigName": "toolchange_gcode_1",
|
||||
"PresentationName": "After Tool Change G-Code 2",
|
||||
"HelpText": "G-Code to be run after switching to extruder 2. Will use standard after G-Code if not set. You can use [wipe_tower_x] & [wipe_tower_y] to set the extruder position if needed.",
|
||||
"ShowIfSet": "!sla_printer",
|
||||
"ShowIfSet": "!sla_printer&extruder_count>1",
|
||||
"DataEditType": "MULTI_LINE_TEXT",
|
||||
"DefaultValue": ""
|
||||
},
|
||||
|
|
@ -1798,7 +1808,7 @@
|
|||
"PresentationName": "Wipe Shield Distance",
|
||||
"HelpText": "Creates a perimeter around the part on which to wipe the other nozzle when printing using dual extrusion. Set to 0 to disable.",
|
||||
"DataEditType": "POSITIVE_DOUBLE",
|
||||
"ShowIfSet": "!sla_printer",
|
||||
"ShowIfSet": "!sla_printer&extruder_count>1",
|
||||
"Units": "mm",
|
||||
"DefaultValue": "0"
|
||||
},
|
||||
|
|
@ -1808,7 +1818,7 @@
|
|||
"HelpText": "The length and width of a tower created at the back left of the print used for wiping the next nozzle when changing between multiple extruders. Set to 0 to disable.",
|
||||
"DataEditType": "POSITIVE_DOUBLE",
|
||||
"Units": "mm",
|
||||
"ShowIfSet": "!sla_printer",
|
||||
"ShowIfSet": "!sla_printer&extruder_count>1",
|
||||
"DefaultValue": "0"
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit d96a853fdd15ac16fbda56be6f00b52490562cf3
|
||||
Subproject commit 23d9dc6637bd79541be1350b5c8395c7d3214efd
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 0713241a06f9766047df59ae9bde133cc28c2095
|
||||
Subproject commit 4d61415fe2ae91d1d67d3ee3023286bb27bef80c
|
||||
|
|
@ -50,6 +50,24 @@ namespace MatterControl.Tests.MatterControl
|
|||
Assert.IsTrue(profile.ParseShowString("!has_heated_bed", null));
|
||||
}
|
||||
|
||||
// test single >
|
||||
{
|
||||
string[] settings = new string[] { SettingsKey.extruder_count, "1" };
|
||||
var profile = GetProfile(settings);
|
||||
Assert.IsFalse(profile.ParseShowString("extruder_count>1", null));
|
||||
Assert.IsTrue(profile.ParseShowString("extruder_count>0", null));
|
||||
}
|
||||
|
||||
// test single >
|
||||
{
|
||||
string[] settings = new string[] { SettingsKey.extruder_count, "2" };
|
||||
var profile = GetProfile(settings);
|
||||
Assert.IsFalse(profile.ParseShowString("extruder_count>3", null));
|
||||
Assert.IsFalse(profile.ParseShowString("extruder_count>2", null));
|
||||
Assert.IsTrue(profile.ParseShowString("extruder_count>1", null));
|
||||
Assert.IsTrue(profile.ParseShowString("extruder_count>0", null));
|
||||
}
|
||||
|
||||
// test single if set to 1
|
||||
{
|
||||
string[] settings = new string[] { SettingsKey.has_heated_bed, "1" };
|
||||
|
|
@ -113,7 +131,9 @@ namespace MatterControl.Tests.MatterControl
|
|||
|
||||
// test list setting value
|
||||
{
|
||||
string[] settings = new string[] { SettingsKey.has_hardware_leveling, "0", SettingsKey.print_leveling_solution, "3 Point Plane" };
|
||||
string[] settings = new string[] { SettingsKey.has_hardware_leveling, "0",
|
||||
SettingsKey.print_leveling_solution, "3 Point Plane",
|
||||
SettingsKey.extruder_count, "2"};
|
||||
var profile = GetProfile(settings);
|
||||
Assert.IsTrue(profile.ParseShowString("!has_hardware_leveling&print_leveling_solution=3 Point Plane", null));
|
||||
Assert.IsTrue(profile.ParseShowString("!has_hardware_leveling&print_leveling_solution=3 Point Plane|print_leveling_solution=3x3 Mesh", null));
|
||||
|
|
@ -122,6 +142,11 @@ namespace MatterControl.Tests.MatterControl
|
|||
Assert.IsFalse(profile.ParseShowString("has_hardware_leveling&print_leveling_solution=3 Point Plane", null));
|
||||
Assert.IsFalse(profile.ParseShowString("!has_hardware_leveling&!print_leveling_solution=3 Point Plane", null));
|
||||
Assert.IsFalse(profile.ParseShowString("!has_hardware_leveling&print_leveling_solution=7 Point Disk", null));
|
||||
|
||||
Assert.IsFalse(profile.ParseShowString("!has_hardware_leveling&print_leveling_solution=3 Point Plane&extruder_count>2", null));
|
||||
Assert.IsFalse(profile.ParseShowString("!has_hardware_leveling&print_leveling_solution=3 Point Plane&extruder_count>2", null));
|
||||
Assert.IsTrue(profile.ParseShowString("!has_hardware_leveling&print_leveling_solution=3 Point Plane&extruder_count>1", null));
|
||||
Assert.IsTrue(profile.ParseShowString("!has_hardware_leveling&print_leveling_solution=3 Point Plane&extruder_count>0", null));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue