package org.simantics.history.csv;
import java.io.IOException;
-import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
-import java.net.URLDecoder;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.Format;
i.history = history;
i.label = label!=null?label:"";
i.variableReference = variableReference!=null?variableReference:"";
- i.variableReference = unescape(i.variableReference);
+ i.variableReference = URIs.safeUnescape(i.variableReference);
i.historyItemId = historyItemId;
i.unit = unit;
if ( !items.contains(i) ) items.add( i );
}
- private static String unescape(String url) {
- try {
- return URLDecoder.decode(url, "UTF-8");
- } catch (UnsupportedEncodingException e) {
- return url;
- }
- }
-
/**
* Sort items by variableId, label1, label2
*/
// Sampling based on given startTime and timeStep
if(timeStep > 0) {
- // Find the first sample time that contains data
+ // Find the first sample time that contains data if startTime < _from
double n = Math.max(0, Math.ceil((_from-startTime) / timeStep));
time = startTime + n*timeStep;
private Formatter evaluateFormatter(Format format, DecimalSeparator target) {
// Probe decimal separator
String onePointTwo = format.format(1.2);
- System.out.println("formatted zeroPointOne: " + onePointTwo);
+ //System.out.println("formatted zeroPointOne: " + onePointTwo);
DecimalSeparator formatSeparator;
if (onePointTwo.indexOf('.') != -1) {