Добавлен функционал генератора спецификаций

This commit is contained in:
Mark Voltov 2023-05-23 15:48:20 +03:00
parent b5c5ec0bd6
commit 29cad491f5
12 changed files with 998 additions and 18 deletions

View file

@ -11,9 +11,11 @@
# Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <http://www.gnu.org/licenses/>.
from BoMList import run_BoM_list
import FreeCAD
import Tools
from scenarios.robossembler_freecad_export_scenario import RobossemblerFreeCadExportScenario
from usecases.asm4parser_usecase import Asm4StructureParseUseCase
if FreeCAD.GuiUp:
import FreeCADGui
@ -297,6 +299,13 @@ def makeAllPartFrames():
def spawnFeatureFrameCreator():
ffpanel = FeatureFramePanel()
FreeCADGui.Control.showDialog(ffpanel)
def BoMGeneration(part):
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython",
"FeatureFrame")
print(obj)
###################################################################
@ -306,22 +315,26 @@ uidir = os.path.join(FreeCAD.getUserAppDataDir(),
"Mod", __workbenchname__, "UI")
icondir = os.path.join(uidir, "icons")
Tools.spawnClassCommand("FrameCommand",
makeFrame,
{"Pixmap": str(os.path.join(icondir, "frame.svg")),
"MenuText": "Make a free frame",
"ToolTip": "Make a freestanding reference frame."})
Tools.spawnClassCommand("ASM4StructureParsing",
RobossemblerFreeCadExportScenario().call,
{"Pixmap": str(os.path.join(icondir, "assembly4.svg")),
"MenuText": "Make a ASM4 parsing",
"ToolTip": "Make a ASM4 1"})
Tools.spawnClassCommand("SelectedPartFrameCommand",
makeSelectedPartFrames,
{"Pixmap": str(os.path.join(icondir, "partframe.svg")),
"MenuText": "selected parts frames",
"ToolTip": "Make selected parts frames."})
# Tools.spawnClassCommand("FrameCommand",
# makeFrame,
# {"Pixmap": str(os.path.join(icondir, "frame.svg")),
# "MenuText": "Make a free frame",
# "ToolTip": "Make a freestanding reference frame."})
Tools.spawnClassCommand("BoMGeneration",
run_BoM_list,
{"Pixmap": str(os.path.join(icondir, "BoMList.svg")),
"MenuText": "Generate Bill of Materials",
"ToolTip": "Press the button to create big BoM"})
# Tools.spawnClassCommand("ASM4StructureParsing",
# Asm4StructureParseUseCase().initParse,
# {"Pixmap": str(os.path.join(icondir, "assembly4.svg")),
# "MenuText": "Make a ASM4 parsing",
# "ToolTip": "Make a ASM4 1"})
# Tools.spawnClassCommand("SelectedPartFrameCommand",
# makeSelectedPartFrames,
# {"Pixmap": str(os.path.join(icondir, "partframe.svg")),
# "MenuText": "selected parts frames",
# "ToolTip": "Make selected parts frames."})
Tools.spawnClassCommand("AllPartFramesCommand",
makeAllPartFrames,