Merge branch 'main' into main

This commit is contained in:
Thom de Jong
2025-11-14 17:52:07 +01:00
committed by GitHub
26 changed files with 132 additions and 134 deletions

View File

@@ -123,7 +123,7 @@ def setStatusIcons(show=True):
statuswidget.setObjectName("BIMStatusWidget")
text = translate(
"BIMStatusWidget",
"BIM status widget",
"BIM Status Widget",
"A context menu action used to show or hide this toolbar widget",
)
statuswidget.setWindowTitle(text)

View File

@@ -85,7 +85,7 @@ class BIM_Material:
w = PARAMS.GetInt("BimMaterialDialogWidth", 230)
h = PARAMS.GetInt("BimMaterialDialogHeight", 350)
self.dlg.resize(w, h)
self.dlg.setWindowTitle(translate("BIM", "Select material"))
self.dlg.setWindowTitle(translate("BIM", "Select Material"))
self.dlg.setWindowIcon(QtGui.QIcon(":/icons/Arch_Material.svg"))
mw = FreeCADGui.getMainWindow()
self.dlg.move(mw.frameGeometry().topLeft() + mw.rect().center() - self.dlg.rect().center())
@@ -104,8 +104,8 @@ class BIM_Material:
searchLayout = QtGui.QHBoxLayout()
searchLayout.setSpacing(2)
searchBox = MatLineEdit(self.dlg)
searchBox.setPlaceholderText(translate("BIM", "Search Objects"))
searchBox.setToolTip(translate("BIM", "Searches for objects in the tree"))
searchBox.setPlaceholderText(translate("BIM", "Search materials"))
searchBox.setToolTip(translate("BIM", "Searches for materials in the list"))
self.dlg.searchBox = searchBox
searchLayout.addWidget(searchBox)
searchBox.textChanged.connect(self.onSearch)
@@ -138,7 +138,7 @@ class BIM_Material:
buttonCreate.clicked.connect(self.onCreate)
# create multi
buttonMulti = QtGui.QPushButton(translate("BIM", "Create new Multi-Material"), self.dlg)
buttonMulti = QtGui.QPushButton(translate("BIM", "New Multi-Material"), self.dlg)
buttonMulti.setIcon(QtGui.QIcon(":/icons/Arch_Material_Multi.svg"))
createButtonsLayout.addWidget(buttonMulti, 0, 1)
buttonMulti.clicked.connect(self.onMulti)

View File

@@ -458,36 +458,42 @@ class BIM_ProjectManager:
for i in range(self.form.groupsList.count()):
groups.append(self.form.groupsList.item(i).text())
s = "# FreeCAD BIM Project setup preset " + name + "\n"
s += "groupNewDocument=" + str(int(self.form.groupNewProject.isChecked())) + "\n"
s += "projectName=" + self.form.projectName.text() + "\n"
s += "groupSite=" + str(int(self.form.groupSite.isChecked())) + "\n"
form = self.form
s += "siteName=" + self.form.siteName.text() + "\n"
s += "siteAddress=" + self.form.siteAddress.text() + "\n"
s += "siteLongitude=" + str(self.form.siteLongitude.value()) + "\n"
s += "siteLatitude=" + str(self.form.siteLatitude.value()) + "\n"
s += "siteDeviation=" + str(self.form.siteDeviation.value()) + "\n"
s += "siteElevation=" + self.form.siteElevation.text() + "\n"
presets: dict[str, object] = {
"groupNewDocument": int(form.groupNewProject.isChecked()),
"projectName": form.projectName.text(),
"groupSite": int(form.groupSite.isChecked()),
"siteName": form.siteName.text(),
"siteAddress": form.siteAddress.text(),
"siteLongitude": form.siteLongitude.value(),
"siteLatitude": form.siteLatitude.value(),
"siteDeviation": form.siteDeviation.value(),
"siteElevation": form.siteElevation.text(),
"groupBuilding": int(form.groupBuilding.isChecked()),
"buildingName": form.buildingName.text(),
"buildingUse": form.buildingUse.currentIndex(),
"buildingLength": form.buildingLength.text(),
"buildingWidth": form.buildingWidth.text(),
"countVAxes": form.countVAxes.value(),
"distVAxes": form.distVAxes.text(),
"countHAxes": form.countHAxes.value(),
"distHAxes": form.distHAxes.text(),
"countLevels": form.countLevels.value(),
"levelHeight": form.levelHeight.text(),
"lineWidth": form.lineWidth.value(),
"lineColor": form.lineColor.property("color").getRgbF()[:3],
"groups": ";;".join(groups),
"addHumanFigure": int(form.addHumanFigure.isChecked()),
}
s += "groupBuilding=" + str(int(self.form.groupBuilding.isChecked())) + "\n"
s += "buildingName=" + self.form.buildingName.text() + "\n"
s += "buildingUse=" + str(self.form.buildingUse.currentIndex()) + "\n"
s += "buildingLength=" + self.form.buildingLength.text() + "\n"
s += "buildingWidth=" + self.form.buildingWidth.text() + "\n"
s += "countVAxes=" + str(self.form.countVAxes.value()) + "\n"
s += "distVAxes=" + self.form.distVAxes.text() + "\n"
s += "countHAxes=" + str(self.form.countHAxes.value()) + "\n"
s += "distHAxes=" + self.form.distHAxes.text() + "\n"
s += "countLevels=" + str(self.form.countLevels.value()) + "\n"
s += "levelHeight=" + self.form.levelHeight.text() + "\n"
s += "lineWidth=" + str(self.form.lineWidth.value()) + "\n"
s += "lineColor=" + str(self.form.lineColor.property("color").getRgbF()[:3]) + "\n"
s += "groups=" + ";;".join(groups) + "\n"
s += "addHumanFigure=" + str(int(self.form.addHumanFigure.isChecked())) + "\n"
preset = f"# FreeCAD BIM Project setup preset { name }\n"
for key, value in presets.items():
preset += f"{ key }={ value }\n"
f = open(os.path.join(presetdir, name + ".txt"), "w")
f.write(s)
f.write(preset)
f.close()
self.fillPresets()

