LamML commited on
Commit
6068c8c
·
verified ·
1 Parent(s): ef4d4e0

Upload calcules.py

Browse files
Files changed (1) hide show
  1. utils/calcules.py +110 -0
utils/calcules.py ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Module qui effectue les calcules pour les dosages
3
+ """
4
+ #----------- Variables -------------
5
+ '''
6
+ PRODUCTS=[
7
+ "TH5",
8
+ "Aldecoc CMK",
9
+ "Virkon LSP",
10
+ "Aldekol DES FF",
11
+ "BioVX"
12
+ ]
13
+
14
+ APPLICATION=[
15
+ "thermal fogging",
16
+ "spraying",
17
+ "foaming"
18
+ ]
19
+
20
+ ANIMAL=[
21
+ "Volaille",
22
+ "Porcin"
23
+ ]
24
+
25
+ TYPE_DE_SOL=[
26
+ "Terre",
27
+ "Béton"
28
+ ]
29
+
30
+ SURFACE = int
31
+ '''
32
+ #----------- Fonction globale -------------
33
+
34
+ def cal_global(produit = None, application=None,
35
+ animal=None, surface = None,
36
+ type_de_sol = None):
37
+
38
+ if produit.lower() == "th5":
39
+ return cal_th5(animal=animal.lower(), surface=surface,
40
+ application=application.lower(), type_de_sol=type_de_sol.lower())
41
+ if produit.lower() == "aldecoc cmk":
42
+ return cal_aldecoc_cmk(surface=surface)
43
+
44
+ if produit.lower() == "virkon lsp":
45
+ return cal_virkon_lsp(surface=surface, application=application.lower(),
46
+ animal=animal.lower())
47
+ if produit.lower() == "aldekol des ff":
48
+ cal_aldekol_des_ff(application=application.lower(), surface=surface,
49
+ animal=animal.lower())
50
+ if produit.lower() == "biovx":
51
+ return cal_biovx(animal=animal.lower(), surface=surface)
52
+
53
+ #----------- Fonction par produit -------------
54
+
55
+ def cal_th5(animal = None, surface=None,
56
+ application = None, type_de_sol=None):
57
+
58
+ if application == "thermal fogging":
59
+ return f"La quantité de TH5 dilué à 1% est de {surface*3.5}L ou { (surface*3.5)/100}L pur"
60
+
61
+ if animal == "volaille" :
62
+ if type_de_sol == "verre":
63
+ return f"La quantité de TH5 dilué à 1% est de {(surface*1.5) * 0.3}L ou { ((surface*1.5) * 0.3)/100}L pur"
64
+ if type_de_sol == "béton":
65
+ return f"La quantité de TH5 dilué à 1% est de {(surface*2.5) * 0.3}L ou { ((surface*2.5) * 0.3)/100}L pur"
66
+
67
+
68
+ if animal == "porcin":
69
+ return f"La quantité de TH5 dilué à 1% est de {surface * 0.3}L ou { ((surface*2.5) * 0.3)/100}L pur"
70
+
71
+
72
+ def cal_aldecoc_cmk(surface = None):
73
+
74
+ # Info obligatoire
75
+
76
+ return f"Pour les volailles, avec un application au spraying, la quantité d'Aldecoc CMK dikué à 2% sera de { (surface*1.2)*0.4}L ou {((surface*1.2)*0.4)/100} "
77
+
78
+
79
+ def cal_virkon_lsp(surface = None, application = None,
80
+ animal = None):
81
+
82
+ if application == "thermal fogging" :
83
+ return f"Pour un nettoyage en thermal fogging, il faudra {(surface/100)*4.59}L d'eau avec {(surface/100)*0.51} de produit concentré"
84
+ if application == "spraying" :
85
+ return f"Pour un nettoyage au spraying, la quantité de Virkon LSP dilué à 1% est de {surface*0.3}L "
86
+ if animal == "porcin":
87
+ return f"La quantité de Virkon LSP dilué à 1% est de {surface * 0.3}L ou { ((surface*2.5) * 0.3)/100}L pur"
88
+
89
+ def cal_aldekol_des_ff(application = None, surface = None,
90
+ animal = None):
91
+
92
+ if animal == "porcin":
93
+ return f"Pour du porcin, il faudra {surface*0.3}L de produit dilué à 1%"
94
+
95
+ if application == "thermal fogging" :
96
+ return f"La quantité TH-Gold pour du thermal fogging est de {surface*0.00525}L de solution du produit pour {surface*0.105}L d'eau"
97
+ if application == "spraying" :
98
+ return f"La quantité d'Aldekol DES FF pour du spraying est de {surface*0.3}L de produit"
99
+ if application == "foaming" :
100
+ return f"La quantité d'Aldekol DES FF pour du foaming est de {surface*0.3}L de produit"
101
+
102
+
103
+ def cal_biovx(animal = None, surface = None):
104
+
105
+ if animal == "porcin":
106
+ return f"Pour des porcins, il faudra {surface*0.3}L de produit dilué à 1%"
107
+ else :
108
+ return f"Il faudra appliquer, en spraying, {surface*0.3}L de produit dilué à 1%"
109
+
110
+