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
0b7ff8e4
Commit
0b7ff8e4
authored
Feb 24, 2015
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor corrections to JS plugins
parent
6c18bd7b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
11 deletions
+23
-11
dream/plugins/MergeSteps.py
dream/plugins/MergeSteps.py
+1
-1
dream/plugins/SplitRoute.py
dream/plugins/SplitRoute.py
+3
-3
dream/plugins/UpdateStationList.py
dream/plugins/UpdateStationList.py
+16
-4
dream/plugins/UpdateWIP.py
dream/plugins/UpdateWIP.py
+3
-3
No files found.
dream/plugins/MergeSteps.py
View file @
0b7ff8e4
...
...
@@ -63,7 +63,7 @@ class MergeSteps(plugin.InputPreparationPlugin):
if
stepToMerge
[
"processingTime"
]:
step
[
"setupTime"
]
=
stepToMerge
[
"processingTime"
]
# setupType + operator for setup
if
stepToMerge
[
"operator"
]
==
"Automatic"
if
stepToMerge
[
"operator"
]
==
"Automatic"
:
step
[
"operationType"
][
"setup"
]
=
"Automatic"
else
:
step
[
"operationType"
][
"setup"
]
=
"Manual"
...
...
dream/plugins/SplitRoute.py
View file @
0b7ff8e4
...
...
@@ -19,7 +19,7 @@ class SplitRoute(plugin.InputPreparationPlugin):
""" splits the routes of mould parts (design + mould)
"""
orders
=
data
[
"input"
][
"BOM"
][
"orders"
]
stations
=
data
[
"input"
][
"BOM"
][
"stations"
]
#
stations = data["input"]["BOM"]["stations"]
for
order
in
orders
:
orderComponents
=
order
.
get
(
"componentsList"
,
[])
componentsToAdd
=
[]
...
...
@@ -31,8 +31,8 @@ class SplitRoute(plugin.InputPreparationPlugin):
i
=
0
for
step
in
routeList
:
stepTechnology
=
step
.
get
(
'technology'
,[])
assert
stepTechnology
in
ROUTE_STEPS_SET
,
'the technology provided does not exist'
if
stepTechnology
in
DESIGN_ROUTE_STEPS_SET
:
assert
stepTechnology
in
self
.
ROUTE_STEPS_SET
,
'the technology provided does not exist'
if
stepTechnology
in
self
.
DESIGN_ROUTE_STEPS_SET
:
design_step_list
.
append
(
step
)
route
.
pop
(
i
)
else
:
...
...
dream/plugins/UpdateStationList.py
View file @
0b7ff8e4
...
...
@@ -12,6 +12,7 @@ class UpdateStationList(plugin.InputPreparationPlugin):
""" Input preparation
reads the data from external data base and substitutes the technology information with stationIDs lists
"""
@
staticmethod
def
getStationTechnologies
():
'''returns the technologies that can be processed on the stations'''
return
{
"CAD"
:
[
"ENG"
,
"CAD"
],
...
...
@@ -31,11 +32,22 @@ class UpdateStationList(plugin.InputPreparationPlugin):
return
initials
return
None
def
getStationNames
(
self
):
node
=
self
.
data
[
"graph"
][
"node"
]
stations
=
[]
for
nodeID
in
node
.
keys
():
stations
.
append
(
nodeID
)
return
stations
def
preprocess
(
self
,
data
):
""" substitutes the technology information with stationIDs lists
"""
self
.
data
=
data
orders
=
data
[
"input"
][
"BOM"
][
'orders'
]
stations
=
data
[
"input"
][
"BOM"
][
'stations'
]
try
:
stations
=
data
[
"input"
][
"BOM"
][
'stations'
]
except
:
stations
=
self
.
getStationNames
()
nodes
=
data
[
"graph"
][
"node"
]
for
order
in
orders
:
...
...
@@ -45,14 +57,14 @@ class UpdateStationList(plugin.InputPreparationPlugin):
for
index
,
step
in
enumerate
(
route
):
technology
=
step
.
get
(
"technology"
,
None
)
technology
=
technology
.
split
(
"-"
)[
0
]
assert
self
.
getStationInitials
(
technology
),
'there is no corresponding station initial for that technology'
step
[
"technology"
]
=
technology
technologyStations
=
[]
for
station
in
stations
:
assert
self
.
getStationInitials
(
technology
),
'there is no corresponding station initial for that technology'
if
station
.
startswith
(
self
.
getStationInitials
(
technology
)):
found
=
False
# check that the id of the station provided by the db BOM exist in the nodes of the graph
for
node
in
nodes
:
if
node
[
"id"
]
==
station
:
for
node
in
nodes
.
keys
()
:
if
node
==
station
:
found
=
True
break
assert
found
==
True
,
"the station ids in the DB must be the same with the stations ids provided by the model"
...
...
dream/plugins/UpdateWIP.py
View file @
0b7ff8e4
...
...
@@ -12,7 +12,7 @@ class UpdateWIP(plugin.InputPreparationPlugin):
def
getWIPIds
(
self
):
"""returns the ids of the parts that are in the WIP dictionary"""
wipIDs
=
[]
for
key
in
self
.
data
[
"input"
][
"BOM"
].
get
(
"WIP"
,
{}).
keys
()
for
key
in
self
.
data
[
"input"
][
"BOM"
].
get
(
"WIP"
,
{}).
keys
()
:
wipIDs
.
append
(
key
)
return
wipIDs
...
...
@@ -91,7 +91,7 @@ class UpdateWIP(plugin.InputPreparationPlugin):
# # if the design is not complete
else
:
# # if the component is design then put it at the start of its route
if
any
(
station
.
startswith
(
"OD"
)
for
station
in
route
[
0
][
"stationIdsList"
]):
if
any
(
station
.
startswith
(
"OD"
)
for
station
in
route
[
-
1
][
"stationIdsList"
]):
insertWIPitem
=
True
# # if the completed components include all the components (exclude mould and design)
if
len
(
completedComponents
)
==
len
(
orderComponents
)
-
2
:
...
...
@@ -99,7 +99,7 @@ class UpdateWIP(plugin.InputPreparationPlugin):
if
any
(
station
.
startswith
(
"E"
)
for
station
in
route
[
-
1
][
"stationIdsList"
]):
insertWIPitem
=
True
if
insertWIPitem
:
if
insertWIPitem
:
wip
[
componentID
][
"station"
]
=
route
[
0
][
"stationIdsList"
][
0
]
wip
[
componentID
][
"sequence"
]
=
route
[
0
][
"sequence"
]
wip
[
componentID
][
"task_id"
]
=
route
[
0
][
"task_id"
]
...
...
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