Consistent cent. freq. width decimal precision 83/114483/13
authorJoakim Törnqvist <joakim.tornqvist@smartoptics.com>
Fri, 15 Nov 2024 11:14:15 +0000 (12:14 +0100)
committerGilles Thouenon <gilles.thouenon@orange.com>
Thu, 19 Dec 2024 12:20:15 +0000 (13:20 +0100)
Corrects an issue where the nr of decimals for central frequency
was 4 in ZtoA direction and 5 in AtoZ direction.

Change-Id: I924273f1fff09870aff9e84042b5aac110a29fc8
Signed-off-by: Joakim Törnqvist <joakim.tornqvist@smartoptics.com>
pce/src/main/java/org/opendaylight/transportpce/pce/PcePathDescription.java

index cf197302f5638a198ccc4168e08b23c7102a64a8..9a13c1594f14fbafa1bf98903f4e126697849fb1 100644 (file)
@@ -121,7 +121,7 @@ public class PcePathDescription {
                         .setAToZMinFrequency(new FrequencyTHz(Decimal64.valueOf(rc.getMinFreq())))
                         .setAToZWavelengthNumber(Uint32.valueOf(rc.getResultWavelength()))
                         .setCentralFrequency(new FrequencyTHz(GridUtils.getCentralFrequencyWithPrecision(
-                                rc.getMinFreq(), rc.getMaxFreq(), 4).getValue()))
+                                rc.getMinFreq(), rc.getMaxFreq(), 5).getValue()))
                         .setWidth(width);
                 break;
             case StringConstants.SERVICE_TYPE_100GE_M:
@@ -173,7 +173,7 @@ public class PcePathDescription {
                         .setZToAMinFrequency(new FrequencyTHz(Decimal64.valueOf(rc.getMinFreq())))
                         .setZToAWavelengthNumber(Uint32.valueOf(rc.getResultWavelength()))
                         .setCentralFrequency(new FrequencyTHz(GridUtils.getCentralFrequencyWithPrecision(
-                                rc.getMinFreq(), rc.getMaxFreq(), 4).getValue()))
+                                rc.getMinFreq(), rc.getMaxFreq(), 5).getValue()))
                         .setWidth(GridUtils.getWidthFromRateAndModulationFormat(
                                 Uint32.valueOf(rc.getRate()), modulationFormat));
                 break;
@@ -185,7 +185,7 @@ public class PcePathDescription {
                         .setZToAMinFrequency(new FrequencyTHz(Decimal64.valueOf(rc.getMinFreq())))
                         .setZToAWavelengthNumber(Uint32.valueOf(rc.getResultWavelength()))
                         .setCentralFrequency(new FrequencyTHz(GridUtils.getCentralFrequencyWithPrecision(
-                                rc.getMinFreq(), rc.getMaxFreq(), 4).getValue()))
+                                rc.getMinFreq(), rc.getMaxFreq(), 5).getValue()))
                         .setWidth(width);
                 break;
             case StringConstants.SERVICE_TYPE_100GE_M: