2 * Copyright © 2017 Orange, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.transportpce.common.fixedflex;
11 public final class FixedFlexImpl implements FixedFlexInterface {
13 private double centerFrequency;
16 private double wavelength;
18 public FixedFlexImpl(Long index, double centreFrequency, double start, double stop, double wavelength) {
20 this.centerFrequency = centreFrequency;
23 this.wavelength = wavelength;
26 public FixedFlexImpl() {
28 this.centerFrequency = 0;
34 public FixedFlexImpl(long wlIndex) {
36 this.centerFrequency = 196.1 - (wlIndex - 1) * 0.05;
37 this.start = this.centerFrequency - 0.025;
38 this.stop = this.centerFrequency + 0.025;
39 this.wavelength = 1528.77 + ((wlIndex - 1) * 0.39);
44 * @param index Wavelength number
45 * @return Returns FixedFlexImp object with the calculated result.
47 public FixedFlexImpl getFixedFlexWaveMapping(long wlIndex) {
48 FixedFlexImpl fixedFlex = new FixedFlexImpl();
49 long mappedWL = wlIndex - 36;
50 fixedFlex.centerFrequency = 193.1 + (50.0 / 1000.0) * mappedWL;
51 fixedFlex.start = 193.1 + (50.0 * mappedWL - 25) / 1000.0;
52 fixedFlex.stop = 193.1 + (50.0 * mappedWL + 25) / 1000.0;
56 public double getCenterFrequency() {
57 return centerFrequency;
60 public double getStart() {
64 public long getIndex() {
68 public double getStop() {
72 public double getWavelength() {