calculations
This commit is contained in:
parent
0f80f7d4e6
commit
38b3cc0b13
@ -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()
|
@ -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()
|
||||||
|
|
||||||
|
@ -92,10 +92,11 @@ 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}"])
|
||||||
]
|
]
|
||||||
|
|
||||||
if transducer_type == "Flow":
|
if transducer_type == "Flow":
|
||||||
del transducer_info["Instrument Pressure"]
|
del transducer_info["Instrument Pressure"]
|
||||||
elif transducer_type == "Pressure":
|
elif transducer_type == "Pressure":
|
||||||
|
Loading…
Reference in New Issue
Block a user