@@ -0,0 +1,13 | |||||
|
1 | ||||
|
2 | function freq2Binary(mclock, frequency) { | |||
|
3 | ||||
|
4 | var freq_bin = parseInt(frequency * (Math.pow(2,48)/mclock)); | |||
|
5 | return freq_bin; | |||
|
6 | ||||
|
7 | } | |||
|
8 | ||||
|
9 | function binary2Freq(mclock, binary) { | |||
|
10 | ||||
|
11 | var frequency = (1.0*binary) / (Math.pow(2,48)/mclock); | |||
|
12 | return frequency; | |||
|
13 | } No newline at end of file |
@@ -3,4 +3,8 from django.conf.urls import url | |||||
3 | urlpatterns = ( |
|
3 | urlpatterns = ( | |
4 | url(r'^(?P<id_conf>-?\d+)/$', 'apps.main.views.dev_conf', name='url_abs_conf'), |
|
4 | url(r'^(?P<id_conf>-?\d+)/$', 'apps.main.views.dev_conf', name='url_abs_conf'), | |
5 | url(r'^(?P<id_conf>-?\d+)/edit/$', 'apps.main.views.dev_conf_edit', name='url_edit_abs_conf'), |
|
5 | url(r'^(?P<id_conf>-?\d+)/edit/$', 'apps.main.views.dev_conf_edit', name='url_edit_abs_conf'), | |
|
6 | url(r'^(?P<id_conf>-?\d+)/write/$', 'apps.main.views.dev_conf_write', name='url_write_abs_conf'), | |||
|
7 | url(r'^(?P<id_conf>-?\d+)/read/$', 'apps.main.views.dev_conf_read', name='url_read_abs_conf'), | |||
|
8 | url(r'^(?P<id_conf>-?\d+)/import/$', 'apps.main.views.dev_conf_import', name='url_import_abs_conf'), | |||
|
9 | url(r'^(?P<id_conf>-?\d+)/export/$', 'apps.main.views.dev_conf_export', name='url_export_abs_conf'), | |||
6 |
) |
|
10 | ) |
@@ -5,5 +5,9 urlpatterns = ( | |||||
5 | # url(r'^(?P<id>-?\d+)/$', 'apps.cgs.views.configurate_frequencies', name='new_device'), |
|
5 | # url(r'^(?P<id>-?\d+)/$', 'apps.cgs.views.configurate_frequencies', name='new_device'), | |
6 | url(r'^(?P<id_conf>-?\d+)/$', 'apps.main.views.dev_conf', name='url_cgs_conf'), |
|
6 | url(r'^(?P<id_conf>-?\d+)/$', 'apps.main.views.dev_conf', name='url_cgs_conf'), | |
7 | url(r'^(?P<id_conf>-?\d+)/edit/$', 'apps.main.views.dev_conf_edit', name='url_edit_cgs_conf'), |
|
7 | url(r'^(?P<id_conf>-?\d+)/edit/$', 'apps.main.views.dev_conf_edit', name='url_edit_cgs_conf'), | |
|
8 | url(r'^(?P<id_conf>-?\d+)/write/$', 'apps.main.views.dev_conf_write', name='url_write_cgs_conf'), | |||
|
9 | url(r'^(?P<id_conf>-?\d+)/read/$', 'apps.main.views.dev_conf_read', name='url_read_cgs_conf'), | |||
|
10 | url(r'^(?P<id_conf>-?\d+)/import/$', 'apps.main.views.dev_conf_import', name='url_import_cgs_conf'), | |||
|
11 | url(r'^(?P<id_conf>-?\d+)/export/$', 'apps.main.views.dev_conf_export', name='url_export_cgs_conf'), | |||
8 | ) |
|
12 | ) | |
9 |
|
13 |
@@ -6,7 +6,6 from django.core.validators import MinValueValidator, MaxValueValidator | |||||
6 | from django.core.exceptions import ValidationError |
|
6 | from django.core.exceptions import ValidationError | |
7 |
|
7 | |||
8 | MOD_TYPES = ( |
|
8 | MOD_TYPES = ( | |
9 | (None, 'Select a modulation type'), |
|
|||
10 | (0, 'Single Tone'), |
|
9 | (0, 'Single Tone'), | |
11 | (1, 'FSK'), |
|
10 | (1, 'FSK'), | |
12 | (2, 'Ramped FSK'), |
|
11 | (2, 'Ramped FSK'), | |
@@ -18,24 +17,24 class DDSConfiguration(Configuration): | |||||
18 |
|
17 | |||
19 | DDS_NBITS = 48 |
|
18 | DDS_NBITS = 48 | |
20 |
|
19 | |||
21 | clock = models.FloatField(verbose_name='Clock Master (MHz)',validators=[MinValueValidator(5), MaxValueValidator(75)]) |
|
20 | clock = models.FloatField(verbose_name='Clock Master (MHz)',validators=[MinValueValidator(5), MaxValueValidator(75)], null=True) | |
22 | multiplier = models.PositiveIntegerField(verbose_name='Multiplier',validators=[MinValueValidator(1), MaxValueValidator(20)], default=4) |
|
21 | multiplier = models.PositiveIntegerField(verbose_name='Multiplier',validators=[MinValueValidator(1), MaxValueValidator(20)], default=4) | |
23 |
|
22 | |||
24 |
frequency = models.DecimalField(verbose_name='Frequency (MHz)', validators=[MinValueValidator(0), MaxValueValidator(150)], max_digits=1 |
|
23 | frequency = models.DecimalField(verbose_name='Frequency (MHz)', validators=[MinValueValidator(0), MaxValueValidator(150)], max_digits=18, decimal_places=16) | |
25 | frequency_bin = models.BigIntegerField(verbose_name='Frequency (Binary)',validators=[MinValueValidator(0), MaxValueValidator(2**DDS_NBITS-1)]) |
|
24 | frequency_bin = models.BigIntegerField(verbose_name='Frequency (Binary)',validators=[MinValueValidator(0), MaxValueValidator(2**DDS_NBITS-1)]) | |
26 |
|
25 | |||
27 | phase = models.FloatField(verbose_name='Phase (Degrees)', validators=[MinValueValidator(0), MaxValueValidator(360)]) |
|
26 | phase = models.FloatField(verbose_name='Phase (Degrees)', validators=[MinValueValidator(0), MaxValueValidator(360)], default=0) | |
28 | # phase_binary = models.PositiveIntegerField(verbose_name='Phase (Binary)',validators=[MinValueValidator(0), MaxValueValidator(2**14-1)]) |
|
27 | # phase_binary = models.PositiveIntegerField(verbose_name='Phase (Binary)',validators=[MinValueValidator(0), MaxValueValidator(2**14-1)]) | |
29 |
|
28 | |||
30 | amplitude_ch_A = models.PositiveIntegerField(verbose_name='Amplitude CHA',validators=[MinValueValidator(0), MaxValueValidator(2**10-1)], blank=True, null=True) |
|
29 | amplitude_ch_A = models.PositiveIntegerField(verbose_name='Amplitude CH A',validators=[MinValueValidator(0), MaxValueValidator(2**10-1)], blank=True, null=True) | |
31 | amplitude_ch_B = models.PositiveIntegerField(verbose_name='Amplitude CHB',validators=[MinValueValidator(0), MaxValueValidator(2**10-1)], blank=True, null=True) |
|
30 | amplitude_ch_B = models.PositiveIntegerField(verbose_name='Amplitude CH B',validators=[MinValueValidator(0), MaxValueValidator(2**10-1)], blank=True, null=True) | |
32 |
|
31 | |||
33 | modulation = models.PositiveIntegerField(choices = MOD_TYPES, default = 0) |
|
32 | modulation = models.PositiveIntegerField(verbose_name='Modulation Type', choices = MOD_TYPES, default = 0) | |
34 |
|
33 | |||
35 |
frequency_mod = models.DecimalField(verbose_name='Frequency |
|
34 | frequency_mod = models.DecimalField(verbose_name='Mod: Frequency (MHz)', validators=[MinValueValidator(0), MaxValueValidator(150)], max_digits=18, decimal_places=16, blank=True, null=True) | |
36 |
frequency_mod_bin = models.BigIntegerField(verbose_name='Frequency |
|
35 | frequency_mod_bin = models.BigIntegerField(verbose_name='Mod: Frequency (Binary)',validators=[MinValueValidator(0), MaxValueValidator(2**DDS_NBITS-1)], blank=True, null=True) | |
37 |
|
36 | |||
38 |
phase_mod = models.FloatField(verbose_name='Phase |
|
37 | phase_mod = models.FloatField(verbose_name='Mod: Phase (Degrees)', validators=[MinValueValidator(0), MaxValueValidator(360)], blank=True, null=True) | |
39 | # phase_binary_mod = models.PositiveIntegerField(verbose_name='Phase Mod (Binary)',validators=[MinValueValidator(0), MaxValueValidator(2**14-1)], blank=True, null=True) |
|
38 | # phase_binary_mod = models.PositiveIntegerField(verbose_name='Phase Mod (Binary)',validators=[MinValueValidator(0), MaxValueValidator(2**14-1)], blank=True, null=True) | |
40 |
|
39 | |||
41 | def get_nbits(self): |
|
40 | def get_nbits(self): |
@@ -1,68 +1,1 | |||||
1 |
{% extends " |
|
1 | {% extends "dev_conf.html" %} No newline at end of file | |
2 | {% load bootstrap3 %} |
|
|||
3 | {% load static %} |
|
|||
4 | {% load main_tags %} |
|
|||
5 |
|
||||
6 | {% block conf-active %}active{% endblock %} |
|
|||
7 |
|
||||
8 | {% block content-title %}{{title}}{% endblock %} |
|
|||
9 | {% block content-suptitle %}{{suptitle}}{% endblock %} |
|
|||
10 |
|
||||
11 | {% block content %} |
|
|||
12 |
|
||||
13 | <table class="table table-bordered"> |
|
|||
14 | <tr><th>Status</th><td>{%if connected == True %} ☘ Connected {% else %} ⛔ Disconnected {% endif %}</td></tr> |
|
|||
15 | {% for item in dev_conf_keys %} |
|
|||
16 | <tr><th>{{item|title}}</th><td>{{dev_conf|attr:item}}</td></tr> |
|
|||
17 | {% endfor %} |
|
|||
18 |
|
||||
19 | <tr><th>{{form.modulation.label}}</th><td>{{form.modulation}}</td></tr> |
|
|||
20 |
|
||||
21 | {% if form.modulation.value == 0 %} |
|
|||
22 | {% endif %} |
|
|||
23 |
|
||||
24 | {% if form.modulation.value == 1 %} |
|
|||
25 | <tr><th>{{form.frequency_mod.label}}</th><td>{{form.frequency_mod.value}}</td></tr> |
|
|||
26 | {% endif %} |
|
|||
27 |
|
||||
28 | {% if form.modulation.value == 2 %} |
|
|||
29 | <tr><th>{{form.frequency_mod.label}}</th><td>{{form.frequency_mod.value}}</td></tr> |
|
|||
30 | {% endif %} |
|
|||
31 |
|
||||
32 | {% if form.modulation.value == 3 %} |
|
|||
33 | <tr><th>{{form.frequency_mod.label}}</th><td>{{form.frequency_mod.value}}</td></tr> |
|
|||
34 | {% endif %} |
|
|||
35 |
|
||||
36 | {% if form.modulation.value == 4 %} |
|
|||
37 | <tr><th>{{form.phase_mod.label}}</th><td>{{form.phase_mod.value}}</td></tr> |
|
|||
38 | {% endif %} |
|
|||
39 | </table> |
|
|||
40 |
|
||||
41 | <button class="btn btn-primary pull-right" style="margin-left: 10px" id="bt_read">Read</button> |
|
|||
42 | <button class="btn btn-primary pull-right" style="margin-left: 10px" id="bt_write">Write</button> |
|
|||
43 | <button class="btn btn-primary pull-left" style="margin-left: 10px" id="bt_export">Export</button> |
|
|||
44 | <button class="btn btn-primary pull-left" style="margin-left: 10px" id="bt_edit">Edit</button> |
|
|||
45 | <br></br> |
|
|||
46 | {% endblock %} |
|
|||
47 |
|
||||
48 | {% block sidebar%} |
|
|||
49 | {% include "sidebar_devices.html" %} |
|
|||
50 | {% endblock %} |
|
|||
51 |
|
||||
52 | {% block extra-js%} |
|
|||
53 | <script type="text/javascript"> |
|
|||
54 |
|
||||
55 | $("#bt_edit").click(function() { |
|
|||
56 | document.location = "{% url 'url_edit_dds_conf' dev_conf.id%}"; |
|
|||
57 | }); |
|
|||
58 |
|
||||
59 | $("#bt_write").click(function() { |
|
|||
60 | document.location = "{% url 'url_dds_conf_write' dev_conf.id%}"; |
|
|||
61 | }); |
|
|||
62 |
|
||||
63 | $("#bt_read").click(function() { |
|
|||
64 | document.location = "{% url 'url_dds_conf_read' dev_conf.id%}"; |
|
|||
65 | }); |
|
|||
66 |
|
||||
67 | </script> |
|
|||
68 | {% endblock %} No newline at end of file |
|
@@ -4,6 +4,7 | |||||
4 | {% load main_tags %} |
|
4 | {% load main_tags %} | |
5 |
|
5 | |||
6 | {% block extra-js%} |
|
6 | {% block extra-js%} | |
|
7 | <script src="{% static 'js/dds_conversion.js' %}"></script> | |||
7 | <script type="text/javascript"> |
|
8 | <script type="text/javascript"> | |
8 |
|
9 | |||
9 | $("#bt_cancel").click(function() { |
|
10 | $("#bt_cancel").click(function() { | |
@@ -11,7 +12,7 | |||||
11 | }); |
|
12 | }); | |
12 |
|
13 | |||
13 | $("#bt_read").click(function() { |
|
14 | $("#bt_read").click(function() { | |
14 |
document.location = "{% url 'url_dds_conf |
|
15 | document.location = "{% url 'url_read_dds_conf' id_dev%}"; | |
15 | }); |
|
16 | }); | |
16 |
|
17 | |||
17 | $("#id_clock").on('change', function() { |
|
18 | $("#id_clock").on('change', function() { | |
@@ -46,16 +47,15 | |||||
46 | var freq_mod = $("#id_frequency_mod").val(); |
|
47 | var freq_mod = $("#id_frequency_mod").val(); | |
47 |
|
48 | |||
48 | var mclock = clock*multiplier; |
|
49 | var mclock = clock*multiplier; | |
49 | var k = Math.pow(2,48)/mclock; |
|
|||
50 |
|
50 | |||
51 |
var freq_bin = |
|
51 | var freq_bin = freq2Binary(mclock, freq); | |
52 |
var freq_mod_bin = |
|
52 | var freq_mod_bin = freq2Binary(mclock, freq_mod); | |
53 |
|
53 | |||
54 | $("#id_frequency_bin").val(freq_bin); |
|
54 | $("#id_frequency_bin").val(freq_bin); | |
55 | $("#id_frequency_mod_bin").val(freq_mod_bin); |
|
55 | $("#id_frequency_mod_bin").val(freq_mod_bin); | |
56 |
|
56 | |||
57 |
freq = freq_bin |
|
57 | freq = binary2Freq(mclock, freq_bin); | |
58 |
freq_mod = freq_mod_bin |
|
58 | freq_mod = binary2Freq(mclock, freq_mod_bin); | |
59 |
|
59 | |||
60 | $("#id_frequency").val(freq); |
|
60 | $("#id_frequency").val(freq); | |
61 | $("#id_frequency_mod").val(freq_mod); |
|
61 | $("#id_frequency_mod").val(freq_mod); | |
@@ -70,20 +70,13 | |||||
70 | var freq_mod_bin = $("#id_frequency_mod_bin").val(); |
|
70 | var freq_mod_bin = $("#id_frequency_mod_bin").val(); | |
71 |
|
71 | |||
72 | var mclock = clock*multiplier; |
|
72 | var mclock = clock*multiplier; | |
73 | var k = Math.pow(2,48)/mclock; |
|
|||
74 |
|
73 | |||
75 |
var freq = |
|
74 | var freq = binary2Freq(mclock, freq_bin); | |
76 |
var freq_mod = |
|
75 | var freq_mod = binary2Freq(mclock, freq_mod_bin); | |
77 |
|
76 | |||
78 | $("#id_frequency").val(freq); |
|
77 | $("#id_frequency").val(freq); | |
79 | $("#id_frequency_mod").val(freq_mod); |
|
78 | $("#id_frequency_mod").val(freq_mod); | |
80 |
|
79 | |||
81 | var freq_bin = parseInt(freq*k); |
|
|||
82 | var freq_mod_bin = parseInt(freq_mod*k); |
|
|||
83 |
|
||||
84 | $("#id_frequency_bin").val(freq_bin); |
|
|||
85 | $("#id_frequency_mod_bin").val(freq_mod_bin); |
|
|||
86 |
|
||||
87 | } |
|
80 | } | |
88 |
|
81 | |||
89 | </script> |
|
82 | </script> |
@@ -4,6 +4,8 urlpatterns = ( | |||||
4 | url(r'^(?P<id_conf>-?\d+)/$', 'apps.dds.views.dds_conf', name='url_dds_conf'), |
|
4 | url(r'^(?P<id_conf>-?\d+)/$', 'apps.dds.views.dds_conf', name='url_dds_conf'), | |
5 | url(r'^(?P<id_conf>-?\d+)/(?P<message>-?\d+)/$', 'apps.dds.views.dds_conf', name='url_dds_conf'), |
|
5 | url(r'^(?P<id_conf>-?\d+)/(?P<message>-?\d+)/$', 'apps.dds.views.dds_conf', name='url_dds_conf'), | |
6 | url(r'^(?P<id_conf>-?\d+)/edit/$', 'apps.dds.views.dds_conf_edit', name='url_edit_dds_conf'), |
|
6 | url(r'^(?P<id_conf>-?\d+)/edit/$', 'apps.dds.views.dds_conf_edit', name='url_edit_dds_conf'), | |
7 |
url(r'^(?P<id_conf>-?\d+)/write/$', 'apps.dds.views.dds_conf_write', name='url_dds_conf |
|
7 | url(r'^(?P<id_conf>-?\d+)/write/$', 'apps.dds.views.dds_conf_write', name='url_write_dds_conf'), | |
8 |
url(r'^(?P<id_conf>-?\d+)/read/$', 'apps.dds.views.dds_conf_read', name='url_dds_conf |
|
8 | url(r'^(?P<id_conf>-?\d+)/read/$', 'apps.dds.views.dds_conf_read', name='url_read_dds_conf'), | |
|
9 | url(r'^(?P<id_conf>-?\d+)/import/$', 'apps.main.views.dev_conf_import', name='url_import_dds_conf'), | |||
|
10 | url(r'^(?P<id_conf>-?\d+)/export/$', 'apps.main.views.dev_conf_export', name='url_export_dds_conf'), | |||
9 | ) |
|
11 | ) |
@@ -2,40 +2,36 | |||||
2 | from django.contrib import messages |
|
2 | from django.contrib import messages | |
3 | from django.shortcuts import redirect, render, get_object_or_404 |
|
3 | from django.shortcuts import redirect, render, get_object_or_404 | |
4 |
|
4 | |||
5 | from apps.main.models import Experiment, Configuration |
|
5 | # from apps.main.models import Experiment, Configuration | |
6 | from apps.main.views import sidebar |
|
6 | from apps.main.views import sidebar | |
7 |
|
7 | |||
8 | from .models import DDSConfiguration |
|
8 | from .models import DDSConfiguration | |
9 | from .forms import DDSConfigurationForm |
|
9 | from .forms import DDSConfigurationForm | |
10 | # Create your views here. |
|
10 | # Create your views here. | |
11 |
|
11 | |||
12 |
from radarsys_api import |
|
12 | from radarsys_api import dds | |
13 |
|
13 | |||
14 | def dds_conf(request, id_conf): |
|
14 | def dds_conf(request, id_conf): | |
15 |
|
15 | |||
16 | conf = get_object_or_404(DDSConfiguration, pk=id_conf) |
|
16 | conf = get_object_or_404(DDSConfiguration, pk=id_conf) | |
17 |
|
17 | |||
18 | if request.method=='GET': |
|
|||
19 | form = DDSConfigurationForm(instance=conf) |
|
|||
20 |
|
||||
21 | answer = dds.echo(ip=str(conf.device.ip_address), port=conf.device.port_address) |
|
18 | answer = dds.echo(ip=str(conf.device.ip_address), port=conf.device.port_address) | |
22 |
|
19 | |||
23 | kwargs = {} |
|
20 | kwargs = {} | |
24 |
kwargs['connected'] = (answer[0] == "1") |
|
21 | kwargs['connected'] = (answer[0] == "1") | |
25 | kwargs['form'] = form |
|
|||
26 |
|
22 | |||
27 | kwargs['dev_conf'] = conf |
|
23 | kwargs['dev_conf'] = conf | |
28 | kwargs['dev_conf_keys'] = ['experiment', 'device', |
|
24 | kwargs['dev_conf_keys'] = ['experiment', 'device', | |
29 | 'clock', 'multiplier', |
|
25 | 'clock', 'multiplier', | |
30 | 'frequency', |
|
26 | 'frequency', | |
31 |
|
|
27 | 'frequency_bin', | |
32 | 'phase', |
|
28 | 'phase', | |
33 | # 'phase_binary', |
|
29 | # 'phase_binary', | |
34 |
'amplitude_ch_A', 'amplitude_ch_B' |
|
30 | 'amplitude_ch_A', 'amplitude_ch_B', | |
35 |
|
|
31 | 'modulation', | |
36 |
|
|
32 | 'frequency_mod', | |
37 |
|
|
33 | 'frequency_mod_bin', | |
38 |
|
|
34 | 'phase_mod'] | |
39 | # 'phase_binary_mod'] |
|
35 | # 'phase_binary_mod'] | |
40 |
|
36 | |||
41 | kwargs['title'] = 'DDS Configuration' |
|
37 | kwargs['title'] = 'DDS Configuration' | |
@@ -74,7 +70,6 def dds_conf_edit(request, id_conf): | |||||
74 | kwargs['title'] = 'Device Configuration' |
|
70 | kwargs['title'] = 'Device Configuration' | |
75 | kwargs['suptitle'] = 'Edit' |
|
71 | kwargs['suptitle'] = 'Edit' | |
76 | kwargs['button'] = 'Save' |
|
72 | kwargs['button'] = 'Save' | |
77 | kwargs['dds_nbits'] = conf.get_nbits() |
|
|||
78 |
|
73 | |||
79 | ###### SIDEBAR ###### |
|
74 | ###### SIDEBAR ###### | |
80 | kwargs.update(sidebar(conf)) |
|
75 | kwargs.update(sidebar(conf)) | |
@@ -99,6 +94,12 def dds_conf_write(request, id_conf): | |||||
99 |
|
94 | |||
100 | if answer[0] == "1": |
|
95 | if answer[0] == "1": | |
101 | messages.success(request, answer[2:]) |
|
96 | messages.success(request, answer[2:]) | |
|
97 | ||||
|
98 | conf.pk = None | |||
|
99 | conf.id = None | |||
|
100 | conf.type = 1 | |||
|
101 | conf.save() | |||
|
102 | ||||
102 | else: |
|
103 | else: | |
103 | messages.error(request, answer) |
|
104 | messages.error(request, answer) | |
104 |
|
105 | |||
@@ -119,15 +120,17 def dds_conf_read(request, id_conf): | |||||
119 | dds_model.save() |
|
120 | dds_model.save() | |
120 | return redirect('url_dds_conf', id_conf=conf.id) |
|
121 | return redirect('url_dds_conf', id_conf=conf.id) | |
121 |
|
122 | |||
122 | parms = None |
|
123 | messages.error(request, "Parameters could not be saved. Invalid parameters") | |
123 |
|
124 | |||
124 | if request.method=='GET': |
|
125 | data = {} | |
125 |
|
126 | |||
|
127 | if request.method=='GET': | |||
126 | #mult, freqA, freqB, modulation, phaseA, phaseB, amp0, amp1 |
|
128 | #mult, freqA, freqB, modulation, phaseA, phaseB, amp0, amp1 | |
127 | parms = dds.read_config(ip=conf.device.ip_address, |
|
129 | parms = dds.read_config(ip=conf.device.ip_address, | |
128 | port=conf.device.port_address) |
|
130 | port=conf.device.port_address) | |
129 |
|
131 | |||
130 |
if parms |
|
132 | if not parms: | |
|
133 | messages.error(request, "Could not read parameters from Device") | |||
131 | return redirect('url_dds_conf', id_conf=conf.id) |
|
134 | return redirect('url_dds_conf', id_conf=conf.id) | |
132 |
|
135 | |||
133 | data = {'experiment' : conf.experiment.id, |
|
136 | data = {'experiment' : conf.experiment.id, | |
@@ -153,7 +156,6 def dds_conf_read(request, id_conf): | |||||
153 | kwargs['title'] = 'Device Configuration' |
|
156 | kwargs['title'] = 'Device Configuration' | |
154 | kwargs['suptitle'] = 'Parameters read from device' |
|
157 | kwargs['suptitle'] = 'Parameters read from device' | |
155 | kwargs['button'] = 'Save' |
|
158 | kwargs['button'] = 'Save' | |
156 | kwargs['dds_nbits'] = conf.get_nbits() |
|
|||
157 |
|
159 | |||
158 | ###### SIDEBAR ###### |
|
160 | ###### SIDEBAR ###### | |
159 | kwargs.update(sidebar(conf)) |
|
161 | kwargs.update(sidebar(conf)) |
@@ -4,4 +4,8 urlpatterns = ( | |||||
4 | # url(r'^(?P<id>-?\d+)/$', 'apps.jars.views.jars_config', name='jars'), |
|
4 | # url(r'^(?P<id>-?\d+)/$', 'apps.jars.views.jars_config', name='jars'), | |
5 | url(r'^(?P<id_conf>-?\d+)/$', 'apps.main.views.dev_conf', name='url_jars_conf'), |
|
5 | url(r'^(?P<id_conf>-?\d+)/$', 'apps.main.views.dev_conf', name='url_jars_conf'), | |
6 | url(r'^(?P<id_conf>-?\d+)/edit/$', 'apps.main.views.dev_conf_edit', name='url_edit_jars_conf'), |
|
6 | url(r'^(?P<id_conf>-?\d+)/edit/$', 'apps.main.views.dev_conf_edit', name='url_edit_jars_conf'), | |
|
7 | url(r'^(?P<id_conf>-?\d+)/write/$', 'apps.main.views.dev_conf_write', name='url_write_jars_conf'), | |||
|
8 | url(r'^(?P<id_conf>-?\d+)/read/$', 'apps.main.views.dev_conf_read', name='url_read_jars_conf'), | |||
|
9 | url(r'^(?P<id_conf>-?\d+)/import/$', 'apps.main.views.dev_conf_import', name='url_import_jars_conf'), | |||
|
10 | url(r'^(?P<id_conf>-?\d+)/export/$', 'apps.main.views.dev_conf_export', name='url_export_jars_conf'), | |||
7 | ) |
|
11 | ) |
@@ -2,6 +2,8 from django.shortcuts import render_to_response | |||||
2 | from django.template import RequestContext |
|
2 | from django.template import RequestContext | |
3 |
|
3 | |||
4 | from apps.main.models import Device |
|
4 | from apps.main.models import Device | |
|
5 | from apps.main.views import sidebar | |||
|
6 | ||||
5 | from .models import JARSConfiguration |
|
7 | from .models import JARSConfiguration | |
6 | from .forms import JARSConfigurationForm |
|
8 | from .forms import JARSConfigurationForm | |
7 | # Create your views here. |
|
9 | # Create your views here. | |
@@ -15,16 +17,17 def jars_config(request, id): | |||||
15 | for device in devices: |
|
17 | for device in devices: | |
16 | if device['device_type__name']=='jars': |
|
18 | if device['device_type__name']=='jars': | |
17 | device['active'] = 'active' |
|
19 | device['active'] = 'active' | |
18 | form = JARSConfigurationForm(instance=conf) |
|
20 | # form = JARSConfigurationForm(instance=conf) | |
19 | else: |
|
21 | # else: | |
20 | form = JARSConfigurationForm() |
|
22 | # form = JARSConfigurationForm() | |
21 |
|
23 | |||
22 | kwargs = { |
|
24 | kwargs = { | |
23 | 'form': form, |
|
|||
24 | 'devices':devices, |
|
|||
25 | 'dev_conf': conf |
|
25 | 'dev_conf': conf | |
26 | } |
|
26 | } | |
27 |
|
27 | |||
|
28 | ###### SIDEBAR ###### | |||
|
29 | kwargs.update(sidebar(conf)) | |||
|
30 | ||||
28 | return render_to_response('jars.html', kwargs, context_instance=RequestContext(request)) |
|
31 | return render_to_response('jars.html', kwargs, context_instance=RequestContext(request)) | |
29 |
|
32 | |||
30 |
|
33 |
@@ -110,3 +110,22 class Configuration(PolymorphicModel): | |||||
110 | from django.core.urlresolvers import reverse |
|
110 | from django.core.urlresolvers import reverse | |
111 | return reverse('url_%s_conf' % self.device.device_type.name, args=[str(self.id)]) |
|
111 | return reverse('url_%s_conf' % self.device.device_type.name, args=[str(self.id)]) | |
112 |
|
112 | |||
|
113 | def get_absolute_url_edit(self): | |||
|
114 | from django.core.urlresolvers import reverse | |||
|
115 | return reverse('url_edit_%s_conf' % self.device.device_type.name, args=[str(self.id)]) | |||
|
116 | ||||
|
117 | def get_absolute_url_import(self): | |||
|
118 | from django.core.urlresolvers import reverse | |||
|
119 | return reverse('url_import_%s_conf' % self.device.device_type.name, args=[str(self.id)]) | |||
|
120 | ||||
|
121 | def get_absolute_url_export(self): | |||
|
122 | from django.core.urlresolvers import reverse | |||
|
123 | return reverse('url_export_%s_conf' % self.device.device_type.name, args=[str(self.id)]) | |||
|
124 | ||||
|
125 | def get_absolute_url_write(self): | |||
|
126 | from django.core.urlresolvers import reverse | |||
|
127 | return reverse('url_write_%s_conf' % self.device.device_type.name, args=[str(self.id)]) | |||
|
128 | ||||
|
129 | def get_absolute_url_read(self): | |||
|
130 | from django.core.urlresolvers import reverse | |||
|
131 | return reverse('url_read_%s_conf' % self.device.device_type.name, args=[str(self.id)]) No newline at end of file |
@@ -90,9 +90,10 | |||||
90 | <strong>{{message.tags|title}}!</strong> {{ message }} |
|
90 | <strong>{{message.tags|title}}!</strong> {{ message }} | |
91 | </div> |
|
91 | </div> | |
92 |
{% endfor %} |
|
92 | {% endfor %} | |
|
93 | <br> | |||
93 | {% endif %} |
|
94 | {% endif %} | |
94 | {% endblock %} |
|
95 | {% endblock %} | |
95 | <br> |
|
96 | ||
96 | {% block content %} |
|
97 | {% block content %} | |
97 | {% endblock %} |
|
98 | {% endblock %} | |
98 | <br> |
|
99 | <br> |
@@ -11,16 +11,26 | |||||
11 | {% block content %} |
|
11 | {% block content %} | |
12 |
|
12 | |||
13 | <table class="table table-bordered"> |
|
13 | <table class="table table-bordered"> | |
14 | <tr><th>Status</th><td>{%if connected == True %} ☘ Connected {% else %} ⛔ Disconnected {% endif %}</td></tr> |
|
14 | <tr> | |
|
15 | <th>Status</th> | |||
|
16 | <td>{%if connected == True %} ☘ Connected {% else %} ⛔ Disconnected {% endif %}</td> | |||
|
17 | </tr> | |||
|
18 | ||||
15 | {% for key in dev_conf_keys %} |
|
19 | {% for key in dev_conf_keys %} | |
16 | <tr><th>{{key|title}}</th><td>{{dev_conf|attr:key}}</td></tr> |
|
20 | <tr> | |
|
21 | <th>{% get_verbose_field_name dev_conf key %}</th> | |||
|
22 | <td>{{dev_conf|attr:key}}</td> | |||
|
23 | </tr> | |||
17 | {% endfor %} |
|
24 | {% endfor %} | |
18 | </table> |
|
25 | </table> | |
19 |
|
26 | |||
20 | <button class="btn btn-primary pull-right" style="margin-left: 10px" id="bt_send">Send</button> |
|
|||
21 | <button class="btn btn-primary pull-right" style="margin-left: 10px" id="bt_export">Export</button> |
|
27 | <button class="btn btn-primary pull-right" style="margin-left: 10px" id="bt_export">Export</button> | |
|
28 | <button class="btn btn-primary pull-right" style="margin-left: 10px" id="bt_import">Import</button> | |||
22 | <button class="btn btn-primary pull-right" style="margin-left: 10px" id="bt_edit">Edit</button> |
|
29 | <button class="btn btn-primary pull-right" style="margin-left: 10px" id="bt_edit">Edit</button> | |
23 | <br></br> |
|
30 | ||
|
31 | <button class="btn btn-primary pull-left" style="margin-left: 10px" id="bt_read">Read</button> | |||
|
32 | <button class="btn btn-primary pull-left" style="margin-left: 10px" id="bt_write">Write</button> | |||
|
33 | ||||
24 | {% endblock %} |
|
34 | {% endblock %} | |
25 |
|
35 | |||
26 | {% block sidebar%} |
|
36 | {% block sidebar%} | |
@@ -31,7 +41,23 | |||||
31 | <script type="text/javascript"> |
|
41 | <script type="text/javascript"> | |
32 |
|
42 | |||
33 | $("#bt_edit").click(function() { |
|
43 | $("#bt_edit").click(function() { | |
34 |
document.location = "{ |
|
44 | document.location = "{{ dev_conf.get_absolute_url_edit }}"; | |
|
45 | }); | |||
|
46 | ||||
|
47 | $("#bt_read").click(function() { | |||
|
48 | document.location = "{{ dev_conf.get_absolute_url_read }}"; | |||
|
49 | }); | |||
|
50 | ||||
|
51 | $("#bt_write").click(function() { | |||
|
52 | document.location = "{{ dev_conf.get_absolute_url_write }}"; | |||
|
53 | }); | |||
|
54 | ||||
|
55 | $("#bt_import").click(function() { | |||
|
56 | document.location = "{{ dev_conf.get_absolute_url_import }}"; | |||
|
57 | }); | |||
|
58 | ||||
|
59 | $("#bt_export").click(function() { | |||
|
60 | document.location = "{{ dev_conf.get_absolute_url_export }}"; | |||
35 | }); |
|
61 | }); | |
36 |
|
62 | |||
37 | </script> |
|
63 | </script> |
@@ -20,7 +20,7 | |||||
20 | {% endfor%} |
|
20 | {% endfor%} | |
21 | </tr> |
|
21 | </tr> | |
22 | {% for item in configurations %} |
|
22 | {% for item in configurations %} | |
23 |
<tr class="clickable-row" data-href=" |
|
23 | <tr class="clickable-row" data-href="{{item.get_absolute_url}}"> | |
24 | <td>{{ forloop.counter }}</td> |
|
24 | <td>{{ forloop.counter }}</td> | |
25 | {% for key in configuration_keys %} |
|
25 | {% for key in configuration_keys %} | |
26 | <td>{{ item|attr:key }}</td> |
|
26 | <td>{{ item|attr:key }}</td> |
@@ -1,11 +1,25 | |||||
1 | from django.template.defaulttags import register |
|
1 | from django.template.defaulttags import register | |
2 |
|
2 | |||
3 | @register.filter |
|
3 | @register.filter | |
4 |
def attr( |
|
4 | def attr(instance, key): | |
5 | if hasattr(object, key): |
|
5 | ||
6 | return getattr(object, key) |
|
6 | display_key = "get_" + key + "_display" | |
7 | return object.get(key) |
|
7 | ||
|
8 | if hasattr(instance, display_key): | |||
|
9 | return getattr(instance, display_key)() | |||
|
10 | ||||
|
11 | if hasattr(instance, key): | |||
|
12 | return getattr(instance, key) | |||
|
13 | ||||
|
14 | return instance.get(key) | |||
8 |
|
15 | |||
9 | @register.filter |
|
16 | @register.filter | |
10 | def title(s): |
|
17 | def title(s): | |
11 | return s.replace('_', ' ').title() |
|
18 | return s.replace('_', ' ').title() | |
|
19 | ||||
|
20 | @register.simple_tag | |||
|
21 | def get_verbose_field_name(instance, field_name): | |||
|
22 | """ | |||
|
23 | Returns verbose_name for a field. | |||
|
24 | """ | |||
|
25 | return instance._meta.get_field(field_name).verbose_name.title() No newline at end of file |
@@ -1,4 +1,5 | |||||
1 | from django.shortcuts import render, redirect, get_object_or_404, HttpResponse |
|
1 | from django.shortcuts import render, redirect, get_object_or_404, HttpResponse | |
|
2 | from django.contrib import messages | |||
2 |
|
3 | |||
3 | from .forms import CampaignForm, ExperimentForm, DeviceForm, ConfigurationForm |
|
4 | from .forms import CampaignForm, ExperimentForm, DeviceForm, ConfigurationForm | |
4 | from apps.cgs.forms import CGSConfigurationForm |
|
5 | from apps.cgs.forms import CGSConfigurationForm | |
@@ -338,7 +339,7 def dev_confs(request): | |||||
338 |
|
339 | |||
339 | # keys = ['id', 'device__device_type__name', 'device__name', 'experiment__campaign__name', 'experiment__name'] |
|
340 | # keys = ['id', 'device__device_type__name', 'device__name', 'experiment__campaign__name', 'experiment__name'] | |
340 |
|
341 | |||
341 | keys = ['id', 'device', 'experiment'] |
|
342 | keys = ['id', 'device', 'experiment', 'type', 'programmed_date'] | |
342 |
|
343 | |||
343 | kwargs = {} |
|
344 | kwargs = {} | |
344 |
|
345 | |||
@@ -368,17 +369,7 def dev_conf(request, id_conf): | |||||
368 | kwargs['button'] = 'Edit Configuration' |
|
369 | kwargs['button'] = 'Edit Configuration' | |
369 |
|
370 | |||
370 | ###### SIDEBAR ###### |
|
371 | ###### SIDEBAR ###### | |
371 | experiments = Experiment.objects.filter(campaign=conf.experiment.campaign) |
|
372 | kwargs.update(sidebar(conf)) | |
372 | configurations = Configuration.objects.filter(experiment=conf.experiment) |
|
|||
373 |
|
||||
374 | exp_keys = ['id', 'campaign', 'name', 'start_time', 'end_time'] |
|
|||
375 | conf_keys = ['id', 'device__name', 'device__device_type__name', 'device__ip_address'] |
|
|||
376 |
|
||||
377 | kwargs['experiment_keys'] = exp_keys[1:] |
|
|||
378 | kwargs['experiments'] = experiments.values(*exp_keys) |
|
|||
379 |
|
||||
380 | kwargs['configuration_keys'] = conf_keys[1:] |
|
|||
381 | kwargs['configurations'] = configurations.values(*conf_keys) |
|
|||
382 |
|
373 | |||
383 | return render(request, 'dev_conf.html', kwargs) |
|
374 | return render(request, 'dev_conf.html', kwargs) | |
384 |
|
375 | |||
@@ -410,6 +401,9 def dev_conf_new(request, id_exp=0): | |||||
410 | kwargs['suptitle'] = 'New' |
|
401 | kwargs['suptitle'] = 'New' | |
411 | kwargs['button'] = 'Create' |
|
402 | kwargs['button'] = 'Create' | |
412 |
|
403 | |||
|
404 | ###### SIDEBAR ###### | |||
|
405 | kwargs.update(sidebar(conf)) | |||
|
406 | ||||
413 | return render(request, 'dev_conf_edit.html', kwargs) |
|
407 | return render(request, 'dev_conf_edit.html', kwargs) | |
414 |
|
408 | |||
415 | def dev_conf_edit(request, id_conf): |
|
409 | def dev_conf_edit(request, id_conf): | |
@@ -437,8 +431,103 def dev_conf_edit(request, id_conf): | |||||
437 | kwargs['suptitle'] = 'Edit' |
|
431 | kwargs['suptitle'] = 'Edit' | |
438 | kwargs['button'] = 'Update' |
|
432 | kwargs['button'] = 'Update' | |
439 |
|
433 | |||
|
434 | ###### SIDEBAR ###### | |||
|
435 | kwargs.update(sidebar(conf)) | |||
|
436 | ||||
440 | return render(request, 'dev_conf_edit.html', kwargs) |
|
437 | return render(request, 'dev_conf_edit.html', kwargs) | |
441 |
|
438 | |||
|
439 | def dev_conf_read(request, id_conf): | |||
|
440 | ||||
|
441 | conf = get_object_or_404(Configuration, pk=id_conf) | |||
|
442 | ||||
|
443 | DevConfModel = CONF_MODELS[conf.device.device_type.name] | |||
|
444 | dev_conf = DevConfModel.objects.get(pk=id_conf) | |||
|
445 | ||||
|
446 | kwargs = {} | |||
|
447 | kwargs['dev_conf'] = dev_conf | |||
|
448 | kwargs['dev_conf_keys'] = ['experiment', 'device'] | |||
|
449 | ||||
|
450 | kwargs['title'] = 'Configuration' | |||
|
451 | kwargs['suptitle'] = 'Details' | |||
|
452 | ||||
|
453 | kwargs['button'] = 'Edit Configuration' | |||
|
454 | ||||
|
455 | ###### SIDEBAR ###### | |||
|
456 | kwargs.update(sidebar(conf)) | |||
|
457 | ||||
|
458 | messages.error(request, "Read View not implemented yet for this configuration") | |||
|
459 | ||||
|
460 | return render(request, 'dev_conf.html', kwargs) | |||
|
461 | ||||
|
462 | def dev_conf_write(request, id_conf): | |||
|
463 | ||||
|
464 | conf = get_object_or_404(Configuration, pk=id_conf) | |||
|
465 | ||||
|
466 | DevConfModel = CONF_MODELS[conf.device.device_type.name] | |||
|
467 | dev_conf = DevConfModel.objects.get(pk=id_conf) | |||
|
468 | ||||
|
469 | kwargs = {} | |||
|
470 | kwargs['dev_conf'] = dev_conf | |||
|
471 | kwargs['dev_conf_keys'] = ['experiment', 'device'] | |||
|
472 | ||||
|
473 | kwargs['title'] = 'Configuration' | |||
|
474 | kwargs['suptitle'] = 'Details' | |||
|
475 | ||||
|
476 | kwargs['button'] = 'Edit Configuration' | |||
|
477 | ||||
|
478 | ###### SIDEBAR ###### | |||
|
479 | kwargs.update(sidebar(conf)) | |||
|
480 | ||||
|
481 | messages.error(request, "Write View not implemented yet for this configuration") | |||
|
482 | ||||
|
483 | return render(request, 'dev_conf.html', kwargs) | |||
|
484 | ||||
|
485 | def dev_conf_import(request, id_conf): | |||
|
486 | ||||
|
487 | conf = get_object_or_404(Configuration, pk=id_conf) | |||
|
488 | ||||
|
489 | DevConfModel = CONF_MODELS[conf.device.device_type.name] | |||
|
490 | dev_conf = DevConfModel.objects.get(pk=id_conf) | |||
|
491 | ||||
|
492 | kwargs = {} | |||
|
493 | kwargs['dev_conf'] = dev_conf | |||
|
494 | kwargs['dev_conf_keys'] = ['experiment', 'device'] | |||
|
495 | ||||
|
496 | kwargs['title'] = 'Configuration' | |||
|
497 | kwargs['suptitle'] = 'Details' | |||
|
498 | ||||
|
499 | kwargs['button'] = 'Edit Configuration' | |||
|
500 | ||||
|
501 | ###### SIDEBAR ###### | |||
|
502 | kwargs.update(sidebar(conf)) | |||
|
503 | ||||
|
504 | messages.error(request, "Import View not implemented yet for this configuration") | |||
|
505 | ||||
|
506 | return render(request, 'dev_conf.html', kwargs) | |||
|
507 | ||||
|
508 | def dev_conf_export(request, id_conf): | |||
|
509 | ||||
|
510 | conf = get_object_or_404(Configuration, pk=id_conf) | |||
|
511 | ||||
|
512 | DevConfModel = CONF_MODELS[conf.device.device_type.name] | |||
|
513 | dev_conf = DevConfModel.objects.get(pk=id_conf) | |||
|
514 | ||||
|
515 | kwargs = {} | |||
|
516 | kwargs['dev_conf'] = dev_conf | |||
|
517 | kwargs['dev_conf_keys'] = ['experiment', 'device'] | |||
|
518 | ||||
|
519 | kwargs['title'] = 'Configuration' | |||
|
520 | kwargs['suptitle'] = 'Details' | |||
|
521 | ||||
|
522 | kwargs['button'] = 'Edit Configuration' | |||
|
523 | ||||
|
524 | ###### SIDEBAR ###### | |||
|
525 | kwargs.update(sidebar(conf)) | |||
|
526 | ||||
|
527 | messages.error(request, "Export View not implemented yet for this configuration") | |||
|
528 | ||||
|
529 | return render(request, 'dev_conf.html', kwargs) | |||
|
530 | ||||
442 | def dev_conf_delete(request, id_conf): |
|
531 | def dev_conf_delete(request, id_conf): | |
443 |
|
532 | |||
444 | conf = get_object_or_404(Configuration, pk=id_conf) |
|
533 | conf = get_object_or_404(Configuration, pk=id_conf) | |
@@ -454,12 +543,15 def dev_conf_delete(request, id_conf): | |||||
454 | kwargs = {'object':conf, 'conf_active':'active', |
|
543 | kwargs = {'object':conf, 'conf_active':'active', | |
455 | 'url_cancel':'url_dev_conf', 'id_item':id_conf} |
|
544 | 'url_cancel':'url_dev_conf', 'id_item':id_conf} | |
456 |
|
545 | |||
|
546 | ###### SIDEBAR ###### | |||
|
547 | kwargs.update(sidebar(conf)) | |||
|
548 | ||||
457 | return render(request, 'item_delete.html', kwargs) |
|
549 | return render(request, 'item_delete.html', kwargs) | |
458 |
|
550 | |||
459 | def sidebar(conf): |
|
551 | def sidebar(conf): | |
460 |
|
552 | |||
461 | experiments = Experiment.objects.filter(campaign=conf.experiment.campaign) |
|
553 | experiments = Experiment.objects.filter(campaign=conf.experiment.campaign) | |
462 | configurations = Configuration.objects.filter(experiment=conf.experiment) |
|
554 | configurations = Configuration.objects.filter(experiment=conf.experiment, type=0) | |
463 |
|
555 | |||
464 | exp_keys = ['id', 'campaign', 'name', 'start_time', 'end_time'] |
|
556 | exp_keys = ['id', 'campaign', 'name', 'start_time', 'end_time'] | |
465 | conf_keys = ['id', 'device__name', 'device__device_type__name', 'device__ip_address'] |
|
557 | conf_keys = ['id', 'device__name', 'device__device_type__name', 'device__ip_address'] |
@@ -3,6 +3,11 from django.conf.urls import url | |||||
3 | urlpatterns = ( |
|
3 | urlpatterns = ( | |
4 | url(r'^(?P<id>-?\d+)/$', 'apps.rc.views.conf', name='url_rc_conf'), |
|
4 | url(r'^(?P<id>-?\d+)/$', 'apps.rc.views.conf', name='url_rc_conf'), | |
5 | url(r'^(?P<id>-?\d+)/edit/$', 'apps.rc.views.conf_edit', name='url_edit_rc_conf'), |
|
5 | url(r'^(?P<id>-?\d+)/edit/$', 'apps.rc.views.conf_edit', name='url_edit_rc_conf'), | |
|
6 | url(r'^(?P<id_conf>-?\d+)/write/$', 'apps.main.views.dev_conf_write', name='url_write_rc_conf'), | |||
|
7 | url(r'^(?P<id_conf>-?\d+)/read/$', 'apps.main.views.dev_conf_read', name='url_read_rc_conf'), | |||
|
8 | url(r'^(?P<id_conf>-?\d+)/import/$', 'apps.main.views.dev_conf_import', name='url_import_rc_conf'), | |||
|
9 | url(r'^(?P<id_conf>-?\d+)/export/$', 'apps.main.views.dev_conf_export', name='url_export_rc_conf'), | |||
|
10 | ||||
6 | url(r'^(?P<conf_id>-?\d+)/add_line/$', 'apps.rc.views.add_line', name='url_add_rc_line'), |
|
11 | url(r'^(?P<conf_id>-?\d+)/add_line/$', 'apps.rc.views.add_line', name='url_add_rc_line'), | |
7 | url(r'^(?P<conf_id>-?\d+)/update_lines/$', 'apps.rc.views.update_lines', name='url_update_rc_lines'), |
|
12 | url(r'^(?P<conf_id>-?\d+)/update_lines/$', 'apps.rc.views.update_lines', name='url_update_rc_lines'), | |
8 | url(r'^(?P<conf_id>-?\d+)/edit_lines/$', 'apps.rc.views.edit_lines', name='url_edit_rc_lines'), |
|
13 | url(r'^(?P<conf_id>-?\d+)/edit_lines/$', 'apps.rc.views.edit_lines', name='url_edit_rc_lines'), |
@@ -3,4 +3,8 from django.conf.urls import url | |||||
3 | urlpatterns = ( |
|
3 | urlpatterns = ( | |
4 | url(r'^(?P<id_conf>-?\d+)/$', 'apps.main.views.dev_conf', name='url_usrp_conf'), |
|
4 | url(r'^(?P<id_conf>-?\d+)/$', 'apps.main.views.dev_conf', name='url_usrp_conf'), | |
5 | url(r'^(?P<id_conf>-?\d+)/edit/$', 'apps.main.views.dev_conf_edit', name='url_edit_usrp_conf'), |
|
5 | url(r'^(?P<id_conf>-?\d+)/edit/$', 'apps.main.views.dev_conf_edit', name='url_edit_usrp_conf'), | |
|
6 | url(r'^(?P<id_conf>-?\d+)/write/$', 'apps.main.views.dev_conf_write', name='url_write_usrp_conf'), | |||
|
7 | url(r'^(?P<id_conf>-?\d+)/read/$', 'apps.main.views.dev_conf_read', name='url_read_usrp_conf'), | |||
|
8 | url(r'^(?P<id_conf>-?\d+)/import/$', 'apps.main.views.dev_conf_import', name='url_import_usrp_conf'), | |||
|
9 | url(r'^(?P<id_conf>-?\d+)/export/$', 'apps.main.views.dev_conf_export', name='url_export_usrp_conf'), | |||
6 | ) |
|
10 | ) |
General Comments 0
You need to be logged in to leave comments.
Login now