popup shows always laser infill if text is in userContent.

This commit is contained in:
clemniem 2016-06-30 17:31:07 +02:00
parent 6c44d8e243
commit e366b4c805
4 changed files with 14 additions and 14 deletions

View file

@ -21,7 +21,6 @@ defaults = dict(
speed = 300,
intensity = 500,
fill_areas = False,
fill_text = False,
cross_fill = False,
fill_angle = 0,
fill_spacing = 0.25,
@ -269,7 +268,6 @@ class Profile(object):
"sharpening": self.get_float("img_sharpening"),
"dithering": self.get_boolean("img_dithering"),
"fill_areas": self.get_boolean("fill_areas"),
"fill_text": self.get_boolean("fill_text"),
"cross_fill": self.get_boolean("cross_fill"),
"fill_angle": self.get_float("fill_angle"),
"fill_spacing": self.get_float("fill_spacing"),

View file

@ -36,17 +36,15 @@ $(function(){
self.maxSpeed = ko.observable(3000);
self.minSpeed = ko.observable(20);
self.fill_areas = ko.observable(false);
self.fill_text = ko.observable(false);
self.show_fill_areas_checkbox = ko.observable(false);
self.show_fill_text_checkbox = ko.observable(false);
// image engraving stuff
// preset values are a good start for wood engraving
self.images_placed = ko.observable(false);
self.text_placed = ko.observable(false);
self.show_image_parameters = ko.computed(function(){
return self.images_placed()
|| (self.fill_areas() && self.show_vector_parameters())
|| self.fill_text();
return (self.images_placed() || self.text_placed()
|| (self.fill_areas() && self.show_vector_parameters()));
});
self.imgIntensityWhite = ko.observable(0);
self.imgIntensityBlack = ko.observable(500);
@ -89,6 +87,7 @@ $(function(){
self.show_vector_parameters(self.workingArea.getPlacedSvgs().length > 0);
self.show_fill_areas_checkbox(self.workingArea.hasFilledVectors())
self.images_placed(self.workingArea.getPlacedImages().length > 0);
self.text_placed(self.workingArea.hasTextItems());
//self.show_image_parameters(self.workingArea.getPlacedImages().length > 0);
if(self.show_vector_parameters() || self.show_image_parameters()){
@ -261,7 +260,6 @@ $(function(){
"profile.speed": self.laserSpeed(),
"profile.intensity": self.laserIntensity(),
"profile.fill_areas": self.fill_areas(),
"profile.fill_text": self.fill_text(),
"profile.pierce_time": self.pierceTime(),
"profile.intensity_black" : self.imgIntensityBlack(),
"profile.intensity_white" : self.imgIntensityWhite(),

View file

@ -711,6 +711,16 @@ $(function(){
return snap.selectAll("#userContent image");
};
self.hasTextItems = function () {
if(snap.selectAll("#userContent tspan").length > 0 ||
snap.selectAll("#userContent text").length > 0 ||
snap.selectAll("userContent #text").length > 0) {
return true
}else{
return false
}
};
self.getPlacedGcodes = ko.computed(function() {
var gcodeFiles = [];
ko.utils.arrayForEach(self.placedDesigns(), function(design) {

View file

@ -44,12 +44,6 @@
<input type="checkbox" data-bind="checked: fill_areas">{{ _('Engrave Infills') }}
</label>
</div>
<div class="controls">
<label class="checkbox">
{#TODO: CLEM make checkbox usable fill_text #}
<input type="checkbox" data-bind="checked: fill_text">{{ _('Engrave Text') }}
</label>
</div>
</div>
<div class="control-group" data-bind="visible: showExpertSettings ">