Skip to content

Commit

Permalink
Merge pull request #501 from kbwbe/tmp
Browse files Browse the repository at this point in the history
Tmp
  • Loading branch information
kbwbe authored Sep 4, 2022
2 parents 3c6974d + a407e7f commit 58517c2
Show file tree
Hide file tree
Showing 15 changed files with 5,912 additions and 912 deletions.
6 changes: 4 additions & 2 deletions InitGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
__title__ = 'A2plus assembly Workbench - InitGui file'
__author__ = 'kbwbe'

A2P_VERSION = 'V0.4.57'

A2P_VERSION = 'V0.4.58'

import FreeCAD
import FreeCADGui
Expand Down Expand Up @@ -66,7 +67,8 @@ def Initialize(self):
# add translations path
FreeCADGui.addLanguagePath(a2plib.getLanguagePath())
FreeCADGui.updateLocale()
print(translate("A2plus_appendMenu", "languagePath of A2plus Workbench is:"), "{}".format(a2plib.getLanguagePath()))
# print(translate("A2plus_appendMenu", "languagePath of A2plus Workbench is:"), "{}".format(a2plib.getLanguagePath()))
FreeCAD.Console.PrintMessage(translate("A2plus_appendMenu", "Initializing A2plus Workbench ")+A2P_VERSION+'.\n')

import a2p_importpart
import a2p_recursiveUpdatePlanner
Expand Down
32 changes: 16 additions & 16 deletions a2p_bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#* *
#***************************************************************************

