skillDict instead of skills set by ReadJSSkills plugin for opeators

parent 38e3ff76
...@@ -9,6 +9,23 @@ from datetime import datetime ...@@ -9,6 +9,23 @@ from datetime import datetime
from dream.plugins import plugin from dream.plugins import plugin
"""{"CAD": ["ENG", "CAD"],
"CAM": ["CAM"],
"MILL": ["MILL"],
"TURN": ["TURN"],
"DRILL": ["DRILL"],
"EDM": ["EDM"],
"WORK": ["QUAL", "ASSM", "MAN"],
"INJM": ["INJM"]}"""
# list of the available skilss
AVAILABLE_SKILLS_LIST = ["ENG", "CAD", "CAM", "MILL", "MILL-SET", "TURN", "DRILL", "EDM", "EDM-SET", "ASSM", "MAN", "INJM", "INJM-MAN", "INJM-SET", "QUAL"]
# dict of the different operations sets (load/ setup/ processing) as defined in the GUI
SKILLS_DICT = {
"load": [],
"process": ["ENG", "CAD", "CAM", "MILL", "TURN", "DRILL", "EDM", "ASSM", "MAN", "INJM", "INJM-MAN", "QUAL"],
"setup": ["MILL-SET", "EDM-SET", "INJM-SET"]
}
class ReadJSSkills(plugin.InputPreparationPlugin): class ReadJSSkills(plugin.InputPreparationPlugin):
""" Input preparation """ Input preparation
reads the operators and their skills from the spreadsheet and adds them to the model reads the operators and their skills from the spreadsheet and adds them to the model
...@@ -31,13 +48,22 @@ class ReadJSSkills(plugin.InputPreparationPlugin): ...@@ -31,13 +48,22 @@ class ReadJSSkills(plugin.InputPreparationPlugin):
skills=PBitem[1].replace(" ","").split(';') skills=PBitem[1].replace(" ","").split(';')
if len(skills)==1: if len(skills)==1:
PBitem[1].replace(" ","").split(',') PBitem[1].replace(" ","").split(',')
skillDict = {
"load": [],
"process": [],
"setup": []
}
for skill in skills:
for operation, availableSkills in SKILLS_DICT.iteritems():
if skill in availableSkills:
skillDict[operation].append(skill)
node[PBId]={ node[PBId]={
"_class": "Dream.Operator", "_class": "Dream.Operator",
"capacity": 1, "capacity": 1,
"name":PBId, "name":PBId,
"skills":skills, "skillDict":skillDict,
"ouputSchedule" : 1 "ouputSchedule" : 1
} }
return data return data
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment