diff --git a/Barcode_Reader_Python/.idea/workspace.xml b/Barcode_Reader_Python/.idea/workspace.xml index e0aab74..39d6ba3 100644 --- a/Barcode_Reader_Python/.idea/workspace.xml +++ b/Barcode_Reader_Python/.idea/workspace.xml @@ -2,11 +2,11 @@ - - + - + + - + - - + + @@ -39,34 +40,29 @@ - - - - - - - + + - - + + - - + + - - + + - - + + - - + + @@ -102,6 +98,8 @@ @@ -160,7 +158,7 @@ - + - + - + - + - + - + @@ -335,7 +333,7 @@ - + @@ -343,7 +341,7 @@ - + @@ -436,13 +434,6 @@ - - - - - - - @@ -450,25 +441,46 @@ + + + - + - - - - - + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Barcode_Reader_Python/database_actions.py b/Barcode_Reader_Python/database_actions.py index 901111a..a3cbe68 100755 --- a/Barcode_Reader_Python/database_actions.py +++ b/Barcode_Reader_Python/database_actions.py @@ -11,17 +11,10 @@ firebase = pyrebase.initialize_app(config) auth = firebase.auth() -user = auth.sign_in_with_email_and_password('yigitcolakohlu@gmail.com', 'Ygtclksbl1') +user = auth.sign_in_with_email_and_password('yigitcolakohlu@gmail.com', 'FoodWro2018') db = firebase.database() - -data_format_prod = {'Prod_Name':None, 'BBD':None,'Nutrients':[],'Calories':0,'Allergens':[],'Problematic':False,'Process':None, 'ED':None} -data_format_proc = {'Harvested':{'Date':'','Location':'','Product':''},'Transport1':{'Duration':0,'Moved to,from':'-','Condition':True,'Stopped':False},'Process':{'Location':'','Processes':''},'Transport2':{'Duration':0,'Moved to,from':'-','Condition':0,'Stopped':False},'Packaging':{'Location':'','Material':'','Cancerogen':True}} - -data_2_prod = {'Prod_Name':"Chocolate", 'BBD':"28.01.2019",'Nutrients':['Lactose','Glucose','Cocoa'],'Calories':180,'Cooked':False,'Allergens':[""],'Problematic':False,'Process':''} -data_1_prod = {'Prod_Name':"Milk", 'BBD':"24.08.2018",'Nutrients':['Protein','Fat','Lactose','Glucose'],'Calories':120,'Cooked':False,'Allergens':['Lactose'],'Problematic':False,'Process':'Pastorized'} -data_2_proc = {'Harvested':{'Date':'24.04.2018','Location':'','Product':''},'Transport1':{'Duration':0,'Moved to,from':'-','Condition':0,'Stopped':False},'Process':{'Location':'','Processes':''},'Transport1':{'Duration':0,'Moved to,from':'-','Condition':0,'Stopped':False},'Packaging':{'Location':'','Material':'','Cancerogen':''}} database_content = db.child("Products").get().val() def getDate(product): diff --git a/Barcode_Reader_Python/database_append.py b/Barcode_Reader_Python/database_append.py new file mode 100644 index 0000000..446e11d --- /dev/null +++ b/Barcode_Reader_Python/database_append.py @@ -0,0 +1,58 @@ +import pyrebase + +config = { + "apiKey": "AIzaSyD3bXRjLxEAVOKtj8hpjO4iI3Nn32F7agU", + "authDomain": "foodcloud-f6eb1.firebaseapp.com", + "databaseURL": "https://foodcloud-f6eb1.firebaseio.com/", + "storageBucket": "foodcloud-f6eb1.appspot.com" +} + +firebase = pyrebase.initialize_app(config) + +auth = firebase.auth() + +user = auth.sign_in_with_email_and_password('yigitcolakohlu@gmail.com', 'FoodWro2018') + +db = firebase.database() + +data_format_prod = {'Prod_Name': None, 'BBD': None, 'Nutrients': [], 'Calories': 0, 'Allergens': [], + 'Problematic': False, 'Process': None, 'ED': None} + +data_format_proc = {'Harvested': {'Date': '', 'Location': '', 'Product': ''}, + 'Transport1': {'Duration': 0, 'Moved to,from': '-', 'Condition': True, 'Stopped': False}, + 'Process': {'Location': '', 'Processes': ''}, + 'Transport2': {'Duration': 0, 'Moved to,from': '-', 'Condition': 0, 'Stopped': False}, + 'Packaging': {'Location': '', 'Material': '', 'Cancerogen': True}} + +data_1_prod = {'Prod_Name': "Milk", 'BBD': "24.08.2018", 'Nutrients': ['Protein', 'Fat', 'Lactose', 'Glucose'], + 'Calories': 120, 'Cooked': False, 'Allergens': ['Lactose'], 'Problematic': False, + 'Process': 'Pastorized'} + +data_2_prod = {'Prod_Name': "Chocolate", 'BBD': "28.01.2019", 'Nutrients': ['Lactose', 'Glucose', 'Cocoa'], + 'Calories': 180, 'Cooked': False, 'Allergens': [""], 'Problematic': False, 'Process': ''} + +data_1_proc = {'Harvested': {'Date': '18.08.2018', 'Location': 'Larson Family', + 'Product': 'Raw Milk'}, + 'Transport1': {'Duration': 9, 'Moved to,from': 'Larson Family-McCarty Family Farms', 'Condition': True, + 'Stopped': True}, 'Process': {'Location': 'McCarty Family Farms', + 'Processes': 'Reverse Osmosis,Nanofiltration,Ultrafiltration,Microfiltration'}, + 'Transport2': {'Duration': 13, 'Moved to,from': 'McCarty Family Farms-JJX Packaging', 'Condition': True, + 'Stopped': True}, + 'Packaging': {'Location': 'JJX Packaging', 'Material': 'Carton', 'Cancerogen': False}} + +data_2_proc = {'Harvested': {'Date': '27.01.2018', 'Location': 'India', + 'Product': 'Cocoa'}, + 'Transport1': {'Duration': 71, 'Moved to,from': 'India-Nestle ', 'Condition': True, 'Stopped': True}, + 'Process': {'Location': 'Nestle', 'Processes': 'Roasting,Pulp,Conching,Moulding'}, + 'Transport2': {'Duration': 4, 'Moved to,from': 'Nestle-Ulma Packaging', 'Condition': True, + 'Stopped': False}, + 'Packaging': {'Location': 'Ulma Packaging', 'Material': 'Foil', 'Cancerogen': False}} + +Products = [data_1_prod, data_2_prod] +Processes = [data_1_proc, data_2_proc] + +for i in range(len(Products)): + db.child("Products").child(str(i + 1)).set(Products[i]) + +for i in range(len(Processes)): + db.child("Processes").child(str(i + 1)).set(Processes[i]) diff --git a/Barcode_Reader_Python/main.py b/Barcode_Reader_Python/main.py index 5f91c4b..68ec2a3 100755 --- a/Barcode_Reader_Python/main.py +++ b/Barcode_Reader_Python/main.py @@ -85,8 +85,7 @@ while reps<1: break print("[INFO] cleaning up...") -print dates -print generate_moves.generate(dates,current_date) - +moves = generate_moves.generate(dates,current_date) +#move(moves) cv2.destroyAllWindows() vs.stop() \ No newline at end of file diff --git a/Barcode_Reader_Python/move.py b/Barcode_Reader_Python/move.py deleted file mode 100644 index 8b13789..0000000 --- a/Barcode_Reader_Python/move.py +++ /dev/null @@ -1 +0,0 @@ -