Fixed some merge rollback RAWRgit add .git add .

main
YaFedImYaEatIm 9 years ago
parent 683c89622d
commit b94fcb6c29

Binary file not shown.

@ -99,7 +99,7 @@ public class App extends Application
session = new Session(); session = new Session();
e.printStackTrace(); e.printStackTrace();
} }
menuController.createPopUpStage(SceneCode.DATASET_CONTROLLER, 600, 400); //menuController.createPopUpStage(SceneCode.DATASET_CONTROLLER, 600, 400);
} }
/** /**

@ -697,7 +697,7 @@ public class Dataset {
flightPathToAdd.setID(flightPathId); flightPathToAdd.setID(flightPathId);
String insertFlightPointQuery = "INSERT INTO `" + this.name + "_Flight_Points` (`Index_ID`, `Name`, `Type`," + String insertFlightPointQuery = "INSERT INTO `" + this.name + "_Flight_Points` (`Index_ID`, `Name`, `Type`," +
" `Altitude`, `Latitude`, `Longitude`) VALUES "; " `Altitude`, `Latitude`, `Longitude`, `Order`) VALUES ";
int numOfFlights = 0; int numOfFlights = 0;
for (int i = 0; i < flightPointsToImport.size(); i ++){ for (int i = 0; i < flightPointsToImport.size(); i ++){
String flightPointIdentifier = flightPointsToImport.get(i).getType() + flightPointsToImport.get(i).getName() + String flightPointIdentifier = flightPointsToImport.get(i).getType() + flightPointsToImport.get(i).getName() +
@ -714,7 +714,7 @@ public class Dataset {
insertFlightPointQuery += ","; insertFlightPointQuery += ",";
} }
insertFlightPointQuery += "(" + flightPathId +", \""+ flightName +"\", \"" + flightType + "\", "+ flightAltitude + ", " + insertFlightPointQuery += "(" + flightPathId +", \""+ flightName +"\", \"" + flightType + "\", "+ flightAltitude + ", " +
"" + flightLatitude + ", " + flightLongitude + ")"; "" + flightLatitude + ", " + flightLongitude + ", "+numOfFlights+")";
flightPointsToImport.get(i).setID(nextID); flightPointsToImport.get(i).setID(nextID);
flightPointsToImport.get(i).setIndexID(flightPathId); flightPointsToImport.get(i).setIndexID(flightPathId);
//add data to dataset array. //add data to dataset array.
@ -1239,12 +1239,12 @@ public class Dataset {
stmt = c.createStatement(); stmt = c.createStatement();
String insertFlightPointQuery = "INSERT INTO `" + this.name + "_Flight_Points` (`Index_ID`, `Name`, `Type`," + String insertFlightPointQuery = "INSERT INTO `" + this.name + "_Flight_Points` (`Index_ID`, `Name`, `Type`," +
" `Altitude`, `Latitude`, `Longitude`, `Heading`, `Tot_Dist`, `Leg_Dist`, `Via`) VALUES "; " `Altitude`, `Latitude`, `Longitude`, `Heading`, `Tot_Dist`, `Leg_Dist`, `Via`, `Order`) VALUES ";
String flightType = type.replace("\"", "\"\""); String flightType = type.replace("\"", "\"\"");
String flightName = name.replace("\"", "\"\""); String flightName = name.replace("\"", "\"\"");
insertFlightPointQuery += "(" + id +", \""+ flightName +"\", \"" + flightType + "\", "+ altitudeVal + ", " + insertFlightPointQuery += "(" + id +", \""+ flightName +"\", \"" + flightType + "\", "+ altitudeVal + ", " +
"" + latitudeVal + ", " + longitudeVal + ", " + headingVal + ", " + totalDistVal + ", " + legDistVal + "" + latitudeVal + ", " + longitudeVal + ", " + headingVal + ", " + totalDistVal + ", " + legDistVal +
", \"" + via + "\")"; ", \"" + via + "\", "+index+")";
stmt.execute(insertFlightPointQuery); stmt.execute(insertFlightPointQuery);
stmt.close(); stmt.close();
//move all the points after this forward //move all the points after this forward
@ -1263,7 +1263,6 @@ public class Dataset {
String query = "UPDATE `"+this.name+"_Flight_Path` SET `Source_Airport` = \""+flightName+"\" " + String query = "UPDATE `"+this.name+"_Flight_Path` SET `Source_Airport` = \""+flightName+"\" " +
"WHERE `Path_ID` = "+flightPath.getID(); "WHERE `Path_ID` = "+flightPath.getID();
stmt.execute(query); stmt.execute(query);
c.close();
} catch ( Exception e ) { } catch ( Exception e ) {
System.err.println( e.getClass().getName() + ": " + e.getMessage() ); System.err.println( e.getClass().getName() + ": " + e.getMessage() );
} }
@ -1274,7 +1273,6 @@ public class Dataset {
String query = "UPDATE `"+this.name+"_Flight_Path` SET `Destination_Airport` = \""+flightName+"\" " + String query = "UPDATE `"+this.name+"_Flight_Path` SET `Destination_Airport` = \""+flightName+"\" " +
"WHERE `Path_ID` = "+flightPath.getID(); "WHERE `Path_ID` = "+flightPath.getID();
stmt.execute(query); stmt.execute(query);
c.close();
} catch ( Exception e ) { } catch ( Exception e ) {
System.err.println( e.getClass().getName() + ": " + e.getMessage() ); System.err.println( e.getClass().getName() + ": " + e.getMessage() );
} }
@ -2102,6 +2100,8 @@ public class Dataset {
int indexToAdd = index; int indexToAdd = index;
if (curIndex < index){ if (curIndex < index){
indexToAdd --; indexToAdd --;
}else{
indexToAdd ++;
} }
flightPath.getFlightPoints().add(indexToAdd, flightPoint); flightPath.getFlightPoints().add(indexToAdd, flightPoint);

@ -27,13 +27,17 @@ public class DatasetController extends Controller{
public void load() { public void load() {
curDataset = getParent().getCurrentDataset(); curDataset = getParent().getCurrentDataset();
}
public void loadTable(){
ArrayList<Dataset> datasets = getParent().getDatasets(); ArrayList<Dataset> datasets = getParent().getDatasets();
datasetList = observableArrayList(datasets); datasetList = observableArrayList(datasets);
datasetView.setItems(datasetList); datasetView.setItems(datasetList);
} }
public void deleteDataset(){ public void deleteDataset(){
Dataset datasetToDelete = (Dataset) datasetView.getSelectionModel().getSelectedItem();
getParent().deleteDataset(datasetToDelete);
} }
public void addDataset(){ public void addDataset(){

Loading…
Cancel
Save