commit
4cc27fff96
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,4 +4,3 @@
|
|||||||
/.idea/codeStyles
|
/.idea/codeStyles
|
||||||
/.idea/*.xml
|
/.idea/*.xml
|
||||||
/target/
|
/target/
|
||||||
# TODO: add your build folder here
|
|
@ -4,16 +4,14 @@ import ch.hevs.isi.db.DatabaseConnector;
|
|||||||
import ch.hevs.isi.field.FieldConnector;
|
import ch.hevs.isi.field.FieldConnector;
|
||||||
import ch.hevs.isi.web.WebConnector;
|
import ch.hevs.isi.web.WebConnector;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public abstract class DataPoint{
|
public abstract class DataPoint{
|
||||||
private static Map<String, DataPoint> dataPointMap;
|
private static Map<String, DataPoint> dataPointMap = new HashMap<>();
|
||||||
private String label;
|
private String label;
|
||||||
private boolean isOutput;
|
private boolean isOutput;
|
||||||
protected DataPoint(String label, boolean isOutput){
|
protected DataPoint(String label, boolean isOutput){
|
||||||
if(dataPointMap.containsKey(label)){
|
|
||||||
|
|
||||||
}
|
|
||||||
this.label = label;
|
this.label = label;
|
||||||
this.isOutput = isOutput;
|
this.isOutput = isOutput;
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ public class DatabaseConnector implements DataPointListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void pushToDatabase(DataPoint dp){
|
private void pushToDatabase(DataPoint dp){
|
||||||
System.out.println("To Database: " + dp.toString());
|
System.out.println(dp.toString() + " -> Database");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -23,13 +23,8 @@ public class FieldConnector implements DataPointListener {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void uselessTest(){
|
|
||||||
FloatDataPoint dp = new FloatDataPoint("Voltage", false);
|
|
||||||
dp.setValue(5);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void pushToField(DataPoint dp){
|
private void pushToField(DataPoint dp){
|
||||||
System.out.println("To Field: " + dp.toString());
|
System.out.println(dp.toString() + " -> Field");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -21,7 +21,7 @@ public class WebConnector implements DataPointListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void pushToWeb(DataPoint dp){
|
private void pushToWeb(DataPoint dp){
|
||||||
System.out.println("To Web: " + dp.toString());
|
System.out.println(dp.toString() + " -> Web");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,22 +1,17 @@
|
|||||||
import ch.hevs.isi.core.BooleanDataPoint;
|
import ch.hevs.isi.core.BooleanDataPoint;
|
||||||
import ch.hevs.isi.core.FloatDataPoint;
|
import ch.hevs.isi.core.FloatDataPoint;
|
||||||
import ch.hevs.isi.field.FieldConnector;
|
|
||||||
|
|
||||||
public class Core {
|
public class Core {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
/*
|
|
||||||
BooleanDataPoint bDp = new BooleanDataPoint("foo", true);
|
BooleanDataPoint bDp = new BooleanDataPoint("foo", true);
|
||||||
FloatDataPoint floatDp = new FloatDataPoint("bar", true);
|
new FloatDataPoint("bar", true).setValue(42);
|
||||||
System.out.println(bDp.toString());
|
bDp.setValue(true);
|
||||||
System.out.println(floatDp.toString());
|
|
||||||
bDp.setValue(true);;
|
|
||||||
floatDp.setValue(42);
|
|
||||||
System.out.println(bDp.toString());
|
|
||||||
System.out.println(floatDp.toString());
|
|
||||||
*/
|
|
||||||
|
|
||||||
FieldConnector fc;
|
|
||||||
// TODO some test
|
FloatDataPoint v = new FloatDataPoint("Voltage", false);
|
||||||
|
v.setValue(5);
|
||||||
|
v.setValue(3.3f);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user