Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
0c6155da
Commit
0c6155da
authored
Sep 26, 2014
by
Ioannis Papagiannopoulos
Committed by
Georgios Dagkakis
Nov 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Order recent updates
parent
3cd854dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
dream/simulation/Order.py
dream/simulation/Order.py
+8
-10
No files found.
dream/simulation/Order.py
View file @
0c6155da
...
...
@@ -33,7 +33,7 @@ from Job import Job
# =======================================================================
class
Order
(
Job
):
type
=
"Order"
# XX define which are the valid assembly types - for which components should the order be searching for
assemblyValidTypes
=
set
([
'Mold Base'
,
'Mold Insert'
,
'Slider'
,
'Misc'
,
'Z-standards'
,
'K-Standards'
])
assemblyInvalidTypes
=
set
([
'Mold'
,
'Injection Molding Part'
])
def
__init__
(
self
,
id
=
None
,
...
...
@@ -72,11 +72,10 @@ class Order(Job):
return
route
#===========================================================================
# find all the child components of the order
# mould cannot be included as if it is not yet created then it can be found in the G.EntityList
# find all the active child components of the order
# returns only the components that are present in the system
#===========================================================================
def
findComponents
(
self
):
def
find
Active
Components
(
self
):
from
Globals
import
findObjectById
for
componentDict
in
self
.
componentsList
:
componentId
=
componentDict
.
get
(
'id'
,
0
)
...
...
@@ -85,25 +84,24 @@ class Order(Job):
if
componentClass
==
'Dream.Mould'
:
if
not
componentId
in
[
x
.
id
for
x
in
G
.
EntityList
]:
self
.
assemblyRequested
=
True
#
XXX
if the component is not yet created then there is no entity to find.
# if the component is not yet created then there is no entity to find.
component
=
findObjectById
(
componentId
)
if
component
:
if
not
component
in
self
.
components
:
self
.
components
.
append
(
component
)
#===========================================================================
# return the all the child components of the order
# return the all the
active
child components of the order
#===========================================================================
def
getComponents
(
self
):
if
not
self
.
components
:
self
.
findComponents
()
def
getActiveComponents
(
self
):
self
.
findActiveComponents
()
return
self
.
components
#===========================================================================
# find all the child components of the order that are required for the building of the mould
#===========================================================================
def
findAssemblyComponents
(
self
):
for
child
in
self
.
getComponents
():
for
child
in
self
.
get
Active
Components
():
if
child
.
componentType
in
self
.
assemblyValidTypes
:
if
not
child
in
self
.
assemblyComponents
:
self
.
assemblyComponents
.
append
(
child
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment