Compare commits
57 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c04fa96ab2 | |||
| cdcfdba82e | |||
| 6433e722e2 | |||
| c9f359b30d | |||
| 5599c9fd14 | |||
| 34dec1e646 | |||
| 6a9c4233e2 | |||
| 88a2ceda45 | |||
| 0981083067 | |||
| b75189fdbf | |||
| 94cee29e10 | |||
| d62e3edac6 | |||
| cb9cfa9e8b | |||
| 3865ddf8f3 | |||
| 6eb0c4411f | |||
| af7c622e2f | |||
| c91289ef9f | |||
| 7ba555890a | |||
| a3d8d9bd0d | |||
| 19ec78289b | |||
| 16170317d1 | |||
| 4e3ea7fad8 | |||
| 6979a66912 | |||
| c30d198c3e | |||
| 1db2b46044 | |||
| 6f18621983 | |||
| d80d816e1c | |||
| fc9267c79c | |||
| f7e7097612 | |||
| 5b72a63b8a | |||
| 673e88d6d3 | |||
| 416c8feff1 | |||
| c5f9763aeb | |||
| 8bb39a4396 | |||
| 636863e207 | |||
| 2093fe9fde | |||
| 3b2fbba025 | |||
| ae0294f774 | |||
| 0547260228 | |||
| 11d9df9606 | |||
| 2749446249 | |||
| 71ce30307b | |||
| 242412dc19 | |||
| c8c4496d4a | |||
| 8a92767293 | |||
| 27aded61fd | |||
| 3e11847964 | |||
| d4596b2eeb | |||
| 9eae600e81 | |||
| 10c13225cc | |||
| adae2623e6 | |||
| df94568376 | |||
| 1be5e787a3 | |||
| 14902379d8 | |||
| 1ac313efa7 | |||
| 002da8f77f | |||
| bd7b1d2533 |
103
cemento.py
103
cemento.py
@@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from flask import Flask, render_template, request, Response
|
from flask import Flask, render_template, request, Response
|
||||||
import math
|
import math
|
||||||
|
import subprocess
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
@@ -10,7 +11,10 @@ def calcola(d):
|
|||||||
val = float(v.replace(',', '.')) if v else 0
|
val = float(v.replace(',', '.')) if v else 0
|
||||||
return val / 1000 if u == "mm" else val / 100 if u == "cm" else val
|
return val / 1000 if u == "mm" else val / 100 if u == "cm" else val
|
||||||
|
|
||||||
vol = to_m(d.get('a','0'), d.get('ua','m')) * to_m(d.get('l','0'), d.get('ul','m')) * to_m(d.get('p','0'), d.get('up','m'))
|
# Salvo le dimensioni originali per il report
|
||||||
|
dim_orig = {"a": d.get('a','0'), "ua": d.get('ua','m'), "l": d.get('l','0'), "ul": d.get('ul','m'), "p": d.get('p','0'), "up": d.get('up','m')}
|
||||||
|
|
||||||
|
vol = to_m(dim_orig['a'], dim_orig['ua']) * to_m(dim_orig['l'], dim_orig['ul']) * to_m(dim_orig['p'], dim_orig['up'])
|
||||||
peso_tot = vol * 2400
|
peso_tot = vol * 2400
|
||||||
|
|
||||||
mats = ['cem', 'sab', 'ghi']
|
mats = ['cem', 'sab', 'ghi']
|
||||||
@@ -19,14 +23,15 @@ def calcola(d):
|
|||||||
c = {m: float(d.get(f'c_{m}', '0').replace(',','.')) for m in mats}
|
c = {m: float(d.get(f'c_{m}', '0').replace(',','.')) for m in mats}
|
||||||
|
|
||||||
somma_p = sum(p.values())
|
somma_p = sum(p.values())
|
||||||
res = {"vol": f"{vol:.3f}", "peso": f"{peso_tot:.0f}"}
|
perc = {m: (p[m]/somma_p)*100 if somma_p > 0 else 0 for m in mats}
|
||||||
|
|
||||||
|
res = {"vol": f"{vol:.3f}", "peso": f"{peso_tot:.0f}", "perc": perc, "dim": dim_orig, "parti": p}
|
||||||
|
|
||||||
tot_s, costo_t = 0, 0
|
tot_s, costo_t = 0, 0
|
||||||
for m in mats:
|
for m in mats:
|
||||||
kg = (p[m]/somma_p)*peso_tot if somma_p > 0 else 0
|
kg = (p[m]/somma_p)*peso_tot if somma_p > 0 else 0
|
||||||
s_esatti = kg/w[m] if w[m] > 0 else 0
|
s_esatti = kg/w[m] if w[m] > 0 else 0
|
||||||
res[f's_{m}'] = math.ceil(s_esatti)
|
res[f's_{m}'] = math.ceil(s_esatti)
|
||||||
res[f'cost_{m}'] = f"{math.ceil(s_esatti)*c[m]:.2f}"
|
|
||||||
tot_s += math.ceil(s_esatti)
|
tot_s += math.ceil(s_esatti)
|
||||||
costo_t += math.ceil(s_esatti)*c[m]
|
costo_t += math.ceil(s_esatti)*c[m]
|
||||||
|
|
||||||
@@ -45,46 +50,66 @@ def calcola(d):
|
|||||||
@app.route('/', methods=['GET', 'POST'])
|
@app.route('/', methods=['GET', 'POST'])
|
||||||
def index():
|
def index():
|
||||||
res = None
|
res = None
|
||||||
if request.method == 'POST': res = calcola(request.form)
|
msg_stampa = None
|
||||||
return render_template('index.html', res=res, form=request.form)
|
if request.method == 'POST':
|
||||||
|
res = calcola(request.form)
|
||||||
|
if 'btn_stampa_cups' in request.form:
|
||||||
|
msg_stampa = esegui_stampa_cups(request.form)
|
||||||
|
return render_template('index.html', res=res, form=request.form, msg_stampa=msg_stampa)
|
||||||
|
|
||||||
|
def esegui_stampa_cups(f):
|
||||||
|
try:
|
||||||
|
ps_content = f"""%!PS
|
||||||
|
/Helvetica-Bold findfont 11 scalefont setfont
|
||||||
|
70 760 moveto (DIMENSIONI GETTO) show
|
||||||
|
/Helvetica findfont 10 scalefont setfont
|
||||||
|
70 745 moveto (Altezza: {f.get('d_a')} {f.get('d_ua')} | Larghezza: {f.get('d_l')} {f.get('d_ul')} | Profondita: {f.get('d_p')} {f.get('d_up')}) show
|
||||||
|
/Helvetica-Bold findfont 11 scalefont setfont
|
||||||
|
70 720 moveto (VOLUME: {f.get('res_vol')} m3 | Peso: {f.get('res_peso')} Kg) show
|
||||||
|
70 700 moveto (ACQUISTI) show
|
||||||
|
/Helvetica findfont 10 scalefont setfont
|
||||||
|
70 685 moveto (o Cemento: {f.get('res_s_cem')} sacchetti) show
|
||||||
|
70 670 moveto (o Sabbia: {f.get('res_s_sab')} sacchetti) show
|
||||||
|
70 655 moveto (o Ghiaia: {f.get('res_s_ghi')} sacchetti) show
|
||||||
|
70 640 moveto (o Acqua: {f.get('res_aq')} L | Totale: {f.get('res_tot_s')} sacch.) show
|
||||||
|
/Helvetica-Bold findfont 11 scalefont setfont
|
||||||
|
70 620 moveto (COSTO TOTALE: {f.get('res_costo_t')} Euro) show
|
||||||
|
70 600 moveto (PROPORZIONI) show
|
||||||
|
/Helvetica findfont 10 scalefont setfont
|
||||||
|
70 585 moveto (Cem: {f.get('p_cem')} ({f.get('pc_cem')}%) | Sab: {f.get('p_sab')} ({f.get('pc_sab')}%) | Ghi: {f.get('p_ghi')} ({f.get('pc_ghi')}%)) show
|
||||||
|
70 560 moveto (PER OGNI CARICO ({f.get('res_nc')} CARICHI):) show
|
||||||
|
70 545 moveto (o Cemento: {f.get('res_bc_cem')} sacchetti) show
|
||||||
|
70 530 moveto (o Sabbia: {f.get('res_bc_sab')} sacchetti) show
|
||||||
|
70 515 moveto (o Ghiaia: {f.get('res_bc_ghi')} sacchetti) show
|
||||||
|
70 500 moveto (o Acqua: {f.get('res_bc_aq')} L) show
|
||||||
|
showpage"""
|
||||||
|
subprocess.run(["docker", "exec", "-i", "cups-pdf-server", "lp", "-d", "Virtual_PDF"], input=ps_content.encode('utf-8'))
|
||||||
|
return "OK - PDF generato in /output!"
|
||||||
|
except: return "Errore di stampa"
|
||||||
|
|
||||||
@app.route('/download', methods=['POST'])
|
@app.route('/download', methods=['POST'])
|
||||||
def download():
|
def download():
|
||||||
# Costruzione del file TXT con tutti i parametri e i risultati
|
|
||||||
f = request.form
|
f = request.form
|
||||||
report = f"""-------------------------------------------
|
report = (
|
||||||
REPORT TECNICO CALCOLO CEMENTO
|
f"DIMENSIONI GETTO\n"
|
||||||
-------------------------------------------
|
f"Altezza: {f.get('d_a')} {f.get('d_ua')} Larghezza: {f.get('d_l')} {f.get('d_ul')} Profondità: {f.get('d_p')} {f.get('d_up')}\n\n"
|
||||||
|
f"VOLUME: {f.get('res_vol')} m3 | Peso: {f.get('res_peso')} Kg\n\n"
|
||||||
PARAMETRI DI INPUT:
|
f"ACQUISTI\n"
|
||||||
- Dimensioni: {f.get('a')} {f.get('ua')} (Alt) x {f.get('l')} {f.get('ul')} (Lar) x {f.get('p')} {f.get('up')} (Pro)
|
f"• Cemento: \t{f.get('res_s_cem')} sacchetti\n"
|
||||||
- Miscela (Parti): Cem {f.get('p_cem')} | Sab {f.get('p_sab')} | Ghi {f.get('p_ghi')}
|
f"• Sabbia: \t{f.get('res_s_sab')} sacchetti\n"
|
||||||
- Peso Sacchi: Cem {f.get('w_cem')}kg | Sab {f.get('w_sab')}kg | Ghi {f.get('w_ghi')}kg
|
f"• Ghiaia: \t{f.get('res_s_ghi')} sacchetti\n"
|
||||||
- Costo Sacchi: Cem {f.get('c_cem')}€ | Sab {f.get('c_sab')}€ | Ghi {f.get('c_ghi')}€
|
f"• Acqua: \t{f.get('res_aq')} L | Totale: {f.get('res_tot_s')} sacch.\n\n"
|
||||||
- Attrezzatura: Betoniera da {f.get('v_bet')} L
|
f"COSTO TOTALE: \t{f.get('res_costo_t')} €\n\n"
|
||||||
|
f"PROPORZIONI\n"
|
||||||
RISULTATI GENERALI:
|
f"Cemento: {f.get('p_cem')} \tSabbia: {f.get('p_sab')} \tGhiaia: {f.get('p_ghi')}\n"
|
||||||
- Volume Totale: {f.get('res_vol')} m3
|
f"Cemento: {f.get('pc_cem')}% \tSabbia: {f.get('pc_sab')}% \tGhiaia: {f.get('pc_ghi')}%\n\n"
|
||||||
- Peso Totale: {f.get('res_peso')} Kg
|
f"PER OGNI CARICO ({f.get('res_nc')} CARICHI):\n\n"
|
||||||
- Acqua Totale: {f.get('res_aq')} L
|
f"• Cemento: \t{f.get('res_bc_cem')} sacchetti\n"
|
||||||
- Totale Sacchetti da acquistare: {f.get('res_tot_s')}
|
f"• Sabbia: \t{f.get('res_bc_sab')} sacchetti\n"
|
||||||
- COSTO COMPLESSIVO: {f.get('res_costo_t')} €
|
f"• Ghiaia: \t{f.get('res_bc_ghi')} sacchetti\n"
|
||||||
|
f"• Acqua: \t{f.get('res_bc_aq')} L"
|
||||||
DETTAGLIO ACQUISTI:
|
)
|
||||||
- Cemento: {f.get('res_s_cem')} sacchetti (€ {f.get('res_c_cem')})
|
return Response(report, mimetype="text/plain", headers={"Content-disposition":"attachment;filename=Report_V1_2.txt"})
|
||||||
- Sabbia: {f.get('res_s_sab')} sacchetti (€ {f.get('res_c_sab')})
|
|
||||||
- Ghiaia: {f.get('res_s_ghi')} sacchetti (€ {f.get('res_c_ghi')})
|
|
||||||
|
|
||||||
DOSAGGIO PER SINGOLO CARICO ({f.get('res_nc')} carichi):
|
|
||||||
- Cemento: {f.get('res_bc_cem')} sacchetti
|
|
||||||
- Sabbia: {f.get('res_bc_sab')} sacchetti
|
|
||||||
- Ghiaia: {f.get('res_bc_ghi')} sacchetti
|
|
||||||
- Acqua: {f.get('res_bc_aq')} L
|
|
||||||
|
|
||||||
-------------------------------------------
|
|
||||||
Generato da Software Cemento Rev.0
|
|
||||||
-------------------------------------------"""
|
|
||||||
return Response(report, mimetype="text/plain", headers={"Content-disposition":"attachment;filename=Report_Dettagliato.txt"})
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run(host='0.0.0.0', port=5000)
|
app.run(host='0.0.0.0', port=5000)
|
||||||
@@ -2,134 +2,104 @@
|
|||||||
<html lang="it">
|
<html lang="it">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<title>Software Cemento V 1.2</title>
|
||||||
<title>Software Cemento Rev.0</title>
|
|
||||||
<style>
|
<style>
|
||||||
:root { --mac-bg: #f2f2f7; --mac-blue: #007aff; --mac-red: #ff3b30; --mac-green: #34c759; }
|
:root { --mac-bg: #f2f2f7; --mac-blue: #007aff; --mac-red: #ff3b30; --mac-green: #34c759; --mac-gray: #8e8e93; }
|
||||||
body { font-family: -apple-system, system-ui, sans-serif; background: var(--mac-bg); padding: 20px; font-size: 14px; color: #1c1c1e; }
|
body { font-family: -apple-system, sans-serif; background: var(--mac-bg); padding: 20px; font-size: 14px; }
|
||||||
.container { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; max-width: 1200px; margin: auto; }
|
.container { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; max-width: 1200px; margin: auto; }
|
||||||
.panel { background: rgba(255,255,255,0.8); backdrop-filter: blur(10px); border-radius: 12px; padding: 20px; flex: 1; min-width: 320px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
|
.panel { background: rgba(255,255,255,0.9); border-radius: 12px; padding: 20px; flex: 1; min-width: 320px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
|
||||||
|
table { width: 100%; border-collapse: collapse; margin-bottom: 15px; border-radius: 8px; overflow: hidden; background: white; }
|
||||||
table { width: 100%; border-collapse: collapse; margin-bottom: 15px; background: white; border-radius: 8px; overflow: hidden; }
|
th { padding: 10px; font-size: 13px; color: white; text-transform: uppercase; }
|
||||||
th { padding: 10px; font-size: 14px; color: white; text-transform: uppercase; }
|
td { padding: 8px; border: 1px solid #e5e5ea; text-align: center; }
|
||||||
td { padding: 8px; text-align: center; border: 1px solid #e5e5ea; font-size: 14px; }
|
|
||||||
.h-blue { background: var(--mac-blue); }
|
.h-blue { background: var(--mac-blue); }
|
||||||
.h-red { background: var(--mac-red); }
|
.h-red { background: var(--mac-red); }
|
||||||
|
input { width: 85%; border: 1px solid #d1d1d6; border-radius: 5px; padding: 4px; text-align: center; }
|
||||||
.input-group { position: relative; display: inline-block; width: 90%; }
|
.btn { width: 100%; padding: 12px; border-radius: 8px; border: none; font-weight: bold; cursor: pointer; margin-top: 10px; color: white; text-transform: uppercase; }
|
||||||
input { width: 100%; border: 1px solid #d1d1d6; border-radius: 5px; padding: 6px 5px; text-align: center; font-size: 14px; box-sizing: border-box; }
|
|
||||||
.unit-label { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: #8e8e93; pointer-events: none; }
|
|
||||||
select { border: 1px solid #d1d1d6; border-radius: 5px; padding: 5px; font-size: 14px; }
|
|
||||||
|
|
||||||
.btn { width: 100%; padding: 12px; border-radius: 8px; border: none; font-weight: 600; cursor: pointer; margin-top: 10px; font-size: 15px; color: white; text-transform: uppercase; }
|
|
||||||
.btn-calc { background: var(--mac-green); }
|
.btn-calc { background: var(--mac-green); }
|
||||||
.btn-exp { background: #5856d6; margin-top: 20px; }
|
.btn-cups { background: var(--mac-blue); }
|
||||||
|
.btn-exp { background: #5856d6; }
|
||||||
.res-section { margin-bottom: 15px; }
|
.btn-device { background: #c7c7cc; color: #1c1c1e; }
|
||||||
.res-section h4 { margin: 0 0 5px 0; text-transform: uppercase; font-size: 12px; color: #8e8e93; }
|
.res-box { border: 1px solid #d1d1d6; border-radius: 10px; padding: 15px; background: #fff; line-height: 1.6; }
|
||||||
.res-box { background: white; padding: 15px; border-radius: 10px; border: 1px solid #d1d1d6; line-height: 1.6; }
|
ul { list-style: none; padding: 0; margin: 0; }
|
||||||
|
li { padding-left: 15px; position: relative; }
|
||||||
|
li::before { content: "•"; position: absolute; left: 0; }
|
||||||
hr { border: 0; border-top: 1px solid #d1d1d6; margin: 15px 0; }
|
hr { border: 0; border-top: 1px solid #d1d1d6; margin: 15px 0; }
|
||||||
|
.footer { text-align: center; font-size: 10px; color: var(--mac-gray); margin-top: 15px; }
|
||||||
@media print { .no-print { display: none !important; } .res-box { border: none; } }
|
@media print { .no-print { display: none !important; } }
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="panel no-print">
|
<div class="panel no-print">
|
||||||
<form method="POST">
|
<form method="POST">
|
||||||
<table>
|
<table><tr class="h-blue"><th colspan="3">Dimensioni</th></tr>
|
||||||
<tr class="h-blue"><th colspan="3">Dimensioni</th></tr>
|
|
||||||
<tr><td>Altezza</td><td><input type="text" name="a" value="{{form.get('a','0')}}"></td><td><select name="ua">{% for u in ['m','cm','mm'] %}<option value="{{u}}" {% if form.get('ua','m')==u %}selected{% endif %}>{{u}}</option>{% endfor %}</select></td></tr>
|
<tr><td>Altezza</td><td><input type="text" name="a" value="{{form.get('a','0')}}"></td><td><select name="ua">{% for u in ['m','cm','mm'] %}<option value="{{u}}" {% if form.get('ua','m')==u %}selected{% endif %}>{{u}}</option>{% endfor %}</select></td></tr>
|
||||||
<tr><td>Larghezza</td><td><input type="text" name="l" value="{{form.get('l','0')}}"></td><td><select name="ul">{% for u in ['m','cm','mm'] %}<option value="{{u}}" {% if form.get('ul','m')==u %}selected{% endif %}>{{u}}</option>{% endfor %}</select></td></tr>
|
<tr><td>Larghezza</td><td><input type="text" name="l" value="{{form.get('l','0')}}"></td><td><select name="ul">{% for u in ['m','cm','mm'] %}<option value="{{u}}" {% if form.get('ul','m')==u %}selected{% endif %}>{{u}}</option>{% endfor %}</select></td></tr>
|
||||||
<tr><td>Profondità</td><td><input type="text" name="p" value="{{form.get('p','0')}}"></td><td><select name="up">{% for u in ['m','cm','mm'] %}<option value="{{u}}" {% if form.get('up','m')==u %}selected{% endif %}>{{u}}</option>{% endfor %}</select></td></tr>
|
<tr><td>Profondità</td><td><input type="text" name="p" value="{{form.get('p','0')}}"></td><td><select name="up">{% for u in ['m','cm','mm'] %}<option value="{{u}}" {% if form.get('up','m')==u %}selected{% endif %}>{{u}}</option>{% endfor %}</select></td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
<table><tr class="h-red"><th colspan="3">Miscela (Parti)</th></tr>
|
||||||
<table>
|
<tr><td>Cem:<br><input type="text" name="p_cem" value="{{form.get('p_cem','1')}}"></td><td>Sab:<br><input type="text" name="p_sab" value="{{form.get('p_sab','3')}}"></td><td>Ghi:<br><input type="text" name="p_ghi" value="{{form.get('p_ghi','5')}}"></td></tr>
|
||||||
<tr class="h-red"><th colspan="3">Miscela (Parti)</th></tr>
|
|
||||||
<tr>
|
|
||||||
<td>Cemento:<br><input type="text" name="p_cem" value="{{form.get('p_cem','1')}}"></td>
|
|
||||||
<td>Sabbia:<br><input type="text" name="p_sab" value="{{form.get('p_sab','3')}}"></td>
|
|
||||||
<td>Ghiaia:<br><input type="text" name="p_ghi" value="{{form.get('p_ghi','5')}}"></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
|
<table><tr class="h-red"><th colspan="3">Peso sacchette (Kg)</th></tr>
|
||||||
<table>
|
<tr><td>Cem:<input type="text" name="w_cem" value="{{form.get('w_cem','25')}}"></td><td>Sab:<input type="text" name="w_sab" value="{{form.get('w_sab','25')}}"></td><td>Ghi:<input type="text" name="w_ghi" value="{{form.get('w_ghi','25')}}"></td></tr>
|
||||||
<tr class="h-red"><th colspan="3">Peso sacchette (Kg)</th></tr>
|
|
||||||
<tr>
|
|
||||||
<td>Cemento:<br><div class="input-group"><input type="text" name="w_cem" value="{{form.get('w_cem','25')}}"><span class="unit-label">Kg</span></div></td>
|
|
||||||
<td>Sabbia:<br><div class="input-group"><input type="text" name="w_sab" value="{{form.get('w_sab','25')}}"><span class="unit-label">Kg</span></div></td>
|
|
||||||
<td>Ghiaia:<br><div class="input-group"><input type="text" name="w_ghi" value="{{form.get('w_ghi','25')}}"><span class="unit-label">Kg</span></div></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
|
<table><tr class="h-red"><th colspan="3">Costo sacchette (€)</th></tr>
|
||||||
<table>
|
<tr><td>Cem:<input type="text" name="c_cem" value="{{form.get('c_cem','1')}}"></td><td>Sab:<input type="text" name="c_sab" value="{{form.get('c_sab','1')}}"></td><td>Ghi:<input type="text" name="c_ghi" value="{{form.get('c_ghi','1')}}"></td></tr>
|
||||||
<tr class="h-red"><th colspan="3">Costo sacchette (€)</th></tr>
|
|
||||||
<tr>
|
|
||||||
<td>Cemento:<br><div class="input-group"><input type="text" name="c_cem" value="{{form.get('c_cem','1')}}"><span class="unit-label">€</span></div></td>
|
|
||||||
<td>Sabbia:<br><div class="input-group"><input type="text" name="c_sab" value="{{form.get('c_sab','1')}}"><span class="unit-label">€</span></div></td>
|
|
||||||
<td>Ghiaia:<br><div class="input-group"><input type="text" name="c_ghi" value="{{form.get('c_ghi','1')}}"><span class="unit-label">€</span></div></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
|
<table><tr class="h-red"><th>Attrezzatura</th></tr><tr><td>Volume Betoniera: <input type="text" name="v_bet" value="{{form.get('v_bet','160')}}" style="width:60px;"> L</td></tr></table>
|
||||||
<table>
|
|
||||||
<tr class="h-red"><th>Attrezzatura</th></tr>
|
|
||||||
<tr><td>Volume Betoniera: <div class="input-group" style="width:80px;"><input type="text" name="v_bet" value="{{form.get('v_bet','160')}}"><span class="unit-label">L</span></div></td></tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<button type="submit" class="btn btn-calc">Esegui Calcolo</button>
|
<button type="submit" class="btn btn-calc">Esegui Calcolo</button>
|
||||||
</form>
|
</form>
|
||||||
|
<div class="footer">VERSIONE SOFTWARE: V 1.2 | DATA: 20/01/2026</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
<h3>Risultati</h3>
|
<h3>Risultati</h3>
|
||||||
{% if res %}
|
{% if res %}
|
||||||
<div class="res-box">
|
<div class="res-box">
|
||||||
<div class="res-section">
|
<b>DIMENSIONI GETTO</b><br>
|
||||||
<b>Volume:</b> {{ res.vol }} m³ | <b>Peso:</b> {{ res.peso }} Kg
|
Altezza: {{res.dim.a}} {{res.dim.ua}} Larghezza: {{res.dim.l}} {{res.dim.ul}} Profondità: {{res.dim.p}} {{res.dim.up}}<br><br>
|
||||||
</div>
|
<b>VOLUME:</b> {{ res.vol }} m³ | <b>Peso:</b> {{ res.peso }} Kg
|
||||||
<hr>
|
<hr>
|
||||||
<div class="res-section">
|
<b>ACQUISTI</b>
|
||||||
<h4>Acquisti</h4>
|
<ul>
|
||||||
Cemento: {{ res.s_cem }} sacchetti<br>
|
<li>Cemento: {{ res.s_cem }} sacchetti</li>
|
||||||
Sabbia: {{ res.s_sab }} sacchetti<br>
|
<li>Sabbia: {{ res.s_sab }} sacchetti</li>
|
||||||
Ghiaia: {{ res.s_ghi }} sacchetti<br>
|
<li>Ghiaia: {{ res.s_ghi }} sacchetti</li>
|
||||||
Acqua: {{ res.acqua }} L<br>
|
<li>Acqua: {{ res.acqua }} L | <b>Totale: {{ res.tot_sacc }} sacch.</b></li>
|
||||||
<b>Totale materiale:</b> {{ res.tot_sacc }} sacchetti
|
</ul>
|
||||||
</div>
|
<br>
|
||||||
<div class="res-section">
|
<b>COSTO TOTALE: {{ res.costo_tot }} €</b>
|
||||||
<h4>Costo stimato</h4>
|
|
||||||
<b>Costo totale: {{ res.costo_tot }} €</b>
|
|
||||||
</div>
|
|
||||||
<hr>
|
<hr>
|
||||||
<div class="res-section">
|
<b>PROPORZIONI</b><br>
|
||||||
<h4>Per ogni carico ({{ res.n_c }} carichi):</h4>
|
Cemento: {{res.parti.cem}} Sabbia: {{res.parti.sab}} Ghiaia: {{res.parti.ghi}}<br>
|
||||||
• Cemento: {{ res.bc_cem }} sacchetti<br>
|
Cemento: {{ "%.1f"|format(res.perc.cem) }}% Sabbia: {{ "%.1f"|format(res.perc.sab) }}% Ghiaia: {{ "%.1f"|format(res.perc.ghi) }}%
|
||||||
• Sabbia: {{ res.bc_sab }} sacchetti<br>
|
<hr>
|
||||||
• Ghiaia: {{ res.bc_ghi }} sacchetti<br>
|
<b>PER OGNI CARICO ({{ res.n_c }} CARICHI):</b>
|
||||||
• Acqua: {{ res.bc_aq }} L
|
<ul>
|
||||||
</div>
|
<li>• Cemento: {{ res.bc_cem }} sacchetti</li>
|
||||||
|
<li>• Sabbia: {{ res.bc_sab }} sacchetti</li>
|
||||||
|
<li>• Ghiaia: {{ res.bc_ghi }} sacchetti</li>
|
||||||
|
<li>• Acqua: {{ res.bc_aq }} L</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<form action="/download" method="POST" class="no-print">
|
<form method="POST" class="no-print">
|
||||||
|
{% for k,v in form.items() %}<input type="hidden" name="{{k}}" value="{{v}}">{% endfor %}
|
||||||
|
<input type="hidden" name="d_a" value="{{res.dim.a}}"><input type="hidden" name="d_ua" value="{{res.dim.ua}}">
|
||||||
|
<input type="hidden" name="d_l" value="{{res.dim.l}}"><input type="hidden" name="d_ul" value="{{res.dim.ul}}">
|
||||||
|
<input type="hidden" name="d_p" value="{{res.dim.p}}"><input type="hidden" name="d_up" value="{{res.dim.up}}">
|
||||||
|
<input type="hidden" name="p_cem" value="{{res.parti.cem}}"><input type="hidden" name="p_sab" value="{{res.parti.sab}}"><input type="hidden" name="p_ghi" value="{{res.parti.ghi}}">
|
||||||
|
<input type="hidden" name="pc_cem" value="{{'%.1f'|format(res.perc.cem)}}"><input type="hidden" name="pc_sab" value="{{'%.1f'|format(res.perc.sab)}}"><input type="hidden" name="pc_ghi" value="{{'%.1f'|format(res.perc.ghi)}}">
|
||||||
<input type="hidden" name="res_vol" value="{{res.vol}}"><input type="hidden" name="res_peso" value="{{res.peso}}">
|
<input type="hidden" name="res_vol" value="{{res.vol}}"><input type="hidden" name="res_peso" value="{{res.peso}}">
|
||||||
<input type="hidden" name="res_aq" value="{{res.acqua}}"><input type="hidden" name="res_tot_s" value="{{res.tot_sacc}}">
|
<input type="hidden" name="res_aq" value="{{res.acqua}}"><input type="hidden" name="res_tot_s" value="{{res.tot_sacc}}">
|
||||||
<input type="hidden" name="res_costo_t" value="{{res.costo_tot}}"><input type="hidden" name="res_s_cem" value="{{res.s_cem}}">
|
<input type="hidden" name="res_costo_t" value="{{res.costo_tot}}"><input type="hidden" name="res_nc" value="{{res.n_c}}">
|
||||||
<input type="hidden" name="res_c_cem" value="{{res.cost_cem}}"><input type="hidden" name="res_s_sab" value="{{res.s_sab}}">
|
<input type="hidden" name="res_s_cem" value="{{res.s_cem}}"><input type="hidden" name="res_s_sab" value="{{res.s_sab}}"><input type="hidden" name="res_s_ghi" value="{{res.s_ghi}}">
|
||||||
<input type="hidden" name="res_c_sab" value="{{res.cost_sab}}"><input type="hidden" name="res_s_ghi" value="{{res.s_ghi}}">
|
<input type="hidden" name="res_bc_cem" value="{{res.bc_cem}}"><input type="hidden" name="res_bc_sab" value="{{res.bc_sab}}"><input type="hidden" name="res_bc_ghi" value="{{res.bc_ghi}}"><input type="hidden" name="res_bc_aq" value="{{res.bc_aq}}">
|
||||||
<input type="hidden" name="res_c_ghi" value="{{res.cost_ghi}}"><input type="hidden" name="res_nc" value="{{res.n_c}}">
|
|
||||||
<input type="hidden" name="res_bc_cem" value="{{res.bc_cem}}"><input type="hidden" name="res_bc_sab" value="{{res.bc_sab}}">
|
<button type="submit" name="btn_stampa_cups" class="btn btn-cups">Stampa PDF (CUPS)</button>
|
||||||
<input type="hidden" name="res_bc_ghi" value="{{res.bc_ghi}}"><input type="hidden" name="res_bc_aq" value="{{res.bc_aq}}">
|
<button type="submit" formaction="/download" class="btn btn-exp">Esporta TXT</button>
|
||||||
<input type="hidden" name="a" value="{{form.get('a')}}"><input type="hidden" name="ua" value="{{form.get('ua')}}">
|
<button type="button" onclick="window.print()" class="btn btn-device">Stampa Pagina</button>
|
||||||
<input type="hidden" name="l" value="{{form.get('l')}}"><input type="hidden" name="ul" value="{{form.get('ul')}}">
|
|
||||||
<input type="hidden" name="p" value="{{form.get('p')}}"><input type="hidden" name="up" value="{{form.get('up')}}">
|
|
||||||
<input type="hidden" name="p_cem" value="{{form.get('p_cem')}}"><input type="hidden" name="p_sab" value="{{form.get('p_sab')}}"><input type="hidden" name="p_ghi" value="{{form.get('p_ghi')}}">
|
|
||||||
<input type="hidden" name="w_cem" value="{{form.get('w_cem')}}"><input type="hidden" name="w_sab" value="{{form.get('w_sab')}}"><input type="hidden" name="w_ghi" value="{{form.get('w_ghi')}}">
|
|
||||||
<input type="hidden" name="c_cem" value="{{form.get('c_cem')}}"><input type="hidden" name="c_sab" value="{{form.get('c_sab')}}"><input type="hidden" name="c_ghi" value="{{form.get('c_ghi')}}">
|
|
||||||
<input type="hidden" name="v_bet" value="{{form.get('v_bet')}}">
|
|
||||||
<button type="submit" class="btn btn-exp">Esporta TXT Completo</button>
|
|
||||||
</form>
|
</form>
|
||||||
<button onclick="window.print()" class="btn no-print" style="background:#d1d1d6; color:#1c1c1e;">Stampa</button>
|
{% if msg_stampa %}<p style="color:var(--mac-green); font-weight:bold; text-align:center;">{{ msg_stampa }}</p>{% endif %}
|
||||||
{% else %}
|
|
||||||
<p style="color:#8e8e93; text-align:center;">Inserisci i dati e premi "Esegui Calcolo".</p>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user