fix(back-end): noozle diameter
Some checks failed
Build, Test, Deploy and Analysis / test-backend (push) Successful in 54s
Build, Test, Deploy and Analysis / qodana (push) Failing after 1m12s
Build, Test, Deploy and Analysis / build-and-push (push) Successful in 37s
Build, Test, Deploy and Analysis / deploy (push) Successful in 9s
Build, Test, Deploy and Analysis / qodana (pull_request) Failing after 11s
Build, Test, Deploy and Analysis / build-and-push (pull_request) Has been cancelled
Build, Test, Deploy and Analysis / deploy (pull_request) Has been cancelled
Build, Test, Deploy and Analysis / test-backend (pull_request) Has been cancelled
Some checks failed
Build, Test, Deploy and Analysis / test-backend (push) Successful in 54s
Build, Test, Deploy and Analysis / qodana (push) Failing after 1m12s
Build, Test, Deploy and Analysis / build-and-push (push) Successful in 37s
Build, Test, Deploy and Analysis / deploy (push) Successful in 9s
Build, Test, Deploy and Analysis / qodana (pull_request) Failing after 11s
Build, Test, Deploy and Analysis / build-and-push (pull_request) Has been cancelled
Build, Test, Deploy and Analysis / deploy (pull_request) Has been cancelled
Build, Test, Deploy and Analysis / test-backend (pull_request) Has been cancelled
This commit is contained in:
@@ -100,11 +100,11 @@ public class OrcaProfileResolver {
|
||||
|
||||
String displayName = machine.getPrinterDisplayName();
|
||||
if (displayName.toLowerCase().contains("bambulab a1") || displayName.toLowerCase().contains("bambu lab a1")) {
|
||||
BigDecimal normalizedNozzle = normalizeNozzle(nozzleDiameterMm);
|
||||
if (normalizedNozzle == null) {
|
||||
String nozzleForProfile = formatNozzleForProfileName(nozzleDiameterMm);
|
||||
if (nozzleForProfile == null) {
|
||||
return "Bambu Lab A1 0.4 nozzle";
|
||||
}
|
||||
return "Bambu Lab A1 " + normalizedNozzle.toPlainString() + " nozzle";
|
||||
return "Bambu Lab A1 " + nozzleForProfile + " nozzle";
|
||||
}
|
||||
|
||||
return displayName;
|
||||
@@ -131,6 +131,18 @@ public class OrcaProfileResolver {
|
||||
return nozzleDiameterMm.setScale(2, RoundingMode.HALF_UP);
|
||||
}
|
||||
|
||||
private String formatNozzleForProfileName(BigDecimal nozzleDiameterMm) {
|
||||
BigDecimal normalizedNozzle = normalizeNozzle(nozzleDiameterMm);
|
||||
if (normalizedNozzle == null) {
|
||||
return null;
|
||||
}
|
||||
BigDecimal stripped = normalizedNozzle.stripTrailingZeros();
|
||||
if (stripped.scale() < 0) {
|
||||
stripped = stripped.setScale(0);
|
||||
}
|
||||
return stripped.toPlainString();
|
||||
}
|
||||
|
||||
public record ResolvedProfiles(
|
||||
String machineProfileName,
|
||||
String filamentProfileName,
|
||||
|
||||
Reference in New Issue
Block a user