Commit 6b4915b5 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 56e04e81
......@@ -55,7 +55,7 @@
{{- ru['ru_ref'] | tojson }}
{%- elif ru['ru_type'] == 'ruincell_ref' %}
{#- XXX first check referred cell exist ? #}
{{- _jcell_ru_ref(cell_dict[ru['ruincell_ref']], seen) }}
{{- _jcell_ru_ref(icell_dict[ru['ruincell_ref']], seen) }}
{%- else %}
{#- ru definition is embedded into cell #}
{{- ('_%s_ru' % J(jref_of_shared(icell))) | tojson }}
......@@ -79,29 +79,29 @@
{%- endmacro %}
{#- cell_dict keeps cell slave instances: reference -> icell
ru_dict keeps RU slave instances + RU whose definition is embedded into a cell: reference -> iRU
{#- icell_dict keeps cell slave instances: reference -> icell
iru_dict keeps RU slave instances + RU whose definition is embedded into a cell: reference -> iRU
in the kept instances _ is automatically json-decoded
#}
{%- set cell_dict = {} %}
{%- set ru_dict = {} %}
{%- set icell_dict = {} %}
{%- set iru_dict = {} %}
{%- for slave in slap_configuration.get('slave-instance-list', []) %}
{%- set ref = J(jref_of_shared(slave)) %}
{%- set _ = J(slave['_']) %}
{%- do slave.update({'_': _}) %}
{%- if 'ru_type' in _ %}
{%- set iru = slave %}
{%- do ru_dict.update({ref: iru}) %}
{%- do iru_dict.update({ref: iru}) %}
{%- elif 'cell_type' in _ %}
{%- set icell = slave %}
{%- for k, v in defaults['cell'].items() %}
{%- do _.setdefault(k, v) %}
{%- endfor %}
{%- do cell_dict.update({ref: icell}) %}
{%- do icell_dict.update({ref: icell}) %}
{%- set ru = _['ru'] %}
{%- if ru['ru_type'] not in ('ru_ref', 'ruincell_ref') %}
{#- embedded ru definition -> expose it as `_<cell_ref>_ru` #}
{%- do ru_dict.update({'_%s_ru' % ref: {
{%- do iru_dict.update({'_%s_ru' % ref: {
'_': ru,
'slave_title': '%s. RU' % icell['slave_title'],
'slave_reference': icell['slave_reference'],
......@@ -112,14 +112,14 @@
{%- endif %}
{%- endfor %}
{#- do print('\n>>> ru_dict:'), pprint(ru_dict) #}
{#- do print('\n>>> cell_dict:'), pprint(cell_dict) #}
{#- do print('\n>>> iru_dict:'), pprint(iru_dict) #}
{#- do print('\n>>> icell_dict:'), pprint(icell_dict) #}
{#- verify that there is no dangling cell->ru references #}
{#- XXX also verify that there is no dangling cell -> cell refs in ruincell_ref #}
{%- for _, icell in cell_dict|dictsort %}
{%- for _, icell in icell_dict|dictsort %}
{%- set ru_ref = J(jcell_ru_ref(icell)) %}
{%- if ru_ref not in ru_dict %}
{%- if ru_ref not in iru_dict %}
{%- do error(icell, "referred RU %s does not exist" % ru_ref) %}
{%- endif %}
{%- endfor %}
......@@ -148,7 +148,7 @@
{%- set dev_argv = [] %}
{%- set ru_cpri_dict = {} %} {# dev -> ru for ru with link_kind = cpri #}
{%- for rf_port, (ru_ref, iru) in enumerate(ru_dict|dictsort) %}
{%- for rf_port, (ru_ref, iru) in enumerate(iru_dict|dictsort) %}
{%- set ru = iru['_'] %}
{%- do ru.update({'.rf_port': rf_port}) %}
{%- if ru['ru_type'] == 'sdr' %}
......@@ -240,11 +240,11 @@
# LTE cells
cell_list: [
{%- for cell_ref, icell in cell_dict|dictsort %}
{%- for cell_ref, icell in icell_dict|dictsort %}
{% set cell = icell['_'] %}
{%- if cell['cell_type'] == 'lte' %}
{%- set ru_ref = J(jcell_ru_ref(icell)) %}
{%- set iru = ru_dict[ru_ref] %}
{%- set iru = iru_dict[ru_ref] %}
{%- set ru = iru['_'] %}
// {{ J(jref_of_shared(icell)) }}
{
......@@ -260,7 +260,7 @@
{#- CA in between all LTE cells #}
scell_list: [
{%- for cell2_ref, icell2 in cell_dict|dictsort %}
{%- for cell2_ref, icell2 in icell_dict|dictsort %}
{%- set cell2 = icell2['_'] %}
{%- if cell2_ref != cell_ref and cell2['cell_type'] == 'lte' %}
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment