implement full DatabaseConnector and do some tests
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import ch.hevs.isi.MinecraftController;
|
||||
import ch.hevs.isi.core.BooleanDataPoint;
|
||||
import ch.hevs.isi.core.DataPoint;
|
||||
import ch.hevs.isi.core.FloatDataPoint;
|
||||
import ch.hevs.isi.db.DatabaseConnector;
|
||||
@@ -8,19 +10,20 @@ import java.util.Properties;
|
||||
|
||||
public class Database {
|
||||
public static void main(String[] args) {
|
||||
Properties properties = new Properties();
|
||||
try (InputStream input = new FileInputStream("src/config.properties")) {
|
||||
properties.load(input);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
String url = properties.getProperty("URL");
|
||||
|
||||
DatabaseConnector db = DatabaseConnector.getMySelf();
|
||||
db.initialize(url);
|
||||
|
||||
MinecraftController.ERASE_PREVIOUS_DATA_INB_DB = true;
|
||||
FloatDataPoint clock = new FloatDataPoint("CLOAK_FLOAT", false);
|
||||
FloatDataPoint gridVoltage = new FloatDataPoint("GRID_U_FLOAT", true);
|
||||
gridVoltage.setValue(500);
|
||||
BooleanDataPoint solarPanel = new BooleanDataPoint("REMOTE_SOLAR_SW", true);
|
||||
|
||||
DatabaseConnector.getMySelf().initialize(null);
|
||||
|
||||
clock.setValue(0f);
|
||||
|
||||
for (float i = 0; i < 3; i += 0.1f) {
|
||||
System.out.println("");
|
||||
clock.setValue(i);
|
||||
gridVoltage.setValue(750 + (100*i)%100);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user