Слияние веток 91 и path2pddl
This commit is contained in:
parent
44ee21414b
commit
e86914dba1
24 changed files with 732 additions and 0 deletions
45
sequence_generation/InitGui.py
Normal file
45
sequence_generation/InitGui.py
Normal file
|
@ -0,0 +1,45 @@
|
|||
import FreeCAD
|
||||
import FreeCADGui
|
||||
|
||||
def register_commands(commands_dict):
|
||||
for cmd_name, (func, icon_path) in commands_dict.items():
|
||||
FreeCADGui.addCommand(cmd_name, func)
|
||||
FreeCADGui.addIcon(cmd_name + "_icon", icon_path)
|
||||
|
||||
class MyWorkbenchGui:
|
||||
def Initialize(self):
|
||||
pass
|
||||
|
||||
def InitGui(self):
|
||||
# Словарь с именами функций и путями к иконкам
|
||||
commands_dict = {
|
||||
'Check Model': (my_function1, "Path/to/icon1.svg"),
|
||||
'Constraints Autogeneration': (my_function2, "Path/to/icon2.svg"),
|
||||
'Constraints Editing': (my_function1, "Path/to/icon1.svg"),
|
||||
'Generate AdjMatrix': (my_function1, "Path/to/icon1.svg"),
|
||||
'Generate Relationship Matrix': (my_function1, "Path/to/icon1.svg"),
|
||||
'Clusterisation': (my_function1, "Path/to/icon1.svg"),
|
||||
'StepByStepClusterisation': (my_function1, "Path/to/icon1.svg"),
|
||||
'Generate Assembly Sequences': (my_function1, "Path/to/icon1.svg"),
|
||||
'Decomposition Step': (my_function1, "Path/to/icon1.svg")
|
||||
|
||||
}
|
||||
|
||||
# Регистрация команд и иконок
|
||||
register_commands(commands_dict)
|
||||
|
||||
# Создание панели инструментов и добавление команд с иконками
|
||||
self.appendToolbar("Preprocessing", ["Check Model", "Constraints Autogeneration", "Constraints Editing"])
|
||||
self.appendToolbar("Analysis", ["Generate AdjMatrix", "Generate Relationship Matrix", "Clusterisation", "StepByStepClusterisation"])
|
||||
self.appendToolbar("AssemblySequence", ["Generate Assembly Sequences", "Decomposition Step" ])
|
||||
|
||||
def appendToolbar(self, toolbar_name, commands):
|
||||
toolbar = FreeCADGui.ToolBar(toolbar_name)
|
||||
for cmd, icon in commands:
|
||||
toolbar.appendCommand(cmd, icon)
|
||||
|
||||
# Создание экземпляра верстака GUI
|
||||
my_workbench_gui = MyWorkbenchGui()
|
||||
|
||||
# Регистрация верстака
|
||||
FreeCADGui.addWorkbench(my_workbench_gui)
|
Loading…
Add table
Add a link
Reference in a new issue