This commit is contained in:
2025-03-28 19:40:11 +06:00
parent af559092bf
commit 1d062a087f
26 changed files with 360 additions and 514 deletions

View File

@@ -56,7 +56,7 @@ class CommandPVPlantSite:
return
class CommandPVPlantGeoreferencing:
'''class CommandPVPlantGeoreferencing:
@staticmethod
def GetResources():
return {'Pixmap': str(os.path.join(DirIcons, "Location.svg")),
@@ -74,8 +74,10 @@ class CommandPVPlantGeoreferencing:
@staticmethod
def Activated():
import PVPlantGeoreferencing
form = PVPlantGeoreferencing.MapWindow()
form.show()
taskd = PVPlantGeoreferencing.MapWindow()
#taskd.setParent(FreeCADGui.getMainWindow())
#taskd.setWindowFlags(QtCore.Qt.Window)
taskd.show()#exec_()'''
class CommandProjectSetup:
@@ -187,8 +189,8 @@ class CommandBoundary:
from Project.Area import PVPlantArea
sel = FreeCADGui.Selection.getSelection()[0]
obj = PVPlantArea.makeArea([ver.Point for ver in sel.Shape.Vertexes])
#taskd = _PVPlantPlacementTaskPanel()
#FreeCADGui.Control.showDialog(taskd)
# taskd = _PVPlantPlacementTaskPanel()
# FreeCADGui.Control.showDialog(taskd)
class CommandFrameArea:
@@ -249,6 +251,7 @@ class CommandPVSubplant:
return True
else:
return False
@staticmethod
def Activated():
from Project.Area import PVPlantArea
@@ -524,7 +527,7 @@ class CommandManhole:
@staticmethod
def IsActive():
return not FreeCAD.ActiveDocument is None
return not (FreeCAD.ActiveDocument is None)
if FreeCAD.ActiveDocument is not None:
if FreeCADGui.Selection.getCompleteSelection():
for ob in FreeCAD.ActiveDocument.Objects:
@@ -534,29 +537,30 @@ class CommandManhole:
@staticmethod
def Activated():
import PVPlantManhole
TaskPanel = PVPlantManhole._ManholeTaskPanel()
FreeCADGui.Control.showDialog(TaskPanel)
task_panel = PVPlantManhole._ManholeTaskPanel()
FreeCADGui.Control.showDialog(task_panel)
return
if FreeCAD.GuiUp:
FreeCADGui.addCommand('PVPlantSite', CommandPVPlantSite())
FreeCADGui.addCommand('PVPlantGeoreferencing', CommandPVPlantGeoreferencing())
import PVPlantGeoreferencing
FreeCADGui.addCommand('PVPlantGeoreferencing', PVPlantGeoreferencing.CommandPVPlantGeoreferencing())
FreeCADGui.addCommand('ProjectSetup', CommandProjectSetup())
FreeCADGui.addCommand('Terrain', CommandTerrain())
FreeCADGui.addCommand('PVPlantCreateTerrainMesh', CommandCreateTerrainMesh())
class CommandAreaGroup:
@staticmethod
def GetCommands():
return tuple([#'Area',
'FrameArea',
'ForbiddenArea',
'PVSubplant',
'OffsetArea'
])
return tuple([ # 'Area',
'FrameArea',
'ForbiddenArea',
'PVSubplant',
'OffsetArea'
])
@staticmethod
def GetResources():
@@ -568,7 +572,8 @@ if FreeCAD.GuiUp:
def IsActive():
return not FreeCAD.ActiveDocument is None
#FreeCADGui.addCommand('Area', CommandBoundary())
# FreeCADGui.addCommand('Area', CommandBoundary())
FreeCADGui.addCommand('FrameArea', CommandFrameArea())
FreeCADGui.addCommand('ForbiddenArea', CommandProhibitedArea())
FreeCADGui.addCommand('PVSubplant', CommandPVSubplant())
@@ -578,6 +583,7 @@ if FreeCAD.GuiUp:
FreeCADGui.addCommand('SplitArea', CommandSplitArea())
FreeCADGui.addCommand('JoinAreas', CommandJoinAreas())
class CommandTerrainAnalisysGroup:
@staticmethod
def GetCommands():
@@ -589,20 +595,22 @@ if FreeCAD.GuiUp:
@staticmethod
def GetResources():
return { 'MenuText': QT_TRANSLATE_NOOP("",'Terrain Analisys'),
'ToolTip': QT_TRANSLATE_NOOP("",'Terrain Analisys')
}
return {'MenuText': QT_TRANSLATE_NOOP("", 'Terrain Analisys'),
'ToolTip': QT_TRANSLATE_NOOP("", 'Terrain Analisys')
}
@staticmethod
def IsActive():
return not FreeCAD.ActiveDocument is None
FreeCADGui.addCommand('Contours', CommandContours())
FreeCADGui.addCommand('SlopeAnalisys', CommandSlopeAnalisys())
FreeCADGui.addCommand('HeightAnalisys', CommandHeightAnalisys())
FreeCADGui.addCommand('OrientationAnalisys', CommandOrientationAnalisys())
FreeCADGui.addCommand('TerrainAnalisys', CommandTerrainAnalisysGroup())
class CommandTrenchGroup:
@staticmethod
def GetCommands():
@@ -625,33 +633,48 @@ if FreeCAD.GuiUp:
active = active and not (FreeCAD.ActiveDocument.getObject("Terrain").Mesh is None)
return active
FreeCADGui.addCommand('PVPlantTrench', CommandTrench())
FreeCADGui.addCommand('PVPlantSemiAutomaticTrench', CommandSemiAutomaticTrench())
FreeCADGui.addCommand('Trenches', CommandTrenchGroup())
FreeCADGui.addCommand('PVPlantEarthworks', CommandCalculateEarthworks())
FreeCADGui.addCommand('PVPlantManhole', _ommandManhole())
FreeCADGui.addCommand('PVPlantManhole', CommandManhole())
projectlist = [ #"Reload",
"PVPlantSite",
"ProjectSetup",
"PVPlantGeoreferencing",
"Separator",
# "ImportGrid",
"Terrain",
"TerrainAnalisys",
"PVPlantCreateTerrainMesh",
"Separator",
#"PointsGroup",
"PVPlantAreas",
"SplitArea",
"Separator",
"Trenches",
"PVPlantEarthworks",
#"PVPlantPad",
#"PVPlantRoad",
#"PVPlantManhole",
#"PVPlantFoundation"
#"GraphTerrainProfile",
#"Trace",
]
import PVPlantPlacement
FreeCADGui.addCommand('PVPlantPlacement', PVPlantPlacement.CommandPVPlantPlacement())
FreeCADGui.addCommand('PVPlantAdjustToTerrain', PVPlantPlacement.CommandAdjustToTerrain())
FreeCADGui.addCommand('PVPlantConvertTo', PVPlantPlacement.CommandConvert())
projectlist = [ # "Reload",
"PVPlantSite",
"ProjectSetup",
"PVPlantGeoreferencing",
"Separator",
# "ImportGrid",
"Terrain",
"TerrainAnalisys",
"PVPlantCreateTerrainMesh",
"Separator",
# "PointsGroup",
"PVPlantAreas",
"SplitArea",
"Separator",
"Trenches",
"PVPlantEarthworks",
# "PVPlantPad",
# "PVPlantRoad",
"PVPlantManhole",
# "PVPlantFoundation"
# "GraphTerrainProfile",
# "Trace",
]
pv_list = [
# "RackType",
# "PVPlantRackCheck",
# "Separator",
"PVPlantPlacement",
"PVPlantAdjustToTerrain",
"PVPlantConvertTo",
# "PVArea"
]