2025-01-28 00:04:13 +01:00
|
|
|
import FreeCAD
|
|
|
|
|
if FreeCAD.GuiUp:
|
|
|
|
|
import FreeCADGui, os
|
|
|
|
|
from PySide.QtCore import QT_TRANSLATE_NOOP
|
|
|
|
|
else:
|
|
|
|
|
# \cond
|
|
|
|
|
def translate(ctxt,txt):
|
|
|
|
|
return txt
|
|
|
|
|
def QT_TRANSLATE_NOOP(ctxt,txt):
|
|
|
|
|
return txt
|
|
|
|
|
# \endcond
|
|
|
|
|
|
|
|
|
|
global __dir__
|
|
|
|
|
__dir__ = os.path.join(FreeCAD.getUserAppDataDir(), "Mod", "PVPlant")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class _CommandReload:
|
|
|
|
|
def GetResources(self):
|
|
|
|
|
return {'Pixmap': str(os.path.join(__dir__, "Resources", "Icons", "Reload.svg")),
|
|
|
|
|
'Accel': "R,E",
|
|
|
|
|
'MenuText': QT_TRANSLATE_NOOP("Reload","Reload"),
|
|
|
|
|
'ToolTip': QT_TRANSLATE_NOOP("Reload","Reload")}
|
|
|
|
|
|
|
|
|
|
def Activated(self):
|
|
|
|
|
import PVPlantPlacement, \
|
|
|
|
|
PVPlantGeoreferencing, PVPlantImportGrid, PVPlantTerrainAnalisys, \
|
|
|
|
|
PVPlantSite, PVPlantRackChecking, PVPlantFence, PVPlantFencePost, PVPlantFenceGate, \
|
|
|
|
|
PVPlantCreateTerrainMesh, \
|
2025-04-14 10:05:32 +06:00
|
|
|
PVPlantFoundation, PVPlantBuilding, PVPlantEarthWorks, PVPlantPad, \
|
2025-01-28 00:04:13 +01:00
|
|
|
PVPlantRoad, PVPlantTerrain, PVPlantStringing, PVPlantManhole, \
|
|
|
|
|
GraphProfile
|
2025-04-14 10:05:32 +06:00
|
|
|
from Civil import PVPlantTrench
|
|
|
|
|
from Vegetation import PVPlantTreeGenerator
|
|
|
|
|
|
2025-01-28 00:04:13 +01:00
|
|
|
from Mechanical.Frame import PVPlantFrame
|
|
|
|
|
from Project.Area import PVPlantArea, PVPlantAreaUtils
|
|
|
|
|
#from Importer import importDXF
|
|
|
|
|
from Export import PVPlantBOQCivil, PVPlantBOQElectrical, PVPlantBOQMechanical, exportPVSyst, exportDXF
|
|
|
|
|
from Utils import PVPlantUtils, PVPlantTrace, m_gui_edit, profile_editor, graphics
|
|
|
|
|
|
|
|
|
|
from Electrical.Cable import PVPlantCable, PVPlantElectricalLine
|
|
|
|
|
from Electrical import Conduit
|
|
|
|
|
from Electrical.CombinerBox import PVPlantStringBox
|
|
|
|
|
from Electrical.Inverter import PVPlantInverter
|
|
|
|
|
|
|
|
|
|
from Export import layoutToExcel
|
|
|
|
|
import MeshTools.MeshGetBoundary as MeshGetBoundary
|
|
|
|
|
import MeshTools.Triangulation as Triangulation
|
|
|
|
|
from Project import ProjectSetup
|
|
|
|
|
import importlib
|
2025-04-14 10:05:32 +06:00
|
|
|
import hydro.hydrological as hydro
|
|
|
|
|
import Importer.importOSM as iOSM
|
2025-01-28 00:04:13 +01:00
|
|
|
|
|
|
|
|
importlib.reload(ProjectSetup)
|
|
|
|
|
importlib.reload(PVPlantPlacement)
|
|
|
|
|
importlib.reload(PVPlantImportGrid)
|
|
|
|
|
importlib.reload(PVPlantGeoreferencing)
|
|
|
|
|
importlib.reload(PVPlantTerrainAnalisys)
|
|
|
|
|
importlib.reload(PVPlantSite)
|
|
|
|
|
importlib.reload(PVPlantFrame)
|
|
|
|
|
importlib.reload(PVPlantRackChecking)
|
|
|
|
|
importlib.reload(PVPlantFence)
|
|
|
|
|
importlib.reload(PVPlantFenceGate)
|
|
|
|
|
importlib.reload(PVPlantFencePost)
|
|
|
|
|
importlib.reload(PVPlantFoundation)
|
|
|
|
|
importlib.reload(PVPlantCreateTerrainMesh)
|
|
|
|
|
importlib.reload(PVPlantTreeGenerator)
|
|
|
|
|
importlib.reload(PVPlantBuilding)
|
|
|
|
|
importlib.reload(exportPVSyst)
|
|
|
|
|
importlib.reload(PVPlantTrench)
|
|
|
|
|
importlib.reload(PVPlantEarthWorks)
|
|
|
|
|
|
|
|
|
|
importlib.reload(PVPlantStringBox)
|
|
|
|
|
importlib.reload(PVPlantCable)
|
|
|
|
|
importlib.reload(PVPlantElectricalLine)
|
|
|
|
|
importlib.reload(PVPlantInverter)
|
|
|
|
|
|
|
|
|
|
importlib.reload(PVPlantPad)
|
|
|
|
|
importlib.reload(PVPlantRoad)
|
|
|
|
|
importlib.reload(PVPlantTerrain)
|
|
|
|
|
importlib.reload(PVPlantStringing)
|
|
|
|
|
importlib.reload(PVPlantBOQCivil)
|
|
|
|
|
importlib.reload(PVPlantBOQMechanical)
|
|
|
|
|
importlib.reload(PVPlantBOQElectrical)
|
|
|
|
|
importlib.reload(PVPlantArea)
|
|
|
|
|
importlib.reload(PVPlantAreaUtils)
|
|
|
|
|
importlib.reload(PVPlantUtils)
|
|
|
|
|
importlib.reload(PVPlantManhole)
|
|
|
|
|
importlib.reload(GraphProfile)
|
|
|
|
|
|
|
|
|
|
importlib.reload(PVPlantTrace)
|
|
|
|
|
importlib.reload(m_gui_edit)
|
|
|
|
|
importlib.reload(profile_editor)
|
|
|
|
|
importlib.reload(graphics)
|
|
|
|
|
|
|
|
|
|
importlib.reload(MeshGetBoundary)
|
|
|
|
|
importlib.reload(Triangulation)
|
|
|
|
|
|
|
|
|
|
#importlib.reload(importDXF)
|
|
|
|
|
importlib.reload(exportDXF)
|
|
|
|
|
importlib.reload(layoutToExcel)
|
|
|
|
|
importlib.reload(Conduit)
|
|
|
|
|
|
2025-04-14 10:05:32 +06:00
|
|
|
importlib.reload(hydro)
|
|
|
|
|
importlib.reload(iOSM)
|
|
|
|
|
|
|
|
|
|
import Project.GenerateExternalDocument as GED
|
|
|
|
|
importlib.reload(GED)
|
2025-01-28 00:04:13 +01:00
|
|
|
|
|
|
|
|
#importlib.reload(GoogleMapDownloader)
|
|
|
|
|
print("Reload modules...")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def IsActive(self):
|
|
|
|
|
if FreeCAD.ActiveDocument:
|
|
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if FreeCAD.GuiUp:
|
|
|
|
|
FreeCADGui.addCommand('Reload', _CommandReload())
|