Skip to content

Commit

Permalink
Merge pull request #212 from kbwbe/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
kbwbe authored Feb 15, 2019
2 parents f1ac4b2 + f806369 commit dfc367f
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 114 deletions.
40 changes: 20 additions & 20 deletions GuiA2p/Resources/ui/a2p_prefs.ui
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>A2plus Settings</string>
<string>A2plus settings</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="4" column="0">
Expand All @@ -38,7 +38,7 @@
<item>
<widget class="Gui::PrefCheckBox" name="checkBox_6">
<property name="text">
<string>show constraints on toolbar</string>
<string>Show constraints on toolbar</string>
</property>
<property name="checked">
<bool>true</bool>
Expand Down Expand Up @@ -77,22 +77,22 @@
</size>
</property>
<property name="title">
<string>behavior when updating imported parts</string>
<string>Behavior when updating imported parts</string>
</property>
<widget class="QWidget" name="verticalLayoutWidget_3">
<property name="geometry">
<rect>
<x>20</x>
<y>30</y>
<width>621</width>
<height>181</height>
<height>200</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="Gui::PrefCheckBox" name="checkBox_4">
<property name="text">
<string>recalculate imported parts before updating them (experimental)</string>
<string>Recalculate imported parts before updating them (experimental)</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>recalculateImportedParts</cstring>
Expand All @@ -105,7 +105,7 @@
<item>
<widget class="Gui::PrefCheckBox" name="checkBox_5">
<property name="text">
<string>enable recursive update of imported parts (process all subassemblies)</string>
<string>Enable recursive update of imported parts (process all subassemblies)</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>enableRecursiveUpdate</cstring>
Expand All @@ -118,7 +118,7 @@
<item>
<widget class="Gui::PrefCheckBox" name="checkBox_2">
<property name="text">
<string>use experimental topological naming</string>
<string>Use experimental topological naming</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>useTopoNaming</cstring>
Expand All @@ -131,7 +131,7 @@
<item>
<widget class="Gui::PrefCheckBox" name="checkBox_7">
<property name="text">
<string>inherit per face transparency from parts and sub-assemblies (experimental)</string>
<string>Inherit per face transparency from parts and sub-assemblies (experimental)</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>usePerFaceTransparency</cstring>
Expand All @@ -144,7 +144,7 @@
<item>
<widget class="Gui::PrefCheckBox" name="checkBox_8">
<property name="text">
<string>do not import invisible shapes (use with caution, can break assemblies)</string>
<string>Do not import invisible shapes (use with caution, can break assemblies)</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>doNotImportInvisibleShapes</cstring>
Expand All @@ -157,7 +157,7 @@
<item>
<widget class="Gui::PrefCheckBox" name="checkBox_9">
<property name="text">
<string>use solid union for importing parts and subassemblies (experimental)</string>
<string>Use solid union for importing parts and subassemblies (experimental)</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>useSolidUnion</cstring>
Expand Down Expand Up @@ -195,7 +195,7 @@
</size>
</property>
<property name="title">
<string>default solving method</string>
<string>Default solving method</string>
</property>
<widget class="QWidget" name="verticalLayoutWidget_2">
<property name="geometry">
Expand All @@ -210,7 +210,7 @@
<item>
<widget class="Gui::PrefRadioButton" name="radioButton">
<property name="text">
<string>use solving of partial systems (recommended for static assemblies)</string>
<string>Use solving of partial systems (recommended for static assemblies)</string>
</property>
<property name="checked">
<bool>true</bool>
Expand All @@ -226,7 +226,7 @@
<item>
<widget class="Gui::PrefRadioButton" name="radioButton_2">
<property name="text">
<string>use &quot;magnetic&quot; solver, solving all parts at once (for dynamical assemblies)</string>
<string>Use &quot;magnetic&quot; solver, solving all parts at once (for dynamical assemblies)</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>useMagneticSolver</cstring>
Expand All @@ -239,7 +239,7 @@
<item>
<widget class="Gui::PrefCheckBox" name="checkBox_3">
<property name="text">
<string>force FixedPosition to all Imports</string>
<string>Force fixed position to all imports</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>forceFixedPosition</cstring>
Expand Down Expand Up @@ -277,7 +277,7 @@
</size>
</property>
<property name="title">
<string>storage of files</string>
<string>Storage of files</string>
</property>
<widget class="QWidget" name="verticalLayoutWidget_5">
<property name="geometry">
Expand All @@ -292,7 +292,7 @@
<item>
<widget class="Gui::PrefRadioButton" name="radioButton_3">
<property name="text">
<string>use relative paths for imported parts</string>
<string>Use relative paths for imported parts</string>
</property>
<property name="checked">
<bool>true</bool>
Expand All @@ -308,7 +308,7 @@
<item>
<widget class="Gui::PrefRadioButton" name="radioButton_4">
<property name="text">
<string>use absolute paths for imported parts</string>
<string>Use absolute paths for imported parts</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>useAbsolutePathes</cstring>
Expand All @@ -321,7 +321,7 @@
<item>
<widget class="Gui::PrefRadioButton" name="radioButton_5">
<property name="text">
<string>use project-folder, all files are below this</string>
<string>Use project-folder, all files are below this</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>useProjectFolder</cstring>
Expand Down Expand Up @@ -376,7 +376,7 @@
</size>
</property>
<property name="title">
<string>default solver behavior</string>
<string>Default solver behavior</string>
</property>
<widget class="QWidget" name="verticalLayoutWidget">
<property name="geometry">
Expand All @@ -391,7 +391,7 @@
<item>
<widget class="Gui::PrefCheckBox" name="checkBox">
<property name="text">
<string>solve automatically if a constraints property is changed</string>
<string>Solve automatically if a constraints property is changed</string>
</property>
<property name="checked">
<bool>true</bool>
Expand Down
2 changes: 1 addition & 1 deletion InitGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
__title__ = 'A2plus assembly Workbench - InitGui file'
__author__ = 'kbwbe'

