@@ -195,6 +195,8 @@ std::string GCodeExport::flavorToString(const EGCodeFlavor& flavor)
195
195
return " Repetier" ;
196
196
case EGCodeFlavor::REPRAP:
197
197
return " RepRap" ;
198
+ case EGCodeFlavor::BAMBULAB:
199
+ return " BambuLab" ;
198
200
case EGCodeFlavor::MARLIN:
199
201
default :
200
202
return " Marlin" ;
@@ -302,7 +304,7 @@ std::string GCodeExport::getFileHeader(
302
304
303
305
prefix << " ;NOZZLE_DIAMETER:" << Application::getInstance ().current_slice_ ->scene .extruders [0 ].settings_ .get <double >(" machine_nozzle_size" ) << new_line_;
304
306
}
305
- else if (flavor_ == EGCodeFlavor::REPRAP || flavor_ == EGCodeFlavor::MARLIN || flavor_ == EGCodeFlavor::MARLIN_VOLUMATRIC)
307
+ else if (flavor_ == EGCodeFlavor::REPRAP || flavor_ == EGCodeFlavor::MARLIN || flavor_ == EGCodeFlavor::MARLIN_VOLUMATRIC || flavor_ == EGCodeFlavor::BAMBULAB )
306
308
{
307
309
prefix << " ;Filament used: " ;
308
310
if (filament_used.size () > 0 )
@@ -1319,6 +1321,12 @@ void GCodeExport::startExtruder(const size_t new_extruder)
1319
1321
extruder_attr_[new_extruder].is_used_ = true ;
1320
1322
if (new_extruder != current_extruder_) // wouldn't be the case on the very first extruder start if it's extruder 0
1321
1323
{
1324
+ if (flavor_ == EGCodeFlavor::BAMBULAB)
1325
+ {
1326
+ // Prepare AMS for extruder change
1327
+ *output_stream_ << " M620 S" << new_extruder << " A" << new_line_;
1328
+ }
1329
+
1322
1330
if (flavor_ == EGCodeFlavor::MAKERBOT)
1323
1331
{
1324
1332
*output_stream_ << " M135 T" << new_extruder << new_line_;
@@ -1594,7 +1602,7 @@ void GCodeExport::writeTemperatureCommand(const size_t extruder, const Temperatu
1594
1602
1595
1603
if (wait && flavor_ != EGCodeFlavor::MAKERBOT)
1596
1604
{
1597
- if (flavor_ == EGCodeFlavor::MARLIN)
1605
+ if (flavor_ == EGCodeFlavor::MARLIN || flavor_ == EGCodeFlavor::BAMBULAB )
1598
1606
{
1599
1607
*output_stream_ << " M105" << new_line_; // get temperatures from the last update, the M109 will not let get the target temperature
1600
1608
}
@@ -1638,7 +1646,7 @@ void GCodeExport::writeBedTemperatureCommand(const Temperature& temperature, con
1638
1646
{
1639
1647
if (wait )
1640
1648
{
1641
- if (flavor_ == EGCodeFlavor::MARLIN)
1649
+ if (flavor_ == EGCodeFlavor::MARLIN || flavor_ == EGCodeFlavor::BAMBULAB )
1642
1650
{
1643
1651
*output_stream_ << " M140 S" ; // set the temperature, it will be used as target temperature from M105
1644
1652
*output_stream_ << PrecisionedDouble{ 1 , temperature } << new_line_;
0 commit comments