diff --git a/xs/src/slic3r/AppController.cpp b/xs/src/slic3r/AppController.cpp index b5c9702f1..c9029f2be 100644 --- a/xs/src/slic3r/AppController.cpp +++ b/xs/src/slic3r/AppController.cpp @@ -73,147 +73,6 @@ void AppControllerBoilerplate::global_progress_indicator( pri_data_->m.unlock(); } -//void PrintController::make_skirt() -//{ -// assert(print_ != nullptr); - -// // prerequisites -// for(auto obj : print_->objects) make_perimeters(obj); -// for(auto obj : print_->objects) infill(obj); -// for(auto obj : print_->objects) gen_support_material(obj); - -// if(!print_->state.is_done(STEP_SKIRT)) { -// print_->state.set_started(STEP_SKIRT); -// print_->skirt.clear(); -// if(print_->has_skirt()) print_->_make_skirt(); - -// print_->state.set_done(STEP_SKIRT); -// } -//} - -//void PrintController::make_brim() -//{ -// assert(print_ != nullptr); - -// // prerequisites -// for(auto obj : print_->objects) make_perimeters(obj); -// for(auto obj : print_->objects) infill(obj); -// for(auto obj : print_->objects) gen_support_material(obj); -// make_skirt(); - -// if(!print_->state.is_done(STEP_BRIM)) { -// print_->state.set_started(STEP_BRIM); - -// // since this method must be idempotent, we clear brim paths *before* -// // checking whether we need to generate them -// print_->brim.clear(); - -// if(print_->config.brim_width > 0) print_->_make_brim(); - -// print_->state.set_done(STEP_BRIM); -// } -//} - -//void PrintController::make_wipe_tower() -//{ -// assert(print_ != nullptr); - -// // prerequisites -// for(auto obj : print_->objects) make_perimeters(obj); -// for(auto obj : print_->objects) infill(obj); -// for(auto obj : print_->objects) gen_support_material(obj); -// make_skirt(); -// make_brim(); - -// if(!print_->state.is_done(STEP_WIPE_TOWER)) { -// print_->state.set_started(STEP_WIPE_TOWER); - -// // since this method must be idempotent, we clear brim paths *before* -// // checking whether we need to generate them -// print_->brim.clear(); - -// if(print_->has_wipe_tower()) print_->_make_wipe_tower(); - -// print_->state.set_done(STEP_WIPE_TOWER); -// } -//} - -//void PrintController::slice(PrintObject *pobj) -//{ -// assert(pobj != nullptr && print_ != nullptr); - -// if(pobj->state.is_done(STEP_SLICE)) return; - -// pobj->state.set_started(STEP_SLICE); - -// pobj->_slice(); - -// auto msg = pobj->_fix_slicing_errors(); -// if(!msg.empty()) report_issue(IssueType::WARN, msg); - -// // simplify slices if required -// if (print_->config.resolution) -// pobj->_simplify_slices(scale_(print_->config.resolution)); - - -// if(pobj->layers.empty()) -// report_issue(IssueType::ERR, -// L("No layers were detected. You might want to repair your " -// "STL file(s) or check their size or thickness and retry") -// ); - -// pobj->state.set_done(STEP_SLICE); -//} - -//void PrintController::make_perimeters(PrintObject *pobj) -//{ -// assert(pobj != nullptr); - -// slice(pobj); - -// if (!pobj->state.is_done(STEP_PERIMETERS)) { -// pobj->_make_perimeters(); -// } -//} - -//void PrintController::infill(PrintObject *pobj) -//{ -// assert(pobj != nullptr); - -// make_perimeters(pobj); - -// if (!pobj->state.is_done(STEP_PREPARE_INFILL)) { -// pobj->state.set_started(STEP_PREPARE_INFILL); - -// pobj->_prepare_infill(); - -// pobj->state.set_done(STEP_PREPARE_INFILL); -// } - -// pobj->_infill(); -//} - -//void PrintController::gen_support_material(PrintObject *pobj) -//{ -// assert(pobj != nullptr); - -// // prerequisites -// slice(pobj); - -// if(!pobj->state.is_done(STEP_SUPPORTMATERIAL)) { -// pobj->state.set_started(STEP_SUPPORTMATERIAL); - -// pobj->clear_support_layers(); - -// if((pobj->config.support_material || pobj->config.raft_layers > 0) -// && pobj->layers.size() > 1) { -// pobj->_generate_support_material(); -// } - -// pobj->state.set_done(STEP_SUPPORTMATERIAL); -// } -//} - PrintController::PngExportData PrintController::query_png_export_data(const DynamicPrintConfig& conf) { @@ -245,39 +104,11 @@ PrintController::query_png_export_data(const DynamicPrintConfig& conf) void PrintController::slice(AppControllerBoilerplate::ProgresIndicatorPtr pri) { - auto st = pri->state(); + print_->set_status_callback([pri](int st, const std::string& msg){ + pri->update(unsigned(st), msg); + }); - Slic3r::trace(3, "Starting the slicing process."); - - pri->update(st+20, L("Generating perimeters")); -// for(auto obj : print_->objects) make_perimeters(obj); - - pri->update(st+60, L("Infilling layers")); -// for(auto obj : print_->objects) infill(obj); - - pri->update(st+70, L("Generating support material")); -// for(auto obj : print_->objects) gen_support_material(obj); - -// pri->message_fmt(L("Weight: %.1fg, Cost: %.1f"), -// print_->total_weight, print_->total_cost); - pri->state(st+85); - - - pri->update(st+88, L("Generating skirt")); - make_skirt(); - - - pri->update(st+90, L("Generating brim")); - make_brim(); - - pri->update(st+95, L("Generating wipe tower")); - make_wipe_tower(); - - pri->update(st+100, L("Done")); - - // time to make some statistics.. - - Slic3r::trace(3, L("Slicing process finished.")); + print_->process(); } void PrintController::slice()