Skip to content

Commit

Permalink
FEM: code formating and unifor licence header in Python modules
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach committed Mar 4, 2020
1 parent c460f08 commit 5620122
Show file tree
Hide file tree
Showing 106 changed files with 232 additions and 67 deletions.
1 change: 0 additions & 1 deletion src/Mod/Fem/Init.py
Expand Up @@ -20,7 +20,6 @@
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
# * USA *
# * *
# * Juergen Riegel 2002 *
# ***************************************************************************/

# FreeCAD init script of the Fem module
Expand Down
17 changes: 6 additions & 11 deletions src/Mod/Fem/InitGui.py
@@ -1,14 +1,5 @@
# Fem gui init module
# (c) 2009 Juergen Riegel
#
# Gathering all the information to start FreeCAD
# This is the second one of three init scripts, the third one
# runs when the gui is up

# ***************************************************************************
# * (c) Juergen Riegel (juergen.riegel@web.de) 2009 *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * Copyright (c) 2009 Juergen Riegel <juergen.riegel@web.de> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the GNU Lesser General Public License (LGPL) *
Expand All @@ -26,9 +17,13 @@
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
# * USA *
# * *
# * Juergen Riegel 2002 *
# ***************************************************************************/

# Fem gui init module
# Gathering all the information to start FreeCAD
# This is the second one of three init scripts
# the third one runs when the gui is up

import FreeCAD
import FreeCADGui

Expand Down
2 changes: 2 additions & 0 deletions src/Mod/Fem/ObjectsFem.py
@@ -1,6 +1,8 @@
# ***************************************************************************
# * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * 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 *
Expand Down
7 changes: 3 additions & 4 deletions src/Mod/Fem/TestFem.py
@@ -1,7 +1,6 @@
# ***************************************************************************
# * Copyright (c) 2018 - FreeCAD Developers *
# * Author: Przemo Firszt <przemo@firszt.eu> *
# * Author: Bernd Hahnebach <bernd@bimstatik.org> *
# * Copyright (c) 2018 Przemo Firszt <przemo@firszt.eu> *
# * Copyright (c) 2018 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
Expand All @@ -21,7 +20,7 @@
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
# * USA *
# * *
# ***************************************************************************/
# ***************************************************************************


# Unit test for the FEM module
Expand Down
2 changes: 2 additions & 0 deletions src/Mod/Fem/femguiobjects/FemSelectionWidgets.py
Expand Up @@ -2,6 +2,8 @@
# * Copyright (c) 2017 Markus Hovorka <m.hovorka@live.de> *
# * Copyright (c) 2018 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * 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 *
Expand Down
2 changes: 2 additions & 0 deletions src/Mod/Fem/femguiobjects/ViewProviderFemConstraint.py
Expand Up @@ -2,6 +2,8 @@
# * Copyright (c) 2017 Markus Hovorka <m.hovorka@live.de> *
# * Copyright (c) 2018 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * 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 *
Expand Down
2 changes: 2 additions & 0 deletions src/Mod/Fem/femguiobjects/_TaskPanelFemSolverControl.py
@@ -1,6 +1,8 @@
# ***************************************************************************
# * Copyright (c) 2017 Markus Hovorka <m.hovorka@live.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * 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 *
Expand Down
@@ -1,6 +1,8 @@
# ***************************************************************************
# * Copyright (c) 2017 Markus Hovorka <m.hovorka@live.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * 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 *
Expand Down
@@ -1,6 +1,8 @@
# ***************************************************************************
# * Copyright (c) 2017 Markus Hovorka <m.hovorka@live.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * 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 *
Expand Down
@@ -1,6 +1,8 @@
# ***************************************************************************
# * Copyright (c) 2017 Markus Hovorka <m.hovorka@live.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * 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 *
Expand Down
@@ -1,6 +1,8 @@
# ***************************************************************************
# * Copyright (c) 2017 Markus Hovorka <m.hovorka@live.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * 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 *
Expand Down
@@ -1,6 +1,8 @@
# ***************************************************************************
# * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * 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 *
Expand Down
2 changes: 2 additions & 0 deletions src/Mod/Fem/femguiobjects/_ViewProviderFemConstraintTie.py
@@ -1,6 +1,8 @@
# ***************************************************************************
# * Copyright (c) 2020 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * 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 *
Expand Down
2 changes: 2 additions & 0 deletions src/Mod/Fem/femguiobjects/_ViewProviderFemElementFluid1D.py
Expand Up @@ -3,6 +3,8 @@
# * Copyright (c) 2018 Bernd Hahnebach <bernd@bimstatik.org> *
# * Based on the FemElementGeometry1D by Bernd Hahnebach *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * 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 *
Expand Down
@@ -1,6 +1,8 @@
# ***************************************************************************
# * Copyright (c) 2015 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * 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 *
Expand Down
@@ -1,6 +1,8 @@
# ***************************************************************************
# * Copyright (c) 2015 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * 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 *
Expand Down
@@ -1,6 +1,8 @@
# ***************************************************************************
# * Copyright (c) 2017 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * 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 *
Expand Down
2 changes: 2 additions & 0 deletions src/Mod/Fem/femguiobjects/_ViewProviderFemMaterial.py
Expand Up @@ -2,6 +2,8 @@
# * Copyright (c) 2013 Juergen Riegel <FreeCAD@juergen-riegel.net> *
# * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * 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 *
Expand Down
@@ -1,6 +1,8 @@
# ***************************************************************************
# * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * 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 *
Expand Down
@@ -1,6 +1,8 @@
# ***************************************************************************
# * Copyright (c) 2019 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * 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 *
Expand Down
@@ -1,6 +1,8 @@
# ***************************************************************************
# * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * 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 *
Expand Down
35 changes: 21 additions & 14 deletions src/Mod/Fem/femguiobjects/_ViewProviderFemMeshGmsh.py
@@ -1,6 +1,8 @@
# ***************************************************************************
# * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * 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 *
Expand Down Expand Up @@ -28,22 +30,25 @@
# \brief FreeCAD FEM _ViewProviderFemMeshGmsh

