Merge branch 'master' into bugfix/toolbit-properties-alignment
This commit is contained in:
@@ -1909,6 +1909,7 @@ QToolBar > QPushButton:!checked {
|
||||
background-color: qlineargradient(spread:pad, x1:0, y1:0.3, x2:0, y2:1, stop:0 #232932, stop:1 #646464);
|
||||
border: 1px solid #232932;
|
||||
border-bottom-color: #434D5B; /* simulates shadow under the button */
|
||||
text-align: left; /* bug fix #4559 */
|
||||
}
|
||||
|
||||
QToolBar > QPushButton:checked:hover {
|
||||
|
||||
@@ -1876,6 +1876,7 @@ QToolBar > QPushButton:!checked {
|
||||
background-color: qlineargradient(spread:pad, x1:0, y1:0.3, x2:0, y2:1, stop:0 #6e6e6e, stop:1 #646464);
|
||||
border: 1px solid #5a5a5a;
|
||||
border-bottom-color: #505050; /* simulates shadow under the button */
|
||||
text-align: left; /* bug fix #4559 */
|
||||
}
|
||||
|
||||
QToolBar > QPushButton:checked:hover {
|
||||
|
||||
@@ -1897,6 +1897,7 @@ QToolBar > QPushButton:!checked {
|
||||
background-color: qlineargradient(spread:pad, x1:0, y1:0.3, x2:0, y2:1, stop:0 #444444, stop:1 #3c3c3c);
|
||||
border: 1px solid #424242;
|
||||
border-bottom-color: #333333; /* simulates shadow under the button */
|
||||
text-align: left; /* bug fix #4559 */
|
||||
}
|
||||
|
||||
QToolBar > QPushButton:checked:hover {
|
||||
|
||||
@@ -1876,6 +1876,7 @@ QToolBar > QPushButton:!checked {
|
||||
background-color: qlineargradient(spread:pad, x1:0, y1:0.3, x2:0, y2:1, stop:0 #6e6e6e, stop:1 #646464);
|
||||
border: 1px solid #5a5a5a;
|
||||
border-bottom-color: #505050; /* simulates shadow under the button */
|
||||
text-align: left; /* bug fix #4559 */
|
||||
}
|
||||
|
||||
QToolBar > QPushButton:checked:hover {
|
||||
|
||||
@@ -1876,6 +1876,7 @@ QToolBar > QPushButton:!checked {
|
||||
background-color: qlineargradient(spread:pad, x1:0, y1:0.3, x2:0, y2:1, stop:0 #6e6e6e, stop:1 #646464);
|
||||
border: 1px solid #5a5a5a;
|
||||
border-bottom-color: #505050; /* simulates shadow under the button */
|
||||
text-align: left; /* bug fix #4559 */
|
||||
}
|
||||
|
||||
QToolBar > QPushButton:checked:hover {
|
||||
|
||||
@@ -1897,6 +1897,7 @@ QToolBar > QPushButton:!checked {
|
||||
background-color: qlineargradient(spread:pad, x1:0, y1:0.3, x2:0, y2:1, stop:0 #444444, stop:1 #3c3c3c);
|
||||
border: 1px solid #424242;
|
||||
border-bottom-color: #333333; /* simulates shadow under the button */
|
||||
text-align: left; /* bug fix #4559 */
|
||||
}
|
||||
|
||||
QToolBar > QPushButton:checked:hover {
|
||||
|
||||
@@ -1897,6 +1897,7 @@ QToolBar > QPushButton:!checked {
|
||||
background-color: qlineargradient(spread:pad, x1:0, y1:0.3, x2:0, y2:1, stop:0 #444444, stop:1 #3c3c3c);
|
||||
border: 1px solid #424242;
|
||||
border-bottom-color: #333333; /* simulates shadow under the button */
|
||||
text-align: left; /* bug fix #4559 */
|
||||
}
|
||||
|
||||
QToolBar > QPushButton:checked:hover {
|
||||
|
||||
@@ -1897,6 +1897,7 @@ QToolBar > QPushButton:!checked {
|
||||
background-color: qlineargradient(spread:pad, x1:0, y1:0.3, x2:0, y2:1, stop:0 #444444, stop:1 #3c3c3c);
|
||||
border: 1px solid #424242;
|
||||
border-bottom-color: #333333; /* simulates shadow under the button */
|
||||
text-align: left; /* bug fix #4559 */
|
||||
}
|
||||
|
||||
QToolBar > QPushButton:checked:hover {
|
||||
|
||||
@@ -1877,6 +1877,7 @@ QToolBar > QPushButton:!checked {
|
||||
background-color: qlineargradient(spread:pad, x1:0, y1:0.3, x2:0, y2:1, stop:0 #f5f5f5, stop:1 #e6e6e6);
|
||||
border: 1px solid #d2d2d2;
|
||||
border-bottom-color: #c3c3c3; /* simulates shadow under the button */
|
||||
text-align: left; /* bug fix #4559 */
|
||||
}
|
||||
|
||||
QToolBar > QPushButton:checked:hover {
|
||||
|
||||
@@ -1877,6 +1877,7 @@ QToolBar > QPushButton:!checked {
|
||||
background-color: qlineargradient(spread:pad, x1:0, y1:0.3, x2:0, y2:1, stop:0 #f5f5f5, stop:1 #e6e6e6);
|
||||
border: 1px solid #d2d2d2;
|
||||
border-bottom-color: #c3c3c3; /* simulates shadow under the button */
|
||||
text-align: left; /* bug fix #4559 */
|
||||
}
|
||||
|
||||
QToolBar > QPushButton:checked:hover {
|
||||
|
||||
@@ -1877,6 +1877,7 @@ QToolBar > QPushButton:!checked {
|
||||
background-color: qlineargradient(spread:pad, x1:0, y1:0.3, x2:0, y2:1, stop:0 #f5f5f5, stop:1 #e6e6e6);
|
||||
border: 1px solid #d2d2d2;
|
||||
border-bottom-color: #c3c3c3; /* simulates shadow under the button */
|
||||
text-align: left; /* bug fix #4559 */
|
||||
}
|
||||
|
||||
QToolBar > QPushButton:checked:hover {
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
using Base::Console;
|
||||
using App::Application;
|
||||
|
||||
const char sBanner[] = "(c) Juergen Riegel, Werner Mayer, Yorik van Havre and others 2001-2020\n"\
|
||||
const char sBanner[] = "(c) Juergen Riegel, Werner Mayer, Yorik van Havre and others 2001-2021\n"\
|
||||
"FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.\n"\
|
||||
"FreeCAD wouldn't be possible without FreeCAD community.\n"\
|
||||
" ##### #### ### #### \n" \
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
|
||||
void PrintInitHelp(void);
|
||||
|
||||
const char sBanner[] = "\xc2\xa9 Juergen Riegel, Werner Mayer, Yorik van Havre and others 2001-2020\n"\
|
||||
const char sBanner[] = "\xc2\xa9 Juergen Riegel, Werner Mayer, Yorik van Havre and others 2001-2021\n"\
|
||||
"FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.\n"\
|
||||
"FreeCAD wouldn't be possible without FreeCAD community.\n"\
|
||||
" ##### #### ### #### \n" \
|
||||
|
||||
@@ -1726,6 +1726,8 @@ class ComponentTaskPanel:
|
||||
self.classButton.hide()
|
||||
else:
|
||||
import os
|
||||
# the BIM_Classification command needs to be added before it can be used
|
||||
FreeCADGui.activateWorkbench("BIMWorkbench")
|
||||
self.classButton.setIcon(QtGui.QIcon(os.path.join(os.path.dirname(BimClassification.__file__),"icons","BIM_Classification.svg")))
|
||||
|
||||
QtCore.QObject.connect(self.addButton, QtCore.SIGNAL("clicked()"), self.addElement)
|
||||
|
||||
@@ -311,7 +311,7 @@ class _ArchPipe(ArchComponent.Component):
|
||||
if not obj.Profile.Shape.Wires[0].isClosed():
|
||||
FreeCAD.Console.PrintError(translate("Arch","The profile is not closed")+"\n")
|
||||
return
|
||||
p = obj.Profile.Shape
|
||||
p = obj.Profile.Shape.Wires[0]
|
||||
else:
|
||||
if obj.Diameter.Value == 0:
|
||||
return
|
||||
|
||||
@@ -379,7 +379,7 @@ def getSVG(source,
|
||||
drafts.append(o)
|
||||
elif not o.isDerivedFrom("App::DocumentObjectGroup"):
|
||||
nonspaces.append(o)
|
||||
if Draft.getType(o) == "Window":
|
||||
if Draft.getType(o.getLinkedObject()) == "Window": # To support Link of Windows(Doors)
|
||||
windows.append(o)
|
||||
objs = nonspaces
|
||||
|
||||
@@ -580,11 +580,12 @@ def getSVG(source,
|
||||
if windows:
|
||||
sh = []
|
||||
for w in windows:
|
||||
if not hasattr(w.Proxy,"sshapes"):
|
||||
w.Proxy.execute(w)
|
||||
if hasattr(w.Proxy,"sshapes"):
|
||||
if w.Proxy.sshapes and (w.Name in cutwindows):
|
||||
c = Part.makeCompound(w.Proxy.sshapes)
|
||||
wlo = w.getLinkedObject() # To support Link of Windows(Doors)
|
||||
if not hasattr(wlo.Proxy,"sshapes"):
|
||||
wlo.Proxy.execute(wlo)
|
||||
if hasattr(wlo.Proxy,"sshapes"):
|
||||
if wlo.Proxy.sshapes and (w.Name in cutwindows):
|
||||
c = Part.makeCompound(wlo.Proxy.sshapes)
|
||||
c.Placement = w.Placement
|
||||
sh.append(c)
|
||||
# buggy for now...
|
||||
|
||||
@@ -235,8 +235,6 @@ class CubicBezCurve(gui_lines.Line):
|
||||
|
||||
def GetResources(self):
|
||||
"""Set icon, menu and tooltip."""
|
||||
_menu = ""
|
||||
_tip = ()
|
||||
|
||||
return {'Pixmap': 'Draft_CubicBezCurve',
|
||||
# 'Accel': "B, Z",
|
||||
|
||||
@@ -163,10 +163,8 @@ class SelectGroup(gui_base.GuiCommandNeedsSelection):
|
||||
|
||||
d = {'Pixmap': 'Draft_SelectGroup',
|
||||
'MenuText': QT_TRANSLATE_NOOP("Draft_SelectGroup","Select group"),
|
||||
'ToolTip': QT_TRANSLATE_NOOP("Draft_SelectGroup","If the selection is a group, it selects all objects that are inside this group, "
|
||||
"including those in nested sub-groups.\n\nIf the selection is a simple object "
|
||||
"inside a group, it will select the \"brother\" objects, that is,\nthose that are "
|
||||
"at the same level as this object, including the upper group that contains them all.")}
|
||||
'ToolTip': QT_TRANSLATE_NOOP("Draft_SelectGroup","If the selection is a group, it selects all objects that are inside this group, including those in nested sub-groups.\n\nIf the selection is a simple object inside a group, it will select the \"brother\" objects, that is,\nthose that are at the same level as this object, including the upper group that contains them all.")}
|
||||
|
||||
return d
|
||||
|
||||
def Activated(self):
|
||||
|
||||
@@ -54,8 +54,6 @@ class Shape2DView(gui_base_original.Modifier):
|
||||
|
||||
def GetResources(self):
|
||||
"""Set icon, menu and tooltip."""
|
||||
_menu = ""
|
||||
_tip = ()
|
||||
|
||||
return {'Pixmap': 'Draft_2DShapeView',
|
||||
'MenuText': QT_TRANSLATE_NOOP("Draft_Shape2DView", "Shape 2D view"),
|
||||
|
||||
@@ -62,8 +62,6 @@ class ShapeString(gui_base_original.Creator):
|
||||
|
||||
def GetResources(self):
|
||||
"""Set icon, menu and tooltip."""
|
||||
_menu = ""
|
||||
_tip = ()
|
||||
|
||||
d = {'Pixmap': 'Draft_ShapeString',
|
||||
'Accel': "S, S",
|
||||
|
||||
@@ -567,7 +567,6 @@ class ShowSnapBar(gui_base.GuiCommandSimplest):
|
||||
|
||||
def GetResources(self):
|
||||
"""Set icon, menu and tooltip."""
|
||||
_tip = ""
|
||||
|
||||
return {'Pixmap': 'Draft_Snap',
|
||||
'MenuText': QT_TRANSLATE_NOOP("Draft_ShowSnapBar","Show snap toolbar"),
|
||||
|
||||
@@ -54,8 +54,6 @@ class SubelementHighlight(gui_base_original.Modifier):
|
||||
|
||||
def GetResources(self):
|
||||
"""Set icon, menu and tooltip."""
|
||||
_menu = ""
|
||||
_tip = ()
|
||||
|
||||
return {'Pixmap': 'Draft_SubelementHighlight',
|
||||
'Accel': "H, S",
|
||||
|
||||
@@ -518,13 +518,21 @@ class _TaskPanel:
|
||||
|
||||
def update_material_property(self, input_field, matProperty, qUnit, variation=0.001):
|
||||
# this update property works for all Gui::InputField widgets
|
||||
value = Units.Quantity(input_field.text()).getValueAs(qUnit)
|
||||
old_value = Units.Quantity(self.material[matProperty]).getValueAs(qUnit)
|
||||
if qUnit != "":
|
||||
value = Units.Quantity(input_field.text()).getValueAs(qUnit)
|
||||
old_value = Units.Quantity(self.material[matProperty]).getValueAs(qUnit)
|
||||
else:
|
||||
# for example PoissonRatio
|
||||
value = float(input_field.text())
|
||||
old_value = float(self.material[matProperty])
|
||||
if value:
|
||||
if not (1 - variation < float(old_value) / value < 1 + variation):
|
||||
material = self.material
|
||||
# unicode() is an alias to str for py3
|
||||
material[matProperty] = unicode(value) + " " + qUnit
|
||||
if qUnit != "":
|
||||
material[matProperty] = unicode(value) + " " + qUnit
|
||||
else:
|
||||
material[matProperty] = unicode(value)
|
||||
self.material = material
|
||||
if self.has_transient_mat is False:
|
||||
self.add_transient_material()
|
||||
|
||||
@@ -207,7 +207,7 @@ class _TaskPanel:
|
||||
"Unexpected error when creating mesh: {}\n"
|
||||
.format(sys.exc_info()[0])
|
||||
)
|
||||
error = sys.exc_info()[0].strip();
|
||||
error = sys.exc_info()[0].strip()
|
||||
if error:
|
||||
FreeCAD.Console.PrintMessage("Gmsh had warnings ...\n")
|
||||
FreeCAD.Console.PrintMessage("{}\n".format(error))
|
||||
|
||||
@@ -504,7 +504,12 @@ double Helix::safePitch()
|
||||
void Helix::proposeParameters(bool force)
|
||||
{
|
||||
if (force || !HasBeenEdited.getValue()) {
|
||||
double pitch = 1.1*safePitch();
|
||||
TopoDS_Shape sketchshape = getVerifiedFace();
|
||||
Bnd_Box bb;
|
||||
BRepBndLib::Add(sketchshape, bb);
|
||||
bb.SetGap(0.0);
|
||||
double pitch = 1.1 * sqrt(bb.SquareExtent());
|
||||
|
||||
Pitch.setValue(pitch);
|
||||
Height.setValue(pitch*3.0);
|
||||
HasBeenEdited.setValue(1);
|
||||
|
||||
@@ -179,6 +179,9 @@ App::DocumentObjectExecReturn *Loft::execute(void)
|
||||
AddSubShape.setValue(result);
|
||||
|
||||
if(base.IsNull()) {
|
||||
if (getAddSubType() == FeatureAddSub::Subtractive)
|
||||
return new App::DocumentObjectExecReturn("Loft: There is nothing to subtract from\n");
|
||||
|
||||
Shape.setValue(getSolid(result));
|
||||
return App::DocumentObject::StdReturn;
|
||||
}
|
||||
|
||||
@@ -84,6 +84,7 @@ SET(PathScripts_SRCS
|
||||
PathScripts/PathPost.py
|
||||
PathScripts/PathPostProcessor.py
|
||||
PathScripts/PathPreferences.py
|
||||
PathScripts/PathPreferencesAdvanced.py
|
||||
PathScripts/PathPreferencesPathDressup.py
|
||||
PathScripts/PathPreferencesPathJob.py
|
||||
PathScripts/PathProbe.py
|
||||
|
||||
@@ -67,9 +67,6 @@ void DlgSettingsPathColor::saveSettings()
|
||||
ui->DefaultBBoxNormalColor->onSave();
|
||||
ui->DefaultSelectionStyle->onSave();
|
||||
ui->DefaultTaskPanelLayout->onSave();
|
||||
ui->WarningSuppressAllSpeeds->onSave();
|
||||
ui->WarningSuppressRapidSpeeds->onSave();
|
||||
ui->WarningSuppressSelectionMode->onSave();
|
||||
}
|
||||
|
||||
void DlgSettingsPathColor::loadSettings()
|
||||
@@ -86,9 +83,6 @@ void DlgSettingsPathColor::loadSettings()
|
||||
ui->DefaultBBoxNormalColor->onRestore();
|
||||
ui->DefaultSelectionStyle->onRestore();
|
||||
ui->DefaultTaskPanelLayout->onRestore();
|
||||
ui->WarningSuppressAllSpeeds->onRestore();
|
||||
ui->WarningSuppressRapidSpeeds->onRestore();
|
||||
ui->WarningSuppressSelectionMode->onRestore();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>512</width>
|
||||
<height>691</height>
|
||||
<height>573</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -436,7 +436,7 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<item row="2" column="0" colspan="2">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@@ -449,72 +449,6 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Warnings</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="Gui::PrefCheckBox" name="WarningSuppressAllSpeeds">
|
||||
<property name="toolTip">
|
||||
<string>Suppress all warnings about setting speed rates for accurate cycle time calculation</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Suppress all missing speeds warning</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>WarningSuppressAllSpeeds</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Path</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Gui::PrefCheckBox" name="WarningSuppressRapidSpeeds">
|
||||
<property name="toolTip">
|
||||
<string>Suppress warning about setting the rapid speed rates for accurate cycle time calculation. Ignored if all speed warnings are already suppressed.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Suppress missing rapid speeds warning</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>WarningSuppressRapidSpeeds</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Path</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Gui::PrefCheckBox" name="WarningSuppressSelectionMode">
|
||||
<property name="toolTip">
|
||||
<string>Suppress warning whenever a Path selection mode is activated</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Suppress selection mode warning</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>WarningSuppressSelectionMode</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Path</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
@@ -538,11 +472,6 @@
|
||||
<extends>QComboBox</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Gui::PrefCheckBox</class>
|
||||
<extends>QCheckBox</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>DefaultNormalPathColor</tabstop>
|
||||
|
||||
@@ -132,6 +132,7 @@
|
||||
<file>panels/ToolLibraryEditor.ui</file>
|
||||
<file>panels/TaskPathSimulator.ui</file>
|
||||
<file>panels/ZCorrectEdit.ui</file>
|
||||
<file>preferences/Advanced.ui</file>
|
||||
<file>preferences/PathDressupHoldingTags.ui</file>
|
||||
<file>preferences/PathJob.ui</file>
|
||||
<file>translations/Path_af.qm</file>
|
||||
|
||||
184
src/Mod/Path/Gui/Resources/preferences/Advanced.ui
Normal file
184
src/Mod/Path/Gui/Resources/preferences/Advanced.ui
Normal file
@@ -0,0 +1,184 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>PathGui::DlgSettingsPathColor</class>
|
||||
<widget class="QWidget" name="PathGui::DlgSettingsPathColor">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>512</width>
|
||||
<height>691</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Advanced</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Warnings</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="Gui::PrefCheckBox" name="WarningSuppressAllSpeeds">
|
||||
<property name="toolTip">
|
||||
<string>Suppress all warnings about setting speed rates for accurate cycle time calculation</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Suppress all missing speeds warning</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>WarningSuppressAllSpeeds</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Path</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Gui::PrefCheckBox" name="WarningSuppressRapidSpeeds">
|
||||
<property name="toolTip">
|
||||
<string>Suppress warning about setting the rapid speed rates for accurate cycle time calculation. Ignored if all speed warnings are already suppressed.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Suppress missing rapid speeds warning</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>WarningSuppressRapidSpeeds</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Path</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Gui::PrefCheckBox" name="WarningSuppressSelectionMode">
|
||||
<property name="toolTip">
|
||||
<string>Suppress warning whenever a Path selection mode is activated</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Suppress selection mode warning</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>WarningSuppressSelectionMode</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Path</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Open CAMlib</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QTextEdit" name="textEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="verticalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QAbstractScrollArea::AdjustToContents</enum>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Sans'; font-size:16pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If openCAMlib is installed with its python interface it can be used by some additional 3d operations.</p>
|
||||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Changing this value requires a restart of FreeCAD to take effect.</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Gui::PrefCheckBox" name="EnableAdvancedOCLFeatures">
|
||||
<property name="text">
|
||||
<string>Enable OCL dependent features</string>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>EnableAdvancedOCLFeatures</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Path</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Gui::PrefCheckBox" name="WarningSuppressOpenCamLib">
|
||||
<property name="toolTip">
|
||||
<string>Suppress warning if openCAMlib cannot be found</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Suppress openCAMlib warning</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>WarningSuppressOpenCamLib</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Path</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>217</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Gui::PrefCheckBox</class>
|
||||
<extends>QCheckBox</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -121,6 +121,7 @@ class PathWorkbench (Workbench):
|
||||
extracmdlist.extend(["Path_Area", "Path_Area_Workplane"])
|
||||
specialcmdlist.append('Path_Thread_Milling')
|
||||
|
||||
if PathPreferences.advancedOCLFeaturesEnabled():
|
||||
try:
|
||||
import ocl # pylint: disable=unused-variable
|
||||
from PathScripts import PathSurfaceGui
|
||||
@@ -164,6 +165,9 @@ class PathWorkbench (Workbench):
|
||||
if curveAccuracy:
|
||||
Path.Area.setDefaultParams(Accuracy=curveAccuracy)
|
||||
|
||||
# keep this one the last entry in the preferences
|
||||
import PathScripts.PathPreferencesAdvanced as PathPreferencesAdvanced
|
||||
FreeCADGui.addPreferencePage(PathPreferencesAdvanced.AdvancedPreferencesPage, "Path")
|
||||
Log('Loading Path workbench... done\n')
|
||||
|
||||
def GetClassName(self):
|
||||
|
||||
@@ -62,6 +62,7 @@ WarningSuppressAllSpeeds = "WarningSuppressAllSpeeds"
|
||||
WarningSuppressSelectionMode = "WarningSuppressSelectionMode"
|
||||
WarningSuppressOpenCamLib = "WarningSuppressOpenCamLib"
|
||||
EnableExperimentalFeatures = "EnableExperimentalFeatures"
|
||||
EnableAdvancedOCLFeatures = "EnableAdvancedOCLFeatures"
|
||||
|
||||
|
||||
def preferences():
|
||||
@@ -243,6 +244,10 @@ def setDefaultTaskPanelLayout(style):
|
||||
preferences().SetInt(DefaultTaskPanelLayout, style)
|
||||
|
||||
|
||||
def advancedOCLFeaturesEnabled():
|
||||
return preferences().GetBool(EnableAdvancedOCLFeatures, False)
|
||||
|
||||
|
||||
def experimentalFeaturesEnabled():
|
||||
return preferences().GetBool(EnableExperimentalFeatures, False)
|
||||
|
||||
@@ -251,8 +256,8 @@ def suppressAllSpeedsWarning():
|
||||
return preferences().GetBool(WarningSuppressAllSpeeds, True)
|
||||
|
||||
|
||||
def suppressRapidSpeedsWarning():
|
||||
return suppressAllSpeedsWarning() or preferences().GetBool(WarningSuppressRapidSpeeds, True)
|
||||
def suppressRapidSpeedsWarning(user=True):
|
||||
return (user and suppressAllSpeedsWarning()) or preferences().GetBool(WarningSuppressRapidSpeeds, True)
|
||||
|
||||
|
||||
def suppressSelectionModeWarning():
|
||||
@@ -262,6 +267,12 @@ def suppressSelectionModeWarning():
|
||||
def suppressOpenCamLibWarning():
|
||||
return preferences().GetBool(WarningSuppressOpenCamLib, True)
|
||||
|
||||
def setPreferencesAdvanced(ocl, warnSpeeds, warnRapids, warnModes, warnOCL):
|
||||
preferences().SetBool(EnableAdvancedOCLFeatures, ocl)
|
||||
preferences().SetBool(WarningSuppressAllSpeeds, warnSpeeds)
|
||||
preferences().SetBool(WarningSuppressRapidSpeeds, warnRapids)
|
||||
preferences().SetBool(WarningSuppressSelectionMode, warnModes)
|
||||
preferences().SetBool(WarningSuppressOpenCamLib, warnOCL)
|
||||
|
||||
def lastFileToolLibrary():
|
||||
filename = preferences().GetString(LastFileToolLibrary)
|
||||
|
||||
60
src/Mod/Path/PathScripts/PathPreferencesAdvanced.py
Normal file
60
src/Mod/Path/PathScripts/PathPreferencesAdvanced.py
Normal file
@@ -0,0 +1,60 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ***************************************************************************
|
||||
# * Copyright (c) 2021 sliptonic <shopinthewoods@gmail.com> *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * This program is distributed in the hope that it will be useful, *
|
||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
# * GNU Library General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with this program; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
import FreeCADGui
|
||||
import PathScripts.PathPreferences as PathPreferences
|
||||
import PySide
|
||||
|
||||
# Qt translation handling
|
||||
def translate(context, text, disambig=None):
|
||||
return PySide.QtCore.QCoreApplication.translate(context, text, disambig)
|
||||
|
||||
class AdvancedPreferencesPage:
|
||||
def __init__(self, parent=None):
|
||||
self.form = FreeCADGui.PySideUic.loadUi(':preferences/Advanced.ui')
|
||||
self.form.WarningSuppressAllSpeeds.stateChanged.connect(self.updateSelection)
|
||||
self.form.EnableAdvancedOCLFeatures.stateChanged.connect(self.updateSelection)
|
||||
|
||||
def saveSettings(self):
|
||||
PathPreferences.setPreferencesAdvanced(
|
||||
self.form.EnableAdvancedOCLFeatures.isChecked(),
|
||||
self.form.WarningSuppressAllSpeeds.isChecked(),
|
||||
self.form.WarningSuppressRapidSpeeds.isChecked(),
|
||||
self.form.WarningSuppressSelectionMode.isChecked(),
|
||||
self.form.WarningSuppressOpenCamLib.isChecked())
|
||||
|
||||
def loadSettings(self):
|
||||
self.form.WarningSuppressAllSpeeds.setChecked(PathPreferences.suppressAllSpeedsWarning())
|
||||
self.form.WarningSuppressRapidSpeeds.setChecked(PathPreferences.suppressRapidSpeedsWarning(False))
|
||||
self.form.WarningSuppressSelectionMode.setChecked(PathPreferences.suppressSelectionModeWarning())
|
||||
self.form.EnableAdvancedOCLFeatures.setChecked(PathPreferences.advancedOCLFeaturesEnabled())
|
||||
self.form.WarningSuppressOpenCamLib.setChecked(PathPreferences.suppressOpenCamLibWarning())
|
||||
self.updateSelection()
|
||||
|
||||
def updateSelection(self, state=None):
|
||||
self.form.WarningSuppressOpenCamLib.setEnabled(self.form.EnableAdvancedOCLFeatures.isChecked())
|
||||
if self.form.WarningSuppressAllSpeeds.isChecked():
|
||||
self.form.WarningSuppressRapidSpeeds.setChecked(True)
|
||||
self.form.WarningSuppressRapidSpeeds.setEnabled(False)
|
||||
else:
|
||||
self.form.WarningSuppressRapidSpeeds.setEnabled(True)
|
||||
|
||||
@@ -2555,6 +2555,7 @@ class OCL_Tool():
|
||||
if (self.diameter == -1.0 or self.cutEdgeHeight == -1.0):
|
||||
return
|
||||
self.tiltCutter = True
|
||||
if self.cutEdgeHeight==0 : self.cutEdgeHeight = self.diameter/2
|
||||
self.oclTool = self.ocl.BallCutter(
|
||||
self.diameter,
|
||||
self.cutEdgeHeight + self.lengthOffset
|
||||
@@ -2582,8 +2583,8 @@ class OCL_Tool():
|
||||
return
|
||||
self.oclTool = self.ocl.ConeCutter(
|
||||
self.diameter,
|
||||
self.cutEdgeAngle,
|
||||
self.cutEdgeHeight + self.lengthOffset
|
||||
self.cutEdgeAngle/2,
|
||||
self.lengthOffset
|
||||
)
|
||||
|
||||
def _setToolMethod(self):
|
||||
|
||||
@@ -85,7 +85,7 @@ function printAddons(data) {
|
||||
if (wblist.indexOf(data.data[i].name.toLowerCase()) == -1) {
|
||||
html.push('<li><a href="', data.data[i].html_url, '">', data.data[i].name, '</a></li>');
|
||||
} else {
|
||||
html.push('<li>', data.data[i].name, ' <img src="IMAGE_SRC_INSTALLED"></li>');
|
||||
html.push('<li><a href="', data.data[i].html_url, '">', data.data[i].name, '</a> <img src="IMAGE_SRC_INSTALLED"></li>');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user