Fix trailing whitespace, typos, headers
Fix trailing whitespace, typos, and header uniformity.
This commit is contained in:
@@ -123,10 +123,10 @@ Requires: python3-matplotlib
|
||||
Requires: python3-pivy
|
||||
Requires: python3-pyside2
|
||||
Requires: qt5-assistant
|
||||
%if %{bundled_smesh}
|
||||
%if %{bundled_smesh}
|
||||
Provides: bundled(smesh) = %{bundled_smesh_version}
|
||||
%endif
|
||||
%if %{bundled_pycxx}
|
||||
%if %{bundled_pycxx}
|
||||
Provides: bundled(python-pycxx)
|
||||
%endif
|
||||
Recommends: python3-pysolar
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
|
||||
<PythonExport
|
||||
Father="PyObjectBase"
|
||||
Name="CoordinateSystemPy"
|
||||
Twin="CoordinateSystem"
|
||||
TwinPointer="CoordinateSystem"
|
||||
Include="Base/CoordinateSystem.h"
|
||||
FatherInclude="Base/PyObjectBase.h"
|
||||
Namespace="Base"
|
||||
<PythonExport
|
||||
Father="PyObjectBase"
|
||||
Name="CoordinateSystemPy"
|
||||
Twin="CoordinateSystem"
|
||||
TwinPointer="CoordinateSystem"
|
||||
Include="Base/CoordinateSystem.h"
|
||||
FatherInclude="Base/PyObjectBase.h"
|
||||
Namespace="Base"
|
||||
Constructor="true"
|
||||
Delete="true"
|
||||
Delete="true"
|
||||
FatherNamespace="Base">
|
||||
<Documentation>
|
||||
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
|
||||
|
||||
@@ -332,8 +332,8 @@ Quantity Quantity::MegaNewton (1e+9 ,Unit(1,1,-2));
|
||||
|
||||
Quantity Quantity::NewtonPerMeter (1.00 ,Unit(0,1,-2)); //Newton per meter (N/m or kg/s^2)
|
||||
Quantity Quantity::MilliNewtonPerMeter (1e-3 ,Unit(0,1,-2));
|
||||
Quantity Quantity::KiloNewtonPerMeter (1e3 ,Unit(0,1,-2));
|
||||
Quantity Quantity::MegaNewtonPerMeter (1e6 ,Unit(0,1,-2));
|
||||
Quantity Quantity::KiloNewtonPerMeter (1e3 ,Unit(0,1,-2));
|
||||
Quantity Quantity::MegaNewtonPerMeter (1e6 ,Unit(0,1,-2));
|
||||
|
||||
Quantity Quantity::Pascal (0.001 ,Unit(-1,1,-2)); // Pascal (kg/m/s^2 or N/m^2)
|
||||
Quantity Quantity::KiloPascal (1.00 ,Unit(-1,1,-2));
|
||||
|
||||
@@ -54,7 +54,7 @@ z : float
|
||||
w : float\n
|
||||
Rotation(dir1, dir2, dir3, seq)
|
||||
Define from three vectors that define rotated axes directions plus an optional
|
||||
3-characher string of capital letters 'X', 'Y', 'Z' that sets the order of
|
||||
3-characher string of capital letters 'X', 'Y', 'Z' that sets the order of
|
||||
importance of the axes (e.g., 'ZXY' means z direction is followed strictly,
|
||||
x is used but corrected if necessary, y is ignored).
|
||||
dir1 : Base.Vector
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# this directory is the entry point for namespace modules. Any package
|
||||
# installed to a directory "freecad" which is in sys.path can be imported
|
||||
# with "from freecad import package" and is checked for a init_gui.py
|
||||
# with "from freecad import package" and is checked for a init_gui.py
|
||||
# module, which is imported at startup. (FreeCADGuiInit.py)
|
||||
|
||||
add_subdirectory(freecad)
|
||||
@@ -1,4 +1,4 @@
|
||||
EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c
|
||||
EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c
|
||||
"from distutils.sysconfig import get_python_lib; print(get_python_lib(plat_specific=True))"
|
||||
OUTPUT_VARIABLE python_libs OUTPUT_STRIP_TRAILING_WHITESPACE )
|
||||
SET(PYTHON_MAIN_DIR ${python_libs})
|
||||
|
||||
@@ -11,7 +11,7 @@ class QUiLoader(QtUiTools.QUiLoader):
|
||||
def __init__(self, arg = None):
|
||||
super(QUiLoader, self).__init__(arg)
|
||||
self.ui = Gui.PySideUic
|
||||
|
||||
|
||||
def createWidget(self, className, parent = None, name = ""):
|
||||
widget = self.ui.createCustomWidget(className, parent, name)
|
||||
if not widget:
|
||||
|
||||
@@ -95,7 +95,7 @@ using namespace Gui;
|
||||
* Q_INIT_RESOURCE(resource);
|
||||
*
|
||||
* \endcode
|
||||
*
|
||||
*
|
||||
* where \a resource is the name of the .qrc file. That's all!
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<RCC>
|
||||
<qresource prefix="/translations">
|
||||
<qresource prefix="/translations">
|
||||
<file>qt_de.qm</file>
|
||||
<file>qt_es-ES.qm</file>
|
||||
<file>qt_fr.qm</file>
|
||||
@@ -65,6 +65,6 @@
|
||||
<file>FreeCAD_ka.qm</file>
|
||||
<file>FreeCAD_sr-CS.qm</file>
|
||||
<file>FreeCAD_be.qm</file>
|
||||
|
||||
|
||||
</qresource>
|
||||
</RCC>
|
||||
</RCC>
|
||||
|
||||
@@ -170,7 +170,7 @@ public:
|
||||
if(it == funcs.end())
|
||||
return;
|
||||
it->second(this);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ class TestUpdateAllGui(unittest.TestCase):
|
||||
sleep(0.01)
|
||||
self.limit_reached = True
|
||||
worker = Worker()
|
||||
self.factory.work_function = worker.run
|
||||
self.factory.work_function = worker.run
|
||||
self.test_object.run()
|
||||
cancel_timer = QtCore.QTimer()
|
||||
cancel_timer.timeout.connect(
|
||||
|
||||
@@ -88,13 +88,13 @@ class AddonInstallerGUI(QtCore.QObject):
|
||||
|
||||
# Dependency check
|
||||
deps = MissingDependencies(self.addon_to_install, self.addons)
|
||||
|
||||
|
||||
# Python interpreter version check
|
||||
stop_installation = self._check_python_version(deps)
|
||||
if stop_installation:
|
||||
self.finished.emit()
|
||||
return
|
||||
|
||||
|
||||
# Required Python
|
||||
if hasattr(deps, "python_requires") and deps.python_requires:
|
||||
# Disallowed packages:
|
||||
@@ -107,7 +107,7 @@ class AddonInstallerGUI(QtCore.QObject):
|
||||
# Remove any disallowed packages from the optional list
|
||||
if hasattr(deps, "python_optional") and deps.python_optional:
|
||||
self._clean_up_optional(deps)
|
||||
|
||||
|
||||
# Missing FreeCAD workbenches
|
||||
if hasattr(deps, "wbs") and deps.wbs:
|
||||
stop_installation = self._report_missing_workbenches(deps.wbs)
|
||||
@@ -529,7 +529,7 @@ class MacroInstallerGUI(QtCore.QObject):
|
||||
"User parameter:BaseApp/Workbench/Global/Toolbar"
|
||||
)
|
||||
self.macro_dir = FreeCAD.getUserMacroDir(True)
|
||||
|
||||
|
||||
def __del__(self):
|
||||
if self.worker_thread and hasattr(self.worker_thread, "quit"):
|
||||
self.worker_thread.quit()
|
||||
|
||||
@@ -1201,7 +1201,7 @@ def insert(srcfile, docname, skip=[], only=[], root=None, preferences=None):
|
||||
"DiffuseColor" not in added_mat.Material
|
||||
and "DiffuseColor" not in mdict
|
||||
) # there is no color in added mat with the same matname and new mat
|
||||
# on modell imported from ArchiCAD color was not found for all IFC material objects,
|
||||
# on model imported from ArchiCAD color was not found for all IFC material objects,
|
||||
# thus DiffuseColor was not set for created materials, workaround to merge these too
|
||||
):
|
||||
matobj = added_mat
|
||||
|
||||
@@ -177,4 +177,4 @@
|
||||
<file>ui/ResultShow.ui</file>
|
||||
<file>ui/SolverCalculix.ui</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
</RCC>
|
||||
|
||||
@@ -131,7 +131,7 @@ void ViewProviderFemPostPipeline::onSelectionChanged(const Gui::SelectionChanges
|
||||
|
||||
void ViewProviderFemPostPipeline::updateColorBars()
|
||||
{
|
||||
|
||||
|
||||
// take all visible childs and update its shape coloring
|
||||
auto children = claimChildren();
|
||||
for (auto& child : children) {
|
||||
@@ -155,7 +155,7 @@ void ViewProviderFemPostPipeline::transformField(char *FieldName, double FieldFa
|
||||
vtkSmartPointer<vtkDataObject> data = obj->Data.getValue();
|
||||
if (!data || !data->IsA("vtkDataSet"))
|
||||
return;
|
||||
|
||||
|
||||
vtkDataSet *dset = vtkDataSet::SafeDownCast(data);
|
||||
vtkDataArray *pdata = dset->GetPointData()->GetArray(FieldName);
|
||||
if (!pdata)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#***************************************************************************
|
||||
#* (c) Milos Koutny (milos.koutny@gmail.com) 2012 *
|
||||
#* Copyright (c) 2012 Milos Koutny <milos.koutny@gmail.com> *
|
||||
#* *
|
||||
#* This file is part of the FreeCAD CAx development system. *
|
||||
#* *
|
||||
@@ -19,7 +19,6 @@
|
||||
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
#* USA *
|
||||
#* *
|
||||
#* Milos Koutny 2010 *
|
||||
#***************************************************************************/
|
||||
|
||||
import FreeCAD, Part, os, FreeCADGui
|
||||
@@ -50,7 +49,7 @@ EmpDisplayMode=2 # 0='Flat Lines', 1='Shaded', 2='Wireframe', 3='Points'; recomm
|
||||
|
||||
IDF_sort=0 # 0-sort per refdes [1 - part number (not preferred)/refdes] 2-sort per footprint/refdes
|
||||
|
||||
IDF_diag=0 # 0/1=disabled/enabled output (footprint.lst/missing_models.lst)
|
||||
IDF_diag=0 # 0/1=disabled/enabled output (footprint.lst/missing_models.lst)
|
||||
IDF_diag_path="/tmp" # path for output of footprint.lst and missing_models.lst
|
||||
|
||||
|
||||
@@ -72,7 +71,7 @@ def insert(filename,docname):
|
||||
doc=FreeCAD.getDocument(docname)
|
||||
FreeCAD.Console.PrintMessage('Started import of "'+filename+'" file')
|
||||
process_emn(doc,filename)
|
||||
|
||||
|
||||
def process_emn(doc,filename):
|
||||
"""process_emn(document, filename)-> adds emn geometry from emn file"""
|
||||
emnfile=pythonopen(filename, "r")
|
||||
@@ -84,7 +83,7 @@ def process_emn(doc,filename):
|
||||
placement=[] #no placement
|
||||
place_item=[] #empty place item
|
||||
emnlines=emnfile.readlines()
|
||||
emnfile.close()
|
||||
emnfile.close()
|
||||
passed_sections=[]
|
||||
current_section=""
|
||||
section_counter=0
|
||||
@@ -142,10 +141,10 @@ def Process_board_outline(doc,board_outline,drills,board_thickness):
|
||||
out_shape=[]
|
||||
out_face=[]
|
||||
for point in board_outline:
|
||||
vertex=Base.Vector(point[1],point[2],0)
|
||||
vertex=Base.Vector(point[1],point[2],0)
|
||||
vertex_index+=1
|
||||
if vertex_index==0:
|
||||
lines=point[0]
|
||||
lines=point[0]
|
||||
elif lines==point[0]:
|
||||
if point[3]!=0 and point[3]!=360:
|
||||
out_shape.append(Part.Arc(prev_vertex,mid_point(prev_vertex,vertex,point[3]),vertex))
|
||||
@@ -161,8 +160,8 @@ def Process_board_outline(doc,board_outline,drills,board_thickness):
|
||||
out_shape=Part.Wire(out_shape.Edges)
|
||||
out_face.append(Part.Face(out_shape))
|
||||
out_shape=[]
|
||||
vertex_index=0
|
||||
lines=point[0]
|
||||
vertex_index=0
|
||||
lines=point[0]
|
||||
prev_vertex=vertex
|
||||
if lines!=-1:
|
||||
out_shape=Part.Shape(out_shape)
|
||||
@@ -180,7 +179,7 @@ def Process_board_outline(doc,board_outline,drills,board_thickness):
|
||||
out_shape=Part.Wire(out_shape.Edges)
|
||||
outline=outline.cut(Part.Face(out_shape))
|
||||
doc_outline=doc.addObject("Part::Feature","Board_outline")
|
||||
doc_outline.Shape=outline
|
||||
doc_outline.Shape=outline
|
||||
#FreeCADGui.Selection.addSelection(doc_outline)
|
||||
#FreeCADGui.runCommand("Draft_Upgrade")
|
||||
#outline=FreeCAD.ActiveDocument.getObject("Union").Shape
|
||||
@@ -194,7 +193,7 @@ def Process_board_outline(doc,board_outline,drills,board_thickness):
|
||||
|
||||
def mid_point(prev_vertex,vertex,angle):
|
||||
"""mid_point(prev_vertex,vertex,angle)-> mid_vertex
|
||||
|
||||
|
||||
returns mid point on arc of angle between prev_vertex and vertex"""
|
||||
angle=radians(angle/2)
|
||||
basic_angle=atan2(vertex.y-prev_vertex.y,vertex.x-prev_vertex.x)-pi/2
|
||||
@@ -204,7 +203,7 @@ def mid_point(prev_vertex,vertex,angle):
|
||||
|
||||
def split_records(line_record):
|
||||
"""split_records(line_record)-> list of strings(records)
|
||||
|
||||
|
||||
standard separator list separator is space, records containing encapsulated by " """
|
||||
split_result=[]
|
||||
quote_pos=line_record.find('"')
|
||||
@@ -213,18 +212,18 @@ def split_records(line_record):
|
||||
split_result.extend(line_record[ :quote_pos].split())
|
||||
line_record=line_record[quote_pos: ]
|
||||
quote_pos=line_record.find('"',1)
|
||||
else:
|
||||
else:
|
||||
quote_pos=line_record.find('"',1)
|
||||
if quote_pos!=-1:
|
||||
split_result.append(line_record[ :quote_pos+1])
|
||||
line_record=line_record[quote_pos+1: ]
|
||||
else:
|
||||
split_result.append(line_record)
|
||||
split_result.append(line_record)
|
||||
line_record=""
|
||||
quote_pos=line_record.find('"')
|
||||
split_result.extend(line_record.split())
|
||||
return split_result
|
||||
|
||||
|
||||
def process_emp(doc,filename,placement,board_thickness):
|
||||
"""process_emp(doc,filename,placement,board_thickness) -> place components from emn file to board"""
|
||||
filename=filename.partition(".emn")[0]+".emp"
|
||||
@@ -237,7 +236,7 @@ def process_emp(doc,filename,placement,board_thickness):
|
||||
comp_PartNumber="" # no Part Number
|
||||
comp_height=0 # no Comp Height
|
||||
emplines=empfile.readlines()
|
||||
empfile.close()
|
||||
empfile.close()
|
||||
passed_sections=[]
|
||||
current_section=""
|
||||
section_counter=0
|
||||
@@ -250,7 +249,7 @@ def process_emp(doc,filename,placement,board_thickness):
|
||||
current_section=""
|
||||
if comp_PartNumber!="":
|
||||
if comp_height==0:
|
||||
comp_height=0.1
|
||||
comp_height=0.1
|
||||
comps.append((comp_PartNumber,[Process_comp_outline(doc,comp_outline,comp_height),comp_GeometryName]))
|
||||
comp_PartNumber=""
|
||||
comp_outline=[]
|
||||
@@ -279,7 +278,7 @@ def process_emp(doc,filename,placement,board_thickness):
|
||||
for compx in comps:
|
||||
empfile.writelines(str(compx[1][1])+"\n")
|
||||
empfile.close()
|
||||
#End section of list footprint
|
||||
#End section of list footprint
|
||||
comps=dict(comps)
|
||||
grp=doc.addObject("App::DocumentObjectGroup", "EMP Models")
|
||||
for place_item in placement:
|
||||
@@ -307,7 +306,7 @@ def Process_comp_outline(doc,comp_outline,comp_height):
|
||||
comp_outline.append([0.0,0.0,0.0])
|
||||
comp_outline.append([0.1,0.0,360.0])
|
||||
for point in comp_outline:
|
||||
vertex=Base.Vector(point[0],point[1],0)
|
||||
vertex=Base.Vector(point[0],point[1],0)
|
||||
vertex_index+=1
|
||||
if vertex_index>0:
|
||||
if point[2]!=0 and point[2]!=360:
|
||||
@@ -328,13 +327,13 @@ def Process_comp_outline(doc,comp_outline,comp_height):
|
||||
return out_shape
|
||||
|
||||
def place_steps(doc,placement,board_thickness):
|
||||
""" place_steps(doc,placement,board_thickness)->place step models on board
|
||||
""" place_steps(doc,placement,board_thickness)->place step models on board
|
||||
|
||||
list of models and path to step files is set at start of this script
|
||||
model_tab_filename= "" & step_path="" """
|
||||
model_file=pythonopen(model_tab_filename, "r")
|
||||
model_lines=model_file.readlines()
|
||||
model_file.close()
|
||||
model_file.close()
|
||||
model_dict=[]
|
||||
if IDF_diag==1:
|
||||
model_file=pythonopen(IDF_diag_path+"/missing_models.lst", "w")
|
||||
@@ -342,9 +341,9 @@ def place_steps(doc,placement,board_thickness):
|
||||
#prev_step="*?.*?" #hope nobody will insert this step filename
|
||||
step_dict=[]
|
||||
for model_line in model_lines:
|
||||
model_records=split_records(model_line)
|
||||
model_records=split_records(model_line)
|
||||
if len(model_records)>1 and model_records[0] and not model_records[0] in keys:
|
||||
keys.append(model_records[0])
|
||||
keys.append(model_records[0])
|
||||
model_dict.append((str(model_records[0]).replace('"',''),str(model_records[1]).replace('"','')))
|
||||
model_dict=dict(model_dict)
|
||||
validkeys=filter(lambda x:x in [place_item[2] for place_item in placement], model_dict.keys())
|
||||
@@ -380,11 +379,11 @@ def place_steps(doc,placement,board_thickness):
|
||||
placmnt=Base.Placement(Base.Vector(place_item[3],place_item[4],z_pos),toQuaternion(rotateY,place_item[5]*pi/180,0))
|
||||
step_model.Placement=placmnt
|
||||
grp.addObject(step_model)
|
||||
else:
|
||||
else:
|
||||
if IDF_diag==1:
|
||||
model_file.writelines(str(place_item[0])+" "+str(place_item[2])+"\n")
|
||||
model_file.close()
|
||||
|
||||
model_file.close()
|
||||
|
||||
def toQuaternion(heading, attitude,bank): # rotation heading=around Y, attitude =around Z, bank attitude =around X
|
||||
"""toQuaternion(heading, attitude,bank)->FreeCAD.Base.Rotation(Quternion)"""
|
||||
c1 = cos(heading/2)
|
||||
@@ -399,7 +398,7 @@ def toQuaternion(heading, attitude,bank): # rotation heading=around Y, attitude
|
||||
x = c1c2*s3 + s1s2*c3
|
||||
y = s1*c2*c3 + c1*s2*s3
|
||||
z = c1*s2*c3 - s1*c2*s3
|
||||
return FreeCAD.Base.Rotation(x,y,z,w)
|
||||
return FreeCAD.Base.Rotation(x,y,z,w)
|
||||
|
||||
def Per_point(prev_vertex,vertex):
|
||||
"""Per_point(center,vertex)->per point
|
||||
@@ -411,4 +410,4 @@ def Per_point(prev_vertex,vertex):
|
||||
perpoint=Base.Vector(2*prev_vertex.x-vertex.x,2*prev_vertex.y-vertex.y,0)
|
||||
return perpoint
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<RCC>
|
||||
<qresource>
|
||||
<qresource>
|
||||
<file>icons/Image_Open.svg</file>
|
||||
<file>icons/Image_CreateImagePlane.svg</file>
|
||||
<file>icons/Image_Scaling.svg</file>
|
||||
@@ -47,4 +47,4 @@
|
||||
<file>translations/Image_sr-CS.qm</file>
|
||||
<file>translations/Image_be.qm</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
</RCC>
|
||||
|
||||
@@ -55,7 +55,7 @@ void TestJtReader::read(void)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Base::Console().Log(i->toString().c_str());
|
||||
}
|
||||
|
||||
@@ -9,4 +9,4 @@ INSTALL(
|
||||
Init.py
|
||||
DESTINATION
|
||||
Mod/JtReader
|
||||
)
|
||||
)
|
||||
|
||||
@@ -157,7 +157,7 @@ ADD_CUSTOM_TARGET(Material ALL
|
||||
SOURCES ${Material_SRCS} ${Material_QRC_SRCS}
|
||||
)
|
||||
|
||||
fc_target_copy_resource(Material
|
||||
fc_target_copy_resource(Material
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_BINARY_DIR}/Mod/Material
|
||||
${Material_SRCS})
|
||||
@@ -167,7 +167,7 @@ ADD_CUSTOM_TARGET(MaterialToolsLib ALL
|
||||
SOURCES ${MaterialTools_Files}
|
||||
)
|
||||
|
||||
fc_target_copy_resource(MaterialToolsLib
|
||||
fc_target_copy_resource(MaterialToolsLib
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_BINARY_DIR}/Mod/Material
|
||||
${MaterialTools_Files})
|
||||
@@ -191,11 +191,11 @@ ADD_CUSTOM_TARGET(FluidMaterialLib ALL
|
||||
|
||||
# When a target copies files to different output directories then apparently it always builds the project
|
||||
# which is very annoying. So, the trick is to split this into two targets to avoid this behaviour.
|
||||
fc_target_copy_resource(MaterialLib
|
||||
fc_target_copy_resource(MaterialLib
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/Material
|
||||
${MaterialLib_Files})
|
||||
fc_target_copy_resource(FluidMaterialLib
|
||||
fc_target_copy_resource(FluidMaterialLib
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/Material
|
||||
${FluidMaterial_Files})
|
||||
|
||||
@@ -4,33 +4,28 @@
|
||||
|
||||
## User defined material
|
||||
|
||||
To prevent the database from becoming inefficiently large it is only limited to commonly used variables at 20 degrees Celsius at 1 atm.
|
||||
To prevent the database from becoming inefficiently large it is only limited to commonly used variables at 20 degrees Celsius at 1 atm.
|
||||
|
||||
Users can defined new material, either in Fem material card editor, or directly generate textual material file, * .FCMat, see example in this folder.
|
||||
Users can defined new material, either in Fem material card editor, or directly generate textual material file, * .FCMat, see example in this folder.
|
||||
|
||||
To enable new material, go to FreeCAD menu "Edit->Preference..." Cfd preference page (select on the left panel) and switch to materiai tab on the right.
|
||||
To enable new material, go to FreeCAD menu "Edit->Preference..." Cfd preference page (select on the left panel) and switch to materiai tab on the right.
|
||||
|
||||
Browse to your material folder, and save/apply this preference, new material will be Material with same name as FreeCAD material has higher priority,
|
||||
|
||||
so user defined` Water` material will not appear in Fem material task panel's dropbox list, just give it a different name!
|
||||
Browse to your material folder, and save/apply this preference, new material will be Material with same name as FreeCAD material has higher priority, so user defined `Water` material will not appear in Fem material task panel's dropbox list, just give it a different name!
|
||||
|
||||
### Edit material value
|
||||
|
||||
Please verify the fluid material properties before use. It aims to serve as a quick reference and does not aim to be an extended look up table.
|
||||
|
||||
|
||||
|
||||
## Add new material to Material module
|
||||
|
||||
1. follow examples in material folders to create new material file
|
||||
2. stick to the meta data definition in `src/Mod/Material/Templatematerial.yml` for property name
|
||||
3. add the file name into the `src/Mod/Material/CMakeLists.txt` , so the new files can be installed to the properly place during compiling and installation.
|
||||
3. add the file name into the `src/Mod/Material/CMakeLists.txt` , so the new files can be installed to the properly place during compiling and installation.
|
||||
|
||||
## Change log
|
||||
## Changelog
|
||||
|
||||
CfdOF module authored 5 material types, values are taken from FM White (2011) Fluid Mechanics.
|
||||
CfdOF module authored 5 material types, values are taken from FM White (2011) Fluid Mechanics.
|
||||
|
||||
|
||||
|
||||
Currently, 3 (Water, Air, None) are merged into Fem module and maintained by Cfd module author, Qingfeng Xia
|
||||
Currently, 3 (Water, Air, None) are merged into Fem module and maintained by Cfd module author, Qingfeng Xia
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<RCC>
|
||||
<qresource>
|
||||
<qresource>
|
||||
<file>icons/preview-rendered.svg</file>
|
||||
<file>icons/preview-vector.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
</RCC>
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
Type: 'Quantity'
|
||||
URL: 'https://en.wikipedia.org/wiki/Compressive_strength'
|
||||
Description: "Compressive strength in [FreeCAD Pressure unit]"
|
||||
Density:
|
||||
Density:
|
||||
Type: 'Quantity'
|
||||
URL: 'https://en.wikipedia.org/wiki/Density'
|
||||
Description: "Density in [FreeCAD Density unit]"
|
||||
|
||||
@@ -128,7 +128,7 @@ MeasureType Measurement::getType()
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
std::stringstream errorMsg;
|
||||
|
||||
|
||||
errorMsg << "Measurement - getType - " << e.GetMessageString() << std::endl;
|
||||
throw Base::CADKernelError(e.GetMessageString());
|
||||
}
|
||||
|
||||
@@ -88,4 +88,4 @@
|
||||
<file>translations/Mesh_sr-CS.qm</file>
|
||||
<file>translations/Mesh_be.qm</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
</RCC>
|
||||
|
||||
@@ -154,13 +154,13 @@ class TestImportCSG(unittest.TestCase):
|
||||
self.assertTrue (wire is not None)
|
||||
self.assertAlmostEqual (wire.Shape.Area, 5000.0)
|
||||
FreeCAD.closeDocument(doc.Name)
|
||||
|
||||
|
||||
def test_import_polyhedron(self):
|
||||
doc = self.utility_create_scad(
|
||||
"""
|
||||
polyhedron(
|
||||
points=[ [10,10,0],[10,-10,0],[-10,-10,0],[-10,10,0], // the four points at base
|
||||
[0,0,10] ], // the apex point
|
||||
[0,0,10] ], // the apex point
|
||||
faces=[ [0,1,4],[1,2,4],[2,3,4],[3,0,4], // each triangle side
|
||||
[1,0,3],[2,1,3] ] // two triangles for square base
|
||||
);
|
||||
@@ -229,7 +229,7 @@ polyhedron(
|
||||
self.assertTrue (object is not None)
|
||||
self.assertAlmostEqual (object.Shape.Volume, 4.5*math.pi, 5)
|
||||
FreeCAD.closeDocument(doc.Name)
|
||||
|
||||
|
||||
def test_import_linear_extrude(self):
|
||||
doc = self.utility_create_scad("linear_extrude(height = 20) square([20, 10], center = true);", "linear_extrude_simple")
|
||||
object = doc.ActiveObject
|
||||
@@ -291,13 +291,13 @@ polyhedron(
|
||||
self.assertTrue (object is not None)
|
||||
self.assertAlmostEqual (object.Shape.Volume, 8.000000, 6)
|
||||
FreeCAD.closeDocument(doc.Name)
|
||||
|
||||
|
||||
doc = self.utility_create_scad("resize([2,2,0]) cube();", "resize_with_zero")
|
||||
object = doc.ActiveObject
|
||||
self.assertTrue (object is not None)
|
||||
self.assertAlmostEqual (object.Shape.Volume, 4.000000, 6)
|
||||
FreeCAD.closeDocument(doc.Name)
|
||||
|
||||
|
||||
doc = self.utility_create_scad("resize([2,0,0], auto=true) cube();", "resize_with_auto")
|
||||
object = doc.ActiveObject
|
||||
self.assertTrue (object is not None)
|
||||
@@ -349,7 +349,7 @@ resize(newsize = [0,0,10], auto = [0,0,0]) {
|
||||
self.assertAlmostEqual (object.Shape.BoundBox.YMin, -4.5, 6)
|
||||
self.assertAlmostEqual (object.Shape.BoundBox.YMax, 4.5, 6)
|
||||
FreeCAD.closeDocument(doc.Name)
|
||||
|
||||
|
||||
testfile = join(self.test_dir, "Surface.dat").replace('\\','/')
|
||||
doc = self.utility_create_scad(f"surface(file = \"{testfile}\", convexity = 5);", "surface_uncentered_dat")
|
||||
object = doc.ActiveObject
|
||||
@@ -390,7 +390,7 @@ resize(newsize = [0,0,10], auto = [0,0,0]) {
|
||||
self.assertAlmostEqual (object.Shape.Area, 0.75*0.75 - 0.25*0.25, 3)
|
||||
FreeCAD.closeDocument(doc.Name)
|
||||
|
||||
# Unimplemented functionality:
|
||||
# Unimplemented functionality:
|
||||
|
||||
# With cut=false, the twisted unit square projects to a circle of radius sqrt(0.5)
|
||||
#doc = self.utility_create_scad(f"projection(cut=false) {base_shape}", "projection_circle")
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# * This file has been modified from Sliptonic original LinuxCNC post *
|
||||
# * This file has been modified from Sliptonic original LinuxCNC post *
|
||||
# * for use with Dynapath Delta 40M,50M,60M controllers. All changes *
|
||||
# * and modifications (c) luvtofish (luvtofish@gmail.com) 2022 *
|
||||
# ***************************************************************************
|
||||
@@ -39,8 +39,8 @@ This is a post processor file for the FreeCAD Path workbench. It is used to
|
||||
take a pseudo-gcode fragment outputted by a Path object, and output
|
||||
real GCode suitable for Dynapath Delta 40,50, & 60 Controls. It has been written
|
||||
and tested on FreeCAD Path workbench bundled with FreeCAD v21.
|
||||
This post processor, once placed in the appropriate PathScripts folder, can be
|
||||
used directly from inside FreeCAD, via the GUI importer or via python scripts with:
|
||||
This post processor, once placed in the appropriate PathScripts folder, can be
|
||||
used directly from inside FreeCAD, via the GUI importer or via python scripts with:
|
||||
|
||||
import delta_4060_post
|
||||
delta_4060_post.export(object,"/path/to/file.ncc","")
|
||||
|
||||
@@ -189,7 +189,7 @@ SceneEventFilter::~SceneEventFilter()
|
||||
/*!
|
||||
Adds a device for event translation
|
||||
*/
|
||||
void
|
||||
void
|
||||
SceneEventFilter::registerInputDevice(SIM::Coin3D::Quarter::InputDevice * device)
|
||||
{
|
||||
PRIVATE(this)->devices += device;
|
||||
@@ -198,7 +198,7 @@ SceneEventFilter::registerInputDevice(SIM::Coin3D::Quarter::InputDevice * device
|
||||
/*!
|
||||
Removes a device from event translation
|
||||
*/
|
||||
void
|
||||
void
|
||||
SceneEventFilter::unregisterInputDevice(SIM::Coin3D::Quarter::InputDevice * device)
|
||||
{
|
||||
int i = PRIVATE(this)->devices.indexOf(device);
|
||||
|
||||
@@ -112,7 +112,7 @@ public:
|
||||
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glColor4d(0.0,0.0,1.0,0.0f);
|
||||
glRasterPos2d(0,0);
|
||||
|
||||
|
||||
//http://wiki.delphigl.com/index.php/Multisampling
|
||||
//glDrawPixels(img.width(),img.height(),GL_RGBA,GL_UNSIGNED_BYTE,img.bits());
|
||||
/*
|
||||
|
||||
@@ -4577,7 +4577,7 @@ void System::identifyConflictingRedundantConstraints( Algorithm alg,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (conflictingMap.empty())
|
||||
break;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<file>icons/actions/section-down.svg</file>
|
||||
<file>icons/actions/section-left.svg</file>
|
||||
<file>icons/actions/section-right.svg</file>
|
||||
<file>icons/actions/section-up.svg</file>
|
||||
<file>icons/actions/section-up.svg</file>
|
||||
<file>icons/actions/TechDraw_2LineCenterline.svg</file>
|
||||
<file>icons/actions/TechDraw_2PointCenterline.svg</file>
|
||||
<file>icons/actions/TechDraw_ActiveView.svg</file>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
|
||||
|
||||
fc_copy_to_mod_path("TemplatePyMod"
|
||||
InitGui.py
|
||||
Init.py
|
||||
Commands.py
|
||||
PythonQt.py
|
||||
Tests.py
|
||||
DocumentObject.py
|
||||
fc_copy_to_mod_path("TemplatePyMod"
|
||||
InitGui.py
|
||||
Init.py
|
||||
Commands.py
|
||||
PythonQt.py
|
||||
Tests.py
|
||||
DocumentObject.py
|
||||
)
|
||||
|
||||
INSTALL(
|
||||
|
||||
@@ -68,7 +68,7 @@ def makeMengerSponge_mt(level=3,x0=0,y0=0,z0=0):
|
||||
boxnums = pow(3,level)
|
||||
thirds = boxnums / 3
|
||||
twothirds = thirds * 2
|
||||
|
||||
|
||||
rangerx = [ x0, x0 + thirds, x0 + twothirds ]
|
||||
rangery = [ y0, y0 + thirds, y0 + twothirds ]
|
||||
rangerz = [ z0, z0 + thirds, z0 + twothirds ]
|
||||
@@ -104,7 +104,7 @@ def makeMengerSponge_mt(level=3,x0=0,y0=0,z0=0):
|
||||
for thr in threads:
|
||||
mesh.addMesh(thr.mesh)
|
||||
del thr.mesh
|
||||
|
||||
|
||||
print(mesh)
|
||||
mesh.removeDuplicatedPoints()
|
||||
mesh.removeFacets(mesh.getInternalFacets())
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# FreeCAD TemplatePyMod module
|
||||
# FreeCAD TemplatePyMod module
|
||||
# (c) 2010 Werner Mayer LGPL
|
||||
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ fc_copy_sources(Test "${CMAKE_BINARY_DIR}/Mod/Test" ${Test_SRCS} ${TestData_SRCS
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
${Test_SRCS}
|
||||
${Test_SRCS}
|
||||
DESTINATION
|
||||
Mod/Test
|
||||
)
|
||||
|
||||
@@ -94,7 +94,7 @@ void FcCookieJar::saveToDisk()
|
||||
|
||||
if (m_file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
QTextStream out(&m_file);
|
||||
for (QList<QByteArray>::iterator i = m_rawCookies.begin(); i != m_rawCookies.end(); i++) {
|
||||
for (QList<QByteArray>::iterator i = m_rawCookies.begin(); i != m_rawCookies.end(); i++) {
|
||||
out << (*i) + "\n";
|
||||
}
|
||||
m_file.close();
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
in a mix of C++ and Python.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/** \defgroup CWORKBENCHES C++ workbenches
|
||||
* \ingroup WORKBENCHES
|
||||
* \brief These workbenches are programmed primarily in C++, but most provide a Python API as well.
|
||||
|
||||
@@ -19,7 +19,7 @@ def cpfile(pathFrom, pathTo, maxfileload=maxfileload):
|
||||
#bytesFrom.close()
|
||||
else:
|
||||
fileFrom = open(pathFrom, 'rb') # read big files in chunks
|
||||
fileTo = open(pathTo, 'wb') # need b mode here too
|
||||
fileTo = open(pathTo, 'wb') # need b mode here too
|
||||
while 1:
|
||||
bytesFrom = fileFrom.read(blksize) # get one block, less at end
|
||||
if not bytesFrom: break # empty after last chunk
|
||||
@@ -97,11 +97,11 @@ def cpallWithFilter(dirFrom, dirTo,MatchList):
|
||||
|
||||
################################################################
|
||||
# Use: "python rmall.py directoryPath directoryPath..."
|
||||
# recursive directory tree deletion: removes all files and
|
||||
# recursive directory tree deletion: removes all files and
|
||||
# directories at and below directoryPaths; recurs into subdirs
|
||||
# and removes parent dir last, because os.rmdir requires that
|
||||
# directory is empty; like a Unix "rm -rf directoryPath"
|
||||
################################################################
|
||||
# and removes parent dir last, because os.rmdir requires that
|
||||
# directory is empty; like a Unix "rm -rf directoryPath"
|
||||
################################################################
|
||||
|
||||
fcount = dcount = 0
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ QT5_WRAP_CPP(RegExp_MOC_SRCS
|
||||
regexpdialog.h
|
||||
)
|
||||
|
||||
QT5_WRAP_UI(RegExp_UIC_HDRS
|
||||
QT5_WRAP_UI(RegExp_UIC_HDRS
|
||||
regexpdialog.ui
|
||||
)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ def main():
|
||||
|
||||
input=""
|
||||
output="."
|
||||
|
||||
|
||||
try:
|
||||
opts, args = getopt.getopt(sys.argv[1:], "dso:", ["dir=","src=","out="])
|
||||
except getopt.GetoptError:
|
||||
@@ -25,7 +25,7 @@ def main():
|
||||
if o in ("-o", "--out"):
|
||||
output = a
|
||||
git = SubWCRev.GitControl()
|
||||
|
||||
|
||||
if(git.extractInfo(input, "")):
|
||||
print(git.hash)
|
||||
print(git.branch)
|
||||
@@ -34,7 +34,7 @@ def main():
|
||||
print(git.url)
|
||||
print(input)
|
||||
print(output)
|
||||
|
||||
|
||||
f = open(input,'r')
|
||||
o = open(output,'w')
|
||||
for line in f.readlines():
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource>
|
||||
<qresource>
|
||||
<file>icons/_TEMPLATEPY_Workbench.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
</RCC>
|
||||
|
||||
@@ -35,5 +35,5 @@ target_link_libraries(_TEMPLATE_Gui ${_TEMPLATE_Gui_LIBS})
|
||||
|
||||
SET_BIN_DIR(_TEMPLATE_Gui _TEMPLATE_Gui /Mod/_TEMPLATE_)
|
||||
SET_PYTHON_PREFIX_SUFFIX(_TEMPLATE_Gui)
|
||||
|
||||
|
||||
install(TARGETS _TEMPLATE_Gui DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
|
||||
@@ -25,11 +25,11 @@ def main():
|
||||
# if os.path.getmtime(f) > ts:
|
||||
# do_not_create = False
|
||||
# break
|
||||
#
|
||||
#
|
||||
# if do_not_create:
|
||||
# print ("Up-to-date file {0}".format(outputfile))
|
||||
# return
|
||||
|
||||
|
||||
with open(outputfile,'wb') as wfd:
|
||||
for f in args:
|
||||
with open(f,'rb') as fd:
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
# FreeCAD MakeNewBuildNbr script
|
||||
# (c) 2003 Werner Mayer
|
||||
#
|
||||
# Creates a new application
|
||||
|
||||
#***************************************************************************
|
||||
#* (c) Werner Mayer (werner.wm.mayer@gmx.de) 2003 *
|
||||
#* Copyright (c) 2003 Werner Mayer <werner.wm.mayer@gmx.de> *
|
||||
#* *
|
||||
#* This file is part of the FreeCAD CAx development system. *
|
||||
#* *
|
||||
@@ -24,9 +19,11 @@
|
||||
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
#* USA *
|
||||
#* *
|
||||
#* Werner Mayer 2003 *
|
||||
#***************************************************************************
|
||||
|
||||
# FreeCAD MakeNewBuildNbr script
|
||||
# Creates a new application
|
||||
|
||||
import os,sys
|
||||
import MakeAppTools
|
||||
import re
|
||||
@@ -72,47 +69,47 @@ def SetupFilter(MatchList):
|
||||
|
||||
|
||||
def createApp(Application):
|
||||
"""
|
||||
Create a new application by copying the template
|
||||
"""
|
||||
# create directory ../Mod/<Application>
|
||||
if not os.path.isdir("../Mod/"+Application):
|
||||
os.mkdir("../Mod/"+Application)
|
||||
else:
|
||||
sys.stdout.write(Application + " already exists. Please enter another name.\n")
|
||||
sys.exit()
|
||||
"""
|
||||
Create a new application by copying the template
|
||||
"""
|
||||
# create directory ../Mod/<Application>
|
||||
if not os.path.isdir("../Mod/"+Application):
|
||||
os.mkdir("../Mod/"+Application)
|
||||
else:
|
||||
sys.stdout.write(Application + " already exists. Please enter another name.\n")
|
||||
sys.exit()
|
||||
|
||||
|
||||
# copying files from _TEMPLATEPY_ to ../Mod/<Application>
|
||||
sys.stdout.write("Copying files...")
|
||||
MakeAppTools.copyTemplate("_TEMPLATEPY_","../Mod/"+Application,"_TEMPLATEPY_", Application, SetupFilter(FilFilter),SetupFilter(DirFilter))
|
||||
sys.stdout.write("Ok\n")
|
||||
# copying files from _TEMPLATEPY_ to ../Mod/<Application>
|
||||
sys.stdout.write("Copying files...")
|
||||
MakeAppTools.copyTemplate("_TEMPLATEPY_","../Mod/"+Application,"_TEMPLATEPY_", Application, SetupFilter(FilFilter),SetupFilter(DirFilter))
|
||||
sys.stdout.write("Ok\n")
|
||||
|
||||
# replace the _TEMPLATEPY_ string by <Application>
|
||||
sys.stdout.write("Modifying files...\n")
|
||||
MakeAppTools.replaceTemplate("../Mod/" + Application,"_TEMPLATEPY_",Application)
|
||||
MakeAppTools.replaceTemplate("../Mod/" + Application,"${CMAKE_SOURCE_DIR}/src/Tools/","${CMAKE_SOURCE_DIR}/src/Mod/")
|
||||
# make the configure script executable
|
||||
#os.chmod("../Mod/" + Application + "/configure", 0777);
|
||||
sys.stdout.write("Modifying files done.\n")
|
||||
# replace the _TEMPLATEPY_ string by <Application>
|
||||
sys.stdout.write("Modifying files...\n")
|
||||
MakeAppTools.replaceTemplate("../Mod/" + Application,"_TEMPLATEPY_",Application)
|
||||
MakeAppTools.replaceTemplate("../Mod/" + Application,"${CMAKE_SOURCE_DIR}/src/Tools/","${CMAKE_SOURCE_DIR}/src/Mod/")
|
||||
# make the configure script executable
|
||||
#os.chmod("../Mod/" + Application + "/configure", 0777);
|
||||
sys.stdout.write("Modifying files done.\n")
|
||||
|
||||
sys.stdout.write(Application + " module created successfully.\n")
|
||||
sys.stdout.write(Application + " module created successfully.\n")
|
||||
|
||||
def validateApp(AppName):
|
||||
"""
|
||||
Validates the class name
|
||||
"""
|
||||
if(len(AppName) < 2):
|
||||
sys.stdout.write("Too short name: '"+AppName+"'\n")
|
||||
sys.exit()
|
||||
# name is long enough
|
||||
clName="class "+AppName+": self=0"
|
||||
try:
|
||||
exec(clName)
|
||||
except Exception:
|
||||
# Invalid class name
|
||||
sys.stdout.write("Invalid name: '"+AppName+"'\n")
|
||||
sys.exit()
|
||||
"""
|
||||
Validates the class name
|
||||
"""
|
||||
if(len(AppName) < 2):
|
||||
sys.stdout.write("Too short name: '"+AppName+"'\n")
|
||||
sys.exit()
|
||||
# name is long enough
|
||||
clName="class "+AppName+": self=0"
|
||||
try:
|
||||
exec(clName)
|
||||
except Exception:
|
||||
# Invalid class name
|
||||
sys.stdout.write("Invalid name: '"+AppName+"'\n")
|
||||
sys.exit()
|
||||
|
||||
sys.stdout.write("Please enter a name for your application:")
|
||||
sys.stdout.flush()
|
||||
|
||||
@@ -33,7 +33,7 @@ def main():
|
||||
wta = "--worktree-attributes"
|
||||
if o in ("--check"):
|
||||
check = True
|
||||
|
||||
|
||||
if dfsg:
|
||||
gitattr = open("src/.gitattributes","w")
|
||||
gitattr.write("zipios++ export-ignore\n")
|
||||
@@ -104,7 +104,7 @@ def main():
|
||||
out = gzip.open(TGZNAME, "wb")
|
||||
out.write(tarstream.getvalue())
|
||||
out.close()
|
||||
|
||||
|
||||
if dfsg:
|
||||
os.remove("src/.gitattributes")
|
||||
print(("Created " + TGZNAME))
|
||||
|
||||
@@ -27,29 +27,29 @@ def generateDoc():
|
||||
os.environ['PATH'] = os.environ['PATH'] + ';' + binpath
|
||||
else:
|
||||
os.environ['PATH'] = os.environ['PATH'] + ':' + binpath
|
||||
|
||||
|
||||
# Import FreeCAD module
|
||||
sys.path.append(binpath)
|
||||
print('Write documentation for module \'FreeCAD\'')
|
||||
pydoc.writedoc('FreeCAD')
|
||||
print('')
|
||||
|
||||
|
||||
# Module directory
|
||||
ModDirs = dircache.listdir(modpath)
|
||||
|
||||
# Search for module paths and append them to Python path
|
||||
# Search for module paths and append them to Python path
|
||||
#for Dir in ModDirs:
|
||||
# if (Dir != '__init__.py'):
|
||||
# sys.path.append( os.path.join(modpath,Dir) )
|
||||
|
||||
# Walk through the module paths again and try loading the modules to create HTML files
|
||||
# Walk through the module paths again and try loading the modules to create HTML files
|
||||
for Dir in ModDirs:
|
||||
dest = os.path.join(modpath,Dir)
|
||||
print('Write documentation for module \'' + Dir + '\'')
|
||||
if (Dir != '__init__.py'):
|
||||
writedocs(dest)
|
||||
print('')
|
||||
|
||||
|
||||
# Now we must create a document and create instances of all Python classes which
|
||||
# cannot be directly created by a module.
|
||||
|
||||
@@ -61,10 +61,10 @@ def generateDoc():
|
||||
if file.find('.html') > 0:
|
||||
print(' Adding file ' + file + ' to archive')
|
||||
zip.write(file)
|
||||
|
||||
|
||||
print('done.')
|
||||
zip.close()
|
||||
|
||||
|
||||
# Remove all HTML files
|
||||
print('Cleaning up HTML files...')
|
||||
for file in os.listdir('.'):
|
||||
@@ -72,7 +72,7 @@ def generateDoc():
|
||||
if file.find('.html') > 0:
|
||||
print(' Removing ' + file)
|
||||
os.remove(file)
|
||||
|
||||
|
||||
os.chdir(cwd)
|
||||
print('done.')
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ locations = [["AddonManager","../Mod/AddonManager/Resources/translations","../Mo
|
||||
["Tux","../Mod/Tux/Resources/translations","../Mod/Tux/Resources/Tux.qrc"],
|
||||
["TechDraw","../Mod/TechDraw/Gui/Resources/translations","../Mod/TechDraw/Gui/Resources/TechDraw.qrc"],
|
||||
]
|
||||
|
||||
|
||||
THRESHOLD = 25 # how many % must be translated for the translation to be included in FreeCAD
|
||||
|
||||
class CrowdinUpdater:
|
||||
@@ -228,7 +228,7 @@ def updateqrc(qrcpath,lncode):
|
||||
"updates a qrc file with the given translation entry"
|
||||
|
||||
#print("opening " + qrcpath + "...")
|
||||
|
||||
|
||||
# getting qrc file contents
|
||||
if not os.path.exists(qrcpath):
|
||||
print("ERROR: Resource file " + qrcpath + " doesn't exist")
|
||||
@@ -287,7 +287,7 @@ def updateTranslatorCpp(lncode):
|
||||
cppfile = os.path.join(os.path.dirname(__file__),"..","Gui","Language","Translator.cpp")
|
||||
l = QtCore.QLocale(lncode)
|
||||
lnname = l.languageToString(l.language())
|
||||
|
||||
|
||||
# read file contents
|
||||
f = open(cppfile,"r")
|
||||
cppcode = []
|
||||
@@ -359,9 +359,9 @@ def doLanguage(lncode):
|
||||
qrcpath = os.path.abspath(target[2])
|
||||
doFile(basefilepath,targetpath,lncode,qrcpath)
|
||||
print(" done")
|
||||
|
||||
|
||||
def applyTranslations(languages):
|
||||
|
||||
|
||||
global tempfolder
|
||||
currentfolder = os.getcwd()
|
||||
tempfolder = tempfile.mkdtemp()
|
||||
@@ -469,7 +469,7 @@ if __name__ == "__main__":
|
||||
print("Updating Translator.cpp...")
|
||||
for ln in languages:
|
||||
updateTranslatorCpp(ln)
|
||||
|
||||
|
||||
elif command == "updateTranslator":
|
||||
print("retrieving list of languages...")
|
||||
status = updater.status()
|
||||
@@ -477,7 +477,7 @@ if __name__ == "__main__":
|
||||
languages = [item['languageId'] for item in status if item['translationProgress'] > THRESHOLD]
|
||||
print("Updating Translator.cpp...")
|
||||
for ln in languages:
|
||||
updateTranslatorCpp(ln)
|
||||
updateTranslatorCpp(ln)
|
||||
|
||||
elif command == "gather":
|
||||
import updatets
|
||||
|
||||
@@ -97,7 +97,7 @@ def find_tools(noobsolete=True):
|
||||
|
||||
print(Usage + "\nFirst, lets find all necessary tools on your system")
|
||||
global QMAKE, LUPDATE, PYLUPDATE, LCONVERT, QT_VERSION_MAJOR
|
||||
|
||||
|
||||
p = subprocess.run(["lupdate","-version"],check=True,stdout=subprocess.PIPE)
|
||||
lupdate_version = p.stdout.decode()
|
||||
result = re.search(r'.* ([456])\.([\d]+)\.([\d]+)', lupdate_version)
|
||||
@@ -123,7 +123,7 @@ def find_tools(noobsolete=True):
|
||||
raise Exception("Cannot find lupdate")
|
||||
else:
|
||||
LUPDATE = "lupdate"
|
||||
|
||||
|
||||
if QT_VERSION_MAJOR < 6:
|
||||
if (os.system("qmake -version") == 0):
|
||||
QMAKE = "qmake"
|
||||
@@ -222,7 +222,7 @@ def update_translation(entry):
|
||||
print(str(e))
|
||||
os.chdir(cur)
|
||||
return
|
||||
|
||||
|
||||
with open (f"{cur}/tsupdate_stdout.log","a") as f:
|
||||
f.write(p.stdout.decode())
|
||||
print(p.stdout.decode())
|
||||
|
||||
Reference in New Issue
Block a user