@@ -3,7 +3,7 @@ |
import java.util.ArrayList; |
|
/** |
-* Last Updated: 23-January-2015 |
+* Last Updated: 26-January-2015 |
* @author Tyler Wible |
* @since 25-January-2014 |
*/ |
@@ -60,7 +60,7 @@ |
}else if(database.equalsIgnoreCase("UserData")){ |
//Find the user uploaded data file and uses this for a timeseries graph |
User_Data user_Data = new User_Data(); |
- flowData = user_Data.readUserFile(database, userData, "flow", beginDate, endDate); |
+ flowData = user_Data.readUserFile(database, stationID, userData, "flow", beginDate, endDate); |
|
}else if(database.equalsIgnoreCase("STORET")){ |
//Search for STORET flow data |
@@ -75,7 +75,7 @@ |
}else{ |
//Parse the data provided (much quicker) |
User_Data user_Data = new User_Data(); |
- flowData = user_Data.readUserFile(database, STORETdata, "flow", beginDate, endDate); |
+ flowData = user_Data.readUserFile(database, stationID, STORETdata, "flow", beginDate, endDate); |
} |
|
}else if(database.equalsIgnoreCase("CDWR")){ |
@@ -149,7 +149,7 @@ |
|
//Find the user uploaded data file and uses this for a timeseries graph |
User_Data user_Data = new User_Data(); |
- wqData = user_Data.readUserFile(database, userData, wqTest, beginDate, endDate); |
+ wqData = user_Data.readUserFile(database, stationID, userData, wqTest, beginDate, endDate); |
|
}else if(database.equalsIgnoreCase("STORET")){ |
String[] resultArray = getWQtestDataInfo(wqTest, database); |
@@ -171,7 +171,7 @@ |
}else{ |
//Parse the data provided (much quicker) |
User_Data user_Data = new User_Data(); |
- wqData = user_Data.readUserFile(database, STORETdata, wqTest, beginDate, endDate); |
+ wqData = user_Data.readUserFile(database, stationID, STORETdata, wqTest, beginDate, endDate); |
} |
|
}else if(database.equalsIgnoreCase("CDWR")){ |
@@ -247,7 +247,7 @@ |
}else if(database.equalsIgnoreCase("UserData")){ |
//Find the user uploaded data file and uses this for a timeseries graph |
User_Data user_Data = new User_Data(); |
- Object[] returnArray = user_Data.readUserFileLDC(database, userData, wqTest, beginDate, endDate); |
+ Object[] returnArray = user_Data.readUserFileLDC(database, stationID, userData, wqTest, beginDate, endDate); |
flowData = (String[][]) returnArray[0]; |
wqData = (String[][]) returnArray[1]; |
|
@@ -273,7 +273,7 @@ |
}else{ |
//Parse the data provided (much quicker) |
User_Data user_Data = new User_Data(); |
- Object[] returnArray = user_Data.readUserFileLDC(database, STORETdata, wqTest, beginDate, endDate); |
+ Object[] returnArray = user_Data.readUserFileLDC(database, stationID, STORETdata, wqTest, beginDate, endDate); |
flowData = (String[][]) returnArray[0]; |
wqData = (String[][]) returnArray[1]; |
} |
@@ -327,7 +327,7 @@ |
}else if(database.equalsIgnoreCase("UserData")){ |
//Find the user uploaded data file and uses this for a timeseries graph |
User_Data user_Data = new User_Data(); |
- String[][] flowData = user_Data.readUserFile(database, userData, "flow", beginDate, endDate); |
+ String[][] flowData = user_Data.readUserFile(database, stationID, userData, "flow", beginDate, endDate); |
|
//Removed duplicate dates |
flowData = doubleArray.removeDuplicateDates(flowData); |
@@ -349,7 +349,7 @@ |
}else{ |
//Parse the data provided (much quicker) |
User_Data user_Data = new User_Data(); |
- flowData = user_Data.readUserFile(database, STORETdata, "flow", beginDate, endDate); |
+ flowData = user_Data.readUserFile(database, stationID, STORETdata, "flow", beginDate, endDate); |
} |
|
//Removed duplicate dates |
@@ -6,7 +6,7 @@ |
import java.util.Date; |
|
/** |
-* Last Updated: 23-January-2015 |
+* Last Updated: 26-January-2015 |
* @author Tyler Wible |
* @since 12-July-2012 |
*/ |
@@ -73,6 +73,7 @@ |
/** |
* Opens and reads out the contents of the specified file to be used as flow and water quality data. |
* @param database the database from which to extract daily flow data (UserData or STORET) |
+ * @param stationID the station ID of the data, used for error message |
* @param userData_string The tab-delimited contents of the user data file |
* with header The expected format of the string is a tab-delimited text |
* file (\n separating lines) with dates in the first column and daily |
@@ -97,14 +98,14 @@ |
* mg/L) |
* @throws IOException |
*/ |
- public Object[] readUserFileLDC(String database, String userData_string, String wqTest, String beginDate, String endDate) throws IOException{ |
+ public Object[] readUserFileLDC(String database, String stationID, String userData_string, String wqTest, String beginDate, String endDate) throws IOException{ |
|
String[] userData_types = userData_string.split("\\$\\$"); |
String userData_flow = userData_types[0]; |
String userData_wq = userData_types[1]; |
|
- String[][] flowData = readUserFile(database, userData_flow, "flow", beginDate, endDate); |
- String[][] wqData = readUserFile(database, userData_wq, wqTest, beginDate, endDate); |
+ String[][] flowData = readUserFile(database, stationID, userData_flow, "flow", beginDate, endDate); |
+ String[][] wqData = readUserFile(database, stationID, userData_wq, wqTest, beginDate, endDate); |
|
Object[] returnArray = {flowData, wqData}; |
return returnArray; |
@@ -112,6 +113,7 @@ |
/** |
* Opens and reads out the contents of the specified file to be used as flow data. |
* @param database the database from which to extract daily flow data (UserData or STORET) |
+ * @param stationID the station ID of the data, used for error message |
* @param userData_string The tab-delimited contents of the user data file |
* with header The expected format of the string is a tab-delimited text |
* file (\n separating lines) with dates in the first column and daily |
@@ -134,7 +136,7 @@ |
* if there is not a value for column2 (blank, null, not a number, etc.) then no data will be kept for that date |
* @throws IOException |
*/ |
- public String[][] readUserFile(String database, String userData_string, String wqTest, String beginDate, String endDate) throws IOException{ |
+ public String[][] readUserFile(String database, String stationID, String userData_string, String wqTest, String beginDate, String endDate) throws IOException{ |
//Get the wqCode out of wqTest |
Data data = new Data(); |
String[] resultArray = data.getWQtestDataInfo(wqTest, "UserData"); |
@@ -155,7 +157,7 @@ |
|
//Check for lack of data |
if(headerIndex == -1){ |
- String errorContents = "There is no available uploaded " + database + " data for " + wqTest; |
+ String errorContents = "There is no available uploaded " + database + " data for station " + stationID + " and water quality test:" + wqTest; |
throw new IOException("Error encountered. Please see the following message for details: \n" + errorContents); |
} |
|
@@ -26,7 +26,7 @@ |
import org.jfree.data.xy.XYSeriesCollection; |
|
/** |
-* Last Updated: 23-January-2015 |
+* Last Updated: 26-January-2015 |
* @author Tyler Wible |
* @since 12-June-2011 |
*/ |
@@ -251,7 +251,7 @@ |
String[][] sortableData_user = new String[0][0]; |
if(mergeDatasets){ |
User_Data user_Data = new User_Data(); |
- sortableData_user = user_Data.readUserFile("UserData", userData, "flow", beginDate, endDate); |
+ sortableData_user = user_Data.readUserFile("UserData", stationID, userData, "flow", beginDate, endDate); |
} |
|
//Sort the Data by date to remove duplicate date entries |
@@ -605,7 +605,7 @@ |
String[][] WQdata_user = new String[0][0]; |
if(mergeDatasets){ |
User_Data user_Data = new User_Data(); |
- Object[] returnArray2 = user_Data.readUserFileLDC("UserData", userData, wqTest, beginDate, endDate); |
+ Object[] returnArray2 = user_Data.readUserFileLDC("UserData", stationID, userData, wqTest, beginDate, endDate); |
sortableData_user = (String[][]) returnArray2[0]; |
WQdata_user = (String[][]) returnArray2[1]; |
} |