from random import choice as rd from classes.trashFunctions import generatePicList class Trash: tdic = {"paper": 1, "bio_waste": 0, "mixed": 4, "glass": 3, "metals_and_plastics": 2} 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 def getTreetype(self): return self.tree_type def setTreetype(self, treetype): self.tree_type = treetype return self def getTtype(self): return self.ttype def setTtype(self, ttype): self.ttype = ttype self.setTreetype(self.tdic[ttype]) return self 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): lista_obrazow = generatePicList("paper") def __init__(self): super().__init__() self.tree_type = 1 self.ttype = "paper" self.real_type = "Papier" self.scan_id = 0 self.waga = 2 self.image = None self.setImage(rd(self.lista_obrazow)) class MetalPlastik(Trash): lista_obrazow = generatePicList("plastic") def __init__(self): super().__init__() self.tree_type = 2 self.ttype = "metals_and_plastics" self.real_type = "MetalPlastik" self.scan_id = 4 self.waga = 3 self.image = None self.setImage(rd(self.lista_obrazow)) class Mixed(Trash): lista_obrazow = generatePicList("mixed") def __init__(self): super().__init__() self.tree_type = 4 self.ttype = "mixed" self.real_type = "Mixed" self.scan_id = 2 self.waga = 1 self.image = None self.setImage(rd(self.lista_obrazow)) class Bio(Trash): lista_obrazow = generatePicList("bio") def __init__(self): super().__init__() self.tree_type = 0 self.ttype = "bio" self.real_type = "Bio" self.scan_id = 1 self.waga = 2 self.image = None self.setImage(rd(self.lista_obrazow)) class Szklo(Trash): lista_obrazow = generatePicList("glass") def __init__(self): super().__init__() self.tree_type = 3 self.ttype = "glass" self.real_type = "Szklo" self.scan_id = 3 self.waga = 5 self.image = None self.setImage(rd(self.lista_obrazow))