Commit 6d879bf5 authored by panos's avatar panos

Scripts are modified

parent d5112e95
...@@ -14,6 +14,9 @@ class JobShopKE(plugin.InputPreparationPlugin): ...@@ -14,6 +14,9 @@ class JobShopKE(plugin.InputPreparationPlugin):
def preprocess(self, data): def preprocess(self, data):
from dream.KnowledgeExtraction.PilotCases.JobShop.DataExtraction import DataExtraction from dream.KnowledgeExtraction.PilotCases.JobShop.DataExtraction import DataExtraction
receivedData = DataExtraction("C:\Users\Panos\Documents\DB_Approach\JobShop") receivedData = DataExtraction("C:\Users\Panos\Documents\DB_Approach\JobShop")
outputJSONString=json.dumps(receivedData, indent=True)
outputJSONFile=open('dataFromSQL.json', mode='w')
outputJSONFile.write(outputJSONString)
data['input']['BOM'] = receivedData data['input']['BOM'] = receivedData
return data return data
...@@ -51,7 +51,7 @@ class UpdateStationList(plugin.InputPreparationPlugin): ...@@ -51,7 +51,7 @@ class UpdateStationList(plugin.InputPreparationPlugin):
self.data = data self.data = data
orders = data["input"].get("BOM",{}).get("productionOrders",{}) orders = data["input"].get("BOM",{}).get("productionOrders",{})
try: try:
stations = data["input"]["BOM"]['stations'] stations = data["input"]["BOM"]['stations1']
except: except:
stations = self.getStationNames() stations = self.getStationNames()
nodes = data["graph"]["node"] nodes = data["graph"]["node"]
...@@ -66,6 +66,7 @@ class UpdateStationList(plugin.InputPreparationPlugin): ...@@ -66,6 +66,7 @@ class UpdateStationList(plugin.InputPreparationPlugin):
step["technology"] = technology step["technology"] = technology
technologyStations = [] technologyStations = []
for station in stations: for station in stations:
station = station.replace(" ", "").split("-")[0]
for initials in self.getStationInitials(technology): for initials in self.getStationInitials(technology):
if station.startswith(initials)\ if station.startswith(initials)\
and data["graph"]["node"][station]["_class"] in self.STATION_CLASS_SET: and data["graph"]["node"][station]["_class"] in self.STATION_CLASS_SET:
......
...@@ -160,7 +160,8 @@ class PluginRegistry(object): ...@@ -160,7 +160,8 @@ class PluginRegistry(object):
outputJSONString=json.dumps(data, indent=5) outputJSONString=json.dumps(data, indent=5)
outputJSONFile=open('sentToManPy.json', mode='w') outputJSONFile=open('sentToManPy.json', mode='w')
outputJSONFile.write(outputJSONString) outputJSONFile.write(outputJSONString)
data = self.execution_plugin.run(data) data = self.execution_plugin.run(data)
for output_preparation in self.output_preparation_list: for output_preparation in self.output_preparation_list:
......
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