Added the nozzle diameter to the printer profile (needed for slicing, cura plugin uses it too)
This commit is contained in:
parent
fc777e69e2
commit
a149cdc4f5
5 changed files with 25 additions and 8 deletions
|
|
@ -173,6 +173,10 @@ Profile
|
|||
- 0..1
|
||||
- Object
|
||||
- Information about the printer's extruders
|
||||
* - ``extruder.nozzleDiameter``
|
||||
- 0..1
|
||||
- ``float``
|
||||
- The diameter of the printer's nozzle(s) in mm.
|
||||
* - ``extruder.count``
|
||||
- 0..1
|
||||
- ``int``
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ defaults = dict(
|
|||
layer_height=0.1,
|
||||
wall_thickness=0.8,
|
||||
solid_layer_thickness=0.6,
|
||||
nozzle_size=0.4,
|
||||
print_temperature=[220, 0, 0, 0],
|
||||
print_bed_temperature=70,
|
||||
platform_adhesion=PlatformAdhesionTypes.NONE,
|
||||
|
|
@ -757,7 +756,7 @@ class Profile(object):
|
|||
|
||||
def calculate_edge_width_and_line_count(self):
|
||||
wall_thickness = self.get_float("wall_thickness")
|
||||
nozzle_size = self.get_float("nozzle_size")
|
||||
nozzle_size = self._printer_profile["extruder"]["nozzleDiameter"]
|
||||
|
||||
if self.get_boolean("spiralize") or self.get_boolean("follow_surface"):
|
||||
return wall_thickness, 1
|
||||
|
|
|
|||
|
|
@ -38,7 +38,8 @@ class PrinterProfileManager(object):
|
|||
count = 1,
|
||||
offsets = [
|
||||
(0, 0)
|
||||
]
|
||||
],
|
||||
nozzleDiameter = 0.4
|
||||
),
|
||||
axes=dict(
|
||||
x = dict(speed=6000, inverted=False),
|
||||
|
|
@ -150,7 +151,7 @@ class PrinterProfileManager(object):
|
|||
if profile is None:
|
||||
continue
|
||||
|
||||
results[identifier] = profile
|
||||
results[identifier] = dict_merge(self._load_default(), profile)
|
||||
return results
|
||||
|
||||
def _load_all_identifiers(self):
|
||||
|
|
@ -183,7 +184,7 @@ class PrinterProfileManager(object):
|
|||
import yaml
|
||||
with open(path, "wb") as f:
|
||||
try:
|
||||
yaml.safe_dump(profile, f)
|
||||
yaml.safe_dump(profile, f, default_flow_style=False, indent=" ", allow_unicode=True)
|
||||
except Exception as e:
|
||||
raise SaveError("Cannot save profile %s: %s" % (profile["id"], e.message))
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,8 @@ function PrinterProfilesViewModel() {
|
|||
count: 1,
|
||||
offsets: [
|
||||
[0,0]
|
||||
]
|
||||
],
|
||||
nozzleDiameter: 0.4
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -64,6 +65,7 @@ function PrinterProfilesViewModel() {
|
|||
|
||||
self.editorHeatedBed = ko.observable();
|
||||
|
||||
self.editorNozzleDiameter = ko.observable();
|
||||
self.editorExtruders = ko.observable();
|
||||
self.editorExtruderOffsets = ko.observableArray();
|
||||
|
||||
|
|
@ -215,6 +217,7 @@ function PrinterProfilesViewModel() {
|
|||
|
||||
self.editorHeatedBed(data.volume.heatedBed);
|
||||
|
||||
self.editorNozzleDiameter(data.extruder.nozzleDiameter);
|
||||
self.editorExtruders(data.extruder.count);
|
||||
var offsets = [];
|
||||
_.each(data.extruder.offsets, function(offset) {
|
||||
|
|
@ -275,7 +278,8 @@ function PrinterProfilesViewModel() {
|
|||
count: self.editorExtruders(),
|
||||
offsets: [
|
||||
[0.0, 0.0]
|
||||
]
|
||||
],
|
||||
nozzleDiameter: self.editorNozzleDiameter()
|
||||
},
|
||||
axes: {
|
||||
x: {
|
||||
|
|
@ -306,6 +310,6 @@ function PrinterProfilesViewModel() {
|
|||
return profile;
|
||||
};
|
||||
|
||||
self.onSettingsShown = self.requestData;
|
||||
self.onSettingsShown = self.requestData;
|
||||
self.onStartup = self.requestData;
|
||||
}
|
||||
|
|
@ -240,6 +240,15 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ _('Nozzle Diameter') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
<input type="number" step="0.01" class="input-mini text-right" data-bind="value: printerProfiles.editorNozzleDiameter">
|
||||
<span class="add-on">mm</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ _('Number of Extruders') }}</label>
|
||||
<div class="controls">
|
||||
|
|
|
|||
Loading…
Reference in a new issue