- 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; LinkedList clientConnections;
uint8_t writeAccessPolicies; uint8_t writeAccessPolicies;
#if (CONFIG_IEC61850_REPORT_SERVICE == 1)
int reportBufferSize;
#endif
#if (CONFIG_MMS_THREADLESS_STACK != 1) #if (CONFIG_MMS_THREADLESS_STACK != 1)
Semaphore dataModelLock; Semaphore dataModelLock;
#endif #endif

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

Loading…
Cancel
Save