2024-05-25 20:34:02 +02:00
|
|
|
from random import choice as rd
|
2024-06-05 20:43:42 +02:00
|
|
|
|
2024-05-25 20:34:02 +02:00
|
|
|
from classes.trashFunctions import generatePicList
|
2024-03-25 11:21:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
class Trash:
|
2024-05-27 10:36:48 +02:00
|
|
|
tdic = {"paper": 1,
|
|
|
|
"bio_waste": 0,
|
|
|
|
"mixed": 4,
|
|
|
|
"glass": 3,
|
|
|
|
"metals_and_plastics": 2}
|
|
|
|
|
2024-05-25 20:34:02 +02:00
|
|
|
def __init__(self):
|
|
|
|
self.tree_type = 0
|
|
|
|
self.ttype = "Trash"
|
|
|
|
self.real_type = "Trash"
|
|
|
|
self.scan_id = 0
|
|
|
|
self.waga = 1
|
|
|
|
self.image = None
|
|
|
|
|
|
|
|
def getRealtype(self):
|
|
|
|
return self.real_type
|
|
|
|
|
|
|
|
def getScanid(self):
|
|
|
|
return self.scan_id
|
2024-03-25 11:21:23 +01:00
|
|
|
|
2024-05-13 15:05:11 +02:00
|
|
|
def getTreetype(self):
|
2024-05-25 20:34:02 +02:00
|
|
|
return self.tree_type
|
2024-05-13 15:05:11 +02:00
|
|
|
|
|
|
|
def setTreetype(self, treetype):
|
2024-05-27 10:36:48 +02:00
|
|
|
self.tree_type = treetype
|
2024-05-13 15:05:11 +02:00
|
|
|
return self
|
|
|
|
|
2024-03-25 14:57:24 +01:00
|
|
|
def getTtype(self):
|
|
|
|
return self.ttype
|
|
|
|
|
|
|
|
def setTtype(self, ttype):
|
|
|
|
self.ttype = ttype
|
2024-05-27 10:36:48 +02:00
|
|
|
self.setTreetype(self.tdic[ttype])
|
2024-03-25 14:57:24 +01:00
|
|
|
return self
|
|
|
|
|
2024-03-25 11:21:23 +01:00
|
|
|
def getWaga(self):
|
|
|
|
return self.waga
|
|
|
|
|
|
|
|
def setWaga(self, waga):
|
|
|
|
self.waga = waga
|
|
|
|
return self
|
|
|
|
|
|
|
|
def getImage(self):
|
|
|
|
return self.image
|
|
|
|
|
|
|
|
def setImage(self, image):
|
|
|
|
self.image = image
|
|
|
|
return self
|
|
|
|
|
|
|
|
|
|
|
|
class Papier(Trash):
|
2024-05-25 20:34:02 +02:00
|
|
|
lista_obrazow = generatePicList("paper")
|
|
|
|
|
2024-03-25 11:21:23 +01:00
|
|
|
def __init__(self):
|
2024-05-25 20:34:02 +02:00
|
|
|
super().__init__()
|
|
|
|
self.tree_type = 1
|
2024-06-05 20:43:42 +02:00
|
|
|
self.ttype = "paper"
|
2024-05-25 20:34:02 +02:00
|
|
|
self.real_type = "Papier"
|
|
|
|
self.scan_id = 0
|
2024-03-25 11:21:23 +01:00
|
|
|
self.waga = 2
|
|
|
|
self.image = None
|
2024-05-25 20:34:02 +02:00
|
|
|
self.setImage(rd(self.lista_obrazow))
|
2024-03-25 11:21:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
class MetalPlastik(Trash):
|
2024-05-25 20:34:02 +02:00
|
|
|
lista_obrazow = generatePicList("plastic")
|
|
|
|
|
2024-03-25 11:21:23 +01:00
|
|
|
def __init__(self):
|
2024-05-25 20:34:02 +02:00
|
|
|
super().__init__()
|
|
|
|
self.tree_type = 2
|
2024-06-05 20:43:42 +02:00
|
|
|
self.ttype = "metals_and_plastics"
|
2024-05-25 20:34:02 +02:00
|
|
|
self.real_type = "MetalPlastik"
|
|
|
|
self.scan_id = 4
|
2024-03-25 11:21:23 +01:00
|
|
|
self.waga = 3
|
|
|
|
self.image = None
|
2024-05-25 20:34:02 +02:00
|
|
|
self.setImage(rd(self.lista_obrazow))
|
2024-03-25 11:21:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
class Mixed(Trash):
|
2024-05-25 20:34:02 +02:00
|
|
|
lista_obrazow = generatePicList("mixed")
|
|
|
|
|
2024-03-25 11:21:23 +01:00
|
|
|
def __init__(self):
|
2024-05-25 20:34:02 +02:00
|
|
|
super().__init__()
|
|
|
|
self.tree_type = 4
|
2024-06-05 20:43:42 +02:00
|
|
|
self.ttype = "mixed"
|
2024-05-25 20:34:02 +02:00
|
|
|
self.real_type = "Mixed"
|
|
|
|
self.scan_id = 2
|
2024-03-25 11:21:23 +01:00
|
|
|
self.waga = 1
|
|
|
|
self.image = None
|
2024-05-25 20:34:02 +02:00
|
|
|
self.setImage(rd(self.lista_obrazow))
|
2024-03-25 11:21:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
class Bio(Trash):
|
2024-05-25 20:34:02 +02:00
|
|
|
lista_obrazow = generatePicList("bio")
|
|
|
|
|
2024-03-25 11:21:23 +01:00
|
|
|
def __init__(self):
|
2024-05-25 20:34:02 +02:00
|
|
|
super().__init__()
|
|
|
|
self.tree_type = 0
|
2024-06-05 20:43:42 +02:00
|
|
|
self.ttype = "bio"
|
2024-05-25 20:34:02 +02:00
|
|
|
self.real_type = "Bio"
|
|
|
|
self.scan_id = 1
|
2024-03-25 11:21:23 +01:00
|
|
|
self.waga = 2
|
|
|
|
self.image = None
|
2024-05-25 20:34:02 +02:00
|
|
|
self.setImage(rd(self.lista_obrazow))
|
2024-03-25 11:21:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
class Szklo(Trash):
|
2024-05-25 20:34:02 +02:00
|
|
|
lista_obrazow = generatePicList("glass")
|
|
|
|
|
2024-03-25 11:21:23 +01:00
|
|
|
def __init__(self):
|
2024-05-25 20:34:02 +02:00
|
|
|
super().__init__()
|
|
|
|
self.tree_type = 3
|
2024-06-05 20:43:42 +02:00
|
|
|
self.ttype = "glass"
|
2024-05-25 20:34:02 +02:00
|
|
|
self.real_type = "Szklo"
|
|
|
|
self.scan_id = 3
|
2024-03-25 11:21:23 +01:00
|
|
|
self.waga = 5
|
|
|
|
self.image = None
|
2024-05-25 20:34:02 +02:00
|
|
|
self.setImage(rd(self.lista_obrazow))
|