Adding in an optional x carriage leveling markdown page

This will help get pulse printers leveled better
This commit is contained in:
Lars Brubaker 2019-04-04 10:35:38 -07:00
parent 301bc9e797
commit 55893499cb
5 changed files with 44 additions and 0 deletions

View file

@ -30,6 +30,7 @@ either expressed or implied, of the FreeBSD Project.
using System;
using System.Collections.Generic;
using System.Linq;
using Markdig.Agg;
using MatterHackers.Agg;
using MatterHackers.Localizations;
using MatterHackers.MatterControl.PrinterCommunication;
@ -227,6 +228,37 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
levelingStrings.HomingPageInstructions(useZProbe, hasHeatedBed),
useZProbe);
// if there is a level_x_cariage_markdown oem markdown page
if (!string.IsNullOrEmpty(printer.Settings.GetValue(SettingsKey.level_x_cariage_markdown)))
{
var levelXCariagePage = new WizardPage(this, "Level X Carriage".Localize(), "")
{
PageLoad = (page) =>
{
// release the motors so the z-axis can be moved
printer.Connection.ReleaseMotors();
var markdownText = printer.Settings.GetValue(SettingsKey.level_x_cariage_markdown);
var markdownWidget = new MarkdownWidget(ApplicationController.Instance.Theme);
markdownWidget.Markdown = markdownText = markdownText.Replace("\\n", "\n");
page.ContentRow.AddChild(markdownWidget);
},
PageClose = () =>
{
// home the printer again to make sure we are ready to level (same behavior as homing page)
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);
}
}
};
yield return levelXCariagePage;
}
// figure out the heating requirements
double targetBedTemp = 0;
double targetHotendTemp = 0;

View file

@ -99,6 +99,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
SettingsKey.ip_port,
SettingsKey.laser_speed_025,
SettingsKey.laser_speed_100,
SettingsKey.level_x_cariage_markdown,
SettingsKey.leveling_sample_points,
SettingsKey.load_filament_length,
SettingsKey.load_filament_speed,