fix the public data for extruder that the panel uses
[clinton/Smoothieware.git] / src / modules / tools / extruder / Extruder.h
CommitLineData
ca037905 1/*
cd011f58
AW
2 This file is part of Smoothie (http://smoothieware.org/). The motion control part is heavily based on Grbl (https://github.com/simen/grbl).
3 Smoothie is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
4 Smoothie is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
ca037905 5 You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>.
cd011f58
AW
6*/
7
8
9
13ad7234 10#pragma once
4cff3ded 11
17c89e4d 12#include "Tool.h"
61134a65
JM
13#include "Pin.h"
14
de2ee57c
JM
15#include <tuple>
16
61134a65 17class StepperMotor;
4cff3ded 18
17c89e4d
JM
19// NOTE Tool is also a module, no need for multiple inheritance here
20class Extruder : public Tool {
4cff3ded 21 public:
13ad7234 22 Extruder(uint16_t config_identifier);
3494f3d0 23 virtual ~Extruder();
17c89e4d 24
8519d744 25 void on_module_loaded();
8519d744 26 void on_gcode_received(void*);
29e809e0
JM
27
28 void select();
29 void deselect();
4cff3ded 30
17c89e4d 31 private:
29e809e0 32 void config_load();
d87968be 33 void on_get_public_data(void* argument);
d467fcad 34 void on_set_public_data(void* argument);
fe484657 35 float check_max_speeds(float target, float isecs);
540c8365 36
13ad7234 37 StepperMotor *stepper_motor;
8a3ae3d0 38
ed68c716
JM
39 float extruder_multiplier; // flow rate 1.0 == 100%
40 float filament_diameter; // filament diameter
d467fcad 41 float volumetric_multiplier;
928467c0 42 float max_volumetric_rate; // used for calculating volumetric rate in mm³/sec
4cff3ded 43
ec6fde0b 44 // for firmware retract
ed68c716 45 float retract_length; // firmware retract length
d467fcad
JM
46 float retract_feedrate;
47 float retract_recover_feedrate;
48 float retract_recover_length;
49 float retract_zlift_length;
50 float retract_zlift_feedrate;
ec6fde0b 51
de2ee57c
JM
52 // for saving and restoring extruder position
53 std::tuple<float, float, int32_t> saved_position;
54
8a3ae3d0 55 struct {
13ad7234 56 uint8_t motor_id:8;
ec6fde0b 57 bool retracted:1;
78af0407 58 bool cancel_zlift_restore:1; // hack to stop a G11 zlift restore from overring an absolute Z setting
29e809e0 59 bool selected:1;
de2ee57c 60 bool saved_selected:1;
8a3ae3d0 61 };
4cff3ded 62};