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
50cd3378
Commit
50cd3378
authored
Feb 19, 2015
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ReadJSWorkPlan plugin corrected
parent
87375166
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
14 deletions
+21
-14
dream/plugins/ReadJSWorkPlan.py
dream/plugins/ReadJSWorkPlan.py
+21
-14
No files found.
dream/plugins/ReadJSWorkPlan.py
View file @
50cd3378
...
...
@@ -5,7 +5,6 @@ import random
import
operator
from
datetime
import
datetime
import
copy
import
routeQuery
from
dream.plugins
import
plugin
...
...
@@ -31,36 +30,44 @@ class ReadJSWorkPlan(plugin.InputPreparationPlugin):
""" inserts the retrieved order components and the related information (routing) to the BOM echelon
"""
self
.
data
=
data
WPdata
=
data
[
"input"
][
"workplan_spreadsheet"
]
WPdata
=
data
[
"input"
].
get
(
"workplan_spreadsheet"
,[])
orders
=
data
[
"input"
][
"BOM"
].
get
(
"orders"
,{})
if
WPdata
:
WPdata
.
pop
(
0
)
# pop the column names
for
line
in
WPdata
:
orderID
=
WPdata
[
1
]
orderID
=
line
[
1
]
order
=
self
.
findEntityByID
(
orderID
)
# if the order is not defined then skip this part
if
not
order
:
continue
partID
=
WPdata
[
0
]
partID
=
line
[
0
]
part
=
self
.
findEntityByID
(
partID
)
# if there is no such part in the BOM then create it
if
not
part
:
partName
=
WPdata
[
2
]
partName
=
line
[
2
]
components
=
order
.
get
(
"componentsList"
,[])
components
.
append
({
# the part is brand new
part
=
{
"componentID"
:
partID
,
"componentName"
:
partName
})
}
components
.
append
(
part
)
order
[
"componentsList"
]
=
components
# update the route of the component
route
=
part
.
get
(
"route"
,
[])
task_id
=
WPdata
[
-
1
]
sequence
=
WPdata
[
4
]
processingTime
=
WPdata
[
-
4
]
operator
=
WPdata
[
5
]
partsneeded
=
WPdata
[
-
2
].
replace
(
" "
,
""
).
split
(
','
)
technology
=
WPdata
[
3
]
quantity
=
WPdata
[
6
]
task_id
=
line
[
-
1
]
sequence
=
line
[
4
]
processingTime
=
line
[
-
4
]
operator
=
line
[
5
]
partsneeded
=
line
[
-
3
]
# if there are requested parts then split them
if
partsneeded
:
partsneeded
=
partsneeded
.
replace
(
" "
,
""
).
split
(
','
)
else
:
partsneeded
=
[
""
]
technology
=
line
[
3
]
quantity
=
line
[
6
]
# append the current step to the route of the part
route
.
append
({
"task_id"
:
task_id
,
"sequence"
:
sequence
,
...
...
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