image export includes full timestamp, export directory defined as /awips2/export/<user>
This commit is contained in:
parent
e2ae440409
commit
54f8dfdbd6
3 changed files with 13 additions and 9 deletions
|
@ -58,7 +58,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* Oct 28, 2014 3767 bsteffen Automatically change filename if selected
|
||||
* format does not support all options.
|
||||
* Dec 4, 2014 DR16713 jgerth Support for date/time selection
|
||||
*
|
||||
* Jan 18, 2016 ---- mjames@ucar datetimeButton selected by default
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bsteffen
|
||||
|
@ -141,8 +142,7 @@ public class ImageExportDialog extends CaveSWTDialog {
|
|||
datetimeButton = new Button(group, SWT.CHECK);
|
||||
datetimeButton.setLayoutData(gridData);
|
||||
datetimeButton.setText("Include date and time in file name");
|
||||
datetimeButton
|
||||
.setSelection(options.getDateTimeSelection() == DateTimeSelection.DATETIME);
|
||||
datetimeButton.setSelection(true);
|
||||
datetimeButton
|
||||
.setToolTipText("Append the date and time to the file name when Animate is not selected.");
|
||||
}
|
||||
|
|
|
@ -80,6 +80,7 @@ import com.raytheon.viz.ui.editor.AbstractEditor;
|
|||
* Jul 26, 2006 chammack Initial Creation.
|
||||
* Jan 20, 2014 2312 bsteffen Move to image export plugin, animation.
|
||||
* Dec 4, 2014 DR16713 jgerth Support for date and time in file name
|
||||
* Jan 18, 2016 ---- mjames@ucar Append yyyy.MM.dd.HH.mm.ss to image filename
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -213,21 +214,22 @@ public class ExportImageHandler extends AbstractImageCaptureHandler {
|
|||
for (Map.Entry<DataTime, BufferedImage> entry : dtbiHash.entrySet()) {
|
||||
i++;
|
||||
BufferedImage bi = entry.getValue();
|
||||
String timeStamp = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss").format(new Date());
|
||||
if (options.getDateTimeSelection() == DateTimeSelection.DATETIME) {
|
||||
DataTime key = entry.getKey();
|
||||
Date validTime = key.getValidTimeAsDate();
|
||||
if (validTime != null && !isFakeTime(key)) {
|
||||
path = basePath + "-" + sdf.format(validTime) + "." + suffix;
|
||||
path = basePath + "-" + sdf.format(validTime) + "-" + timeStamp + "." + suffix;
|
||||
if (path.equals(ppath)) {
|
||||
path = basePath + "-" + sdf.format(validTime) + "-" + twoDigit.format(i).toString() + "." + suffix;
|
||||
path = basePath + "-" + sdf.format(validTime) + "-" + twoDigit.format(i).toString() + "-" + timeStamp + "." + suffix;
|
||||
}
|
||||
} else {
|
||||
path = basePath + "-" + twoDigit.format(i).toString() + "." + suffix;
|
||||
path = basePath + "-" + twoDigit.format(i).toString() + "-" + timeStamp + "." + suffix;
|
||||
}
|
||||
} else if (dtbiHash.size() > 1) {
|
||||
path = basePath + "-" + twoDigit.format(i).toString() + "." + suffix;
|
||||
path = basePath + "-" + twoDigit.format(i).toString() + "-" + timeStamp + "." + suffix;
|
||||
} else {
|
||||
path = basePath + "." + suffix;
|
||||
path = basePath + "-" + timeStamp + "." + suffix;
|
||||
}
|
||||
ppath = path;
|
||||
stream = new FileImageOutputStream(new File(path));
|
||||
|
|
|
@ -39,6 +39,8 @@ import com.raytheon.uf.viz.core.datastructure.LoopProperties;
|
|||
* Mar 10, 2014 2867 bsteffen Better frame range validation.
|
||||
* Oct 28, 2014 3767 bsteffen Change default name to screenCapture.png
|
||||
* Dec 4, 2014 DR16713 jgerth Support for date/time selection
|
||||
* Jan 18, 2016 ---- mjames@ucar Save images to /awips2/export/<username> rather than
|
||||
* /awips2/eclipse (and avoid guessing that /home/awips exists)
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -85,7 +87,7 @@ public class ImageExportOptions {
|
|||
|
||||
}
|
||||
|
||||
private File fileLocation = new File("screenCapture.png");
|
||||
private File fileLocation = new File("/awips2/export/" + System.getProperty("user.name") + "/screenCapture.png");
|
||||
|
||||
private ImageFormat imageFormat = ImageFormat.SEQUENCE;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue