Made it configurable if the motors are released automatically at the end of a print

This commit is contained in:
LarsBrubaker 2017-12-03 14:40:50 -08:00
parent 5a50457629
commit 0353aab30c
7 changed files with 19 additions and 4 deletions

View file

@ -1712,9 +1712,13 @@ namespace MatterHackers.MatterControl.PrinterCommunication
serialPort.DtrEnable = true;
}
public void ReleaseMotors()
public void ReleaseMotors(bool forceRelease = false)
{
SendLineToPrinterNow("M84");
if (forceRelease
|| this.printer.Settings.GetValue<bool>(SettingsKey.auto_release_motors))
{
SendLineToPrinterNow("M84");
}
}
public void RequestPause()

View file

@ -184,7 +184,7 @@ namespace MatterHackers.MatterControl.PrinterControls
disableMotors.Margin = new BorderDouble(0);
disableMotors.Click += (s, e) =>
{
printer.Connection.ReleaseMotors();
printer.Connection.ReleaseMotors(true);
};
homeButtonBar.AddChild(homeIconImageWidget);

View file

@ -117,6 +117,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
public const string number_of_first_layers = nameof(number_of_first_layers);
public const string recover_is_enabled = nameof(recover_is_enabled);
public const string recover_position_before_z_home = nameof(recover_position_before_z_home);
public const string auto_release_motors = nameof(auto_release_motors);
public const string resume_gcode = nameof(resume_gcode);
public const string show_reset_connection = nameof(show_reset_connection);
public const string sla_printer = nameof(sla_printer);

View file

@ -79,6 +79,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
SettingsKey.number_of_first_layers,
SettingsKey.recover_is_enabled,
SettingsKey.recover_position_before_z_home,
SettingsKey.auto_release_motors,
SettingsKey.resume_gcode,
SettingsKey.temperature,
SettingsKey.enable_retractions,

View file

@ -298,6 +298,7 @@ Advanced
Behavior
z_homes_to_max
heat_extruder_before_homing
auto_release_motors
validate_layer_height
send_with_checksum
reset_long_extrusion

View file

@ -481,6 +481,14 @@
"ShowIfSet": "!sla_printer",
"DefaultValue": "205"
},
{
"SlicerConfigName": "auto_release_motors",
"PresentationName": "Auto Release Motors",
"HelpText": "Turn off motor current at end of print or after cancel print.",
"DataEditType": "CHECK_BOX",
"ShowIfSet": "!sla_printer",
"DefaultValue": "1"
},
{
"SlicerConfigName": "g0",
"PresentationName": "Use G0",

@ -1 +1 @@
Subproject commit c68eeaea48151c0c10328f704d73ead0e95005db
Subproject commit 3d9c6a089683cc71a9eefd5241f91531928e6317