##// END OF EJS Templates
add cgs_status command to rc/models.py to program cgs
add cgs_status command to rc/models.py to program cgs

File last commit:

r417:bd23d85743d8
r417:bd23d85743d8
Show More
models.py
1107 lines | 38.2 KiB | text/x-python | PythonLexer
ver_3Julio :: update jars and rc files
r402
Juan C. Espinoza
Update RC models, views, templates & statics...
r45 import ast
Juan C. Espinoza
Updates to models, views & forms for CR...
r25 import json
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 import requests
Juan C. Espinoza
Update RC models, views, templates & statics...
r45 import numpy as np
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 from base64 import b64encode
Juan C. Espinoza
Update RC model, RC api for testing...
r185 from struct import pack
Juan C. Espinoza
Updates to models, views & forms for CR...
r25
Juan C. Espinoza
Proyecto base en Django (refs #259) ...
r0 from django.db import models
Nueva plantilla, prueba comunicacion y nuevos campos ddsrest
r338 from django.urls import reverse
Juan C. Espinoza
Add rc config mods...
r23 from django.core.validators import MinValueValidator, MaxValueValidator
Juan C. Espinoza
Updating base models and views ...
r6 from apps.main.models import Configuration
Fiorella Quino
RC files have been updated...
r264 from apps.main.utils import Params
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 from devices.rc import api
Fiorella Quino
RC files have been updated...
r264 from apps.rc.utils import RCFile
Juan C. Espinoza
- Update rc app...
r79
Juan C. Espinoza
Updating base models and views ...
r6
Juan C. Espinoza
Add rc config mods...
r23 LINE_TYPES = (
Juan C. Espinoza
Update RC models, views, templates & statics...
r45 ('none', 'Not used'),
Juan C. Espinoza
Add rc config mods...
r23 ('tr', 'Transmission/reception selector signal'),
('tx', 'A modulating signal (Transmission pulse)'),
('codes', 'BPSK modulating signal'),
('windows', 'Sample window signal'),
('sync', 'Synchronizing signal'),
('flip', 'IPP related periodic signal'),
('prog_pulses', 'Programmable pulse'),
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 ('mix', 'Mixed line'),
Juan C. Espinoza
Add rc config mods...
r23 )
Juan C. Espinoza
- Update rc app...
r79 SAMPLING_REFS = (
('none', 'No Reference'),
Juan C. Espinoza
sync repo...
r157 ('begin_baud', 'Begin of the first baud'),
Juan C. Espinoza
- Update rc app...
r79 ('first_baud', 'Middle of the first baud'),
('sub_baud', 'Middle of the sub-baud')
)
DAT_CMDS = {
# Pulse Design commands
'DISABLE' : 0, # Disables pulse generation
'ENABLE' : 24, # Enables pulse generation
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 'DELAY_START' : 40, # Write delay status to memory
Juan C. Espinoza
- Update rc app...
r79 'FLIP_START' : 48, # Write flip status to memory
'SAMPLING_PERIOD' : 64, # Establish Sampling Period
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 'TX_ONE' : 72, # Output '0' in line TX
'TX_ZERO' : 88, # Output '0' in line TX
'SW_ONE' : 104, # Output '0' in line SW
Juan C. Espinoza
- Update rc app...
r79 'SW_ZERO' : 112, # Output '1' in line SW
'RESTART': 120, # Restarts CR8 Firmware
'CONTINUE' : 253, # Function Unknown
# Commands available to new controllers
# In Pulse Design Executable, the clock divisor code is written as 12 at the start, but it should be written as code 22(below) just before the final enable.
'CLOCK_DIVISOR_INIT' : 12, # Specifies Clock Divisor. Legacy command, ignored in the actual .dat conversion
'CLOCK_DIVISOR_LAST' : 22, # Specifies Clock Divisor (default 60 if not included) syntax: 255,22 254,N-1.
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 'CLOCK_DIVIDER' : 8,
Juan C. Espinoza
- Update rc app...
r79 }
Fiorella Quino
RC files have been updated...
r264 MAX_BITS = 8
# Rotate left: 0b1001 --> 0b0011
rol = lambda val, r_bits: \
(val << r_bits%MAX_BITS) & (2**MAX_BITS-1) | \
((val & (2**MAX_BITS-1)) >> (MAX_BITS-(r_bits%MAX_BITS)))
# Rotate right: 0b1001 --> 0b1100
ror = lambda val, r_bits: \
((val & (2**MAX_BITS-1)) >> r_bits%MAX_BITS) | \
(val << (MAX_BITS-(r_bits%MAX_BITS)) & (2**MAX_BITS-1))
Juan C. Espinoza
- Update rc app...
r79
Juan C. Espinoza
Updating base models and views ...
r6 class RCConfiguration(Configuration):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
SIR with docker-compose working
r299 ipp = models.FloatField(verbose_name='IPP [Km]', validators=[MinValueValidator(1)], default=300)
ntx = models.PositiveIntegerField(verbose_name='Number of TX', validators=[MinValueValidator(1)], default=1)
Juan C. Espinoza
Fix mix RC configurations for different ipp's...
r112 clock_in = models.FloatField(verbose_name='Clock in [MHz]', validators=[MinValueValidator(1), MaxValueValidator(80)], default=1)
Juan C. Espinoza
Update RC models, views, templates & statics...
r45 clock_divider = models.PositiveIntegerField(verbose_name='Clock divider', validators=[MinValueValidator(1), MaxValueValidator(256)], default=1)
Juan C. Espinoza
Fix mix RC configurations for different ipp's...
r112 clock = models.FloatField(verbose_name='Clock Master [MHz]', blank=True, default=1)
time_before = models.PositiveIntegerField(verbose_name='Time before [&mu;S]', default=12)
time_after = models.PositiveIntegerField(verbose_name='Time after [&mu;S]', default=1)
Juan C. Espinoza
Update RC models, views, templates & statics...
r45 sync = models.PositiveIntegerField(verbose_name='Synchro delay', default=0)
Juan C. Espinoza
- Update rc app...
r79 sampling_reference = models.CharField(verbose_name='Sampling Reference', choices=SAMPLING_REFS, default='none', max_length=40)
control_tx = models.BooleanField(verbose_name='Control Switch TX', default=False)
control_sw = models.BooleanField(verbose_name='Control Switch SW', default=False)
Juan C. Espinoza
Fix mix RC configurations for different ipp's...
r112 total_units = models.PositiveIntegerField(default=0)
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 mix = models.BooleanField(default=False)
Juan C. Espinoza
Updating base models and views ...
r6
class Meta:
db_table = 'rc_configurations'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
- Update rc app...
r79 def get_absolute_url_plot(self):
return reverse('url_plot_rc_pulses', args=[str(self.id)])
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Fix mix RC configurations for different ipp's...
r112 @property
def ipp_unit(self):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Fix mix RC configurations for different ipp's...
r112 return '{} ({})'.format(self.ipp, int(self.ipp*self.km2unit))
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
- Update rc app...
r79 @property
def us2unit(self):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
- Update rc app...
r79 return self.clock_in/self.clock_divider
@property
def km2unit(self):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
- Update rc app...
r79 return 20./3*(self.clock_in/self.clock_divider)
Juan C. Espinoza
Update several views and models in main app...
r85 def clone(self, **kwargs):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
ver_3Julio :: update jars and rc files
r402 lines = self.get_lines()
Juan C. Espinoza
Update several views and models in main app...
r85 self.pk = None
self.id = None
for attr, value in kwargs.items():
setattr(self, attr, value)
self.save()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update several views and models in main app...
r85 for line in lines:
line.clone(rc_configuration=self)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
RC files have been updated...
r264 new_lines = self.get_lines()
for line in new_lines:
line_params = json.loads(line.params)
SIR with docker-compose working
r299 if 'TX_ref' in line_params and (line_params['TX_ref'] != '0'):
Fiorella Quino
RC files have been updated...
r264 ref_line = RCLine.objects.get(pk=line_params['TX_ref'])
line_params['TX_ref'] = ['{}'.format(l.pk) for l in new_lines if l.get_name()==ref_line.get_name()][0]
line.params = json.dumps(line_params)
line.save()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 return self
Juan C. Espinoza
Update several views and models in main app...
r85
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 def get_lines(self, **kwargs):
Juan C. Espinoza
- Update rc app...
r79 '''
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 Retrieve configuration lines
Juan C. Espinoza
- Update rc app...
r79 '''
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 return RCLine.objects.filter(rc_configuration=self.pk, **kwargs)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update RC models, views, templates & statics...
r45
Juan C. Espinoza
- Update rc app...
r79 def clean_lines(self):
'''
'''
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 empty_line = RCLineType.objects.get(name='none')
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
- Update rc app...
r79 for line in self.get_lines():
line.line_type = empty_line
line.params = '{}'
line.save()
Fiorella Quino
RC files have been updated...
r264 def dict_to_parms(self, params, id=None):
Juan C. Espinoza
- Update rc app...
r79 '''
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 '''
Fiorella Quino
RC files have been updated...
r264 if id:
data = Params(params).get_conf(id_conf=id)
else:
data = Params(params).get_conf(dtype='rc')
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
gonzalesluisfrancisco
Actualizacion de la app RC a python3 y django 2, antes del merge con cambios
r341 #print(data)
Juan C. Espinoza
Update Views y several improvements
r316 # self.name = data['name']
Fiorella Quino
RC files have been updated...
r264 self.ipp = data['ipp']
self.ntx = data['ntx']
self.clock_in = data['clock_in']
self.clock_divider = data['clock_divider']
self.clock = data['clock']
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 self.time_before = data['time_before']
self.time_after = data['time_after']
self.sync = data['sync']
self.sampling_reference = data['sampling_reference']
Juan C. Espinoza
- Fix input form for delays in RCLine...
r119 self.total_units = self.ipp*self.ntx*self.km2unit
Juan C. Espinoza
Fix RCConfiguration.dict_to_params ...
r114 self.save()
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 self.clean_lines()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
gonzalesluisfrancisco
Actualizacion de la app RC a python3 y django 2, antes del merge con cambios
r341 #print(params)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 positions = {'tx':0, 'tr':0}
Fiorella Quino
RC files have been updated...
r264 for i, id in enumerate(data['lines']):
line_data = params['lines']['byId'][id]
line_type = RCLineType.objects.get(name=line_data['line_type'])
if line_type.name == 'codes':
code = RCLineCode.objects.get(name=line_data['params']['code'])
line_data['params']['code'] = code.pk
if line_type.name == 'tx':
position = positions['tx']
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 positions['tx'] += 1
Fiorella Quino
RC files have been updated...
r264 elif line_type.name == 'tr':
position = positions['tr']
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 positions['tr'] += 1
Fiorella Quino
RC files have been updated...
r264 else:
position = 0
line, dum = RCLine.objects.update_or_create(
rc_configuration=self,
channel=i,
position=position,
defaults={
'line_type': line_type,
'params': json.dumps(line_data['params'])
}
)
for i, line in enumerate(self.get_lines()):
line_params = json.loads(line.params)
if 'TX_ref' in line_params:
if line_params['TX_ref'] in (0, '0'):
line_params['TX_ref'] = '0'
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 else:
Fiorella Quino
RC files have been updated...
r264 ref_id = '{}'.format(line_params['TX_ref'])
ref_line = params['lines']['byId'][ref_id]
line_params['TX_ref'] = RCLine.objects.get(
rc_configuration=self,
params=json.dumps(ref_line['params'])
).pk
line.params = json.dumps(line_params)
gonzalesluisfrancisco
Actualizacion de la app RC a python3 y django 2, antes del merge con cambios
r341 print(line.params)
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 line.save()
gonzalesluisfrancisco
Actualizacion de la app RC a python3 y django 2, antes del merge con cambios
r341 print("Fin de dict to param")
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
- Update rc app...
r79 def get_delays(self):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 pulses = [line.pulses_as_points() for line in self.get_lines()]
Juan C. Espinoza
- Update rc app...
r79 points = [tup for tups in pulses for tup in tups]
points = set([x for tup in points for x in tup])
points = list(points)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 points.sort()
if points[0]!=0:
Juan C. Espinoza
- Update rc app...
r79 points.insert(0, 0)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
- Update rc app...
r79 return [points[i+1]-points[i] for i in range(len(points)-1)]
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 def get_pulses(self, binary=True):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
import/export functions have been updated...
r243 pulses = [line.pulses_as_points() for line in self.get_lines()]
tuples = [tup for tups in pulses for tup in tups]
Juan C. Espinoza
Update RC control methods, add change_ip for RC, fix win_reference for sub-baudio...
r236 points = set([x for tup in tuples for x in tup])
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 points = list(points)
Fiorella Quino
import/export functions have been updated...
r243 points.sort()
Juan C. Espinoza
Update RC control methods, add change_ip for RC, fix win_reference for sub-baudio...
r236 states = []
last = [0 for x in pulses]
ver_3Julio:: update cr models.py to show used memory in plot_pulses view
r410 n_pulses = len(pulses)
print('len_pulses', n_pulses)
print('len_points', len(points))
ups_arr = [[] for _ in range(n_pulses)]
dws_arr = [[] for _ in range(n_pulses)]
for i, tups in enumerate(pulses):
ups_arr[i] = [tup[0] for tup in tups if tup!=(0,0)]
dws_arr[i] = [tup[1] for tup in tups if tup!=(0,0)]
print('len_points*n_pulses',len(points)*n_pulses)
#print('ups_arr', ups_arr)
#print('dws_arr', dws_arr)
Fiorella Quino
import/export functions have been updated...
r243
add cgs_status command to rc/models.py to program cgs
r417 #####################Code for load configuration#########################
Juan C. Espinoza
Update RC control methods, add change_ip for RC, fix win_reference for sub-baudio...
r236 for x in points:
dum = []
ver_3Julio :: update jars and rc files
r402 print('loading', x*100/max(points))
add cgs_status command to rc/models.py to program cgs
r417
ver_3Julio:: update cr models.py to show used memory in plot_pulses view
r410 for i in range(n_pulses):
if x in ups_arr[i]:
Juan C. Espinoza
Update RC control methods, add change_ip for RC, fix win_reference for sub-baudio...
r236 dum.append(1)
ver_3Julio:: update cr models.py to show used memory in plot_pulses view
r410 elif x in dws_arr[i]:
Juan C. Espinoza
Update RC control methods, add change_ip for RC, fix win_reference for sub-baudio...
r236 dum.append(0)
else:
Fiorella Quino
import/export functions have been updated...
r243 dum.append(last[i])
ver_3Julio:: update cr models.py to show used memory in plot_pulses view
r410 #print(dum)
ver_3Julio :: update jars and rc files
r402 states.append(dum)
Fiorella Quino
import/export functions have been updated...
r243 last = dum
add cgs_status command to rc/models.py to program cgs
r417 print("Finish loading")
#########################################################################
ver_3Julio :: update jars and rc files
r402
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 if binary:
Juan C. Espinoza
Update RC control methods, add change_ip for RC, fix win_reference for sub-baudio...
r236 ret = []
for flips in states:
flips.reverse()
Fiorella Quino
import/export functions have been updated...
r243 ret.append(int(''.join([str(x) for x in flips]), 2))
Juan C. Espinoza
Update RC control methods, add change_ip for RC, fix win_reference for sub-baudio...
r236 states = ret
ver_3Julio:: update cr models.py to show used memory in plot_pulses view
r410 #print(states[:-1])
#print('len_states',len(states[:-1]))
Fiorella Quino
import/export functions have been updated...
r243
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 return states[:-1]
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
- Update rc app...
r79 def add_cmd(self, cmd):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
- Update rc app...
r79 if cmd in DAT_CMDS:
return (255, DAT_CMDS[cmd])
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
def add_data(self, value):
Juan C. Espinoza
- Update rc app...
r79 return (254, value-1)
Fiorella Quino
import/export functions have been updated...
r243
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 def parms_to_binary(self, dat=True):
Juan C. Espinoza
- Update rc app...
r79 '''
Create "dat" stream to be send to CR
'''
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 data = bytearray()
Juan C. Espinoza
- Update rc app...
r79 # create header
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 data.extend(self.add_cmd('DISABLE'))
data.extend(self.add_cmd('CONTINUE'))
data.extend(self.add_cmd('RESTART'))
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
- Update rc app...
r79 if self.control_sw:
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 data.extend(self.add_cmd('SW_ONE'))
Juan C. Espinoza
- Update rc app...
r79 else:
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 data.extend(self.add_cmd('SW_ZERO'))
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
- Update rc app...
r79 if self.control_tx:
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 data.extend(self.add_cmd('TX_ONE'))
Juan C. Espinoza
- Update rc app...
r79 else:
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 data.extend(self.add_cmd('TX_ZERO'))
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
- Update rc app...
r79 # write divider
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 data.extend(self.add_cmd('CLOCK_DIVIDER'))
data.extend(self.add_data(self.clock_divider))
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
- Update rc app...
r79 # write delays
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 data.extend(self.add_cmd('DELAY_START'))
Juan C. Espinoza
- Update rc app...
r79 # first delay is always zero
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 data.extend(self.add_data(1))
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 delays = self.get_delays()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
for delay in delays:
while delay>252:
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 data.extend(self.add_data(253))
Juan C. Espinoza
- Update rc app...
r79 delay -= 253
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 data.extend(self.add_data(int(delay)))
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
- Update rc app...
r79 # write flips
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 data.extend(self.add_cmd('FLIP_START'))
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Add start, stop methods to experiment, fix RC dat export file...
r240 states = self.get_pulses(binary=True)
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107
Fiorella Quino
import/export functions have been updated...
r243
Juan C. Espinoza
Add start, stop methods to experiment, fix RC dat export file...
r240 last = 0
Fiorella Quino
import/export functions have been updated...
r243 for flip, delay in zip(states, delays):
Juan C. Espinoza
Add start, stop methods to experiment, fix RC dat export file...
r240 data.extend(self.add_data((flip^last)+1))
last = flip
Juan C. Espinoza
- Update rc app...
r79 while delay>252:
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 data.extend(self.add_data(1))
Juan C. Espinoza
- Update rc app...
r79 delay -= 253
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
- Update rc app...
r79 # write sampling period
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 data.extend(self.add_cmd('SAMPLING_PERIOD'))
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 wins = self.get_lines(line_type__name='windows')
Juan C. Espinoza
- Update rc app...
r79 if wins:
win_params = json.loads(wins[0].params)['params']
if win_params:
dh = int(win_params[0]['resolution']*self.km2unit)
else:
dh = 1
else:
dh = 1
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 data.extend(self.add_data(dh))
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
- Update rc app...
r79 # write enable
Fiorella Quino
import/export functions have been updated...
r243 data.extend(self.add_cmd('ENABLE'))
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175
if not dat:
return data
return '\n'.join(['{}'.format(x) for x in data])
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 def update_pulses(self):
gonzalesluisfrancisco
Aplicacion de controlador de radar revisada. Un bug remanente en mix de experimentos pendiente.
r343 contador = 0
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 for line in self.get_lines():
gonzalesluisfrancisco
Aplicacion de controlador de radar revisada. Un bug remanente en mix de experimentos pendiente.
r343 contador=contador+1
print(contador)
Juan C. Espinoza
- Fix input form for delays in RCLine...
r119 line.update_pulses()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 def plot_pulses2(self, km=False):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
SIR with docker-compose working
r299 import matplotlib
matplotlib.use('Agg')
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 import matplotlib.pyplot as plt
from bokeh.resources import CDN
from bokeh.embed import components
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 from bokeh.mpl import to_bokeh
from bokeh.models.tools import WheelZoomTool, ResetTool, PanTool, HoverTool, SaveTool
lines = self.get_lines()
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 N = len(lines)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 npoints = self.total_units/self.km2unit if km else self.total_units
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 fig = plt.figure(figsize=(12, 2+N*0.5))
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 ax = fig.add_subplot(111)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 labels = ['IPP']
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 for i, line in enumerate(lines):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 labels.append(line.get_name(channel=True))
Juan C. Espinoza
sync repo...
r157 l = ax.plot((0, npoints),(N-i-1, N-i-1))
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 points = [(tup[0], tup[1]-tup[0]) for tup in line.pulses_as_points(km=km) if tup!=(0,0)]
ax.broken_barh(points, (N-i-1, 0.5),
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 edgecolor=l[0].get_color(), facecolor='none')
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
sync repo...
r157 n = 0
f = ((self.ntx+50)/100)*5 if ((self.ntx+50)/100)*10>0 else 2
for x in np.arange(0, npoints, self.ipp if km else self.ipp*self.km2unit):
if n%f==0:
ax.text(x, N, '%s' % n, size=10)
n += 1
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 labels.reverse()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 ax.set_yticks(range(len(labels)))
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 ax.set_yticklabels(labels)
Juan C. Espinoza
- Add sequence mode in mix configurations....
r116 ax.set_xlabel = 'Units'
Fiorella Quino
import/export functions have been updated...
r243 plot = to_bokeh(fig, use_pandas=False)
gonzalesluisfrancisco
Actualizacion de la app RC a python3 y django 2, antes del merge con cambios
r341 plot.tools = [PanTool(dimensions="width"), WheelZoomTool(dimensions="width"), ResetTool(), SaveTool()]
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 plot.toolbar_location="above"
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 return components(plot, CDN)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 def plot_pulses(self, km=False):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 from bokeh.plotting import figure
from bokeh.resources import CDN
from bokeh.embed import components
ver_3Julio:: update cr models.py to show used memory in plot_pulses view
r410 from bokeh.models import FixedTicker, PrintfTickFormatter, Label
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 from bokeh.models.tools import WheelZoomTool, ResetTool, PanTool, HoverTool, SaveTool
from bokeh.models.sources import ColumnDataSource
Juan C. Espinoza
Update several views and models in main app...
r85
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 lines = self.get_lines().reverse()
Fiorella Quino
import/export functions have been updated...
r243
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 N = len(lines)
npoints = self.total_units/self.km2unit if km else self.total_units
ipp = self.ipp if km else self.ipp*self.km2unit
Fiorella Quino
import/export functions have been updated...
r243
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 hover = HoverTool(tooltips=[("Line", "@name"),
("IPP", "@ipp"),
("X", "@left")])
Fiorella Quino
import/export functions have been updated...
r243
gonzalesluisfrancisco
Actualizacion de la app RC a python3 y django 2, antes del merge con cambios
r341 tools = [PanTool(dimensions="width"),
WheelZoomTool(dimensions="width"),
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 hover, SaveTool()]
Fiorella Quino
import/export functions have been updated...
r243
plot = figure(width=1000,
height=40+N*50,
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 y_range = (0, N),
Fiorella Quino
import/export functions have been updated...
r243 tools=tools,
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 toolbar_location='above',
Fiorella Quino
import/export functions have been updated...
r243 toolbar_sticky=False,)
ver_3Julio:: update cr models.py to show used memory in plot_pulses view
r410 pulses = [line.pulses_as_points() for line in self.get_lines()]
tuples = [tup for tups in pulses for tup in tups]
points = set([x for tup in tuples for x in tup])
capacity_bytes = round((8*(len(points)-1)+12)/2) # se divide entre 2 porque la mitad era solo para direcciones
capacity_percent = (capacity_bytes/2097152)*100
# Add the used memory message
x_label_memory = Label(x=900, y=-1.5, text='Used memory of '+str(capacity_bytes)+'/2097152 bytes ('+'%.3f'%capacity_percent+'%)', text_align="right", x_units='screen', text_font_size='14pt')
plot.add_layout(x_label_memory, 'below')
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 plot.xaxis.axis_label = 'Km' if km else 'Units'
plot.xaxis[0].formatter = PrintfTickFormatter(format='%d')
Fiorella Quino
import/export functions have been updated...
r243 plot.yaxis.axis_label = 'Pulses'
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 plot.yaxis[0].ticker=FixedTicker(ticks=list(range(N)))
plot.yaxis[0].formatter = PrintfTickFormatter(format='Line %d')
Fiorella Quino
import/export functions have been updated...
r243 for i, line in enumerate(lines):
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 points = [tup for tup in line.pulses_as_points(km=km) if tup!=(0,0)]
Fiorella Quino
import/export functions have been updated...
r243
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 source = ColumnDataSource(data = dict(
bottom = [i for tup in points],
top = [i+0.5 for tup in points],
left = [tup[0] for tup in points],
right = [tup[1] for tup in points],
ipp = [int(tup[0]/ipp) for tup in points],
name = [line.get_name() for tup in points]
))
Fiorella Quino
import/export functions have been updated...
r243
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 plot.quad(
bottom = 'bottom',
top = 'top',
left = 'left',
right = 'right',
source = source,
fill_alpha = 0,
#line_color = 'blue',
)
Fiorella Quino
import/export functions have been updated...
r243
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 plot.line([0, npoints], [i, i])#, color='blue')
return components(plot, CDN)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
RC files have been updated...
r264 def request(self, cmd, method='get', **kwargs):
req = getattr(requests, method)(self.device.url(cmd), **kwargs)
payload = req.json()
return payload
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 def status_device(self):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update RC API methods...
r222 try:
self.device.status = 0
Fiorella Quino
RC files have been updated...
r264 payload = self.request('status')
if payload['status']=='enable':
Juan C. Espinoza
Update RC control methods, add change_ip for RC, fix win_reference for sub-baudio...
r236 self.device.status = 3
Fiorella Quino
RC files have been updated...
r264 elif payload['status']=='disable':
Juan C. Espinoza
Update RC API methods...
r222 self.device.status = 2
Juan C. Espinoza
Update RC model, RC api for testing...
r185 else:
Fiorella Quino
import/export functions have been updated...
r243 self.device.status = 1
Juan C. Espinoza
Update RC API methods...
r222 self.device.save()
Fiorella Quino
RC files have been updated...
r264 self.message = 'RC status: {}'.format(payload['status'])
Juan C. Espinoza
Update RC API methods...
r222 return False
Juan C. Espinoza
Update RC model, RC api for testing...
r185 except Exception as e:
Juan C. Espinoza
Update RC API methods...
r222 if 'No route to host' not in str(e):
self.device.status = 4
self.device.save()
Fiorella Quino
RC files have been updated...
r264 self.message = 'RC status: {}'.format(str(e))
Juan C. Espinoza
Update RC model, RC api for testing...
r185 return False
Fiorella Quino
import/export functions have been updated...
r243
self.device.save()
return True
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175
def reset_device(self):
Fiorella Quino
import/export functions have been updated...
r243
Juan C. Espinoza
Update RC model, RC api for testing...
r185 try:
Fiorella Quino
RC files have been updated...
r264 payload = self.request('reset', 'post')
Juan C. Espinoza
Update RC API methods...
r222 if payload['reset']=='ok':
Fiorella Quino
RC files have been updated...
r264 self.message = 'RC restarted OK'
self.device.status = 2
self.device.save()
Juan C. Espinoza
Update RC model, RC api for testing...
r185 else:
Fiorella Quino
RC files have been updated...
r264 self.message = 'RC restart fail'
Juan C. Espinoza
Update RC model, RC api for testing...
r185 self.device.status = 4
self.device.save()
except Exception as e:
Fiorella Quino
RC files have been updated...
r264 self.message = 'RC reset: {}'.format(str(e))
Juan C. Espinoza
Update RC model, RC api for testing...
r185 return False
Fiorella Quino
import/export functions have been updated...
r243
Juan C. Espinoza
Update RC model, RC api for testing...
r185 return True
Fiorella Quino
import/export functions have been updated...
r243
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 def stop_device(self):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update RC model, RC api for testing...
r185 try:
Fiorella Quino
RC files have been updated...
r264 payload = self.request('stop', 'post')
self.message = 'RC stop: {}'.format(payload['stop'])
Juan C. Espinoza
Update RC API methods...
r222 if payload['stop']=='ok':
Juan C. Espinoza
Update RC model, RC api for testing...
r185 self.device.status = 2
self.device.save()
else:
self.device.status = 4
self.device.save()
return False
except Exception as e:
Juan C. Espinoza
Update RC API methods...
r222 if 'No route to host' not in str(e):
self.device.status = 4
else:
self.device.status = 0
Fiorella Quino
RC files have been updated...
r264 self.message = 'RC stop: {}'.format(str(e))
Juan C. Espinoza
Update RC API methods...
r222 self.device.save()
Fiorella Quino
import/export functions have been updated...
r243 return False
Juan C. Espinoza
Update RC model, RC api for testing...
r185 return True
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 def start_device(self):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update RC model, RC api for testing...
r185 try:
Fiorella Quino
RC files have been updated...
r264 payload = self.request('start', 'post')
self.message = 'RC start: {}'.format(payload['start'])
Juan C. Espinoza
Update RC API methods...
r222 if payload['start']=='ok':
Juan C. Espinoza
Update RC model, RC api for testing...
r185 self.device.status = 3
self.device.save()
else:
return False
except Exception as e:
Juan C. Espinoza
Update RC API methods...
r222 if 'No route to host' not in str(e):
self.device.status = 4
else:
self.device.status = 0
Fiorella Quino
RC files have been updated...
r264 self.message = 'RC start: {}'.format(str(e))
Juan C. Espinoza
Update RC API methods...
r222 self.device.save()
Juan C. Espinoza
Update RC model, RC api for testing...
r185 return False
Fiorella Quino
import/export functions have been updated...
r243
Juan C. Espinoza
Update RC model, RC api for testing...
r185 return True
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Pruebas de ejecución de tareas celery-redis con varios dispositivos
r348 def write_device(self, raw=False):
ver_3Julio :: update jars and rc files
r402 print("write device")
add cgs_status command to rc/models.py to program cgs
r417 ##############Comando status a CGS para hacer programacion ############
try:
self.device.status = 0
cgs = self.request('status_cgs')
print('CGS status ok') # solo para depurar lo que devuelve CGS
except Exception as e:
cgs = {'multiplier': 60, 'divider': 10, 'reference_clk': 1} # simulando parametros devueltos por el cgs
if 'No route to host' not in str(e):
self.device.status = 4
self.device.save()
self.message = 'CGS status: {}'.format(str(e))
print('not cgs status')
SIR with docker-compose working
r299
add cgs_status command to rc/models.py to program cgs
r417 print(cgs)
Added monitor channel to the RC configuration.
r414
add cgs_status command to rc/models.py to program cgs
r417 if not raw:
Juan C. Espinoza
Add compatibility with embed CGS in RC
r328 clock = RCClock.objects.get(rc_configuration=self)
add cgs_status command to rc/models.py to program cgs
r417 print('clock_freq', clock.frequency)
print('clock_mult', clock.multiplier)
print('clock_div', clock.divisor)
print('clock_ref', clock.reference)
print('cgs', cgs)
Juan C. Espinoza
Add compatibility with embed CGS in RC
r328 if clock.mode:
add cgs_status command to rc/models.py to program cgs
r417 data = {'default': clock.frequency} # mult=72, div=12
Juan C. Espinoza
Add compatibility with embed CGS in RC
r328 else:
data = {'manual': [clock.multiplier, clock.divisor, clock.reference]}
add cgs_status command to rc/models.py to program cgs
r417 print('data', data)
int_cgs_multiplier=int(cgs['multiplier'])
int_cgs_divisor=int(cgs['divider'])
int_cgs_reference=int(cgs['reference_clk'])
print(cgs['divider'])
if clock.multiplier != int_cgs_multiplier or clock.divisor != int_cgs_divisor or clock.reference != int_cgs_reference:
print("Program CGS...")
payload = self.request('setfreq', 'post', data=json.dumps(data))#data=data)#data=json.dumps(data))
if payload['command'] != 'ok':
self.message = 'RC write: {}'.format(payload['command'])
else:
self.message = payload['programming']
if payload['programming'] == 'fail':
self.message = 'RC write: error programming CGS chip'
Added monitor channel to the RC configuration.
r414 else:
add cgs_status command to rc/models.py to program cgs
r417 print("Not program CGS...")
ver_3Julio :: update jars and rc files
r402
SIR with docker-compose working
r299 values = []
ver_3Julio :: update jars and rc files
r402 print('wait delay values...')
SIR with docker-compose working
r299 for pulse, delay in zip(self.get_pulses(), self.get_delays()):
ver_3Julio :: update jars and rc files
r402 #print('wait zip...')
Pruebas de ejecución de tareas celery-redis con varios dispositivos
r348 while delay > 65536:
SIR with docker-compose working
r299 values.append((pulse, 65535))
Fix extra delays in RC when delay is bigger than 65536 (16bits)
r302 delay -= 65536
SIR with docker-compose working
r299 values.append((pulse, delay-1))
Juan C. Espinoza
Update RC control methods, add change_ip for RC, fix win_reference for sub-baudio...
r236 data = bytearray()
Fiorella Quino
import/export functions have been updated...
r243 #reset
data.extend((128, 0))
#disable
Juan C. Espinoza
Update RC control methods, add change_ip for RC, fix win_reference for sub-baudio...
r236 data.extend((129, 0))
Add control_sw value in write_device RC
r304 #SW switch
if self.control_sw:
data.extend((130, 2))
else:
data.extend((130, 0))
Fiorella Quino
import/export functions have been updated...
r243 #divider
data.extend((131, self.clock_divider-1))
Juan C. Espinoza
Update RC control methods, add change_ip for RC, fix win_reference for sub-baudio...
r236 #enable writing
data.extend((139, 62))
Fiorella Quino
import/export functions have been updated...
r243
Juan C. Espinoza
Update RC control methods, add change_ip for RC, fix win_reference for sub-baudio...
r236 last = 0
ver_3Julio :: update jars and rc files
r402 print('wait data...')
Fiorella Quino
import/export functions have been updated...
r243 for tup in values:
vals = pack('<HH', last^tup[0], tup[1])
Juan C. Espinoza
Update RC control methods, add change_ip for RC, fix win_reference for sub-baudio...
r236 last = tup[0]
Fiorella Quino
import/export functions have been updated...
r243 data.extend((133, vals[1], 132, vals[0], 133, vals[3], 132, vals[2]))
Juan C. Espinoza
Update RC control methods, add change_ip for RC, fix win_reference for sub-baudio...
r236 #enable
data.extend((129, 1))
ver_3Julio:: update cr models.py to show used memory in plot_pulses view
r410 print('len',len(data))
Fiorella Quino
import/export functions have been updated...
r243
Juan C. Espinoza
Update Views y several improvements
r316 if raw:
return b64encode(data)
Pruebas de ejecución de tareas celery-redis con varios dispositivos
r348 #try:
ver_3Julio :: update jars and rc files
r402 print('requests')
Pruebas de ejecución de tareas celery-redis con varios dispositivos
r348 payload = self.request('stop', 'post')
payload = self.request('reset', 'post')
#payload = self.request('divider', 'post', data={'divider': self.clock_divider-1})
#payload = self.request('write', 'post', data=b64encode(bytearray((139, 62))), timeout=20)
n = len(data)
ver_3Julio :: update jars and rc files
r402 print('len: ',n)
Pruebas de ejecución de tareas celery-redis con varios dispositivos
r348 x = 0
ver_3Julio :: update jars and rc files
r402 cnt = 0
ver_3Julio :: new changes
r400 while x < n:
ver_3Julio :: update jars and rc files
r402 print('writing...', cnt)
add cgs_status command to rc/models.py to program cgs
r417 payload = self.request('write', 'post', data=b64encode(data[x:x+16384]))#(data))#
x += 16384
ver_3Julio :: update jars and rc files
r402 cnt += 1#time.sleep(1)
print('writing...', x*100/n)
Pruebas de ejecución de tareas celery-redis con varios dispositivos
r348 if payload['write']=='ok':
self.device.status = 3
self.device.save()
self.message = 'RC configured and started'
else:
self.device.status = 1
self.device.save()
self.message = 'RC write: {}'.format(payload['write'])
return False
Fiorella Quino
import/export functions have been updated...
r243
SIR with docker-compose working
r299 #payload = self.request('start', 'post')
Pruebas de ejecución de tareas celery-redis con varios dispositivos
r348 #except Exception as e:
# if 'No route to host' not in str(e):
# self.device.status = 4
# else:
# self.device.status = 0
# self.message = 'RC write: {}'.format(str(e))
# self.device.save()
# return False
Fiorella Quino
import/export functions have been updated...
r243
Juan C. Espinoza
Update RC model, RC api for testing...
r185 return True
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107
Fiorella Quino
RC files have been updated...
r264 def get_absolute_url_import(self):
return reverse('url_import_rc_conf', args=[str(self.id)])
Juan C. Espinoza
Add rc config mods...
r23 class RCLineCode(models.Model):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Updates to models, views & forms for CR...
r25 name = models.CharField(max_length=40)
Juan C. Espinoza
Add rc config mods...
r23 bits_per_code = models.PositiveIntegerField(default=0)
number_of_codes = models.PositiveIntegerField(default=0)
codes = models.TextField(blank=True, null=True)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Add rc config mods...
r23 class Meta:
db_table = 'rc_line_codes'
Juan C. Espinoza
Updates to models, views & forms for CR...
r25 ordering = ('name',)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
def __str__(self):
return u'%s' % self.name
Juan C. Espinoza
Add rc config mods...
r23
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107
Juan C. Espinoza
Add rc config mods...
r23 class RCLineType(models.Model):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Add rc config mods...
r23 name = models.CharField(choices=LINE_TYPES, max_length=40)
description = models.TextField(blank=True, null=True)
params = models.TextField(default='[]')
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Add rc config mods...
r23 class Meta:
db_table = 'rc_line_types'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 def __str__(self):
Juan C. Espinoza
Add rc config mods...
r23 return u'%s - %s' % (self.name.upper(), self.get_name_display())
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Add rc config mods...
r23 class RCLine(models.Model):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Nueva plantilla, prueba comunicacion y nuevos campos ddsrest
r338 rc_configuration = models.ForeignKey('RCConfiguration', on_delete=models.CASCADE)
line_type = models.ForeignKey('RCLineType',on_delete=models.CASCADE)
Juan C. Espinoza
Add rc config mods...
r23 channel = models.PositiveIntegerField(default=0)
position = models.PositiveIntegerField(default=0)
params = models.TextField(default='{}')
Juan C. Espinoza
Update RC models, views, templates & statics...
r45 pulses = models.TextField(default='')
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Add rc config mods...
r23 class Meta:
db_table = 'rc_lines'
Juan C. Espinoza
Update RC models, views, templates & statics...
r45 ordering = ['channel']
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
def __str__(self):
Juan C. Espinoza
- Update rc app...
r79 if self.rc_configuration:
SIR with docker-compose working
r299 return u'{}|{} - {}'.format(self.pk, self.get_name(), self.rc_configuration.name)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
RC files have been updated...
r264 def jsonify(self):
data = {}
data['params'] = json.loads(self.params)
data['id'] = '{}'.format(self.pk)
data['line_type'] = self.line_type.name
data['name'] = self.get_name()
if data['line_type']=='codes':
data['params']['code'] = RCLineCode.objects.get(pk=data['params']['code']).name
return data
Juan C. Espinoza
Update several views and models in main app...
r85 def clone(self, **kwargs):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update several views and models in main app...
r85 self.pk = None
Fiorella Quino
RC files have been updated...
r264 self.id = None
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update several views and models in main app...
r85 for attr, value in kwargs.items():
setattr(self, attr, value)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
self.save()
Juan C. Espinoza
Update several views and models in main app...
r85
return self
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
sync repo...
r157 def get_name(self, channel=False):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Add rc config mods...
r23 chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 s = ''
Juan C. Espinoza
Update RC models, views, templates & statics...
r45 if self.line_type.name in ('tx',):
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 s = chars[self.position]
Juan C. Espinoza
Update RC models, views, templates & statics...
r45 elif self.line_type.name in ('codes', 'windows', 'tr'):
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 if 'TX_ref' in json.loads(self.params):
pk = json.loads(self.params)['TX_ref']
if pk in (0, '0'):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 s = ','.join(chars[l.position] for l in self.rc_configuration.get_lines(line_type__name='tx'))
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 else:
ref = RCLine.objects.get(pk=pk)
s = chars[ref.position]
Juan C. Espinoza
fix RCLine.get_name()...
r113 s = '({})'.format(s)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
sync repo...
r157 s = '{}{}'.format(self.line_type.name.upper(), s)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
sync repo...
r157 if channel:
return '{} {}'.format(s, self.channel)
Juan C. Espinoza
Updates to models, views & forms for CR...
r25 else:
Juan C. Espinoza
sync repo...
r157 return s
Juan C. Espinoza
Update RC models, views, templates & statics...
r45
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 def get_lines(self, **kwargs):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
return RCLine.objects.filter(rc_configuration=self.rc_configuration, **kwargs)
Juan C. Espinoza
Update RC models, views, templates & statics...
r45 def pulses_as_array(self):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Fix mix RC configurations for different ipp's...
r112 y = np.zeros(self.rc_configuration.total_units)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 for tup in ast.literal_eval(self.pulses):
y[tup[0]:tup[1]] = 1
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 return y.astype(np.int8)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
sync repo...
r157 def pulses_as_points(self, km=False):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
sync repo...
r157 if km:
unit2km = 1/self.rc_configuration.km2unit
return [(tup[0]*unit2km, tup[1]*unit2km) for tup in ast.literal_eval(self.pulses)]
else:
return ast.literal_eval(self.pulses)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
- Update rc app...
r79 def get_win_ref(self, params, tx_id, km2unit):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
- Update rc app...
r79 ref = self.rc_configuration.sampling_reference
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 codes = [line for line in self.get_lines(line_type__name='codes') if int(json.loads(line.params)['TX_ref'])==int(tx_id)]
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
if codes:
Fiorella Quino
import/export functions have been updated...
r243 tx_width = float(json.loads(RCLine.objects.get(pk=tx_id).params)['pulse_width'])*km2unit/len(json.loads(codes[0].params)['codes'][0])
Juan C. Espinoza
- Update rc app...
r79 else:
tx_width = float(json.loads(RCLine.objects.get(pk=tx_id).params)['pulse_width'])*km2unit
Fiorella Quino
import/export functions have been updated...
r243
if ref=='first_baud':
Juan C. Espinoza
Update RC control methods, add change_ip for RC, fix win_reference for sub-baudio...
r236 return int(1 + round((tx_width + 1)/2 + params['first_height']*km2unit - params['resolution']*km2unit))
Fiorella Quino
import/export functions have been updated...
r243 elif ref=='sub_baud':
Juan C. Espinoza
Fix importing racp, fix sub-baudio windows reference ...
r237 return np.ceil(1 + params['first_height']*km2unit - params['resolution']*km2unit/2)
Juan C. Espinoza
- Update rc app...
r79 else:
return 0
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 def update_pulses(self):
Juan C. Espinoza
- Update rc app...
r79 '''
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 Update pulses field
Juan C. Espinoza
- Update rc app...
r79 '''
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
- Update rc app...
r79 km2unit = self.rc_configuration.km2unit
us2unit = self.rc_configuration.us2unit
Juan C. Espinoza
Update RC models, views, templates & statics...
r45 ipp = self.rc_configuration.ipp
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 ntx = int(self.rc_configuration.ntx)
Juan C. Espinoza
- Update rc app...
r79 ipp_u = int(ipp*km2unit)
Juan C. Espinoza
- Add sequence mode in mix configurations....
r116 total = ipp_u*ntx if self.rc_configuration.total_units==0 else self.rc_configuration.total_units
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 y = []
ver_3Julio :: update jars and rc files
r402
Juan C. Espinoza
Update RC models, views, templates & statics...
r45 if self.line_type.name=='tr':
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 tr_params = json.loads(self.params)
gonzalesluisfrancisco
Actualizacion de la app RC a python3 y django 2, antes del merge con cambios
r341 #print(tr_params)
#print(tr_params['TX_ref'])
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 if tr_params['TX_ref'] in ('0', 0):
txs = self.get_lines(line_type__name='tx')
Juan C. Espinoza
Update RC models, views, templates & statics...
r45 else:
Juan C. Espinoza
Fix RCLine.update_pulses()...
r115 txs = RCLine.objects.filter(pk=tr_params['TX_ref'])
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 for tx in txs:
params = json.loads(tx.params)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 if float(params['pulse_width'])==0:
continue
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 delays = [float(d)*km2unit for d in params['delays'].split(',') if d]
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 width = float(params['pulse_width'])*km2unit+int(self.rc_configuration.time_before*us2unit)
before = 0
after = int(self.rc_configuration.time_after*us2unit)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 y_tx = self.points(ntx, ipp_u, width,
delay=delays,
before=before,
after=after,
sync=self.rc_configuration.sync)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 ranges = params['range'].split(',')
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
if len(ranges)>0 and ranges[0]!='0':
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 y_tx = self.mask_ranges(y_tx, ranges)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 tr_ranges = tr_params['range'].split(',')
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
if len(tr_ranges)>0 and tr_ranges[0]!='0':
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 y_tx = self.mask_ranges(y_tx, tr_ranges)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 y.extend(y_tx)
Juan C. Espinoza
- Fix input form for delays in RCLine...
r119
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 self.pulses = str(y)
Juan C. Espinoza
- Add sequence mode in mix configurations....
r116 y = self.array_to_points(self.pulses_as_array())
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update RC models, views, templates & statics...
r45 elif self.line_type.name=='tx':
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 params = json.loads(self.params)
delays = [float(d)*km2unit for d in params['delays'].split(',') if d]
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 width = float(params['pulse_width'])*km2unit
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
if width>0:
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 before = int(self.rc_configuration.time_before*us2unit)
after = 0
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 y = self.points(ntx, ipp_u, width,
delay=delays,
before=before,
after=after,
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 sync=self.rc_configuration.sync)
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 ranges = params['range'].split(',')
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
if len(ranges)>0 and ranges[0]!='0':
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 y = self.mask_ranges(y, ranges)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update RC models, views, templates & statics...
r45 elif self.line_type.name=='flip':
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 n = float(json.loads(self.params)['number_of_flips'])
width = n*ipp*km2unit
y = self.points(int((ntx+1)/(2*n)), ipp_u*n*2, width)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update RC models, views, templates & statics...
r45 elif self.line_type.name=='codes':
params = json.loads(self.params)
tx = RCLine.objects.get(pk=params['TX_ref'])
tx_params = json.loads(tx.params)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 delays = [float(d)*km2unit for d in tx_params['delays'].split(',') if d]
f = int(float(tx_params['pulse_width'])*km2unit/len(params['codes'][0]))
Fiorella Quino
import/export functions have been updated...
r243 codes = [(np.fromstring(''.join([s*f for s in code]), dtype=np.uint8)-48).astype(np.int8) for code in params['codes']]
codes = [self.array_to_points(code) for code in codes]
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 n = len(codes)
Fiorella Quino
import/export functions have been updated...
r243
Juan C. Espinoza
Update RC models, views, templates & statics...
r45 ranges = tx_params['range'].split(',')
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 if len(ranges)>0 and ranges[0]!='0':
Juan C. Espinoza
Fix importing racp, fix sub-baudio windows reference ...
r237 dum = self.mask_ranges(tx.pulses_as_points(), ranges)
else:
Fiorella Quino
import/export functions have been updated...
r243 dum = tx.pulses_as_points()
Juan C. Espinoza
Fix importing racp, fix sub-baudio windows reference ...
r237 for i, tup in enumerate(dum):
if tup==(0,0): continue
code = codes[i%n]
Fiorella Quino
import/export functions have been updated...
r243 y.extend([(c[0]+tup[0], c[1]+tup[0]) for c in code])
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update RC models, views, templates & statics...
r45 elif self.line_type.name=='sync':
params = json.loads(self.params)
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 n = ipp_u*ntx
Juan C. Espinoza
Update RC models, views, templates & statics...
r45 if params['invert'] in ('1', 1):
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 y = [(n-1, n)]
Juan C. Espinoza
Update RC models, views, templates & statics...
r45 else:
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 y = [(0, 1)]
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update RC models, views, templates & statics...
r45 elif self.line_type.name=='prog_pulses':
params = json.loads(self.params)
if int(params['periodic'])==0:
nntx = 1
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 nipp = ipp_u*ntx
else:
nntx = ntx
nipp = ipp_u
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
if 'params' in params and len(params['params'])>0:
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 for p in params['params']:
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 y_pp = self.points(nntx, nipp,
p['end']-p['begin'],
before=p['begin'])
y.extend(y_pp)
Juan C. Espinoza
Update RC models, views, templates & statics...
r45 elif self.line_type.name=='windows':
Fiorella Quino
import/export functions have been updated...
r243 params = json.loads(self.params)
Juan C. Espinoza
Update RC models, views, templates & statics...
r45 if 'params' in params and len(params['params'])>0:
Fix windows line ranges in RC model
r303 tx = RCLine.objects.get(pk=params['TX_ref'])
tx_params = json.loads(tx.params)
ranges = tx_params['range'].split(',')
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 for p in params['params']:
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 y_win = self.points(ntx, ipp_u,
p['resolution']*p['number_of_samples']*km2unit,
SIR with docker-compose working
r299 before=int(self.rc_configuration.time_before*us2unit)+p['first_height']*km2unit,
Juan C. Espinoza
Fix importing racp, fix sub-baudio windows reference ...
r237 sync=self.rc_configuration.sync+self.get_win_ref(p, params['TX_ref'], km2unit))
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
import/export functions have been updated...
r243
Fix windows line ranges in RC model
r303 if len(ranges)>0 and ranges[0]!='0':
y_win = self.mask_ranges(y_win, ranges)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
import/export functions have been updated...
r243 y.extend(y_win)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 elif self.line_type.name=='mix':
values = self.rc_configuration.parameters.split('-')
Juan C. Espinoza
- Add sequence mode in mix configurations....
r116 confs = [RCConfiguration.objects.get(pk=value.split('|')[0]) for value in values]
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 modes = [value.split('|')[1] for value in values]
Juan C. Espinoza
Fix mix RC configurations for different ipp's...
r112 ops = [value.split('|')[2] for value in values]
delays = [value.split('|')[3] for value in values]
masks = [value.split('|')[4] for value in values]
gonzalesluisfrancisco
Aplicacion de controlador de radar revisada. Un bug remanente en mix de experimentos pendiente.
r343 print("masks")
print(masks)
print('{:8b}'.format(int(masks[0])))
Juan C. Espinoza
Fix mix RC configurations for different ipp's...
r112 mask = list('{:8b}'.format(int(masks[0])))
gonzalesluisfrancisco
Aplicacion de controlador de radar revisada. Un bug remanente en mix de experimentos pendiente.
r343 print("mask")
print(mask)
Juan C. Espinoza
Fix mix RC configurations for different ipp's...
r112 mask.reverse()
gonzalesluisfrancisco
Aplicacion de controlador de radar revisada. Un bug remanente en mix de experimentos pendiente.
r343 print("mask reverse")
print(mask)
Juan C. Espinoza
Fix mix RC configurations for different ipp's...
r112 if mask[self.channel] in ('0', '', ' '):
Juan C. Espinoza
- Add sequence mode in mix configurations....
r116 y = np.zeros(confs[0].total_units, dtype=np.int8)
Juan C. Espinoza
Fix mix RC configurations for different ipp's...
r112 else:
Juan C. Espinoza
- Add sequence mode in mix configurations....
r116 y = confs[0].get_lines(channel=self.channel)[0].pulses_as_array()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 for i in range(1, len(values)):
mask = list('{:8b}'.format(int(masks[i])))
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 mask.reverse()
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 if mask[self.channel] in ('0', '', ' '):
continue
Juan C. Espinoza
- Add sequence mode in mix configurations....
r116 Y = confs[i].get_lines(channel=self.channel)[0].pulses_as_array()
Juan C. Espinoza
Update RC app (add support for mix configurations, bug plotting window line, )...
r107 delay = float(delays[i])*km2unit
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
- Add sequence mode in mix configurations....
r116 if modes[i]=='P':
if delay>0:
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 if delay<self.rc_configuration.ipp*km2unit and len(Y)==len(y):
Juan C. Espinoza
- Add sequence mode in mix configurations....
r116 y_temp = np.empty_like(Y)
y_temp[:delay] = 0
y_temp[delay:] = Y[:-delay]
elif delay+len(Y)>len(y):
y_new = np.zeros(delay+len(Y), dtype=np.int8)
y_new[:len(y)] = y
y = y_new
y_temp = np.zeros(delay+len(Y), dtype=np.int8)
y_temp[-len(Y):] = Y
elif delay+len(Y)==len(y):
y_temp = np.zeros(delay+len(Y))
y_temp[-len(Y):] = Y
elif delay+len(Y)<len(y):
y_temp = np.zeros(len(y), dtype=np.int8)
y_temp[delay:delay+len(Y)] = Y
Juan C. Espinoza
Fix Mix RC configurations...
r238 else:
y_temp = Y.copy()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
- Add sequence mode in mix configurations....
r116 if ops[i]=='OR':
y = y | y_temp
elif ops[i]=='XOR':
y = y ^ y_temp
elif ops[i]=='AND':
y = y & y_temp
elif ops[i]=='NAND':
y = y & ~y_temp
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 else:
Juan C. Espinoza
- Add sequence mode in mix configurations....
r116 y = np.concatenate([y, Y])
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Fix mix RC configurations for different ipp's...
r112 total = len(y)
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 y = self.array_to_points(y)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update RC models, views, templates & statics...
r45 else:
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 y = []
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
if self.rc_configuration.total_units != total:
Juan C. Espinoza
Fix mix RC configurations for different ipp's...
r112 self.rc_configuration.total_units = total
Juan C. Espinoza
- Fix input form for delays in RCLine...
r119 self.rc_configuration.save()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
self.pulses = str(y)
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 self.save()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 @staticmethod
def array_to_points(X):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
RC files have been updated...
r264 if X.size==0:
return []
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 d = X[1:]-X[:-1]
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 up = np.where(d==1)[0]
if X[0]==1:
up = np.concatenate((np.array([-1]), up))
up += 1
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 dw = np.where(d==-1)[0]
if X[-1]==1:
dw = np.concatenate((dw, np.array([len(X)-1])))
dw += 1
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 return [(tup[0], tup[1]) for tup in zip(up, dw)]
@staticmethod
def mask_ranges(Y, ranges):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 y = [(0, 0) for __ in Y]
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 for index in ranges:
if '-' in index:
args = [int(a) for a in index.split('-')]
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 y[args[0]-1:args[1]] = Y[args[0]-1:args[1]]
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 else:
Juan C. Espinoza
Fix importing racp, fix sub-baudio windows reference ...
r237 y[int(index)-1] = Y[int(index)-1]
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 return y
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 @staticmethod
def points(ntx, ipp, width, delay=[0], before=0, after=0, sync=0):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Optimize pulses's plot and generation ...
r111 delays = len(delay)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update RC model, RC api for testing...
r185 Y = [(int(ipp*x+before+delay[x%delays]+sync), int(ipp*x+width+before+delay[x%delays]+after+sync)) for x in range(ntx)]
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
return Y
Juan C. Espinoza
Add compatibility with embed CGS in RC
r328
class RCClock(models.Model):
Nueva plantilla, prueba comunicacion y nuevos campos ddsrest
r338 rc_configuration = models.ForeignKey('RCConfiguration', on_delete=models.CASCADE)
Juan C. Espinoza
Add compatibility with embed CGS in RC
r328 mode = models.BooleanField(default=True, choices=((True, 'Auto'), (False, 'Manual')))
multiplier = models.PositiveIntegerField(default=60)
divisor = models.PositiveIntegerField(default=10)
reference = models.PositiveSmallIntegerField(default=1, choices=((0, 'Internal (25MHz)'), (1, 'External (10MHz)')))
ver_3Julio :: new changes
r400 frequency = models.FloatField(default=60.0)