mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-04-06 08:42:05 +02:00
Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
abb6676b65 | ||
|
|
8d0111721a | ||
|
|
4576ea4287 | ||
|
|
a0af14fc80 | ||
|
|
ce0fd3736e | ||
|
|
6ddf2e8c08 | ||
|
|
f06171f551 | ||
|
|
4f53ef9316 | ||
|
|
eeb8b6eb37 | ||
|
|
264b0ee891 | ||
|
|
4a20f7c22a | ||
|
|
5bb0addb3d | ||
|
|
57755c766c | ||
|
|
b77682c13f | ||
|
|
bcff4f81c2 | ||
|
|
f18550bd9d | ||
|
|
44c2c235c0 | ||
|
|
fcf490028a | ||
|
|
9d85a7f216 | ||
|
|
d039fc95ed | ||
|
|
e022c5ad5b | ||
|
|
ff2cf17a73 | ||
|
|
88c0fea06f | ||
|
|
3af2c20bb2 | ||
|
|
0355d0297e | ||
|
|
d3326f9f0c |
31
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
31
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**3mf File for This Bug**
|
||||
If it is related to slicing, please append the 3mf file. It could be extremely helpful to solve the issue.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. iOS, Windows]
|
||||
- Version [e.g. 22]
|
||||
10
.github/ISSUE_TEMPLATE/custom.md
vendored
Normal file
10
.github/ISSUE_TEMPLATE/custom.md
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
name: Custom issue template
|
||||
about: For generic ideas such as enhancement of a feature, some questions, and etc.
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
|
||||
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: feature
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
26
README.md
26
README.md
@@ -7,6 +7,25 @@ You can download it here: https://github.com/SoftFever/BambuStudio-SoftFever/rel
|
||||
|
||||
## BambuStudio SoftFever change notes:
|
||||
|
||||
### [V1.3.3 changes](https://github.com/SoftFever/BambuStudio-SoftFever/releases/tag/v1.3.3):
|
||||
1. Improve top surface quality.
|
||||
Fix a bug that internal solid infills didn't use monotonic when top surface is using monotonic lines
|
||||
2. New feature: filter out tiny gaps.
|
||||
Note: for aesthetic considerations, this setting won't affect top/bottom layers. In other words, gap fills that can be seen from outside won't be filtered out
|
||||
3. PA(pressure advance) now support multi-color printing. A new PA value from the selected filament profile will be applied whenever there is
|
||||
a filament/extruder change action. This change only affects multi-color printing.
|
||||
5. Users can now set float values of layer time in Filament->Cooling tab.
|
||||
6. Allow to set target bed temp to 0
|
||||
7. Fix a bug that layer number is not displayed correctly in klipper UIs
|
||||
8. Force using linear PA model when manual PA override is enabled for Bambu machines
|
||||
9. Remember the last used filament
|
||||
10. Skip checking BL network plugin for third-party printers.
|
||||
### [V1.3.2 changes](https://github.com/SoftFever/BambuStudio-SoftFever/releases/tag/v1.3.2-sf):
|
||||
1. Support device control view for 3rd party printers
|
||||
2. Port `Small perimeters` feature from PrusaSlicer. I also add an extra option to adjust the small perimeter threshold
|
||||
You might want to reduce speed for small perimeter parts to prevent failures like bellow:
|
||||
3. Add fan speed preview mode
|
||||
4. Fix an issue that print time estimation is inaccurate when `Klipper` g-code style is used.
|
||||
### [V1.3.1 changes](https://github.com/SoftFever/BambuStudio-SoftFever/releases/tag/v1.3.1-sf):
|
||||
1. Support change bed size and nozzle diameter
|
||||
2. Allow users to specify the bridge infill direction
|
||||
@@ -56,11 +75,14 @@ You can download it here: https://github.com/SoftFever/BambuStudio-SoftFever/rel
|
||||
Demo video: https://youtu.be/vSNE9iGj2II
|
||||
|
||||
## NOTE:
|
||||
## - If you have troubles to run the build, you might need to install following runtimes:
|
||||
## 1. For Apple M1 users, please take a look at this [article](https://www.howtogeek.com/803598/app-is-damaged-and-cant-be-opened/ ) about how to run unsigned applications on your machine. Or better, you can build it from the source codes if you want:)
|
||||
Apple requires a subscription(costs 99$ yearly) for developers to sign their app. I don't do a lot of dev work on Mac, and this is a nonprofit open-source project, so I decided not to pay the money ;)
|
||||
|
||||
## 2. If you have troubles to run the build, you might need to install following runtimes:
|
||||
- [MicrosoftEdgeWebView2RuntimeInstallerX64](https://github.com/SoftFever/BambuStudio-SoftFever/releases/download/v1.0.10-sf2/MicrosoftEdgeWebView2RuntimeInstallerX64.exe)
|
||||
- [vcredist2019_x64](https://github.com/SoftFever/BambuStudio-SoftFever/releases/download/v1.0.10-sf2/vcredist2019_x64.exe)
|
||||
|
||||
## - BambuStudio use G2/G3 commands by default. You need to turn on ARC support in your printer's firmware use with this slicer.
|
||||
## 3. BambuStudio use G2/G3 commands by default. You need to turn on ARC support in your printer's firmware use with this slicer.
|
||||
- For Voron and any Klipper based printers:
|
||||
You can enable gcode_arcs(G2/G3) support by adding following section into you printer.cfg file:
|
||||
```
|
||||
|
||||
BIN
SoftFever_doc/sandwich-mode1.png
Normal file
BIN
SoftFever_doc/sandwich-mode1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 228 KiB |
BIN
SoftFever_doc/sandwich-mode2.png
Normal file
BIN
SoftFever_doc/sandwich-mode2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 214 KiB |
@@ -5519,6 +5519,9 @@ msgstr "内圈墙/外圈墙/填充的打印顺序"
|
||||
msgid "inner/outer/infill"
|
||||
msgstr "内墙/外墙/填充"
|
||||
|
||||
msgid "inner-outer-inner/infill"
|
||||
msgstr "内墙/外墙/内墙/填充"
|
||||
|
||||
msgid "outer/inner/infill"
|
||||
msgstr "外墙/内墙/填充"
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -26,7 +26,7 @@
|
||||
<br/>
|
||||
|
||||
<div>
|
||||
<input id="ChoosePrivacy" type="checkbox" checked onClick="SendPrivacySelect()" onChange="SendPrivacySelect()" />
|
||||
<input id="ChoosePrivacy" type="checkbox" onClick="SendPrivacySelect()" onChange="SendPrivacySelect()" />
|
||||
<span class="trans" tid="t7">Allow sending anonymous data</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<br/>
|
||||
|
||||
<div>
|
||||
<input id="ChoosePrivacy" type="checkbox" checked onClick="SendPrivacySelect()" onChange="SendPrivacySelect()" />
|
||||
<input id="ChoosePrivacy" type="checkbox" onClick="SendPrivacySelect()" onChange="SendPrivacySelect()" />
|
||||
<span class="trans" tid="t7">Allow sending anonymous data</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1150,7 +1150,7 @@ ConfigSubstitutions ConfigBase::load_from_gcode_file(const std::string &file, Fo
|
||||
bool end_found = false;
|
||||
std::string line;
|
||||
while (std::getline(ifs, line))
|
||||
if (line == "; CONFIG_BLOCK_START") {
|
||||
if (line.rfind("; CONFIG_BLOCK_START",0)==0) {
|
||||
begin_found = true;
|
||||
break;
|
||||
}
|
||||
@@ -1160,7 +1160,7 @@ ConfigSubstitutions ConfigBase::load_from_gcode_file(const std::string &file, Fo
|
||||
}
|
||||
std::string key, value;
|
||||
while (std::getline(ifs, line)) {
|
||||
if (line == "; CONFIG_BLOCK_END") {
|
||||
if (line.rfind("; CONFIG_BLOCK_END",0)==0) {
|
||||
end_found = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2092,40 +2092,45 @@ static bool custom_gcode_sets_temperature(const std::string &gcode, const int mc
|
||||
// Do not process this piece of G-code by the time estimator, it already knows the values through another sources.
|
||||
void GCode::print_machine_envelope(GCodeOutputStream &file, Print &print)
|
||||
{
|
||||
if (print.config().gcode_flavor.value == gcfMarlinLegacy || print.config().gcode_flavor.value == gcfMarlinFirmware) {
|
||||
const auto flavor = print.config().gcode_flavor.value;
|
||||
if (flavor == gcfMarlinLegacy || flavor == gcfMarlinFirmware) {
|
||||
int factor = flavor == gcfRepRapFirmware ? 60 : 1; // RRF M203 and M566 are in mm/min
|
||||
file.write_format("M201 X%d Y%d Z%d E%d\n",
|
||||
int(print.config().machine_max_acceleration_x.values.front() + 0.5),
|
||||
int(print.config().machine_max_acceleration_y.values.front() + 0.5),
|
||||
int(print.config().machine_max_acceleration_z.values.front() + 0.5),
|
||||
int(print.config().machine_max_acceleration_e.values.front() + 0.5));
|
||||
file.write_format("M203 X%d Y%d Z%d E%d\n",
|
||||
int(print.config().machine_max_speed_x.values.front() + 0.5),
|
||||
int(print.config().machine_max_speed_y.values.front() + 0.5),
|
||||
int(print.config().machine_max_speed_z.values.front() + 0.5),
|
||||
int(print.config().machine_max_speed_e.values.front() + 0.5));
|
||||
int(print.config().machine_max_speed_x.values.front() * factor + 0.5),
|
||||
int(print.config().machine_max_speed_y.values.front() * factor + 0.5),
|
||||
int(print.config().machine_max_speed_z.values.front() * factor + 0.5),
|
||||
int(print.config().machine_max_speed_e.values.front() * factor + 0.5));
|
||||
|
||||
// Now M204 - acceleration. This one is quite hairy thanks to how Marlin guys care about
|
||||
// Legacy Marlin should export travel acceleration the same as printing acceleration.
|
||||
// MarlinFirmware has the two separated.
|
||||
int travel_acc = print.config().gcode_flavor == gcfMarlinLegacy
|
||||
int travel_acc = flavor == gcfMarlinLegacy
|
||||
? int(print.config().machine_max_acceleration_extruding.values.front() + 0.5)
|
||||
: int(print.config().machine_max_acceleration_travel.values.front() + 0.5);
|
||||
file.write_format("M204 P%d R%d T%d\n",
|
||||
int(print.config().machine_max_acceleration_extruding.values.front() + 0.5),
|
||||
int(print.config().machine_max_acceleration_retracting.values.front() + 0.5),
|
||||
travel_acc);
|
||||
|
||||
if (flavor == gcfRepRapFirmware)
|
||||
file.write_format("M204 P%d T%d ; sets acceleration (P, T), mm/sec^2\n",
|
||||
int(print.config().machine_max_acceleration_extruding.values.front() + 0.5),
|
||||
travel_acc);
|
||||
else
|
||||
file.write_format("M204 P%d R%d T%d\n",
|
||||
int(print.config().machine_max_acceleration_extruding.values.front() + 0.5),
|
||||
int(print.config().machine_max_acceleration_retracting.values.front() + 0.5),
|
||||
travel_acc);
|
||||
|
||||
assert(is_decimal_separator_point());
|
||||
file.write_format("M205 X%.2lf Y%.2lf Z%.2lf E%.2lf\n",
|
||||
print.config().machine_max_jerk_x.values.front(),
|
||||
print.config().machine_max_jerk_y.values.front(),
|
||||
print.config().machine_max_jerk_z.values.front(),
|
||||
print.config().machine_max_jerk_e.values.front());
|
||||
//BBS: don't support M205 Sx Tx
|
||||
//file.write_format("M205 S%d T%d\n",
|
||||
// int(print.config().machine_min_extruding_rate.values.front() + 0.5),
|
||||
// int(print.config().machine_min_travel_rate.values.front() + 0.5));
|
||||
file.write_format(flavor == gcfRepRapFirmware
|
||||
? "M566 X%.2lf Y%.2lf Z%.2lf E%.2lf ; sets the jerk limits, mm/min\n"
|
||||
: "M205 X%.2lf Y%.2lf Z%.2lf E%.2lf ; sets the jerk limits, mm/sec\n",
|
||||
print.config().machine_max_jerk_x.values.front() * factor,
|
||||
print.config().machine_max_jerk_y.values.front() * factor,
|
||||
print.config().machine_max_jerk_z.values.front() * factor,
|
||||
print.config().machine_max_jerk_e.values.front() * factor);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3304,7 +3309,8 @@ std::string GCode::extrude_loop(ExtrusionLoop loop, std::string description, dou
|
||||
if (!m_config.spiral_mode && description == "perimeter") {
|
||||
assert(m_layer != nullptr);
|
||||
bool is_outer_wall_first = m_config.wall_infill_order == WallInfillOrder::OuterInnerInfill
|
||||
|| m_config.wall_infill_order == WallInfillOrder::InfillOuterInner;
|
||||
|| m_config.wall_infill_order == WallInfillOrder::InfillOuterInner
|
||||
|| m_config.wall_infill_order == WallInfillOrder::InnerOuterInnerInfill;
|
||||
m_seam_placer.place_seam(m_layer, loop, is_outer_wall_first, this->last_pos());
|
||||
} else
|
||||
loop.split_at(last_pos, false);
|
||||
|
||||
@@ -911,12 +911,17 @@ void GCodeProcessor::apply_config(const PrintConfig& config)
|
||||
m_result.filament_vitrification_temperature[i] = static_cast<float>(config.temperature_vitrification.get_at(i));
|
||||
}
|
||||
|
||||
if (m_flavor == gcfMarlinLegacy || m_flavor == gcfMarlinFirmware || m_flavor == gcfKlipper) {
|
||||
if (m_flavor == gcfMarlinLegacy || m_flavor == gcfMarlinFirmware || m_flavor == gcfKlipper || m_flavor == gcfRepRapFirmware) {
|
||||
m_time_processor.machine_limits = reinterpret_cast<const MachineEnvelopeConfig&>(config);
|
||||
if (m_flavor == gcfMarlinLegacy) {
|
||||
// Legacy Marlin does not have separate travel acceleration, it uses the 'extruding' value instead.
|
||||
m_time_processor.machine_limits.machine_max_acceleration_travel = m_time_processor.machine_limits.machine_max_acceleration_extruding;
|
||||
}
|
||||
if (m_flavor == gcfRepRapFirmware) {
|
||||
// RRF does not support setting min feedrates. Set them to zero.
|
||||
m_time_processor.machine_limits.machine_min_travel_rate.values.assign(m_time_processor.machine_limits.machine_min_travel_rate.size(), 0.);
|
||||
m_time_processor.machine_limits.machine_min_extruding_rate.values.assign(m_time_processor.machine_limits.machine_min_extruding_rate.size(), 0.);
|
||||
}
|
||||
}
|
||||
|
||||
// Filament load / unload times are not specific to a firmware flavor. Let anybody use it if they find it useful.
|
||||
|
||||
@@ -99,8 +99,13 @@ public:
|
||||
}
|
||||
|
||||
WipeTowerWriter& disable_linear_advance() {
|
||||
m_gcode += (m_gcode_flavor == gcfKlipper ? (std::string("SET_PRESSURE_ADVANCE ADVANCE=0\n"))
|
||||
: std::string("M900 K0\n"));
|
||||
if(m_gcode_flavor == gcfKlipper)
|
||||
m_gcode += "SET_PRESSURE_ADVANCE ADVANCE=0\n";
|
||||
else if(m_gcode_flavor == gcfRepRapFirmware)
|
||||
m_gcode += std::string("M572 D") + std::to_string(m_current_tool) + " S0\n";
|
||||
else
|
||||
m_gcode += "M900 K0\n";
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,9 +22,12 @@ void GCodeWriter::apply_print_config(const PrintConfig &print_config)
|
||||
{
|
||||
this->config.apply(print_config, true);
|
||||
m_single_extruder_multi_material = print_config.single_extruder_multi_material.value;
|
||||
bool is_marlin = print_config.gcode_flavor.value == gcfMarlinLegacy || print_config.gcode_flavor.value == gcfMarlinFirmware || print_config.gcode_flavor.value == gcfKlipper;
|
||||
m_max_acceleration = std::lrint(is_marlin ? print_config.machine_max_acceleration_extruding.values.front() : 0);
|
||||
m_max_jerk = std::lrint(is_marlin ? std::min(print_config.machine_max_jerk_x.values.front(), print_config.machine_max_jerk_y.values.front()) : 0);
|
||||
bool use_mach_limits = print_config.gcode_flavor.value == gcfMarlinLegacy ||
|
||||
print_config.gcode_flavor.value == gcfMarlinFirmware ||
|
||||
print_config.gcode_flavor.value == gcfKlipper ||
|
||||
print_config.gcode_flavor.value == gcfRepRapFirmware;
|
||||
m_max_acceleration = std::lrint(use_mach_limits ? print_config.machine_max_acceleration_extruding.values.front() : 0);
|
||||
m_max_jerk = std::lrint(use_mach_limits ? std::min(print_config.machine_max_jerk_x.values.front(), print_config.machine_max_jerk_y.values.front()) : 0);
|
||||
}
|
||||
|
||||
void GCodeWriter::set_extruders(std::vector<unsigned int> extruder_ids)
|
||||
|
||||
@@ -667,18 +667,37 @@ void PerimeterGenerator::process()
|
||||
}
|
||||
// at this point, all loops should be in contours[0]
|
||||
ExtrusionEntityCollection entities = traverse_loops(*this, contours.front(), thin_walls);
|
||||
|
||||
// if brim will be printed, reverse the order of perimeters so that
|
||||
// we continue inwards after having finished the brim
|
||||
// TODO: add test for perimeter order
|
||||
bool is_outer_wall_first =
|
||||
bool is_outer_wall_first =
|
||||
this->print_config->wall_infill_order == WallInfillOrder::OuterInnerInfill ||
|
||||
this->print_config->wall_infill_order == WallInfillOrder::InfillOuterInner;
|
||||
this->print_config->wall_infill_order == WallInfillOrder::InfillOuterInner ||
|
||||
this->print_config->wall_infill_order == WallInfillOrder::InnerOuterInnerInfill;
|
||||
if (is_outer_wall_first ||
|
||||
//BBS: always print outer wall first when there indeed has brim.
|
||||
(this->layer_id == 0 &&
|
||||
this->object_config->brim_type == BrimType::btOuterOnly &&
|
||||
this->object_config->brim_width.value > 0))
|
||||
entities.reverse();
|
||||
this->object_config->brim_type == BrimType::btOuterOnly &&
|
||||
this->object_config->brim_width.value > 0))
|
||||
{
|
||||
if (this->print_config->wall_infill_order == WallInfillOrder::InnerOuterInnerInfill) {
|
||||
if (entities.entities.size() > 1) {
|
||||
std::vector<int> extPs;
|
||||
for (int i = 0; i < entities.entities.size(); ++i) {
|
||||
if (entities.entities[i]->role() == erExternalPerimeter)
|
||||
extPs.push_back(i);
|
||||
}
|
||||
for (int i = 0; i < extPs.size(); ++i) {
|
||||
if (extPs[i] == 0 || (i > 0 && extPs[i] - 1 == extPs[i - 1]))
|
||||
continue;
|
||||
std::swap(entities.entities[extPs[i]], entities.entities[extPs[i] - 1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
entities.reverse();
|
||||
}
|
||||
// append perimeters for this slice as a collection
|
||||
if (! entities.empty())
|
||||
this->loops->append(entities);
|
||||
|
||||
@@ -159,6 +159,7 @@ CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(IroningType)
|
||||
static t_config_enum_values s_keys_map_WallInfillOrder {
|
||||
{ "inner wall/outer wall/infill", int(WallInfillOrder::InnerOuterInfill) },
|
||||
{ "outer wall/inner wall/infill", int(WallInfillOrder::OuterInnerInfill) },
|
||||
{ "inner-outer-inner wall/infill", int(WallInfillOrder::InnerOuterInnerInfill) },
|
||||
{ "infill/inner wall/outer wall", int(WallInfillOrder::InfillInnerOuter) },
|
||||
{ "infill/outer wall/inner wall", int(WallInfillOrder::InfillOuterInner) }
|
||||
};
|
||||
@@ -1000,10 +1001,12 @@ void PrintConfigDef::init_fff_params()
|
||||
def->enum_values.push_back("outer wall/inner wall/infill");
|
||||
def->enum_values.push_back("infill/inner wall/outer wall");
|
||||
def->enum_values.push_back("infill/outer wall/inner wall");
|
||||
def->enum_values.push_back("inner-outer-inner wall/infill");
|
||||
def->enum_labels.push_back(L("inner/outer/infill"));
|
||||
def->enum_labels.push_back(L("outer/inner/infill"));
|
||||
def->enum_labels.push_back(L("infill/inner/outer"));
|
||||
def->enum_labels.push_back(L("infill/outer/inner"));
|
||||
def->enum_labels.push_back(L("inner-outer-inner/infill"));
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionEnum<WallInfillOrder>(WallInfillOrder::InnerOuterInfill));
|
||||
|
||||
@@ -1567,7 +1570,7 @@ void PrintConfigDef::init_fff_params()
|
||||
def->enum_keys_map = &ConfigOptionEnum<GCodeFlavor>::get_enum_values();
|
||||
def->enum_values.push_back("marlin");
|
||||
def->enum_values.push_back("klipper");
|
||||
//def->enum_values.push_back("reprapfirmware");
|
||||
def->enum_values.push_back("reprapfirmware");
|
||||
//def->enum_values.push_back("repetier");
|
||||
//def->enum_values.push_back("teacup");
|
||||
//def->enum_values.push_back("makerware");
|
||||
@@ -1578,8 +1581,9 @@ void PrintConfigDef::init_fff_params()
|
||||
//def->enum_values.push_back("smoothie");
|
||||
//def->enum_values.push_back("no-extrusion");
|
||||
def->enum_labels.push_back("Marlin(legacy)");
|
||||
def->enum_labels.push_back(L("Klipper"));
|
||||
def->enum_labels.push_back("RepRapFirmware");
|
||||
//def->enum_labels.push_back("RepRap/Sprinter");
|
||||
//def->enum_labels.push_back("RepRapFirmware");
|
||||
//def->enum_labels.push_back("Repetier");
|
||||
//def->enum_labels.push_back("Teacup");
|
||||
//def->enum_labels.push_back("MakerWare (MakerBot)");
|
||||
@@ -1589,7 +1593,6 @@ void PrintConfigDef::init_fff_params()
|
||||
//def->enum_labels.push_back("Machinekit");
|
||||
//def->enum_labels.push_back("Smoothie");
|
||||
//def->enum_labels.push_back(L("No extrusion"));
|
||||
def->enum_labels.push_back(L("Klipper"));
|
||||
def->mode = comAdvanced;
|
||||
def->readonly = false;
|
||||
def->set_default_value(new ConfigOptionEnum<GCodeFlavor>(gcfMarlinLegacy));
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
namespace Slic3r {
|
||||
|
||||
enum GCodeFlavor : unsigned char {
|
||||
gcfMarlinLegacy, gcfKlipper, gcfRepRapSprinter, gcfRepRapFirmware, gcfRepetier, gcfTeacup, gcfMakerWare, gcfMarlinFirmware, gcfSailfish, gcfMach3, gcfMachinekit,
|
||||
gcfMarlinLegacy, gcfKlipper, gcfRepRapFirmware, gcfRepRapSprinter, gcfRepetier, gcfTeacup, gcfMakerWare, gcfMarlinFirmware, gcfSailfish, gcfMach3, gcfMachinekit,
|
||||
gcfSmoothie, gcfNoExtrusion
|
||||
};
|
||||
|
||||
@@ -75,6 +75,7 @@ enum class WallInfillOrder {
|
||||
OuterInnerInfill,
|
||||
InfillInnerOuter,
|
||||
InfillOuterInner,
|
||||
InnerOuterInnerInfill,
|
||||
Count,
|
||||
};
|
||||
//BBS
|
||||
|
||||
@@ -1097,10 +1097,11 @@ void GUI_App::post_init()
|
||||
|
||||
std::string http_url = get_http_url(app_config->get_country_code());
|
||||
std::string language = GUI::into_u8(current_language_code());
|
||||
this->preset_updater->sync(http_url, language, preset_bundle);
|
||||
std::string network_ver = Slic3r::NetworkAgent::get_version();
|
||||
this->preset_updater->sync(http_url, language, network_ver, preset_bundle);
|
||||
|
||||
//BBS: check new version
|
||||
this->check_new_version();
|
||||
//this->check_new_version();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2225,6 +2226,7 @@ bool GUI_App::on_init_inner()
|
||||
|
||||
Bind(EVT_USER_LOGIN, &GUI_App::on_user_login, this);
|
||||
|
||||
copy_network_if_available();
|
||||
on_init_network();
|
||||
|
||||
//BBS if load user preset failed
|
||||
@@ -2386,6 +2388,59 @@ bool GUI_App::on_init_inner()
|
||||
return true;
|
||||
}
|
||||
|
||||
void GUI_App::copy_network_if_available()
|
||||
{
|
||||
std::string network_library, player_library, network_library_dst, player_library_dst;
|
||||
std::string data_dir_str = data_dir();
|
||||
boost::filesystem::path data_dir_path(data_dir_str);
|
||||
auto plugin_folder = data_dir_path / "plugins";
|
||||
auto cache_folder = data_dir_path / "ota";
|
||||
#if defined(_MSC_VER) || defined(_WIN32)
|
||||
network_library = cache_folder.string() + "/bambu_networking.dll";
|
||||
player_library = cache_folder.string() + "/BambuSource.dll";
|
||||
network_library_dst = plugin_folder.string() + "/bambu_networking.dll";
|
||||
player_library_dst = plugin_folder.string() + "/BambuSource.dll";
|
||||
#elif defined(__WXMAC__)
|
||||
network_library = cache_folder.string() + "/libbambu_networking.dylib";
|
||||
player_library = cache_folder.string() + "/libBambuSource.dylib";
|
||||
network_library_dst = plugin_folder.string() + "/libbambu_networking.dylib";
|
||||
player_library_dst = plugin_folder.string() + "/libBambuSource.dylib";
|
||||
#else
|
||||
network_library = cache_folder.string() + "/libbambu_networking.so";
|
||||
player_library = cache_folder.string() + "/libBambuSource.so";
|
||||
network_library_dst = plugin_folder.string() + "/libbambu_networking.so";
|
||||
player_library_dst = plugin_folder.string() + "/libBambuSource.so";
|
||||
#endif
|
||||
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< ": checking network_library " << network_library << ", player_library " << player_library;
|
||||
std::string error_message;
|
||||
if (boost::filesystem::exists(network_library)) {
|
||||
CopyFileResult cfr = copy_file(network_library, network_library_dst, error_message, false);
|
||||
if (cfr != CopyFileResult::SUCCESS) {
|
||||
BOOST_LOG_TRIVIAL(error) << __FUNCTION__<< ": Copying failed(" << cfr << "): " << error_message;
|
||||
return;
|
||||
}
|
||||
|
||||
static constexpr const auto perms = fs::owner_read | fs::owner_write | fs::group_read | fs::others_read;
|
||||
fs::permissions(network_library_dst, perms);
|
||||
fs::remove(network_library);
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< ": Copying network library from" << network_library << " to " << network_library_dst<<" successfully.";
|
||||
}
|
||||
|
||||
if (boost::filesystem::exists(player_library)) {
|
||||
CopyFileResult cfr = copy_file(player_library, player_library_dst, error_message, false);
|
||||
if (cfr != CopyFileResult::SUCCESS) {
|
||||
BOOST_LOG_TRIVIAL(error) << __FUNCTION__<< ": Copying failed(" << cfr << "): " << error_message;
|
||||
return;
|
||||
}
|
||||
|
||||
static constexpr const auto perms = fs::owner_read | fs::owner_write | fs::group_read | fs::others_read;
|
||||
fs::permissions(player_library_dst, perms);
|
||||
fs::remove(player_library);
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< ": Copying player library from" << player_library << " to " << player_library_dst<<" successfully.";
|
||||
}
|
||||
}
|
||||
|
||||
bool GUI_App::on_init_network(bool try_backup)
|
||||
{
|
||||
int load_agent_dll = Slic3r::NetworkAgent::initialize_network_module();
|
||||
|
||||
@@ -538,6 +538,7 @@ public:
|
||||
private:
|
||||
int updating_bambu_networking();
|
||||
bool on_init_inner();
|
||||
void copy_network_if_available();
|
||||
bool on_init_network(bool try_backup = false);
|
||||
void init_networking_callbacks();
|
||||
void init_app_config();
|
||||
|
||||
@@ -1889,6 +1889,7 @@ void TabPrint::build()
|
||||
optgroup->append_single_option_line("tree_support_wall_count");
|
||||
optgroup->append_single_option_line("tree_support_with_infill");
|
||||
optgroup->append_single_option_line("support_top_z_distance", "support#top-z-distance");
|
||||
//optgroup->append_single_option_line("support_bottom_z_distance", "support#bottom-z-distance");
|
||||
optgroup->append_single_option_line("support_base_pattern", "support#base-pattern");
|
||||
optgroup->append_single_option_line("support_base_pattern_spacing", "support#base-pattern");
|
||||
//optgroup->append_single_option_line("support_angle");
|
||||
@@ -3449,8 +3450,8 @@ void TabPrinter::toggle_options()
|
||||
// Disable silent mode for non-marlin firmwares.
|
||||
toggle_option("silent_mode", is_marlin_flavor);
|
||||
//BBS: extruder clearance of BBL printer can't be edited.
|
||||
for (auto el : { "extruder_clearance_radius", "extruder_clearance_height_to_rod", "extruder_clearance_height_to_lid" })
|
||||
toggle_option(el, !is_BBL_printer);
|
||||
//for (auto el : { "extruder_clearance_radius", "extruder_clearance_height_to_rod", "extruder_clearance_height_to_lid" })
|
||||
// toggle_option(el, !is_BBL_printer);
|
||||
|
||||
// SoftFever: hide BBL specific settings
|
||||
for (auto el :
|
||||
|
||||
@@ -230,9 +230,10 @@ struct PresetUpdater::priv
|
||||
void prune_tmps() const;
|
||||
void sync_version() const;
|
||||
void parse_version_string(const std::string& body) const;
|
||||
void sync_resources(std::string http_url, std::map<std::string, Resource> &resources);
|
||||
void sync_resources(std::string http_url, std::map<std::string, Resource> &resources, bool check_patch = false, std::string current_version="");
|
||||
void sync_config(std::string http_url, const VendorMap vendors);
|
||||
void sync_tooltip(std::string http_url, std::string language);
|
||||
void sync_plugins(std::string http_url, std::string plugin_version);
|
||||
|
||||
//BBS: refine preset update logic
|
||||
bool install_bundles_rsrc(std::vector<std::string> bundles, bool snapshot) const;
|
||||
@@ -349,6 +350,7 @@ bool PresetUpdater::priv::extract_file(const fs::path &source_path, const fs::pa
|
||||
close_zip_reader(&archive);
|
||||
return res;
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(info) << "[BBL Updater]successfully extract file " << stat.m_file_index << " to "<<dest_file;
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
@@ -479,11 +481,11 @@ void PresetUpdater::priv::parse_version_string(const std::string& body) const
|
||||
//BBS: refine the Preset Updater logic
|
||||
// Download vendor indices. Also download new bundles if an index indicates there's a new one available.
|
||||
// Both are saved in cache.
|
||||
void PresetUpdater::priv::sync_resources(std::string http_url, std::map<std::string, Resource> &resources)
|
||||
void PresetUpdater::priv::sync_resources(std::string http_url, std::map<std::string, Resource> &resources, bool check_patch, std::string current_version_str)
|
||||
{
|
||||
std::map<std::string, Resource> resource_list;
|
||||
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("[BBL Updater]: sync_resources get preferred setting version for app version %1%, url: %2%")%SLIC3R_APP_NAME%http_url;
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("[BBL Updater]: sync_resources get preferred setting version for app version %1%, url: %2%, current_version_str %3%, check_patch %4%")%SLIC3R_APP_NAME%http_url%current_version_str%check_patch;
|
||||
|
||||
std::string query_params = "?";
|
||||
bool first = true;
|
||||
@@ -545,7 +547,7 @@ void PresetUpdater::priv::sync_resources(std::string http_url, std::map<std::str
|
||||
} catch (std::exception &e) {
|
||||
BOOST_LOG_TRIVIAL(error) << (boost::format("[BBL Updater]: get version of settings failed, exception=%1% body=%2%") % e.what() % body).str();
|
||||
} catch (...) {
|
||||
BOOST_LOG_TRIVIAL(error) << "[BBL Updater]: get version of settings failed,, body=" << body;
|
||||
BOOST_LOG_TRIVIAL(error) << "[BBL Updater]: get version of settings failed, body=" << body;
|
||||
}
|
||||
})
|
||||
.on_error([&](std::string body, std::string error, unsigned status) {
|
||||
@@ -566,8 +568,16 @@ void PresetUpdater::priv::sync_resources(std::string http_url, std::map<std::str
|
||||
}
|
||||
Semver online_version = resource_update->second.version;
|
||||
// Semver current_version = get_version_from_json(vendor_root_config.string());
|
||||
Semver current_version = resource.version;
|
||||
Semver current_version = current_version_str.empty()?resource.version:current_version_str;
|
||||
bool version_match = ((online_version.maj() == current_version.maj()) && (online_version.min() == current_version.min()));
|
||||
if (version_match && check_patch) {
|
||||
int online_cc_patch = online_version.patch()/100;
|
||||
int current_cc_patch = current_version.patch()/100;
|
||||
if (online_cc_patch != current_cc_patch) {
|
||||
version_match = false;
|
||||
BOOST_LOG_TRIVIAL(warning) << boost::format("[BBL Updater]: online patch CC not match: online_cc_patch=%1%, current_cc_patch=%2%") % online_cc_patch % current_cc_patch;
|
||||
}
|
||||
}
|
||||
if (version_match && (current_version < online_version)) {
|
||||
if (cancel) { return; }
|
||||
|
||||
@@ -584,14 +594,20 @@ void PresetUpdater::priv::sync_resources(std::string http_url, std::map<std::str
|
||||
|
||||
// remove previous files before
|
||||
if (resource.sub_caches.empty()) {
|
||||
if (fs::exists(cache_path)) fs::remove_all(cache_path);
|
||||
if (fs::exists(cache_path)) {
|
||||
fs::remove_all(cache_path);
|
||||
BOOST_LOG_TRIVIAL(info) << "[BBL Updater]remove cache path " << cache_path.string();
|
||||
}
|
||||
} else {
|
||||
for (auto sub : resource.sub_caches) {
|
||||
if (fs::exists(cache_path / sub)) fs::remove_all(cache_path / sub);
|
||||
if (fs::exists(cache_path / sub)) {
|
||||
fs::remove_all(cache_path / sub);
|
||||
BOOST_LOG_TRIVIAL(info) << "[BBL Updater]remove cache path " << (cache_path / sub).string();
|
||||
}
|
||||
}
|
||||
}
|
||||
// extract the file downloaded
|
||||
BOOST_LOG_TRIVIAL(info) << "[BBL Updater]start to unzip the downloaded file " << cache_file_path;
|
||||
BOOST_LOG_TRIVIAL(info) << "[BBL Updater]start to unzip the downloaded file " << cache_file_path << " to "<<cache_path;
|
||||
fs::create_directories(cache_path);
|
||||
if (!extract_file(cache_file_path, cache_path)) {
|
||||
BOOST_LOG_TRIVIAL(warning) << "[BBL Updater]extract resource " << resource_it.first << " failed, path: " << cache_file_path;
|
||||
@@ -611,6 +627,9 @@ void PresetUpdater::priv::sync_resources(std::string http_url, std::map<std::str
|
||||
|
||||
resource_it.second = resource_update->second;
|
||||
}
|
||||
else {
|
||||
BOOST_LOG_TRIVIAL(warning) << boost::format("[BBL Updater]: online version=%1%, current_version=%2%, no need to download") % online_version.to_string() % current_version.to_string();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -830,6 +849,28 @@ void PresetUpdater::priv::sync_tooltip(std::string http_url, std::string languag
|
||||
}
|
||||
}
|
||||
|
||||
void PresetUpdater::priv::sync_plugins(std::string http_url, std::string plugin_version)
|
||||
{
|
||||
if (plugin_version == "00.00.00.00") {
|
||||
BOOST_LOG_TRIVIAL(info) << "non need to sync plugins for there is no plugins currently.";
|
||||
return;
|
||||
}
|
||||
std::string curr_version = SLIC3R_VERSION;
|
||||
std::string using_version = curr_version.substr(0, 9) + "00";
|
||||
|
||||
try {
|
||||
std::map<std::string, Resource> resources
|
||||
{
|
||||
{"slicer/plugins/cloud", { using_version, "", "", cache_path.string(), {"plugins"}}}
|
||||
};
|
||||
sync_resources(http_url, resources, true, plugin_version);
|
||||
}
|
||||
catch (std::exception& e) {
|
||||
BOOST_LOG_TRIVIAL(warning) << format("[BBL Updater] sync_plugins: %1%", e.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool PresetUpdater::priv::install_bundles_rsrc(std::vector<std::string> bundles, bool snapshot) const
|
||||
{
|
||||
Updates updates;
|
||||
@@ -1092,7 +1133,7 @@ PresetUpdater::~PresetUpdater()
|
||||
|
||||
//BBS: change directories by design
|
||||
//BBS: refine the preset updater logic
|
||||
void PresetUpdater::sync(std::string http_url, std::string language, PresetBundle *preset_bundle)
|
||||
void PresetUpdater::sync(std::string http_url, std::string language, std::string plugin_version, PresetBundle *preset_bundle)
|
||||
{
|
||||
//p->set_download_prefs(GUI::wxGetApp().app_config);
|
||||
if (!p->enabled_version_check && !p->enabled_config_update) { return; }
|
||||
@@ -1102,7 +1143,7 @@ void PresetUpdater::sync(std::string http_url, std::string language, PresetBundl
|
||||
// into the closure (but perhaps the compiler can elide this).
|
||||
VendorMap vendors = preset_bundle->vendors;
|
||||
|
||||
p->thread = std::thread([this, vendors, http_url, language]() {
|
||||
p->thread = std::thread([this, vendors, http_url, language, plugin_version]() {
|
||||
this->p->prune_tmps();
|
||||
if (p->cancel)
|
||||
return;
|
||||
@@ -1112,8 +1153,12 @@ void PresetUpdater::sync(std::string http_url, std::string language, PresetBundl
|
||||
this->p->sync_config(http_url, std::move(vendors));
|
||||
if (p->cancel)
|
||||
return;
|
||||
this->p->sync_tooltip(http_url, language);
|
||||
});
|
||||
this->p->sync_plugins(http_url, plugin_version);
|
||||
//if (p->cancel)
|
||||
// return;
|
||||
//remove the tooltip currently
|
||||
//this->p->sync_tooltip(http_url, language);
|
||||
});
|
||||
}
|
||||
|
||||
void PresetUpdater::slic3r_update_notify()
|
||||
|
||||
@@ -26,7 +26,7 @@ public:
|
||||
~PresetUpdater();
|
||||
|
||||
// If either version check or config updating is enabled, get the appropriate data in the background and cache it.
|
||||
void sync(std::string http_url, std::string language, PresetBundle *preset_bundle);
|
||||
void sync(std::string http_url, std::string language, std::string plugin_version, PresetBundle *preset_bundle);
|
||||
|
||||
// If version check is enabled, check if chaced online slic3r version is newer, notify if so.
|
||||
void slic3r_update_notify();
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace BBL {
|
||||
|
||||
#define BAMBU_NETWORK_LIBRARY "bambu_networking"
|
||||
#define BAMBU_NETWORK_AGENT_NAME "bambu_network_agent"
|
||||
#define BAMBU_NETWORK_AGENT_VERSION "01.03.00.02"
|
||||
#define BAMBU_NETWORK_AGENT_VERSION "01.03.01.02"
|
||||
|
||||
|
||||
//iot preset type strings
|
||||
|
||||
@@ -10,5 +10,5 @@ endif()
|
||||
if(NOT DEFINED BBL_INTERNAL_TESTING)
|
||||
set(BBL_INTERNAL_TESTING "1")
|
||||
endif()
|
||||
set(SLIC3R_VERSION "01.03.00.25")
|
||||
set(SoftFever_VERSION "1.3.3")
|
||||
set(SLIC3R_VERSION "01.03.01.01")
|
||||
set(SoftFever_VERSION "1.3.4")
|
||||
|
||||
Reference in New Issue
Block a user