Fix bug in FixedFlexImpl and its use by renderer
[transportpce.git] / common / src / main / java / org / opendaylight / transportpce / common / fixedflex / FixedFlexImpl.java
index dd5bd03b663184447ae7c1da733e400a69c0cb8c..06c2bb9fce4af43a6bb8d86fe385446e409f34fa 100644 (file)
@@ -35,6 +35,14 @@ public final class FixedFlexImpl implements FixedFlexInterface {
         this.wavelength = 0;
     }
 
+    public FixedFlexImpl(long wlIndex) {
+        this.index = wlIndex;
+        this.centerFrequency = 196.1 - (wlIndex - 1) * 0.05;
+        this.start = this.centerFrequency - 0.025;
+        this.stop = this.centerFrequency + 0.025;
+        this.wavelength = 1528.77 + ((wlIndex - 1) * 0.39);
+    }
+
     @Override
     /**
      * @param index Wavelength number