View File

@@ -31,11 +31,10 @@ QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP
class BIM_Sketch:
def GetResources(self):
return {
"Pixmap": "Sketch",
"MenuText": QT_TRANSLATE_NOOP("BIM_Sketch", "Sketch"),
"MenuText": QT_TRANSLATE_NOOP("BIM_Sketch", "New Sketch"),
"ToolTip": QT_TRANSLATE_NOOP(
"BIM_Sketch", "Creates a new sketch in the current working plane"
),

View File

@@ -1,20 +1,14 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
from PySide.QtCore import QT_TRANSLATE_NOOP
import FreeCAD
import Path
import Path.Base.Util as PathUtil
import Path.Dressup.Array as DressupArray
import Path.Dressup.Utils as PathDressup
import Path.Main.Stock as PathStock
import PathScripts.PathUtils as PathUtils
from PySide import QtGui
from PySide.QtCore import QT_TRANSLATE_NOOP
import FreeCAD
import FreeCADGui
import Path
import PathGui
import Path.Dressup.Array as DressupArray
import Path.Dressup.Utils as PathDressup
from PySide.QtCore import QT_TRANSLATE_NOOP
translate = FreeCAD.Qt.translate
class DressupArrayViewProvider(object):

View File

@@ -671,7 +671,7 @@ class ObjectDressup:
lead.append(self.createStraightMove(obj, lineBegin, begin))
# prepend "LineZ" style lead-in - vertical inclined line
# Should be apply only on straight Path segment
# Should be applied only on straight Path segment
elif styleIn == "LineZ":
# tangent vector in XY plane
# normal vector is vertical
@@ -686,7 +686,7 @@ class ObjectDressup:
lead.append(self.createStraightMove(obj, lineBegin, begin))
# prepend "ArcZ" style lead-in - vertical Arc
# Should be apply only on straight Path segment
# Should be applied only on straight Path segment
elif styleIn == "ArcZ":
# tangent vector in XY plane
# normal vector is vertical
@@ -704,7 +704,7 @@ class ObjectDressup:
arcBegin = begin + tangent + normal
lead.extend(self.createArcZMoveDown(obj, arcBegin, begin, arcRadius))
# replace 'begin' position by first lead-in command
# replace 'begin' position with first lead-in command
begin = lead[0].positionBegin()
if styleIn in ("Arc3d", "Line3d"):
@@ -728,12 +728,12 @@ class ObjectDressup:
if obj.StyleOut == "Helix" and outInstrPrev:
"""change Z for previous helix lead-out
Can not do it in getLeadEnd(),
because no any information about next moves there while creating Lead-out"""
Unable to do it in getLeadEnd(), due to lack of
existing information about next moves while creating Lead-out"""
posPrevZ = outInstrPrev.positionEnd().z
if posPrevZ > beginZ:
"""previous profile upper than this
mean procesing one stepdown profile"""
mean processing one stepdown profile"""
halfStepZ = (posPrevZ - beginZ) / 2
outInstrPrev.param["Z"] = posPrevZ - halfStepZ
@@ -847,7 +847,7 @@ class ObjectDressup:
else:
lead[-1].param["Z"] = self.baseOp.StartDepth.Value
# append travel moves to clearance height after finish all profiles
# append travel moves to clearance height after finishing all profiles
if last and obj.StyleOut != "No Retract":
lead += self.getTravelEnd(obj)
@@ -888,7 +888,7 @@ class ObjectDressup:
return i
# Increase travel length from begin
# Increase travel length from 'begin'
def getOvertravelIn(self, obj, source, length, start, end):
startPoint = source[start].positionBegin()
endPoint = source[end].positionEnd()
@@ -901,12 +901,12 @@ class ObjectDressup:
instrLength = instr.pathLength()
if Path.Geom.isRoughly(measuredLength + instrLength, length, 1):
# get needed length and not need to cut last command
# get needed length without needing to cut last command
commands = source[end - i : end + 1]
return commands
elif measuredLength + instrLength > length:
# measured length exceed needed length and need cut command
# measured length exceeds needed length and needs cut command
commands = source[end - i + 1 : end + 1]
newLength = length - measuredLength
newInstr = self.cutInstrBegin(obj, instr, newLength)
@@ -938,12 +938,12 @@ class ObjectDressup:
instrLength = instr.pathLength()
if Path.Geom.isRoughly(measuredLength + instrLength, length, 1):
# get needed length and not need to cut last command
# get needed length without needing to cut last command
commands = source[start : start + i + 1]
return commands
elif measuredLength + instrLength > length:
# measured length exceed needed length and need cut command
# measured length exceeds needed length and needs cut command
commands = source[start : start + i]
newLength = length - measuredLength
newInstr = self.cutInstrEnd(obj, instr, newLength)
@@ -1051,7 +1051,7 @@ class ObjectDressup:
source = PathLanguage.Maneuver.FromPath(PathUtils.getPathWithPlacement(obj.Base)).instr
maneuver = PathLanguage.Maneuver()
# Knowing weather a given instruction is the first cutting move is easy,
# Knowing whether a given instruction is the first cutting move is easy,
# we just use a flag and set it to false afterwards. To find the last
# cutting move we need to search the list in reverse order.
@@ -1067,10 +1067,10 @@ class ObjectDressup:
# Process all instructions
for i, instr in enumerate(source):
# Process not mill instruction
# Process without mill instruction
if not self.isCuttingMove(instr):
if not instr.isMove():
# non-move instruction get added verbatim
# non-move instruction gets added verbatim
commands.append(instr)
else:
moveDir = self.getMoveDir(instr)

View File

@@ -1522,7 +1522,7 @@ def drawSpline(spline, forceShape=False):
if nbfitp != len(fitpoints):
raise ValueError("Wrong number of fit points")
if rational == all((w == 1.0 or w is None) for w in weights):
raise ValueError("inconsistant rational flag")
raise ValueError("Inconsistent rational flag")
if len(weights) == 0:
weights = None
elif len(weights) != len(controlpoints):

View File

@@ -102,7 +102,7 @@ class ConstraintTie(base_fempythonobject.BaseFemPythonObject):
type="App::PropertyInteger",
name="ConnectedSectors",
group="Geometry",
doc="Number of connected sectors",
doc="Number of connected sectors used for results display",
value=1,
)
)

