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();
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);
String insertFlightPointQuery = "INSERT INTO `" + this.name + "_Flight_Points` (`Index_ID`, `Name`, `Type`," +
" `Altitude`, `Latitude`, `Longitude`) VALUES ";
" `Altitude`, `Latitude`, `Longitude`, `Order`) VALUES ";
int numOfFlights = 0;
for (int i = 0; i < flightPointsToImport.size(); i ++){
String flightPointIdentifier = flightPointsToImport.get(i).getType() + flightPointsToImport.get(i).getName() +
@ -714,7 +714,7 @@ public class Dataset {
insertFlightPointQuery += ",";
}
insertFlightPointQuery += "(" + flightPathId +", \""+ flightName +"\", \"" + flightType + "\", "+ flightAltitude + ", " +
"" + flightLatitude + ", " + flightLongitude + ")";
"" + flightLatitude + ", " + flightLongitude + ", "+numOfFlights+")";
flightPointsToImport.get(i).setID(nextID);
flightPointsToImport.get(i).setIndexID(flightPathId);
//add data to dataset array.
@ -1239,12 +1239,12 @@ public class Dataset {
stmt = c.createStatement();
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 flightName = name.replace("\"", "\"\"");
insertFlightPointQuery += "(" + id +", \""+ flightName +"\", \"" + flightType + "\", "+ altitudeVal + ", " +
"" + latitudeVal + ", " + longitudeVal + ", " + headingVal + ", " + totalDistVal + ", " + legDistVal +
", \"" + via + "\")";
", \"" + via + "\", "+index+")";
stmt.execute(insertFlightPointQuery);
stmt.close();
//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+"\" " +
"WHERE `Path_ID` = "+flightPath.getID();
stmt.execute(query);
c.close();
} catch ( Exception e ) {
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+"\" " +
"WHERE `Path_ID` = "+flightPath.getID();
stmt.execute(query);
c.close();
} catch ( Exception e ) {
System.err.println( e.getClass().getName() + ": " + e.getMessage() );
}
@ -2102,6 +2100,8 @@ public class Dataset {
int indexToAdd = index;
if (curIndex < index){
indexToAdd --;
}else{
indexToAdd ++;
}
flightPath.getFlightPoints().add(indexToAdd, flightPoint);

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

Loading…
Cancel
Save