|
From: <bma...@us...> - 2016-12-19 10:11:52
|
Revision: 9486
http://sourceforge.net/p/fudaa/svn/9486
Author: bmarchan
Date: 2016-12-19 10:11:49 +0000 (Mon, 19 Dec 2016)
Log Message:
-----------
Lecture et affichage du champ "D?\195?\169bit mesur?\195?\169" dans les r?\195?\169sultats du calcul de d?\195?\169bit
Modified Paths:
--------------
trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/PivFlowInfoPanel.java
trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/action/PivExportGaugingReportAction.java
trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/io/PivDischargeReader.java
trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/layer/PivTransectModel.java
trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/metier/PivFlowResults.java
trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/metier/PivResultsI.java
Modified: trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/PivFlowInfoPanel.java
===================================================================
--- trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/PivFlowInfoPanel.java 2016-12-16 16:04:05 UTC (rev 9485)
+++ trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/PivFlowInfoPanel.java 2016-12-19 10:11:49 UTC (rev 9486)
@@ -37,6 +37,7 @@
private double meanDisch_;
private double meanArea_;
private double meanMeanV_;
+ private double meanMeasuredDisch_;
/**
* Une classe pour le modele de la table affichant les r\xE9sultats.
@@ -48,7 +49,7 @@
}
public int getColumnCount() {
- return 7;
+ return 9;
}
public String getColumnName(int columnIndex) {
@@ -68,6 +69,10 @@
return PivResource.getS("Vit. moy. (m/s)");
case 6:
return PivResource.getS("Ecart (%)");
+ case 7:
+ return PivResource.getS("D\xE9bit mesur\xE9 (m/s)");
+ case 8:
+ return PivResource.getS("Ecart (%)");
}
}
@@ -101,6 +106,11 @@
case 6:
val=rowIndex==res_.length? meanMeanV_:res_[rowIndex].getMeanVelocity();
return (val-meanMeanV_)/meanMeanV_*100;
+ case 7:
+ return rowIndex==res_.length? meanMeasuredDisch_:res_[rowIndex].getValue(-1,ResultType.MEASURED_DISCHARGE);
+ case 8:
+ val=rowIndex==res_.length? meanMeasuredDisch_:res_[rowIndex].getValue(-1,ResultType.MEASURED_DISCHARGE);
+ return (val-meanMeasuredDisch_)/meanMeasuredDisch_*100;
}
}
@@ -129,7 +139,10 @@
super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
if (value instanceof Double) {
- if (column==2 || column==4 || column==6)
+ if (((Double) value).isNaN()) {
+ this.setText(value.toString());
+ }
+ else if (column==2 || column==4 || column==6 || column==8)
this.setText(fmtEcart.format((Double)value));
else
this.setText(fmt.format((Double)value));
@@ -147,9 +160,14 @@
JTable tbResults=new JTable();
tbResults.setModel(new DischargeTableModel());
tbResults.setDefaultRenderer(Double.class,new DischargeCellRenderer());
+ tbResults.getColumnModel().getColumn(0).setMaxWidth(60);
+ tbResults.getColumnModel().getColumn(2).setMaxWidth(70);
+ tbResults.getColumnModel().getColumn(4).setMaxWidth(70);
+ tbResults.getColumnModel().getColumn(6).setMaxWidth(70);
+ tbResults.getColumnModel().getColumn(8).setMaxWidth(70);
JScrollPane spResults=new JScrollPane();
spResults.getViewport().add(tbResults);
- spResults.setPreferredSize(new Dimension(700,200));
+ spResults.setPreferredSize(new Dimension(850,200));
add(new JLabel(PivResource.getS("Liste des transects")),BorderLayout.NORTH);
add(spResults, BorderLayout.CENTER);
@@ -159,9 +177,10 @@
protected void computeMoyennes() {
PivGlobalFlowResults globRes=new PivGlobalFlowResults(res_);
- meanDisch_=globRes.getAverageScalarResult(ResultType.DISCHARGE);
+ meanDisch_=globRes.getAverageScalarResult(ResultType.FULL_DISCHARGE);
meanArea_=globRes.getAverageScalarResult(ResultType.WETTED_AREA);
meanMeanV_=globRes.getAverageScalarResult(ResultType.MEAN_VELOCITY);
+ meanMeasuredDisch_=globRes.getAverageScalarResult(ResultType.MEASURED_DISCHARGE);
}
@Override
Modified: trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/action/PivExportGaugingReportAction.java
===================================================================
--- trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/action/PivExportGaugingReportAction.java 2016-12-16 16:04:05 UTC (rev 9485)
+++ trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/action/PivExportGaugingReportAction.java 2016-12-19 10:11:49 UTC (rev 9486)
@@ -345,7 +345,7 @@
final PivOrthoParameters orthoParams = impl.getCurrentProject().getOrthoParameters();
final PivGlobalFlowResults globRes = new PivGlobalFlowResults(flowResults);
- final Double meanDisch=globRes.getAverageScalarResult(ResultType.DISCHARGE);
+ final Double meanDisch=globRes.getAverageScalarResult(ResultType.FULL_DISCHARGE);
final Double meanArea=globRes.getAverageScalarResult(ResultType.WETTED_AREA);
final Double meanMeanV=globRes.getAverageScalarResult(ResultType.MEAN_VELOCITY);
Modified: trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/io/PivDischargeReader.java
===================================================================
--- trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/io/PivDischargeReader.java 2016-12-16 16:04:05 UTC (rev 9485)
+++ trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/io/PivDischargeReader.java 2016-12-19 10:11:49 UTC (rev 9486)
@@ -17,6 +17,7 @@
import org.fudaa.dodico.fortran.FileCharSimpleReaderAbstract;
import org.fudaa.fudaa.piv.PivResource;
import org.fudaa.fudaa.piv.metier.PivFlowResults;
+import org.fudaa.fudaa.piv.metier.PivResultsI.ResultType;
/**
* Un lecteur pour les fichiers des r\xE9sultats de calcul de d\xE9bit.
@@ -80,6 +81,7 @@
// 1ere ligne
in_.readFields();
+ // Le niveau d'eau
res.setWaterElevation(in_.doubleField(0));
// Debit
res.setDischarge(in_.doubleField(1));
@@ -87,6 +89,10 @@
res.setWettedArea(in_.doubleField(2));
// Vitesse moyenne
res.setMeanVelocity(in_.doubleField(3));
+ // D\xE9bit mesur\xE9 (Fudaa-LSPIV > 1.5.0)
+ if (in_.getNumberOfFields()>4) {
+ res.setValue(0, ResultType.MEASURED_DISCHARGE, in_.doubleField(4));
+ }
// Boucle jusque fin de fichier. Exception EOF si fin.
while (true) {
Modified: trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/layer/PivTransectModel.java
===================================================================
--- trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/layer/PivTransectModel.java 2016-12-16 16:04:05 UTC (rev 9485)
+++ trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/layer/PivTransectModel.java 2016-12-19 10:11:49 UTC (rev 9486)
@@ -19,6 +19,7 @@
import org.fudaa.fudaa.piv.PivVisuPanel;
import org.fudaa.fudaa.piv.metier.PivFlowResults;
import org.fudaa.fudaa.piv.metier.PivProject;
+import org.fudaa.fudaa.piv.metier.PivResultsI.ResultType;
import org.fudaa.fudaa.piv.metier.PivTransect;
import org.fudaa.fudaa.piv.metier.PivTransectParams;
@@ -252,6 +253,7 @@
Double discharge=res.getDischarge();
Double wettedArea=res.getWettedArea();
Double meanVelocity=res.getMeanVelocity();
+ Double measuredDischarge=res.getValue(-1,ResultType.MEASURED_DISCHARGE);
for (int idx : selIds) {
res=prj_.getFlowResults()[idx];
@@ -263,6 +265,8 @@
wettedArea=null;
if (meanVelocity != res.getMeanVelocity())
meanVelocity=null;
+ if (measuredDischarge != res.getValue(-1,ResultType.MEASURED_DISCHARGE))
+ measuredDischarge=null;
}
if (waterElevation != null)
@@ -273,6 +277,8 @@
_d.put(PivResource.getS("Aire mouill\xE9e (m\xB2)"), "" + wettedArea);
if (meanVelocity != null)
_d.put(PivResource.getS("Vitesse moyenne sur la section (m/s)"), "" + meanVelocity);
+ if (measuredDischarge != null)
+ _d.put(PivResource.getS("D\xE9bit mesur\xE9 (m\xB3/s)"), "" + measuredDischarge);
}
}
Modified: trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/metier/PivFlowResults.java
===================================================================
--- trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/metier/PivFlowResults.java 2016-12-16 16:04:05 UTC (rev 9485)
+++ trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/metier/PivFlowResults.java 2016-12-19 10:11:49 UTC (rev 9486)
@@ -19,6 +19,8 @@
protected double meanVelocity;
/** Le niveau d'eau */
protected double waterElevation;
+ /** Le d\xE9bit mesur\xE9. Peut \xEAtre NaN si la mesure n'est pas calcul\xE9e (Fudaa-LSPIV < 1.5.0). */
+ protected double measuredDischarge = Double.NaN;
/** Les coordonn\xE9es X des points */
protected double[] x;
/** Les coordonn\xE9es Y des points */
@@ -162,7 +164,7 @@
@Override
public ResultType[] getResults() {
- return new ResultType[]{ResultType.VX,ResultType.VY,ResultType.DISCHARGE, ResultType.WETTED_AREA, ResultType.MEAN_VELOCITY, ResultType.WATER_ELEVATION};
+ return new ResultType[]{ResultType.VX,ResultType.VY,ResultType.FULL_DISCHARGE, ResultType.WETTED_AREA, ResultType.MEAN_VELOCITY, ResultType.WATER_ELEVATION, ResultType.MEASURED_DISCHARGE};
}
@Override
@@ -176,7 +178,7 @@
return getVx(_ind);
else if (ResultType.VY.equals(_tpRes))
return getVy(_ind);
- else if (ResultType.DISCHARGE.equals(_tpRes))
+ else if (ResultType.FULL_DISCHARGE.equals(_tpRes))
return discharge;
else if (ResultType.WETTED_AREA.equals(_tpRes))
return wettedArea;
@@ -184,6 +186,8 @@
return meanVelocity;
else if (ResultType.WATER_ELEVATION.equals(_tpRes))
return waterElevation;
+ else if (ResultType.MEASURED_DISCHARGE.equals(_tpRes))
+ return measuredDischarge;
else
return -1;
}
@@ -194,7 +198,7 @@
return vy;
else if (ResultType.VY.equals(_tpRes))
return vy;
- else if (ResultType.DISCHARGE.equals(_tpRes))
+ else if (ResultType.FULL_DISCHARGE.equals(_tpRes))
return new double[]{discharge};
else if (ResultType.WETTED_AREA.equals(_tpRes))
return new double[]{wettedArea};
@@ -202,6 +206,8 @@
return new double[]{meanVelocity};
else if (ResultType.WATER_ELEVATION.equals(_tpRes))
return new double[]{waterElevation};
+ else if (ResultType.MEASURED_DISCHARGE.equals(_tpRes))
+ return new double[]{measuredDischarge};
else
return null;
}
@@ -211,14 +217,14 @@
if (!hasResult(_tpRes))
return;
- if (_ind>=vx.length)
+ if (_tpRes.isVector() && _ind>=vx.length)
return;
if (ResultType.VX.equals(_tpRes))
vx[_ind] = _val;
else if (ResultType.VY.equals(_tpRes))
vy[_ind] = _val;
- else if (ResultType.DISCHARGE.equals(_tpRes))
+ else if (ResultType.FULL_DISCHARGE.equals(_tpRes))
discharge = _val;
else if (ResultType.WETTED_AREA.equals(_tpRes))
wettedArea = _val;
@@ -226,5 +232,7 @@
meanVelocity = _val;
else if (ResultType.WATER_ELEVATION.equals(_tpRes))
waterElevation = _val;
+ else if (ResultType.MEASURED_DISCHARGE.equals(_tpRes))
+ measuredDischarge = _val;
}
}
Modified: trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/metier/PivResultsI.java
===================================================================
--- trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/metier/PivResultsI.java 2016-12-16 16:04:05 UTC (rev 9485)
+++ trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/metier/PivResultsI.java 2016-12-19 10:11:49 UTC (rev 9486)
@@ -22,7 +22,10 @@
CORREL(true),
OMEGA(true),
DIVERG(true),
- DISCHARGE(false),
+ /** D\xE9bit total */
+ FULL_DISCHARGE(false),
+ /** D\xE9bit mesur\xE9 */
+ MEASURED_DISCHARGE(false),
WETTED_AREA(false),
MEAN_VELOCITY(false),
WATER_ELEVATION(false);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|