View File

@@ -226,6 +226,15 @@
</item>
</layout>
</widget>
<tabstops>
<tabstop>rbUniform</tabstop>
<tabstop>dsbUniformScale</tabstop>
<tabstop>rbNonUniform</tabstop>
<tabstop>dsbXScale</tabstop>
<tabstop>dsbYScale</tabstop>
<tabstop>dsbZScale</tabstop>
<tabstop>treeWidget</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

View File

@@ -344,7 +344,7 @@ This setting is only for the toolbar. Whichever you choose, all tools are always
<property name="toolTip">
<string>Choose a visibility mode for the On-View-Parameters:
'Disabled': On-View-Parameters are completely disabled.
'Only dimensional': Only dimensional On-View-Parameters are visible. They are the most useful. For example the radius of a circle.
'Dimensional only': Only dimensional On-View-Parameters are visible. They are the most useful. For example, the radius of a circle.
'All': Both dimensional and positional On-View-Parameters. Positionals are the (x,y) position of the cursor. For example for the center of a circle.</string>
</property>
</widget>

View File

@@ -191,12 +191,12 @@ SheetTableView::SheetTableView(QWidget* parent)
return act;
};
actionProperties = createAction("", tr("Properties"), &SheetTableView::cellProperties);
actionProperties = createAction("", tr("Properties"), &SheetTableView::cellProperties);
contextMenu.addSeparator();
actionRecompute
= createAction(":/icons/view-refresh.svg", tr("Recompute"), &SheetTableView::onRecompute);
actionBind = createAction("", tr("Bind…"), &SheetTableView::onBind);
actionConf = createAction("", tr("Configuration Table"), &SheetTableView::onConfSetup);
actionConf = createAction("", tr("Configuration Table"), &SheetTableView::onConfSetup);
contextMenu.addSeparator();
actionMerge = createAction(
":/icons/SpreadsheetMergeCells.svg",

View File

@@ -423,7 +423,7 @@ class TaskFillTemplateFields:
QtCore.QObject.connect(
self.okbox, QtCore.SIGNAL("rejected()"), self.close
)
self.okbox.button(QtGui.QDialogButtonBox.Ok).setText("&Ok")
self.okbox.button(QtGui.QDialogButtonBox.Ok).setText("&OK")
self.okbox.button(QtGui.QDialogButtonBox.Cancel).setText("&Cancel")
self.button = self.okbox.button(QtGui.QDialogButtonBox.Ok)
self.button.setEnabled(True)

View File

@@ -668,7 +668,7 @@ indicator.adjustSize()
indicator.setObjectName("NavigationIndicator")
text = QtGui.QApplication.translate(
"NavigationIndicator",
"Navigation indicator",
"Navigation Indicator",
"A context menu action used to show or hide the 'Navigation indicator' toolbar widget",
)
indicator.setWindowTitle(text)