calculations

This commit is contained in:
Tyrel Souza 2023-07-25 22:05:56 -04:00
parent 0f80f7d4e6
commit 38b3cc0b13
No known key found for this signature in database
GPG Key ID: F3614B02ACBE438E
4 changed files with 10 additions and 3 deletions

4
TODO.txt Normal file
View File

@ -0,0 +1,4 @@
TODO:
AS LEFT
AS FOUND
prompt for files.

View File

@ -14,6 +14,7 @@ class UploadFileForm(forms.Form):
temperature = forms.FloatField(widget=forms.NumberInput(attrs={'step': 0.01, 'max': 1000.0, 'min': -459.67}))
humidity = forms.FloatField(widget=forms.NumberInput(attrs={'step': 0.01, 'max': 100.0, 'min': 0.0}))
CHOICES = [
('TV', _('Transducer Verify')),
('HC', _('Hardware Calibration'))
@ -23,4 +24,5 @@ class UploadFileForm(forms.Form):
widget=forms.RadioSelect,
choices=CHOICES,
)
file = forms.FileField()

View File

@ -3,8 +3,8 @@ from django.db import models
# Create your models here.
class Configuration(models.Model):
sertial = models.CharField(max_length = 200)
description = models.TextField()
serial = models.CharField(max_length=100)
device = models.CharField(max_length=100)
calibration_date = models.DateField()
calibration_due_date = models.DateField()

View File

@ -92,10 +92,11 @@ def parse_transducer(content, accuracy):
{
"Value": v,
"In Range": in_range(idx, v, transducer_info["Master Value"]),
"Delta":"TODO"
}
for idx, v in enumerate(transducer_info[f"Instrument {transducer_type}"])
]
if transducer_type == "Flow":
del transducer_info["Instrument Pressure"]
elif transducer_type == "Pressure":