WIP161013

WIP-PC2
Harald Wolff 2016-10-13 08:29:17 +02:00
parent 52cac8e5d9
commit ccf6e4d9f7
1 changed files with 9 additions and 1 deletions

View File

@ -17,6 +17,10 @@ import org.hwo.interactiveobjects.ObjectEditorUI;
import org.hwo.models.TableMapper.TableColumn;
import org.hwo.pulscounter.ui.ExportSettingsEditorDialog;
import static org.hwo.logging.Logging.*;
import static org.hwo.logging.LogLevel.*;
@ObjectEditorUI(editor=ExportSettingsEditorDialog.class)
@ConfigurableObject
public class ExportSetting {
@ -118,11 +122,15 @@ public class ExportSetting {
Calendar c = Calendar.getInstance();
c.setTime(d);
return filename
filename = filename
.replaceAll("\\%S", String.format("%d", ss.getDeviceSerial()))
.replaceAll("\\%Y", String.format("%04d", new Integer(c.get(Calendar.YEAR))))
.replaceAll("\\%M", String.format("%02d", new Integer(c.get(Calendar.MONTH)+1)))
.replaceAll("\\%D", String.format("%02d", new Integer(c.get(Calendar.DAY_OF_MONTH))));
log(DEBUG, "exportFileName for Snapshot %s from [%s: %04d-%02d-%02d %02d:%02d:%02d] is %s", ss, ss.getDeviceSerial(), c.get(Calendar.YEAR), c.get(Calendar.MONTH), c.get(Calendar.DAY_OF_MONTH), c.get(Calendar.HOUR_OF_DAY), c.get(Calendar.MINUTE), c.get(Calendar.SECOND),filename);
return filename;
}
public void export(){