Commit 75394fbf authored by balanche's avatar balanche

Progress bars de classification terminées

parent 11c0fc90
......@@ -68,6 +68,7 @@ public class ClassificationImage extends ClassificationModel {
@Override
public void doOperationAfterClassification(Classification result) {
//setprogress final ?
if (!result.isHybrid() && !(result instanceof ClassificationSAM4)) {
if (result.getTimeExec() != 0)
result.setTimeExec(ManagementFactory.getThreadMXBean()
......
......@@ -86,14 +86,13 @@ public class ClassificationThread extends Thread {
@Override
public void run() {
/* Si on a une barre de progression on monitore la classification */
if (this.progressBar_ != null && this.statusBar_ != null) {
LearningMethod lm = this.classification_.getLearningMethod();
new ProgressThreadJCL(lm, this.progressBar_,this.statusBar_).start();
if (this.progressBar_ != null && this.statusBar_ != null) {
// LearningMethod lm = this.classification_.getLearningMethod();
// new ProgressThreadJCL(lm, this.progressBar_,this.statusBar_).start();
// lm.incProgress();
// lm.setStatus("Clustering test !");
}
new ProgressThreadJCL(this.classification_, this.progressBar_,this.statusBar_).start();
}
/* teste si le calcul est a faire avec rmi */
if ((this.rmiServer_ != null) && (this.rmiServer_.useRmi())) {
......@@ -133,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_);
.doOperationAfterClassification(this.classification_);//prends aussi du temps ?!!!
}
}
......
......@@ -311,7 +311,6 @@ public class GDALImageReaderWrapper extends ReaderWrapper {
if (dataSet == null) {
throw new Exception("GDAL : Error when opening the file");
} else {
MainFrame.getProgressStatus().setMessage("Loading file ...");
// if the overview list has not the same length OR
// the factor is the different (just tested for the first band)
if ((dataSet.GetRasterBand(1).GetOverviewCount() != overViewIDList.length) ||
......
......@@ -206,7 +206,7 @@ public class ImageSampler extends Sampler {
if (mandatoriesIndexes != null && mandatoriesIndexes.length > sizeByCount) {
throw new IndexOutOfBoundsException("The number of mandatory pixels"
+ " is bigger than the expeted sample size");
+ " is bigger than the expected sample size");
}
updateRAMAvailable(false);
if (getReaders().size() > 1) {
......@@ -249,12 +249,12 @@ public class ImageSampler extends Sampler {
}
/**
* Return the sampling from a single image
* Return the sampling from a single image and monitor the progress bar and status accordingly
*
* @return the sample
*/
private List<DataObject> getDataFromOneImage() {
//System.out.println("getDataFromOneImage()");
setStatus("Loading sampler...");
setStatus("Sampling ...");
List<DataObject> result = new ArrayList<DataObject>(sizeByCount);
int index = 0;
int x = 0;
......@@ -298,10 +298,7 @@ public class ImageSampler extends Sampler {
if(i == jalon)
{
jalon+=sizeByCount/100;
//System.out.println("jalon:"+jalon);
incProgress();
System.out.print(" p:"+this.progress);
}
}
endProgress();
......
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