##// END OF EJS Templates
operation mode field added...
Fiorella Quino -
r194:1bba8179301f
parent child
Show More
@@ -0,0 +1,19
1 $(document).ready(function() {
2 updateOperationMode()
3 });
4
5 $("#id_operation_mode").on('change', function() {
6 updateOperationMode()
7 });
8
9 function updateOperationMode(){
10 var operation_mode = $("#id_operation_mode").val();
11 if (operation_mode==0){
12 document.getElementById("id_operation_value").disabled=true;
13 $("#id_operation_value").hide();
14 }
15 else {
16 document.getElementById("id_operation_value").disabled=false;
17 $("#id_operation_value").show();
18 }
19 }
@@ -183,8 +183,8 OPERATION_MODES = (
183 class ABSConfiguration(Configuration):
183 class ABSConfiguration(Configuration):
184 active_beam = models.CharField(verbose_name='Active Beam', max_length=20000, default="{}")
184 active_beam = models.CharField(verbose_name='Active Beam', max_length=20000, default="{}")
185 module_status = models.CharField(verbose_name='Module Status', max_length=10000, default=json.dumps(status_default))
185 module_status = models.CharField(verbose_name='Module Status', max_length=10000, default=json.dumps(status_default))
186 operation_mode = models.CharField(verbose_name='Operation Mode', max_length = 20, choices=OPERATION_MODES, default = 0)
186 operation_mode = models.PositiveSmallIntegerField(verbose_name='Operation Mode', choices=OPERATION_MODES, default = 0)
187 operation_value = models.CharField(verbose_name='Periodic (seconds)', max_length=20000, default="10", null=True, blank=True)
187 operation_value = models.FloatField(verbose_name='Periodic (seconds)', default="10", null=True, blank=True)
188
188
189 class Meta:
189 class Meta:
190 db_table = 'abs_configurations'
190 db_table = 'abs_configurations'
@@ -413,7 +413,7 class ABSConfiguration(Configuration):
413 #-------------Write each abs module-----------
413 #-------------Write each abs module-----------
414 if beams:
414 if beams:
415 beams_status = ast.literal_eval(self.module_status)
415 beams_status = ast.literal_eval(self.module_status)
416 for i in range(62,65): #(62,65)
416 for i in range(61,64): #(62,65)
417 try:
417 try:
418 answer = self.module_conf(i, beams)
418 answer = self.module_conf(i, beams)
419 beams_status[str(i)] = 1
419 beams_status[str(i)] = 1
@@ -32,6 +32,7
32
32
33
33
34 {% block extra-js%}
34 {% block extra-js%}
35 <script src="{% static 'js/abs.js' %}"></script>
35 <script type="text/javascript">
36 <script type="text/javascript">
36
37
37 $("#bt_toggle").click(function() {
38 $("#bt_toggle").click(function() {
@@ -245,7 +245,7 def send_beam(request, id_conf, id_beam):
245 beam = get_object_or_404(ABSBeam, pk=id_beam)
245 beam = get_object_or_404(ABSBeam, pk=id_beam)
246 beams_list = ABSBeam.objects.filter(abs_conf=conf)
246 beams_list = ABSBeam.objects.filter(abs_conf=conf)
247 #To set this beam as an Active Beam
247 #To set this beam as an Active Beam
248 beam.set_activebeam()
248 beam.set_as_activebeam()
249 #To send beam position to abs-modules
249 #To send beam position to abs-modules
250 i = 0
250 i = 0
251 for b in beams_list:
251 for b in beams_list:
General Comments 0
You need to be logged in to leave comments. Login now