Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add klipper support for changing filament #1359

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/app/config/config.default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const defaultConfig: Config = {
name: '',
xySpeed: 150,
zSpeed: 5,
disableExtruderGCode: 'M18 E',
zBabystepGCode: 'M290 Z',
defaultTemperatureFanSpeed: {
hotend: 200,
Expand Down
1 change: 1 addition & 0 deletions src/app/config/config.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ interface Printer {
name: string;
xySpeed: number;
zSpeed: number;
disableExtruderGCode: string;
zBabystepGCode: string;
defaultTemperatureFanSpeed: DefaultTemperatureFanSpeed;
}
Expand Down
7 changes: 6 additions & 1 deletion src/app/config/config.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const configSchema = {
printer: {
$id: '#/properties/printer',
type: 'object',
required: ['name', 'xySpeed', 'zSpeed', 'zBabystepGCode', 'defaultTemperatureFanSpeed'],
required: ['name', 'xySpeed', 'zSpeed', 'disableExtruderGCode', 'zBabystepGCode', 'defaultTemperatureFanSpeed'],
properties: {
name: {
$id: '#/properties/printer/properties/name',
Expand All @@ -40,6 +40,11 @@ export const configSchema = {
$id: '#/properties/printer/properties/zSpeed',
type: 'integer',
},
disableExtruderGCode: {
$id: '#/properties/printer/properties/disableExtruderGCode',
type: 'string',
pattern: '^(.*)$',
},
zBabystepGCode: {
$id: '#/properties/printer/properties/zBabystepGCode',
type: 'string',
Expand Down
4 changes: 4 additions & 0 deletions src/app/config/config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ export class ConfigService {
return this.config.octoprint.accessToken;
}

public getDisableExtruderGCode(): string {
return this.config.printer.disableExtruderGCode;
}

public getZBabystepGCode(): string {
return this.config.printer.zBabystepGCode;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class ChangeFilamentComponent implements OnInit {
}

private disableExtruderStepper(): void {
this.printerService.executeGCode('M18 E ');
this.printerService.executeGCode(`${this.configService.getDisableExtruderGCode()}`);
}

private initiateM600FilamentChange(): void {
Expand Down