A2P_VERSION = 'V0.3.7'
A2P_VERSION = 'V0.3.8'

import sys
PyVersion = sys.version_info[0]
Expand Down
48 changes: 15 additions & 33 deletions a2p_bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def createPartList(
parentAssemblyDir
)
workingDir,basicFileName = os.path.split(fileNameInProject)

docReader1 = FCdocumentReader()
docReader1.openDocument(fileNameInProject)

Expand Down Expand Up @@ -129,20 +130,18 @@ def createPartList(
toolTip = \
'''
Create a spreadsheet with a
partlist of this file.
parts list of this file.
This function will read out
the partInfo spreadSheet of
the #PARTINFO# spreadsheet of
all involved parts of the
assembly and create a new
spreadSheet, containing the
partlist. (see tree view)
After hitting this button
a dialog will pop up:
spreadsheet containing the
parts list.
Question:
- iterate recursively over
This button will open a dialog
with the Question:
- Iterate recursively over
all subassenblies?
Answer Yes:
Expand Down Expand Up @@ -171,27 +170,27 @@ def Activated(self):
if doc == None:
QtGui.QMessageBox.information( QtGui.QApplication.activeWindow(),
u"No active document found!",
u"You have to open an fcstd file first."
u"You have to open a FCStd file first."
)
return
completeFilePath = doc.FileName
p,f = os.path.split(completeFilePath)

flags = QtGui.QMessageBox.StandardButton.Yes | QtGui.QMessageBox.StandardButton.No
msg = u"Please save before generating a partlist!\nSave now ?"
msg = u"Please save before generating a parts list!\nSave now ?"
response = QtGui.QMessageBox.information(QtGui.QApplication.activeWindow(), u"Save document?", msg, flags )
if response == QtGui.QMessageBox.No:
QtGui.QMessageBox.information( QtGui.QApplication.activeWindow(),
u"Partlist generation aborted!",
u"Parts list generation aborted!",
u"You have to save the assembly file first."
)
return
else:
doc.save()

flags = QtGui.QMessageBox.StandardButton.Yes | QtGui.QMessageBox.StandardButton.No
msg = u"Partslist/BOM: Do recursively over all included subassemblies ?"
response = QtGui.QMessageBox.information(QtGui.QApplication.activeWindow(), u"PARTSLIST/BOM mode?", msg, flags )
msg = u"Do you want to iterate recursively over all included subassemblies?"
response = QtGui.QMessageBox.information(QtGui.QApplication.activeWindow(), u"PARTSLIST", msg, flags )
if response == QtGui.QMessageBox.Yes:
subAssyRecursion = True
else:
Expand Down Expand Up @@ -248,32 +247,15 @@ def Activated(self):

# recompute to finish..
doc.recompute()
print("partslist/BOM spreadsheet has been created!")
print("#PARTSLIST# spreadsheet has been created")


def GetResources(self):
return {
'Pixmap' : ':/icons/a2p_PartsList.svg',
'MenuText': 'Create a spreadsheet with a partlist of this file',
'MenuText': 'Create a spreadsheet with a parts list of this file',
'ToolTip': toolTip
}

FreeCADGui.addCommand('a2p_CreatePartlist', a2p_CreatePartlist())
#------------------------------------------------------------------------------

















38 changes: 9 additions & 29 deletions a2p_constraintDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def solve(self):
QtGui.QMessageBox.information(
QtGui.QApplication.activeWindow(),
"Constraint does not exist anymore",
"Constraint has been already deleted"
"Constraint has already been deleted"
)
a2plib.setConstraintEditorRef(None)
self.Deleted.emit()
Expand Down Expand Up @@ -326,10 +326,10 @@ def delete(self):
return

flags = QtGui.QMessageBox.StandardButton.Yes | QtGui.QMessageBox.StandardButton.No
response = QtGui.QMessageBox.critical(
response = QtGui.QMessageBox.information(
QtGui.QApplication.activeWindow(),
"Confirmation required",
"Really delete this constraint ?",
"Really delete this constraint?",
flags
)
if response == QtGui.QMessageBox.Yes:
Expand All @@ -352,7 +352,7 @@ def accept(self):
QtGui.QMessageBox.information(
QtGui.QApplication.activeWindow(),
"Constraint does not exist anymore",
"Constraint has been already deleted"
"Constraint has already been deleted"
)
a2plib.setConstraintEditorRef(None)
self.Deleted.emit()
Expand All @@ -367,18 +367,18 @@ def cancelOperation(self):
QtGui.QMessageBox.information(
QtGui.QApplication.activeWindow(),
"Constraint does not exist anymore",
"Constraint has been already deleted"
"Constraint has already been deleted"
)
a2plib.setConstraintEditorRef(None)
self.Deleted.emit()
return

if self.mode == 'createConstraint':
flags = QtGui.QMessageBox.StandardButton.Yes | QtGui.QMessageBox.StandardButton.No
response = QtGui.QMessageBox.critical(
response = QtGui.QMessageBox.information(
QtGui.QApplication.activeWindow(),
"Confirmation required",
"Exit and delete new constraint ?",
"Exit and delete new constraint?",
flags
)
if response == QtGui.QMessageBox.Yes:
Expand All @@ -389,7 +389,7 @@ def cancelOperation(self):
else:
if self.isWindowModified() or self.winModified:
flags = QtGui.QMessageBox.StandardButton.Yes | QtGui.QMessageBox.StandardButton.No
response = QtGui.QMessageBox.critical(
response = QtGui.QMessageBox.information(
QtGui.QApplication.activeWindow(),
"Information",
"Values changed! Accept Constraint?",
Expand Down Expand Up @@ -895,12 +895,8 @@ def closeEvent(self,event):
#==============================================================================
toolTipText = \
'''
Open a dialog to
Opens a dialog to
define constraints
Find all constraints
within the opening
dialog !
'''

class a2p_ConstraintDialogCommand:
Expand Down Expand Up @@ -974,19 +970,3 @@ def GetResources(self):

FreeCADGui.addCommand('a2p_EditConstraintCommand', a2p_EditConstraintCommand())
#==============================================================================
















Loading

0 comments on commit dfc367f

Please sign in to comment.