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
0d2afafb
Commit
0d2afafb
authored
Aug 24, 2015
by
panos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A plug-in added to extract WIP from WIP reports
parent
9b94ba5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
87 additions
and
0 deletions
+87
-0
dream/KnowledgeExtraction/PilotCases/BatchModel/WIPExtraction.py
...nowledgeExtraction/PilotCases/BatchModel/WIPExtraction.py
+87
-0
No files found.
dream/KnowledgeExtraction/PilotCases/BatchModel/WIPExtraction.py
0 → 100644
View file @
0d2afafb
'''
Created on 24 Aug 2015
@author: Panos
'''
import
xlrd
#Read from the given directory the Excel document with the input data
workbook
=
xlrd
.
open_workbook
(
'WIP_test report.xls'
)
worksheets
=
workbook
.
sheet_names
()
main
=
workbook
.
sheet_by_name
(
'WIP & Static Detail Section'
)
worksheet_WIP
=
worksheets
[
0
]
#Define the worksheet with the production data
# columns that are used (static)
CONTAINERNAME
=
0
STATIONNAME
=
16
WORKCELL
=
17
def
findStation
(
dictStory
):
for
key
,
value
in
dictStory
.
iteritems
():
if
value
[
0
]
==
"Proximal Balloon Attach-CREFW"
and
value
[
1
]
==
"CRE FW FRONT END LINE 1"
:
dictStory
[
key
]
=
[]
dictStory
[
key
].
append
(
"2_P_B_A_A"
)
elif
value
[
0
]
==
"Proximal Balloon Attach-CREFW"
and
value
[
1
]
==
"CRE FW FRONT END LINE 2"
:
dictStory
[
key
]
=
[]
dictStory
[
key
].
append
(
"2_P_B_A_B"
)
elif
value
[
0
]
==
"RO/Exit Marker-CREFW"
and
value
[
1
]
==
"CRE FW FRONT END LINE 1"
:
dictStory
[
key
]
=
[]
dictStory
[
key
].
append
(
"1_RO_E_M_A_A"
)
elif
value
[
0
]
==
"RO/Exit Marker-CREFW"
and
value
[
1
]
==
"CRE FW FRONT END LINE 2"
:
dictStory
[
key
]
=
[]
dictStory
[
key
].
append
(
"1_RO_E_M_A_B"
)
elif
value
[
0
]
==
"Distal Balloon Attach-CREFW"
and
value
[
1
]
==
"CRE FW FRONT END LINE 1"
:
dictStory
[
key
]
=
[]
dictStory
[
key
].
append
(
"3_D_B_A_A"
)
elif
value
[
0
]
==
"Distal Balloon Attach-CREFW"
and
value
[
1
]
==
"CRE FW FRONT END LINE 2"
:
dictStory
[
key
]
=
[]
dictStory
[
key
].
append
(
"3_D_B_A_B"
)
elif
value
[
0
]
==
"Carding Cell-CREFW"
:
dictStory
[
key
]
=
[]
dictStory
[
key
].
append
(
"8_Carding"
)
elif
value
[
0
]
==
"Flag Label Attach-CREFW"
:
dictStory
[
key
]
=
[]
dictStory
[
key
].
append
(
"6_Flag Labelling"
)
elif
value
[
0
]
==
"Pressure Test-CREFW"
and
value
[
1
]
==
"CRE FW BACK END LINE 2"
:
dictStory
[
key
]
=
[]
dictStory
[
key
].
append
(
"7_Pressure B"
)
elif
value
[
0
]
==
"Pressure Test-CREFW"
and
value
[
1
]
==
"CRE FW BACK END LINE 1"
:
dictStory
[
key
]
=
[]
dictStory
[
key
].
append
(
"7_Pressure A"
)
elif
value
[
0
]
==
"Moulding Cell-CREFW"
:
dictStory
[
key
]
=
[]
dictStory
[
key
].
append
(
"5_Moulding"
)
elif
value
[
0
]
==
"Cut and Bend Corewire"
:
dictStory
[
key
]
=
[]
dictStory
[
key
].
append
(
"4_Cut & Bend"
)
elif
value
[
0
]
==
"Fixed Wire Pack Cell 1-CREFW"
and
value
[
1
]
==
"CRE FW BACK END LINE 1"
:
dictStory
[
key
]
=
[]
dictStory
[
key
].
append
(
"9_Packaging A"
)
elif
value
[
0
]
==
"Fixed Wire Pack Cell 2-CRE"
and
value
[
1
]
==
"CRE FW BACK END LINE 2"
:
dictStory
[
key
]
=
[]
dictStory
[
key
].
append
(
"9_Packaging B"
)
return
dictStory
contIds
=
[]
contDetails
=
{}
for
sheet
in
workbook
.
sheets
():
if
worksheet_WIP
:
for
i
in
range
(
1
,
main
.
nrows
):
Id
=
main
.
cell
(
i
,
CONTAINERNAME
).
value
if
not
Id
in
contIds
:
contIds
.
append
(
Id
)
contDetails
[
Id
]
=
[]
statName
=
main
.
cell
(
i
,
STATIONNAME
).
value
workcell
=
main
.
cell
(
i
,
WORKCELL
).
value
contDetails
[
Id
].
append
(
statName
)
contDetails
[
Id
].
append
(
workcell
)
print
findStation
(
contDetails
)
\ No newline at end of file
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