This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit 1bf50adf67dc5d08d3365b4320666b109b49ac26 Author: Kevin Morin <morin@codelutin.com> Date: Thu Feb 25 17:43:35 2016 +0100 utilisation des rtp pour calculer les poids des lignes de mensuration (refs #8019) --- .../frequency/SpeciesFrequencyRowModel.java | 34 +++++-- .../frequency/SpeciesFrequencyTableModel.java | 111 ++++++++++++--------- .../species/frequency/SpeciesFrequencyUI.jcss | 1 + .../frequency/SpeciesFrequencyUIHandler.java | 91 ++++++++++++++--- .../species/frequency/SpeciesFrequencyUIModel.java | 46 +++++++++ 5 files changed, 215 insertions(+), 68 deletions(-) diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyRowModel.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyRowModel.java index 63dd67e..60fd754 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyRowModel.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyRowModel.java @@ -30,6 +30,7 @@ import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequencys; import fr.ifremer.tutti.persistence.entities.referential.Caracteristic; import fr.ifremer.tutti.type.WeightUnit; import fr.ifremer.tutti.ui.swing.util.AbstractTuttiBeanUIModel; +import fr.ifremer.tutti.ui.swing.util.computable.ComputableData; import org.nuiton.util.beans.Binder; import org.nuiton.util.beans.BinderFactory; @@ -51,6 +52,8 @@ public class SpeciesFrequencyRowModel extends AbstractTuttiBeanUIModel<SpeciesBa public static final String PROPERTY_WEIGHT = "weight"; + public static final String PROPERTY_COMPUTED_WEIGHT = "computedOrNotWeight"; + public static final String PROPERTY_LENGHT_STEP_CARACTERISTIC = "lengthStepCaracteristic"; /** @@ -70,10 +73,9 @@ public class SpeciesFrequencyRowModel extends AbstractTuttiBeanUIModel<SpeciesBa /** * Weight of fishes observed. * - * @since 0.2 + * @since 4.5 */ - protected Float weight; - + protected ComputableData<Float> computedOrNotWeight = new ComputableData<>(); /** * Length step caracteristic. * @@ -130,6 +132,8 @@ public class SpeciesFrequencyRowModel extends AbstractTuttiBeanUIModel<SpeciesBa public SpeciesFrequencyRowModel(WeightUnit weightUnit) { super(fromBeanBinder, toBeanBinder); this.weightUnit = weightUnit; + computedOrNotWeight.addPropagateListener(PROPERTY_WEIGHT, this); + computedOrNotWeight.addPropagateListener(PROPERTY_COMPUTED_WEIGHT, this); } //------------------------------------------------------------------------// @@ -188,16 +192,34 @@ public class SpeciesFrequencyRowModel extends AbstractTuttiBeanUIModel<SpeciesBa @Override public Float getWeight() { - return weight; + return computedOrNotWeight.getData(); } @Override public void setWeight(Float weight) { Object oldValue = getWeight(); - this.weight = weight; + computedOrNotWeight.setData(weight); firePropertyChange(PROPERTY_WEIGHT, oldValue, weight); } + public Float getComputedWeight() { + return computedOrNotWeight.getComputedData(); + } + + public void setComputedWeight(Float weight) { + Object oldValue = getComputedWeight(); + computedOrNotWeight.setComputedData(weight); + firePropertyChange(PROPERTY_COMPUTED_WEIGHT, oldValue, weight); + } + + public ComputableData<Float> getComputedOrNotWeight() { + return computedOrNotWeight; + } + + public void setComputedOrNotWeight(ComputableData<Float> computedOrNotWeight) { + this.computedOrNotWeight = computedOrNotWeight; + } + @Override public Caracteristic getLengthStepCaracteristic() { return lengthStepCaracteristic; @@ -234,7 +256,7 @@ public class SpeciesFrequencyRowModel extends AbstractTuttiBeanUIModel<SpeciesBa } public boolean isEmpty() { - return lengthStep == null && (weight == null || number == null); + return lengthStep == null && (computedOrNotWeight.getData() == null || number == null); } } diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyTableModel.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyTableModel.java index 1a3056a..99a8445 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyTableModel.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyTableModel.java @@ -29,6 +29,7 @@ import org.jfree.data.xy.XYSeries; import org.nuiton.jaxx.application.swing.table.AbstractApplicationTableModel; import org.nuiton.jaxx.application.swing.table.ColumnIdentifier; +import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.List; @@ -55,7 +56,7 @@ public class SpeciesFrequencyTableModel extends AbstractApplicationTableModel<Sp n("tutti.editSpeciesFrequencies.table.header.number")); public static final ColumnIdentifier<SpeciesFrequencyRowModel> WEIGHT = ColumnIdentifier.newId( - SpeciesFrequencyRowModel.PROPERTY_WEIGHT, + SpeciesFrequencyRowModel.PROPERTY_COMPUTED_WEIGHT, n("tutti.editSpeciesFrequencies.table.header.weight"), n("tutti.editSpeciesFrequencies.table.header.weight")); @@ -176,7 +177,9 @@ public class SpeciesFrequencyTableModel extends AbstractApplicationTableModel<Sp if (oldRows != null) { - oldRows.forEach(this::dettachListeners); + for (SpeciesFrequencyRowModel row : oldRows) { + dettachListeners(row); + } } @@ -228,42 +231,45 @@ public class SpeciesFrequencyTableModel extends AbstractApplicationTableModel<Sp private PropertyChangeListener getOnLengthStepChangedListener() { if (onLengthStepChangedListener == null) { - onLengthStepChangedListener = evt -> { + onLengthStepChangedListener = new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { + + Float oldValue = (Float) evt.getOldValue(); + if (oldValue != null) { - Float oldValue = (Float) evt.getOldValue(); - if (oldValue != null) { + modelCache.removeLengthStep(oldValue); + if (series.indexOf(oldValue) >= 0) { + series.remove(oldValue); + } - modelCache.removeLengthStep(oldValue); - if (series.indexOf(oldValue) >= 0) { - series.remove(oldValue); } - } + SpeciesFrequencyRowModel row = (SpeciesFrequencyRowModel) evt.getSource(); - SpeciesFrequencyRowModel row = (SpeciesFrequencyRowModel) evt.getSource(); + Float newValue = (Float) evt.getNewValue(); + if (newValue != null) { - Float newValue = (Float) evt.getNewValue(); - if (newValue != null) { + modelCache.addLengthStep(row); - modelCache.addLengthStep(row); + if (row.getNumber() != null) { - if (row.getNumber() != null) { + series.addOrUpdate(newValue, row.getNumber()); - series.addOrUpdate(newValue, row.getNumber()); + } } - } - - uiModel.recomputeCanEditLengthStep(); - uiModel.recomputeRowsValidateState(); - uiModel.updateEmptyRow(row); + uiModel.recomputeCanEditLengthStep(); + uiModel.recomputeRowsValidateState(); + uiModel.updateEmptyRow(row); - // Can recompute total number and weight only after valid flag change - uiModel.recomputeTotalNumberAndWeight(); + // Can recompute total number and weight only after valid flag change + uiModel.recomputeTotalNumberAndWeight(); - fireTableDataChanged(); + fireTableDataChanged(); + } }; } return onLengthStepChangedListener; @@ -271,38 +277,44 @@ public class SpeciesFrequencyTableModel extends AbstractApplicationTableModel<Sp private PropertyChangeListener getOnNumberChangedListener() { if (onNumberChangedListener == null) { - onNumberChangedListener = evt -> { + onNumberChangedListener = new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { - SpeciesFrequencyRowModel row = (SpeciesFrequencyRowModel) evt.getSource(); + SpeciesFrequencyRowModel row = (SpeciesFrequencyRowModel) evt.getSource(); - Integer newValue = (Integer) evt.getNewValue(); + Integer newValue = (Integer) evt.getNewValue(); - Float lengthStep = row.getLengthStep(); + Float lengthStep = row.getLengthStep(); - if (lengthStep != null) { + if (lengthStep != null) { - if (newValue == null) { + if (newValue == null) { - // remove the value for the lengthStep - if (series.indexOf(lengthStep) >= 0) { - series.remove(lengthStep); - } + // remove the value for the lengthStep + if (series.indexOf(lengthStep) >= 0) { + series.remove(lengthStep); + } - } else { + } else { - series.addOrUpdate(lengthStep, row.getNumber()); + series.addOrUpdate(lengthStep, row.getNumber()); + + } } - } + uiModel.recomputeCanEditLengthStep(); + uiModel.recomputeRowValidState(row); + uiModel.updateEmptyRow(row); - uiModel.recomputeCanEditLengthStep(); - uiModel.recomputeRowValidState(row); - uiModel.updateEmptyRow(row); + // recompute the weight with the rtp + uiModel.computeRowWeightWithRtp(row); - // Can recompute total number and weight only after valid flag change - uiModel.recomputeTotalNumberAndWeight(); + // Can recompute total number and weight only after valid flag change + uiModel.recomputeTotalNumberAndWeight(); + } }; } return onNumberChangedListener; @@ -310,17 +322,20 @@ public class SpeciesFrequencyTableModel extends AbstractApplicationTableModel<Sp private PropertyChangeListener getOnWeightChangedListener() { if (onWeightChangedListener == null) { - onWeightChangedListener = evt -> { + onWeightChangedListener = new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { - SpeciesFrequencyRowModel row = (SpeciesFrequencyRowModel) evt.getSource(); - modelCache.updateRowWithWeight(row); + SpeciesFrequencyRowModel row = (SpeciesFrequencyRowModel) evt.getSource(); + modelCache.updateRowWithWeight(row); - uiModel.recomputeRowsValidateState(); - uiModel.updateEmptyRow(row); + uiModel.recomputeRowsValidateState(); + uiModel.updateEmptyRow(row); - // Can recompute total number and weight only after valid flag change - uiModel.recomputeTotalNumberAndWeight(); + // Can recompute total number and weight only after valid flag change + uiModel.recomputeTotalNumberAndWeight(); + } }; } return onWeightChangedListener; diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUI.jcss b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUI.jcss index b7d9a39..9bb4ad2 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUI.jcss +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUI.jcss @@ -262,6 +262,7 @@ ComputableDataEditor { #useRTPCheckBox { text: "tutti.editSpeciesFrequencies.field.useRtp"; toolTipText: "tutti.editSpeciesFrequencies.field.useRtp.tip"; + enabled: { getModel().getRtp() != null }; _help: {"tutti.editSpeciesFrequencies.field.useRtp.help"}; } diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java index ed119da..cb64e63 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java @@ -24,12 +24,16 @@ package fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency; import com.google.common.collect.Lists; import com.google.common.collect.Sets; +import fr.ifremer.adagio.core.dao.referential.pmfm.QualitativeValueId; import fr.ifremer.tutti.ichtyometer.feed.event.FeedReaderEvent; import fr.ifremer.tutti.ichtyometer.feed.event.FeedReaderListener; import fr.ifremer.tutti.ichtyometer.feed.record.FeedReaderMeasureRecord; import fr.ifremer.tutti.persistence.entities.TuttiEntities; import fr.ifremer.tutti.persistence.entities.data.Attachment; import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModel; +import fr.ifremer.tutti.persistence.entities.protocol.Rtp; +import fr.ifremer.tutti.persistence.entities.protocol.SpeciesProtocol; +import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol; import fr.ifremer.tutti.persistence.entities.referential.Caracteristic; import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue; import fr.ifremer.tutti.persistence.entities.referential.Species; @@ -56,6 +60,7 @@ import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentCellRenderer; import fr.ifremer.tutti.ui.swing.util.caracteristics.CaracteristicMapCellComponent; import fr.ifremer.tutti.ui.swing.util.comment.CommentCellEditor; import fr.ifremer.tutti.ui.swing.util.comment.CommentCellRenderer; +import fr.ifremer.tutti.ui.swing.util.computable.ComputableDataTableCell; import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIHandler; import fr.ifremer.tutti.ui.swing.util.table.CaracteristicColumnIdentifier; import jaxx.runtime.swing.editor.bean.BeanFilterableComboBox; @@ -82,7 +87,9 @@ import javax.swing.JPanel; import javax.swing.JSplitPane; import javax.swing.JTextField; import javax.swing.SwingUtilities; +import javax.swing.table.TableCellRenderer; import java.awt.BorderLayout; +import java.awt.Color; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; @@ -93,6 +100,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.Set; import static org.nuiton.i18n.I18n.t; @@ -114,6 +122,8 @@ public class SpeciesFrequencyUIHandler extends AbstractTuttiTableUIHandler<Speci private JFreeChart chart; + protected Caracteristic sexCaracteristic; + /** * Weight unit. * @@ -236,7 +246,9 @@ public class SpeciesFrequencyUIHandler extends AbstractTuttiTableUIHandler<Speci public void beforeInit(SpeciesFrequencyUI ui) { super.beforeInit(ui); + this.weightUnit = getConfig().getSpeciesWeightUnit(); + sexCaracteristic = getPersistenceService().getSexCaracteristic(); SampleCategoryModel sampleCategoryModel = getDataContext().getSampleCategoryModel(); @@ -384,6 +396,11 @@ public class SpeciesFrequencyUIHandler extends AbstractTuttiTableUIHandler<Speci } }); + model.addPropertyChangeListener(SpeciesFrequencyUIModel.PROPERTY_USE_RTP, evt -> { + getModel().getRows().forEach(row -> getModel().computeRowWeightWithRtp(row)); + getTableModel().fireTableDataChanged(); + }); + // set the pattern to the weight in simple counting mode according to the weight unit ui.getSimpleCountingWeightField().setNumberPattern(weightUnit.getNumberEditorPattern()); @@ -442,6 +459,9 @@ public class SpeciesFrequencyUIHandler extends AbstractTuttiTableUIHandler<Speci public void editBatch(FrequencyCellEditor editor) { + FrequencyConfigurationMode mode = FrequencyConfigurationMode.FREQUENCIES; + FrequencyConfigurationMode frequenciesMode = FrequencyConfigurationMode.AUTO_GEN; + SpeciesBatchRowModel speciesBatch = editor.getEditRow(); SpeciesFrequencyUIModel model = getModel(); @@ -452,6 +472,7 @@ public class SpeciesFrequencyUIHandler extends AbstractTuttiTableUIHandler<Speci model.setSimpleCount(null); model.setMinStep(null); model.setMaxStep(null); + model.setRtp(null); frequencyEditor = editor; @@ -462,8 +483,46 @@ public class SpeciesFrequencyUIHandler extends AbstractTuttiTableUIHandler<Speci if (speciesBatch != null) { + Species species = speciesBatch.getSpecies(); + model.setTotalWeight(speciesBatch.getWeight()); + // set rtps + + TuttiProtocol protocol = getDataContext().getProtocol(); + if (protocol != null) { + + Integer referenceTaxonId = species.getReferenceTaxonId(); + Optional<SpeciesProtocol> optSpeciesProtocol = + protocol.getSpecies().stream() + .filter(sp -> sp.getSpeciesReferenceTaxonId().equals(referenceTaxonId)) + .findFirst(); + + if (optSpeciesProtocol.isPresent()) { + SpeciesProtocol speciesProtocol = optSpeciesProtocol.get(); + Rtp rtp; + QualitativeValueId sex = + (QualitativeValueId) speciesBatch.getSampleCategoryValue(sexCaracteristic.getIdAsInt()); + if (sex != null) { + + switch (sex) { + case SEX_MALE: + rtp = speciesProtocol.getRtpMale(); + break; + case SEX_FEMALE: + rtp = speciesProtocol.getRtpFemale(); + break; + default: + rtp = speciesProtocol.getRtpUndefined(); + } + + } else { + rtp = speciesProtocol.getRtpUndefined(); + } + model.setRtp(rtp); + } + } + List<SpeciesFrequencyRowModel> frequency = speciesBatch.getFrequency(); // try to load existing frequency @@ -520,8 +579,6 @@ public class SpeciesFrequencyUIHandler extends AbstractTuttiTableUIHandler<Speci if (lengthStepCaracteristic == null) { - Species species = speciesBatch.getSpecies(); - String lengthStepPmfmId = taxonCache.getLengthStepPmfmId(species); if (lengthStepPmfmId != null) { @@ -546,20 +603,19 @@ public class SpeciesFrequencyUIHandler extends AbstractTuttiTableUIHandler<Speci listenItchtyometer(); } + + if (lengthStepCaracteristic == null) { + String speciesLengthStepPmfmId = taxonCache.getLengthStepPmfmId(species); + if (speciesLengthStepPmfmId == null) { + mode = FrequencyConfigurationMode.SIMPLE_COUNTING; + } + } } if (log.isDebugEnabled()) { log.debug("Will edit batch row: " + speciesBatch + " with " + rows.size() + " frequency"); } - FrequencyConfigurationMode mode = FrequencyConfigurationMode.FREQUENCIES; - FrequencyConfigurationMode frequenciesMode = FrequencyConfigurationMode.AUTO_GEN; - if (lengthStepCaracteristic == null) { - String speciesLengthStepPmfmId = taxonCache.getLengthStepPmfmId(speciesBatch.getSpecies()); - if (speciesLengthStepPmfmId == null) { - mode = FrequencyConfigurationMode.SIMPLE_COUNTING; - } - } Integer number = speciesBatch.getNumber(); if (number != null && rows.isEmpty()) { mode = FrequencyConfigurationMode.SIMPLE_COUNTING; @@ -616,10 +672,17 @@ public class SpeciesFrequencyUIHandler extends AbstractTuttiTableUIHandler<Speci { // Weight - addFloatColumnToModel(columnModel, - SpeciesFrequencyTableModel.WEIGHT, - weightUnit, - table); + Color computedDataColor = getConfig().getColorComputedWeights(); + // create table column model + TableCellRenderer defaultRenderer = table.getDefaultRenderer(Object.class); + + addColumnToModel(columnModel, + ComputableDataTableCell.newEditor( + Float.class, weightUnit, computedDataColor), + ComputableDataTableCell.newRender( + defaultRenderer, weightUnit, computedDataColor), + SpeciesFrequencyTableModel.WEIGHT, + weightUnit); } // create table model diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIModel.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIModel.java index f2f67cf..ba13e6c 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIModel.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIModel.java @@ -25,6 +25,7 @@ package fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency; import com.google.common.collect.Lists; import com.google.common.collect.Sets; import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModel; +import fr.ifremer.tutti.persistence.entities.protocol.Rtp; import fr.ifremer.tutti.persistence.entities.referential.Caracteristic; import fr.ifremer.tutti.type.WeightUnit; import fr.ifremer.tutti.ui.swing.content.operation.catches.FrequencyConfigurationMode; @@ -92,6 +93,8 @@ public class SpeciesFrequencyUIModel extends AbstractTuttiTableUIModel<SpeciesBa public static final String PROPERTY_USE_RTP = "useRTP"; + public static final String PROPERTY_RTP = "rtp"; + public static final String PROPERTY_EMPTY_ROWS = "emptyRows"; public static final String PROPERTY_NEXT_EDITABLE_ROW_INDEX = "nextEditableRowIndex"; @@ -164,6 +167,13 @@ public class SpeciesFrequencyUIModel extends AbstractTuttiTableUIModel<SpeciesBa protected ComputableData<Float> totalComputedOrNotWeight = new ComputableData<>(); /** + * Rtp of the species batch + * + * @since 4.5 + */ + protected Rtp rtp; + + /** * Use the RTPs of the protocol to compute the total weight * * @since 4.5 @@ -513,6 +523,16 @@ public class SpeciesFrequencyUIModel extends AbstractTuttiTableUIModel<SpeciesBa && Weights.isEqualWeight(totalWeight, computedWeight); } + public Rtp getRtp() { + return rtp; + } + + public void setRtp(Rtp rtp) { + Object oldValue = getRtp(); + this.rtp = rtp; + firePropertyChange(PROPERTY_RTP, oldValue, rtp); + } + public boolean isUseRTP() { return useRTP; } @@ -650,6 +670,32 @@ public class SpeciesFrequencyUIModel extends AbstractTuttiTableUIModel<SpeciesBa } + public void computeRowWeightWithRtp(SpeciesFrequencyRowModel row) { + + Integer number = row.getNumber(); + if (number != null && isUseRTP()) { + + //Formule Poids (gramme) = a Taille (cm) ^ b + Rtp rtp = getRtp(); + + Float lengthStep = row.getLengthStep(); + if ("cm".equals(getLengthStepCaracteristicUnit())) { + // measurement in cm asked + lengthStep = lengthStep / 10; + } + + float weight = (float)(number * rtp.getA() * Math.pow(lengthStep, rtp.getB())); + if (weightUnit == WeightUnit.KG) { + weight = weight / 1000; + } + row.setComputedWeight(weight); + + } else { + row.setComputedWeight(null); + } + + } + public int numberOfRows(float lengthStep) { return cache.numberOfRows(lengthStep); } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.