Compare commits

..

No commits in common. "b191a28a0a2c73d21c5e6b8ef4406506a00adedb" and "5fc603ab502de240de2775ed12a965511452f928" have entirely different histories.

3 changed files with 14 additions and 24 deletions

View file

@ -6,7 +6,6 @@ KiCAD 9 API Workbench
## What works
* Create board
* Bidirectional syncing
* Add Vias
* Add footprint pads
* Import footprint 3d models
@ -20,11 +19,14 @@ KiCAD 9 API Workbench
## In Progress / To be ported
### Tracks
Tracks can be loaded and drawn as simple `LineSegment` but more work is needed to draw properly 'widthed', and particularly while trying to eliminate overlapping lines.
Tracks can be loaded and drawn as simple `LineSegment` but more work is needed to draw properly 'widthed', and particularly whilte trying to eliminate overlapping lines.
### More Pad Shapes
Only rectangle get drawn right now, would like to figure out how to get Sketcher to do the heavy lifting
### Sync to KiCAD
In theory this code is mostly working but there seems to be an [issue in kicad-python](https://gitlab.com/kicad/code/kicad-python/-/issues/34)
## Plans
### Add more board features

View file

@ -17,7 +17,9 @@ class BaseObject:
self.sync_from()
def execute(self, feature):
pass
# TODO this might not be the right move
print(self, 'BaseObject.execute')
#self.onDocumentRestored(feature)
def get_api(self):
p = self.feature

View file

@ -9,8 +9,6 @@ class BaseViewProvider:
TYPE = None
EXTENSIONS = []
save_keys = []
def __init__(self, viewprovider):
self.viewprovider = viewprovider
self.feature = viewprovider.Object.Proxy.feature
@ -18,7 +16,6 @@ class BaseViewProvider:
self.icon = ''
if self.ICON:
print('>', settings.ICONPATH, self.ICON, os.path.join(settings.ICONPATH, self.ICON))
self.icon = os.path.join(settings.ICONPATH, self.ICON)
viewprovider.Proxy = self
@ -39,7 +36,6 @@ class BaseViewProvider:
Gui.Selection.clearSelection()
def getIcon(self):
print(self.icon)
return self.icon
def getDisplayModes(self,obj):
@ -50,21 +46,11 @@ class BaseViewProvider:
'''Return the name of the default display mode. It must be defined in getDisplayModes.'''
return 'Standard'
def dumps(self):
data = [ getattr(self, 'icon') ]
def __getstate__(self):
return {
'icon': self.icon
}
if len(self.save_keys) > 0:
for key in self.save_keys:
try:
data.append(getattr(self, key))
except Exception as e:
#XXX logging
print(e)
return tuple(data)
def loads(self, state):
self.icon = state[0]
for idx, key in enumerate(self.save_keys):
setattr(self, key, state[idx + 1])
def __setstate__(self, props):
for prop in props:
setattr(self, prop, props[prop])