Merge branch 'master' into bugfix/tags-precision

This commit is contained in:
mlampert
2017-11-21 12:31:00 -08:00
committed by GitHub
12 changed files with 35 additions and 28 deletions

View File

@@ -126,7 +126,7 @@ void CombiView::changeEvent(QEvent *e)
if (e->type() == QEvent::LanguageChange) {
tabs->setTabText(0, trUtf8("Model"));
tabs->setTabText(1, trUtf8("Tasks"));
tabs->setTabText(2, trUtf8("Project"));
//tabs->setTabText(2, trUtf8("Project"));
}
DockWindow::changeEvent(e);

View File

@@ -84,7 +84,7 @@ using namespace Gui::DockWnd;
*
* \section wayout Way out
* To solve these problems we have introduced the command framework to decouple QAction and MainWindow. The base classes of the framework are
* \a Gui::CommandBase and \a Gui::Action that represent the link between Qt's QAction world and the FreeCAD's command world.
* \a Gui::CommandBase and \a Gui::Action that represent the link between Qt's QAction world and the FreeCAD's command world.
*
* The Action class holds a pointer to QAction and CommandBase and acts as a mediator and -- to save memory -- that gets created
* (@ref Gui::CommandBase::createAction()) not before it is added (@ref Gui::Command::addTo()) to a menu or toolbar.

View File

@@ -1865,9 +1865,9 @@ StdCmdViewCreate::StdCmdViewCreate()
{
sGroup = QT_TR_NOOP("Standard-View");
sMenuText = QT_TR_NOOP("Create new view");
sToolTipText= QT_TR_NOOP("Creates a new view window for the active document");
sToolTipText= QT_TR_NOOP("Creates a new view window for the active document");
sWhatsThis = "Std_ViewCreate";
sStatusTip = QT_TR_NOOP("Creates a new view window for the active document");
sStatusTip = QT_TR_NOOP("Creates a new view window for the active document");
sPixmap = "window-new";
eType = Alter3DView;
}

View File