import sys
import FreeCAD
import FreeCADGui
import FemGui
from . import ViewProviderFemConstraint
import time

# for the panel
from femobjects import _FemMeshGmsh
from PySide import QtCore
from PySide import QtGui
from PySide.QtCore import Qt
from PySide.QtGui import QApplication
import time

import FreeCAD
import FreeCADGui

import FemGui
from . import ViewProviderFemConstraint
from femobjects import _FemMeshGmsh


class _ViewProviderFemMeshGmsh(ViewProviderFemConstraint.ViewProxy):
"A View Provider for the FemMeshGmsh object"
"""
A View Provider for the FemMeshGmsh object
"""

def getIcon(self):
return ":/icons/fem-femmesh-from-shape.svg"
Expand All @@ -53,13 +58,13 @@ def setEdit(self, vobj, mode=0):
self,
vobj,
mode,
_TaskPanelFemMeshGmsh
_TaskPanel
)

# overwrite unsetEdit, because the mesh should to be hided on task panel exit
# overwrite unsetEdit, hide mesh object on task panel exit
def unsetEdit(self, vobj, mode):
FreeCADGui.Control.closeDialog()
self.ViewObject.hide() # hide the mesh after edit is finished
self.ViewObject.hide()
return True

def doubleClicked(self, vobj):
Expand Down Expand Up @@ -222,9 +227,11 @@ def dropObject(self, selfvp, incoming_object):
FreeCAD.ActiveDocument.recompute()


class _TaskPanelFemMeshGmsh:
"""The TaskPanel for editing References property of
FemMeshGmsh objects and creation of new FEM mesh"""
class _TaskPanel:
"""
The TaskPanel for editing References property of
FemMeshGmsh objects and creation of new FEM mesh
"""

def __init__(self, obj):
self.mesh_obj = obj
Expand Down
2 changes: 2 additions & 0 deletions src/Mod/Fem/femguiobjects/_ViewProviderFemMeshGroup.py
@@ -1,6 +1,8 @@
# ***************************************************************************
# * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * 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 *
Expand Down
2 changes: 2 additions & 0 deletions src/Mod/Fem/femguiobjects/_ViewProviderFemMeshRegion.py
@@ -1,6 +1,8 @@
# ***************************************************************************
# * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * 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 *
Expand Down
2 changes: 2 additions & 0 deletions src/Mod/Fem/femguiobjects/_ViewProviderFemMeshResult.py
@@ -1,6 +1,8 @@
# ***************************************************************************
# * Copyright (c) 2017 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * 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 *
Expand Down
Expand Up @@ -2,6 +2,8 @@
# * Copyright (c) 2015 Qingfeng Xia <qingfeng.xia()eng.ox.ac.uk> *
# * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * 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 *
Expand Down Expand Up @@ -60,7 +62,7 @@ def setEdit(self, vobj, mode=0):
_TaskPanel,
)

# overwrite unsetEdit, because the mesh result obj needs to be hided on task panel exit
# overwrite unsetEdit, hide result mesh object on task panel exit
def unsetEdit(self, vobj, mode=0):
FreeCADGui.Control.closeDialog()
# hide the mesh after result viewing is finished, but do not reset the coloring
Expand Down

0 comments on commit 5620122

Please sign in to comment.