@Override public <G, D, L> void importParameters( ParameterHelper helper, DataDocument<G, D, L> document, D dictionary) { final Set<String> keys = document.keySetOfDictionary(dictionary); if (keys.contains("intensityDeviation")) setIntensityDeviation(document.getDoubleFromDictionary(dictionary, "intensityDeviation")); if (keys.contains("medianNoiseIntensity")) setMedianNoiseIntensity(document.getDoubleFromDictionary(dictionary, "medianNoiseIntensity")); if (keys.contains("formulaConstraints")) setFormulaConstraints( (FormulaConstraints) helper.unwrap( document, document.getFromDictionary(dictionary, "formulaConstraints"))); if (keys.contains("allowedMassDeviation")) allowedMassDeviation = Deviation.fromString( document.getStringFromDictionary(dictionary, "allowedMassDeviation")); if (keys.contains("standardMs1MassDeviation")) standardMs1MassDeviation = Deviation.fromString( document.getStringFromDictionary(dictionary, "standardMs1MassDeviation")); if (keys.contains("standardMs2MassDeviation")) standardMs2MassDeviation = Deviation.fromString( document.getStringFromDictionary(dictionary, "standardMs2MassDeviation")); if (keys.contains("standardMassDifferenceDeviation")) standardMassDifferenceDeviation = Deviation.fromString( document.getStringFromDictionary(dictionary, "standardMassDifferenceDeviation")); }
/** * @param center the current center of the board * @param radius the current radius of the board * @return the calculated point */ public Point calculatePoint(Point center, int radius) { int angle; /* * bullseye special treatment */ if (baseNumber == 25) { angle = 45; } else { angle = HitAreaConstants.getAngle(baseNumber); } double targetDistance; switch (multiplier) { case 3: targetDistance = radius * 0.5; break; case 2: targetDistance = radius * 0.82; break; default: if (outerRing) { targetDistance = radius * 0.65; } else { targetDistance = radius * 0.35; } break; } /* * bullseye special treatment */ if (baseNumber == 25) { if (multiplier == 2) { targetDistance = radius * 0.01; } else { targetDistance = radius * 0.05; } } /* * apply deviation */ if (deviation != null) { targetDistance = targetDistance * deviation.getDistanceFactor(); angle += deviation.getAngleDelta(); } double deltaX = targetDistance * Math.cos(Math.toRadians(angle)); double deltaY = targetDistance * Math.sin(Math.toRadians(angle)); logger.info("Delta x: {}, Delta y: {}", deltaX, deltaY); double x = center.x + deltaX; double y = center.y - deltaY; return new Point((int) x, (int) y); }