Skip to content

Commit

Permalink
Merge pull request #103 from kbwbe/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
kbwbe authored Oct 8, 2018
2 parents bb73ca5 + 29f1fd3 commit 9051235
Show file tree
Hide file tree
Showing 9 changed files with 704 additions and 117 deletions.
153 changes: 107 additions & 46 deletions GuiA2p/Resources/ui/a2p_prefs.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>705</width>
<height>512</height>
<height>731</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -60,67 +60,128 @@
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</item>
<item row="3" column="0">
<widget class="QGroupBox" name="groupBox_2">
<item row="2" column="0">
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Storage of files</string>
<string>default Solver Behaviour</string>
</property>
<widget class="QWidget" name="verticalLayoutWidget_3">
<widget class="QGroupBox" name="groupBox_2">
<property name="geometry">
<rect>
<x>49</x>
<y>40</y>
<width>537</width>
<height>171</height>
<x>0</x>
<y>140</y>
<width>687</width>
<height>234</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="Gui::PrefCheckBox" name="checkBox">
<property name="text">
<string>Use project-folder, all parts and assemblies have to be unique inside (experimetal)</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>useProjectFolder</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/A2plus</cstring>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefFileChooser" name="fileChooser">
<property name="mode">
<enum>Gui::FileChooser::Directory</enum>
</property>
<property name="prefEntry" stdset="0">
<cstring>projectFolder</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/A2plus</cstring>
</property>
</widget>
</item>
</layout>
<property name="title">
<string>Storage of files</string>
</property>
<widget class="QWidget" name="verticalLayoutWidget_3">
<property name="geometry">
<rect>
<x>49</x>
<y>40</y>
<width>537</width>
<height>171</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="Gui::PrefRadioButton" name="radioButton_3">
<property name="text">
<string>use relative pathes for imported parts</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>useRelativePathes</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/A2plus</cstring>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefRadioButton" name="radioButton_4">
<property name="text">
<string>use absolute pathes for imported parts</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>useAbsolutePathes</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/A2plus</cstring>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefRadioButton" name="radioButton_5">
<property name="text">
<string>Use project-folder, all files are below this</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>useProjectFolder</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/A2plus</cstring>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefFileChooser" name="fileChooser">
<property name="mode">
<enum>Gui::FileChooser::Directory</enum>
</property>
<property name="prefEntry" stdset="0">
<cstring>projectFolder</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/A2plus</cstring>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</widget>
</item>
<item row="2" column="0">
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>default Solver Behaviour</string>
</property>
<widget class="QWidget" name="verticalLayoutWidget">
<property name="geometry">
<rect>
<x>9</x>
<y>30</y>
<x>30</x>
<y>40</y>
<width>521</width>
<height>71</height>
</rect>
Expand Down
3 changes: 2 additions & 1 deletion InitGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ def Initialize(self):
)

menuEntries = [
'a2p_repairTreeViewCommand'
'a2p_repairTreeViewCommand',
'a2p_absPath_to_relPath_Command'
]
self.appendMenu(
'A2p',
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ You have to assemble existing projects again.
Releases of A2plus available ?
------------------------------

Not at moment. A2plus is in very early alpha state, but already functional for small projects.
There are prereleases available. Please have a look at the releases section of this repository

Known Issues:
-------------
Expand All @@ -49,6 +49,9 @@ After that please constrain these parts again.
This behaviour is due to FreeCAD's lack of topolocigal naming and is difficult to handle at moment.
Some work will be done in future to improve this behaviour.

Installation
------------
A2plus can now be installed by FreeCAD's add-on manager.

Linux Installation Instructions
-------------------------------
Expand Down
10 changes: 6 additions & 4 deletions a2p_convertPart.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ def convertToImportedPart(doc, obj):

newObj = doc.addObject("Part::FeaturePython",partName)
newObj.Label = partLabel

newObj.Proxy = Proxy_convertPart()
newObj.ViewObject.Proxy = ImportedPartViewProviderProxy()

newObj.addProperty("App::PropertyString", "a2p_Version","importPart").a2p_Version = A2P_VERSION
newObj.addProperty("App::PropertyFile", "sourceFile", "importPart").sourceFile = filename
newObj.addProperty("App::PropertyStringList","muxInfo","importPart")
Expand All @@ -74,16 +78,13 @@ def convertToImportedPart(doc, obj):
newObj.muxInfo = createTopoInfo(obj)

for p in obj.ViewObject.PropertiesList:
if hasattr(newObj.ViewObject, p) and p not in ['DiffuseColor','Proxy','MappedColors']:
if hasattr(obj.ViewObject, p) and p not in ['DiffuseColor','Proxy','MappedColors']:
setattr(newObj.ViewObject, p, getattr( obj.ViewObject, p))
newObj.ViewObject.DiffuseColor = copy.copy( obj.ViewObject.DiffuseColor )
newObj.ViewObject.Transparency = obj.ViewObject.Transparency
newObj.Placement.Base = obj.Placement.Base
newObj.Placement.Rotation = obj.Placement.Rotation

newObj.Proxy = Proxy_convertPart()
newObj.ViewObject.Proxy = ImportedPartViewProviderProxy()

doc.removeObject(obj.Name) # don't want the original in this doc anymore
newObj.recompute()

Expand Down Expand Up @@ -155,3 +156,4 @@ def IsActive(self):
FreeCADGui.addCommand('a2p_ConvertPart',a2p_ConvertPartCommand())



Loading

0 comments on commit 9051235

Please sign in to comment.