Avoid converting spanloss to double when calculating target power value 27/91127/1
authorJonas Mårtensson <jonas.martensson@ri.se>
Sun, 31 May 2020 18:02:09 +0000 (20:02 +0200)
committerGilles Thouenon <gilles.thouenon@orange.com>
Fri, 10 Jul 2020 13:09:38 +0000 (15:09 +0200)
commit0b6122a85487144f423d6374e6f9e45b07f0ab71
treec671ce6d57df2f1191b13ac24d94cdf1dacf3d1c
parentb2e9926068b9fa9c93384a12f3414a254ff5a4dd
Avoid converting spanloss to double when calculating target power value

Currently spanloss is measured and set without any fractional digits.
We would like to have one fractional digit but this creates problems
because of the conversion to double when calculating target power
resulting in the power value having more than the two fractional digits
allowed by the yang module. This patch proposes to skip the conversion
to double and only use BigDecimal to avoid the problem.

The proposal to measure spanloss with one fractional digit will be
submitted in a separate patch.

Signed-off-by: Jonas Mårtensson <jonas.martensson@ri.se>
Change-Id: Ibd13c991d43f2e94739710412e8edadcc0c537bf
olm/src/main/java/org/opendaylight/transportpce/olm/power/PowerMgmtImpl.java