Skip to content

Commit

Permalink
converted some file encodings from LATIN1 to UTF8 for better portability
Browse files Browse the repository at this point in the history
  • Loading branch information
daFritz84 committed Jul 20, 2016
1 parent 45e9226 commit e6ba0f6
Show file tree
Hide file tree
Showing 20 changed files with 94 additions and 94 deletions.
Expand Up @@ -51,7 +51,7 @@
/**
* Class for storing the data of an obix.Obj
*
* @author Clemens Pühringer
* @author Clemens Pühringer
*
*/
public class IotObject implements Serializable {
Expand Down
Expand Up @@ -59,7 +59,7 @@
* the Device will send all propertys that are set. if you want poll all PropertyId {@link ReadPropertyRangeTest}.
*
* @author Matthew Lohbihler
* @author Arne Plöse
* @author Arne Plöse
*/
public class ReadAllAvailableProperties {
public static String BROADCAST_ADDRESS = "128.130.56.255";
Expand Down
Expand Up @@ -49,8 +49,8 @@ protected void initValues()
BoolElement pressed = new BoolElement(EncodingPressedReleased.KEY_PRESSED, "Pressed", true);
BoolElement released = new BoolElement(EncodingPressedReleased.KEY_RELEASED, "Released", false);

pressed.addTranslation("de", TranslationAttribute.displayName, "Gedrückt");
released.addTranslation("de", TranslationAttribute.displayName, "Nicht gedrückt");
pressed.addTranslation("de", TranslationAttribute.displayName, "Gedrückt");
released.addTranslation("de", TranslationAttribute.displayName, "Nicht gedrückt");

addElement(pressed);
addElement(released);
Expand Down
Expand Up @@ -40,9 +40,9 @@ public class UnitCelsiusImpl extends UnitImpl implements UnitCelsius
{
public UnitCelsiusImpl()
{
super("celsius", "temperature (°C)", new Uri(UnitCelsius.HREF), "°C", 1, -273.15, new DimensionImpl(0, 0, 0, 1, 0, 0, 0));
super("celsius", "temperature (°C)", new Uri(UnitCelsius.HREF), "°C", 1, -273.15, new DimensionImpl(0, 0, 0, 1, 0, 0, 0));

// Translations
addTranslation("de", TranslationAttribute.displayName, "Temperatur (°C)");
addTranslation("de", TranslationAttribute.displayName, "Temperatur (°C)");
}
}
Expand Up @@ -40,9 +40,9 @@ public class UnitDegreeImpl extends UnitImpl implements UnitDegree
{
public UnitDegreeImpl()
{
super("degree", "degree (°)", new Uri(UnitDegree.HREF), "°", 1, 0, new DimensionImpl(0, 0, 0, 0, 0, 0, 0));
super("degree", "degree (°)", new Uri(UnitDegree.HREF), "°", 1, 0, new DimensionImpl(0, 0, 0, 0, 0, 0, 0));

// Translations
addTranslation("de", TranslationAttribute.displayName, "Grad (°)");
addTranslation("de", TranslationAttribute.displayName, "Grad (°)");
}
}
Expand Up @@ -48,12 +48,12 @@ public static String getEscapedUri(String decodedStr)
tmp = tmp.replace(" ", "_");
tmp = tmp.replace("-", "_");
tmp = tmp.replace("/", "_");
tmp = tmp.replace("ß", "ss");
tmp = tmp.replace("ä", "ae");
tmp = tmp.replace("ö", "oe");
tmp = tmp.replace("ü", "ue");
tmp = tmp.replace("²", "2");
tmp = tmp.replace("³", "3");
tmp = tmp.replace("ß", "ss");
tmp = tmp.replace("ä", "ae");
tmp = tmp.replace("ö", "oe");
tmp = tmp.replace("ü", "ue");
tmp = tmp.replace("²", "2");
tmp = tmp.replace("³", "3");
tmp = tmp.replace("!", "");
tmp = tmp.replace("?", "");
tmp = tmp.replace("=", "");
Expand Down
Expand Up @@ -46,12 +46,12 @@ public void runTests()
if (obj instanceof TemperatureControlActuator)
{
TemperatureControlActuator kuehlhaus = (TemperatureControlActuator) obj;
System.out.println("\nK�hlhaus Hesselbachweg 5.");
System.out.println("\nK�hlhaus Hesselbachweg 5.");

System.out.println(" Vorgabe Raumtemperatur-Sollwert: " + kuehlhaus.targetValue());
System.out.println(" Aktueller Raumtemperatur-Istwert: " + kuehlhaus.actualValue());
System.out.println(" Aktueller Raumtemperatur-Sollwert: " + kuehlhaus.actualTargetValue());
System.out.println(" Aktueller Zustand Freigabe K�ltemaschine: " + kuehlhaus.active());
System.out.println(" Aktueller Zustand Freigabe K�ltemaschine: " + kuehlhaus.active());

System.out.println("Setting new target temperature value for Kuehlhaus.");
kuehlhaus.targetValue().set(-10);
Expand Down Expand Up @@ -88,9 +88,9 @@ public void runTests()
if (obj instanceof HeatPumpActuator)
{
HeatPumpActuator heatPump = (HeatPumpActuator) obj;
System.out.println("\nW�rmepumpe Lienbachstra�e 5.");
System.out.println("\nW�rmepumpe Lienbachstra�e 5.");

System.out.println(" Sperre W�rmepumpe: " + heatPump.disabled());
System.out.println(" Sperre W�rmepumpe: " + heatPump.disabled());
System.out.println(" Sollwertbeeinflussung: " + heatPump.targetValueInfluence());

System.out.println("\nDisabling heat pump and enabling target value influence.");
Expand All @@ -110,12 +110,12 @@ public void update(Object state)
if (obj instanceof TemperatureControlActuator)
{
TemperatureControlActuator kuehlhaus = (TemperatureControlActuator) obj;
System.out.println("\nK�hlhaus Hesselbachweg 5 (Observed).");
System.out.println("\nK�hlhaus Hesselbachweg 5 (Observed).");

System.out.println(" Vorgabe Raumtemperatur-Sollwert: " + kuehlhaus.targetValue());
System.out.println(" Aktueller Raumtemperatur-Istwert: " + kuehlhaus.actualValue());
System.out.println(" Aktueller Raumtemperatur-Sollwert: " + kuehlhaus.actualTargetValue());
System.out.println(" Aktueller Zustand Freigabe K�ltemaschine: " + kuehlhaus.active());
System.out.println(" Aktueller Zustand Freigabe K�ltemaschine: " + kuehlhaus.active());
}
}

Expand All @@ -131,7 +131,7 @@ public void update(Object state)
if (obj instanceof TemperatureControlActuator)
{
TemperatureControlActuator kuehlhaus = (TemperatureControlActuator) obj;
System.out.println("\nK�hlhaus Hesselbachweg 5 (Observed).");
System.out.println("\nK�hlhaus Hesselbachweg 5 (Observed).");

System.out.println(" Vorgabe Raumtemperatur-Sollwert: " + kuehlhaus.targetValue());
System.out.println(" Aktueller Raumtemperatur-Istwert: " + kuehlhaus.actualValue());
Expand All @@ -143,7 +143,7 @@ public void update(Object state)
if (obj instanceof HeatPumpActuator)
{
HeatPumpActuator heatPump = (HeatPumpActuator) obj;
System.out.println(" Sperre W�rmepumpe: " + heatPump.disabled());
System.out.println(" Sperre W�rmepumpe: " + heatPump.disabled());
System.out.println(" Sollwertbeeinflussung: " + heatPump.targetValueInfluence());
}
}
Expand Down
Expand Up @@ -68,7 +68,7 @@ public void simpleTest() {
public void extendedTest() {
System.out.println("=[ extendedTest ]==============================");

String input = "</my/Päth>;rt=\"MyName\";if=\"/someRef/path\";ct=42;obs;sz=10";
String input = "</my/Päth>;rt=\"MyName\";if=\"/someRef/path\";ct=42;obs;sz=10";
Resource root = RemoteResource.newRoot(input);

RemoteResource my = new RemoteResource("my");
Expand All @@ -77,18 +77,18 @@ public void extendedTest() {

root.prettyPrint();

Resource res = root.getResource("/my/Päth");
Resource res = root.getResource("/my/Päth");
assertNotNull(res);
res = root.getResource("my/Päth");
res = root.getResource("my/Päth");
assertNotNull(res);
res = root.getResource("my");
res = res.getResource("Päth");
res = res.getResource("Päth");
assertNotNull(res);
res = res.getResource("/my/Päth");
res = res.getResource("/my/Päth");
assertNotNull(res);

assertEquals("Päth", res.getName());
assertEquals("/my/Päth", res.getPath());
assertEquals("Päth", res.getName());
assertEquals("/my/Päth", res.getPath());
assertEquals("MyName", res.getResourceType().get(0));
assertEquals("/someRef/path", res.getInterfaceDescription().get(0));
assertEquals(42, res.getContentTypeCode().get(0).intValue());
Expand Down
Expand Up @@ -18,7 +18,7 @@
/**
* Stand-alone Application for reading EnOcean packages
*
* @author Jürgen Schober
* @author Jürgen Schober
*
*/
public class Application {
Expand Down
Expand Up @@ -2,7 +2,7 @@

public enum Unit {

DEGREE_CELSIUS("°C"), LUX("lx"), HUMIDITY("%"), PPB("ppb - parts per billion"), PPM("ppm - parts per million"), VOLTAGE("Volt"), WATT(
DEGREE_CELSIUS("°C"), LUX("lx"), HUMIDITY("%"), PPB("ppb - parts per billion"), PPM("ppm - parts per million"), VOLTAGE("Volt"), WATT(
"W");

private String displayName;
Expand Down
Expand Up @@ -22,7 +22,7 @@ public class ADTRadioPacket extends RadioPacket {
* @param senderId
* Unique device sender Id
* @param status
* Telegram control bits used in case of repeating, switch
* Telegram control bits – used in case of repeating, switch
* telegram encapsulation, checksum type identification
* @param subTelNum
* Number of subTelegram. Send = 3, receive = 1..x
Expand Down
Expand Up @@ -11,7 +11,7 @@
/**
* "55, 00, 07, 07, 01, 7A, F6, 50, 00, 00, 00, 00, 30, 03, FF, FF, FF, FF, FF, 00, E8"
*
* @author Jürgen Schober
* @author Jürgen Schober
*
*/
public class StateChangerTest {
Expand Down
Expand Up @@ -63,7 +63,7 @@ public class EntityEEP_A52001Impl extends EnoceanEntityImpl implements EntityEEP
EnoceanDPTIntPercImpl datapoint_percent;
EnoceanDPTRealTempImpl datapoint_temp;
EnoceanDPTRealTempImpl datapoint_currenttemp;
EnoceanDPTBoolOnOffImpl datapoint_setpoint; // off = valve pos (0-100), on = temp (0-40°C)
EnoceanDPTBoolOnOffImpl datapoint_setpoint; // off = valve pos (0-100), on = temp (0-40°C)
EnoceanDPTBoolOnOffImpl datapoint_learnonoff;

// constructor
Expand All @@ -82,12 +82,12 @@ public EntityEEP_A52001Impl(ESP3Host esp3Host, EnoceanId id, String name, String
this.addDatapoint(datapoint_percent);

// Create and add new datapoint for the temperature set point
datapoint_temp = new EnoceanDPTRealTempImpl("BatteryPoweredActuatorSetPointTemperature", "Set Point Temperature", "0-40°C", this, true, true);
datapoint_temp = new EnoceanDPTRealTempImpl("BatteryPoweredActuatorSetPointTemperature", "Set Point Temperature", "0-40°C", this, true, true);
datapoint_temp.addTranslation("de-DE", TranslationAttribute.displayName, "Sollwert Temperatur");
this.addDatapoint(datapoint_temp);

// Create and add new datapoint for current temperature
datapoint_currenttemp = new EnoceanDPTRealTempImpl("BatteryPoweredActuatorCurrentTemperature", "Current Temperature", "0-40°C", this, true, false);
datapoint_currenttemp = new EnoceanDPTRealTempImpl("BatteryPoweredActuatorCurrentTemperature", "Current Temperature", "0-40°C", this, true, false);
datapoint_currenttemp.addTranslation("de-DE", TranslationAttribute.displayName, "Istwert Temperatur");
this.addDatapoint(datapoint_currenttemp);

Expand Down Expand Up @@ -130,14 +130,14 @@ public void notifyWatchDog(BasicPacket packet) {
});
}

// helper function to convert a temperature in °C to the byte format of the 4BS telegram
// helper function to convert a temperature in °C to the byte format of the 4BS telegram
private Real temperatureByteToReal(byte temperature){
double real = ((double)temperature)*40/255;
Real temp = new Real(real);
return temp;
}

// helper function to convert the byte format of the 4BS telegram to a temperature in °C
// helper function to convert the byte format of the 4BS telegram to a temperature in °C
private byte temperatureDoubleToByte(double temperature){
int inttemp = (int)(temperature*255/40);
byte temp = (byte)(inttemp&0xFF);
Expand Down Expand Up @@ -175,7 +175,7 @@ else if (input instanceof Int)
db0.setBit(3, !datapoint_learnonoff.value().getBool());
db1.setBit(2 ,datapoint_setpoint.value().getBool());

if(datapoint_setpoint.value().getBool()){ // off = valve pos (0-100), on = temp (0-40°C)
if(datapoint_setpoint.value().getBool()){ // off = valve pos (0-100), on = temp (0-40°C)
db3 = temperatureDoubleToByte(datapoint_temp.value().getReal());
} else {
db3 = (byte)(datapoint_percent.value().getInt()&0xFF);
Expand Down
Expand Up @@ -186,7 +186,7 @@ public static byte[] encryptByPublicKey(byte[] data, String certificatePath)
}

/**
* Decrypted with public key
* Decrypted with public key
*
* @param data
* @param certificatePath
Expand Down

0 comments on commit e6ba0f6

Please sign in to comment.