예제 #1
0
  ArrayOfEStandardisationCreationTarget translateEStandardisationCreationTargets(
      ScorisQig scorisQig) throws TranslatorException {
    ArrayOfEStandardisationCreationTarget arrayOfEStandardisationCreationTarget =
        new ArrayOfEStandardisationCreationTarget();
    QigAttributes qigAttributes = scorisQig.getQigAttributes();
    throwExceptionForNullInput(qigAttributes, "qigAttributes");

    List<EStandardisationCreationTarget> eStandardisationCreationTargets =
        arrayOfEStandardisationCreationTarget.getEStandardisationCreationTarget();
    for (Target target : qigAttributes.getTargets(TargetType.Creation)) {
      EStandardisationCreationTarget eStdCreationTarget = new EStandardisationCreationTarget();
      eStdCreationTarget.setMarkingModeName(target.getTargetMode().getModeType());
      throwExceptionForNullInput(target.getTargetQuantity(), "target.targetQuantity");
      eStdCreationTarget.setTarget(target.getTargetQuantity());
      eStandardisationCreationTargets.add(eStdCreationTarget);
    }
    return arrayOfEStandardisationCreationTarget;
  }
예제 #2
0
 private void handleSeedingCreationTarget(
     QigAttributes qigAttributes,
     QualityModel qualityModel,
     ArrayOfEStandardisationCreationTarget creationTargets)
     throws TranslatorException {
   if (qualityModel.getQualityMethod().equalsIgnoreCase(SEEDING_QUALITY_METHOD)) {
     Float seedingPercentage = qigAttributes.getSeedingCreationPercentage();
     if (seedingPercentage == null) {
       throw new TranslatorException(
           "A seeding creation percentage is required for a paper configured with a seeding quality method");
     }
     EStandardisationCreationTarget seedingCreationTarget = new EStandardisationCreationTarget();
     seedingCreationTarget.setMarkingModeName("Seeding");
     Integer liveMarkingTarget =
         getLiveMarkingTarget(qigAttributes.getTargets(TargetType.Marking));
     seedingCreationTarget.setTarget(
         (int) Math.ceil((seedingPercentage / 100) * liveMarkingTarget));
     creationTargets.getEStandardisationCreationTarget().add(seedingCreationTarget);
   }
 }