- Java SCL parser: allow parse float "Val" elements using "," as decimal separator

pull/143/head
Michael Zillgith 8 years ago
parent b195acd128
commit 60b7b673f4

@ -43,6 +43,10 @@ struct sIedServer
LinkedList clientConnections;
uint8_t writeAccessPolicies;
#if (CONFIG_IEC61850_REPORT_SERVICE == 1)
int reportBufferSize;
#endif
#if (CONFIG_MMS_THREADLESS_STACK != 1)
Semaphore dataModelLock;
#endif

@ -102,35 +102,39 @@ public class DataModelValue {
this.value = new Boolean(false);
break;
case FLOAT32:
trimmedValue = value.trim();
if (trimmedValue != value) {
System.out.println("WARNING: value initializer contains leading or trailing whitespace");
}
if (trimmedValue.isEmpty())
this.value = new Float(0);
else
this.value = new Float(trimmedValue);
break;
trimmedValue = value.trim();
if (trimmedValue != value) {
System.out.println("WARNING: value initializer contains leading or trailing whitespace");
}
trimmedValue.replace(',', '.');
if (trimmedValue.isEmpty())
this.value = new Float(0);
else
this.value = new Float(trimmedValue);
break;
case FLOAT64:
trimmedValue = value.trim();
if (trimmedValue != value) {
System.out.println("WARNING: value initializer contains leading or trailing whitespace");
}
if (trimmedValue.isEmpty())
this.value = new Double(0);
else
this.value = new Double(trimmedValue);
break;
trimmedValue = value.trim();
if (trimmedValue != value) {
System.out.println("WARNING: value initializer contains leading or trailing whitespace");
}
trimmedValue.replace(',', '.');
if (trimmedValue.isEmpty())
this.value = new Double(0);
else
this.value = new Double(trimmedValue);
break;
case UNICODE_STRING_255:
this.value = value;
break;
this.value = value;
break;
case OCTET_STRING_64:
try {
this.value = Base64.getDecoder().decode(value);

Loading…
Cancel
Save