Commit 7f9912dd authored by PECQUOT's avatar PECQUOT

[fix] Fix SamplingOperationDTO.individualCount type (Double to Integer),...

[fix] Fix SamplingOperationDTO.individualCount type (Double to Integer), Exceptions thrown in SwingWorkers are now caught (Mantis #50418)
[fix] Fix contiguous sampling operation's transition check in grid initialisation (Mantis #50450)
Signed-off-by: PECQUOT's avatarlp1ee9d <ludovic.pecquot@e-is.pro>
parent 898689e3
## Sprint 80 - v3.8.1
- Pas de mise à jour de modèle
- La configuration du server de synchronisation (>= 3.6.3) doit **impérativement** avoir les deux options suivantes :
quadrige3.persistence.db.script=classpath:fr/ifremer/quadrige3/core/db/changelog/hsqldb/quadrige3.script
quadrige3.persistence.liquibase.changelog.path=classpath:fr/ifremer/quadrige3/core/db/changelog/hsqldb/db-changelog-master.xml
## Sprint 79 - v3.8.0
- Une mise à jour de la base de données cliente HsqlDb s'exécutera au démarrage de l'application
......
......@@ -171,7 +171,7 @@
<maven.compiler.debug>true</maven.compiler.debug>
<!-- Quadrige3 Core version -->
<quadrige3-core.version>3.6.2</quadrige3-core.version>
<quadrige3-core.version>3.6.3</quadrige3-core.version>
<!-- Last ReefDb launcher version -->
<launcherVersion>3.0.3</launcherVersion>
......
......@@ -325,8 +325,7 @@ public class ReefDbSamplingOperationDaoImpl extends SamplingOperationDaoImpl imp
result.setDepth(Daos.convertToDouble((Float) it.next()));
result.setMaxDepth(Daos.convertToDouble((Float) it.next()));
result.setMinDepth(Daos.convertToDouble((Float) it.next()));
Double nbIndiv = (Double) it.next();
result.setIndividualCount(nbIndiv == null ? null : nbIndiv.intValue());
result.setIndividualCount(Daos.convertToInteger((Number) it.next()));
// Get positioning system
Integer posSystemId = (Integer) it.next();
......
......@@ -32,6 +32,7 @@ import fr.ifremer.reefdb.dto.configuration.filter.FilterDTO;
import fr.ifremer.reefdb.dto.enums.ExtractionFilterValues;
import fr.ifremer.reefdb.dto.system.extraction.ExtractionPeriodDTO;
import fr.ifremer.reefdb.dto.system.extraction.FilterTypeDTO;
import fr.ifremer.reefdb.service.ReefDbTechnicalException;
import fr.ifremer.reefdb.ui.swing.content.extraction.filters.period.ExtractionPeriodUI;
import fr.ifremer.reefdb.ui.swing.content.manage.filter.select.SelectFilterUI;
import fr.ifremer.reefdb.ui.swing.util.table.AbstractReefDbTableModel;
......@@ -49,6 +50,7 @@ import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ExecutionException;
import static org.nuiton.i18n.I18n.t;
......@@ -334,6 +336,11 @@ public class ExtractionsFiltersUIHandler extends
if (isCancelled()) {
return;
}
try {
get();
} catch (InterruptedException | ExecutionException e) {
throw new ReefDbTechnicalException(e.getMessage(), e);
}
getModel().setLoading(true);
getTable().setVisibleRowCount(rows.size());
......
......@@ -40,6 +40,7 @@ import fr.ifremer.reefdb.dto.enums.FilterTypeValues;
import fr.ifremer.reefdb.dto.referential.DepartmentDTO;
import fr.ifremer.reefdb.dto.referential.SamplingEquipmentDTO;
import fr.ifremer.reefdb.dto.referential.pmfm.PmfmDTO;
import fr.ifremer.reefdb.service.ReefDbTechnicalException;
import fr.ifremer.reefdb.service.StatusFilter;
import fr.ifremer.reefdb.ui.swing.content.home.HomeUI;
import fr.ifremer.reefdb.ui.swing.content.home.operation.add.AddOperationTableUI;
......@@ -60,6 +61,7 @@ import javax.swing.SwingWorker;
import java.awt.Dimension;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ThreadPoolExecutor;
import static org.nuiton.i18n.I18n.t;
......@@ -704,6 +706,11 @@ public class OperationsTableUIHandler extends AbstractReefDbTableUIHandler<Opera
if (isCancelled()) {
return;
}
try {
get();
} catch (InterruptedException | ExecutionException e) {
throw new ReefDbTechnicalException(e.getMessage(), e);
}
// Set model properties
getModel().setPmfms(pmfms);
......
......@@ -24,6 +24,7 @@ package fr.ifremer.reefdb.ui.swing.content.manage.filter;
*/
import fr.ifremer.quadrige3.ui.core.dto.QuadrigeBean;
import fr.ifremer.reefdb.service.ReefDbTechnicalException;
import fr.ifremer.reefdb.ui.swing.action.QuitScreenAction;
import fr.ifremer.reefdb.ui.swing.content.manage.filter.element.AbstractFilterElementUIHandler;
import fr.ifremer.reefdb.ui.swing.content.manage.filter.element.FilterElementUIModel;
......@@ -44,6 +45,7 @@ import java.awt.event.ComponentEvent;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;
import static org.nuiton.i18n.I18n.t;
......@@ -201,6 +203,12 @@ public class FilterUIHandler extends AbstractReefDbUIHandler<FilterUIModel, Filt
if (isCancelled()) {
return;
}
try {
get();
} catch (InterruptedException | ExecutionException e) {
throw new ReefDbTechnicalException(e.getMessage(), e);
}
getModel().getFilterElementUIModel().setLoading(true);
getModel().setSelectedFilter(selectedFilter);
......
......@@ -28,6 +28,7 @@ import fr.ifremer.quadrige3.ui.swing.table.SwingTable;
import fr.ifremer.reefdb.dao.technical.Daos;
import fr.ifremer.reefdb.dto.ReefDbBeans;
import fr.ifremer.reefdb.dto.configuration.programStrategy.ProgramDTO;
import fr.ifremer.reefdb.service.ReefDbTechnicalException;
import fr.ifremer.reefdb.ui.swing.content.manage.program.ProgramsUI;
import fr.ifremer.reefdb.ui.swing.content.manage.program.programs.departments.DepartmentsDialogUI;
import fr.ifremer.reefdb.ui.swing.content.manage.program.programs.users.UsersDialogUI;
......@@ -48,6 +49,7 @@ import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.ExecutionException;
import static org.nuiton.i18n.I18n.t;
......@@ -576,6 +578,11 @@ public class ProgramsTableUIHandler extends AbstractReefDbTableUIHandler<Program
if (isCancelled()) {
return;
}
try {
get();
} catch (InterruptedException | ExecutionException e) {
throw new ReefDbTechnicalException(e.getMessage(), e);
}
// Update strategies table
adminProgrammeUI.getStrategiesTableUI().getHandler().load(selectedProgram);
......
......@@ -30,6 +30,7 @@ import fr.ifremer.quadrige3.ui.swing.table.SwingTable;
import fr.ifremer.reefdb.dto.ReefDbBeans;
import fr.ifremer.reefdb.dto.configuration.programStrategy.AppliedStrategyDTO;
import fr.ifremer.reefdb.dto.configuration.programStrategy.PmfmStrategyDTO;
import fr.ifremer.reefdb.service.ReefDbTechnicalException;
import fr.ifremer.reefdb.ui.swing.content.manage.program.ProgramsUI;
import fr.ifremer.reefdb.ui.swing.content.manage.program.programs.ProgramsTableRowModel;
import fr.ifremer.reefdb.ui.swing.util.AbstractReefDbBeanUIModel;
......@@ -45,6 +46,7 @@ import javax.swing.SwingWorker;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;
import static org.nuiton.i18n.I18n.t;
......@@ -479,6 +481,11 @@ public class StrategiesTableUIHandler extends AbstractReefDbTableUIHandler<Strat
if (isCancelled()) {
return;
}
try {
get();
} catch (InterruptedException | ExecutionException e) {
throw new ReefDbTechnicalException(e.getMessage(), e);
}
// loading locations
adminProgrammeUI.getLocationsTableUI().getHandler().loadAppliedStrategiesFromStrategy(selectedProgram, selectedStrategy);
......@@ -511,6 +518,11 @@ public class StrategiesTableUIHandler extends AbstractReefDbTableUIHandler<Strat
if (isCancelled()) {
return;
}
try {
get();
} catch (InterruptedException | ExecutionException e) {
throw new ReefDbTechnicalException(e.getMessage(), e);
}
// loading pmfms
adminProgrammeUI.getPmfmsTableUI().getHandler().load(selectedProgram, selectedStrategy);
......
......@@ -27,6 +27,7 @@ import fr.ifremer.reefdb.dto.ReefDbBeans;
import fr.ifremer.reefdb.dto.data.survey.SurveyDTO;
import fr.ifremer.reefdb.dto.referential.TaxonDTO;
import fr.ifremer.reefdb.dto.referential.TaxonGroupDTO;
import fr.ifremer.reefdb.service.ReefDbTechnicalException;
import fr.ifremer.reefdb.ui.swing.action.GoToObservationAction;
import fr.ifremer.reefdb.ui.swing.action.QuitScreenAction;
import fr.ifremer.reefdb.ui.swing.util.ReefDbUIs;
......@@ -43,6 +44,7 @@ import javax.swing.JTabbedPane;
import javax.swing.SwingWorker;
import java.awt.Color;
import java.util.List;
import java.util.concurrent.ExecutionException;
import static org.nuiton.i18n.I18n.t;
......@@ -324,6 +326,12 @@ public class ObservationUIHandler extends AbstractReefDbTabContainerUIHandler<Ob
@Override
protected void done() {
try {
try {
get();
} catch (InterruptedException | ExecutionException e) {
throw new ReefDbTechnicalException(e.getMessage(), e);
}
getUI().applyDataBinding(ObservationUI.BINDING_OBSERVATION_DESCRIPTION_LABEL_TEXT);
// Reset modify flag
......
......@@ -170,7 +170,9 @@ public class InitGridUIModel extends AbstractEmptyUIModel<InitGridUIModel> {
if (getLength() % getSamplingOperations().size() != 0) return false;
// the effective length per sampling operation (length/nbSamplingOperation - origin) must be a multiple of transition
return (getLength() / getSamplingOperations().size() - getOrigin()) % getTransition() == 0;
// wrong test: return (getLength() / getSamplingOperations().size() - getOrigin()) % getTransition() == 0;
// Mantis #50450: use this correct test:
return (((getLength() - getOrigin()) / getTransition()) + 1) % getSamplingOperations().size() == 0;
}
......
......@@ -29,6 +29,7 @@ import fr.ifremer.quadrige3.ui.swing.table.editor.ExtendedComboBoxCellEditor;
import fr.ifremer.reefdb.dto.ReefDbBeans;
import fr.ifremer.reefdb.dto.data.photo.PhotoDTO;
import fr.ifremer.reefdb.dto.data.sampling.SamplingOperationDTO;
import fr.ifremer.reefdb.service.ReefDbTechnicalException;
import fr.ifremer.reefdb.ui.swing.util.image.PhotoViewer;
import fr.ifremer.reefdb.ui.swing.util.table.AbstractReefDbTableUIHandler;
import fr.ifremer.reefdb.ui.swing.util.table.AbstractReefDbTableUIModel;
......@@ -45,6 +46,7 @@ import javax.swing.table.TableCellRenderer;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.ExecutionException;
import static org.nuiton.i18n.I18n.t;
......@@ -485,6 +487,12 @@ public class PhotosTabUIHandler extends AbstractReefDbTableUIHandler<PhotosTable
@Override
protected void done() {
try {
get();
} catch (InterruptedException | ExecutionException e) {
throw new ReefDbTechnicalException(e.getMessage(), e);
}
// affiche l indice photos
getUI().getPhotoIndexLabel().setText(String.format("%s / %s", getModel().getPhotoIndex() == null ? 0 : getModel().getPhotoIndex() + 1, getModel().getRowCount()));
......
......@@ -31,6 +31,16 @@
</properties>
<body>
<release version="3.8.1" date="2020-01-16" description="Stable release">
<action dev="ludovic.pecquot@e-is.pro" type="fix" issue="50418">
Fix SamplingOperationDTO.individualCount type (Double to Integer)
Exceptions thrown in SwingWorkers are now caught
</action>
<action dev="ludovic.pecquot@e-is.pro" type="fix" issue="50450">
Fix contiguous sampling operation's transition check in grid initialisation
</action>
</release>
<release version="3.8.0" date="2020-01-10" description="Stable release">
<action dev="ludovic.pecquot@e-is.pro" type="fix" issue="49361">
Cache rebuild after a referential import is now performed correctly
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment