补充遗漏翻译,新增启动脚本,整理import

This commit is contained in:
2026-05-09 16:42:17 +08:00
parent e542c482d7
commit 75ceec0798
16 changed files with 152 additions and 103 deletions

View File

@@ -4,6 +4,7 @@ import json
import uuid
import configparser
from app.utils.conf_parse import ConfParse
from app.models import SystemConfig
class CuraEngine:
def __init__(self, print_config_folder=None):
@@ -44,8 +45,6 @@ class CuraEngine:
env = os.environ.copy()
env["CURA_ENGINE_SEARCH_PATH"] = f"{printers_path}:{extruders_path}:{materials_path}:{presets_path}:{variants_path}"
from app.models import SystemConfig
db_printer = SystemConfig.query.filter_by(key='default_printer').first()
p_val = db_printer.value if db_printer and db_printer.value else 'creality_ender3v3se.def.json'
if not p_val.endswith('.def.json'): p_val += '.def.json'
@@ -232,8 +231,6 @@ class CuraEngine:
return []
def get_bed_dimensions(self):
from app.models import SystemConfig
import json
try:
db_printer = SystemConfig.query.filter_by(key='default_printer').first()
p_val = db_printer.value if db_printer and db_printer.value else 'creality_ender3v3se.def.json'

View File

@@ -2,6 +2,7 @@ import os
import subprocess
import configparser
import uuid
from app.models import SystemConfig
class PrusaSlicerEngine:
def __init__(self, print_config_folder=None):
@@ -47,8 +48,6 @@ class PrusaSlicerEngine:
# print(support_pattern)
all_configs = {}
from app.models import SystemConfig
db_printer = SystemConfig.query.filter_by(key='default_printer').first()
p_val = db_printer.value if db_printer and db_printer.value else 'Ender3_V3_SE'
if not p_val.endswith('.ini'): p_val += '.ini'
@@ -156,8 +155,6 @@ class PrusaSlicerEngine:
def get_bed_dimensions(self):
from app.models import SystemConfig
import configparser
try:
db_printer = SystemConfig.query.filter_by(key='default_printer').first()
p_val = db_printer.value if db_printer and db_printer.value else 'Ender3_V3_SE.ini'