import FreeCADGui,FreeCAD
import FreeCAD, FreeCADGui
from PySide import QtGui, QtCore
import Spreadsheet
import os
Expand Down Expand Up @@ -86,7 +86,7 @@ def createPartList(
workingDir
)
if linkedSource is None:
print(u"BOM ERROR: Could not open sourcefile {}".format(linkedSource1))
print(translate("A2p_BoM", "BOM ERROR: Could not open sourcefile {}").format(linkedSource1))
continue
# Is it already processed minimum one time ?
entry = partListEntries.get(linkedSource,None)
Expand Down Expand Up @@ -134,7 +134,7 @@ def createPartList(


#------------------------------------------------------------------------------
toolTip = translate("A2plus",
toolTip = translate("A2p_BoM",
'''
Create a spreadsheet with a
parts list of this file.
Expand Down Expand Up @@ -176,28 +176,28 @@ def Activated(self):
doc = FreeCAD.activeDocument()
if doc is None:
QtGui.QMessageBox.information( QtGui.QApplication.activeWindow(),
translate("A2plus","No active document found!"),
translate("A2plus","You have to open a FCStd file first.")
translate("A2p_BoM","No active document found!"),
translate("A2p_BoM","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 = translate("A2plus","Please save before generating a parts list! Save now?")
response = QtGui.QMessageBox.information(QtGui.QApplication.activeWindow(), translate("A2plus","Save document?"), msg, flags )
msg = translate("A2p_BoM","Please save before generating a parts list! Save now?")
response = QtGui.QMessageBox.information(QtGui.QApplication.activeWindow(), translate("A2p_BoM","Save document?"), msg, flags )
if response == QtGui.QMessageBox.No:
QtGui.QMessageBox.information( QtGui.QApplication.activeWindow(),
translate("A2plus","Parts list generation aborted!"),
translate("A2plus","You have to save the assembly file first.")
translate("A2p_BoM","Parts list generation aborted!"),
translate("A2p_BoM","You have to save the assembly file first.")
)
return
else:
doc.save()

flags = QtGui.QMessageBox.StandardButton.Yes | QtGui.QMessageBox.StandardButton.No
msg = translate("A2plus","Do you want to iterate recursively over all included subassemblies?")
response = QtGui.QMessageBox.information(QtGui.QApplication.activeWindow(), u"PARTSLIST", msg, flags )
msg = translate("A2p_BoM","Do you want to iterate recursively over all included subassemblies?")
response = QtGui.QMessageBox.information(QtGui.QApplication.activeWindow(), translate("A2p_BoM", "PARTSLIST"), msg, flags )
if response == QtGui.QMessageBox.Yes:
subAssyRecursion = True
else:
Expand All @@ -222,8 +222,8 @@ def Activated(self):
self.clearPartList()

# Write Column headers to spreadsheet
ss.set('A1',u'POS')
ss.set('B1',u'QTY')
ss.set('A1', translate("A2p_BoM", "POS"))
ss.set('B1', translate("A2p_BoM", "QTY"))
idx1 = ord('C')
idx2 = idx1 + len(PARTLIST_COLUMN_NAMES)
i=0
Expand Down Expand Up @@ -254,13 +254,13 @@ def Activated(self):

# recompute to finish..
doc.recompute()
print("#PARTSLIST# spreadsheet has been created")

# print(translate("A2p_BoM", "#PARTSLIST# spreadsheet has been created"))
FreeCAD.Console.PrintMessage("#" + translate("A2p_BoM", "PARTSLIST") + "#" + translate("A2p_BoM", " spreadsheet has been created") + "\n")

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

Expand Down
3 changes: 2 additions & 1 deletion a2p_partinformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#* *
#***************************************************************************

import FreeCADGui,FreeCAD
import FreeCAD, FreeCADGui
import Spreadsheet
from PySide import QtGui, QtCore
import os, copy, time, sys, platform
Expand Down Expand Up @@ -81,6 +81,7 @@ def Activated(self):
ss.setBackground('A1:A'+str(len(PARTLIST_COLUMN_NAMES)), (0.000000,1.000000,0.000000,1.000000))
ss.setBackground('B1:B'+str(len(PARTLIST_COLUMN_NAMES)), (0.85,0.85,0.85,1.000000))
doc.recompute()
FreeCAD.Console.PrintMessage("#" + translate("A2plus_partinformation", "PARTINFO") + "#" + translate("A2p_BoM", " spreadsheet has been created") + "\n")

def GetResources(self):
return {
Expand Down
24 changes: 13 additions & 11 deletions a2p_partlistglobals.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,22 @@

from a2p_translateUtils import *

PARTINFORMATION_SHEET_NAME = '_PARTINFO_'
PARTINFORMATION_SHEET_LABEL = '#PARTINFO#'
#PARTINFORMATION_SHEET_NAME = "_" + translate("A2p_BoM", "PARTINFO") + "_"
PARTINFORMATION_SHEET_NAME = "_PARTINFO_"
PARTINFORMATION_SHEET_LABEL = "#" + translate("A2p_BoM", "PARTINFO") + "#"

BOM_SHEET_NAME = '_PARTSLIST_' # BOM = BillOfMaterials...
BOM_SHEET_LABEL = '#PARTSLIST#'
# BOM = BillOfMaterials...
BOM_SHEET_NAME = "_" + translate("A2p_BoM", "PARTSLIST") + "_"

BOM_SHEET_LABEL = "#" + translate("A2p_BoM", "PARTSLIST") + "#"
BOM_MAX_COLS = 10
BOM_MAX_LENGTH = 150


PARTLIST_COLUMN_NAMES = [
u'IDENTNO',
u'DESCRIPTION',
u'SUPPLIER',
u'SUPP.IDENTNO',
u'SUPP.DESCRIPTION',
u'(FILENAME)'
translate("A2p_BoM", "IDENTNO"),
translate("A2p_BoM", "DESCRIPTION"),
translate("A2p_BoM", "SUPPLIER"),
translate("A2p_BoM", "SUPP.IDENTNO"),
translate("A2p_BoM", "SUPP.DESCRIPTION"),
translate("A2p_BoM", "(FILENAME)")
]
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package format="1" xmlns="https://wiki.freecad.org/Package_Metadata">
<name>A2plus</name>
<description>Another assembly workbench for FreeCAD, following and extending Hamish's Assembly 2 workbench hence Assembly2plus. The main goal of A2plus is to create a very simple, easy to use, and not over-featured workbench for FreeCAD assemblies. Using the KISS principle: KEEP IT SIMPLE, STUPID</description>
<version>0.4.57</version>
<version>0.4.58</version>
<date>2022-01-24</date>
<maintainer email="[email protected]">kbwbe</maintainer>
<license file="LICENSE">LGPLv2.1</license>
Expand Down
Binary file modified translations/A2plus_de.qm
Binary file not shown.
Loading

0 comments on commit 58517c2

Please sign in to comment.