Skip to content
Snippets Groups Projects
Commit a2719342 authored by Céline  TREBEAU's avatar Céline TREBEAU
Browse files

code cleanup

parent 9d7da8d7
No related branches found
No related tags found
2 merge requests!47Feature : Multi-channel and Binning,!41Resolve "Consider rescaling (binning) large images"
...@@ -31,12 +31,6 @@ package fr.pasteur.ida.zellige.gui.model; ...@@ -31,12 +31,6 @@ package fr.pasteur.ida.zellige.gui.model;
import fr.pasteur.ida.zellige.element.ReferenceSurface; import fr.pasteur.ida.zellige.element.ReferenceSurface;
import fr.pasteur.ida.zellige.element.Surface; import fr.pasteur.ida.zellige.element.Surface;
import fr.pasteur.ida.zellige.gui.ZDoubleProperty; import fr.pasteur.ida.zellige.gui.ZDoubleProperty;
import fr.pasteur.ida.zellige.gui.controller.MainController;
import fr.pasteur.ida.zellige.gui.task.AbstractTask;
import fr.pasteur.ida.zellige.gui.task.RunFirstConstructionTask;
import fr.pasteur.ida.zellige.gui.task.RunSecondConstructionTask;
import fr.pasteur.ida.zellige.steps.construction.exception.FirstRoundConstructionException;
import fr.pasteur.ida.zellige.steps.construction.exception.SecondRoundConstructionException;
import javafx.beans.property.IntegerProperty; import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleIntegerProperty; import javafx.beans.property.SimpleIntegerProperty;
...@@ -53,8 +47,6 @@ import org.slf4j.LoggerFactory; ...@@ -53,8 +47,6 @@ import org.slf4j.LoggerFactory;
import java.util.ArrayList; import java.util.ArrayList;
import static fr.pasteur.ida.zellige.gui.MainAppFrame.GUI_MARKER;
public class ConstructionModel< T extends RealType< T > & NativeType< T > > public class ConstructionModel< T extends RealType< T > & NativeType< T > >
{ {
...@@ -91,54 +83,6 @@ public class ConstructionModel< T extends RealType< T > & NativeType< T > > ...@@ -91,54 +83,6 @@ public class ConstructionModel< T extends RealType< T > & NativeType< T > >
surfaceSize = new ZDoubleProperty(); surfaceSize = new ZDoubleProperty();
} }
public void firstRound()
{
LOGGER.info(GUI_MARKER, "Computing first round construction..." );
AbstractTask< ArrayList< Surface > > firstRoundTask = new RunFirstConstructionTask( maximums.getValue(), st1.doubleValue(), r1.intValue(), c1.doubleValue(), surfaceSize.doubleValue() / 100.0 );
firstRoundTask.setOnSucceeded( workerStateEvent ->
{
firstRoundSurfaces.setValue( firstRoundTask.getValue() );
if ( firstRoundTask.getValue() == null )
{
LOGGER.info( "" ); //TODO write right message
MainController.showError( new FirstRoundConstructionException() );
}
} );
LOGGER.info( GUI_MARKER,"First round construction done." );
firstRoundTask.start();
}
public void secondRound()
{
LOGGER.info( GUI_MARKER,"Computing second round construction..." );
AbstractTask< ArrayList< Surface > > secondRoundTask = new RunSecondConstructionTask( firstRoundSurfacesProperty().getValue(), st2.getValue(), r2.intValue(), c2.doubleValue(), surfaceSize.doubleValue() / 100.0 );
secondRoundTask.setOnSucceeded( workerStateEvent ->
{
secondRoundSurfacesProperty().setValue( secondRoundTask.getValue() );
if ( secondRoundTask.getValue() == null )
{
LOGGER.info( "" ); //TODO write right message
MainController.showError( new SecondRoundConstructionException() );
}
} );
LOGGER.info( GUI_MARKER,"Second round construction done." );
secondRoundTask.start();
}
public void runConstruction()
{
LOGGER.debug( "Run construction" );
if ( firstRoundSurfacesProperty().getValue() == null )
{
firstRound();
}
else if ( secondRoundSurfaces.getValue() == null )
{
secondRound();
}
}
public IntegerProperty getBin() public IntegerProperty getBin()
{ {
...@@ -229,4 +173,9 @@ public class ConstructionModel< T extends RealType< T > & NativeType< T > > ...@@ -229,4 +173,9 @@ public class ConstructionModel< T extends RealType< T > & NativeType< T > >
{ {
return disableGUI; return disableGUI;
} }
public int getSurfaceMax()
{
return ( int ) (input.get().dimension( 0 )* input.get().dimension( 1 )/ (bin.get() * bin.get()));
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment