diff --git a/apps/abs/forms.py b/apps/abs/forms.py
index 38e0531..514f9c2 100644
--- a/apps/abs/forms.py
+++ b/apps/abs/forms.py
@@ -1,8 +1,56 @@
from django import forms
-from .models import ABSConfiguration
+from .models import ABSConfiguration, ABSBeam
+from .widgets import UpDataWidget, DownDataWidget, EditUpDataWidget, EditDownDataWidget
+from apps.main.models import Configuration
class ABSConfigurationForm(forms.ModelForm):
-
+ def __init__(self, *args, **kwargs):
+ super(ABSConfigurationForm, self).__init__(*args, **kwargs)
+ #instance = getattr(self, 'instance', None)
+
+ #if instance and instance.pk:
+ # devices = Device.objects.filter(device_type__name='abs')
+
+ #if instance.experiment:
+ # experiments = Experiment.objects.filter(pk=instance.experiment.id)
+ # self.fields['experiment'].widget.choices = [(experiment.id, experiment) for experiment in experiments]
+
class Meta:
model = ABSConfiguration
- fields = ('experiment',)
+ exclude = ('type', 'status', 'parameters', 'beams', 'module_status')
+
+class ABSBeamAddForm(forms.Form):
+
+ #abs_conf = forms.CharField(widget=forms.HiddenInput)
+ #name = forms.CharField(max_length=60)
+ up_data = forms.CharField(widget=UpDataWidget, label='')
+ down_data = forms.CharField(widget=DownDataWidget, label='')
+
+ def __init__(self, *args, **kwargs):
+ super(ABSBeamAddForm, self).__init__(*args, **kwargs)
+ #if 'abs_conf' in self.initial:
+ # self.fields['abs_conf'].initial = self.initial['abs_conf']
+ #self.fields['name'].initial = 'Beam'
+ # self.fields['up_data'].initial = self.initial['abs_conf']
+ # self.fields['down_data'].initial = self.initial['abs_conf']
+ #self.fields['abs_conf'].initial = self.initial['abs_conf']
+ #self.fields['name'].initial = 'Beam'
+ #self.fields['up_data'].initial = self.initial['abs_conf']
+ #self.fields['down_data'].initial = self.initial['abs_conf']
+
+
+
+class ABSBeamEditForm(forms.Form):
+
+ #abs_conf = forms.CharField(widget=forms.HiddenInput)
+ up_data = forms.CharField(widget=EditUpDataWidget, label='')
+ down_data = forms.CharField(widget=EditDownDataWidget, label='')
+
+ def __init__(self, *args, **kwargs):
+ super(ABSBeamEditForm, self).__init__(*args, **kwargs)
+
+ if 'initial' in kwargs:
+ if 'beam' in self.initial:
+ #self.fields['abs_conf'].initial = self.initial['beam'].abs_conf
+ self.fields['up_data'].initial = self.initial['beam']
+ self.fields['down_data'].initial = self.initial['beam']
diff --git a/apps/abs/models.py b/apps/abs/models.py
index 3890f46..65558c4 100644
--- a/apps/abs/models.py
+++ b/apps/abs/models.py
@@ -619,7 +619,7 @@ class ABSBeam(models.Model):
self.save()
return parameters
-
+
def change_beam(self, beam_pos=0):
@@ -869,6 +869,38 @@ class ABSBeam(models.Model):
return data
@property
+ def get_uptx(self):
+ """
+ This function shows the up-tx-values of one beam
+ """
+ data = json.loads(self.tx)
+ up_data = data['up']
+
+ up_values = []
+ for data in up_data:
+ for i in range(0,8):
+ up_values.append(data[i])
+
+ return up_values
+
+ @property
+ def get_downtx(self):
+ """
+ This function shows the down-tx-values of one beam
+ """
+ data = json.loads(self.tx)
+ down_data = data['down']
+
+ down_values = []
+ for data in down_data:
+ for i in range(0,8):
+ down_values.append(data[i])
+
+ return down_values
+
+
+
+ @property
def get_rx(self):
"""
This function shows the rx-values of one beam
@@ -876,3 +908,33 @@ class ABSBeam(models.Model):
data = json.loads(self.rx)
return data
+
+ @property
+ def get_uprx(self):
+ """
+ This function shows the up-rx-values of one beam
+ """
+ data = json.loads(self.rx)
+ up_data = data['up']
+
+ up_values = []
+ for data in up_data:
+ for i in range(0,8):
+ up_values.append(data[i])
+
+ return up_values
+
+ @property
+ def get_downrx(self):
+ """
+ This function shows the down-rx-values of one beam
+ """
+ data = json.loads(self.rx)
+ down_data = data['down']
+
+ down_values = []
+ for data in down_data:
+ for i in range(0,8):
+ down_values.append(data[i])
+
+ return down_values
diff --git a/apps/abs/templates/abs_add_beam.html b/apps/abs/templates/abs_add_beam.html
new file mode 100644
index 0000000..3794553
--- /dev/null
+++ b/apps/abs/templates/abs_add_beam.html
@@ -0,0 +1,19 @@
+{% extends "dev_conf_edit.html" %}
+
+{% load bootstrap3 %}
+{% load static %}
+{% load main_tags %}
+
+{% block content %}
+
+{% endblock %}
diff --git a/apps/abs/templates/abs_beam_values.html b/apps/abs/templates/abs_beam_values.html
new file mode 100644
index 0000000..c19a713
--- /dev/null
+++ b/apps/abs/templates/abs_beam_values.html
@@ -0,0 +1,691 @@
+{% load static %}
+{% load bootstrap3 %}
+{% load main_tags %}
+
+{% block content %}
+
+
+
+
+
+
+
+
UP
+
+
+
+ Antenna
+
+
+ North Quarter
+
+
+ {{beam.get_upvalues.0}} | {{beam.get_upvalues.1}} | {{beam.get_upvalues.2}} | {{beam.get_upvalues.3}} |
+
+
+ {{beam.get_upvalues.8}} | {{beam.get_upvalues.9}} | {{beam.get_upvalues.10}} | {{beam.get_upvalues.11}} |
+
+
+ {{beam.get_upvalues.16}} | {{beam.get_upvalues.17}} | {{beam.get_upvalues.18}} | {{beam.get_upvalues.19}} |
+
+
+ {{beam.get_upvalues.24}} | {{beam.get_upvalues.25}} | {{beam.get_upvalues.26}} | {{beam.get_upvalues.27}} |
+
+
+ |
+ East Quarter
+
+
+ {{beam.get_upvalues.4}} | {{beam.get_upvalues.5}} | {{beam.get_upvalues.6}} | {{beam.get_upvalues.7}} |
+
+
+ {{beam.get_upvalues.12}} | {{beam.get_upvalues.13}} | {{beam.get_upvalues.14}} | {{beam.get_upvalues.15}} |
+
+
+ {{beam.get_upvalues.20}} | {{beam.get_upvalues.21}} | {{beam.get_upvalues.22}} | {{beam.get_upvalues.23}} |
+
+
+ {{beam.get_upvalues.28}} | {{beam.get_upvalues.29}} | {{beam.get_upvalues.30}} | {{beam.get_upvalues.31}} |
+
+
+ |
+
+
+ West Quarter
+
+
+ {{beam.get_upvalues.32}} | {{beam.get_upvalues.33}} | {{beam.get_upvalues.34}} | {{beam.get_upvalues.35}} |
+
+
+ {{beam.get_upvalues.40}} | {{beam.get_upvalues.41}} | {{beam.get_upvalues.42}} | {{beam.get_upvalues.43}} |
+
+
+ {{beam.get_upvalues.48}} | {{beam.get_upvalues.49}} | {{beam.get_upvalues.50}} | {{beam.get_upvalues.51}} |
+
+
+ {{beam.get_upvalues.56}} | {{beam.get_upvalues.57}} | {{beam.get_upvalues.58}} | {{beam.get_upvalues.59}} |
+
+
+ |
+ South Quarter
+
+
+ {{beam.get_upvalues.36}} | {{beam.get_upvalues.37}} | {{beam.get_upvalues.38}} | {{beam.get_upvalues.39}} |
+
+
+ {{beam.get_upvalues.44}} | {{beam.get_upvalues.45}} | {{beam.get_upvalues.46}} | {{beam.get_upvalues.47}} |
+
+
+ {{beam.get_upvalues.52}} | {{beam.get_upvalues.53}} | {{beam.get_upvalues.54}} | {{beam.get_upvalues.55}} |
+
+
+ {{beam.get_upvalues.60}} | {{beam.get_upvalues.61}} | {{beam.get_upvalues.62}} | {{beam.get_upvalues.63}} |
+
+
+ |
+
+
+ |
+
+
+
+
+
+
+ TX
+
+
+ North Quarter
+
+
+ {{beam.get_tx.up.0.0}} | {{beam.get_tx.up.0.1}} | {{beam.get_tx.up.0.2}} | {{beam.get_tx.up.0.3}} |
+
+
+ {{beam.get_tx.up.1.0}} | {{beam.get_tx.up.1.1}} | {{beam.get_tx.up.1.2}} | {{beam.get_tx.up.1.3}} |
+
+
+ {{beam.get_tx.up.2.0}} | {{beam.get_tx.up.2.1}} | {{beam.get_tx.up.2.2}} | {{beam.get_tx.up.2.3}} |
+
+
+ {{beam.get_tx.up.3.0}} | {{beam.get_tx.up.3.1}} | {{beam.get_tx.up.3.2}} | {{beam.get_tx.up.3.3}} |
+
+
+ |
+ East Quarter
+
+
+ {{beam.get_tx.up.0.4}} | {{beam.get_tx.up.0.5}} | {{beam.get_tx.up.0.6}} | {{beam.get_tx.up.0.7}} |
+
+
+ {{beam.get_tx.up.1.4}} | {{beam.get_tx.up.1.5}} | {{beam.get_tx.up.1.6}} | {{beam.get_tx.up.1.7}} |
+
+
+ {{beam.get_tx.up.2.4}} | {{beam.get_tx.up.2.5}} | {{beam.get_tx.up.2.6}} | {{beam.get_tx.up.2.7}} |
+
+
+ {{beam.get_tx.up.3.4}} | {{beam.get_tx.up.3.5}} | {{beam.get_tx.up.3.6}} | {{beam.get_tx.up.3.7}} |
+
+
+ |
+
+
+ West Quarter
+
+
+ {{beam.get_tx.up.4.0}} | {{beam.get_tx.up.4.1}} | {{beam.get_tx.up.4.2}} | {{beam.get_tx.up.4.3}} |
+
+
+ {{beam.get_tx.up.5.0}} | {{beam.get_tx.up.5.1}} | {{beam.get_tx.up.5.2}} | {{beam.get_tx.up.5.3}} |
+
+
+ {{beam.get_tx.up.6.0}} | {{beam.get_tx.up.6.1}} | {{beam.get_tx.up.6.2}} | {{beam.get_tx.up.6.3}} |
+
+
+ {{beam.get_tx.up.7.0}} | {{beam.get_tx.up.7.1}} | {{beam.get_tx.up.7.2}} | {{beam.get_tx.up.7.3}} |
+
+
+ |
+ South Quarter
+
+
+ {{beam.get_tx.up.4.4}} | {{beam.get_tx.up.4.5}} | {{beam.get_tx.up.4.6}} | {{beam.get_tx.up.4.7}} |
+
+
+ {{beam.get_tx.up.5.4}} | {{beam.get_tx.up.5.5}} | {{beam.get_tx.up.5.6}} | {{beam.get_tx.up.5.7}} |
+
+
+ {{beam.get_tx.up.6.4}} | {{beam.get_tx.up.6.5}} | {{beam.get_tx.up.6.6}} | {{beam.get_tx.up.6.7}} |
+
+
+ {{beam.get_tx.up.7.4}} | {{beam.get_tx.up.7.5}} | {{beam.get_tx.up.7.6}} | {{beam.get_tx.up.7.7}} |
+
+
+ |
+
+
+ |
+
+
+
+
+
+
+ RX
+
+
+ North Quarter
+
+
+ {{beam.get_rx.up.0.0}} | {{beam.get_rx.up.0.1}} | {{beam.get_rx.up.0.2}} | {{beam.get_rx.up.0.3}} |
+
+
+ {{beam.get_rx.up.1.0}} | {{beam.get_rx.up.1.1}} | {{beam.get_rx.up.1.2}} | {{beam.get_rx.up.1.3}} |
+
+
+ {{beam.get_rx.up.2.0}} | {{beam.get_rx.up.2.1}} | {{beam.get_rx.up.2.2}} | {{beam.get_rx.up.2.3}} |
+
+
+ {{beam.get_rx.up.3.0}} | {{beam.get_rx.up.3.1}} | {{beam.get_rx.up.3.2}} | {{beam.get_rx.up.3.3}} |
+
+
+ |
+ East Quarter
+
+
+ {{beam.get_rx.up.0.4}} | {{beam.get_rx.up.0.5}} | {{beam.get_rx.up.0.6}} | {{beam.get_rx.up.0.7}} |
+
+
+ {{beam.get_rx.up.1.4}} | {{beam.get_rx.up.1.5}} | {{beam.get_rx.up.1.6}} | {{beam.get_rx.up.1.7}} |
+
+
+ {{beam.get_rx.up.2.4}} | {{beam.get_rx.up.2.5}} | {{beam.get_rx.up.2.6}} | {{beam.get_rx.up.2.7}} |
+
+
+ {{beam.get_rx.up.3.4}} | {{beam.get_rx.up.3.5}} | {{beam.get_rx.up.3.6}} | {{beam.get_rx.up.3.7}} |
+
+
+ |
+
+
+ West Quarter
+
+
+ {{beam.get_rx.up.4.0}} | {{beam.get_rx.up.4.1}} | {{beam.get_rx.up.4.2}} | {{beam.get_rx.up.4.3}} |
+
+
+ {{beam.get_rx.up.5.0}} | {{beam.get_rx.up.5.1}} | {{beam.get_rx.up.5.2}} | {{beam.get_rx.up.5.3}} |
+
+
+ {{beam.get_rx.up.6.0}} | {{beam.get_rx.up.6.1}} | {{beam.get_rx.up.6.2}} | {{beam.get_rx.up.6.3}} |
+
+
+ {{beam.get_rx.up.7.0}} | {{beam.get_rx.up.7.1}} | {{beam.get_rx.up.7.2}} | {{beam.get_rx.up.7.3}} |
+
+
+ |
+ South Quarter
+
+
+ {{beam.get_rx.up.4.4}} | {{beam.get_rx.up.4.5}} | {{beam.get_rx.up.4.6}} | {{beam.get_rx.up.4.7}} |
+
+
+ {{beam.get_rx.up.5.4}} | {{beam.get_rx.up.5.5}} | {{beam.get_rx.up.5.6}} | {{beam.get_rx.up.5.7}} |
+
+
+ {{beam.get_rx.up.6.4}} | {{beam.get_rx.up.6.5}} | {{beam.get_rx.up.6.6}} | {{beam.get_rx.up.6.7}} |
+
+
+ {{beam.get_rx.up.7.4}} | {{beam.get_rx.up.7.5}} | {{beam.get_rx.up.7.6}} | {{beam.get_rx.up.7.7}} |
+
+
+ |
+
+
+ |
+
+
+
+
+
+
+
+
+ Ues: {{beam.get_up_ues}}
+
+
+
+
+ Only RX: {{beam.get_up_onlyrx}}
+
+
+
+
+
+
+
+
+
+
DOWN
+
+
+
+ Antenna
+
+
+ North Quarter
+
+
+ {{beam.get_downvalues.0}} | {{beam.get_downvalues.1}} | {{beam.get_downvalues.2}} | {{beam.get_downvalues.3}} |
+
+
+ {{beam.get_downvalues.8}} | {{beam.get_downvalues.9}} | {{beam.get_downvalues.10}} | {{beam.get_downvalues.11}} |
+
+
+ {{beam.get_downvalues.16}} | {{beam.get_downvalues.17}} | {{beam.get_downvalues.18}} | {{beam.get_downvalues.19}} |
+
+
+ {{beam.get_downvalues.24}} | {{beam.get_downvalues.25}} | {{beam.get_downvalues.26}} | {{beam.get_downvalues.27}} |
+
+
+ |
+ East Quarter
+
+
+ {{beam.get_downvalues.4}} | {{beam.get_downvalues.5}} | {{beam.get_downvalues.6}} | {{beam.get_downvalues.7}} |
+
+
+ {{beam.get_downvalues.12}} | {{beam.get_downvalues.13}} | {{beam.get_downvalues.14}} | {{beam.get_downvalues.15}} |
+
+
+ {{beam.get_downvalues.20}} | {{beam.get_downvalues.21}} | {{beam.get_downvalues.22}} | {{beam.get_downvalues.23}} |
+
+
+ {{beam.get_downvalues.28}} | {{beam.get_downvalues.29}} | {{beam.get_downvalues.30}} | {{beam.get_downvalues.31}} |
+
+
+ |
+
+
+ West Quarter
+
+
+ {{beam.get_downvalues.32}} | {{beam.get_downvalues.33}} | {{beam.get_downvalues.34}} | {{beam.get_downvalues.35}} |
+
+
+ {{beam.get_downvalues.40}} | {{beam.get_downvalues.41}} | {{beam.get_downvalues.42}} | {{beam.get_downvalues.43}} |
+
+
+ {{beam.get_downvalues.48}} | {{beam.get_downvalues.49}} | {{beam.get_downvalues.50}} | {{beam.get_downvalues.51}} |
+
+
+ {{beam.get_downvalues.56}} | {{beam.get_downvalues.57}} | {{beam.get_downvalues.58}} | {{beam.get_downvalues.59}} |
+
+
+ |
+ South Quarter
+
+
+ {{beam.get_downvalues.36}} | {{beam.get_downvalues.37}} | {{beam.get_downvalues.38}} | {{beam.get_downvalues.39}} |
+
+
+ {{beam.get_downvalues.44}} | {{beam.get_downvalues.45}} | {{beam.get_downvalues.46}} | {{beam.get_downvalues.47}} |
+
+
+ {{beam.get_downvalues.52}} | {{beam.get_downvalues.53}} | {{beam.get_downvalues.54}} | {{beam.get_downvalues.55}} |
+
+
+ {{beam.get_downvalues.60}} | {{beam.get_downvalues.61}} | {{beam.get_downvalues.62}} | {{beam.get_downvalues.63}} |
+
+
+ |
+
+
+ |
+
+
+
+
+
+ TX
+
+
+ North Quarter
+
+
+ {{beam.get_tx.down.0.0}} | {{beam.get_tx.down.0.1}} | {{beam.get_tx.down.0.2}} | {{beam.get_tx.down.0.3}} |
+
+
+ {{beam.get_tx.down.1.0}} | {{beam.get_tx.down.1.1}} | {{beam.get_tx.down.1.2}} | {{beam.get_tx.down.1.3}} |
+
+
+ {{beam.get_tx.down.2.0}} | {{beam.get_tx.down.2.1}} | {{beam.get_tx.down.2.2}} | {{beam.get_tx.down.2.3}} |
+
+
+ {{beam.get_tx.down.3.0}} | {{beam.get_tx.down.3.1}} | {{beam.get_tx.down.3.2}} | {{beam.get_tx.down.3.3}} |
+
+
+ |
+ East Quarter
+
+
+ {{beam.get_tx.down.0.4}} | {{beam.get_tx.down.0.5}} | {{beam.get_tx.down.0.6}} | {{beam.get_tx.down.0.7}} |
+
+
+ {{beam.get_tx.down.1.4}} | {{beam.get_tx.down.1.5}} | {{beam.get_tx.down.1.6}} | {{beam.get_tx.down.1.7}} |
+
+
+ {{beam.get_tx.down.2.4}} | {{beam.get_tx.down.2.5}} | {{beam.get_tx.down.2.6}} | {{beam.get_tx.down.2.7}} |
+
+
+ {{beam.get_tx.down.3.4}} | {{beam.get_tx.down.3.5}} | {{beam.get_tx.down.3.6}} | {{beam.get_tx.down.3.7}} |
+
+
+ |
+
+
+ West Quarter
+
+
+ {{beam.get_tx.down.4.0}} | {{beam.get_tx.down.4.1}} | {{beam.get_tx.down.4.2}} | {{beam.get_tx.down.4.3}} |
+
+
+ {{beam.get_tx.down.5.0}} | {{beam.get_tx.down.5.1}} | {{beam.get_tx.down.5.2}} | {{beam.get_tx.down.5.3}} |
+
+
+ {{beam.get_tx.down.6.0}} | {{beam.get_tx.down.6.1}} | {{beam.get_tx.down.6.2}} | {{beam.get_tx.down.6.3}} |
+
+
+ {{beam.get_tx.down.7.0}} | {{beam.get_tx.down.7.1}} | {{beam.get_tx.down.7.2}} | {{beam.get_tx.down.7.3}} |
+
+
+ |
+ South Quarter
+
+
+ {{beam.get_tx.down.4.4}} | {{beam.get_tx.down.4.5}} | {{beam.get_tx.down.4.6}} | {{beam.get_tx.down.4.7}} |
+
+
+ {{beam.get_tx.down.5.4}} | {{beam.get_tx.down.5.5}} | {{beam.get_tx.down.5.6}} | {{beam.get_tx.down.5.7}} |
+
+
+ {{beam.get_tx.down.6.4}} | {{beam.get_tx.down.6.5}} | {{beam.get_tx.down.6.6}} | {{beam.get_tx.down.6.7}} |
+
+
+ {{beam.get_tx.down.7.4}} | {{beam.get_tx.down.7.5}} | {{beam.get_tx.down.7.6}} | {{beam.get_tx.down.7.7}} |
+
+
+ |
+
+
+ |
+
+
+
+
+
+
+ RX
+
+
+ North Quarter
+
+
+ {{beam.get_rx.down.0.0}} | {{beam.get_rx.down.0.1}} | {{beam.get_rx.down.0.2}} | {{beam.get_rx.down.0.3}} |
+
+
+ {{beam.get_rx.down.1.0}} | {{beam.get_rx.down.1.1}} | {{beam.get_rx.down.1.2}} | {{beam.get_rx.down.1.3}} |
+
+
+ {{beam.get_rx.down.2.0}} | {{beam.get_rx.down.2.1}} | {{beam.get_rx.down.2.2}} | {{beam.get_rx.down.2.3}} |
+
+
+ {{beam.get_rx.down.3.0}} | {{beam.get_rx.down.3.1}} | {{beam.get_rx.down.3.2}} | {{beam.get_rx.down.3.3}} |
+
+
+ |
+ East Quarter
+
+
+ {{beam.get_rx.down.0.4}} | {{beam.get_rx.down.0.5}} | {{beam.get_rx.down.0.6}} | {{beam.get_rx.down.0.7}} |
+
+
+ {{beam.get_rx.down.1.4}} | {{beam.get_rx.down.1.5}} | {{beam.get_rx.down.1.6}} | {{beam.get_rx.down.1.7}} |
+
+
+ {{beam.get_rx.down.2.4}} | {{beam.get_rx.down.2.5}} | {{beam.get_rx.down.2.6}} | {{beam.get_rx.down.2.7}} |
+
+
+ {{beam.get_rx.down.3.4}} | {{beam.get_rx.down.3.5}} | {{beam.get_rx.down.3.6}} | {{beam.get_rx.down.3.7}} |
+
+
+ |
+
+
+ West Quarter
+
+
+ {{beam.get_rx.down.4.0}} | {{beam.get_rx.down.4.1}} | {{beam.get_rx.down.4.2}} | {{beam.get_rx.down.4.3}} |
+
+
+ {{beam.get_rx.down.5.0}} | {{beam.get_rx.down.5.1}} | {{beam.get_rx.down.5.2}} | {{beam.get_rx.down.5.3}} |
+
+
+ {{beam.get_rx.down.6.0}} | {{beam.get_rx.down.6.1}} | {{beam.get_rx.down.6.2}} | {{beam.get_rx.down.6.3}} |
+
+
+ {{beam.get_rx.down.7.0}} | {{beam.get_rx.down.7.1}} | {{beam.get_rx.down.7.2}} | {{beam.get_rx.down.7.3}} |
+
+
+ |
+ South Quarter
+
+
+ {{beam.get_rx.down.4.4}} | {{beam.get_rx.down.4.5}} | {{beam.get_rx.down.4.6}} | {{beam.get_rx.down.4.7}} |
+
+
+ {{beam.get_rx.down.5.4}} | {{beam.get_rx.down.5.5}} | {{beam.get_rx.down.5.6}} | {{beam.get_rx.down.5.7}} |
+
+
+ {{beam.get_rx.down.6.4}} | {{beam.get_rx.down.6.5}} | {{beam.get_rx.down.6.6}} | {{beam.get_rx.down.6.7}} |
+
+
+ {{beam.get_rx.down.7.4}} | {{beam.get_rx.down.7.5}} | {{beam.get_rx.down.7.6}} | {{beam.get_rx.down.7.7}} |
+
+
+ |
+
+
+ |
+
+
+
+
+
+
+
+
+ Ues: {{beam.get_down_ues}}
+
+
+
+
+ Only RX: {{beam.get_down_onlyrx}}
+
+
+
+
+
+
+
+{% endblock %}
diff --git a/apps/abs/templates/abs_beams_list.html b/apps/abs/templates/abs_beams_list.html
new file mode 100644
index 0000000..ab6878c
--- /dev/null
+++ b/apps/abs/templates/abs_beams_list.html
@@ -0,0 +1,42 @@
+{% load bootstrap3 %}
+
+{% if abs_beams %}
+
+
+
+
+
+
+ {% for beam in abs_beams %}
+
+
+
+
+ {% include "abs_beam_values.html" %}
+ {# bootstrap_form beam.form layout='horizontal' size='small' #}
+
+
+
+
+ {# endif #}
+
+
+
+
+{% endfor%}
+
+{% else %}
+ No Beams...
+{% endif %}
diff --git a/apps/abs/templates/abs_conf.html b/apps/abs/templates/abs_conf.html
new file mode 100644
index 0000000..1213138
--- /dev/null
+++ b/apps/abs/templates/abs_conf.html
@@ -0,0 +1,462 @@
+{% extends "dev_conf.html" %}
+
+{% block extra-menu-actions %}
+ View Patterns
+ Write
+{% endblock %}
+
+{% block extra-content %}
+
+
+Beams:
+{% if beams_id %}
+
+
+
+
+
+
+
+
+
+
+
+
+ North Quarter
+
+
+ {{beams.0.get_upvalues.0}} | {{beams.0.get_upvalues.1}} | {{beams.0.get_upvalues.2}} | {{beams.0.get_upvalues.3}} |
+
+
+ {{beams.0.get_downvalues.0}} | {{beams.0.get_downvalues.1}} | {{beams.0.get_downvalues.2}} | {{beams.0.get_downvalues.3}} |
+
+
+ {{beams.0.get_upvalues.8}} | {{beams.0.get_upvalues.9}} | {{beams.0.get_upvalues.10}} | {{beams.0.get_upvalues.11}} |
+
+
+ {{beams.0.get_downvalues.8}} | {{beams.0.get_downvalues.9}} | {{beams.0.get_downvalues.10}} | {{beams.0.get_downvalues.11}} |
+
+
+ {{beams.0.get_upvalues.16}} | {{beams.0.get_upvalues.17}} | {{beams.0.get_upvalues.18}} | {{beams.0.get_upvalues.19}} |
+
+
+ {{beams.0.get_downvalues.16}} | {{beams.0.get_downvalues.17}} | {{beams.0.get_downvalues.18}} | {{beams.0.get_downvalues.19}} |
+
+
+ {{beams.0.get_upvalues.24}} | {{beams.0.get_upvalues.25}} | {{beams.0.get_upvalues.26}} | {{beams.0.get_upvalues.27}} |
+
+
+ {{beams.0.get_downvalues.24}} | {{beams.0.get_downvalues.25}} | {{beams.0.get_downvalues.26}} | {{beams.0.get_downvalues.27}} |
+
+
+ |
+ East Quarter
+
+
+ {{beams.0.get_upvalues.4}} | {{beams.0.get_upvalues.5}} | {{beams.0.get_upvalues.6}} | {{beams.0.get_upvalues.7}} |
+
+
+ {{beams.0.get_downvalues.4}} | {{beams.0.get_downvalues.5}} | {{beams.0.get_downvalues.6}} | {{beams.0.get_downvalues.7}} |
+
+
+ {{beams.0.get_upvalues.12}} | {{beams.0.get_upvalues.13}} | {{beams.0.get_upvalues.14}} | {{beams.0.get_upvalues.15}} |
+
+
+ {{beams.0.get_downvalues.12}} | {{beams.0.get_downvalues.13}} | {{beams.0.get_downvalues.14}} | {{beams.0.get_downvalues.15}} |
+
+
+ {{beams.0.get_upvalues.20}} | {{beams.0.get_upvalues.21}} | {{beams.0.get_upvalues.22}} | {{beams.0.get_upvalues.23}} |
+
+
+ {{beams.0.get_downvalues.20}} | {{beams.0.get_downvalues.21}} | {{beams.0.get_downvalues.22}} | {{beams.0.get_downvalues.23}} |
+
+
+ {{beams.0.get_upvalues.28}} | {{beams.0.get_upvalues.29}} | {{beams.0.get_upvalues.30}} | {{beams.0.get_upvalues.31}} |
+
+
+ {{beams.0.get_downvalues.28}} | {{beams.0.get_downvalues.29}} | {{beams.0.get_downvalues.30}} | {{beams.0.get_downvalues.31}} |
+
+
+ |
+
+
+ West Quarter
+
+
+ {{beams.0.get_upvalues.32}} | {{beams.0.get_upvalues.33}} | {{beams.0.get_upvalues.34}} | {{beams.0.get_upvalues.35}} |
+
+
+ {{beams.0.get_downvalues.32}} | {{beams.0.get_downvalues.33}} | {{beams.0.get_downvalues.34}} | {{beams.0.get_downvalues.35}} |
+
+
+ {{beams.0.get_upvalues.40}} | {{beams.0.get_upvalues.41}} | {{beams.0.get_upvalues.42}} | {{beams.0.get_upvalues.43}} |
+
+
+ {{beams.0.get_downvalues.40}} | {{beams.0.get_downvalues.41}} | {{beams.0.get_downvalues.42}} | {{beams.0.get_downvalues.43}} |
+
+
+ {{beams.0.get_upvalues.48}} | {{beams.0.get_upvalues.49}} | {{beams.0.get_upvalues.50}} | {{beams.0.get_upvalues.51}} |
+
+
+ {{beams.0.get_downvalues.48}} | {{beams.0.get_downvalues.49}} | {{beams.0.get_downvalues.50}} | {{beams.0.get_downvalues.51}} |
+
+
+ {{beams.0.get_upvalues.56}} | {{beams.0.get_upvalues.57}} | {{beams.0.get_upvalues.58}} | {{beams.0.get_upvalues.59}} |
+
+
+ {{beams.0.get_downvalues.56}} | {{beams.0.get_downvalues.57}} | {{beams.0.get_downvalues.58}} | {{beams.0.get_downvalues.59}} |
+
+
+ |
+ South Quarter
+
+
+ {{beams.0.get_upvalues.36}} | {{beams.0.get_upvalues.37}} | {{beams.0.get_upvalues.38}} | {{beams.0.get_upvalues.39}} |
+
+
+ {{beams.0.get_downvalues.36}} | {{beams.0.get_downvalues.37}} | {{beams.0.get_downvalues.38}} | {{beams.0.get_downvalues.39}} |
+
+
+ {{beams.0.get_upvalues.44}} | {{beams.0.get_upvalues.45}} | {{beams.0.get_upvalues.46}} | {{beams.0.get_upvalues.47}} |
+
+
+ {{beams.0.get_downvalues.44}} | {{beams.0.get_downvalues.45}} | {{beams.0.get_downvalues.46}} | {{beams.0.get_downvalues.47}} |
+
+
+ {{beams.0.get_upvalues.52}} | {{beams.0.get_upvalues.53}} | {{beams.0.get_upvalues.54}} | {{beams.0.get_upvalues.55}} |
+
+
+ {{beams.0.get_downvalues.52}} | {{beams.0.get_downvalues.53}} | {{beams.0.get_downvalues.54}} | {{beams.0.get_downvalues.55}} |
+
+
+ {{beams.0.get_upvalues.60}} | {{beams.0.get_upvalues.61}} | {{beams.0.get_upvalues.62}} | {{beams.0.get_upvalues.63}} |
+
+
+ {{beams.0.get_downvalues.60}} | {{beams.0.get_downvalues.61}} | {{beams.0.get_downvalues.62}} | {{beams.0.get_downvalues.63}} |
+
+
+ |
+
+
+
+
+
+ Legend |
+
+
+ RED | Disconnected |
+
+
+ ORANGE | Connected |
+
+
+ GREEN | Running |
+
+
+
+{% else %}
+ No Beams...
+{% endif %}
+
+
+{% endblock %}
diff --git a/apps/abs/templates/abs_pattern.html b/apps/abs/templates/abs_pattern.html
new file mode 100644
index 0000000..0b8e300
--- /dev/null
+++ b/apps/abs/templates/abs_pattern.html
@@ -0,0 +1,876 @@
+{% load static %}
+{% load bootstrap3 %}
+{% load main_tags %}
+
+{% block content %}
+
+
+
+
+
+
+
+
UP
+
+
+
+ Antenna
+
+
+ North Quarter
+
+
+ {{abs_beams.0.get_upvalues.0}} | {{abs_beams.0.get_upvalues.1}} | {{abs_beams.0.get_upvalues.2}} | {{abs_beams.0.get_upvalues.3}} |
+
+
+ {{abs_beams.0.get_upvalues.8}} | {{abs_beams.0.get_upvalues.9}} | {{abs_beams.0.get_upvalues.10}} | {{abs_beams.0.get_upvalues.11}} |
+
+
+ {{abs_beams.0.get_upvalues.16}} | {{abs_beams.0.get_upvalues.17}} | {{abs_beams.0.get_upvalues.18}} | {{abs_beams.0.get_upvalues.19}} |
+
+
+ {{abs_beams.0.get_upvalues.24}} | {{abs_beams.0.get_upvalues.25}} | {{abs_beams.0.get_upvalues.26}} | {{abs_beams.0.get_upvalues.27}} |
+
+
+ |
+ East Quarter
+
+
+ {{abs_beams.0.get_upvalues.4}} | {{abs_beams.0.get_upvalues.5}} | {{abs_beams.0.get_upvalues.6}} | {{abs_beams.0.get_upvalues.7}} |
+
+
+ {{abs_beams.0.get_upvalues.12}} | {{abs_beams.0.get_upvalues.13}} | {{abs_beams.0.get_upvalues.14}} | {{abs_beams.0.get_upvalues.15}} |
+
+
+ {{abs_beams.0.get_upvalues.20}} | {{abs_beams.0.get_upvalues.21}} | {{abs_beams.0.get_upvalues.22}} | {{abs_beams.0.get_upvalues.23}} |
+
+
+ {{abs_beams.0.get_upvalues.28}} | {{abs_beams.0.get_upvalues.29}} | {{abs_beams.0.get_upvalues.30}} | {{abs_beams.0.get_upvalues.31}} |
+
+
+ |
+
+
+ West Quarter
+
+
+ {{abs_beams.0.get_upvalues.32}} | {{abs_beams.0.get_upvalues.33}} | {{abs_beams.0.get_upvalues.34}} | {{abs_beams.0.get_upvalues.35}} |
+
+
+ {{abs_beams.0.get_upvalues.40}} | {{abs_beams.0.get_upvalues.41}} | {{abs_beams.0.get_upvalues.42}} | {{abs_beams.0.get_upvalues.43}} |
+
+
+ {{abs_beams.0.get_upvalues.48}} | {{abs_beams.0.get_upvalues.49}} | {{abs_beams.0.get_upvalues.50}} | {{abs_beams.0.get_upvalues.51}} |
+
+
+ {{abs_beams.0.get_upvalues.56}} | {{abs_beams.0.get_upvalues.57}} | {{abs_beams.0.get_upvalues.58}} | {{abs_beams.0.get_upvalues.59}} |
+
+
+ |
+ South Quarter
+
+
+ {{abs_beams.0.get_upvalues.36}} | {{abs_beams.0.get_upvalues.37}} | {{abs_beams.0.get_upvalues.38}} | {{abs_beams.0.get_upvalues.39}} |
+
+
+ {{abs_beams.0.get_upvalues.44}} | {{abs_beams.0.get_upvalues.45}} | {{abs_beams.0.get_upvalues.46}} | {{abs_beams.0.get_upvalues.47}} |
+
+
+ {{abs_beams.0.get_upvalues.52}} | {{abs_beams.0.get_upvalues.53}} | {{abs_beams.0.get_upvalues.54}} | {{abs_beams.0.get_upvalues.55}} |
+
+
+ {{abs_beams.0.get_upvalues.60}} | {{abs_beams.0.get_upvalues.61}} | {{abs_beams.0.get_upvalues.62}} | {{abs_beams.0.get_upvalues.63}} |
+
+
+ |
+
+
+ |
+
+
+
+
+
+
+ TX
+
+
+ North Quarter
+
+
+ {{abs_beams.0.get_tx.up.0.0}} | {{abs_beams.0.get_tx.up.0.1}} | {{abs_beams.0.get_tx.up.0.2}} | {{abs_beams.0.get_tx.up.0.3}} |
+
+
+ {{abs_beams.0.get_tx.up.1.0}} | {{abs_beams.0.get_tx.up.1.1}} | {{abs_beams.0.get_tx.up.1.2}} | {{abs_beams.0.get_tx.up.1.3}} |
+
+
+ {{abs_beams.0.get_tx.up.2.0}} | {{abs_beams.0.get_tx.up.2.1}} | {{abs_beams.0.get_tx.up.2.2}} | {{abs_beams.0.get_tx.up.2.3}} |
+
+
+ {{abs_beams.0.get_tx.up.3.0}} | {{abs_beams.0.get_tx.up.3.1}} | {{abs_beams.0.get_tx.up.3.2}} | {{abs_beams.0.get_tx.up.3.3}} |
+
+
+ |
+ East Quarter
+
+
+ {{abs_beams.0.get_tx.up.0.4}} | {{abs_beams.0.get_tx.up.0.5}} | {{abs_beams.0.get_tx.up.0.6}} | {{abs_beams.0.get_tx.up.0.7}} |
+
+
+ {{abs_beams.0.get_tx.up.1.4}} | {{abs_beams.0.get_tx.up.1.5}} | {{abs_beams.0.get_tx.up.1.6}} | {{abs_beams.0.get_tx.up.1.7}} |
+
+
+ {{abs_beams.0.get_tx.up.2.4}} | {{abs_beams.0.get_tx.up.2.5}} | {{abs_beams.0.get_tx.up.2.6}} | {{abs_beams.0.get_tx.up.2.7}} |
+
+
+ {{abs_beams.0.get_tx.up.3.4}} | {{abs_beams.0.get_tx.up.3.5}} | {{abs_beams.0.get_tx.up.3.6}} | {{abs_beams.0.get_tx.up.3.7}} |
+
+
+ |
+
+
+ West Quarter
+
+
+ {{abs_beams.0.get_tx.up.4.0}} | {{abs_beams.0.get_tx.up.4.1}} | {{abs_beams.0.get_tx.up.4.2}} | {{abs_beams.0.get_tx.up.4.3}} |
+
+
+ {{abs_beams.0.get_tx.up.5.0}} | {{abs_beams.0.get_tx.up.5.1}} | {{abs_beams.0.get_tx.up.5.2}} | {{abs_beams.0.get_tx.up.5.3}} |
+
+
+ {{abs_beams.0.get_tx.up.6.0}} | {{abs_beams.0.get_tx.up.6.1}} | {{abs_beams.0.get_tx.up.6.2}} | {{abs_beams.0.get_tx.up.6.3}} |
+
+
+ {{abs_beams.0.get_tx.up.7.0}} | {{abs_beams.0.get_tx.up.7.1}} | {{abs_beams.0.get_tx.up.7.2}} | {{abs_beams.0.get_tx.up.7.3}} |
+
+
+ |
+ South Quarter
+
+
+ {{abs_beams.0.get_tx.up.4.4}} | {{abs_beams.0.get_tx.up.4.5}} | {{abs_beams.0.get_tx.up.4.6}} | {{abs_beams.0.get_tx.up.4.7}} |
+
+
+ {{abs_beams.0.get_tx.up.5.4}} | {{abs_beams.0.get_tx.up.5.5}} | {{abs_beams.0.get_tx.up.5.6}} | {{abs_beams.0.get_tx.up.5.7}} |
+
+
+ {{abs_beams.0.get_tx.up.6.4}} | {{abs_beams.0.get_tx.up.6.5}} | {{abs_beams.0.get_tx.up.6.6}} | {{abs_beams.0.get_tx.up.6.7}} |
+
+
+ {{abs_beams.0.get_tx.up.7.4}} | {{abs_beams.0.get_tx.up.7.5}} | {{abs_beams.0.get_tx.up.7.6}} | {{abs_beams.0.get_tx.up.7.7}} |
+
+
+ |
+
+
+ |
+
+
+
+
+
+
+ RX
+
+
+ North Quarter
+
+
+ {{abs_beams.0.get_rx.up.0.0}} | {{abs_beams.0.get_rx.up.0.1}} | {{abs_beams.0.get_rx.up.0.2}} | {{abs_beams.0.get_rx.up.0.3}} |
+
+
+ {{abs_beams.0.get_rx.up.1.0}} | {{abs_beams.0.get_rx.up.1.1}} | {{abs_beams.0.get_rx.up.1.2}} | {{abs_beams.0.get_rx.up.1.3}} |
+
+
+ {{abs_beams.0.get_rx.up.2.0}} | {{abs_beams.0.get_rx.up.2.1}} | {{abs_beams.0.get_rx.up.2.2}} | {{abs_beams.0.get_rx.up.2.3}} |
+
+
+ {{abs_beams.0.get_rx.up.3.0}} | {{abs_beams.0.get_rx.up.3.1}} | {{abs_beams.0.get_rx.up.3.2}} | {{abs_beams.0.get_rx.up.3.3}} |
+
+
+ |
+ East Quarter
+
+
+ {{abs_beams.0.get_rx.up.0.4}} | {{abs_beams.0.get_rx.up.0.5}} | {{abs_beams.0.get_rx.up.0.6}} | {{abs_beams.0.get_rx.up.0.7}} |
+
+
+ {{abs_beams.0.get_rx.up.1.4}} | {{abs_beams.0.get_rx.up.1.5}} | {{abs_beams.0.get_rx.up.1.6}} | {{abs_beams.0.get_rx.up.1.7}} |
+
+
+ {{abs_beams.0.get_rx.up.2.4}} | {{abs_beams.0.get_rx.up.2.5}} | {{abs_beams.0.get_rx.up.2.6}} | {{abs_beams.0.get_rx.up.2.7}} |
+
+
+ {{abs_beams.0.get_rx.up.3.4}} | {{abs_beams.0.get_rx.up.3.5}} | {{abs_beams.0.get_rx.up.3.6}} | {{abs_beams.0.get_rx.up.3.7}} |
+
+
+ |
+
+
+ West Quarter
+
+
+ {{abs_beams.0.get_rx.up.4.0}} | {{abs_beams.0.get_rx.up.4.1}} | {{abs_beams.0.get_rx.up.4.2}} | {{abs_beams.0.get_rx.up.4.3}} |
+
+
+ {{abs_beams.0.get_rx.up.5.0}} | {{abs_beams.0.get_rx.up.5.1}} | {{abs_beams.0.get_rx.up.5.2}} | {{abs_beams.0.get_rx.up.5.3}} |
+
+
+ {{abs_beams.0.get_rx.up.6.0}} | {{abs_beams.0.get_rx.up.6.1}} | {{abs_beams.0.get_rx.up.6.2}} | {{abs_beams.0.get_rx.up.6.3}} |
+
+
+ {{abs_beams.0.get_rx.up.7.0}} | {{abs_beams.0.get_rx.up.7.1}} | {{abs_beams.0.get_rx.up.7.2}} | {{abs_beams.0.get_rx.up.7.3}} |
+
+
+ |
+ South Quarter
+
+
+ {{abs_beams.0.get_rx.up.4.4}} | {{abs_beams.0.get_rx.up.4.5}} | {{abs_beams.0.get_rx.up.4.6}} | {{abs_beams.0.get_rx.up.4.7}} |
+
+
+ {{abs_beams.0.get_rx.up.5.4}} | {{abs_beams.0.get_rx.up.5.5}} | {{abs_beams.0.get_rx.up.5.6}} | {{abs_beams.0.get_rx.up.5.7}} |
+
+
+ {{abs_beams.0.get_rx.up.6.4}} | {{abs_beams.0.get_rx.up.6.5}} | {{abs_beams.0.get_rx.up.6.6}} | {{abs_beams.0.get_rx.up.6.7}} |
+
+
+ {{abs_beams.0.get_rx.up.7.4}} | {{abs_beams.0.get_rx.up.7.5}} | {{abs_beams.0.get_rx.up.7.6}} | {{abs_beams.0.get_rx.up.7.7}} |
+
+
+ |
+
+
+ |
+
+
+
+ {% if not edit %}
+ {% include "abs_pattern_img.html" %}
+ {% endif %}
+
+
+
+
+ Ues: {{abs_beams.0.get_up_ues}}
+
+
+
+
+ Only RX: {{abs_beams.0.get_up_onlyrx}}
+
+
+
+
+
+
+
+
+
+
DOWN
+
+
+
+ Antenna
+
+
+ North Quarter
+
+
+ 0.0 | 0.0 | 0.0 | 0.0 |
+
+
+ 0.0 | 0.0 | 0.0 | 0.0 |
+
+
+ 0.0 | 0.0 | 0.0 | 0.0 |
+
+
+ 0.0 | 0.0 | 0.0 | 0.0 |
+
+
+ |
+ East Quarter
+
+
+ 0.0 | 0.0 | 0.0 | 0.0 |
+
+
+ 0.0 | 0.0 | 0.0 | 0.0 |
+
+
+ 0.0 | 0.0 | 0.0 | 0.0 |
+
+
+ 0.0 | 0.0 | 0.0 | 0.0 |
+
+
+ |
+
+
+ West Quarter
+
+
+ 0.0 | 0.0 | 0.0 | 0.0 |
+
+
+ 0.0 | 0.0 | 0.0 | 0.0 |
+
+
+ 0.0 | 0.0 | 0.0 | 0.0 |
+
+
+ 0.0 | 0.0 | 0.0 | 0.0 |
+
+
+ |
+ South Quarter
+
+
+ 0.0 | 0.0 | 0.0 | 0.0 |
+
+
+ 0.0 | 0.0 | 0.0 | 0.0 |
+
+
+ 0.0 | 0.0 | 0.0 | 0.0 |
+
+
+ 0.0 | 0.0 | 0.0 | 0.0 |
+
+
+ |
+
+
+ |
+
+
+
+
+
+ TX
+
+
+ North Quarter
+
+
+ {{abs_beams.0.get_tx.down.0.0}} | {{abs_beams.0.get_tx.down.0.1}} | {{abs_beams.0.get_tx.down.0.2}} | {{abs_beams.0.get_tx.down.0.3}} |
+
+
+ {{abs_beams.0.get_tx.down.1.0}} | {{abs_beams.0.get_tx.down.1.1}} | {{abs_beams.0.get_tx.down.1.2}} | {{abs_beams.0.get_tx.down.1.3}} |
+
+
+ {{abs_beams.0.get_tx.down.2.0}} | {{abs_beams.0.get_tx.down.2.1}} | {{abs_beams.0.get_tx.down.2.2}} | {{abs_beams.0.get_tx.down.2.3}} |
+
+
+ {{abs_beams.0.get_tx.down.3.0}} | {{abs_beams.0.get_tx.down.3.1}} | {{abs_beams.0.get_tx.down.3.2}} | {{abs_beams.0.get_tx.down.3.3}} |
+
+
+ |
+ East Quarter
+
+
+ {{abs_beams.0.get_tx.down.0.4}} | {{abs_beams.0.get_tx.down.0.5}} | {{abs_beams.0.get_tx.down.0.6}} | {{abs_beams.0.get_tx.down.0.7}} |
+
+
+ {{abs_beams.0.get_tx.down.1.4}} | {{abs_beams.0.get_tx.down.1.5}} | {{abs_beams.0.get_tx.down.1.6}} | {{abs_beams.0.get_tx.down.1.7}} |
+
+
+ {{abs_beams.0.get_tx.down.2.4}} | {{abs_beams.0.get_tx.down.2.5}} | {{abs_beams.0.get_tx.down.2.6}} | {{abs_beams.0.get_tx.down.2.7}} |
+
+
+ {{abs_beams.0.get_tx.down.3.4}} | {{abs_beams.0.get_tx.down.3.5}} | {{abs_beams.0.get_tx.down.3.6}} | {{abs_beams.0.get_tx.down.3.7}} |
+
+
+ |
+
+
+ West Quarter
+
+
+ {{abs_beams.0.get_tx.down.4.0}} | {{abs_beams.0.get_tx.down.4.1}} | {{abs_beams.0.get_tx.down.4.2}} | {{abs_beams.0.get_tx.down.4.3}} |
+
+
+ {{abs_beams.0.get_tx.down.5.0}} | {{abs_beams.0.get_tx.down.5.1}} | {{abs_beams.0.get_tx.down.5.2}} | {{abs_beams.0.get_tx.down.5.3}} |
+
+
+ {{abs_beams.0.get_tx.down.6.0}} | {{abs_beams.0.get_tx.down.6.1}} | {{abs_beams.0.get_tx.down.6.2}} | {{abs_beams.0.get_tx.down.6.3}} |
+
+
+ {{abs_beams.0.get_tx.down.7.0}} | {{abs_beams.0.get_tx.down.7.1}} | {{abs_beams.0.get_tx.down.7.2}} | {{abs_beams.0.get_tx.down.7.3}} |
+
+
+ |
+ South Quarter
+
+
+ {{abs_beams.0.get_tx.down.4.4}} | {{abs_beams.0.get_tx.down.4.5}} | {{abs_beams.0.get_tx.down.4.6}} | {{abs_beams.0.get_tx.down.4.7}} |
+
+
+ {{abs_beams.0.get_tx.down.5.4}} | {{abs_beams.0.get_tx.down.5.5}} | {{abs_beams.0.get_tx.down.5.6}} | {{abs_beams.0.get_tx.down.5.7}} |
+
+
+ {{abs_beams.0.get_tx.down.6.4}} | {{abs_beams.0.get_tx.down.6.5}} | {{abs_beams.0.get_tx.down.6.6}} | {{abs_beams.0.get_tx.down.6.7}} |
+
+
+ {{abs_beams.0.get_tx.down.7.4}} | {{abs_beams.0.get_tx.down.7.5}} | {{abs_beams.0.get_tx.down.7.6}} | {{abs_beams.0.get_tx.down.7.7}} |
+
+
+ |
+
+
+ |
+
+
+
+
+
+
+ RX
+
+
+ North Quarter
+
+
+ {{abs_beams.0.get_rx.down.0.0}} | {{abs_beams.0.get_rx.down.0.1}} | {{abs_beams.0.get_rx.down.0.2}} | {{abs_beams.0.get_rx.down.0.3}} |
+
+
+ {{abs_beams.0.get_rx.down.1.0}} | {{abs_beams.0.get_rx.down.1.1}} | {{abs_beams.0.get_rx.down.1.2}} | {{abs_beams.0.get_rx.down.1.3}} |
+
+
+ {{abs_beams.0.get_rx.down.2.0}} | {{abs_beams.0.get_rx.down.2.1}} | {{abs_beams.0.get_rx.down.2.2}} | {{abs_beams.0.get_rx.down.2.3}} |
+
+
+ {{abs_beams.0.get_rx.down.3.0}} | {{abs_beams.0.get_rx.down.3.1}} | {{abs_beams.0.get_rx.down.3.2}} | {{abs_beams.0.get_rx.down.3.3}} |
+
+
+ |
+ East Quarter
+
+
+ {{abs_beams.0.get_rx.down.0.4}} | {{abs_beams.0.get_rx.down.0.5}} | {{abs_beams.0.get_rx.down.0.6}} | {{abs_beams.0.get_rx.down.0.7}} |
+
+
+ {{abs_beams.0.get_rx.down.1.4}} | {{abs_beams.0.get_rx.down.1.5}} | {{abs_beams.0.get_rx.down.1.6}} | {{abs_beams.0.get_rx.down.1.7}} |
+
+
+ {{abs_beams.0.get_rx.down.2.4}} | {{abs_beams.0.get_rx.down.2.5}} | {{abs_beams.0.get_rx.down.2.6}} | {{abs_beams.0.get_rx.down.2.7}} |
+
+
+ {{abs_beams.0.get_rx.down.3.4}} | {{abs_beams.0.get_rx.down.3.5}} | {{abs_beams.0.get_rx.down.3.6}} | {{abs_beams.0.get_rx.down.3.7}} |
+
+
+ |
+
+
+ West Quarter
+
+
+ {{abs_beams.0.get_rx.down.4.0}} | {{abs_beams.0.get_rx.down.4.1}} | {{abs_beams.0.get_rx.down.4.2}} | {{abs_beams.0.get_rx.down.4.3}} |
+
+
+ {{abs_beams.0.get_rx.down.5.0}} | {{abs_beams.0.get_rx.down.5.1}} | {{abs_beams.0.get_rx.down.5.2}} | {{abs_beams.0.get_rx.down.5.3}} |
+
+
+ {{abs_beams.0.get_rx.down.6.0}} | {{abs_beams.0.get_rx.down.6.1}} | {{abs_beams.0.get_rx.down.6.2}} | {{abs_beams.0.get_rx.down.6.3}} |
+
+
+ {{abs_beams.0.get_rx.down.7.0}} | {{abs_beams.0.get_rx.down.7.1}} | {{abs_beams.0.get_rx.down.7.2}} | {{abs_beams.0.get_rx.down.7.3}} |
+
+
+ |
+ South Quarter
+
+
+ {{abs_beams.0.get_rx.down.4.4}} | {{abs_beams.0.get_rx.down.4.5}} | {{abs_beams.0.get_rx.down.4.6}} | {{abs_beams.0.get_rx.down.4.7}} |
+
+
+ {{abs_beams.0.get_rx.down.5.4}} | {{abs_beams.0.get_rx.down.5.5}} | {{abs_beams.0.get_rx.down.5.6}} | {{abs_beams.0.get_rx.down.5.7}} |
+
+
+ {{abs_beams.0.get_rx.down.6.4}} | {{abs_beams.0.get_rx.down.6.5}} | {{abs_beams.0.get_rx.down.6.6}} | {{abs_beams.0.get_rx.down.6.7}} |
+
+
+ {{abs_beams.0.get_rx.down.7.4}} | {{abs_beams.0.get_rx.down.7.5}} | {{abs_beams.0.get_rx.down.7.6}} | {{abs_beams.0.get_rx.down.7.7}} |
+
+
+ |
+
+
+ |
+
+
+
+ {% if not edit %}
+ {% include "abs_pattern_img.html" %}
+ {% endif %}
+
+
+
+
+ Ues: {{abs_beams.0.get_down_ues}}
+
+
+
+
+ Only RX: {{abs_beams.0.get_down_onlyrx}}
+
+
+
+
+
+
+
+{% endblock %}
+
+
diff --git a/apps/abs/templates/abs_patterns.html b/apps/abs/templates/abs_patterns.html
new file mode 100644
index 0000000..d7ed960
--- /dev/null
+++ b/apps/abs/templates/abs_patterns.html
@@ -0,0 +1,47 @@
+{% extends "dev_conf.html" %}
+{% load static %}
+{% load bootstrap3 %}
+{% load main_tags %}
+
+{% block content %}
+
+
+{% if abs_beams %}
+
+
+
+ {% include "abs_pattern.html" %}
+
+
+{% else %}
+
+{% endif %}
+
+{% endblock %}
+
+
diff --git a/apps/abs/templates/index.html b/apps/abs/templates/index.html
deleted file mode 100644
index e21ab6b..0000000
--- a/apps/abs/templates/index.html
+++ /dev/null
@@ -1,15 +0,0 @@
-{% extends "base.html" %}
-{% block mainactive %}active{% endblock %}
-
-{% block content-title %}TITLE{% endblock %}
-{% block content-suptitle %}Suptitle{% endblock %}
-
-{% block content %}
-
- {% lorem %}
-
-{% endblock %}
-
-{% block sidebar%}
-
-{% endblock %}
diff --git a/apps/abs/urls.py b/apps/abs/urls.py
index 4824c3c..418d4a0 100644
--- a/apps/abs/urls.py
+++ b/apps/abs/urls.py
@@ -1,6 +1,13 @@
from django.conf.urls import url
urlpatterns = (
- url(r'^(?P-?\d+)/$', 'apps.main.views.dev_conf', name='url_abs_conf'),
- url(r'^(?P-?\d+)/edit/$', 'apps.main.views.dev_conf_edit', name='url_edit_abs_conf'),
+ url(r'^(?P-?\d+)/$', 'apps.abs.views.abs_conf', name='url_abs_conf'),
+ url(r'^(?P-?\d+)/edit/$', 'apps.abs.views.abs_conf_edit', name='url_edit_abs_conf'),
+ url(r'^(?P-?\d+)/read/$', 'apps.main.views.dev_conf_read', name='url_read_abs_conf'),
+ url(r'^(?P-?\d+)/import/$', 'apps.main.views.dev_conf_import', name='url_import_abs_conf'),
+ url(r'^(?P-?\d+)/export/$', 'apps.main.views.dev_conf_export', name='url_export_abs_conf'),
+ url(r'^(?P-?\d+)/plot/$', 'apps.abs.views.plot_patterns', name='url_plot_abs_patterns'),
+ url(r'^(?P-?\d+)/add_beam/$', 'apps.abs.views.add_beam', name='url_add_abs_beam'),
+ url(r'^(?P-?\d+)/beam/(?P-?\d+)/delete/$', 'apps.abs.views.remove_beam', name='url_remove_abs_beam'),
+ url(r'^(?P-?\d+)/beam/(?P-?\d+)/edit/$', 'apps.abs.views.edit_beam', name='url_edit_abs_beam'),
)
diff --git a/apps/abs/views.py b/apps/abs/views.py
index 91ea44a..6363f82 100644
--- a/apps/abs/views.py
+++ b/apps/abs/views.py
@@ -1,3 +1,327 @@
-from django.shortcuts import render
+from django.shortcuts import render_to_response
+from django.template import RequestContext
+from django.shortcuts import redirect, render, get_object_or_404
+from django.contrib import messages
+from apps.main.models import Device, Configuration
+from apps.main.views import sidebar
+
+from .models import ABSConfiguration, ABSBeam
+from .forms import ABSConfigurationForm, ABSBeamEditForm, ABSBeamAddForm
# Create your views here.
+import json, ast
+
+
+def get_values_from_form(form_data):
+
+ sublistup = []
+ sublistdown = []
+ subtxlistup = []
+ subtxlistdown = []
+ subrxlistup = []
+ subrxlistdown = []
+
+ up_values_list = []
+ down_values_list = []
+ up_txvalues_list = []
+ down_txvalues_list = []
+ up_rxvalues_list = []
+ down_rxvalues_list = []
+
+ values_list = {}
+ cont = 1
+
+ for i in range(1,65):
+ x = float(form_data['abs_up'+str(i)])
+ y = float(form_data['abs_down'+str(i)])
+ sublistup.append(x)
+ sublistdown.append(y)
+
+ if str(i) in form_data.getlist('uptx_checks'):
+ subtxlistup.append(1)
+ else:
+ subtxlistup.append(0)
+ if str(i) in form_data.getlist('downtx_checks'):
+ subtxlistdown.append(1)
+ else:
+ subtxlistdown.append(0)
+
+ if str(i) in form_data.getlist('uprx_checks'):
+ subrxlistup.append(1)
+ else:
+ subrxlistup.append(0)
+ if str(i) in form_data.getlist('downrx_checks'):
+ subrxlistdown.append(1)
+ else:
+ subrxlistdown.append(0)
+
+ cont = cont+1
+
+ if cont == 9:
+ up_values_list.append(sublistup)
+ down_values_list.append(sublistdown)
+ sublistup = []
+ sublistdown = []
+
+ up_txvalues_list.append(subtxlistup)
+ down_txvalues_list.append(subtxlistdown)
+ subtxlistup = []
+ subtxlistdown = []
+ up_rxvalues_list.append(subrxlistup)
+ down_rxvalues_list.append(subrxlistdown)
+ subrxlistup = []
+ subrxlistdown = []
+ cont = 1
+
+
+ list_uesup = []
+ list_uesdown = []
+ for i in range(1,5):
+ if form_data['ues_up'+str(i)] == '':
+ list_uesup.append(0.0)
+ else:
+ list_uesup.append(float(form_data['ues_up'+str(i)]))
+
+ if form_data['ues_down'+str(i)] == '':
+ list_uesdown.append(0.0)
+ else:
+ list_uesdown.append(float(form_data['ues_down'+str(i)]))
+
+ onlyrx_list = form_data.getlist('onlyrx')
+ only_rx = {}
+ if '1' in onlyrx_list:
+ only_rx['up'] = True
+ else:
+ only_rx['up'] = False
+ if '2' in onlyrx_list:
+ only_rx['down'] = True
+ else:
+ only_rx['down'] = False
+
+ antenna = {'antenna_up': up_values_list, 'antenna_down': down_values_list}
+ tx = {'up': up_txvalues_list, 'down': down_txvalues_list}
+ rx = {'up': up_rxvalues_list, 'down': down_rxvalues_list}
+ ues = {'up': list_uesup, 'down': list_uesdown}
+ name = str(form_data['beam_name'])
+
+ beam_data = {'name': name, 'antenna': antenna, 'tx': tx, 'rx': rx, 'ues': ues, 'only_rx': only_rx}
+
+ return beam_data
+
+
+
+def abs_conf(request, id_conf):
+
+ conf = get_object_or_404(ABSConfiguration, pk=id_conf)
+
+ beams_dict = ast.literal_eval(conf.beams)
+ beams = []
+ for beam_id in range(1,len(beams_dict)+1):
+ beam = ABSBeam.objects.get(pk=beams_dict['beam'+str(beam_id)])
+ beams.append(beam)
+
+ beams_id = ast.literal_eval(conf.beams)
+
+ ip=conf.device.ip_address
+ port=conf.device.port_address
+
+ kwargs = {}
+ kwargs['status'] = conf.device.get_status_display()
+
+
+ kwargs['dev_conf'] = conf
+ kwargs['dev_conf_keys'] = ['name',]
+
+ kwargs['title'] = 'ABS Configuration'
+ kwargs['suptitle'] = 'Details'
+ kwargs['no_play'] = True
+
+ kwargs['button'] = 'Edit Configuration'
+
+ #kwargs['no_play'] = True
+ kwargs['beams_id'] = beams_id
+ kwargs['beams'] = beams
+ kwargs['beam_selector'] = 0
+ #kwargs['my_data'] = simplejson.dumps(beams)
+
+ kwargs['only_stop'] = True
+
+ ###### SIDEBAR ######
+ kwargs.update(sidebar(conf=conf))
+
+ return render(request, 'abs_conf.html', kwargs)
+
+def abs_conf_edit(request, id_conf):
+
+ conf = get_object_or_404(ABSConfiguration, pk=id_conf)
+ beams_list = ast.literal_eval(conf.beams)
+ i = 1
+ beams = []
+ for b in beams_list:
+ beam = ABSBeam.objects.get(pk=beams_list['beam'+str(i)])
+ beams.append(beam)
+ i=i+1
+
+ if request.method=='GET':
+ form = ABSConfigurationForm(instance=conf)
+
+ if request.method=='POST':
+ form = ABSConfigurationForm(request.POST, instance=conf)
+
+ if form.is_valid():
+ conf = form.save(commit=False)
+ conf.save()
+ return redirect('url_abs_conf', id_conf=conf.id)
+
+ ###### SIDEBAR ######
+ kwargs = {}
+
+ kwargs['dev_conf'] = conf
+ #kwargs['id_dev'] = conf.id
+ kwargs['id_conf'] = conf.id
+ kwargs['form'] = form
+ kwargs['abs_beams'] = beams
+ kwargs['title'] = 'Device Configuration'
+ kwargs['suptitle'] = 'Edit'
+ kwargs['button'] = 'Save'
+
+ kwargs['edit'] = True
+
+ return render(request, 'abs_conf_edit.html', kwargs)
+
+
+def plot_patterns(request, id_conf):
+
+ conf = get_object_or_404(ABSConfiguration, pk=id_conf)
+ beams_list = ast.literal_eval(conf.beams)
+ i = 1
+ beams = []
+ for b in beams_list:
+ beam = ABSBeam.objects.get(pk=beams_list['beam'+str(i)])
+ beams.append(beam)
+ i=i+1
+
+ ###### SIDEBAR ######
+ kwargs = {}
+
+ kwargs['dev_conf'] = conf.device
+ kwargs['id_dev'] = conf.device
+ kwargs['id_conf'] = conf.id
+ kwargs['abs_beams'] = beams
+ kwargs['title'] = 'ABS Patterns'
+ kwargs['suptitle'] = conf.name
+ kwargs['no_sidebar'] = True
+
+ return render(request, 'abs_patterns.html', kwargs)
+
+def add_beam(request, id_conf):
+
+ conf = get_object_or_404(ABSConfiguration, pk=id_conf)
+ confs = Configuration.objects.all()
+
+ if request.method=='GET':
+ #form = ABSBeamEditForm()
+ form = ABSBeamAddForm()
+
+ if request.method=='POST':
+ form = ABSBeamAddForm(request.POST)
+
+ beam_data = get_values_from_form(request.POST)
+
+ new_beam = ABSBeam(
+ name =beam_data['name'],
+ antenna =json.dumps(beam_data['antenna']),
+ abs_conf=conf,
+ tx =json.dumps(beam_data['tx']),
+ rx =json.dumps(beam_data['rx']),
+ ues =json.dumps(beam_data['ues']),
+ only_rx =json.dumps(beam_data['only_rx'])
+ )
+ new_beam.save()
+ #---Update 6bits configuration and add beam to abs configuration beams list.
+ new_beam.modules_6bits()
+ new_beam.add_beam2list()
+ messages.success(request, 'Beam: "%s" has been added.' % new_beam.name)
+
+ return redirect('url_edit_abs_conf', conf.id)
+
+ ###### SIDEBAR ######
+ kwargs = {}
+
+ #kwargs['dev_conf'] = conf.device
+ #kwargs['id_dev'] = conf.device
+ kwargs['id_conf'] = conf.id
+ kwargs['form'] = form
+ kwargs['title'] = 'ABS Beams'
+ kwargs['suptitle'] = 'Add Beam'
+ kwargs['button'] = 'Add'
+ kwargs['no_sidebar'] = True
+
+ #kwargs['previous'] = conf.get_absolute_url_edit()
+ kwargs['edit'] = True
+
+ return render(request, 'abs_add_beam.html', kwargs)
+
+
+def edit_beam(request, id_conf, id_beam):
+
+ conf = get_object_or_404(ABSConfiguration, pk=id_conf)
+ beam = get_object_or_404(ABSBeam, pk=id_beam)
+
+ if request.method=='GET':
+ form = ABSBeamEditForm(initial={'beam': beam})
+
+ if request.method=='POST':
+ form = ABSBeamEditForm(request.POST)
+
+ beam_data = get_values_from_form(request.POST)
+
+ beam.dict_to_parms(beam_data)
+ beam.save()
+
+ messages.success(request, 'Beam: "%s" has been updated.' % beam.name)
+
+ return redirect('url_edit_abs_conf', conf.id)
+
+ ###### SIDEBAR ######
+ kwargs = {}
+
+ kwargs['id_conf'] = conf.id
+ kwargs['form'] = form
+ kwargs['title'] = 'ABS Beams'
+ kwargs['suptitle'] = 'Edit Beam'
+ kwargs['button'] = 'Save'
+ kwargs['no_sidebar'] = True
+
+ #kwargs['previous'] = conf.get_absolute_url_edit()
+ kwargs['edit'] = True
+
+ return render(request, 'abs_add_beam.html', kwargs)
+
+
+
+def remove_beam(request, id_conf, id_beam):
+
+ conf = get_object_or_404(ABSConfiguration, pk=id_conf)
+ beam = get_object_or_404(ABSBeam, pk=id_beam)
+
+ if request.method=='POST':
+ if beam:
+ try:
+ beam.remove_beamfromlist()
+ beam.delete()
+ messages.success(request, 'Beam: "%s" has been deleted.' % beam)
+ except:
+ messages.error(request, 'Unable to delete beam: "%s".' % beam)
+
+ return redirect('url_edit_abs_conf', conf.id)
+
+ ###### SIDEBAR ######
+ kwargs = {}
+
+ kwargs['object'] = beam
+ kwargs['delete'] = True
+ kwargs['title'] = 'Delete'
+ kwargs['suptitle'] = 'Beam'
+ kwargs['previous'] = conf.get_absolute_url_edit()
+ return render(request, 'confirm.html', kwargs)