Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

Commit 41cccadf authored by balanche's avatar balanche
Browse files

Correction d'un bug sur la progress bar Sampling et d'un autre bug sur la progress bar Displaying

parent 1ebd5b90
package mustic.gui;
import java.lang.management.ManagementFactory;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import javax.swing.ImageIcon;
import javax.swing.WindowConstants;
......@@ -57,19 +60,17 @@ public class ClassificationImage extends ClassificationModel {
}
rpanel.setName(title);
resultPanels.add(rpanel);
Tab t1 = ClassificationModel.createTab(title, new ImageIcon(getClass()
.getResource("/icons/actions/document-open-result.png")), //$NON-NLS-1$
rpanel, true);
pane.addTab(t1);
t1.setSelected(true);
}
@Override
public void doOperationAfterClassification(Classification result) {
/* Monitoring the operation */
result.setStatus("Step "+ (result.getProgressableList().size()+1) + "/" + (result.getProgressableList().size()+1) + " : Displaying result");
// Monitoring the operation status
result.setStatus("Step "+ (result.getProgressableList().size()+1) + "/" + (result.getProgressableList().size()+1) + " : Displaying");
if (!result.isHybrid() && !(result instanceof ClassificationSAM4)) {
if (result.getTimeExec() != 0)
result.setTimeExec(ManagementFactory.getThreadMXBean()
......@@ -97,6 +98,7 @@ public class ClassificationImage extends ClassificationModel {
irp.historique.addInfosln(Messages.getString("ClassificationImage.6") //$NON-NLS-1$
+ (exec / 1.0E9) + "s"); //$NON-NLS-1$
}
}
}
......
......@@ -4,6 +4,8 @@ import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Observable;
import java.util.Observer;
import java.util.Vector;
......@@ -200,10 +202,9 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
MainFrame.getInstance().getCurrentDataSession().addResultPanel(this);
this.result = classification.getClusteringResult();
this.clusterMap = new MultiResolutionClusterMap(this, imgData.getWidth(),
imgData.getHeight(), result.getClusterMap(false), this.result.getClusters());//!!
imgData.getHeight(), result.getClusterMap(false), this.result.getClusters());
this.classPanel.addTreeSelectionListener(this);
if (imgData.getRawImages() != null && imgData.getRawImages().size() > 0) {
this.viewer = new ClusteringImageViewer(new GDALPyramidImageViewer(
imgData.getRawImages().get(0), true), this.clusterMap);
......
......@@ -238,13 +238,10 @@ public class ImageData extends SimpleData implements Serializable {
* a mask to apply to the sampler
*/
public ImageData(Sampler sampler, RawImage path, Mask mask) {
System.out.println("ImageData(Sampler sampler, RawImage path, Mask mask)");
if (MainFrame.DEBUG_MODE) {
System.out.println(">> ImageData(Sampler,String) <<");
}
MainFrame.getProgressStatus().setMessage("loading sampler...");
this.rawImages.add(path);
long startTime = System.currentTimeMillis();
......
......@@ -132,7 +132,7 @@ public class ClassificationThread extends Thread {
/* Si on a un container on affiche le resultat */
if (this.container_ != null) {
this.container_
.doOperationAfterClassification(this.classification_);//prends aussi du temps ?!!!
.doOperationAfterClassification(this.classification_);
}
}
......
......@@ -41,13 +41,13 @@ public class MultiResolutionClusterMap {
private void generateMaps(int[] map) {
int[][] newMap = new int[width][height];
double pas = 100./(height*width);
double progress = imageResultPanel.getClassification().getProgress()+pas;
// double step = 100./(height*width);
// double progress = imageResultPanel.getClassification().getProgress()+step;
for(int j = 0 ; j < height ; j++) {
for(int i = 0 ; i < width ; i++) {
newMap[i][j] = map[i + j*width];
progress+=pas;
imageResultPanel.getClassification().setProgress((int)progress);
// progress+=step;
// imageResultPanel.getClassification().setProgress((int)progress);
}
}
this.maps.add(newMap);
......
......@@ -64,7 +64,7 @@ public class ImageSampler extends Sampler {
private double progressM = 100;
private String status = null;
private String status = "Sampling";
/**
* Constructor from a sequence of images
......
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