Skip to content

Commit

Permalink
Merge pull request #8 from rsre/0.54
Browse files Browse the repository at this point in the history
Adds v0.53 and v0.54 changes
  • Loading branch information
rsre authored Oct 24, 2020
2 parents c795400 + b7804d5 commit 28ae894
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 10 deletions.
7 changes: 7 additions & 0 deletions Change_Log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,10 @@ Version 0.52:
- Added margin to prevent warning about out of bounds vector features when they are really close to the page boundary.
- Added explicit font definition for GUI

Version 0.53:
- Fixed handling of some hidden layers/objects
- Fixed handling of a less common color specification format
- Brought back removal of unnecessary commands from data sent to laser (from V0.43 with a correction). This Reduced volume of data sent to laser.

Version 0.54:
- Reverted back to egv.py file from Version 0.52 fixing problem with movements introduced in Version 0.53
14 changes: 12 additions & 2 deletions k40_whisperer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"""
app_name = "K40 Whisperer"
version = '0.52'
version = '0.54'
title_text = app_name+" V"+version

import sys
Expand Down Expand Up @@ -227,6 +227,16 @@ def createWidgets(self):
self.master.bind('<Alt-Control-8>' , self.Move_Arb_Up)
self.master.bind('<Alt-Control-Key-2>', self.Move_Arb_Down)

self.master.bind('<Alt-Left>' , self.Move_Arb_Left)
self.master.bind('<Alt-Right>', self.Move_Arb_Right)
self.master.bind('<Alt-Up>' , self.Move_Arb_Up)
self.master.bind('<Alt-Down>' , self.Move_Arb_Down)

self.master.bind('<Alt-Key-4>', self.Move_Arb_Left)
self.master.bind('<Alt-6>' , self.Move_Arb_Right)
self.master.bind('<Alt-8>' , self.Move_Arb_Up)
self.master.bind('<Alt-Key-2>', self.Move_Arb_Down)

#####
self.master.bind('<Control-i>' , self.Initialize_Laser)
self.master.bind('<Control-o>' , self.menu_File_Open_Design)
Expand Down Expand Up @@ -2033,7 +2043,7 @@ def Open_SVG(self,filemname):
svg_reader.make_paths(txt2paths=True)

except Exception as e:
msg1 = "SVG file load failed: "
msg1 = "SVG Error: "
msg2 = "%s" %(e)
self.statusMessage.set((msg1+msg2).split("\n")[0] )
self.statusbar.configure( bg = 'red' )
Expand Down
2 changes: 0 additions & 2 deletions requirements.txt
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
lxml
pyusb
pillow
pyinstaller
setuptools<45.0.0
pyclipper
5 changes: 3 additions & 2 deletions simplestyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,10 @@ def isColor(c):
if c.startswith('#') and (len(c)==4 or len(c)==7):
return True
if c.lower() in svgcolors.keys():
return True
if c.startswith('rgb('): #however, rgb() shouldnt occur at this point?
return True
#might be "none" or some undefined color constant or rgb()
#however, rgb() shouldnt occur at this point
#might be "none" or some undefined color constant
return False

def parseColor(c):
Expand Down
16 changes: 12 additions & 4 deletions svg_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def process_shape(self, node, mat, group_stroke = None):
line2 = "Automatic conversion to paths failed: Try upgrading to Inkscape .90 or later"
line3 = "To convert manually in Inkscape: select the text then select \"Path\"-\"Object to Path\" in the menu bar."
text_message_fatal = "%s\n\n%s\n\n%s" %(line1,line2,line3)

##############################################
### Handle 'style' data outside of style ###
##############################################
Expand Down Expand Up @@ -309,6 +309,10 @@ def process_shape(self, node, mat, group_stroke = None):
if len(parts) == 2:
(prop, col) = parts
prop = prop.strip().lower()

if prop == 'display' and col == "none":
# display is 'none' return without processing group
return

if prop == 'k40_action':
changed = True
Expand Down Expand Up @@ -506,11 +510,13 @@ def process_clone(self, node):
self.groupmat.append(simpletransform.composeTransform(self.groupmat[-1], mat))
# get referenced node
refid = node.get(inkex.addNS('href','xlink'))
#print(refid,node.get('id'),node.get('layer'))
refnode = self.getElementById(refid[1:])
if refnode is not None:
if refnode.tag == inkex.addNS('g','svg') or refnode.tag == inkex.addNS('switch','svg'):
self.process_group(refnode)
elif refnode.tag == inkex.addNS('use', 'svg'):
#print(refnode,'1')
self.process_clone(refnode)
else:
self.process_shape(refnode, self.groupmat[-1])
Expand All @@ -522,8 +528,10 @@ def process_group(self, group):
##############################################
### Get color set at group level
stroke_group = group.get('stroke')
if group.get('display')=='none':
return
##############################################
### Handle 'style' data
### Handle 'style' data
style = group.get('style')
if style:
declarations = style.split(';')
Expand All @@ -538,7 +546,6 @@ def process_group(self, group):
#group display is 'none' return without processing group
return
##############################################

if group.get(inkex.addNS('groupmode', 'inkscape')) == 'layer':
style = group.get('style')
if style:
Expand All @@ -548,7 +555,7 @@ def process_group(self, group):
#layer display is 'none' return without processing layer
return
layer = group.get(inkex.addNS('label', 'inkscape'))

layer = layer.replace(' ', '_')
if layer in self.layers:
self.layer = layer
Expand All @@ -559,6 +566,7 @@ def process_group(self, group):
if node.tag == inkex.addNS('g','svg') or node.tag == inkex.addNS('switch','svg'):
self.process_group(node)
elif node.tag == inkex.addNS('use', 'svg'):
#print(node.get('id'),'2',node.get('href'))
self.process_clone(node)

elif node.tag == inkex.addNS('style', 'svg'):
Expand Down

0 comments on commit 28ae894

Please sign in to comment.