private void updateOMSPorts(int numChls, ConnectPoint srcCp, ConnectPoint dstCp) { // round down to largest slot that allows numChl channels to fit into C band range ChannelSpacing chl = null; Frequency perChl = TOTAL.floorDivision(numChls); for (int i = 0; i < ChannelSpacing.values().length; i++) { Frequency val = ChannelSpacing.values()[i].frequency(); if (val.isLessThan(perChl)) { chl = ChannelSpacing.values()[i]; break; } } if (chl == null) { chl = ChannelSpacing.CHL_6P25GHZ; } // if true, there was less channels than can be tightly packed. Frequency grid = chl.frequency(); // say Linc's 1st slot starts at CENTER and goes up from there. Frequency min = CENTER.add(grid); Frequency max = CENTER.add(grid.multiply(numChls)); PortDescription srcPortDesc = new OmsPortDescription(srcCp.port(), true, min, max, grid); PortDescription dstPortDesc = new OmsPortDescription(dstCp.port(), true, min, max, grid); descriptions.put(srcCp, srcPortDesc); descriptions.put(dstCp, dstPortDesc); deviceProviderService.portStatusChanged(srcCp.deviceId(), srcPortDesc); deviceProviderService.portStatusChanged(dstCp.deviceId(), dstPortDesc); }