diff --git a/bin/.gitignore b/bin/.gitignore deleted file mode 100644 index 1efcc2d..0000000 --- a/bin/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -/InputOutput/ -/UML.cld -/Use_Cases.ucd -/interface_xml_files/ -/main/ -/networking/ -/server/ -/testing/ -/thermostat/ -/user_interface/ diff --git a/bin/InputOutput/InputOutput.class b/bin/InputOutput/InputOutput.class index aab2499..7aa4694 100644 Binary files a/bin/InputOutput/InputOutput.class and b/bin/InputOutput/InputOutput.class differ diff --git a/bin/META-INF/MANIFEST.MF b/bin/META-INF/MANIFEST.MF new file mode 100644 index 0000000..fd06042 --- /dev/null +++ b/bin/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: thermostat.ThermostatDevice + diff --git a/bin/testing/Networking_Test.class b/bin/testing/Networking_Test.class index 7263198..31ef510 100644 Binary files a/bin/testing/Networking_Test.class and b/bin/testing/Networking_Test.class differ diff --git a/bin/testing/TestforIO.class b/bin/testing/TestforIO.class index 6e069f9..1d9cb4a 100644 Binary files a/bin/testing/TestforIO.class and b/bin/testing/TestforIO.class differ diff --git a/bin/testing/ThermostatTest.class b/bin/testing/ThermostatTest.class index 4e6ea8b..39623c1 100644 Binary files a/bin/testing/ThermostatTest.class and b/bin/testing/ThermostatTest.class differ diff --git a/bin/thermostat/Sensorable.class b/bin/thermostat/Sensorable.class index 73d5001..9ced7e2 100644 Binary files a/bin/thermostat/Sensorable.class and b/bin/thermostat/Sensorable.class differ diff --git a/bin/thermostat/TemperatureSensor.class b/bin/thermostat/TemperatureSensor.class index bdb0ed8..f7f979f 100644 Binary files a/bin/thermostat/TemperatureSensor.class and b/bin/thermostat/TemperatureSensor.class differ diff --git a/bin/thermostat/ThermostatDevice.class b/bin/thermostat/ThermostatDevice.class index 15ee3fb..eacbdc3 100644 Binary files a/bin/thermostat/ThermostatDevice.class and b/bin/thermostat/ThermostatDevice.class differ diff --git a/out/MAIN.jar b/out/MAIN.jar new file mode 100644 index 0000000..4d13b43 Binary files /dev/null and b/out/MAIN.jar differ diff --git a/src/InputOutput/DataStructure.java b/src/InputOutput/DataStructure.java index e839137..1fc357d 100644 --- a/src/InputOutput/DataStructure.java +++ b/src/InputOutput/DataStructure.java @@ -69,12 +69,23 @@ public void updateTable(String tableName, String key, String subKey, String valu } public String queryForValue(String tableName, String key, String subKey){ - return this.get(tableName).get(key).get(subKey); + String value = null; + try{ + value = this.get(tableName).get(key).get(subKey); + } catch(Exception e){ + System.out.println("ERROR QUERYING STRUCT, no value found"); + } + return value; } public Hashtable getObjectFromTableAndKey(String tableName, String key){ - return this.get(tableName).get(key); - + Hashtable table = new Hashtable(); + try{ + table = this.get(tableName).get(key); + } catch(Exception e){ + System.out.println("ERROR QUERYING STRUCT, no value found"); + } + return table; } public void printStruct(){ diff --git a/src/InputOutput/UserLogin.java b/src/InputOutput/UserLogin.java index 4c00b14..fb57951 100644 --- a/src/InputOutput/UserLogin.java +++ b/src/InputOutput/UserLogin.java @@ -54,8 +54,22 @@ public void handle(ActionEvent e) { _password = _login.get(enteredEmail); enteredPassword = password.getText(); boolean goodKey = _login.containsKey(enteredEmail);*/ - - if (_server.getUserFromEmail(enteredEmail).get("email").equals(enteredEmail) && _server.getUserFromEmail(enteredEmail).get("password").equals(enteredPassword)){ + + + String queriedEmail = null; + String queriedPassword = null; + try { + queriedEmail = _server.getUserFromEmail(enteredEmail).get("email"); + queriedPassword = _server.getUserFromEmail(enteredEmail).get("password"); + } catch(Exception e1){ + System.out.println("user and password does not exist"); + + } + + if(queriedEmail ==null || queriedPassword==null){ + System.out.println("user and password does not exist"); + } else { + if (queriedEmail.equals(enteredEmail) && queriedPassword.equals(enteredPassword)){ _loggedin = true; try{//opens new window when login true Parent root = FXMLLoader.load(getClass().getResource("/interface_xml_files/SetupThermo.fxml")); @@ -73,6 +87,7 @@ public void handle(ActionEvent e) { stage.close(); } + } }); } diff --git a/src/META-INF/MANIFEST.MF b/src/META-INF/MANIFEST.MF new file mode 100644 index 0000000..fd06042 --- /dev/null +++ b/src/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: thermostat.ThermostatDevice + diff --git a/src/testing/DatabaseTest.java b/src/testing/DatabaseTest.java index df4af24..4dd8313 100644 --- a/src/testing/DatabaseTest.java +++ b/src/testing/DatabaseTest.java @@ -29,7 +29,7 @@ public DatabaseTest(){ System.out.println("ip pass"); } - if(testuser.get())) + //if(testuser.get())) } @Override diff --git a/src/testing/ThermostatTest.java b/src/testing/ThermostatTest.java index 2528f52..1b7b302 100644 --- a/src/testing/ThermostatTest.java +++ b/src/testing/ThermostatTest.java @@ -22,12 +22,12 @@ public ThermostatTest(){ private void testRandomTempGenerator() { Boolean testPassed = false; - DataObject randomTemperatureValue = this.testSensor.generateFakeTemperature(); + /*DataObject randomTemperatureValue = this.testSensor.generateFakeTemperature(); if(randomTemperatureValue.getValue() > 50 && randomTemperatureValue.getValue()<78){ testPassed = true; } - this.printTestResults("Generate Random Temp", testPassed); + this.printTestResults("Generate Random Temp", testPassed);*/ } private void testEnterCoolingMode(){