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
12dd0bb1
Commit
12dd0bb1
authored
Mar 26, 2015
by
panos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Data Extraction updated to its latest version
parent
d2bbb33b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
5 deletions
+35
-5
dream/KnowledgeExtraction/PilotCases/CapacityStations/DataExtraction.py
...eExtraction/PilotCases/CapacityStations/DataExtraction.py
+35
-5
No files found.
dream/KnowledgeExtraction/PilotCases/CapacityStations/DataExtraction.py
View file @
12dd0bb1
...
...
@@ -136,6 +136,7 @@ def DataExtraction(DBFilePath):
step
=
{}
ind4
=
d
.
fetchone
()
process
=
ind4
.
Operation_Name
orderID
=
ind3
.
Order_id
task
=
ind4
.
WP_id
#create another dictionary in step dictionary and insert the following attributes
step
[
process
]
=
{}
...
...
@@ -144,6 +145,29 @@ def DataExtraction(DBFilePath):
step
[
process
][
'requiredCapacity'
]
=
ind4
.
CapacityRequirement
step
[
process
][
'earliestStart'
]
=
str
(
ind4
.
EarliestStart
)
order
[
'sequence'
].
append
(
step
)
if
status
==
'accepted'
or
status
==
'in progress'
:
if
process
==
'SMF'
:
data
[
'WIP'
][
'startBuffered.SMF_id'
+
orderID
]
=
{}
data
[
'WIP'
][
'startBuffered.SMF_id'
+
orderID
][
'operation'
]
=
process
data
[
'WIP'
][
'startBuffered.SMF_id'
+
orderID
][
'buffered'
]
=
ind4
.
CapacityRequirement
data
[
'WIP'
][
'startBuffered.SMF_id'
+
orderID
][
'order_id'
]
=
ind3
.
Order_id
elif
process
==
'CNC'
:
data
[
'WIP'
][
'startBuffered.CNC_id'
+
orderID
]
=
{}
data
[
'WIP'
][
'startBuffered.CNC_id'
+
orderID
][
'operation'
]
=
process
data
[
'WIP'
][
'startBuffered.CNC_id'
+
orderID
][
'buffered'
]
=
ind4
.
CapacityRequirement
data
[
'WIP'
][
'startBuffered.CNC_id'
+
orderID
][
'order_id'
]
=
ind3
.
Order_id
elif
process
==
'MCH'
:
data
[
'WIP'
][
'startBuffered.MCH_id'
+
orderID
]
=
{}
data
[
'WIP'
][
'startBuffered.MCH_id'
+
orderID
][
'operation'
]
=
process
data
[
'WIP'
][
'startBuffered.MCH_id'
+
orderID
][
'buffered'
]
=
ind4
.
CapacityRequirement
data
[
'WIP'
][
'startBuffered.MCH_id'
+
orderID
][
'order_id'
]
=
ind3
.
Order_id
elif
process
==
'EEP'
:
data
[
'WIP'
][
'startBuffered.EEP_id'
+
orderID
]
=
{}
data
[
'WIP'
][
'startBuffered.EEP_id'
+
orderID
][
'operation'
]
=
process
data
[
'WIP'
][
'startBuffered.EEP_id'
+
orderID
][
'buffered'
]
=
ind4
.
CapacityRequirement
data
[
'WIP'
][
'startBuffered.EEP_id'
+
orderID
][
'order_id'
]
=
ind3
.
Order_id
else
:
continue
#SQL query that extracts data from production_status table, joining the sequence and production_status table in WP_id attribute, in order to retrieve that WIP
e
=
cursor
[
5
].
execute
(
"""
...
...
@@ -202,7 +226,8 @@ def DataExtraction(DBFilePath):
if
operation
==
'SMF'
and
not
ind5
.
END_DATE
:
finishedCap
=
ind5
.
CapacityRequirement
-
ind5
.
Capacity_left
startWELD
=
float
(
key
)
*
float
(
finishedCap
)
try
:
try
:
del
data
[
'WIP'
][
'startBuffered.SMF_id'
+
orderID
]
data
[
'WIP'
][
'WELD_id'
+
orderID
][
'operation'
]
=
'WELD'
data
[
'WIP'
][
'WELD_id'
+
orderID
][
'buffered'
]
=
startWELD
data
[
'WIP'
][
'WELD_id'
+
orderID
][
'order_id'
]
=
orderID
...
...
@@ -234,6 +259,7 @@ def DataExtraction(DBFilePath):
if
operation
==
'CNC'
:
try
:
cncfinishedCap
=
ind5
.
CapacityRequirement
-
ind5
.
Capacity_left
del
data
[
'WIP'
][
'startBuffered.CNC_id'
+
orderID
]
data
[
'WIP'
][
'PPASB_id'
+
orderID
][
'operation'
]
=
'PPASB'
data
[
'WIP'
][
'PPASB_id'
+
orderID
][
'order_id'
]
=
orderID
if
weldfinishedCap
or
mchfinishedCap
:
...
...
@@ -254,6 +280,7 @@ def DataExtraction(DBFilePath):
if
operation
==
'MCH'
:
try
:
mchfinishedCap
=
ind5
.
CapacityRequirement
-
ind5
.
Capacity_left
del
data
[
'WIP'
][
'startBuffered.MCH_id'
+
orderID
]
data
[
'WIP'
][
'PPASB_id'
+
orderID
][
'operation'
]
=
'PPASB'
data
[
'WIP'
][
'PPASB_id'
+
orderID
][
'order_id'
]
=
orderID
if
weldfinishedCap
or
cncfinishedCap
:
...
...
@@ -269,7 +296,10 @@ def DataExtraction(DBFilePath):
FinishedCap
=
mchfinishedCap
data
[
'WIP'
][
'PPASB_id'
+
orderID
][
'buffered'
]
=
FinishedCap
except
KeyError
:
continue
return
data
continue
if
operation
==
'EEP'
:
try
:
del
data
[
'WIP'
][
'startBuffered.EEP_id'
+
orderID
]
except
KeyError
:
continue
return
data
\ 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