15
15
*/
16
16
package org .cirdles .squid .core ;
17
17
18
+ import org .cirdles .squid .Squid ;
18
19
import org .cirdles .squid .parameters .parameterModels .ParametersModel ;
19
- import org .cirdles .squid .parameters .util .DateHelper ;
20
20
import org .cirdles .squid .projects .SquidProject ;
21
21
import org .cirdles .squid .shrimp .ShrimpFraction ;
22
22
import org .cirdles .squid .shrimp .ShrimpFractionExpressionInterface ;
41
41
import static java .nio .charset .StandardCharsets .UTF_8 ;
42
42
import static java .nio .file .StandardOpenOption .APPEND ;
43
43
import static java .util .Arrays .asList ;
44
- import org .cirdles .squid .Squid ;
45
44
import static org .cirdles .squid .constants .Squid3Constants .DEFAULT_PRAWNFILE_NAME ;
46
45
import static org .cirdles .squid .squidReports .squidWeightedMeanReports .SquidWeightedMeanReportEngine .makeWeightedMeanReportHeaderAsCSV ;
47
46
import static org .cirdles .squid .utilities .conversionUtilities .RoundingUtilities .squid3RoundedToSize ;
@@ -131,7 +130,7 @@ public void clearReports() {
131
130
/**
132
131
* ReportsEngine to test results
133
132
*
134
- * @param shrimpFractions the value of shrimpFractions
133
+ * @param shrimpFractions the value of shrimpFractions
135
134
* @param doWriteReportFiles
136
135
* @param summaryOnly
137
136
* @throws java.io.IOException
@@ -145,9 +144,9 @@ public void produceReports(List<ShrimpFractionExpressionInterface> shrimpFractio
145
144
}
146
145
}
147
146
148
- public String makeReportFolderStructure () throws IOException {
147
+ public String makeReportFolderStructure () throws IOException {
149
148
return folderToWriteCalamariReports .getCanonicalPath ()
150
- + File .separator + "Squid3ProjectReports-"
149
+ + File .separator + "Squid3ProjectReports-"
151
150
+ squidProject .getProjectName ().replaceAll ("\\ s" , "_" )
152
151
+ File .separator ;
153
152
}
@@ -969,29 +968,27 @@ public String produceCalamariReportByFlavor(CalamariReportFlavors flavor) {
969
968
break ;
970
969
971
970
default :
972
- // throw exception
971
+ // throw exception
973
972
}
974
973
975
974
return report .toString ();
976
975
}
977
976
978
977
public File writeReportTableFiles (String [][] report , String baseReportTableName ) throws IOException {
979
- String reportsPath
980
- = makeReportFolderStructure ();
978
+ String reportsPath = makeReportFolderStructure ();
981
979
File reportsFolder = new File (reportsPath );
982
980
if (!reportsFolder .mkdirs ()) {
983
981
//throw new IOException("Failed to delete reports folder '" + reportsPath + "'");
984
982
}
985
983
986
984
File reportTableFile = new File (reportsPath + baseReportTableName );
987
- ReportSerializerToCSV .writeCSVReport (false , reportTableFile , report );
985
+ ReportSerializerToCSV .writeCSVReport (false , reportTableFile , report , true );
988
986
989
987
return reportTableFile ;
990
988
}
991
989
992
990
public File writeReportTableFilesPerSquid3 (String [][] report , String baseReportTableName ) throws IOException {
993
- String reportsPath
994
- = makeReportFolderStructure ();
991
+ String reportsPath = makeReportFolderStructure ();
995
992
File reportsFolder = new File (reportsPath );
996
993
if (!reportsFolder .mkdirs ()) {
997
994
//throw new IOException("Failed to delete reports folder '" + reportsPath + "'");
@@ -1004,14 +1001,13 @@ public File writeReportTableFilesPerSquid3(String[][] report, String baseReportT
1004
1001
}
1005
1002
1006
1003
/**
1007
- *
1008
1004
* @throws IOException
1009
1005
*/
1010
1006
public File writeSummaryReportsForUnknowns () throws IOException {
1011
1007
File reportFile = getFileForSummaryCalc (
1012
1008
squidProject .getProjectName ()
1013
- + "_UnknownsSummaryReport"
1014
- + ".csv" );
1009
+ + "_UnknownsSummaryReport"
1010
+ + ".csv" );
1015
1011
PrintWriter writer = new PrintWriter (reportFile , "UTF-8" );
1016
1012
List <Expression > unknownExpressions = new ArrayList <>();
1017
1013
for (Expression exp : squidProject .getTask ().getTaskExpressionsOrdered ()) {
@@ -1028,15 +1024,14 @@ public File writeSummaryReportsForUnknowns() throws IOException {
1028
1024
}
1029
1025
1030
1026
/**
1031
- *
1032
- * @throws IOException
1033
1027
* @return the java.io.File
1028
+ * @throws IOException
1034
1029
*/
1035
1030
public File writeSummaryReportsForReferenceMaterials () throws IOException {
1036
1031
File reportFile = getFileForSummaryCalc (
1037
1032
squidProject .getProjectName ()
1038
- + "_RefMatSummaryReport"
1039
- + ".csv" );
1033
+ + "_RefMatSummaryReport"
1034
+ + ".csv" );
1040
1035
PrintWriter writer = new PrintWriter (reportFile , "UTF-8" );
1041
1036
List <Expression > refMatExpressions = new ArrayList <>();
1042
1037
for (Expression exp : squidProject .getTask ().getTaskExpressionsOrdered ()) {
@@ -1077,9 +1072,9 @@ public File writeSummaryReportsForReferenceMaterials() throws IOException {
1077
1072
writer .println ("name, value, one sigma ABS, one sigma PCT" );
1078
1073
Arrays .asList (val .getValues ()).forEach (valueModel -> writer .println (
1079
1074
valueModel .getName () + ","
1080
- + valueModel .getValue () + ", "
1081
- + valueModel .getOneSigmaABS ().doubleValue () + ", "
1082
- + valueModel .getOneSigmaPCT ().doubleValue ()));
1075
+ + valueModel .getValue () + ", "
1076
+ + valueModel .getOneSigmaABS ().doubleValue () + ", "
1077
+ + valueModel .getOneSigmaPCT ().doubleValue ()));
1083
1078
});
1084
1079
1085
1080
writer .flush ();
@@ -1230,7 +1225,7 @@ public void writeSquidWeightedMeanReportToFile(String weightedMeanReport, File r
1230
1225
1231
1226
/**
1232
1227
* @param aFolderToWriteCalamariReports the folderToWriteCalamariReports to
1233
- * set
1228
+ * set
1234
1229
*/
1235
1230
public void setFolderToWriteCalamariReports (File aFolderToWriteCalamariReports ) {
1236
1231
folderToWriteCalamariReports = aFolderToWriteCalamariReports ;
0 commit comments