forked from URJCMakerGroup/MakerWorkbench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
InitGui.py
189 lines (165 loc) · 6.83 KB
/
InitGui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# -*- coding: utf-8 -*-
# FreeCAD init script of the Filter Stage module,
# ***************************************************************************
# * (c) David Muñoz Bernal *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the GNU Lesser General Public License (LGPL) *
# * as published by the Free Software Foundation; either version 2 of *
# * the License, or (at your option) any later version. *
# * for detail see the LICENCE text file. *
# * *
# * FreeCAD is distributed in the hope that it will be useful, *
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
# * GNU Lesser General Public License for more details. *
# * *
# * You should have received a copy of the GNU Library General Public *
# * License along with FreeCAD; if not, write to the Free Software *
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
# * USA *
# * *
# ***************************************************************************/
class MakerWorkbench (Workbench):
"""Maker Wokbench to create objects"""
# Icon in XPM 16x16
Icon = "/Resources/icons/Maker_workbench_icon.svg"
# """
# /* XPM */
# static char * Filter_Stage_xpm[] = {
# "16 16 5 1",
# " c None",
# ". c #FFFFFF",
# "+ c #000000",
# "@ c #7F4F00",
# "# c #FFBF00",
# "................",
# "...++++++++++++.",
# "..+@#########++.",
# ".+@#########+@+.",
# ".+++++++++++@#+.",
# ".+#########+##+.",
# ".+#++###++#+##+.",
# ".+#+#+#+#+#+##+.",
# ".+#+##+##+#+##+.",
# ".+#+#####+#+##+.",
# ".+#+#####+#+##+.",
# ".+#+#####+#+##+.",
# ".+#+#####+#+#@+.",
# ".+#########+@+..",
# ".++++++++++++...",
# "................"};
# """
MenuText = "Maker Workbench"
ToolTip = "Maker Workbench"
def Initialize(self):
from PySide2 import QtCore, QtGui
# import MechatronicGui
import Gui.Sk_Gui
import Gui.IdlePulleyHolder_Gui
import Gui.AluprofBracket_Gui
import Gui.MotorHolder_Gui
import Gui.NemaMotor_Gui
import Gui.SimpleEndStopHolder_Gui
import Gui.LinBearHouse_Gui
import Gui.StopHolder_Gui
import Gui.FilterHolder_Gui
import Gui.BeltClamp_Gui
import Gui.SensorHolder_Gui
import Gui.Aluprof_Gui
import Gui.LinGuideBlock_Gui
import Gui.Bolt_Nut_Washer_Gui
import Gui.TubeLense_Gui
import Gui.LCPB1M_Gui
import Gui.Plate_Gui
import Gui.CageCube_Gui
import Gui.ThLed30_Gui
import Gui.PrizLed_Gui
import Gui.BreadBoard_Gui
import Gui.FilterStage_Gui
import Gui.Tensioner_Gui
import Gui.ChangePos_Gui
import Gui.Assembly_Gui
import Gui.test_Gui
import Gui.New_Point_Gui
# +-------------------------------+
# | |
# | List of mechanical models |
# | |
# +-------------------------------+
partsList = ["Sk",
"Idle_Pulley_Holder",
"Aluprof_Bracket",
"Motor_Holder",
"Motor",
"Simple_Endstop_Holder",
"LinBearHouse",
"Stop_Holder",
"Filter_Holder",
"Belt_Clamp",
# "Belt_Clamped", # Not working properly
"Sensor_Holder",
"Aluproft",
"Linear_Guide_Block",
"Bolts, Nuts & Washers"]
# +-------------------------------+
# | |
# | List of optic models |
# | |
# +-------------------------------+
opticList = ["TubeLense",
"LCB1M_Base",
"Plate",
"CageCube",
"ThLed30",
"PrizLed",
"BreadBoard"]
# +-------------------------------+
# | |
# | List of systems |
# | |
# +-------------------------------+
sysList = ["Filter_Stage",
"Tensioner"]
# +-------------------------------+
# | |
# | List of functions |
# | |
# +-------------------------------+
modList = ["ChangePosExport",
"Assembly",
"New_Internal_Point"] # ,
# "test"]
# +-------------------------------+
# | |
# | Add ToolBars |
# | |
# +-------------------------------+
self.appendToolbar(
str(QtCore.QT_TRANSLATE_NOOP("Maker", "Parts")), partsList)
self.appendToolbar(
str(QtCore.QT_TRANSLATE_NOOP("Maker", "Optic")), opticList)
self.appendToolbar(
str(QtCore.QT_TRANSLATE_NOOP("Maker", "Systems")), sysList)
self.appendToolbar(
str(QtCore.QT_TRANSLATE_NOOP("Maker", "Functions")), modList)
# +-------------------------------+
# | |
# | Add Menus |
# | |
# +-------------------------------+
self.appendMenu(
str(QtCore.QT_TRANSLATE_NOOP("Maker", "Parts")), partsList)
self.appendMenu(
str(QtCore.QT_TRANSLATE_NOOP("Maker", "Optic")), opticList)
self.appendMenu(
str(QtCore.QT_TRANSLATE_NOOP("Maker", "Systems")), sysList)
self.appendMenu(
str(QtCore.QT_TRANSLATE_NOOP("Maker", "Functions")), modList)
Log('Loalding Maker Workbench... done! \n')
def GetClassName(self):
return "Gui::PythonWorkbench"
# Add workbench
Gui.addWorkbench(MakerWorkbench())