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
Show 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):
...
@@ -63,7 +63,7 @@ class MergeSteps(plugin.InputPreparationPlugin):
if
stepToMerge
[
"processingTime"
]:
if
stepToMerge
[
"processingTime"
]:
step
[
"setupTime"
]
=
stepToMerge
[
"processingTime"
]
step
[
"setupTime"
]
=
stepToMerge
[
"processingTime"
]
# setupType + operator for setup
# setupType + operator for setup
if
stepToMerge
[
"operator"
]
==
"Automatic"
if
stepToMerge
[
"operator"
]
==
"Automatic"
:
step
[
"operationType"
][
"setup"
]
=
"Automatic"
step
[
"operationType"
][
"setup"
]
=
"Automatic"
else
:
else
:
step
[
"operationType"
][
"setup"
]
=
"Manual"
step
[
"operationType"
][
"setup"
]
=
"Manual"
...
...
dream/plugins/SplitRoute.py
View file @
0b7ff8e4
...
@@ -19,7 +19,7 @@ class SplitRoute(plugin.InputPreparationPlugin):
...
@@ -19,7 +19,7 @@ class SplitRoute(plugin.InputPreparationPlugin):
""" splits the routes of mould parts (design + mould)
""" splits the routes of mould parts (design + mould)
"""
"""
orders
=
data
[
"input"
][
"BOM"
][
"orders"
]
orders
=
data
[
"input"
][
"BOM"
][
"orders"
]
stations
=
data
[
"input"
][
"BOM"
][
"stations"
]
#
stations = data["input"]["BOM"]["stations"]
for
order
in
orders
:
for
order
in
orders
:
orderComponents
=
order
.
get
(
"componentsList"
,
[])
orderComponents
=
order
.
get
(
"componentsList"
,
[])
componentsToAdd
=
[]
componentsToAdd
=
[]
...
@@ -31,8 +31,8 @@ class SplitRoute(plugin.InputPreparationPlugin):
...
@@ -31,8 +31,8 @@ class SplitRoute(plugin.InputPreparationPlugin):
i
=
0
i
=
0
for
step
in
routeList
:
for
step
in
routeList
:
stepTechnology
=
step
.
get
(
'technology'
,[])
stepTechnology
=
step
.
get
(
'technology'
,[])
assert
stepTechnology
in
ROUTE_STEPS_SET
,
'the technology provided does not exist'
assert
stepTechnology
in
self
.
ROUTE_STEPS_SET
,
'the technology provided does not exist'
if
stepTechnology
in
DESIGN_ROUTE_STEPS_SET
:
if
stepTechnology
in
self
.
DESIGN_ROUTE_STEPS_SET
:
design_step_list
.
append
(
step
)
design_step_list
.
append
(
step
)
route
.
pop
(
i
)
route
.
pop
(
i
)
else
:
else
:
...
...
dream/plugins/UpdateStationList.py
View file @
0b7ff8e4
...
@@ -12,6 +12,7 @@ class UpdateStationList(plugin.InputPreparationPlugin):
...
@@ -12,6 +12,7 @@ class UpdateStationList(plugin.InputPreparationPlugin):
""" Input preparation
""" Input preparation
reads the data from external data base and substitutes the technology information with stationIDs lists
reads the data from external data base and substitutes the technology information with stationIDs lists
"""
"""
@
staticmethod
def
getStationTechnologies
():
def
getStationTechnologies
():
'''returns the technologies that can be processed on the stations'''
'''returns the technologies that can be processed on the stations'''
return
{
"CAD"
:
[
"ENG"
,
"CAD"
],
return
{
"CAD"
:
[
"ENG"
,
"CAD"
],
...
@@ -31,11 +32,22 @@ class UpdateStationList(plugin.InputPreparationPlugin):
...
@@ -31,11 +32,22 @@ class UpdateStationList(plugin.InputPreparationPlugin):
return
initials
return
initials
return
None
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
):
def
preprocess
(
self
,
data
):
""" substitutes the technology information with stationIDs lists
""" substitutes the technology information with stationIDs lists
"""
"""
self
.
data
=
data
orders
=
data
[
"input"
][
"BOM"
][
'orders'
]
orders
=
data
[
"input"
][
"BOM"
][
'orders'
]
try
:
stations
=
data
[
"input"
][
"BOM"
][
'stations'
]
stations
=
data
[
"input"
][
"BOM"
][
'stations'
]
except
:
stations
=
self
.
getStationNames
()
nodes
=
data
[
"graph"
][
"node"
]
nodes
=
data
[
"graph"
][
"node"
]
for
order
in
orders
:
for
order
in
orders
:
...
@@ -45,14 +57,14 @@ class UpdateStationList(plugin.InputPreparationPlugin):
...
@@ -45,14 +57,14 @@ class UpdateStationList(plugin.InputPreparationPlugin):
for
index
,
step
in
enumerate
(
route
):
for
index
,
step
in
enumerate
(
route
):
technology
=
step
.
get
(
"technology"
,
None
)
technology
=
step
.
get
(
"technology"
,
None
)
technology
=
technology
.
split
(
"-"
)[
0
]
technology
=
technology
.
split
(
"-"
)[
0
]
assert
self
.
getStationInitials
(
technology
),
'there is no corresponding station initial for that technology'
step
[
"technology"
]
=
technology
step
[
"technology"
]
=
technology
technologyStations
=
[]
technologyStations
=
[]
for
station
in
stations
:
for
station
in
stations
:
assert
self
.
getStationInitials
(
technology
),
'there is no corresponding station initial for that technology'
if
station
.
startswith
(
self
.
getStationInitials
(
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
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
:
for
node
in
nodes
.
keys
()
:
if
node
[
"id"
]
==
station
:
if
node
==
station
:
found
=
True
found
=
True
break
break
assert
found
==
True
,
"the station ids in the DB must be the same with the stations ids provided by the model"
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):
...
@@ -12,7 +12,7 @@ class UpdateWIP(plugin.InputPreparationPlugin):
def
getWIPIds
(
self
):
def
getWIPIds
(
self
):
"""returns the ids of the parts that are in the WIP dictionary"""
"""returns the ids of the parts that are in the WIP dictionary"""
wipIDs
=
[]
wipIDs
=
[]
for
key
in
self
.
data
[
"input"
][
"BOM"
].
get
(
"WIP"
,
{}).
keys
()
for
key
in
self
.
data
[
"input"
][
"BOM"
].
get
(
"WIP"
,
{}).
keys
()
:
wipIDs
.
append
(
key
)
wipIDs
.
append
(
key
)
return
wipIDs
return
wipIDs
...
@@ -91,7 +91,7 @@ class UpdateWIP(plugin.InputPreparationPlugin):
...
@@ -91,7 +91,7 @@ class UpdateWIP(plugin.InputPreparationPlugin):
# # if the design is not complete
# # if the design is not complete
else
:
else
:
# # if the component is design then put it at the start of its route
# # 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
insertWIPitem
=
True
# # if the completed components include all the components (exclude mould and design)
# # if the completed components include all the components (exclude mould and design)
if
len
(
completedComponents
)
==
len
(
orderComponents
)
-
2
:
if
len
(
completedComponents
)
==
len
(
orderComponents
)
-
2
:
...
...
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