Commit 85eab5d9 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 6d5d201c
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
[template] [template]
filename = instance.cfg filename = instance.cfg
md5sum = 149ae45a3c6b99c7341551b8b63402f4 md5sum = e1eae1f1f53df0d0e1f9a650f341d2ed
[amari_lte.jinja2] [amari_lte.jinja2]
_update_hash_filename_ = amari/lte.jinja2 _update_hash_filename_ = amari/lte.jinja2
...@@ -80,7 +80,7 @@ md5sum = e5ca405581632c9ff9b435ff4a45d408 ...@@ -80,7 +80,7 @@ md5sum = e5ca405581632c9ff9b435ff4a45d408
[template-enb] [template-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg _update_hash_filename_ = instance-enb.jinja2.cfg
md5sum = 6d14a7924981eed3fcf8f9fc97864066 md5sum = a8e7e21adecdc5b4f3c1381bf465142e
[template-gnb] [template-gnb]
_update_hash_filename_ = instance-gnb.jinja2.cfg _update_hash_filename_ = instance-gnb.jinja2.cfg
...@@ -140,7 +140,7 @@ md5sum = e435990eb0a0d4be41efa9bd16dce09b ...@@ -140,7 +140,7 @@ md5sum = e435990eb0a0d4be41efa9bd16dce09b
[ru_lopcomm_cu_config.jinja2.xml] [ru_lopcomm_cu_config.jinja2.xml]
_update_hash_filename_ = ru/lopcomm/cu_config.jinja2.xml _update_hash_filename_ = ru/lopcomm/cu_config.jinja2.xml
md5sum = 3589be1efdfa9c2ebb26c6dcd07c0e02 md5sum = c5a0fb132d4afeeadd4d7f34bd2b1c73
[software.cfg.html] [software.cfg.html]
_update_hash_filename_ = gadget/software.cfg.html _update_hash_filename_ = gadget/software.cfg.html
......
...@@ -341,12 +341,13 @@ context = ...@@ -341,12 +341,13 @@ context =
key slapparameter_dict slap-configuration:configuration key slapparameter_dict slap-configuration:configuration
key gtp_addr_v6 slap-configuration:ipv6-random key gtp_addr_v6 slap-configuration:ipv6-random
raw gtp_addr_v4 {{ lan_ipv4 }} raw gtp_addr_v4 {{ lan_ipv4 }}
raw one_watt {{ ors_version['one-watt'] }}
raw tx_gain {{ ors_version['current-tx-gain'] }}
raw rx_gain {{ ors_version['current-rx-gain'] }}
raw earfcn {{ ors_version['current-earfcn'] }}
import netaddr netaddr import netaddr netaddr
${:extra-context} ${:extra-context}
# XXX reenable/rethink
{# raw one_watt {{ ors_version['one-watt'] }} #}
{# raw tx_gain {{ ors_version['current-tx-gain'] }} #}
{# raw rx_gain {{ ors_version['current-rx-gain'] }} #}
{# raw earfcn {{ ors_version['current-earfcn'] }} #}
[sib-config] [sib-config]
<= config-base <= config-base
......
...@@ -184,37 +184,41 @@ init = ...@@ -184,37 +184,41 @@ init =
return subprocess.check_output( return subprocess.check_output(
["sudo", "-n", "/opt/amarisoft/get-sdr-info", "-" + cmd] ["sudo", "-n", "/opt/amarisoft/get-sdr-info", "-" + cmd]
) )
options['version'] = float(get_sdr_info('v').decode()) #options['version'] = float(get_sdr_info('v').decode())
options['version'] = get_sdr_info('v').decode()
#options['is_ors'] = is_ors = (options['version'] != 'UNKNOWN')
options['is_ors'] = is_ors = False
options['band'] = get_sdr_info('b').decode() options['band'] = get_sdr_info('b').decode()
options['tdd'] = get_sdr_info('t').decode() options['tdd'] = get_sdr_info('t').decode()
options['one-watt'] = bool(options['version'] >= 4) if is_ors:
options['ors-version'] = "{} {} {}".format( options['one-watt'] = bool(options['version'] >= 4)
options['tdd'], options['ors-version'] = "{} {} {}".format(
options['band'], options['tdd'],
"2x1W" if options['one-watt'] else "2x0.5W", options['band'],
) "2x1W" if options['one-watt'] else "2x0.5W",
default_tx_gain = default_tx_gain_map [options['band']][int(options['one-watt'])] )
default_rx_gain = default_rx_gain_map [options['band']][int(options['one-watt'])] default_tx_gain = default_tx_gain_map [options['band']][int(options['one-watt'])]
default_earfcn = default_earfcn_map [options['band']] default_rx_gain = default_rx_gain_map [options['band']][int(options['one-watt'])]
default_nr_arfcn = default_nr_arfcn_map[options['band']] default_earfcn = default_earfcn_map [options['band']]
default_nr_band = default_nr_band_map [options['band']] default_nr_arfcn = default_nr_arfcn_map[options['band']]
options['range'] = range_map [options['band']] default_nr_band = default_nr_band_map [options['band']]
options['current-tx-gain'] = options['configuration'].get('tx_gain' , default_tx_gain ) options['range'] = range_map [options['band']]
options['current-rx-gain'] = options['configuration'].get('rx_gain' , default_rx_gain ) options['current-tx-gain'] = options['configuration'].get('tx_gain' , default_tx_gain )
options['current-earfcn'] = options['configuration'].get('dl_earfcn' , default_earfcn ) options['current-rx-gain'] = options['configuration'].get('rx_gain' , default_rx_gain )
options['current-nr-arfcn'] = options['configuration'].get('dl_nr_arfcn', default_nr_arfcn) options['current-earfcn'] = options['configuration'].get('dl_earfcn' , default_earfcn )
options['current-nr-band'] = options['configuration'].get('nr_band' , default_nr_band ) options['current-nr-arfcn'] = options['configuration'].get('dl_nr_arfcn', default_nr_arfcn)
power_estimate_dbm = power_map[options['band']][int(options['one-watt'])](float(options['current-tx-gain'])) options['current-nr-band'] = options['configuration'].get('nr_band' , default_nr_band )
if power_estimate_dbm == "UNKNOWN": power_estimate_dbm = power_map[options['band']][int(options['one-watt'])](float(options['current-tx-gain']))
power_estimate = "Information not available for this band" if power_estimate_dbm == "UNKNOWN":
else: power_estimate = "Information not available for this band"
power_estimate_mw = 10 ** ( power_estimate_dbm / 10 )
if power_estimate_mw < 0.01:
power_estimate_s = "{:0.2f} µW".format(power_estimate_mw * 1000)
else: else:
power_estimate_s = "{:0.2f} mW".format(power_estimate_mw) power_estimate_mw = 10 ** ( power_estimate_dbm / 10 )
power_estimate = "{:0.2f} dBm ({})".format(power_estimate_dbm, power_estimate_s) if power_estimate_mw < 0.01:
options['power-estimate'] = power_estimate power_estimate_s = "{:0.2f} µW".format(power_estimate_mw * 1000)
else:
power_estimate_s = "{:0.2f} mW".format(power_estimate_mw)
power_estimate = "{:0.2f} dBm ({})".format(power_estimate_dbm, power_estimate_s)
options['power-estimate'] = power_estimate
[lan-ip] [lan-ip]
recipe = slapos.recipe.build recipe = slapos.recipe.build
......
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