@@ -63,9 +63,27 | |||
|
63 | 63 | <!--<h4 class="panel-title"> </h4>--> |
|
64 | 64 | <tr><th>IPP(km)</th><td>{{experiment_data.configurations.rc.ipp}}</td></tr> |
|
65 | 65 | <tr><th>NTX</th><td>{{experiment_data.configurations.rc.ntx}}</td></tr> |
|
66 | <tr><th>TX</th><td>{{tx}}</td></tr> | |
|
67 | 66 | <tr><th>Code</th><td>{{code}}</td></tr> |
|
68 | <tr><th>Sampling Window</th><td>{{window|linebreaks}}</td></tr> | |
|
67 | ||
|
68 | <!--Jueves 01-12-2016--> | |
|
69 | {% if lines %} | |
|
70 | ||
|
71 | <tr><th>TAU</th><td>{{rc_delays_num}} taus (km): {{rc_delays|linebreaks}}</td></tr> | |
|
72 | {% for tx_line in tx_lines %} | |
|
73 | <tr><th>{{tx_line.name}}</th><td>{{tx_line.parameters.pulse_width}}km</td></tr> | |
|
74 | {% endfor %} | |
|
75 | {% for windows_line in windows_lines%} | |
|
76 | <tr><th>{{windows_line.name}}</th><td>{{windows_line.parameters|linebreaks}}</td></tr> | |
|
77 | {% endfor %} | |
|
78 | {% for code_line in code_lines%} | |
|
79 | <tr><th>{{code_line.name}}</th><td>{{code_line.code_name}}</td></tr> | |
|
80 | {% endfor %} | |
|
81 | {% for progpulses_line in progpulses_lines%} | |
|
82 | <tr><th>{{progpulses_line.name}}</th><td>{{progpulses_line.parameters|linebreaks}}</td></tr> | |
|
83 | {% endfor %} | |
|
84 | ||
|
85 | {% endif %} | |
|
86 | <!--FIN--> | |
|
69 | 87 | </table> |
|
70 | 88 | {% endif %} |
|
71 | 89 |
@@ -19,7 +19,7 from .forms import OperationSearchForm, FilterForm, ChangeIpForm | |||
|
19 | 19 | |
|
20 | 20 | from .tasks import task_start, task_stop |
|
21 | 21 | |
|
22 | from apps.rc.forms import RCConfigurationForm | |
|
22 | from apps.rc.forms import RCConfigurationForm, RCLineCode | |
|
23 | 23 | from apps.dds.forms import DDSConfigurationForm |
|
24 | 24 | from apps.jars.forms import JARSConfigurationForm |
|
25 | 25 | from apps.cgs.forms import CGSConfigurationForm |
@@ -38,7 +38,7 from django.contrib.auth.decorators import login_required | |||
|
38 | 38 | from django.contrib.auth.decorators import user_passes_test |
|
39 | 39 | from django.contrib.admin.views.decorators import staff_member_required |
|
40 | 40 | |
|
41 | ||
|
41 | import ast | |
|
42 | 42 | |
|
43 | 43 | CONF_FORMS = { |
|
44 | 44 | 'rc': RCConfigurationForm, |
@@ -70,7 +70,6 MIX_OPERATIONS = { | |||
|
70 | 70 | '3': 'NAND', |
|
71 | 71 | } |
|
72 | 72 | |
|
73 | ||
|
74 | 73 | def index(request): |
|
75 | 74 | kwargs = {'no_sidebar':True} |
|
76 | 75 | |
@@ -827,7 +826,7 def experiment_summary(request, id_exp): | |||
|
827 | 826 | |
|
828 | 827 | kwargs = {} |
|
829 | 828 | |
|
830 |
kwargs['experiment_keys'] = [ |
|
|
829 | kwargs['experiment_keys'] = ['radar_system', 'name', 'start_time', 'end_time'] | |
|
831 | 830 | kwargs['experiment'] = experiment |
|
832 | 831 | |
|
833 | 832 | kwargs['configuration_keys'] = ['name', 'device__ip_address', 'device__port_address', 'device__status'] |
@@ -862,29 +861,86 def experiment_summary(request, id_exp): | |||
|
862 | 861 | rc_lines = experiment_data['configurations']['rc']['lines'] |
|
863 | 862 | ipp = configuration.ipp |
|
864 | 863 | if experiment_data['configurations']['rc']['mix'] == 'True': |
|
865 | tx = '' | |
|
866 | 864 | code = '' |
|
867 | window = '' | |
|
868 | 865 | else: |
|
869 | 866 | code = rc_lines[3]['code'] |
|
870 | 867 | |
|
871 | window_data = rc_lines[6]['params'][0] | |
|
872 | h0 = str(window_data['first_height']) | |
|
873 | dh = str(window_data['resolution']) | |
|
874 | nsa = str(window_data['number_of_samples']) | |
|
875 | window = 'Ho='+h0+'km\nDH='+dh+'km\nNSA='+nsa | |
|
876 | ||
|
877 | tx = '' | |
|
878 | if float(rc_lines[1]['delays']) == 0: | |
|
879 | tx = rc_lines[2]['pulse_width'] | |
|
880 | elif float(rc_lines[2]['delays']) == 0: | |
|
881 | tx = rc_lines[1]['pulse_width'] | |
|
882 | else: | |
|
883 | tx = rc_lines[1]['pulse_width']+' | '+rc_lines[2]['pulse_width'] | |
|
884 | ||
|
885 | kwargs['tx'] = tx | |
|
886 | 868 | kwargs['code'] = code |
|
887 | kwargs['window'] = window | |
|
869 | ||
|
870 | #---Jueves 01-12-2016--- | |
|
871 | ||
|
872 | lines = configuration.get_lines() | |
|
873 | ||
|
874 | if lines: | |
|
875 | ||
|
876 | #TX Delays (TAU) | |
|
877 | rc_delays_num = 0 | |
|
878 | rc_delays = '' | |
|
879 | tx_lines = configuration.get_lines(line_type__name='tx') | |
|
880 | for tx_line in tx_lines: | |
|
881 | if len(tx_lines) < 2: | |
|
882 | rc_delay = json.loads(tx_line.params) | |
|
883 | rc_delays = rc_delays+tx_line.get_name()+': '+rc_delay['delays']+'\n' | |
|
884 | delay = ast.literal_eval(rc_delay['delays']) | |
|
885 | if isinstance(delay,int): | |
|
886 | rc_delays_num += 1 | |
|
887 | else: | |
|
888 | rc_delays_num += len(delay) | |
|
889 | else: | |
|
890 | rc_delay = json.loads(tx_line.params) | |
|
891 | rc_delays = rc_delays+tx_line.get_name()+': '+rc_delay['delays']+'\n' | |
|
892 | delay = ast.literal_eval(rc_delay['delays']) | |
|
893 | if isinstance(delay,int): | |
|
894 | rc_delays_num += 1 | |
|
895 | else: | |
|
896 | rc_delays_num += len(delay) | |
|
897 | ||
|
898 | #TX: TXA - TXB... | |
|
899 | for tx_line in tx_lines: | |
|
900 | tx_line.name = tx_line.get_name() | |
|
901 | tx_line_parameters = json.loads(tx_line.params) | |
|
902 | tx_line.parameters = tx_line_parameters | |
|
903 | ||
|
904 | #WINDOWS | |
|
905 | windows_lines = configuration.get_lines(line_type__name='windows') | |
|
906 | for windows_line in windows_lines: | |
|
907 | windows_line.name = windows_line.get_name() | |
|
908 | windows_data = json.loads(windows_line.params) | |
|
909 | windows_params = windows_data['params'][0] | |
|
910 | h0 = str(windows_params['first_height']) | |
|
911 | dh = str(windows_params['resolution']) | |
|
912 | nsa = str(windows_params['number_of_samples']) | |
|
913 | windows_line.parameters = 'Ho=' + h0 +'km\nDH=' + dh +'km\nNSA=' + nsa | |
|
914 | ||
|
915 | #CODES | |
|
916 | code_lines = configuration.get_lines(line_type__name='codes') | |
|
917 | for code_line in code_lines: | |
|
918 | code_line.name = code_line.get_name() | |
|
919 | line_params = json.loads(code_line.params) | |
|
920 | rccode = RCLineCode.objects.get(pk=int(line_params['code'])) | |
|
921 | code_line.code_name = rccode.name | |
|
922 | ||
|
923 | #PROG_PULSES | |
|
924 | progpulses_lines = configuration.get_lines(line_type__name='prog_pulses') | |
|
925 | for progpulses_line in progpulses_lines: | |
|
926 | progpulses_line.name = progpulses_line.get_name() | |
|
927 | progpulses_parameters = json.loads(progpulses_line.params) | |
|
928 | progpulses_parameters = progpulses_parameters['params'][0] | |
|
929 | progpulses_line.parameters = 'Begin: '+str(progpulses_parameters['begin'])+' (Units)\nEnd: '+str(progpulses_parameters['end'])+' (Units)' | |
|
930 | ||
|
931 | ||
|
932 | ||
|
933 | #kwargs['kwargs_channels'] = sorted(kwargs_channels, reverse=True) | |
|
934 | kwargs['lines'] = sorted(lines, reverse=True) | |
|
935 | kwargs['rc_delays'] = rc_delays | |
|
936 | kwargs['rc_delays_num'] = rc_delays_num | |
|
937 | kwargs['tx_lines'] = tx_lines | |
|
938 | kwargs['windows_lines'] = windows_lines | |
|
939 | kwargs['code_lines'] = code_lines | |
|
940 | kwargs['progpulses_lines'] = progpulses_lines | |
|
941 | ||
|
942 | ||
|
943 | #--FIN: Jueves 01-12-2016--- | |
|
888 | 944 | |
|
889 | 945 | #-------------------- DDS -----------------------: |
|
890 | 946 | if configuration.device.device_type.name == 'dds': |
General Comments 0
You need to be logged in to leave comments.
Login now