diff --git a/apps/main/forms.py b/apps/main/forms.py index 0d0e14a..a097190 100644 --- a/apps/main/forms.py +++ b/apps/main/forms.py @@ -67,8 +67,8 @@ class ExperimentForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(ExperimentForm, self).__init__(*args, **kwargs) - self.fields['start_time'].widget = TimepickerWidget(self.fields['start_time'].widget.attrs) - self.fields['end_time'].widget = TimepickerWidget(self.fields['end_time'].widget.attrs) + #self.fields['start_time'].widget = TimepickerWidget(self.fields['start_time'].widget.attrs) + #self.fields['end_time'].widget = TimepickerWidget(self.fields['end_time'].widget.attrs) def save(self, *args, **kwargs): exp = super(ExperimentForm, self).save(*args, **kwargs) diff --git a/apps/main/models.py b/apps/main/models.py index fa6e912..010ed62 100644 --- a/apps/main/models.py +++ b/apps/main/models.py @@ -21,7 +21,6 @@ from django.dispatch import receiver from apps.main.utils import Params - DEV_PORTS = { 'pedestal' : 80, 'pedestal_dev' : 80, @@ -330,13 +329,14 @@ class RunningExperiment(models.Model): class Experiment(models.Model): - + template = models.BooleanField(default=False) name = models.CharField(max_length=40, default='', unique=True) - location = models.ForeignKey('Location', null=False, blank=False, on_delete=models.CASCADE, default='') + location = models.ForeignKey('Location', null=False, blank=False, on_delete=models.CASCADE, default=None) #freq = models.FloatField(verbose_name='Operating Freq. (MHz)', validators=[MinValueValidator(1), MaxValueValidator(10000)], default=49.9200) - start_time = models.TimeField(default='00:00:00') - end_time = models.TimeField(default='23:59:59') + #start_time = models.TimeField(default='00:00:00') + #end_time = models.TimeField(default='23:59:59') + pedestal = models.ForeignKey('pedestal.PedestalConfiguration', null=False, blank=False, on_delete=models.CASCADE, default=None, related_name = "pedestal_conf") task = models.CharField(max_length=36, default='', blank=True, null=True) status = models.PositiveSmallIntegerField(default=4, choices=EXP_STATES) author = models.ForeignKey(User, null=True, blank=True,on_delete=models.CASCADE) @@ -362,7 +362,7 @@ class Experiment(models.Model): if field.name in ignored: continue data[field.name] = field.value_from_object(self) - + data['start_time'] = data['start_time'].strftime('%H:%M:%S') data['end_time'] = data['end_time'].strftime('%H:%M:%S') data['location'] = self.location.name @@ -498,7 +498,7 @@ class Experiment(models.Model): ) conf.dict_to_parms(parms, id=id_conf) - + location, created = Location.objects.get_or_create(name=exp_parms['location']) self.name = '{}-{}'.format(exp_parms['name'], datetime.now().strftime('%y%m%d')) self.location = location diff --git a/apps/main/templates/experiment.html b/apps/main/templates/experiment.html index 1ae6ae2..134ddf8 100644 --- a/apps/main/templates/experiment.html +++ b/apps/main/templates/experiment.html @@ -21,10 +21,8 @@
  • ----------------
  • Start
  • Stop
  • -
  • Mix RC Configurations
  • Add Configuration
  • -
  • Summary
  • - + {% endblock %} diff --git a/apps/main/views.py b/apps/main/views.py index 78a1f22..87f3c93 100644 --- a/apps/main/views.py +++ b/apps/main/views.py @@ -576,8 +576,7 @@ def experiments(request): form = FilterForm(initial=request.GET, extra_fields=fields) - kwargs['keys'] = ['name', 'radar_system', - 'start_time', 'end_time', 'actions'] + kwargs['keys'] = ['name', 'radar_system', 'actions'] kwargs['title'] = 'Experiment' kwargs['suptitle'] = 'List' kwargs['no_sidebar'] = True @@ -594,14 +593,13 @@ def experiments(request): def experiment(request, id_exp): experiment = get_object_or_404(Experiment, pk=id_exp) - + configurations = Configuration.objects.filter( experiment=experiment, type=0) kwargs = {} - kwargs['experiment_keys'] = ['template', 'radar_system', - 'name', 'start_time', 'end_time'] + kwargs['experiment_keys'] = ['template', 'radar_system', 'name'] kwargs['experiment'] = experiment kwargs['configuration_keys'] = ['name', 'device__ip_address', 'device__port_address', 'device__status'] diff --git a/status.txt b/status.txt new file mode 100644 index 0000000..af92b57 --- /dev/null +++ b/status.txt @@ -0,0 +1,4 @@ +On branch master +Your branch is up to date with 'origin/master'. + +nothing to commit, working tree clean