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

View File

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

View File

@ -92,6 +92,7 @@ def parse_transducer(content, accuracy):
{ {
"Value": v, "Value": v,
"In Range": in_range(idx, v, transducer_info["Master Value"]), "In Range": in_range(idx, v, transducer_info["Master Value"]),
"Delta":"TODO"
} }
for idx, v in enumerate(transducer_info[f"Instrument {transducer_type}"]) for idx, v in enumerate(transducer_info[f"Instrument {transducer_type}"])
] ]