@@ -97,7 +97,7 @@ int main( int argc, char ** argv )
catch (const Base::Exception& e) {
std::string appName = App::Application::Config()["ExeName"];
std::stringstream msg;
msg << "While initializing " << appName << " the following exception occurred: '" << e.what() << "'\n\n";
msg << "While initializing " << appName << " the following exception occurred: '" << e.what() << "'\n\n";
msg << "Python is searching for its runtime files in the following directories:\n" << Py_GetPath() << "\n\n";
msg << "Python version information:\n" << Py_GetVersion() << "\n";
const char* pythonhome = getenv("PYTHONHOME");

View File

@@ -208,7 +208,7 @@ int main( int argc, char ** argv )
QApplication app(argc,argv);
QString appName = QString::fromLatin1(App::Application::Config()["ExeName"].c_str());
QString msg;
msg = QObject::tr("While initializing %1 the following exception occurred: '%2'\n\n"
msg = QObject::tr("While initializing %1 the following exception occurred: '%2'\n\n"
"Python is searching for its files in the following directories:\n%3\n\n"
"Python version information:\n%4\n")
.arg(appName).arg(QString::fromUtf8(e.what()))

View File

@@ -215,7 +215,7 @@ PyMOD_INIT_FUNC(FreeCAD)
catch (const Base::Exception& e) {
std::string appName = App::Application::Config()["ExeName"];
std::stringstream msg;
msg << "While initializing " << appName << " the following exception occurred: '"
msg << "While initializing " << appName << " the following exception occurred: '"
<< e.what() << "'\n\n";
msg << "\nPlease contact the application's support team for more information.\n\n";
printf("Initialization of %s failed:\n%s", appName.c_str(), msg.str().c_str());

View File

@@ -59,7 +59,7 @@ public:
/*! \brief Load the input-shapes. Must be called before running the main program
\param InputMesh Input-mesh
\param CAD_Shape Input-shape
\param CAD_Shape Input-shape
*/
void Load(const MeshCore::MeshKernel &InputMesh, const TopoDS_Shape &CAD_Shape);

View File

@@ -567,7 +567,7 @@ void DrawingView::print(QPrinter* printer)
if (doPrint && printer->orientation() != this->m_orientation) {
int ret = QMessageBox::warning(this, tr("Different orientation"),
tr("The printer uses a different orientation than the drawing.\n"
tr("The printer uses a different orientation than the drawing.\n"
"Do you want to continue?"),
QMessageBox::Yes | QMessageBox::No);
if (ret != QMessageBox::Yes)

View File

@@ -39,16 +39,19 @@ __author__ = "sliptonic (Brad Collette)"
__url__ = "http://www.freecadweb.org"
__doc__ = "Base class an implementation for operations on circular holes."
# Qt tanslation handling
def translate(context, text, disambig=None):
return QtCore.QCoreApplication.translate(context, text, disambig)
if False:
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
PathLog.trackModule(PathLog.thisModule())
else:
PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
class ObjectOp(PathOp.ObjectOp):
'''Base class for proxy objects of all operations on circular holes.'''
@@ -155,23 +158,7 @@ class ObjectOp(PathOp.ObjectOp):
return len(obj.Locations) != 0
return False
if len(obj.Base) == 0 and not haveLocations(self, obj):
features = []
if self.baseIsArchPanel(obj, self.baseobject):
holeshapes = self.baseobject.Proxy.getHoles(self.baseobject, transform=True)
tooldiameter = obj.ToolController.Proxy.getTool(obj.ToolController).Diameter
for holeNr, hole in enumerate(holeshapes):
PathLog.debug('Entering new HoleShape')
for wireNr, wire in enumerate(hole.Wires):
PathLog.debug('Entering new Wire')
for edgeNr, edge in enumerate(wire.Edges):
if PathUtils.isDrillable(self.baseobject, edge, tooldiameter):
PathLog.debug('Found drillable hole edges: {}'.format(edge))
features.append((self.baseobject, "%d.%d.%d" % (holeNr, wireNr, edgeNr)))
else:
features = self.findHoles(obj, self.baseobject)
obj.Base = features
obj.Disabled = []
# if len(obj.Base) == 0 and not haveLocations(self, obj):
holes = []
@@ -195,6 +182,24 @@ class ObjectOp(PathOp.ObjectOp):
Must be overwritten by subclasses.'''
pass
def findAllHoles(self, obj):
features = []
if self.baseIsArchPanel(obj, self.baseobject):
holeshapes = self.baseobject.Proxy.getHoles(self.baseobject, transform=True)
tooldiameter = obj.ToolController.Proxy.getTool(obj.ToolController).Diameter
for holeNr, hole in enumerate(holeshapes):
PathLog.debug('Entering new HoleShape')
for wireNr, wire in enumerate(hole.Wires):
PathLog.debug('Entering new Wire')
for edgeNr, edge in enumerate(wire.Edges):
if PathUtils.isDrillable(self.baseobject, edge, tooldiameter):
PathLog.debug('Found drillable hole edges: {}'.format(edge))
features.append((self.baseobject, "%d.%d.%d" % (holeNr, wireNr, edgeNr)))
else:
features = self.findHoles(obj, self.baseobject)
obj.Base = features
obj.Disabled = []
def findHoles(self, obj, baseobject):
'''findHoles(obj, baseobject) ... inspect baseobject and identify all features that resemble a straight cricular hole.'''
shape = baseobject.Shape

View File

@@ -165,6 +165,7 @@ class TaskPanelHoleGeometryPage(PathOpGui.TaskPanelBaseGeometryPage):
'''resetBase() ... push button callback'''
self.obj.Base = []
self.obj.Disabled = []
self.obj.Proxy.findAllHoles(self.obj)
self.obj.Proxy.execute(self.obj)
FreeCAD.ActiveDocument.recompute()
@@ -180,4 +181,3 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage):
def taskPanelBaseGeometryPage(self, obj, features):
'''taskPanelBaseGeometryPage(obj, features) ... Return circular hole specific page controller for Base Geometry.'''
return TaskPanelHoleGeometryPage(obj, features)

View File

@@ -124,4 +124,5 @@ def Create(name):
'''Create(name) ... Creates and returns a Drilling operation.'''
obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython", name)
proxy = ObjectDrilling(obj)
proxy.findAllHoles(obj)
return obj

View File

@@ -45,7 +45,7 @@ class ObjectHelix(PathCircularHoleBase.ObjectOp):
def circularHoleFeatures(self, obj):
'''circularHoleFeatures(obj) ... enable features supported by Helix.'''
return PathOp.FeatureStepDown | PathOp.FeatureBaseEdges | PathOp.FeatureBaseFaces | PathOp.FeatureBasePanels
return PathOp.FeatureStepDown | PathOp.FeatureBaseEdges | PathOp.FeatureBaseFaces | PathOp.FeatureBasePanels
def initCircularHoleOperation(self, obj):
'''initCircularHoleOperation(obj) ... create helix specific properties.'''
@@ -197,4 +197,5 @@ def Create(name):
'''Create(name) ... Creates and returns a Helix operation.'''
obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython", name)
proxy = ObjectHelix(obj)
proxy.findAllHoles(obj)
return obj