Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 4eb7744b by Tony Chemit at 2023-05-11T13:18:54+02:00 En LL / logbook / Opération de pêche, les boutons de recopie des caractéristiques des opérations précédentes sont indisponibles - Closes #2688 - - - - - 98b5886d by Tony Chemit at 2023-05-11T13:19:22+02:00 Dans le calcul des nombres estimés (PS observation), appliquer un arrondi standard - Closes #2687 - - - - - 3 changed files: - client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/logbook/SetUI.jcss - client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/logbook/SetUIModelStates.java - core/persistence/consolidation/src/main/java/fr/ird/observe/consolidation/data/ps/observation/CatchConsolidateActions.java Changes: ===================================== client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/logbook/SetUI.jcss ===================================== @@ -30,14 +30,14 @@ DateTimeEditor { } #copyFirstValuesAndSave { - enabled:{states.isUpdatingMode() && states.getCopyFirstSetCandidate() != null && states.isValid()}; + enabled:{!states.isReadingMode() && states.getCopyFirstSetCandidate() != null && states.isValid()}; text:"observe.data.ll.logbook.Set.action.copyFirstValuesAndSave"; toolTipText:"observe.data.ll.logbook.Set.action.copyFirstValuesAndSave"; _keyStroke:{fr.ird.observe.client.datasource.editor.ll.ObserveLLKeyStrokes.KEY_STROKE_COPY_FIRST_VALUES_AND_SAVE}; } #copyLastValuesAndSave { - enabled:{states.isUpdatingMode() && states.getCopyLastSetCandidate() != null && states.isValid()}; + enabled:{!states.isReadingMode() && states.getCopyLastSetCandidate() != null && states.isValid()}; text:"observe.data.ll.logbook.Set.action.copyLastValuesAndSave"; toolTipText:"observe.data.ll.logbook.Set.action.copyLastValuesAndSave"; _keyStroke:{fr.ird.observe.client.datasource.editor.ll.ObserveLLKeyStrokes.KEY_STROKE_COPY_LAST_VALUES_AND_SAVE}; ===================================== client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/logbook/SetUIModelStates.java ===================================== @@ -51,7 +51,7 @@ public class SetUIModelStates extends GeneratedSetUIModelStates { copySetCandidates = form.getObject().getOtherSets().stream() .sorted(Comparator.comparing(SetStubDto::getSettingStartTimeStamp)) .collect(Collectors.toList()); - updateCopySetCandidate(getBean().getSettingStartTimeStamp()); + updateCopySetCandidate(null); super.copyFormToBean(form); } @@ -91,17 +91,19 @@ public class SetUIModelStates extends GeneratedSetUIModelStates { } private void updateCopySetCandidate(Date newValue) { + if (isReadingMode()) { + return; + } + setCopyFirstSetCandidate(null); + setCopyLastSetCandidate(null); if (newValue == null) { - setCopyLastSetCandidate(null); - } else { - List<SetStubDto> collect = copySetCandidates.stream().filter(e -> e.getSettingStartTimeStamp().before(newValue)).collect(Collectors.toList()); - if (collect.isEmpty()) { - setCopyFirstSetCandidate(null); - setCopyLastSetCandidate(null); - } else { - setCopyFirstSetCandidate(collect.get(0)); - setCopyLastSetCandidate(collect.get(collect.size() - 1)); - } + return; + } + List<SetStubDto> collect = copySetCandidates.stream().filter(e -> e.getSettingStartTimeStamp().before(newValue)).collect(Collectors.toList()); + if (collect.isEmpty()) { + return; } + setCopyFirstSetCandidate(collect.get(0)); + setCopyLastSetCandidate(collect.get(collect.size() - 1)); } } ===================================== core/persistence/consolidation/src/main/java/fr/ird/observe/consolidation/data/ps/observation/CatchConsolidateActions.java ===================================== @@ -143,7 +143,7 @@ public enum CatchConsolidateActions implements AtomicConsolidateAction<CatchCons public void accept(CatchConsolidateContext context, Catch aCatch) { float meanWeight = aCatch.getMeanWeight(); float catchWeight = aCatch.getCatchWeight(); - int totalCount = (int) ((float) 1000 * catchWeight / meanWeight); + int totalCount = Math.round(1000f * catchWeight / meanWeight); aCatch.setTotalCount(totalCount); aCatch.setTotalCountComputedSource(CatchComputedValueSource.fromData); } View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/a1c12e640affebbf7e5337029... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/a1c12e640affebbf7e5337029... You're receiving this email because of your account on gitlab.com.