Author: kmorin Date: 2013-04-30 10:56:13 +0200 (Tue, 30 Apr 2013) New Revision: 892 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/892 Log: fixes #2384 [CAPTURE] - Observations individuelles - Les poids des lots sont saisis en grammes mais pas convertis en kg pour la sauvegarde Removed: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/plankton/ Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchRowModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIHandler.java Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx 2013-04-29 18:21:08 UTC (rev 891) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx 2013-04-30 08:56:13 UTC (rev 892) @@ -371,32 +371,6 @@ </JXTitledPanel> </JPanel> </tab> - - <tab id='planktonTab' title='tutti.label.tab.plancton'> - <!--JXTitledPanel id='planktonTabFishingOperationReminderLabel'> - <PlanktonBatchUI id='planktonTabContent' constructorParams='this'/> - </JXTitledPanel--> - </tab> - - <tab id='accidentalTab'> - <JPanel id='accidentalTabPanel'> - <JXTitledPanel id='accidentalTabFishingOperationReminderLabel' - constraints='EditCatchesUIHandler.MAIN_CARD'> - <AccidentalBatchUI id='accidentalTabContent' - constructorParams='this'/> - </JXTitledPanel> - <JXTitledPanel id='accidentalTabCreateBatchReminderLabel' - constraints='EditCatchesUIHandler.CREATE_BATCH_CARD'> - <CreateAccidentalBatchUI id='accidentalTabCreateBatch' - constructorParams='this'/> - </JXTitledPanel> - <JXTitledPanel id='accidentalCaracteristicMapEditorReminderLabel' - constraints='EditCatchesUIHandler.EDIT_CARACTERISTICS_CARD'> - <CaracteristicMapEditorUI id='accidentalCaracteristicMapEditor' - constructorParams='accidentalTabContent'/> - </JXTitledPanel> - </JPanel> - </tab> <tab id='individualObservationTab'> <JPanel id='individualObservationTabPanel'> <JXTitledPanel @@ -420,6 +394,25 @@ </JXTitledPanel> </JPanel> </tab> + <tab id='accidentalTab'> + <JPanel id='accidentalTabPanel'> + <JXTitledPanel id='accidentalTabFishingOperationReminderLabel' + constraints='EditCatchesUIHandler.MAIN_CARD'> + <AccidentalBatchUI id='accidentalTabContent' + constructorParams='this'/> + </JXTitledPanel> + <JXTitledPanel id='accidentalTabCreateBatchReminderLabel' + constraints='EditCatchesUIHandler.CREATE_BATCH_CARD'> + <CreateAccidentalBatchUI id='accidentalTabCreateBatch' + constructorParams='this'/> + </JXTitledPanel> + <JXTitledPanel id='accidentalCaracteristicMapEditorReminderLabel' + constraints='EditCatchesUIHandler.EDIT_CARACTERISTICS_CARD'> + <CaracteristicMapEditorUI id='accidentalCaracteristicMapEditor' + constructorParams='accidentalTabContent'/> + </JXTitledPanel> + </JPanel> + </tab> </JTabbedPane> <!-- Actions --> Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchRowModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchRowModel.java 2013-04-29 18:21:08 UTC (rev 891) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchRowModel.java 2013-04-30 08:56:13 UTC (rev 892) @@ -79,6 +79,10 @@ public IndividualObservationBatchRowModel(IndividualObservationBatch aBatch) { this(); fromBean(aBatch); + Float weightInG = getWeight(); + if (weightInG != null) { + setWeight(weightInG * 1000.0f); + } } @Override Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIHandler.java 2013-04-29 18:21:08 UTC (rev 891) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIHandler.java 2013-04-30 08:56:13 UTC (rev 892) @@ -480,6 +480,13 @@ FishingOperation fishingOperation = getModel().getFishingOperation(); catchBean.setFishingOperation(fishingOperation); + + // convert grams into kilograms + Float weightInG = catchBean.getWeight(); + if (weightInG != null) { + catchBean.setWeight(weightInG / 1000.0f); + } + if (log.isInfoEnabled()) { log.info("Selected fishingOperation: " + fishingOperation.getId()); }