Merge branch 'omaha_14.4.1' into field_14.4.1
Former-commit-id: 875c825320bdfb0e051b6d0ad2e530f7a7a16d19
This commit is contained in:
commit
86648e0a20
112 changed files with 8832 additions and 7907 deletions
|
@ -98,7 +98,9 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId;
|
|||
import com.raytheon.uf.viz.collaboration.ui.actions.AddNotifierAction;
|
||||
import com.raytheon.uf.viz.collaboration.ui.actions.AddToGroupAction;
|
||||
import com.raytheon.uf.viz.collaboration.ui.actions.ArchiveViewerAction;
|
||||
import com.raytheon.uf.viz.collaboration.ui.actions.ChangeBackgroundColorAction;
|
||||
import com.raytheon.uf.viz.collaboration.ui.actions.ChangeFontAction;
|
||||
import com.raytheon.uf.viz.collaboration.ui.actions.ChangeForegroundColorAction;
|
||||
import com.raytheon.uf.viz.collaboration.ui.actions.ChangePasswordAction;
|
||||
import com.raytheon.uf.viz.collaboration.ui.actions.ChangeRoleAction;
|
||||
import com.raytheon.uf.viz.collaboration.ui.actions.ChangeSiteAction;
|
||||
|
@ -160,6 +162,7 @@ import com.raytheon.viz.ui.views.CaveWorkbenchPageManager;
|
|||
* added static utility method to show view
|
||||
* May 19, 2014 3180 bclement fixed inviting multiple users to session
|
||||
* Oct 08, 2014 3705 bclement added room search and bookmarking
|
||||
* Oct 14, 2014 3709 mapeters Added change background/foreground color actions to menu.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -361,6 +364,9 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
mgr.add(roomSearchAction);
|
||||
mgr.add(new Separator());
|
||||
mgr.add(new ChangeFontAction());
|
||||
mgr.add(new ChangeForegroundColorAction());
|
||||
mgr.add(new ChangeBackgroundColorAction());
|
||||
mgr.add(new Separator());
|
||||
mgr.add(new ChangeStatusAction());
|
||||
mgr.add(new ChangeStatusMessageAction());
|
||||
mgr.add(new ChangePasswordAction());
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.viz.collaboration.ui.actions;
|
||||
|
||||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.swt.graphics.RGB;
|
||||
import org.eclipse.swt.widgets.ColorDialog;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
|
||||
import com.raytheon.uf.viz.collaboration.ui.Activator;
|
||||
import com.raytheon.uf.viz.collaboration.ui.actions.ChatDisplayChangeEvent.ChangeType;
|
||||
import com.raytheon.uf.viz.core.preferences.PreferenceConverter;
|
||||
|
||||
/**
|
||||
* Open change background color dialog
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 14, 2014 3709 mapeters Initial creation.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mapeters
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class ChangeBackgroundColorAction extends Action {
|
||||
|
||||
public ChangeBackgroundColorAction() {
|
||||
super("Change Background Color...");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
ColorDialog dialog = new ColorDialog(Display.getCurrent()
|
||||
.getActiveShell());
|
||||
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
|
||||
RGB data = PreferenceConverter.getRGB(store, "bg", "white");
|
||||
dialog.setRGB(data);
|
||||
RGB postData = dialog.open();
|
||||
CollaborationConnection connection = CollaborationConnection
|
||||
.getConnection();
|
||||
if (postData != null && connection != null) {
|
||||
PreferenceConverter.setValue(store, "bg", postData);
|
||||
connection.postEvent(ChatDisplayChangeEvent.createColorEvent(
|
||||
ChangeType.BACKGROUND, postData));
|
||||
}
|
||||
};
|
||||
}
|
|
@ -40,6 +40,7 @@ import com.raytheon.uf.viz.core.icon.IconUtil;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 6, 2012 bsteffen Initial creation
|
||||
* Oct 14, 2014 3709 mapeters Post event using {@link ChatDisplayChangeEvent}.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -66,7 +67,8 @@ public class ChangeFontAction extends Action {
|
|||
.getConnection();
|
||||
if (postData != null && connection != null) {
|
||||
PreferenceConverter.setValue(store, "font", postData);
|
||||
connection.postEvent(postData);
|
||||
connection.postEvent(ChatDisplayChangeEvent
|
||||
.createFontEvent(postData));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.viz.collaboration.ui.actions;
|
||||
|
||||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.swt.graphics.RGB;
|
||||
import org.eclipse.swt.widgets.ColorDialog;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
|
||||
import com.raytheon.uf.viz.collaboration.ui.Activator;
|
||||
import com.raytheon.uf.viz.collaboration.ui.actions.ChatDisplayChangeEvent.ChangeType;
|
||||
import com.raytheon.uf.viz.core.preferences.PreferenceConverter;
|
||||
|
||||
/**
|
||||
* Open change foreground color dialog
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 14, 2014 3709 mapeters Initial creation.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mapeters
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class ChangeForegroundColorAction extends Action {
|
||||
|
||||
public ChangeForegroundColorAction() {
|
||||
super("Change Foreground Color...");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
ColorDialog dialog = new ColorDialog(Display.getCurrent()
|
||||
.getActiveShell());
|
||||
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
|
||||
RGB data = PreferenceConverter.getRGB(store, "fg", "black");
|
||||
dialog.setRGB(data);
|
||||
RGB postData = dialog.open();
|
||||
CollaborationConnection connection = CollaborationConnection
|
||||
.getConnection();
|
||||
if (postData != null && connection != null) {
|
||||
PreferenceConverter.setValue(store, "fg", postData);
|
||||
connection.postEvent(ChatDisplayChangeEvent.createColorEvent(
|
||||
ChangeType.FOREGROUND, postData));
|
||||
}
|
||||
};
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.viz.collaboration.ui.actions;
|
||||
|
||||
import org.eclipse.swt.graphics.FontData;
|
||||
import org.eclipse.swt.graphics.RGB;
|
||||
|
||||
/**
|
||||
* Store font/color change information
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 14, 2014 3709 mapeters Initial creation.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mapeters
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class ChatDisplayChangeEvent {
|
||||
|
||||
private ChangeType type;
|
||||
|
||||
private RGB color;
|
||||
|
||||
private FontData font;
|
||||
|
||||
public enum ChangeType {
|
||||
BACKGROUND, FOREGROUND, FONT;
|
||||
}
|
||||
|
||||
private ChatDisplayChangeEvent(ChangeType type, RGB color) {
|
||||
this.type = type;
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
private ChatDisplayChangeEvent(ChangeType type, FontData font) {
|
||||
this.type = type;
|
||||
this.font = font;
|
||||
}
|
||||
|
||||
public static ChatDisplayChangeEvent createColorEvent(ChangeType type,
|
||||
RGB color) {
|
||||
return new ChatDisplayChangeEvent(type, color);
|
||||
}
|
||||
|
||||
public static ChatDisplayChangeEvent createFontEvent(FontData font) {
|
||||
return new ChatDisplayChangeEvent(ChangeType.FONT, font);
|
||||
}
|
||||
|
||||
public RGB getColor() {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
public ChangeType getChangeType() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
public FontData getFont() {
|
||||
return this.font;
|
||||
}
|
||||
}
|
|
@ -30,7 +30,7 @@ import java.util.TimeZone;
|
|||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.jface.action.IToolBarManager;
|
||||
import org.eclipse.jface.action.MenuManager;
|
||||
import org.eclipse.jface.preference.PreferenceConverter;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.resource.StringConverter;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.custom.SashForm;
|
||||
|
@ -61,6 +61,8 @@ import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationC
|
|||
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
|
||||
import com.raytheon.uf.viz.collaboration.ui.Activator;
|
||||
import com.raytheon.uf.viz.collaboration.ui.CollaborationUtils;
|
||||
import com.raytheon.uf.viz.collaboration.ui.actions.ChatDisplayChangeEvent;
|
||||
import com.raytheon.uf.viz.collaboration.ui.actions.ChatDisplayChangeEvent.ChangeType;
|
||||
import com.raytheon.uf.viz.collaboration.ui.actions.CopyTextAction;
|
||||
import com.raytheon.uf.viz.collaboration.ui.actions.CutTextAction;
|
||||
import com.raytheon.uf.viz.collaboration.ui.actions.PasteTextAction;
|
||||
|
@ -94,6 +96,7 @@ import com.raytheon.viz.ui.views.CaveFloatingView;
|
|||
* Jun 20, 2014 3281 bclement made sendErrorMessage() public
|
||||
* Jun 27, 2014 3323 bclement fixed disposed font issue
|
||||
* Oct 09, 2014 3711 mapeters Display chat text in accordance with preferences.
|
||||
* Oct 14, 2014 3709 mapeters Support changing foreground/background color.
|
||||
* </pre>
|
||||
*
|
||||
* @author rferrel
|
||||
|
@ -212,12 +215,24 @@ public abstract class AbstractSessionView<T extends IUser> extends
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
|
||||
// here need to grab the font from preferences and use that font
|
||||
messagesTextFont = new Font(Display.getCurrent(),
|
||||
PreferenceConverter.getFontData(Activator.getDefault()
|
||||
.getPreferenceStore(), "font"));
|
||||
org.eclipse.jface.preference.PreferenceConverter.getFontData(
|
||||
store, "font"));
|
||||
messagesText.setFont(messagesTextFont);
|
||||
|
||||
// grab the background color from preferences (default to white)
|
||||
RGB bgColor = com.raytheon.uf.viz.core.preferences.PreferenceConverter
|
||||
.getRGB(store, "bg", "white");
|
||||
messagesText.setBackground(new Color(Display.getCurrent(), bgColor));
|
||||
|
||||
// grab the foreground color from preferences (default to black)
|
||||
RGB fgColor = com.raytheon.uf.viz.core.preferences.PreferenceConverter
|
||||
.getRGB(store, "fg", "black");
|
||||
messagesText.setForeground(new Color(Display.getCurrent(), fgColor));
|
||||
|
||||
searchComp.setSearchText(messagesText);
|
||||
|
||||
// adding a menu item so that Paste can be found when clicking on the
|
||||
|
@ -576,15 +591,23 @@ public abstract class AbstractSessionView<T extends IUser> extends
|
|||
}
|
||||
|
||||
@Subscribe
|
||||
public void changeFont(FontData data) {
|
||||
Font oldFont = messagesTextFont;
|
||||
messagesTextFont = new Font(Display.getCurrent(), data);
|
||||
messagesText.setFont(messagesTextFont);
|
||||
if (oldFont != null) {
|
||||
oldFont.dispose();
|
||||
public void changeChatDisplay(ChatDisplayChangeEvent event) {
|
||||
ChangeType type = event.getChangeType();
|
||||
if (type == ChangeType.FOREGROUND) {
|
||||
messagesText.setForeground(new Color(Display.getCurrent(), event.getColor()));
|
||||
} else if (type == ChangeType.BACKGROUND) {
|
||||
messagesText.setBackground(new Color(Display.getCurrent(), event
|
||||
.getColor()));
|
||||
} else if (type == ChangeType.FONT) {
|
||||
Font oldFont = messagesTextFont;
|
||||
messagesTextFont = new Font(Display.getCurrent(), event.getFont());
|
||||
messagesText.setFont(messagesTextFont);
|
||||
if (oldFont != null) {
|
||||
oldFont.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void setAlertWords(List<AlertWord> words) {
|
||||
alertWords = words;
|
||||
}
|
||||
|
|
|
@ -84,6 +84,7 @@ import com.raytheon.uf.viz.core.maps.jobs.AbstractMapQueryJob;
|
|||
import com.raytheon.uf.viz.core.maps.jobs.AbstractMapRequest;
|
||||
import com.raytheon.uf.viz.core.maps.jobs.AbstractMapResult;
|
||||
import com.raytheon.uf.viz.core.maps.rsc.AbstractMapResource;
|
||||
import com.raytheon.uf.viz.core.preferences.PreferenceConverter;
|
||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||
import com.raytheon.uf.viz.core.rsc.RenderingOrderFactory;
|
||||
import com.raytheon.uf.viz.core.rsc.RenderingOrderFactory.ResourceOrder;
|
||||
|
@ -94,7 +95,6 @@ import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability;
|
|||
import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.ShadeableCapability;
|
||||
import com.raytheon.uf.viz.gisdatastore.Activator;
|
||||
import com.raytheon.uf.viz.gisdatastore.ui.PreferenceConverter;
|
||||
import com.raytheon.viz.core.rsc.jts.JTSCompiler;
|
||||
import com.raytheon.viz.core.rsc.jts.JTSCompiler.JTSGeometryData;
|
||||
import com.raytheon.viz.core.rsc.jts.JTSCompiler.PointStyle;
|
||||
|
|
|
@ -27,6 +27,7 @@ import org.eclipse.swt.widgets.ColorDialog;
|
|||
import org.eclipse.swt.widgets.Composite;
|
||||
|
||||
import com.raytheon.uf.viz.core.RGBColors;
|
||||
import com.raytheon.uf.viz.core.preferences.StringConverter;
|
||||
|
||||
/**
|
||||
* Preference field editor for selecting a color for the DataStoreResource
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.eclipse.swt.layout.GridData;
|
|||
import org.eclipse.swt.widgets.Composite;
|
||||
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
|
||||
import com.raytheon.uf.viz.core.preferences.StringConverter;
|
||||
|
||||
/**
|
||||
* Preference field editor for selecting a color for the DataStoreResource
|
||||
|
|
|
@ -24,6 +24,8 @@ import org.eclipse.swt.graphics.GC;
|
|||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
|
||||
import com.raytheon.uf.viz.core.preferences.StringConverter;
|
||||
|
||||
/**
|
||||
* Preference field editor for selecting a line width for DataStoreResource
|
||||
* highlight
|
||||
|
|
|
@ -29,6 +29,7 @@ import org.eclipse.swt.graphics.Rectangle;
|
|||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
|
||||
import com.raytheon.uf.viz.core.preferences.StringConverter;
|
||||
import com.raytheon.viz.ui.dialogs.SetOpacityDialog;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,201 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.viz.gisdatastore.ui;
|
||||
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.swt.graphics.RGB;
|
||||
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
|
||||
import com.raytheon.uf.viz.core.RGBColors;
|
||||
|
||||
/**
|
||||
* Utility for loading and saving GIS Viewer preferences
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 27, 2012 randerso Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author randerso
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class PreferenceConverter {
|
||||
private PreferenceConverter() {
|
||||
// unused, all methods are static
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an RGB color preference value. If no preference is stored,
|
||||
* defaultValue will be returned
|
||||
*
|
||||
* @param prefs
|
||||
* the preference store
|
||||
* @param key
|
||||
* the preference key
|
||||
* @param defaultValue
|
||||
* the default value
|
||||
* @return the RGB color
|
||||
*/
|
||||
public static RGB getRGB(IPreferenceStore prefs, String key,
|
||||
String defaultValue) {
|
||||
String value = prefs.getString(key);
|
||||
RGB newColor = StringConverter.asRGB(value);
|
||||
|
||||
if (newColor == null) {
|
||||
newColor = StringConverter.asRGB(defaultValue);
|
||||
}
|
||||
return newColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Store an RGB color preference value.
|
||||
*
|
||||
* @param prefs
|
||||
* the preference store
|
||||
* @param key
|
||||
* the preference key
|
||||
* @param color
|
||||
* the RGB color to be stored
|
||||
*/
|
||||
public static void setValue(IPreferenceStore prefs, String key, RGB color) {
|
||||
String value = RGBColors.getColorName(color);
|
||||
prefs.setValue(key, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a LineStyle value. If no preference is stored, defaultValue will be
|
||||
* returned
|
||||
*
|
||||
* @param prefs
|
||||
* the preference store
|
||||
* @param key
|
||||
* the preference key
|
||||
* @param defaultValue
|
||||
* the default value
|
||||
* @return the LineStyle
|
||||
*/
|
||||
public static LineStyle getLineStyle(IPreferenceStore prefs, String key,
|
||||
String defaultValue) {
|
||||
String value = prefs.getString(key);
|
||||
LineStyle style = StringConverter.asLineStyle(value);
|
||||
|
||||
if (style == null) {
|
||||
style = StringConverter.asLineStyle(defaultValue);
|
||||
}
|
||||
|
||||
return style;
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a LineStyle preference value.
|
||||
*
|
||||
* @param prefs
|
||||
* the preference store
|
||||
* @param key
|
||||
* the preference key
|
||||
* @param opacity
|
||||
* the LineStyle to be stored
|
||||
*/
|
||||
public static void setValue(IPreferenceStore prefs, String key,
|
||||
LineStyle style) {
|
||||
String value = style.name();
|
||||
prefs.setValue(key, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an integer preference value. If no preference is stored, defaultValue
|
||||
* will be returned
|
||||
*
|
||||
* @param prefs
|
||||
* the preference store
|
||||
* @param key
|
||||
* the preference key
|
||||
* @param defaultValue
|
||||
* the default value
|
||||
* @return the integer value
|
||||
*/
|
||||
public static int getInt(IPreferenceStore prefs, String key,
|
||||
String defaultValue) {
|
||||
String stringValue = prefs.getString(key);
|
||||
Integer value = StringConverter.asInteger(stringValue);
|
||||
if (value == null) {
|
||||
value = StringConverter.asInteger(defaultValue);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Store an integer preference value.
|
||||
*
|
||||
* @param prefs
|
||||
* the preference store
|
||||
* @param key
|
||||
* the preference key
|
||||
* @param value
|
||||
* the integer value to be stored
|
||||
*/
|
||||
public static void setValue(IPreferenceStore prefs, String key, int value) {
|
||||
String stringValue = StringConverter.asString(value);
|
||||
prefs.setValue(key, stringValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an float preference value. If no preference is stored, defaultValue
|
||||
* will be returned
|
||||
*
|
||||
* @param prefs
|
||||
* the preference store
|
||||
* @param key
|
||||
* the preference key
|
||||
* @param defaultValue
|
||||
* the default value
|
||||
* @return the float value
|
||||
*/
|
||||
public static float getFloat(IPreferenceStore prefs, String key,
|
||||
String defaultValue) {
|
||||
String stringValue = prefs.getString(key);
|
||||
Float value = StringConverter.asFloat(stringValue);
|
||||
if (value == null) {
|
||||
value = StringConverter.asFloat(defaultValue);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Store an float preference value.
|
||||
*
|
||||
* @param prefs
|
||||
* the preference store
|
||||
* @param key
|
||||
* the preference key
|
||||
* @param value
|
||||
* the float value to be stored
|
||||
*/
|
||||
public static void setValue(IPreferenceStore prefs, String key, float value) {
|
||||
String stringValue = StringConverter.asString(value);
|
||||
prefs.setValue(key, stringValue);
|
||||
}
|
||||
}
|
|
@ -1,163 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.viz.gisdatastore.ui;
|
||||
|
||||
import org.eclipse.swt.graphics.RGB;
|
||||
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
|
||||
import com.raytheon.uf.viz.core.RGBColors;
|
||||
|
||||
/**
|
||||
* Convert GIS Viewer preference types to/from strings
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 27, 2012 randerso Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author randerso
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class StringConverter {
|
||||
private StringConverter() {
|
||||
// unused, all methods are static
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert RGB color value to string
|
||||
*
|
||||
* @param color
|
||||
* RGB color value
|
||||
* @return string String value
|
||||
*/
|
||||
public static String asString(RGB color) {
|
||||
return RGBColors.getColorName(color);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert string to RGB color value
|
||||
*
|
||||
* @param string
|
||||
* String value
|
||||
* @return RGB color value or null if string is not a valid RGB color name
|
||||
* or hex value of the form "#rrggbb"
|
||||
*/
|
||||
public static RGB asRGB(String string) {
|
||||
RGB rgb = RGBColors.getRGBColor(string);
|
||||
return rgb;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert LineStyle value to string
|
||||
*
|
||||
* @param opacity
|
||||
* LineStyle value
|
||||
* @return string String value
|
||||
*/
|
||||
public static String asString(LineStyle style) {
|
||||
return style.name();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert string to LineStyle value
|
||||
*
|
||||
* @param string
|
||||
* String value
|
||||
* @return LineStyle value or null if string is not a valid LineStyle name
|
||||
*/
|
||||
public static LineStyle asLineStyle(String string) {
|
||||
LineStyle style = null;
|
||||
|
||||
try {
|
||||
style = LineStyle.valueOf(string);
|
||||
} catch (Exception e) {
|
||||
style = null;
|
||||
}
|
||||
|
||||
return style;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert integer value to string
|
||||
*
|
||||
* @param value
|
||||
* integer value
|
||||
* @return string String value
|
||||
*/
|
||||
public static String asString(int value) {
|
||||
return Integer.toString(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert string to Integer value
|
||||
*
|
||||
* @param string
|
||||
* String Value
|
||||
* @return Integer value or null if string is not a valid integer
|
||||
* representation
|
||||
*/
|
||||
public static Integer asInteger(String string) {
|
||||
Integer value = null;
|
||||
|
||||
try {
|
||||
value = Integer.parseInt(string);
|
||||
} catch (Exception e) {
|
||||
value = null;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert float value to string
|
||||
*
|
||||
* @param value
|
||||
* float value
|
||||
* @return string String value
|
||||
*/
|
||||
public static String asString(float value) {
|
||||
return Float.toString(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert string to Float value
|
||||
*
|
||||
* @param string
|
||||
* String Value
|
||||
* @return Float value or null if string is not a valid float representation
|
||||
*/
|
||||
public static Float asFloat(String string) {
|
||||
Float value = null;
|
||||
|
||||
try {
|
||||
value = Float.parseFloat(string);
|
||||
} catch (Exception e) {
|
||||
value = null;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
}
|
4
cave/com.raytheon.uf.viz.monitor.fog/src/com/raytheon/uf/viz/monitor/fog/FogMonitor.java
Executable file → Normal file
4
cave/com.raytheon.uf.viz.monitor.fog/src/com/raytheon/uf/viz/monitor/fog/FogMonitor.java
Executable file → Normal file
|
@ -89,6 +89,7 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
* Apr 28, 2014 3086 skorolev Removed local getMonitorAreaConfig method.
|
||||
* Sep 04, 2014 3220 skorolev Updated configUpdate method and added updateMonitoringArea.
|
||||
* Sep 23, 2014 3356 njensen Remove unnecessary import
|
||||
* Oct 16, 2014 3220 skorolev Corrected fogConfig assignment.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
|
@ -160,7 +161,7 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
|
|||
*/
|
||||
private FogMonitor() {
|
||||
pluginPatterns.add(fogPattern);
|
||||
fogConfig = new FSSObsMonitorConfigurationManager(MonName.fog.name());
|
||||
fogConfig = FSSObsMonitorConfigurationManager.getFogObsManager();
|
||||
updateMonitoringArea();
|
||||
initObserver(OBS, this);
|
||||
obData = new ObMultiHrsReports(CommonConfig.AppName.FOG);
|
||||
|
@ -650,5 +651,4 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
|
|||
}
|
||||
MonitoringArea.setPlatformMap(zones);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
22
cave/com.raytheon.uf.viz.monitor.fog/src/com/raytheon/uf/viz/monitor/fog/threshold/FogThresholdMgr.java
Executable file → Normal file
22
cave/com.raytheon.uf.viz.monitor.fog/src/com/raytheon/uf/viz/monitor/fog/threshold/FogThresholdMgr.java
Executable file → Normal file
|
@ -22,7 +22,6 @@ package com.raytheon.uf.viz.monitor.fog.threshold;
|
|||
import java.util.ArrayList;
|
||||
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
|
||||
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
|
||||
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
|
||||
import com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr;
|
||||
|
@ -42,6 +41,7 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.FogMonitor;
|
|||
* Feb 03, 2014 #2757 skorolev Fixed reInitialize()
|
||||
* May 20, 2014 3086 skorolev Cleaned code.
|
||||
* Sep 04, 2014 3220 skorolev Removed "site".
|
||||
* Oct 16, 2014 3220 skorolev Corrected areaConfigMgr assignment.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -61,8 +61,7 @@ public class FogThresholdMgr extends AbstractThresholdMgr {
|
|||
super("DefaultFogDisplayThresholds.xml",
|
||||
"DefaultFogMonitorThresholds.xml", AppName.FOG.name()
|
||||
.toLowerCase());
|
||||
areaConfigMgr = new FSSObsMonitorConfigurationManager(
|
||||
MonName.fog.name());
|
||||
areaConfigMgr = FSSObsMonitorConfigurationManager.getFogObsManager();
|
||||
init();
|
||||
}
|
||||
|
||||
|
@ -75,7 +74,6 @@ public class FogThresholdMgr extends AbstractThresholdMgr {
|
|||
if (classInstance == null) {
|
||||
classInstance = new FogThresholdMgr();
|
||||
}
|
||||
|
||||
return classInstance;
|
||||
}
|
||||
|
||||
|
@ -118,20 +116,4 @@ public class FogThresholdMgr extends AbstractThresholdMgr {
|
|||
}
|
||||
return threshKeys;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr#
|
||||
* getMonitorAreaConfigInstance()
|
||||
*/
|
||||
@Override
|
||||
protected FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance() {
|
||||
if (areaConfigMgr == null) {
|
||||
areaConfigMgr = new FSSObsMonitorConfigurationManager(
|
||||
MonName.fog.name());
|
||||
}
|
||||
return areaConfigMgr;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -48,6 +48,7 @@ import com.raytheon.uf.viz.monitor.xml.ThresholdsXML;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- -------------
|
||||
* May 21, 2014 3086 skorolev Cleaned code.
|
||||
* Oct 16, 2014 3220 skorolev Added condition to avoid NPE.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -178,22 +179,23 @@ public class FogMonitorMeteoTab extends TabItemComp implements
|
|||
ThresholdsXML threshXML = ftm.getThresholdsXmlData(duKey);
|
||||
|
||||
List<AreaXML> areasArray = threshXML.getAreas();
|
||||
if (areasArray != null) {
|
||||
for (AreaXML area : areasArray) {
|
||||
String areaID = area.getAreaId();
|
||||
FogMonitorMeteoData fmmd = new FogMonitorMeteoData();
|
||||
fmmd.setAreaID(areaID);
|
||||
|
||||
for (AreaXML area : areasArray) {
|
||||
String areaID = area.getAreaId();
|
||||
FogMonitorMeteoData fmmd = new FogMonitorMeteoData();
|
||||
fmmd.setAreaID(areaID);
|
||||
/*
|
||||
* Visibility
|
||||
*/
|
||||
String xmlKey = FogMonitor.FOG_MONITOR_METEO_VIS.getXmlKey();
|
||||
fmmd.setMeteoVisR(ftm.getThresholdValue(duKey, threshKeyR,
|
||||
areaID, xmlKey));
|
||||
fmmd.setMeteoVisY(ftm.getThresholdValue(duKey, threshKeyY,
|
||||
areaID, xmlKey));
|
||||
|
||||
/*
|
||||
* Visibility
|
||||
*/
|
||||
String xmlKey = FogMonitor.FOG_MONITOR_METEO_VIS.getXmlKey();
|
||||
fmmd.setMeteoVisR(ftm.getThresholdValue(duKey, threshKeyR, areaID,
|
||||
xmlKey));
|
||||
fmmd.setMeteoVisY(ftm.getThresholdValue(duKey, threshKeyY, areaID,
|
||||
xmlKey));
|
||||
|
||||
fogDataArray.add(fmmd);
|
||||
fogDataArray.add(fmmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
8
cave/com.raytheon.uf.viz.monitor.fog/src/com/raytheon/uf/viz/monitor/fog/ui/dialogs/FogMonitoringAreaConfigDlg.java
Executable file → Normal file
8
cave/com.raytheon.uf.viz.monitor.fog/src/com/raytheon/uf/viz/monitor/fog/ui/dialogs/FogMonitoringAreaConfigDlg.java
Executable file → Normal file
|
@ -24,7 +24,6 @@ import org.eclipse.swt.widgets.Display;
|
|||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
|
||||
import com.raytheon.uf.common.monitor.data.CommonConfig;
|
||||
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
|
||||
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
|
||||
|
@ -49,6 +48,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
* Apr 28, 2014 3086 skorolev Updated getConfigManager.
|
||||
* Sep 04, 2014 3220 skorolev Added fireConfigUpdateEvent method. Updated handler.
|
||||
* Sep 19, 2014 2757 skorolev Updated handlers for dialog buttons.
|
||||
* Oct 16, 2014 3220 skorolev Corrected getInstance() method.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
|
@ -150,11 +150,7 @@ public class FogMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
|||
*/
|
||||
@Override
|
||||
protected FSSObsMonitorConfigurationManager getInstance() {
|
||||
if (configMgr == null) {
|
||||
configMgr = new FSSObsMonitorConfigurationManager(
|
||||
MonName.fog.name());
|
||||
}
|
||||
return configMgr;
|
||||
return FSSObsMonitorConfigurationManager.getFogObsManager();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
18
cave/com.raytheon.uf.viz.monitor.fog/src/com/raytheon/uf/viz/monitor/fog/ui/dialogs/FogZoneTableDlg.java
Executable file → Normal file
18
cave/com.raytheon.uf.viz.monitor.fog/src/com/raytheon/uf/viz/monitor/fog/ui/dialogs/FogZoneTableDlg.java
Executable file → Normal file
|
@ -28,7 +28,6 @@ import org.eclipse.swt.widgets.Display;
|
|||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
|
||||
import com.raytheon.uf.common.monitor.data.CommonConfig;
|
||||
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
|
||||
import com.raytheon.uf.common.monitor.data.ObConst.DisplayVarName;
|
||||
|
@ -60,6 +59,7 @@ import com.raytheon.uf.viz.monitor.ui.dialogs.ZoneTableDlg;
|
|||
* Dec 7, 2012 1351 skorolev Changes for non-blocking dialogs.
|
||||
* Apr 28, 2014 3086 skorolev Updated getConfigMgr method.
|
||||
* Sep 04, 2014 3220 skorolev Removed "site". Added check on dispose.
|
||||
* Oct 16, 2014 3220 skorolev Corrected configMgr assignment.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -79,6 +79,7 @@ public class FogZoneTableDlg extends ZoneTableDlg {
|
|||
*/
|
||||
public FogZoneTableDlg(Shell parent, ObMultiHrsReports obData) {
|
||||
super(parent, obData, CommonConfig.AppName.FOG);
|
||||
configMgr = FSSObsMonitorConfigurationManager.getFogObsManager();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -294,19 +295,4 @@ public class FogZoneTableDlg extends ZoneTableDlg {
|
|||
protected void shellDisposeAction() {
|
||||
// Not used
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.uf.viz.monitor.ui.dialogs.ZoneTableDlg#
|
||||
* getMonitorAreaConfigInstance()
|
||||
*/
|
||||
@Override
|
||||
protected FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance() {
|
||||
if (configMgr == null || configMgr.isPopulated()) {
|
||||
configMgr = new FSSObsMonitorConfigurationManager(
|
||||
MonName.fog.name());
|
||||
}
|
||||
return configMgr;
|
||||
}
|
||||
}
|
||||
|
|
5
cave/com.raytheon.uf.viz.monitor.safeseas/src/com/raytheon/uf/viz/monitor/safeseas/SafeSeasMonitor.java
Executable file → Normal file
5
cave/com.raytheon.uf.viz.monitor.safeseas/src/com/raytheon/uf/viz/monitor/safeseas/SafeSeasMonitor.java
Executable file → Normal file
|
@ -37,7 +37,6 @@ import com.raytheon.uf.common.dataplugin.fog.FogRecord.FOG_THREAT;
|
|||
import com.raytheon.uf.common.geospatial.SpatialException;
|
||||
import com.raytheon.uf.common.monitor.MonitorAreaUtils;
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
|
||||
import com.raytheon.uf.common.monitor.data.AdjacentWfoMgr;
|
||||
import com.raytheon.uf.common.monitor.data.CommonConfig;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
|
@ -87,6 +86,7 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
* Feb 15, 2013 1638 mschenke Changed code to reference DataURI.SEPARATOR instead of URIFilter
|
||||
* Apr 28, 2014 3086 skorolev Removed local getMonitorAreaConfig method.
|
||||
* Sep 04, 2014 3220 skorolev Updated configUpdate method and added updateMonitoringArea.
|
||||
* Oct 16, 2014 3220 skorolev Corrected ssAreaConfig assignment.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -161,7 +161,7 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
|
|||
*/
|
||||
private SafeSeasMonitor() {
|
||||
pluginPatterns.add(ssPattern);
|
||||
ssAreaConfig = new FSSObsMonitorConfigurationManager(MonName.ss.name());
|
||||
ssAreaConfig = FSSObsMonitorConfigurationManager.getSsObsManager();
|
||||
updateMonitoringArea();
|
||||
initObserver(OBS, this);
|
||||
obData = new ObMultiHrsReports(CommonConfig.AppName.SAFESEAS);
|
||||
|
@ -685,5 +685,4 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
|
|||
}
|
||||
MonitoringArea.setPlatformMap(zones);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
19
cave/com.raytheon.uf.viz.monitor.safeseas/src/com/raytheon/uf/viz/monitor/safeseas/threshold/SSThresholdMgr.java
Executable file → Normal file
19
cave/com.raytheon.uf.viz.monitor.safeseas/src/com/raytheon/uf/viz/monitor/safeseas/threshold/SSThresholdMgr.java
Executable file → Normal file
|
@ -22,7 +22,6 @@ package com.raytheon.uf.viz.monitor.safeseas.threshold;
|
|||
import java.util.ArrayList;
|
||||
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
|
||||
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
|
||||
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
|
||||
import com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr;
|
||||
|
@ -42,6 +41,7 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.SafeSeasMonitor;
|
|||
* Feb 03, 2014 #2757 skorolev Fixed reInitialize().
|
||||
* Apr 28, 2014 3086 skorolev Removed local getMonitorAreaConfig method.
|
||||
* Sep 04, 2014 3220 skorolev Removed "site".
|
||||
* Oct 16, 2014 3220 skorolev Corrected areaConfigMgr assignment.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -59,7 +59,7 @@ public class SSThresholdMgr extends AbstractThresholdMgr {
|
|||
super("DefaultSSDisplayThresholds.xml",
|
||||
"DefaultSSMonitorThresholds.xml", AppName.SAFESEAS.name()
|
||||
.toLowerCase());
|
||||
areaConfigMgr = new FSSObsMonitorConfigurationManager(MonName.ss.name());
|
||||
areaConfigMgr = FSSObsMonitorConfigurationManager.getSsObsManager();
|
||||
init();
|
||||
}
|
||||
|
||||
|
@ -113,19 +113,4 @@ public class SSThresholdMgr extends AbstractThresholdMgr {
|
|||
}
|
||||
return threshKeys;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr#
|
||||
* getMonitorAreaConfigInstance()
|
||||
*/
|
||||
@Override
|
||||
protected FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance() {
|
||||
if (areaConfigMgr == null) {
|
||||
areaConfigMgr = new FSSObsMonitorConfigurationManager(
|
||||
MonName.ss.name());
|
||||
}
|
||||
return areaConfigMgr;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,305 +41,309 @@ import com.raytheon.uf.viz.monitor.xml.ThresholdsXML;
|
|||
* SAFESEAS Monitor Meteo Table.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 17, 2014 2757 skorolev Removed unnecessary printouts.
|
||||
*
|
||||
* Oct 16, 2014 3220 skorolev Added condition to avoid NPE.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @author skorolev
|
||||
* @version 1.0
|
||||
* @version 1.0
|
||||
*/
|
||||
public class SSMonitorMeteoTab extends TabItemComp implements IUpdateMonitorMeteo
|
||||
{
|
||||
public class SSMonitorMeteoTab extends TabItemComp implements
|
||||
IUpdateMonitorMeteo {
|
||||
private SSMonitorMeteoEditDlg monitorMeteoEditDlg;
|
||||
|
||||
|
||||
private ArrayList<String> areaIDArray;
|
||||
|
||||
|
||||
private ArrayList<SSMonitorMeteoData> ssDataArray;
|
||||
|
||||
public SSMonitorMeteoTab(TabFolder parent, DataUsageKey duKey)
|
||||
{
|
||||
|
||||
public SSMonitorMeteoTab(TabFolder parent, DataUsageKey duKey) {
|
||||
super(parent, duKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createListHeader(Composite parentComp)
|
||||
{
|
||||
@Override
|
||||
protected void createListHeader(Composite parentComp) {
|
||||
Composite lblComp = new Composite(parentComp, SWT.NONE);
|
||||
GridLayout gl = new GridLayout(5, false);
|
||||
gl.horizontalSpacing = 0;
|
||||
gl.horizontalSpacing = 0;
|
||||
gl.marginHeight = 0;
|
||||
gl.marginWidth = 0;
|
||||
lblComp.setLayout(gl);
|
||||
|
||||
|
||||
/*
|
||||
* Create filler label.
|
||||
*/
|
||||
GridData gd = new GridData(75, SWT.DEFAULT);
|
||||
Label fillerLbl = new Label(lblComp, SWT.CENTER);
|
||||
fillerLbl.setLayoutData(gd);
|
||||
|
||||
|
||||
/*
|
||||
* Meteo
|
||||
*/
|
||||
Composite meteoComp = createGroupComposite(lblComp, 5, null);
|
||||
createLabelComp(meteoComp, "Wind", "Speed(kt)", false);
|
||||
createLabelComp(meteoComp, "Peak", "Wind(kt)", false);
|
||||
Composite meteoComp = createGroupComposite(lblComp, 5, null);
|
||||
createLabelComp(meteoComp, "Wind", "Speed(kt)", false);
|
||||
createLabelComp(meteoComp, "Peak", "Wind(kt)", false);
|
||||
createLabelComp(meteoComp, "Gust", "Speed(kt)", false);
|
||||
createLabelComp(meteoComp, "Wave", "Height(ft)", false);
|
||||
createLabelComp(meteoComp, "Vis(mi)", "", true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void populateList()
|
||||
{
|
||||
if (ssDataArray == null)
|
||||
{
|
||||
protected void populateList() {
|
||||
if (ssDataArray == null) {
|
||||
createDataArray();
|
||||
}
|
||||
|
||||
|
||||
boolean update = false;
|
||||
if (dataList.getItemCount() > 0)
|
||||
{
|
||||
if (dataList.getItemCount() > 0) {
|
||||
update = true;
|
||||
}
|
||||
|
||||
|
||||
RangesUtil rangeUtil = RangesUtil.getInstance();
|
||||
|
||||
|
||||
areaIDArray = new ArrayList<String>();
|
||||
|
||||
|
||||
String tmpVisStr;
|
||||
String currentAreaID;
|
||||
|
||||
|
||||
double visVal = 0.0;
|
||||
|
||||
StringBuilder sb = null;
|
||||
|
||||
StringBuilder sb = null;
|
||||
SSMonitorMeteoData ssmmd = null;
|
||||
|
||||
for (int i = 0; i < ssDataArray.size(); i++)
|
||||
{
|
||||
|
||||
for (int i = 0; i < ssDataArray.size(); i++) {
|
||||
sb = new StringBuilder();
|
||||
|
||||
|
||||
ssmmd = ssDataArray.get(i);
|
||||
|
||||
|
||||
currentAreaID = ssmmd.getAreaID();
|
||||
areaIDArray.add(currentAreaID);
|
||||
|
||||
|
||||
sb.append(String.format(areaIdFmt, currentAreaID));
|
||||
|
||||
|
||||
/*
|
||||
* Wind Speed
|
||||
*/
|
||||
appendIntData(sb, ssmmd.getWindSpeedR(), ssmmd.getWindSpeedY());
|
||||
|
||||
|
||||
/*
|
||||
* Peak Wind
|
||||
*/
|
||||
appendIntData(sb, ssmmd.getPeakWindR(), ssmmd.getPeakWindY());
|
||||
|
||||
|
||||
/*
|
||||
* Gust Wind
|
||||
*/
|
||||
appendIntData(sb, ssmmd.getGustSpeedR(), ssmmd.getGustSpeedY());
|
||||
|
||||
|
||||
/*
|
||||
* Wave Height
|
||||
*/
|
||||
appendIntData(sb, ssmmd.getWaveHgtR(), ssmmd.getWaveHgtY());
|
||||
|
||||
|
||||
/*
|
||||
* Visibility
|
||||
*/
|
||||
visVal = ssmmd.getVisR();
|
||||
tmpVisStr = rangeUtil.getVisString((int)visVal);
|
||||
*/
|
||||
visVal = ssmmd.getVisR();
|
||||
tmpVisStr = rangeUtil.getVisString((int) visVal);
|
||||
sb.append(String.format(dataFmt, tmpVisStr));
|
||||
|
||||
visVal = ssmmd.getVisY();
|
||||
tmpVisStr = rangeUtil.getVisString((int)visVal);
|
||||
sb.append(String.format(dataFmt, tmpVisStr));
|
||||
|
||||
|
||||
visVal = ssmmd.getVisY();
|
||||
tmpVisStr = rangeUtil.getVisString((int) visVal);
|
||||
sb.append(String.format(dataFmt, tmpVisStr));
|
||||
|
||||
/*
|
||||
* Append a space and add the data line to the list.
|
||||
*/
|
||||
sb.append(" ");
|
||||
|
||||
if (update == true)
|
||||
{
|
||||
|
||||
if (update == true) {
|
||||
dataList.setItem(i, sb.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
dataList.add(sb.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
packListControls();
|
||||
}
|
||||
|
||||
private void createDataArray()
|
||||
{
|
||||
ssDataArray = new ArrayList<SSMonitorMeteoData>();
|
||||
|
||||
SSThresholdMgr sstm = SSThresholdMgr.getInstance();
|
||||
|
||||
String xmlKey;
|
||||
String areaID;
|
||||
|
||||
ThresholdsXML threshXML = sstm.getThresholdsXmlData(duKey);
|
||||
|
||||
ArrayList<AreaXML> areasArray = threshXML.getAreas();
|
||||
|
||||
for (AreaXML area : areasArray)
|
||||
{
|
||||
areaID = area.getAreaId();
|
||||
SSMonitorMeteoData ssmmd = new SSMonitorMeteoData();
|
||||
|
||||
ssmmd.setAreaID(areaID);
|
||||
|
||||
/*
|
||||
* Wind Speed
|
||||
*/
|
||||
xmlKey = SafeSeasMonitor.SS_MON_METEO_WIND_SPEED.getXmlKey();
|
||||
ssmmd.setWindSpeedR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
|
||||
ssmmd.setWindSpeedY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
|
||||
|
||||
/*
|
||||
* Peak Wind
|
||||
*/
|
||||
xmlKey = SafeSeasMonitor.SS_MON_METEO_PEAK_WIND.getXmlKey();
|
||||
ssmmd.setPeakWindR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
|
||||
ssmmd.setPeakWindY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
|
||||
|
||||
/*
|
||||
* Gust Speed
|
||||
*/
|
||||
xmlKey = SafeSeasMonitor.SS_MON_METEO_GUST_SPEED.getXmlKey();
|
||||
ssmmd.setGustSpeedR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
|
||||
ssmmd.setGustSpeedY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
|
||||
|
||||
/*
|
||||
* Wave Height
|
||||
*/
|
||||
xmlKey = SafeSeasMonitor.SS_MON_METEO_WAVE_HT.getXmlKey();
|
||||
ssmmd.setWaveHgtR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
|
||||
ssmmd.setWaveHgtY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
|
||||
|
||||
/*
|
||||
* Visibility
|
||||
*/
|
||||
xmlKey = SafeSeasMonitor.SS_MON_METEO_VIS.getXmlKey();
|
||||
ssmmd.setVisR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
|
||||
ssmmd.setVisY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
|
||||
|
||||
/*
|
||||
* Add data to array.
|
||||
*/
|
||||
ssDataArray.add(ssmmd);
|
||||
}
|
||||
}
|
||||
|
||||
private SSMonitorMeteoData getDataAtFirstSelection()
|
||||
{
|
||||
int index = dataList.getSelectionIndex();
|
||||
|
||||
return ssDataArray.get(index);
|
||||
}
|
||||
|
||||
private void updateDataArray(SSMonitorMeteoData ssmmd)
|
||||
{
|
||||
int[] dataListIndexes = dataList.getSelectionIndices();
|
||||
int currentIndex = 0;
|
||||
|
||||
for (int i = 0; i < dataListIndexes.length; i++)
|
||||
{
|
||||
currentIndex = dataListIndexes[i];
|
||||
|
||||
ssDataArray.get(currentIndex).updateData(ssmmd);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void commitDataToXML()
|
||||
{
|
||||
private void createDataArray() {
|
||||
ssDataArray = new ArrayList<SSMonitorMeteoData>();
|
||||
|
||||
SSThresholdMgr sstm = SSThresholdMgr.getInstance();
|
||||
|
||||
|
||||
String xmlKey;
|
||||
String areaID;
|
||||
|
||||
for (SSMonitorMeteoData ssmmd : ssDataArray)
|
||||
{
|
||||
|
||||
ThresholdsXML threshXML = sstm.getThresholdsXmlData(duKey);
|
||||
|
||||
ArrayList<AreaXML> areasArray = threshXML.getAreas();
|
||||
|
||||
if (areasArray != null) {
|
||||
for (AreaXML area : areasArray) {
|
||||
areaID = area.getAreaId();
|
||||
SSMonitorMeteoData ssmmd = new SSMonitorMeteoData();
|
||||
|
||||
ssmmd.setAreaID(areaID);
|
||||
|
||||
/*
|
||||
* Wind Speed
|
||||
*/
|
||||
xmlKey = SafeSeasMonitor.SS_MON_METEO_WIND_SPEED.getXmlKey();
|
||||
ssmmd.setWindSpeedR(sstm.getThresholdValue(duKey, threshKeyR,
|
||||
areaID, xmlKey));
|
||||
ssmmd.setWindSpeedY(sstm.getThresholdValue(duKey, threshKeyY,
|
||||
areaID, xmlKey));
|
||||
|
||||
/*
|
||||
* Peak Wind
|
||||
*/
|
||||
xmlKey = SafeSeasMonitor.SS_MON_METEO_PEAK_WIND.getXmlKey();
|
||||
ssmmd.setPeakWindR(sstm.getThresholdValue(duKey, threshKeyR,
|
||||
areaID, xmlKey));
|
||||
ssmmd.setPeakWindY(sstm.getThresholdValue(duKey, threshKeyY,
|
||||
areaID, xmlKey));
|
||||
|
||||
/*
|
||||
* Gust Speed
|
||||
*/
|
||||
xmlKey = SafeSeasMonitor.SS_MON_METEO_GUST_SPEED.getXmlKey();
|
||||
ssmmd.setGustSpeedR(sstm.getThresholdValue(duKey, threshKeyR,
|
||||
areaID, xmlKey));
|
||||
ssmmd.setGustSpeedY(sstm.getThresholdValue(duKey, threshKeyY,
|
||||
areaID, xmlKey));
|
||||
|
||||
/*
|
||||
* Wave Height
|
||||
*/
|
||||
xmlKey = SafeSeasMonitor.SS_MON_METEO_WAVE_HT.getXmlKey();
|
||||
ssmmd.setWaveHgtR(sstm.getThresholdValue(duKey, threshKeyR,
|
||||
areaID, xmlKey));
|
||||
ssmmd.setWaveHgtY(sstm.getThresholdValue(duKey, threshKeyY,
|
||||
areaID, xmlKey));
|
||||
|
||||
/*
|
||||
* Visibility
|
||||
*/
|
||||
xmlKey = SafeSeasMonitor.SS_MON_METEO_VIS.getXmlKey();
|
||||
ssmmd.setVisR(sstm.getThresholdValue(duKey, threshKeyR, areaID,
|
||||
xmlKey));
|
||||
ssmmd.setVisY(sstm.getThresholdValue(duKey, threshKeyY, areaID,
|
||||
xmlKey));
|
||||
|
||||
/*
|
||||
* Add data to array.
|
||||
*/
|
||||
ssDataArray.add(ssmmd);
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private SSMonitorMeteoData getDataAtFirstSelection() {
|
||||
int index = dataList.getSelectionIndex();
|
||||
|
||||
return ssDataArray.get(index);
|
||||
}
|
||||
|
||||
private void updateDataArray(SSMonitorMeteoData ssmmd) {
|
||||
int[] dataListIndexes = dataList.getSelectionIndices();
|
||||
int currentIndex = 0;
|
||||
|
||||
for (int i = 0; i < dataListIndexes.length; i++) {
|
||||
currentIndex = dataListIndexes[i];
|
||||
|
||||
ssDataArray.get(currentIndex).updateData(ssmmd);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void commitDataToXML() {
|
||||
SSThresholdMgr sstm = SSThresholdMgr.getInstance();
|
||||
|
||||
String xmlKey;
|
||||
String areaID;
|
||||
|
||||
for (SSMonitorMeteoData ssmmd : ssDataArray) {
|
||||
areaID = ssmmd.getAreaID();
|
||||
|
||||
|
||||
/*
|
||||
* Wind Speed
|
||||
*/
|
||||
xmlKey = SafeSeasMonitor.SS_MON_METEO_WIND_SPEED.getXmlKey();
|
||||
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, ssmmd.getWindSpeedR());
|
||||
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, ssmmd.getWindSpeedY());
|
||||
|
||||
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
|
||||
ssmmd.getWindSpeedR());
|
||||
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
|
||||
ssmmd.getWindSpeedY());
|
||||
|
||||
/*
|
||||
* Peak Wind
|
||||
*/
|
||||
xmlKey = SafeSeasMonitor.SS_MON_METEO_PEAK_WIND.getXmlKey();
|
||||
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, ssmmd.getPeakWindR());
|
||||
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, ssmmd.getPeakWindY());
|
||||
|
||||
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
|
||||
ssmmd.getPeakWindR());
|
||||
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
|
||||
ssmmd.getPeakWindY());
|
||||
|
||||
/*
|
||||
* Gust Speed
|
||||
*/
|
||||
xmlKey = SafeSeasMonitor.SS_MON_METEO_GUST_SPEED.getXmlKey();
|
||||
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, ssmmd.getGustSpeedR());
|
||||
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, ssmmd.getGustSpeedY());
|
||||
|
||||
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
|
||||
ssmmd.getGustSpeedR());
|
||||
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
|
||||
ssmmd.getGustSpeedY());
|
||||
|
||||
/*
|
||||
* Wave Height
|
||||
*/
|
||||
xmlKey = SafeSeasMonitor.SS_MON_METEO_WAVE_HT.getXmlKey();
|
||||
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, ssmmd.getWaveHgtR());
|
||||
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, ssmmd.getWaveHgtY());
|
||||
|
||||
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
|
||||
ssmmd.getWaveHgtR());
|
||||
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
|
||||
ssmmd.getWaveHgtY());
|
||||
|
||||
/*
|
||||
* Visibility
|
||||
*/
|
||||
xmlKey = SafeSeasMonitor.SS_MON_METEO_VIS.getXmlKey();
|
||||
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, ssmmd.getVisR());
|
||||
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, ssmmd.getVisY());
|
||||
}
|
||||
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
|
||||
ssmmd.getVisR());
|
||||
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
|
||||
ssmmd.getVisY());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reloadData()
|
||||
{
|
||||
public void reloadData() {
|
||||
dataList.removeAll();
|
||||
ssDataArray.clear();
|
||||
ssDataArray = null;
|
||||
|
||||
populateList();
|
||||
|
||||
populateList();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void editDataAction()
|
||||
{
|
||||
protected void editDataAction() {
|
||||
SSMonitorMeteoData ssmmd = getDataAtFirstSelection();
|
||||
|
||||
if (monitorMeteoEditDlg == null)
|
||||
{
|
||||
monitorMeteoEditDlg = new SSMonitorMeteoEditDlg(getParent().getShell(), ssmmd, this);
|
||||
|
||||
if (monitorMeteoEditDlg == null) {
|
||||
monitorMeteoEditDlg = new SSMonitorMeteoEditDlg(getParent()
|
||||
.getShell(), ssmmd, this);
|
||||
monitorMeteoEditDlg.open();
|
||||
monitorMeteoEditDlg = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void updateThresholdData(SSMonitorMeteoData ssmmd)
|
||||
{
|
||||
public void updateThresholdData(SSMonitorMeteoData ssmmd) {
|
||||
updateDataArray(ssmmd);
|
||||
populateList();
|
||||
populateList();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,312 +36,404 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.SafeSeasMonitor;
|
|||
import com.raytheon.uf.viz.monitor.xml.AreaXML;
|
||||
import com.raytheon.uf.viz.monitor.xml.ThresholdsXML;
|
||||
|
||||
public class SSMonitorSwellTab extends TabItemComp implements IUpdateDisplayMonitorSwell
|
||||
{
|
||||
/**
|
||||
* SAFESEAS Monitor Swell Table.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 16, 2014 3220 skorolev Added condition to avoid NPE.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author
|
||||
* @version 1.0
|
||||
*/
|
||||
public class SSMonitorSwellTab extends TabItemComp implements
|
||||
IUpdateDisplayMonitorSwell {
|
||||
private SSDispMonSwellEditDlg monitorSwellEditDlg;
|
||||
|
||||
|
||||
private ArrayList<String> areaIDArray;
|
||||
|
||||
|
||||
private ArrayList<SSDispMonSwellData> ssDataArray;
|
||||
|
||||
public SSMonitorSwellTab(TabFolder parent, DataUsageKey duKey)
|
||||
{
|
||||
|
||||
public SSMonitorSwellTab(TabFolder parent, DataUsageKey duKey) {
|
||||
super(parent, duKey, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createListHeader(Composite parentComp)
|
||||
{
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.monitor.ui.dialogs.TabItemComp#createListHeader(org
|
||||
* .eclipse.swt.widgets.Composite)
|
||||
*/
|
||||
@Override
|
||||
protected void createListHeader(Composite parentComp) {
|
||||
Composite lblComp = new Composite(parentComp, SWT.NONE);
|
||||
GridLayout gl = new GridLayout(5, false);
|
||||
gl.horizontalSpacing = 0;
|
||||
gl.horizontalSpacing = 0;
|
||||
gl.marginHeight = 0;
|
||||
gl.marginWidth = 0;
|
||||
lblComp.setLayout(gl);
|
||||
|
||||
|
||||
/*
|
||||
* Create filler label.
|
||||
*/
|
||||
GridData gd = new GridData(75, SWT.DEFAULT);
|
||||
Label fillerLbl = new Label(lblComp, SWT.CENTER);
|
||||
fillerLbl.setLayoutData(gd);
|
||||
|
||||
|
||||
/*
|
||||
* Primary Swell
|
||||
*/
|
||||
Composite priSwellComp = createGroupComposite(lblComp, 4, "Primary Swell");
|
||||
Composite priSwellComp = createGroupComposite(lblComp, 4,
|
||||
"Primary Swell");
|
||||
createLabelComp(priSwellComp, "Height(ft)", "", false);
|
||||
createLabelComp(priSwellComp, "Periods(s)", "", false);
|
||||
createLabelComp(priSwellComp, "Dir(deg)", "(from)", false);
|
||||
createLabelComp(priSwellComp, "Dir(deg)", "(to)", false);
|
||||
|
||||
createLabelComp(priSwellComp, "Dir(deg)", "(to)", false);
|
||||
|
||||
/*
|
||||
* Secondary Swell
|
||||
*/
|
||||
Composite secSwellComp = createGroupComposite(lblComp, 4, "Secondary Swell");
|
||||
Composite secSwellComp = createGroupComposite(lblComp, 4,
|
||||
"Secondary Swell");
|
||||
createLabelComp(secSwellComp, "Height(ft)", "", false);
|
||||
createLabelComp(secSwellComp, "Periods(s)", "", false);
|
||||
createLabelComp(secSwellComp, "Dir(deg)", "(from)", false);
|
||||
createLabelComp(secSwellComp, "Dir(deg)", "(to)", false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.uf.viz.monitor.ui.dialogs.TabItemComp#populateList()
|
||||
*/
|
||||
@Override
|
||||
protected void populateList()
|
||||
{
|
||||
if (ssDataArray == null)
|
||||
{
|
||||
protected void populateList() {
|
||||
if (ssDataArray == null) {
|
||||
createDataArray();
|
||||
}
|
||||
|
||||
|
||||
boolean update = false;
|
||||
if (dataList.getItemCount() > 0)
|
||||
{
|
||||
if (dataList.getItemCount() > 0) {
|
||||
update = true;
|
||||
}
|
||||
|
||||
|
||||
areaIDArray = new ArrayList<String>();
|
||||
|
||||
|
||||
String currentAreaID;
|
||||
|
||||
StringBuilder sb = null;
|
||||
|
||||
StringBuilder sb = null;
|
||||
SSDispMonSwellData sssd = null;
|
||||
|
||||
for (int i = 0; i < ssDataArray.size(); i++)
|
||||
{
|
||||
|
||||
for (int i = 0; i < ssDataArray.size(); i++) {
|
||||
sb = new StringBuilder();
|
||||
|
||||
|
||||
sssd = ssDataArray.get(i);
|
||||
|
||||
|
||||
currentAreaID = sssd.getAreaID();
|
||||
areaIDArray.add(currentAreaID);
|
||||
|
||||
sb.append(String.format(areaIdFmt, currentAreaID));
|
||||
|
||||
|
||||
sb.append(String.format(areaIdFmt, currentAreaID));
|
||||
|
||||
/*
|
||||
* Primary Swell
|
||||
*/
|
||||
appendIntData(sb, sssd.getPriSwellHeightR(), sssd.getPriSwellHeightY());
|
||||
|
||||
double higherThreshold = Math.max(sssd.getPriSwellPeriodR(), sssd.getPriSwellPeriodY());
|
||||
double lowerThreshold = Math.min(sssd.getPriSwellPeriodR(), sssd.getPriSwellPeriodY());
|
||||
if ( rankSwellPeriodHigh ) {
|
||||
sssd.setRankSwellPeriodHigh(true);
|
||||
sssd.setPriSwellPeriodR(higherThreshold);
|
||||
sssd.setPriSwellPeriodY(lowerThreshold);
|
||||
appendIntData(sb, sssd.getPriSwellHeightR(),
|
||||
sssd.getPriSwellHeightY());
|
||||
|
||||
double higherThreshold = Math.max(sssd.getPriSwellPeriodR(),
|
||||
sssd.getPriSwellPeriodY());
|
||||
double lowerThreshold = Math.min(sssd.getPriSwellPeriodR(),
|
||||
sssd.getPriSwellPeriodY());
|
||||
if (rankSwellPeriodHigh) {
|
||||
sssd.setRankSwellPeriodHigh(true);
|
||||
sssd.setPriSwellPeriodR(higherThreshold);
|
||||
sssd.setPriSwellPeriodY(lowerThreshold);
|
||||
} else {
|
||||
sssd.setRankSwellPeriodHigh(false);
|
||||
sssd.setPriSwellPeriodR(lowerThreshold);
|
||||
sssd.setPriSwellPeriodY(higherThreshold);
|
||||
sssd.setRankSwellPeriodHigh(false);
|
||||
sssd.setPriSwellPeriodR(lowerThreshold);
|
||||
sssd.setPriSwellPeriodY(higherThreshold);
|
||||
}
|
||||
appendIntData(sb, sssd.getPriSwellPeriodR(), sssd.getPriSwellPeriodY());
|
||||
|
||||
appendIntData(sb, sssd.getPriSwellDirFromR(), sssd.getPriSwellDirFromY());
|
||||
appendIntData(sb, sssd.getPriSwellDirToR(), sssd.getPriSwellDirToY());
|
||||
|
||||
appendIntData(sb, sssd.getPriSwellPeriodR(),
|
||||
sssd.getPriSwellPeriodY());
|
||||
|
||||
appendIntData(sb, sssd.getPriSwellDirFromR(),
|
||||
sssd.getPriSwellDirFromY());
|
||||
appendIntData(sb, sssd.getPriSwellDirToR(),
|
||||
sssd.getPriSwellDirToY());
|
||||
|
||||
/*
|
||||
* Secondary Swell
|
||||
*/
|
||||
appendIntData(sb, sssd.getSecSwellHeightR(), sssd.getSecSwellHeightY());
|
||||
|
||||
higherThreshold = Math.max(sssd.getSecSwellPeriodR(), sssd.getSecSwellPeriodY());
|
||||
lowerThreshold = Math.min(sssd.getSecSwellPeriodR(), sssd.getSecSwellPeriodY());
|
||||
if ( rankSwellPeriodHigh ) {
|
||||
//sssd.setRankSwellPeriodHigh(true);
|
||||
sssd.setSecSwellPeriodR(higherThreshold);
|
||||
sssd.setSecSwellPeriodY(lowerThreshold);
|
||||
appendIntData(sb, sssd.getSecSwellHeightR(),
|
||||
sssd.getSecSwellHeightY());
|
||||
|
||||
higherThreshold = Math.max(sssd.getSecSwellPeriodR(),
|
||||
sssd.getSecSwellPeriodY());
|
||||
lowerThreshold = Math.min(sssd.getSecSwellPeriodR(),
|
||||
sssd.getSecSwellPeriodY());
|
||||
if (rankSwellPeriodHigh) {
|
||||
// sssd.setRankSwellPeriodHigh(true);
|
||||
sssd.setSecSwellPeriodR(higherThreshold);
|
||||
sssd.setSecSwellPeriodY(lowerThreshold);
|
||||
} else {
|
||||
//sssd.setRankSwellPeriodHigh(false);
|
||||
sssd.setSecSwellPeriodR(lowerThreshold);
|
||||
sssd.setSecSwellPeriodY(higherThreshold);
|
||||
// sssd.setRankSwellPeriodHigh(false);
|
||||
sssd.setSecSwellPeriodR(lowerThreshold);
|
||||
sssd.setSecSwellPeriodY(higherThreshold);
|
||||
}
|
||||
appendIntData(sb, sssd.getSecSwellPeriodR(), sssd.getSecSwellPeriodY());
|
||||
|
||||
appendIntData(sb, sssd.getSecSwellDirFromR(), sssd.getSecSwellDirFromY());
|
||||
appendIntData(sb, sssd.getSecSwellDirToR(), sssd.getSecSwellDirToY());
|
||||
|
||||
appendIntData(sb, sssd.getSecSwellPeriodR(),
|
||||
sssd.getSecSwellPeriodY());
|
||||
|
||||
appendIntData(sb, sssd.getSecSwellDirFromR(),
|
||||
sssd.getSecSwellDirFromY());
|
||||
appendIntData(sb, sssd.getSecSwellDirToR(),
|
||||
sssd.getSecSwellDirToY());
|
||||
|
||||
/*
|
||||
* Append a space and add the data line to the list.
|
||||
*/
|
||||
sb.append(" ");
|
||||
|
||||
if (update == true)
|
||||
{
|
||||
|
||||
if (update == true) {
|
||||
dataList.setItem(i, sb.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
dataList.add(sb.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
packListControls();
|
||||
}
|
||||
|
||||
private void createDataArray()
|
||||
{
|
||||
ssDataArray = new ArrayList<SSDispMonSwellData>();
|
||||
|
||||
SSThresholdMgr sstm = SSThresholdMgr.getInstance();
|
||||
|
||||
String xmlKey;
|
||||
String areaID;
|
||||
|
||||
ThresholdsXML threshXML = sstm.getThresholdsXmlData(duKey);
|
||||
|
||||
ArrayList<AreaXML> areasArray = threshXML.getAreas();
|
||||
|
||||
for (AreaXML area : areasArray)
|
||||
{
|
||||
areaID = area.getAreaId();
|
||||
SSDispMonSwellData sssd = new SSDispMonSwellData();
|
||||
|
||||
sssd.setAreaID(areaID);
|
||||
|
||||
/*
|
||||
* Primary Swell
|
||||
*/
|
||||
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_HT.getXmlKey();
|
||||
sssd.setPriSwellHeightR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
|
||||
sssd.setPriSwellHeightY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
|
||||
|
||||
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_PD.getXmlKey();
|
||||
sssd.setPriSwellPeriodR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
|
||||
sssd.setPriSwellPeriodY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
|
||||
|
||||
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_DIR_FROM.getXmlKey();
|
||||
sssd.setPriSwellDirFromR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
|
||||
sssd.setPriSwellDirFromY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
|
||||
|
||||
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_DIR_TO.getXmlKey();
|
||||
sssd.setPriSwellDirToR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
|
||||
sssd.setPriSwellDirToY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
|
||||
|
||||
/*
|
||||
* Secondary Swell
|
||||
*/
|
||||
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_HT.getXmlKey();
|
||||
sssd.setSecSwellHeightR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
|
||||
sssd.setSecSwellHeightY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
|
||||
|
||||
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_PD.getXmlKey();
|
||||
sssd.setSecSwellPeriodR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
|
||||
sssd.setSecSwellPeriodY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
|
||||
|
||||
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_DIR_FROM.getXmlKey();
|
||||
sssd.setSecSwellDirFromR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
|
||||
sssd.setSecSwellDirFromY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
|
||||
|
||||
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_DIR_TO.getXmlKey();
|
||||
sssd.setSecSwellDirToR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
|
||||
sssd.setSecSwellDirToY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
|
||||
|
||||
/*
|
||||
* Add data to array.
|
||||
*/
|
||||
ssDataArray.add(sssd);
|
||||
}
|
||||
}
|
||||
|
||||
private SSDispMonSwellData getDataAtFirstSelection()
|
||||
{
|
||||
int index = dataList.getSelectionIndex();
|
||||
|
||||
return ssDataArray.get(index);
|
||||
}
|
||||
|
||||
private void updateDataArray(SSDispMonSwellData sssd)
|
||||
{
|
||||
int[] dataListIndexes = dataList.getSelectionIndices();
|
||||
int currentIndex = 0;
|
||||
|
||||
for (int i = 0; i < dataListIndexes.length; i++)
|
||||
{
|
||||
currentIndex = dataListIndexes[i];
|
||||
|
||||
ssDataArray.get(currentIndex).updateData(sssd);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void commitDataToXML()
|
||||
{
|
||||
/**
|
||||
* Create Data Array.
|
||||
*/
|
||||
private void createDataArray() {
|
||||
ssDataArray = new ArrayList<SSDispMonSwellData>();
|
||||
|
||||
SSThresholdMgr sstm = SSThresholdMgr.getInstance();
|
||||
|
||||
|
||||
String xmlKey;
|
||||
String areaID;
|
||||
|
||||
for (SSDispMonSwellData sssd : ssDataArray)
|
||||
{
|
||||
|
||||
ThresholdsXML threshXML = sstm.getThresholdsXmlData(duKey);
|
||||
|
||||
ArrayList<AreaXML> areasArray = threshXML.getAreas();
|
||||
|
||||
if (areasArray != null) {
|
||||
for (AreaXML area : areasArray) {
|
||||
areaID = area.getAreaId();
|
||||
SSDispMonSwellData sssd = new SSDispMonSwellData();
|
||||
|
||||
sssd.setAreaID(areaID);
|
||||
|
||||
/*
|
||||
* Primary Swell
|
||||
*/
|
||||
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_HT.getXmlKey();
|
||||
sssd.setPriSwellHeightR(sstm.getThresholdValue(duKey,
|
||||
threshKeyR, areaID, xmlKey));
|
||||
sssd.setPriSwellHeightY(sstm.getThresholdValue(duKey,
|
||||
threshKeyY, areaID, xmlKey));
|
||||
|
||||
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_PD.getXmlKey();
|
||||
sssd.setPriSwellPeriodR(sstm.getThresholdValue(duKey,
|
||||
threshKeyR, areaID, xmlKey));
|
||||
sssd.setPriSwellPeriodY(sstm.getThresholdValue(duKey,
|
||||
threshKeyY, areaID, xmlKey));
|
||||
|
||||
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_DIR_FROM.getXmlKey();
|
||||
sssd.setPriSwellDirFromR(sstm.getThresholdValue(duKey,
|
||||
threshKeyR, areaID, xmlKey));
|
||||
sssd.setPriSwellDirFromY(sstm.getThresholdValue(duKey,
|
||||
threshKeyY, areaID, xmlKey));
|
||||
|
||||
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_DIR_TO.getXmlKey();
|
||||
sssd.setPriSwellDirToR(sstm.getThresholdValue(duKey,
|
||||
threshKeyR, areaID, xmlKey));
|
||||
sssd.setPriSwellDirToY(sstm.getThresholdValue(duKey,
|
||||
threshKeyY, areaID, xmlKey));
|
||||
|
||||
/*
|
||||
* Secondary Swell
|
||||
*/
|
||||
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_HT.getXmlKey();
|
||||
sssd.setSecSwellHeightR(sstm.getThresholdValue(duKey,
|
||||
threshKeyR, areaID, xmlKey));
|
||||
sssd.setSecSwellHeightY(sstm.getThresholdValue(duKey,
|
||||
threshKeyY, areaID, xmlKey));
|
||||
|
||||
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_PD.getXmlKey();
|
||||
sssd.setSecSwellPeriodR(sstm.getThresholdValue(duKey,
|
||||
threshKeyR, areaID, xmlKey));
|
||||
sssd.setSecSwellPeriodY(sstm.getThresholdValue(duKey,
|
||||
threshKeyY, areaID, xmlKey));
|
||||
|
||||
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_DIR_FROM.getXmlKey();
|
||||
sssd.setSecSwellDirFromR(sstm.getThresholdValue(duKey,
|
||||
threshKeyR, areaID, xmlKey));
|
||||
sssd.setSecSwellDirFromY(sstm.getThresholdValue(duKey,
|
||||
threshKeyY, areaID, xmlKey));
|
||||
|
||||
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_DIR_TO.getXmlKey();
|
||||
sssd.setSecSwellDirToR(sstm.getThresholdValue(duKey,
|
||||
threshKeyR, areaID, xmlKey));
|
||||
sssd.setSecSwellDirToY(sstm.getThresholdValue(duKey,
|
||||
threshKeyY, areaID, xmlKey));
|
||||
|
||||
/*
|
||||
* Add data to array.
|
||||
*/
|
||||
ssDataArray.add(sssd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Data at first selection.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private SSDispMonSwellData getDataAtFirstSelection() {
|
||||
int index = dataList.getSelectionIndex();
|
||||
|
||||
return ssDataArray.get(index);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Data Array.
|
||||
*
|
||||
* @param sssd
|
||||
*/
|
||||
private void updateDataArray(SSDispMonSwellData sssd) {
|
||||
int[] dataListIndexes = dataList.getSelectionIndices();
|
||||
int currentIndex = 0;
|
||||
|
||||
for (int i = 0; i < dataListIndexes.length; i++) {
|
||||
currentIndex = dataListIndexes[i];
|
||||
|
||||
ssDataArray.get(currentIndex).updateData(sssd);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.uf.viz.monitor.ui.dialogs.TabItemComp#commitDataToXML()
|
||||
*/
|
||||
@Override
|
||||
public void commitDataToXML() {
|
||||
SSThresholdMgr sstm = SSThresholdMgr.getInstance();
|
||||
|
||||
String xmlKey;
|
||||
String areaID;
|
||||
|
||||
for (SSDispMonSwellData sssd : ssDataArray) {
|
||||
areaID = sssd.getAreaID();
|
||||
|
||||
|
||||
/*
|
||||
* Primary Swell
|
||||
*/
|
||||
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_HT.getXmlKey();
|
||||
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, sssd.getPriSwellHeightR());
|
||||
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, sssd.getPriSwellHeightY());
|
||||
|
||||
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
|
||||
sssd.getPriSwellHeightR());
|
||||
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
|
||||
sssd.getPriSwellHeightY());
|
||||
|
||||
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_PD.getXmlKey();
|
||||
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, sssd.getPriSwellPeriodR());
|
||||
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, sssd.getPriSwellPeriodY());
|
||||
|
||||
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
|
||||
sssd.getPriSwellPeriodR());
|
||||
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
|
||||
sssd.getPriSwellPeriodY());
|
||||
|
||||
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_DIR_FROM.getXmlKey();
|
||||
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, sssd.getPriSwellDirFromR());
|
||||
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, sssd.getPriSwellDirFromY());
|
||||
|
||||
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
|
||||
sssd.getPriSwellDirFromR());
|
||||
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
|
||||
sssd.getPriSwellDirFromY());
|
||||
|
||||
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_DIR_TO.getXmlKey();
|
||||
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, sssd.getPriSwellDirToR());
|
||||
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, sssd.getPriSwellDirToY());
|
||||
|
||||
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
|
||||
sssd.getPriSwellDirToR());
|
||||
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
|
||||
sssd.getPriSwellDirToY());
|
||||
|
||||
/*
|
||||
* Secondary Swell
|
||||
*/
|
||||
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_HT.getXmlKey();
|
||||
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, sssd.getSecSwellHeightR());
|
||||
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, sssd.getSecSwellHeightY());
|
||||
|
||||
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
|
||||
sssd.getSecSwellHeightR());
|
||||
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
|
||||
sssd.getSecSwellHeightY());
|
||||
|
||||
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_PD.getXmlKey();
|
||||
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, sssd.getSecSwellPeriodR());
|
||||
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, sssd.getSecSwellPeriodY());
|
||||
|
||||
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
|
||||
sssd.getSecSwellPeriodR());
|
||||
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
|
||||
sssd.getSecSwellPeriodY());
|
||||
|
||||
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_DIR_FROM.getXmlKey();
|
||||
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, sssd.getSecSwellDirFromR());
|
||||
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, sssd.getSecSwellDirFromY());
|
||||
|
||||
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
|
||||
sssd.getSecSwellDirFromR());
|
||||
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
|
||||
sssd.getSecSwellDirFromY());
|
||||
|
||||
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_DIR_TO.getXmlKey();
|
||||
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, sssd.getSecSwellDirToR());
|
||||
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, sssd.getSecSwellDirToY());
|
||||
}
|
||||
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
|
||||
sssd.getSecSwellDirToR());
|
||||
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
|
||||
sssd.getSecSwellDirToY());
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.uf.viz.monitor.ui.dialogs.TabItemComp#reloadData()
|
||||
*/
|
||||
@Override
|
||||
public void reloadData()
|
||||
{
|
||||
public void reloadData() {
|
||||
dataList.removeAll();
|
||||
ssDataArray.clear();
|
||||
ssDataArray = null;
|
||||
|
||||
populateList();
|
||||
|
||||
populateList();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.uf.viz.monitor.ui.dialogs.TabItemComp#editDataAction()
|
||||
*/
|
||||
@Override
|
||||
protected void editDataAction()
|
||||
{
|
||||
protected void editDataAction() {
|
||||
SSDispMonSwellData sssd = getDataAtFirstSelection();
|
||||
|
||||
if (monitorSwellEditDlg == null)
|
||||
{
|
||||
monitorSwellEditDlg = new SSDispMonSwellEditDlg(getParent().getShell(), sssd, this, false);
|
||||
|
||||
if (monitorSwellEditDlg == null) {
|
||||
monitorSwellEditDlg = new SSDispMonSwellEditDlg(getParent()
|
||||
.getShell(), sssd, this, false);
|
||||
monitorSwellEditDlg.open();
|
||||
monitorSwellEditDlg = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.monitor.safeseas.ui.dialogs.IUpdateDisplayMonitorSwell
|
||||
* #updateThresholdData(com.raytheon.uf.viz.monitor.safeseas.threshold.
|
||||
* SSDispMonSwellData)
|
||||
*/
|
||||
@Override
|
||||
public void updateThresholdData(SSDispMonSwellData sssd)
|
||||
{
|
||||
public void updateThresholdData(SSDispMonSwellData sssd) {
|
||||
updateDataArray(sssd);
|
||||
populateList();
|
||||
populateList();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
7
cave/com.raytheon.uf.viz.monitor.safeseas/src/com/raytheon/uf/viz/monitor/safeseas/ui/dialogs/SSMonitoringAreaConfigDlg.java
Executable file → Normal file
7
cave/com.raytheon.uf.viz.monitor.safeseas/src/com/raytheon/uf/viz/monitor/safeseas/ui/dialogs/SSMonitoringAreaConfigDlg.java
Executable file → Normal file
|
@ -24,7 +24,6 @@ import org.eclipse.swt.widgets.Display;
|
|||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
|
||||
import com.raytheon.uf.common.monitor.data.CommonConfig;
|
||||
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
|
||||
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
|
||||
|
@ -49,6 +48,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
* Apr 28, 2014 3086 skorolev Updated getConfigManager.
|
||||
* Sep 04, 2014 3220 skorolev Added fireConfigUpdateEvent method. Updated handler.
|
||||
* Sep 19, 2014 2757 skorolev Updated handlers for dialog buttons.
|
||||
* Oct 16, 2014 3220 skorolev Corrected getInstance() method.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
|
@ -142,10 +142,7 @@ public class SSMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
|||
*/
|
||||
@Override
|
||||
public FSSObsMonitorConfigurationManager getInstance() {
|
||||
if (configMgr == null) {
|
||||
configMgr = new FSSObsMonitorConfigurationManager(MonName.ss.name());
|
||||
}
|
||||
return configMgr;
|
||||
return FSSObsMonitorConfigurationManager.getSsObsManager();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
19
cave/com.raytheon.uf.viz.monitor.safeseas/src/com/raytheon/uf/viz/monitor/safeseas/ui/dialogs/SSZoneTableDlg.java
Executable file → Normal file
19
cave/com.raytheon.uf.viz.monitor.safeseas/src/com/raytheon/uf/viz/monitor/safeseas/ui/dialogs/SSZoneTableDlg.java
Executable file → Normal file
|
@ -29,7 +29,6 @@ import org.eclipse.swt.widgets.Shell;
|
|||
|
||||
import com.raytheon.uf.common.dataplugin.fog.FogRecord.FOG_THREAT;
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
|
||||
import com.raytheon.uf.common.monitor.data.CommonConfig;
|
||||
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
|
||||
import com.raytheon.uf.common.monitor.data.ObConst.DisplayVarName;
|
||||
|
@ -57,7 +56,8 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants;
|
|||
* Nov 10, 2012 1297 skorolev Added initiateProdArray
|
||||
* Dec 7, 2012 #1351 skorolev Changes for non-blocking dialogs.
|
||||
* Apr 28, 2014 3086 skorolev Updated getConfigMgr method.
|
||||
* Sep 04, 2014 3220 skorolev Removed "site". Added check on dispose.
|
||||
* Sep 04, 2014 3220 skorolev Removed "site". Added check on dispose.
|
||||
* Oct 16, 2014 3220 skorolev Corrected configMgr assignment.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -80,6 +80,7 @@ public class SSZoneTableDlg extends ZoneTableDlg {
|
|||
*/
|
||||
public SSZoneTableDlg(Shell parent, ObMultiHrsReports obData) {
|
||||
super(parent, obData, CommonConfig.AppName.SAFESEAS);
|
||||
configMgr = FSSObsMonitorConfigurationManager.getSsObsManager();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -319,18 +320,4 @@ public class SSZoneTableDlg extends ZoneTableDlg {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.uf.viz.monitor.ui.dialogs.ZoneTableDlg#
|
||||
* getMonitorAreaConfigInstance()
|
||||
*/
|
||||
@Override
|
||||
protected FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance() {
|
||||
if (configMgr == null || configMgr.isPopulated()) {
|
||||
configMgr = new FSSObsMonitorConfigurationManager(MonName.ss.name());
|
||||
}
|
||||
return configMgr;
|
||||
}
|
||||
}
|
||||
|
|
4
cave/com.raytheon.uf.viz.monitor.snow/src/com/raytheon/uf/viz/monitor/snow/SnowMonitor.java
Executable file → Normal file
4
cave/com.raytheon.uf.viz.monitor.snow/src/com/raytheon/uf/viz/monitor/snow/SnowMonitor.java
Executable file → Normal file
|
@ -31,7 +31,6 @@ import org.eclipse.swt.widgets.Shell;
|
|||
|
||||
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
|
||||
import com.raytheon.uf.common.monitor.data.CommonConfig;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
|
@ -74,6 +73,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
* Feb 15, 2013 1638 mschenke Changed code to reference DataURI.SEPARATOR instead of URIFilter
|
||||
* Apr 28, 2014 3086 skorolev Removed local getMonitorAreaConfig method.
|
||||
* Sep 04, 2014 3220 skorolev Updated configUpdate method and added updateMonitoringArea.
|
||||
* Oct 16, 2014 3220 skorolev Corrected snowConfig assignment.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -128,7 +128,7 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
|
|||
*/
|
||||
private SnowMonitor() {
|
||||
pluginPatterns.add(snowPattern);
|
||||
snowConfig = new FSSObsMonitorConfigurationManager(MonName.snow.name());
|
||||
snowConfig = FSSObsMonitorConfigurationManager.getSnowObsManager();
|
||||
updateMonitoringArea();
|
||||
initObserver(OBS, this);
|
||||
obData = new ObMultiHrsReports(CommonConfig.AppName.SNOW);
|
||||
|
|
21
cave/com.raytheon.uf.viz.monitor.snow/src/com/raytheon/uf/viz/monitor/snow/threshold/SnowThresholdMgr.java
Executable file → Normal file
21
cave/com.raytheon.uf.viz.monitor.snow/src/com/raytheon/uf/viz/monitor/snow/threshold/SnowThresholdMgr.java
Executable file → Normal file
|
@ -22,7 +22,6 @@ package com.raytheon.uf.viz.monitor.snow.threshold;
|
|||
import java.util.ArrayList;
|
||||
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
|
||||
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
|
||||
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
|
||||
import com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr;
|
||||
|
@ -42,6 +41,7 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.SnowMonitor;
|
|||
* Feb 03, 2014 #2757 skorolev Fixed reInitialize()
|
||||
* May 21, 2014 3086 skorolev Cleaned code.
|
||||
* Sep 04, 2014 3220 skorolev Removed "site".
|
||||
* Oct 16, 2014 3220 skorolev Corrected areaConfigMgr assignment.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -58,9 +58,7 @@ public class SnowThresholdMgr extends AbstractThresholdMgr {
|
|||
super("DefaultSnowDisplayThresholds.xml",
|
||||
"DefaultSnowMonitorThresholds.xml", AppName.SNOW.name()
|
||||
.toLowerCase());
|
||||
|
||||
areaConfigMgr = new FSSObsMonitorConfigurationManager(
|
||||
MonName.snow.name());
|
||||
areaConfigMgr = FSSObsMonitorConfigurationManager.getSnowObsManager();
|
||||
init();
|
||||
}
|
||||
|
||||
|
@ -114,19 +112,4 @@ public class SnowThresholdMgr extends AbstractThresholdMgr {
|
|||
}
|
||||
return threshKeys;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr#
|
||||
* getMonitorAreaConfigInstance()
|
||||
*/
|
||||
@Override
|
||||
protected FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance() {
|
||||
if (areaConfigMgr == null) {
|
||||
areaConfigMgr = new FSSObsMonitorConfigurationManager(
|
||||
MonName.snow.name());
|
||||
}
|
||||
return areaConfigMgr;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,6 +48,7 @@ import com.raytheon.uf.viz.monitor.xml.ThresholdsXML;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* May 21, 2014 3086 skorolev Cleaned code.
|
||||
* Oct 16, 2014 3220 skorolev Added condition to avoid NPE.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -213,84 +214,86 @@ public class SnowDisplayMeteoTab extends TabItemComp implements
|
|||
|
||||
List<AreaXML> areasArray = threshXML.getAreas();
|
||||
|
||||
for (AreaXML area : areasArray) {
|
||||
areaID = area.getAreaId();
|
||||
SnowDisplayMeteoData sdmd = new SnowDisplayMeteoData();
|
||||
if (areasArray != null) {
|
||||
for (AreaXML area : areasArray) {
|
||||
areaID = area.getAreaId();
|
||||
SnowDisplayMeteoData sdmd = new SnowDisplayMeteoData();
|
||||
|
||||
sdmd.setAreaID(areaID);
|
||||
sdmd.setAreaID(areaID);
|
||||
|
||||
/* Tempature */
|
||||
xmlKey = SnowDisplay.SNOW_DISP_METEO_TEMP.getXmlKey();
|
||||
sdmd.setTempR(stm.getThresholdValue(duKey, threshKeyR, areaID,
|
||||
xmlKey));
|
||||
sdmd.setTempY(stm.getThresholdValue(duKey, threshKeyY, areaID,
|
||||
xmlKey));
|
||||
/* Tempature */
|
||||
xmlKey = SnowDisplay.SNOW_DISP_METEO_TEMP.getXmlKey();
|
||||
sdmd.setTempR(stm.getThresholdValue(duKey, threshKeyR, areaID,
|
||||
xmlKey));
|
||||
sdmd.setTempY(stm.getThresholdValue(duKey, threshKeyY, areaID,
|
||||
xmlKey));
|
||||
|
||||
/* Dew point */
|
||||
xmlKey = SnowDisplay.SNOW_DISP_METEO_DEWPT.getXmlKey();
|
||||
sdmd.setDewpointR(stm.getThresholdValue(duKey, threshKeyR, areaID,
|
||||
xmlKey));
|
||||
sdmd.setDewpointY(stm.getThresholdValue(duKey, threshKeyY, areaID,
|
||||
xmlKey));
|
||||
/* Dew point */
|
||||
xmlKey = SnowDisplay.SNOW_DISP_METEO_DEWPT.getXmlKey();
|
||||
sdmd.setDewpointR(stm.getThresholdValue(duKey, threshKeyR,
|
||||
areaID, xmlKey));
|
||||
sdmd.setDewpointY(stm.getThresholdValue(duKey, threshKeyY,
|
||||
areaID, xmlKey));
|
||||
|
||||
/* Visibility */
|
||||
xmlKey = SnowDisplay.SNOW_DISP_METEO_VIS.getXmlKey();
|
||||
sdmd.setVisR(stm.getThresholdValue(duKey, threshKeyR, areaID,
|
||||
xmlKey));
|
||||
sdmd.setVisY(stm.getThresholdValue(duKey, threshKeyY, areaID,
|
||||
xmlKey));
|
||||
/* Visibility */
|
||||
xmlKey = SnowDisplay.SNOW_DISP_METEO_VIS.getXmlKey();
|
||||
sdmd.setVisR(stm.getThresholdValue(duKey, threshKeyR, areaID,
|
||||
xmlKey));
|
||||
sdmd.setVisY(stm.getThresholdValue(duKey, threshKeyY, areaID,
|
||||
xmlKey));
|
||||
|
||||
/* SLP */
|
||||
xmlKey = SnowDisplay.SNOW_DISP_METEO_SLP.getXmlKey();
|
||||
sdmd.setSlpR(stm.getThresholdValue(duKey, threshKeyR, areaID,
|
||||
xmlKey));
|
||||
sdmd.setSlpY(stm.getThresholdValue(duKey, threshKeyY, areaID,
|
||||
xmlKey));
|
||||
/* SLP */
|
||||
xmlKey = SnowDisplay.SNOW_DISP_METEO_SLP.getXmlKey();
|
||||
sdmd.setSlpR(stm.getThresholdValue(duKey, threshKeyR, areaID,
|
||||
xmlKey));
|
||||
sdmd.setSlpY(stm.getThresholdValue(duKey, threshKeyY, areaID,
|
||||
xmlKey));
|
||||
|
||||
/* Hourly Precipitation */
|
||||
xmlKey = SnowDisplay.SNOW_DISP_METEO_HOURLY_PRECIP.getXmlKey();
|
||||
sdmd.setHrPrecipR(stm.getThresholdValue(duKey, threshKeyR, areaID,
|
||||
xmlKey));
|
||||
sdmd.setHrPrecipY(stm.getThresholdValue(duKey, threshKeyY, areaID,
|
||||
xmlKey));
|
||||
/* Hourly Precipitation */
|
||||
xmlKey = SnowDisplay.SNOW_DISP_METEO_HOURLY_PRECIP.getXmlKey();
|
||||
sdmd.setHrPrecipR(stm.getThresholdValue(duKey, threshKeyR,
|
||||
areaID, xmlKey));
|
||||
sdmd.setHrPrecipY(stm.getThresholdValue(duKey, threshKeyY,
|
||||
areaID, xmlKey));
|
||||
|
||||
/* Wind Chill */
|
||||
xmlKey = SnowDisplay.SNOW_DISP_METEO_WIND_CHILL.getXmlKey();
|
||||
sdmd.setWindChillR(stm.getThresholdValue(duKey, threshKeyR, areaID,
|
||||
xmlKey));
|
||||
sdmd.setWindChillY(stm.getThresholdValue(duKey, threshKeyY, areaID,
|
||||
xmlKey));
|
||||
/* Wind Chill */
|
||||
xmlKey = SnowDisplay.SNOW_DISP_METEO_WIND_CHILL.getXmlKey();
|
||||
sdmd.setWindChillR(stm.getThresholdValue(duKey, threshKeyR,
|
||||
areaID, xmlKey));
|
||||
sdmd.setWindChillY(stm.getThresholdValue(duKey, threshKeyY,
|
||||
areaID, xmlKey));
|
||||
|
||||
/* Frost Bite */
|
||||
xmlKey = SnowDisplay.SNOW_DISP_METEO_FROSTBITE.getXmlKey();
|
||||
sdmd.setFrostBiteR(stm.getThresholdValue(duKey, threshKeyR, areaID,
|
||||
xmlKey));
|
||||
sdmd.setFrostBiteY(stm.getThresholdValue(duKey, threshKeyY, areaID,
|
||||
xmlKey));
|
||||
/* Frost Bite */
|
||||
xmlKey = SnowDisplay.SNOW_DISP_METEO_FROSTBITE.getXmlKey();
|
||||
sdmd.setFrostBiteR(stm.getThresholdValue(duKey, threshKeyR,
|
||||
areaID, xmlKey));
|
||||
sdmd.setFrostBiteY(stm.getThresholdValue(duKey, threshKeyY,
|
||||
areaID, xmlKey));
|
||||
|
||||
/* Snow Depth */
|
||||
xmlKey = SnowDisplay.SNOW_DISP_METEO_SNOW_DEPTH.getXmlKey();
|
||||
sdmd.setSnowDepthR(stm.getThresholdValue(duKey, threshKeyR, areaID,
|
||||
xmlKey));
|
||||
sdmd.setSnowDepthY(stm.getThresholdValue(duKey, threshKeyY, areaID,
|
||||
xmlKey));
|
||||
/* Snow Depth */
|
||||
xmlKey = SnowDisplay.SNOW_DISP_METEO_SNOW_DEPTH.getXmlKey();
|
||||
sdmd.setSnowDepthR(stm.getThresholdValue(duKey, threshKeyR,
|
||||
areaID, xmlKey));
|
||||
sdmd.setSnowDepthY(stm.getThresholdValue(duKey, threshKeyY,
|
||||
areaID, xmlKey));
|
||||
|
||||
/* SNINCR Hourly */
|
||||
xmlKey = SnowDisplay.SNOW_DISP_METEO_SNINCR_HOURLY.getXmlKey();
|
||||
sdmd.setSnincrHrlyR(stm.getThresholdValue(duKey, threshKeyR,
|
||||
areaID, xmlKey));
|
||||
sdmd.setSnincrHrlyY(stm.getThresholdValue(duKey, threshKeyY,
|
||||
areaID, xmlKey));
|
||||
/* SNINCR Hourly */
|
||||
xmlKey = SnowDisplay.SNOW_DISP_METEO_SNINCR_HOURLY.getXmlKey();
|
||||
sdmd.setSnincrHrlyR(stm.getThresholdValue(duKey, threshKeyR,
|
||||
areaID, xmlKey));
|
||||
sdmd.setSnincrHrlyY(stm.getThresholdValue(duKey, threshKeyY,
|
||||
areaID, xmlKey));
|
||||
|
||||
/* SNINCR Total */
|
||||
xmlKey = SnowDisplay.SNOW_DISP_METEO_SNINCR_TOTAL.getXmlKey();
|
||||
sdmd.setSnincrTotR(stm.getThresholdValue(duKey, threshKeyR, areaID,
|
||||
xmlKey));
|
||||
sdmd.setSnincrTotY(stm.getThresholdValue(duKey, threshKeyY, areaID,
|
||||
xmlKey));
|
||||
/* SNINCR Total */
|
||||
xmlKey = SnowDisplay.SNOW_DISP_METEO_SNINCR_TOTAL.getXmlKey();
|
||||
sdmd.setSnincrTotR(stm.getThresholdValue(duKey, threshKeyR,
|
||||
areaID, xmlKey));
|
||||
sdmd.setSnincrTotY(stm.getThresholdValue(duKey, threshKeyY,
|
||||
areaID, xmlKey));
|
||||
|
||||
/* Add data to array. */
|
||||
snowDataArray.add(sdmd);
|
||||
/* Add data to array. */
|
||||
snowDataArray.add(sdmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
9
cave/com.raytheon.uf.viz.monitor.snow/src/com/raytheon/uf/viz/monitor/snow/ui/dialogs/SnowMonitoringAreaConfigDlg.java
Executable file → Normal file
9
cave/com.raytheon.uf.viz.monitor.snow/src/com/raytheon/uf/viz/monitor/snow/ui/dialogs/SnowMonitoringAreaConfigDlg.java
Executable file → Normal file
|
@ -24,7 +24,6 @@ import org.eclipse.swt.widgets.Display;
|
|||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
|
||||
import com.raytheon.uf.common.monitor.data.CommonConfig;
|
||||
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
|
||||
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
|
||||
|
@ -49,6 +48,8 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
* Apr 28, 2014 3086 skorolev Updated snowConfigManager.
|
||||
* Sep 04, 2014 3220 skorolev Added fireConfigUpdateEvent method. Updated handler.
|
||||
* Sep 19, 2014 2757 skorolev Updated handlers for dialog buttons.
|
||||
* Oct 16, 2014 3220 skorolev Corrected getInstance() method.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mpduff
|
||||
|
@ -134,11 +135,7 @@ public class SnowMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
|||
*/
|
||||
@Override
|
||||
protected FSSObsMonitorConfigurationManager getInstance() {
|
||||
if (configMgr == null) {
|
||||
configMgr = new FSSObsMonitorConfigurationManager(
|
||||
MonName.snow.name());
|
||||
}
|
||||
return configMgr;
|
||||
return FSSObsMonitorConfigurationManager.getSnowObsManager();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
17
cave/com.raytheon.uf.viz.monitor.snow/src/com/raytheon/uf/viz/monitor/snow/ui/dialogs/SnowZoneTableDlg.java
Executable file → Normal file
17
cave/com.raytheon.uf.viz.monitor.snow/src/com/raytheon/uf/viz/monitor/snow/ui/dialogs/SnowZoneTableDlg.java
Executable file → Normal file
|
@ -26,7 +26,6 @@ import java.util.List;
|
|||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
|
||||
import com.raytheon.uf.common.monitor.data.CommonConfig;
|
||||
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
|
||||
import com.raytheon.uf.common.monitor.data.ObConst.DisplayVarName;
|
||||
|
@ -55,6 +54,7 @@ import com.raytheon.uf.viz.monitor.ui.dialogs.ZoneTableDlg;
|
|||
* Dec 7, 2012 1351 skorolev Changes for non-blocking dialogs
|
||||
* Apr 28, 2014 3086 skorolev Updated getConfigMgr method.
|
||||
* Sep 04, 2014 3220 skorolev Removed "site". Added check on dispose.
|
||||
* Oct 16, 2014 3220 skorolev Corrected configMgr assignment.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -75,6 +75,7 @@ public class SnowZoneTableDlg extends ZoneTableDlg {
|
|||
*/
|
||||
public SnowZoneTableDlg(Shell parent, ObMultiHrsReports obData) {
|
||||
super(parent, obData, CommonConfig.AppName.SNOW);
|
||||
configMgr = FSSObsMonitorConfigurationManager.getSnowObsManager();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -256,18 +257,4 @@ public class SnowZoneTableDlg extends ZoneTableDlg {
|
|||
protected void shellDisposeAction() {
|
||||
// Not used
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.uf.viz.monitor.ui.dialogs.ZoneTableDlg#getInstance()
|
||||
*/
|
||||
@Override
|
||||
protected FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance() {
|
||||
if (configMgr == null || configMgr.isPopulated()) {
|
||||
configMgr = new FSSObsMonitorConfigurationManager(
|
||||
MonName.snow.name());
|
||||
}
|
||||
return configMgr;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,6 +33,9 @@ import com.raytheon.uf.common.localization.PathManagerFactory;
|
|||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.data.ObConst;
|
||||
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||
import com.raytheon.uf.viz.monitor.config.CommonTableConfig.CellType;
|
||||
import com.raytheon.uf.viz.monitor.filename.DefaultFilenameMgr;
|
||||
|
@ -53,6 +56,7 @@ import com.raytheon.uf.viz.monitor.xml.ThresholdsXML;
|
|||
* Mar 22, 2010 #4282 zhao obtain zone IDs from monitoring-area-config-manager
|
||||
* Feb 16, 2011 #7346 zhao added getDirectionalThresholdValueCellType(...)
|
||||
* Apr 28, 2014 3086 skorolev Updated getAreaConfigMgr method.
|
||||
* Oct 17, 2014 3220 skorolev Replaced System.out.print with debug statusHandler.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -61,6 +65,9 @@ import com.raytheon.uf.viz.monitor.xml.ThresholdsXML;
|
|||
*/
|
||||
public abstract class AbstractThresholdMgr {
|
||||
|
||||
private final IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(AbstractThresholdMgr.class);
|
||||
|
||||
/**
|
||||
* Monitor Area Configuration Manager.
|
||||
*/
|
||||
|
@ -134,7 +141,6 @@ public abstract class AbstractThresholdMgr {
|
|||
this.defMonitorThreshName = defMonitorThreshName;
|
||||
this.appName = appName;
|
||||
this.site = LocalizationManager.getInstance().getCurrentSite();
|
||||
this.areaConfigMgr = getMonitorAreaConfigInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -201,7 +207,7 @@ public abstract class AbstractThresholdMgr {
|
|||
LocalizationFile locFile = pm.getLocalizationFile(context,
|
||||
pathAndFileName);
|
||||
|
||||
System.out.println("--- validate path = "
|
||||
statusHandler.handle(Priority.DEBUG, "--- validate path = "
|
||||
+ locFile.getFile().getAbsolutePath());
|
||||
|
||||
return locFile.getFile().exists();
|
||||
|
@ -526,7 +532,8 @@ public abstract class AbstractThresholdMgr {
|
|||
|
||||
ArrayList<String> threshKeys = getThresholdKeys(DataUsageKey.DISPLAY);
|
||||
|
||||
System.out.println("---- " + currFullDisplayXmlFileName);
|
||||
statusHandler.handle(Priority.DEBUG, "---- "
|
||||
+ currFullDisplayXmlFileName);
|
||||
|
||||
displayThreshMgr.createConfigFromDefaults(
|
||||
currFullDisplayXmlFileName, areaIDs, threshKeys);
|
||||
|
@ -764,14 +771,17 @@ public abstract class AbstractThresholdMgr {
|
|||
ArrayList<AreaXML> areasArray = displayXML.getAreas();
|
||||
|
||||
for (AreaXML area : areasArray) {
|
||||
System.out.println("--- " + area.getAreaId());
|
||||
statusHandler.handle(Priority.DEBUG, "--- " + area.getAreaId());
|
||||
|
||||
ArrayList<AreaThresholdXML> atXmlArray = area.getAreaThresholds();
|
||||
|
||||
for (AreaThresholdXML atXml : atXmlArray) {
|
||||
System.out.println("****** " + atXml.getKey());
|
||||
System.out.println(" R " + atXml.getRed());
|
||||
System.out.println(" Y " + atXml.getYellow());
|
||||
statusHandler.handle(Priority.DEBUG,
|
||||
"****** " + atXml.getKey());
|
||||
statusHandler.handle(Priority.DEBUG,
|
||||
" R " + atXml.getRed());
|
||||
statusHandler.handle(Priority.DEBUG,
|
||||
" Y " + atXml.getYellow());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -784,23 +794,18 @@ public abstract class AbstractThresholdMgr {
|
|||
ArrayList<AreaXML> areasArray = threshXmlCopy.getAreas();
|
||||
|
||||
for (AreaXML area : areasArray) {
|
||||
System.out.println("--- " + area.getAreaId());
|
||||
statusHandler.handle(Priority.DEBUG, "--- " + area.getAreaId());
|
||||
|
||||
ArrayList<AreaThresholdXML> atXmlArray = area.getAreaThresholds();
|
||||
|
||||
for (AreaThresholdXML atXml : atXmlArray) {
|
||||
System.out.println("****** " + atXml.getKey());
|
||||
System.out.println(" R " + atXml.getRed());
|
||||
System.out.println(" Y " + atXml.getYellow());
|
||||
statusHandler.handle(Priority.DEBUG,
|
||||
"****** " + atXml.getKey());
|
||||
statusHandler.handle(Priority.DEBUG,
|
||||
" R " + atXml.getRed());
|
||||
statusHandler.handle(Priority.DEBUG,
|
||||
" Y " + atXml.getYellow());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Monitor Area Configuration manager.
|
||||
*
|
||||
* @return manager
|
||||
*/
|
||||
protected abstract FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance();
|
||||
|
||||
}
|
||||
|
|
|
@ -50,6 +50,7 @@ import com.raytheon.uf.viz.monitor.xml.ThresholdsXML;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Dec 15, 2009 #3963 lvenable Initial creation
|
||||
* Dec 4, 2012 #1351 skorolev Cleaned code
|
||||
* Oct 16, 2014 #3220 skorolev Added error message when Default threshold configuration file is corrupted or empty.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -145,7 +146,11 @@ public class ThresholdMgr {
|
|||
ThresholdsXML.class);
|
||||
createXmlFromDefaults(cfgXmlDefaults, areaIDs, keys);
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.ERROR, e.getMessage());
|
||||
statusHandler
|
||||
.handle(Priority.ERROR,
|
||||
"Default threshold configuration file "
|
||||
+ fullDefaultPathName
|
||||
+ " is corrupted.\nDelete the files in the folder on the server side and restart CAVE.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
20
cave/com.raytheon.uf.viz.monitor/src/com/raytheon/uf/viz/monitor/ui/dialogs/ZoneTableDlg.java
Executable file → Normal file
20
cave/com.raytheon.uf.viz.monitor/src/com/raytheon/uf/viz/monitor/ui/dialogs/ZoneTableDlg.java
Executable file → Normal file
|
@ -89,6 +89,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
* May 13, 2014 3133 njensen Updated getting ObsHistType from configMgr
|
||||
* May 15, 2014 3086 skorolev Replaced MonitorConfigurationManager with FSSObsMonitorConfigurationManager.
|
||||
* Sep 15, 2014 3220 skorolev Added refreshZoneTableData method.
|
||||
* Oct 17, 2014 3220 skorolev Added condition into launchTrendPlot to avoid NPE.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -736,10 +737,14 @@ public abstract class ZoneTableDlg extends CaveSWTDialog implements
|
|||
}
|
||||
// Set dialog index
|
||||
String dialogID = appName.name() + station;
|
||||
String strHistType = getMonitorAreaConfigInstance().getStationType(
|
||||
selectedZone, station);
|
||||
ObsHistType histType = ObsHistType.valueOf(strHistType);
|
||||
|
||||
ObsHistType histType = null;
|
||||
if (configMgr != null) {
|
||||
String strHistType = configMgr
|
||||
.getStationType(selectedZone, station);
|
||||
histType = ObsHistType.valueOf(strHistType);
|
||||
}
|
||||
if (histType == null)
|
||||
return;
|
||||
/**
|
||||
* For Snow monitor, no history table is displayed for a Maritime
|
||||
* station
|
||||
|
@ -953,13 +958,6 @@ public abstract class ZoneTableDlg extends CaveSWTDialog implements
|
|||
return varName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Configuration manager.
|
||||
*
|
||||
* @return manager
|
||||
*/
|
||||
protected abstract FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance();
|
||||
|
||||
/**
|
||||
* Refreshes Zone Table.
|
||||
*
|
||||
|
|
|
@ -88,6 +88,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* Jul 10, 2012 #875 rferrel Initial creation
|
||||
* Dec 05, 2012 #1364 rferrel Replace File.Separator with IPathManager.SEPARATOR
|
||||
* to work correctly on all platforms.
|
||||
* Oct 20, 2014 #3418 dlovely Fixed a possible NPE in loadPoint.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -658,12 +659,6 @@ public class PointsDataManager implements ILocalizationFileObserver {
|
|||
try {
|
||||
point = unmarshalPointFromXmlFile(lFile);
|
||||
} catch (IOException ex) {
|
||||
StringBuffer sb = new StringBuffer(lFile.toString());
|
||||
sb.replace(0, pointsDir.toString().length(), "");
|
||||
int index = sb.lastIndexOf(IPathManager.SEPARATOR);
|
||||
sb.setLength(index);
|
||||
point.setGroup(sb.toString());
|
||||
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Unable to open localized file: " + lFile, ex);
|
||||
} catch (LocalizationException e) {
|
||||
|
|
|
@ -21,6 +21,7 @@ package com.raytheon.viz.radar.ui.xy;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.EnumMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
@ -49,6 +50,7 @@ import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
|
|||
import com.raytheon.uf.viz.core.rsc.capabilities.ImagingCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability;
|
||||
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||
import com.raytheon.uf.viz.points.data.Point;
|
||||
import com.raytheon.uf.viz.xy.map.rsc.IInsetMapResource;
|
||||
import com.raytheon.viz.awipstools.capabilities.RangeRingsOverlayCapability;
|
||||
import com.raytheon.viz.core.graphing.GraphProperties;
|
||||
|
@ -68,9 +70,9 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 16, 2009 askripsk Initial creation
|
||||
* 10-21-09 #1711 bsteffen Updated Baseline and Points to use new ToolsDataManager
|
||||
*
|
||||
* Mar 16, 2009 askripsk Initial creation
|
||||
* 10-21-09 #1711 bsteffen Updated Baseline and Points to use new ToolsDataManager
|
||||
* Oct 20, 2014 #3418 dlovely Fixed an NPE with the Points now showing on the inset map.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -274,16 +276,9 @@ public class RadarGraphResource extends
|
|||
}
|
||||
}
|
||||
|
||||
String selectedPoint = this.resourceData.getPointID();
|
||||
|
||||
// Default to Point A if somehow the point wasn't set
|
||||
if ("".equals(selectedPoint)) {
|
||||
selectedPoint = "A";
|
||||
}
|
||||
|
||||
// Find the packet that is closest to the selected point
|
||||
CellTrendDataPacket packet = getNearestCell(selectedPoint,
|
||||
radarRecord.getSymbologyData());
|
||||
CellTrendDataPacket packet = getNearestCell(
|
||||
getResourcePointID(), radarRecord.getSymbologyData());
|
||||
|
||||
// get the data for each trend code
|
||||
for (Integer trendCode : packet.getLatestScans().keySet()) {
|
||||
|
@ -484,27 +479,54 @@ public class RadarGraphResource extends
|
|||
return sortedTimes;
|
||||
}
|
||||
|
||||
/** This should happen on initialization and cache it maybe */
|
||||
private Coordinate getMapCoordinate() {
|
||||
RadarRecord record = getRadarRecord(displayedDate);
|
||||
if (record == null) {
|
||||
return null;
|
||||
/**
|
||||
* Returns the Point ID for the local Radar Resource Data. The Point ID is
|
||||
* verified and if not found a default Point is used.
|
||||
*
|
||||
* @return String Point ID
|
||||
*/
|
||||
private String getResourcePointID() {
|
||||
String selectedPoint = this.resourceData.getPointID();
|
||||
PointsDataManager manager = PointsDataManager.getInstance();
|
||||
Collection<String> names = manager.getPointNames();
|
||||
|
||||
if (!names.contains(selectedPoint)) {
|
||||
if (names.contains("A")) {
|
||||
selectedPoint = "A";
|
||||
} else {
|
||||
selectedPoint = (String) names.toArray()[0];
|
||||
}
|
||||
}
|
||||
return new Coordinate(record.getLongitude(), record.getLatitude(), 0.0);
|
||||
|
||||
return selectedPoint;
|
||||
}
|
||||
|
||||
// This should happen on initialization and cache it maybe
|
||||
/**
|
||||
* Returns the coordinate for the currently referenced {@link Point}.
|
||||
*
|
||||
* @return Coordinate
|
||||
*/
|
||||
private Coordinate getMapCoordinate() {
|
||||
Point pt = PointsDataManager.getInstance().getPoint(
|
||||
getResourcePointID());
|
||||
return new Coordinate(pt.getLongitude(), pt.getLatitude(), 0.0);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public Geometry getInsetMapLocation() {
|
||||
return IInsetMapResource.factory.createPoint(getMapCoordinate());
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void paintInsetMap(IGraphicsTarget target,
|
||||
PaintProperties paintProps, MapDescriptor insetMapDescriptor)
|
||||
throws VizException {
|
||||
Coordinate latLon = getMapCoordinate();
|
||||
double[] pixels = descriptor.worldToPixel(new double[] { latLon.x,
|
||||
latLon.y });
|
||||
double[] pixels = insetMapDescriptor.worldToPixel(new double[] {
|
||||
latLon.x, latLon.y });
|
||||
target.drawPoint(pixels[0], pixels[1], 0.0,
|
||||
getCapability(ColorableCapability.class).getColor(), style);
|
||||
}
|
||||
|
|
|
@ -122,6 +122,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* May 06, 2014 njensen Improve error message
|
||||
* Jun 12, 2014 3238 bsteffen Implement Interrogatable
|
||||
* Aug 21, 2014 DR 17313 jgerth Set no data value if no data mapping
|
||||
* Oct 15, 2014 3681 bsteffen create renderable in interrogate if necessary.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -606,7 +607,12 @@ public class SatResource extends
|
|||
public InterrogateMap interrogate(ReferencedCoordinate coordinate,
|
||||
DataTime time, InterrogationKey<?>... keys) {
|
||||
InterrogateMap result = new InterrogateMap();
|
||||
SatRenderable renderable = (SatRenderable) getRenderable(time);
|
||||
SatRenderable renderable = null;
|
||||
try {
|
||||
renderable = (SatRenderable) getOrCreateRenderable(time);
|
||||
} catch (VizException e) {
|
||||
statusHandler.error("Unable to interrogate " + getSafeName(), e);
|
||||
}
|
||||
if (renderable == null) {
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -19,23 +19,38 @@
|
|||
**/
|
||||
package com.raytheon.viz.satellite.tileset;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.lang.ref.Reference;
|
||||
import java.lang.ref.SoftReference;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import javax.measure.unit.Unit;
|
||||
import javax.measure.unit.UnitFormat;
|
||||
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.geotools.coverage.grid.GeneralGridEnvelope;
|
||||
import org.geotools.coverage.grid.GridGeometry2D;
|
||||
import org.opengis.coverage.grid.GridEnvelope;
|
||||
import org.opengis.referencing.operation.TransformException;
|
||||
|
||||
import com.raytheon.uf.common.colormap.image.ColorMapData;
|
||||
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
|
||||
import com.raytheon.uf.common.dataplugin.satellite.SatelliteRecord;
|
||||
import com.raytheon.uf.common.geospatial.data.GeographicDataSource;
|
||||
import com.raytheon.uf.common.numeric.buffer.BufferWrapper;
|
||||
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||
import com.raytheon.uf.viz.core.DrawableImage;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||
import com.raytheon.uf.viz.core.VizApp;
|
||||
import com.raytheon.uf.viz.core.drawables.IColormappedImage;
|
||||
import com.raytheon.uf.viz.core.drawables.IImage;
|
||||
import com.raytheon.uf.viz.core.drawables.IImage.Status;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||
import com.raytheon.uf.viz.core.tile.RecordTileSetRenderable;
|
||||
import com.raytheon.uf.viz.core.tile.Tile;
|
||||
import com.raytheon.uf.viz.core.tile.TileLevel;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
* Satellite tile set renderable, uses {@link SatDataRetriever} for {@link Tile}
|
||||
|
@ -50,6 +65,7 @@ import com.raytheon.uf.viz.core.tile.TileLevel;
|
|||
* Jun 19, 2013 mschenke Initial creation
|
||||
* Jun 19, 2014 3238 bsteffen Add method to create a DataSource for
|
||||
* a tile level.
|
||||
* Oct 15, 2014 3681 bsteffen Allow asynchronous interrogation.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -61,6 +77,15 @@ public class SatTileSetRenderable extends RecordTileSetRenderable {
|
|||
|
||||
private final AbstractVizResource<?, ?> resource;
|
||||
|
||||
/**
|
||||
* Provides a temporary cache of data so that if multiple interrogations
|
||||
* and/or rendering will not retrieve data that has been recently used. The
|
||||
* references in this map that have been cleared are ignored since the
|
||||
* maximum size is limited to the number of tiles which should be fairly
|
||||
* reasonable.
|
||||
*/
|
||||
private final Map<Tile, Reference<ColorMapData>> dataCache = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
* Create satellite tile set renderable
|
||||
*
|
||||
|
@ -78,8 +103,19 @@ public class SatTileSetRenderable extends RecordTileSetRenderable {
|
|||
|
||||
@Override
|
||||
protected ColorMapData retrieveRecordData(Tile tile) {
|
||||
return new SatDataRetriever((SatelliteRecord) record, tile.tileLevel,
|
||||
tile.getRectangle()).getColorMapData();
|
||||
Reference<ColorMapData> dataRef = dataCache.get(tile);
|
||||
ColorMapData data = null;
|
||||
if (dataRef != null) {
|
||||
data = dataRef.get();
|
||||
}
|
||||
if (data == null) {
|
||||
data = new SatDataRetriever((SatelliteRecord) record,
|
||||
tile.tileLevel, tile.getRectangle()).getColorMapData();
|
||||
}
|
||||
if (data != null) {
|
||||
dataCache.put(tile, new SoftReference<ColorMapData>(data));
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -92,6 +128,11 @@ public class SatTileSetRenderable extends RecordTileSetRenderable {
|
|||
return (SatelliteRecord) record;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a {@link GeographicDataSource} that can be used for interrogating
|
||||
* any point on the renderable for the most recently painted tile
|
||||
* level.
|
||||
*/
|
||||
public GeographicDataSource getCurrentLevelDataSource() {
|
||||
TileLevel level = tileSet.getTileLevel(lastPaintedLevel);
|
||||
DataSource tile = new TileLevelDataSource(level);
|
||||
|
@ -113,6 +154,122 @@ public class SatTileSetRenderable extends RecordTileSetRenderable {
|
|||
return new GeographicDataSource(tile, levelGeometry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double interrogate(Coordinate coordinate, Unit<?> resultUnit)
|
||||
throws VizException {
|
||||
ColorMapParameters parameters = colormapping.getColorMapParameters();
|
||||
/*
|
||||
* RecordTileSetRenderable is nearly identical but it calls
|
||||
* super.interrogate here which ignores the override of that specific
|
||||
* interrogate method so we must override this method to ensure this
|
||||
* classes interrogate methods are used.
|
||||
*/
|
||||
return interrogate(coordinate, resultUnit, parameters.getNoDataValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public double interrogate(Coordinate coordinate, Unit<?> resultUnit,
|
||||
double nanValue) throws VizException {
|
||||
/* Overriden to provide accurate results asynchronously */
|
||||
TileLevel level = tileSet.getTileLevel(lastPaintedLevel);
|
||||
|
||||
double[] grid = null;
|
||||
try {
|
||||
double[] local = new double[2];
|
||||
llToLocalProj
|
||||
.transform(new double[] { coordinate.x, coordinate.y }, 0,
|
||||
local, 0, 1);
|
||||
grid = level.crsToGrid(local[0], local[1]);
|
||||
} catch (TransformException e) {
|
||||
throw new VizException("Error interrogating ", e);
|
||||
}
|
||||
|
||||
return getDataValue(level, grid[0], grid[1], resultUnit, nanValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a single data value for a specific 2d index. This method will load
|
||||
* data from the image if it is calle don the appropriate thread and the
|
||||
* image has data. Otherwise it requests the data from the datastore(with
|
||||
* some caching).
|
||||
*
|
||||
* @param level
|
||||
* the level to get the data for.
|
||||
* @param x
|
||||
* the x index in the level.
|
||||
* @param y
|
||||
* the y index in the level
|
||||
* @param resultUnit
|
||||
* the unit the data should be in.
|
||||
* @param nanValue
|
||||
* a special value that will return nan.
|
||||
* @return a data value in the specified unit.
|
||||
*/
|
||||
protected double getDataValue(TileLevel level, double x, double y,
|
||||
Unit<?> resultUnit, double nanValue) {
|
||||
double dataValue = Double.NaN;
|
||||
IColormappedImage cmapImage = null;
|
||||
Tile tile = level.getTile(x, y);
|
||||
/**
|
||||
* If we are not on the UI thread then do not use the image for the data
|
||||
* value.
|
||||
*/
|
||||
if (tile != null && Display.getCurrent() != null) {
|
||||
DrawableImage di = imageMap.get(tile);
|
||||
if (di != null) {
|
||||
IImage image = di.getImage();
|
||||
if (image instanceof IColormappedImage) {
|
||||
cmapImage = (IColormappedImage) image;
|
||||
}
|
||||
}
|
||||
}
|
||||
int tilex = (int) x % tileSize;
|
||||
int tiley = (int) y % tileSize;
|
||||
Unit<?> dataUnit = null;
|
||||
/**
|
||||
* In some implementations of IColormappedImage NaN is returned if the
|
||||
* data is not loaded. So for those cases fall back to retrieving the
|
||||
* tile.
|
||||
*/
|
||||
if (cmapImage != null && (cmapImage.getStatus() == Status.STAGED || cmapImage.getStatus() == Status.LOADED)) {
|
||||
dataValue = cmapImage.getValue(tilex, tiley);
|
||||
if (dataValue == nanValue) {
|
||||
dataValue = Double.NaN;
|
||||
} else {
|
||||
ColorMapParameters parameters = cmapImage
|
||||
.getColorMapParameters();
|
||||
dataUnit = cmapImage.getDataUnit();
|
||||
if (parameters.getDataMapping() != null) {
|
||||
dataUnit = parameters.getColorMapUnit();
|
||||
}
|
||||
}
|
||||
} else if (tile != null) {
|
||||
ColorMapData data = retrieveRecordData(tile);
|
||||
Rectangle rect = tile.getRectangle();
|
||||
DataSource source = BufferWrapper.wrap(data.getBuffer(),
|
||||
rect.width, rect.height);
|
||||
dataValue = source.getDataValue(tilex, tiley);
|
||||
dataUnit = data.getDataUnit();
|
||||
}
|
||||
|
||||
/** Reconcile any unit discrepencies. */
|
||||
if (resultUnit != null && dataUnit != null
|
||||
&& dataUnit.equals(resultUnit) == false) {
|
||||
if (resultUnit.isCompatible(dataUnit)) {
|
||||
dataValue = dataUnit.getConverterTo(resultUnit).convert(
|
||||
dataValue);
|
||||
} else {
|
||||
UnitFormat uf = UnitFormat.getUCUMInstance();
|
||||
String message = String
|
||||
.format("Unable to interrogate tile set. Desired unit (%s) is not compatible with data unit (%s).",
|
||||
uf.format(resultUnit), uf.format(dataUnit));
|
||||
throw new IllegalArgumentException(message);
|
||||
}
|
||||
}
|
||||
|
||||
return dataValue;
|
||||
}
|
||||
|
||||
private class TileLevelDataSource implements DataSource {
|
||||
|
||||
private final TileLevel level;
|
||||
|
@ -123,32 +280,10 @@ public class SatTileSetRenderable extends RecordTileSetRenderable {
|
|||
|
||||
@Override
|
||||
public double getDataValue(final int x, final int y) {
|
||||
Tile tile = level.getTile((double) x, (double) y);
|
||||
IColormappedImage cmapImage = null;
|
||||
if (tile != null) {
|
||||
DrawableImage di = imageMap.get(tile);
|
||||
if (di != null) {
|
||||
IImage image = di.getImage();
|
||||
if (image instanceof IColormappedImage) {
|
||||
cmapImage = (IColormappedImage) image;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cmapImage != null) {
|
||||
final IColormappedImage theImage = cmapImage;
|
||||
final double[] result = new double[1];
|
||||
VizApp.runSync(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
result[0] = theImage.getValue(x % tileSize, y
|
||||
% tileSize);
|
||||
}
|
||||
|
||||
});
|
||||
return result[0];
|
||||
}
|
||||
return Double.NaN;
|
||||
ColorMapParameters parameters = colormapping
|
||||
.getColorMapParameters();
|
||||
return SatTileSetRenderable.this.getDataValue(level, x, y, null,
|
||||
parameters.getNoDataValue());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
39
deltaScripts/14.4.1/DR3720/dropRedbookDataURI.sh
Normal file
39
deltaScripts/14.4.1/DR3720/dropRedbookDataURI.sh
Normal file
|
@ -0,0 +1,39 @@
|
|||
#!/bin/bash
|
||||
# DR #3720 - this update script will drop the dataURI column from redbook
|
||||
|
||||
PSQL="/awips2/psql/bin/psql"
|
||||
|
||||
# takes one arg: a table name
|
||||
# drops the datauri constraint and column if they exist
|
||||
function dropDatauri {
|
||||
echo "INFO: Dropping DataURI column from $1"
|
||||
${PSQL} -U awips -d metadata -c "ALTER TABLE $1 DROP CONSTRAINT IF EXISTS ${1}_datauri_key;"
|
||||
${PSQL} -U awips -d metadata -c "ALTER TABLE $1 DROP COLUMN IF EXISTS datauri;"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: Failed to drop dataURI column for $table"
|
||||
echo "FATAL: The update has failed."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# takes three args: table, constraint name, unique columns
|
||||
# will first drop the constraint if it exists and then adds it back, this is
|
||||
# fairly inefficient if it does exist but operationally it won't exist and for
|
||||
# testing this allows the script to be run easily as a noop.
|
||||
function dropDatauriAndAddConstraint {
|
||||
dropDatauri $1
|
||||
${PSQL} -U awips -d metadata -c "ALTER TABLE $1 DROP CONSTRAINT IF EXISTS $2;"
|
||||
${PSQL} -U awips -d metadata -c "ALTER TABLE $1 ADD CONSTRAINT $2 UNIQUE $3;"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: Failed to add new unique constraint for $table"
|
||||
echo "FATAL: The update has failed."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
echo "INFO: Dropping redbook dataURI columns."
|
||||
|
||||
dropDatauriAndAddConstraint redbook redbook_reftime_forecasttime_wmottaaii_corindicator_fcsthours_productid_fileid_originatorid_key "(reftime, forecasttime, wmottaaii, corindicator, fcsthours, productid, fileid, originatorid)"
|
||||
${PSQL} -U awips -d metadata -c "VACUUM FULL ANALYZE redbook"
|
||||
|
||||
echo "INFO: redbook dataURI columns dropped successfully"
|
|
@ -62,7 +62,7 @@
|
|||
<else>
|
||||
<!-- all of the projects are in the workspace or one single directory -->
|
||||
<echo message="BUILDING: in workspace or flattened directory structure"/>
|
||||
<var property="awips.baseline.directory"
|
||||
<var name="awips.baseline.directory"
|
||||
value="${base.dir}" />
|
||||
<var name="repository.directories"
|
||||
value="${base.dir}" />
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
org.postgresql.Driver
|
||||
</property>
|
||||
<property name="dialect">
|
||||
org.hibernatespatial.postgis.PostgisDialect
|
||||
org.hibernate.spatial.dialect.postgis.PostgisDialect
|
||||
</property>
|
||||
<property name="connection.url">
|
||||
jdbc:postgresql://${db.addr}:${db.port}/maps
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
org.postgresql.Driver
|
||||
</property>
|
||||
<property name="dialect">
|
||||
org.hibernatespatial.postgis.PostgisDialect
|
||||
org.hibernate.spatial.dialect.postgis.PostgisDialect
|
||||
</property>
|
||||
<property name="connection.url">
|
||||
jdbc:postgresql://${db.addr}:${db.port}/metadata
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
</bean>
|
||||
|
||||
<bean id="metadataTxManager"
|
||||
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
|
||||
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
|
||||
<property name="sessionFactory" ref="metadataSessionFactory" />
|
||||
</bean>
|
||||
|
||||
|
@ -55,7 +55,7 @@
|
|||
</bean>
|
||||
|
||||
<bean id="mapsTxManager"
|
||||
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
|
||||
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
|
||||
<property name="sessionFactory" ref="mapsSessionFactory" />
|
||||
</bean>
|
||||
|
||||
|
|
|
@ -59,6 +59,7 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
|
|||
* where query for T (T%hr) returned TP6hr
|
||||
* Jun 13, 2013 2044 randerso Cleaned up JavaDoc
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -130,7 +131,7 @@ public class GFED2DDao extends GridDao {
|
|||
Session s = null;
|
||||
|
||||
try {
|
||||
s = getHibernateTemplate().getSessionFactory().openSession();
|
||||
s = getSession();
|
||||
// TODO: clean up so we only make one db query
|
||||
SortedMap<Integer, Integer> rawTimes = queryByParmId(d2dModelName,
|
||||
refTime, d2dParmName, d2dLevel, s);
|
||||
|
@ -150,7 +151,7 @@ public class GFED2DDao extends GridDao {
|
|||
try {
|
||||
s.close();
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(
|
||||
logger.error(
|
||||
"Error occurred closing database session", e);
|
||||
}
|
||||
}
|
||||
|
@ -278,7 +279,7 @@ public class GFED2DDao extends GridDao {
|
|||
List<Integer> timeList = new ArrayList<Integer>();
|
||||
Session s = null;
|
||||
try {
|
||||
s = getHibernateTemplate().getSessionFactory().openSession();
|
||||
s = getSession();
|
||||
|
||||
SortedMap<Integer, Integer> results = queryByParmId(d2dModelName,
|
||||
refTime, d2dParmName, d2dLevel, s);
|
||||
|
@ -290,7 +291,7 @@ public class GFED2DDao extends GridDao {
|
|||
try {
|
||||
s.close();
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(
|
||||
logger.error(
|
||||
"Error occurred closing database session", e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -106,6 +106,7 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery;
|
|||
* 10/15/2013 #2446 randerso Added ORDER BY clause to getOverlappingTimes
|
||||
* 06/12/14 #3244 randerso Improved error handling
|
||||
* 09/21/2014 #3648 randerso Changed to do version purging when new databases are added
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -153,7 +154,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
Session sess = null;
|
||||
|
||||
try {
|
||||
sess = getHibernateTemplate().getSessionFactory().openSession();
|
||||
sess = getSession();
|
||||
sess.setDefaultReadOnly(true);
|
||||
int tries = 0;
|
||||
Transaction tx = null;
|
||||
|
@ -202,7 +203,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
try {
|
||||
sess.close();
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(
|
||||
logger.error(
|
||||
"Error occurred closing database session", e);
|
||||
}
|
||||
}
|
||||
|
@ -242,7 +243,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
Transaction tx = null;
|
||||
|
||||
try {
|
||||
sess = getHibernateTemplate().getSessionFactory().openSession();
|
||||
sess = getSession();
|
||||
sess.setDefaultReadOnly(true);
|
||||
tx = sess.beginTransaction();
|
||||
|
||||
|
@ -280,7 +281,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
try {
|
||||
sess.close();
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(
|
||||
logger.error(
|
||||
"Error occurred closing database session", e);
|
||||
}
|
||||
}
|
||||
|
@ -304,8 +305,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
Transaction tx = null;
|
||||
|
||||
try {
|
||||
sess = getHibernateTemplate().getSessionFactory()
|
||||
.openStatelessSession();
|
||||
sess = getSessionFactory().openStatelessSession();
|
||||
tx = sess.beginTransaction();
|
||||
|
||||
for (ParmStorageInfo psi : psiList) {
|
||||
|
@ -331,7 +331,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
try {
|
||||
sess.close();
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(
|
||||
logger.error(
|
||||
"Error occurred closing database session", e);
|
||||
}
|
||||
}
|
||||
|
@ -351,8 +351,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
Transaction tx = null;
|
||||
|
||||
try {
|
||||
sess = getHibernateTemplate().getSessionFactory()
|
||||
.openStatelessSession();
|
||||
sess = getSessionFactory().openStatelessSession();
|
||||
tx = sess.beginTransaction();
|
||||
sess.update(psi);
|
||||
tx.commit();
|
||||
|
@ -374,7 +373,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
try {
|
||||
sess.close();
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(
|
||||
logger.error(
|
||||
"Error occurred closing database session", e);
|
||||
}
|
||||
}
|
||||
|
@ -395,7 +394,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
Session sess = null;
|
||||
|
||||
try {
|
||||
sess = getHibernateTemplate().getSessionFactory().openSession();
|
||||
sess = getSession();
|
||||
sess.setDefaultReadOnly(true);
|
||||
|
||||
// reattach so dbId doesn't requery
|
||||
|
@ -450,7 +449,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
try {
|
||||
sess.close();
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(
|
||||
logger.error(
|
||||
"Error occurred closing database session", e);
|
||||
}
|
||||
}
|
||||
|
@ -515,18 +514,18 @@ public class GFEDao extends DefaultPluginDao {
|
|||
try {
|
||||
removed = txTemplate
|
||||
.execute(new TransactionCallback<List<DatabaseID>>() {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<DatabaseID> doInTransaction(
|
||||
TransactionStatus status) {
|
||||
Date purgeDate = new Date(
|
||||
System.currentTimeMillis()
|
||||
- (REMOVED_DB_PURGE_TIME * TimeUtil.MILLIS_PER_DAY));
|
||||
@SuppressWarnings("unchecked")
|
||||
List<DatabaseID> removed = getHibernateTemplate()
|
||||
.find("FROM DatabaseID where removedDate < ?",
|
||||
purgeDate);
|
||||
|
||||
return removed;
|
||||
return getCurrentSession()
|
||||
.createQuery(
|
||||
"FROM DatabaseID where removedDate < :removedDate")
|
||||
.setParameter("removedDate", purgeDate)
|
||||
.list();
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
|
@ -555,8 +554,10 @@ public class GFEDao extends DefaultPluginDao {
|
|||
return txTemplate.execute(new TransactionCallback<Integer>() {
|
||||
@Override
|
||||
public Integer doInTransaction(TransactionStatus status) {
|
||||
return getHibernateTemplate().bulkUpdate(
|
||||
"DELETE FROM DatabaseID WHERE siteId = ?", siteID);
|
||||
return getCurrentSession()
|
||||
.createQuery(
|
||||
"DELETE FROM DatabaseID WHERE siteId = :siteId")
|
||||
.setParameter("siteId", siteID).executeUpdate();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -579,8 +580,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
Transaction tx = null;
|
||||
|
||||
try {
|
||||
sess = getHibernateTemplate().getSessionFactory()
|
||||
.openStatelessSession();
|
||||
sess = getSessionFactory().openStatelessSession();
|
||||
tx = sess.beginTransaction();
|
||||
for (GFERecord rec : records) {
|
||||
// TODO: Update saving a record, currently causes 2 inserts and
|
||||
|
@ -608,7 +608,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
try {
|
||||
sess.close();
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(
|
||||
logger.error(
|
||||
"Error occurred closing database session", e);
|
||||
}
|
||||
}
|
||||
|
@ -632,8 +632,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
}
|
||||
|
||||
try {
|
||||
sess = getHibernateTemplate().getSessionFactory()
|
||||
.openStatelessSession();
|
||||
sess = getSessionFactory().openStatelessSession();
|
||||
tx = sess.beginTransaction();
|
||||
|
||||
// Update insert time
|
||||
|
@ -690,7 +689,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
try {
|
||||
sess.close();
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(
|
||||
logger.error(
|
||||
"Error occurred closing database session", e);
|
||||
}
|
||||
}
|
||||
|
@ -713,15 +712,14 @@ public class GFEDao extends DefaultPluginDao {
|
|||
try {
|
||||
return txTemplate
|
||||
.execute(new TransactionCallback<List<DatabaseID>>() {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<DatabaseID> doInTransaction(
|
||||
TransactionStatus status) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<DatabaseID> result = getHibernateTemplate()
|
||||
.find("FROM DatabaseID WHERE siteId = ? AND removeddate is null",
|
||||
siteId);
|
||||
|
||||
return result;
|
||||
return getCurrentSession()
|
||||
.createQuery(
|
||||
"FROM DatabaseID WHERE siteId = :siteId AND removeddate is null")
|
||||
.setParameter("siteId", siteId).list();
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
|
@ -746,7 +744,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
Transaction tx = null;
|
||||
|
||||
try {
|
||||
sess = getHibernateTemplate().getSessionFactory().openSession();
|
||||
sess = getSession();
|
||||
sess.setDefaultReadOnly(true);
|
||||
tx = sess.beginTransaction();
|
||||
|
||||
|
@ -776,7 +774,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
try {
|
||||
sess.close();
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(
|
||||
logger.error(
|
||||
"Error occurred closing database session", e);
|
||||
}
|
||||
}
|
||||
|
@ -801,7 +799,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
try {
|
||||
// stateless session so we can bulk query histories instead of once
|
||||
// per record via hibernate
|
||||
sess = getHibernateTemplate().getSessionFactory().openSession();
|
||||
sess = getSession();
|
||||
sess.setDefaultReadOnly(true);
|
||||
tx = sess.beginTransaction();
|
||||
|
||||
|
@ -837,7 +835,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
try {
|
||||
sess.close();
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(
|
||||
logger.error(
|
||||
"Error occurred closing database session", e);
|
||||
}
|
||||
}
|
||||
|
@ -867,8 +865,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
Transaction tx = null;
|
||||
|
||||
try {
|
||||
sess = getHibernateTemplate().getSessionFactory()
|
||||
.openStatelessSession();
|
||||
sess = getSessionFactory().openStatelessSession();
|
||||
tx = sess.beginTransaction();
|
||||
Query query = sess
|
||||
.createQuery("DELETE FROM GFERecord WHERE parmId = :parmId"
|
||||
|
@ -878,7 +875,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
int rowsDeleted = query.executeUpdate();
|
||||
tx.commit();
|
||||
tx = null;
|
||||
statusHandler.info("Deleted " + rowsDeleted
|
||||
logger.info("Deleted " + rowsDeleted
|
||||
+ " records from the database.");
|
||||
|
||||
Map<File, Pair<List<TimeRange>, String[]>> fileMap = GfeUtil
|
||||
|
@ -893,19 +890,19 @@ public class GFEDao extends DefaultPluginDao {
|
|||
try {
|
||||
dataStore.deleteGroups(groupsToDelete);
|
||||
|
||||
if (statusHandler.isPriorityEnabled(Priority.DEBUG)) {
|
||||
statusHandler.handle(Priority.DEBUG, "Deleted: "
|
||||
if (logger.isPriorityEnabled(Priority.DEBUG)) {
|
||||
logger.handle(Priority.DEBUG, "Deleted: "
|
||||
+ Arrays.toString(groupsToDelete) + " from "
|
||||
+ hdf5File.getName());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.WARN,
|
||||
logger.handle(Priority.WARN,
|
||||
"Error deleting hdf5 record(s) from file: "
|
||||
+ hdf5File.getPath(), e);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
statusHandler.error("Error deleting database record(s) for parmId "
|
||||
logger.error("Error deleting database record(s) for parmId "
|
||||
+ parmId + " timeRanges " + times, e);
|
||||
|
||||
if (tx != null) {
|
||||
|
@ -920,7 +917,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
try {
|
||||
sess.close();
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(
|
||||
logger.error(
|
||||
"Error occurred closing database session", e);
|
||||
}
|
||||
}
|
||||
|
@ -940,14 +937,14 @@ public class GFEDao extends DefaultPluginDao {
|
|||
try {
|
||||
return txTemplate
|
||||
.execute(new TransactionCallback<List<TimeRange>>() {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<TimeRange> doInTransaction(
|
||||
TransactionStatus status) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<TimeRange> result = getHibernateTemplate()
|
||||
.find("SELECT dataTime.validPeriod FROM GFERecord WHERE parmId = ? ORDER BY dataTime.validPeriod.start",
|
||||
parmId);
|
||||
return result;
|
||||
return getCurrentSession()
|
||||
.createQuery(
|
||||
"SELECT dataTime.validPeriod FROM GFERecord WHERE parmId = :parmId ORDER BY dataTime.validPeriod.start")
|
||||
.setParameter("parmId", parmId).list();
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
|
@ -972,19 +969,19 @@ public class GFEDao extends DefaultPluginDao {
|
|||
try {
|
||||
return txTemplate
|
||||
.execute(new TransactionCallback<List<TimeRange>>() {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<TimeRange> doInTransaction(
|
||||
TransactionStatus status) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<TimeRange> rval = getHibernateTemplate()
|
||||
.find("SELECT dataTime.validPeriod"
|
||||
+ " FROM GFERecord WHERE parmId = ?"
|
||||
+ " AND dataTime.validPeriod.start < ?"
|
||||
+ " AND dataTime.validPeriod.end > ?"
|
||||
+ " ORDER BY dataTime.validPeriod.start",
|
||||
new Object[] { parmId, tr.getEnd(),
|
||||
tr.getStart() });
|
||||
return rval;
|
||||
Query query = getCurrentSession().createQuery("SELECT dataTime.validPeriod"
|
||||
+ " FROM GFERecord WHERE parmId = :parmId"
|
||||
+ " AND dataTime.validPeriod.start < :start"
|
||||
+ " AND dataTime.validPeriod.end > :end"
|
||||
+ " ORDER BY dataTime.validPeriod.start");
|
||||
query.setParameter("parmId", parmId);
|
||||
query.setParameter("start", tr.getEnd());
|
||||
query.setParameter("end", tr.getStart());
|
||||
return query.list();
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
|
@ -1020,7 +1017,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
Transaction tx = null;
|
||||
|
||||
try {
|
||||
sess = getHibernateTemplate().getSessionFactory()
|
||||
sess = getSessionFactory()
|
||||
.openStatelessSession();
|
||||
tx = sess.beginTransaction();
|
||||
|
||||
|
@ -1059,7 +1056,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
try {
|
||||
sess.close();
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(
|
||||
logger.error(
|
||||
"Error occurred closing database session", e);
|
||||
}
|
||||
}
|
||||
|
@ -1080,7 +1077,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
Session sess = null;
|
||||
boolean purged = false;
|
||||
try {
|
||||
sess = getHibernateTemplate().getSessionFactory().openSession();
|
||||
sess = getSessionFactory().openSession();
|
||||
Transaction tx = sess.beginTransaction();
|
||||
Object toDelete = sess.get(DatabaseID.class, dbId.getId(),
|
||||
LockOptions.UPGRADE);
|
||||
|
@ -1092,13 +1089,13 @@ public class GFEDao extends DefaultPluginDao {
|
|||
tx.commit();
|
||||
purged = true;
|
||||
} catch (Exception e) {
|
||||
statusHandler.error("Error purging " + dbId, e);
|
||||
logger.error("Error purging " + dbId, e);
|
||||
} finally {
|
||||
if (sess != null) {
|
||||
try {
|
||||
sess.close();
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(
|
||||
logger.error(
|
||||
"Error occurred closing database session", e);
|
||||
}
|
||||
}
|
||||
|
@ -1159,7 +1156,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
Transaction tx = null;
|
||||
|
||||
try {
|
||||
sess = getHibernateTemplate().getSessionFactory()
|
||||
sess = getSessionFactory()
|
||||
.openStatelessSession();
|
||||
tx = sess.beginTransaction();
|
||||
Query q = sess
|
||||
|
@ -1182,7 +1179,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
try {
|
||||
sess.close();
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(
|
||||
logger.error(
|
||||
"Error occurred closing database session", e);
|
||||
}
|
||||
}
|
||||
|
@ -1208,7 +1205,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
List<Object[]> rows = null;
|
||||
|
||||
try {
|
||||
sess = getHibernateTemplate().getSessionFactory()
|
||||
sess = getSessionFactory()
|
||||
.openStatelessSession();
|
||||
tx = sess.beginTransaction();
|
||||
// use intersection of time range, UPDATE statement don't auto join
|
||||
|
@ -1253,7 +1250,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
try {
|
||||
sess.close();
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(
|
||||
logger.error(
|
||||
"Error occurred closing database session", e);
|
||||
}
|
||||
}
|
||||
|
@ -1293,7 +1290,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
Transaction tx = null;
|
||||
|
||||
try {
|
||||
sess = getHibernateTemplate().getSessionFactory()
|
||||
sess = getSessionFactory()
|
||||
.openStatelessSession();
|
||||
tx = sess.beginTransaction();
|
||||
Query q = sess
|
||||
|
@ -1316,7 +1313,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
try {
|
||||
sess.close();
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(
|
||||
logger.error(
|
||||
"Error occurred closing database session", e);
|
||||
}
|
||||
}
|
||||
|
@ -1368,17 +1365,17 @@ public class GFEDao extends DefaultPluginDao {
|
|||
// TODO: Should this be done from GridParmManager?
|
||||
List<DatabaseID> results = Collections.emptyList();
|
||||
try {
|
||||
final String[] queryParams = { siteId, modelName };
|
||||
results = txTemplate
|
||||
.execute(new TransactionCallback<List<DatabaseID>>() {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<DatabaseID> doInTransaction(
|
||||
TransactionStatus status) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<DatabaseID> result = getHibernateTemplate()
|
||||
.find("FROM DatabaseID WHERE siteId = ? AND modelName = ? ORDER BY modelTime DESC LIMIT 1",
|
||||
(Object[]) queryParams);
|
||||
return result;
|
||||
|
||||
Query query = getCurrentSession().createQuery("FROM DatabaseID WHERE siteId = :siteId AND modelName = :modelName ORDER BY modelTime DESC LIMIT 1");
|
||||
query.setParameter("siteId", siteId);
|
||||
query.setParameter("modelName",modelName);
|
||||
return query.list();
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
|
@ -1409,7 +1406,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
dbId.setRemovedDate(removedDate);
|
||||
Session sess = null;
|
||||
try {
|
||||
sess = getHibernateTemplate().getSessionFactory().openSession();
|
||||
sess = getSession();
|
||||
int tries = 0;
|
||||
Transaction tx = null;
|
||||
try {
|
||||
|
@ -1445,7 +1442,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
try {
|
||||
sess.close();
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(
|
||||
logger.error(
|
||||
"Error occurred closing database session", e);
|
||||
}
|
||||
}
|
||||
|
@ -1465,7 +1462,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
Transaction tx = null;
|
||||
|
||||
try {
|
||||
sess = getHibernateTemplate().getSessionFactory().openSession();
|
||||
sess = getSession();
|
||||
tx = sess.beginTransaction();
|
||||
sess.saveOrUpdate(gloc);
|
||||
tx.commit();
|
||||
|
@ -1486,7 +1483,7 @@ public class GFEDao extends DefaultPluginDao {
|
|||
try {
|
||||
sess.close();
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(
|
||||
logger.error(
|
||||
"Error occurred closing database session", e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,6 +52,7 @@ import com.raytheon.uf.edex.database.dao.DaoConfig;
|
|||
* 06/17/08 #940 bphillip Initial Creation
|
||||
* 04/19/13 #1949 rjpeter Normalized GFE Database.
|
||||
* 06/20/13 #2127 rjpeter Set session to read only.
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
|
@ -98,7 +99,7 @@ public class GFELockDao extends CoreDao {
|
|||
Transaction tx = null;
|
||||
|
||||
try {
|
||||
sess = getHibernateTemplate().getSessionFactory().openSession();
|
||||
sess = getSession();
|
||||
sess.setDefaultReadOnly(true);
|
||||
tx = sess.beginTransaction();
|
||||
|
||||
|
@ -137,7 +138,7 @@ public class GFELockDao extends CoreDao {
|
|||
try {
|
||||
sess.close();
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(
|
||||
logger.error(
|
||||
"Error occurred closing database session", e);
|
||||
}
|
||||
}
|
||||
|
@ -159,7 +160,7 @@ public class GFELockDao extends CoreDao {
|
|||
Transaction tx = null;
|
||||
|
||||
try {
|
||||
s = this.getHibernateTemplate().getSessionFactory()
|
||||
s = getSessionFactory()
|
||||
.openStatelessSession();
|
||||
tx = s.beginTransaction();
|
||||
|
||||
|
@ -185,7 +186,7 @@ public class GFELockDao extends CoreDao {
|
|||
try {
|
||||
s.close();
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(
|
||||
logger.error(
|
||||
"Error occurred closing database session", e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,6 +63,7 @@ import com.raytheon.uf.edex.database.dao.DaoConfig;
|
|||
* May 08, 2012 600 dgilling Re-work logic for handling PENDING
|
||||
* records.
|
||||
* Feb 07, 2014 2357 rjpeter iscSendNotification uri.
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -333,7 +334,7 @@ public class IscSendQueue {
|
|||
|
||||
for (IscSendRecord record : newJobs) {
|
||||
try {
|
||||
s = cd.getHibernateTemplate().getSessionFactory().openSession();
|
||||
s = cd.getSession();
|
||||
tx = s.beginTransaction();
|
||||
boolean foundDupe = false;
|
||||
boolean foundMerge = false;
|
||||
|
@ -575,7 +576,7 @@ public class IscSendQueue {
|
|||
CoreDao dao = new CoreDao(DaoConfig.DEFAULT);
|
||||
List<IscSendRecord> pendingToSending = null;
|
||||
try {
|
||||
lookupSess = dao.getHibernateTemplate().getSessionFactory()
|
||||
lookupSess = dao.getSessionFactory()
|
||||
.openStatelessSession();
|
||||
|
||||
Criteria pendingCrit = lookupSess
|
||||
|
@ -607,8 +608,7 @@ public class IscSendQueue {
|
|||
Transaction tx = null;
|
||||
|
||||
try {
|
||||
dbModSess = dao.getHibernateTemplate().getSessionFactory()
|
||||
.openSession();
|
||||
dbModSess = dao.getSession();
|
||||
tx = dbModSess.beginTransaction();
|
||||
|
||||
IscSendRecord oldRecord = (IscSendRecord) dbModSess.get(
|
||||
|
|
|
@ -37,7 +37,7 @@ import org.geotools.data.simple.SimpleFeatureIterator;
|
|||
import org.geotools.data.simple.SimpleFeatureSource;
|
||||
import org.geotools.factory.CommonFactoryFinder;
|
||||
import org.geotools.factory.GeoTools;
|
||||
import org.hibernate.engine.SessionFactoryImplementor;
|
||||
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
||||
import org.opengis.feature.IllegalAttributeException;
|
||||
import org.opengis.feature.simple.SimpleFeature;
|
||||
import org.opengis.feature.simple.SimpleFeatureType;
|
||||
|
@ -71,6 +71,7 @@ import com.vividsolutions.jts.geom.Polygon;
|
|||
* Mar 28, 2013 #1837 dgilling Change error handling in
|
||||
* getLastUpdated().
|
||||
* Mar 11, 2014 #2718 randerso Changes for GeoTools 10.5
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
@ -56,6 +56,7 @@ import com.raytheon.uf.edex.database.dao.DaoConfig;
|
|||
* Jun 13, 2013 #2044 randerso Refactored to use IFPServer,
|
||||
* moved smartInit queuing code here
|
||||
* from other modules, general code cleanup
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
* </pre>
|
||||
*
|
||||
* @author njensen
|
||||
|
@ -217,7 +218,7 @@ public class SmartInitQueue {
|
|||
CoreDao cd = new CoreDao(DaoConfig.DEFAULT);
|
||||
Session s = null;
|
||||
try {
|
||||
s = cd.getHibernateTemplate().getSessionFactory().openSession();
|
||||
s = cd.getSession();
|
||||
Transaction tx = null;
|
||||
SmartInitRecord oldRecord = null;
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -20,6 +20,7 @@ Require-Bundle: com.raytheon.edex.common;bundle-version="1.14.0",
|
|||
javax.measure,
|
||||
ucar.nc2
|
||||
Export-Package: com.raytheon.edex.plugin.grib,
|
||||
com.raytheon.edex.plugin.grib.decoderpostprocessors,
|
||||
com.raytheon.edex.plugin.grib.exception,
|
||||
com.raytheon.edex.plugin.grib.spatial,
|
||||
com.raytheon.edex.plugin.grib.util,
|
||||
|
|
|
@ -23,6 +23,7 @@ package com.raytheon.edex.plugin.radar.dao;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.criterion.DetachedCriteria;
|
||||
import org.hibernate.criterion.Disjunction;
|
||||
import org.hibernate.criterion.Expression;
|
||||
|
@ -45,6 +46,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 7/24/07 353 bphillip Initial Check in
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -167,10 +169,8 @@ public class RadarStationDao extends CoreDao {
|
|||
}
|
||||
}
|
||||
crit.add(stationEq);
|
||||
List<RadarStation> stations = getHibernateTemplate()
|
||||
.findByCriteria(crit);
|
||||
|
||||
return stations;
|
||||
Session session = getSession();
|
||||
return crit.getExecutableCriteria(session).list();
|
||||
} else {
|
||||
logger.warn("Cannot execute spatial query with less than 3 points");
|
||||
return new ArrayList<RadarStation>();
|
||||
|
|
|
@ -29,8 +29,8 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.hibernate.connection.ConnectionProvider;
|
||||
import org.hibernate.engine.SessionFactoryImplementor;
|
||||
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
||||
import org.hibernate.service.jdbc.connections.spi.ConnectionProvider;
|
||||
|
||||
import com.raytheon.edex.plugin.shef.data.ShefData;
|
||||
import com.raytheon.edex.plugin.shef.data.ShefRecord;
|
||||
|
@ -87,6 +87,7 @@ import com.raytheon.uf.edex.database.dao.DaoConfig;
|
|||
* 04/29/2014 3088 mpduff Change logging class, clean up/optimization.
|
||||
* More performance fixes.
|
||||
* 09/03/2014 mpduff postRiverStatus() writes directly, not via batch
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
@ -55,6 +55,7 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
* May 10, 2013 1951 rjpeter Added own id sequence tagging
|
||||
* Jul 16, 2013 2181 bsteffen Convert geometry types to use hibernate-
|
||||
* spatial
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
* </pre>
|
||||
*
|
||||
* @author njensen
|
||||
|
@ -144,7 +145,7 @@ public abstract class ActiveTableRecord extends PersistableDataObject {
|
|||
protected boolean ufn;
|
||||
|
||||
@Column
|
||||
@Type(type = "org.hibernatespatial.GeometryUserType")
|
||||
@Type(type = "org.hibernate.spatial.GeometryType")
|
||||
@DynamicSerializeElement
|
||||
protected Geometry geometry;
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
* Nov 01, 2013 2361 njensen Remove XML annotations
|
||||
* Apr 15, 2014 3001 bgonzale Refactored to common package,
|
||||
* com.raytheon.uf.common.dataplugin.ccfp.
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
|
@ -62,7 +63,7 @@ public class CcfpLocation implements ISpatialObject {
|
|||
private static final long serialVersionUID = 8890315829188793187L;
|
||||
|
||||
@Column(name = "location")
|
||||
@Type(type = "org.hibernatespatial.GeometryUserType")
|
||||
@Type(type = "org.hibernate.spatial.GeometryType")
|
||||
@DynamicSerializeElement
|
||||
private Geometry geometry;
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ import java.sql.SQLException;
|
|||
import java.sql.Types;
|
||||
|
||||
import org.hibernate.HibernateException;
|
||||
import org.hibernate.engine.spi.SessionImplementor;
|
||||
import org.hibernate.usertype.UserType;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.gfe.GridDataHistory;
|
||||
|
@ -42,6 +43,7 @@ import com.raytheon.uf.common.dataplugin.gfe.GridDataHistory;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 4/18/08 875 bphillip Initial Creation
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -87,29 +89,30 @@ public class OriginHibType implements UserType {
|
|||
public boolean isMutable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object nullSafeGet(ResultSet resultSet, String[] names, Object owner)
|
||||
public Object nullSafeGet(ResultSet rs, String[] names,
|
||||
SessionImplementor session, Object owner)
|
||||
throws HibernateException, SQLException {
|
||||
return GridDataHistory.OriginType
|
||||
.valueOf(resultSet.getString(names[0]));
|
||||
.valueOf(rs.getString(names[0]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void nullSafeSet(PreparedStatement statement, Object value, int index)
|
||||
throws HibernateException, SQLException {
|
||||
public void nullSafeSet(PreparedStatement st, Object value, int index,
|
||||
SessionImplementor session) throws HibernateException, SQLException {
|
||||
if (value == null) {
|
||||
statement.setString(index, null);
|
||||
st.setString(index, null);
|
||||
} else {
|
||||
if (value instanceof GridDataHistory.OriginType) {
|
||||
statement.setString(index, ((GridDataHistory.OriginType) value)
|
||||
st.setString(index, ((GridDataHistory.OriginType) value)
|
||||
.name());
|
||||
} else {
|
||||
throw new HibernateException("value is not of type "
|
||||
+ GridDataHistory.OriginType.class.getName());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -127,5 +130,4 @@ public class OriginHibType implements UserType {
|
|||
public int[] sqlTypes() {
|
||||
return OriginHibType.SQL_TYPES;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ import java.sql.SQLException;
|
|||
import java.sql.Types;
|
||||
|
||||
import org.hibernate.HibernateException;
|
||||
import org.hibernate.engine.spi.SessionImplementor;
|
||||
import org.hibernate.usertype.UserType;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID;
|
||||
|
@ -41,6 +42,7 @@ import com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 4/18/08 875 bphillip Initial Creation
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -85,20 +87,21 @@ public class ParmIdType implements UserType{
|
|||
public boolean isMutable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object nullSafeGet(ResultSet resultSet, String[] names, Object owner)
|
||||
public Object nullSafeGet(ResultSet rs, String[] names,
|
||||
SessionImplementor session, Object owner)
|
||||
throws HibernateException, SQLException {
|
||||
return new ParmID(resultSet.getString(names[0]));
|
||||
return new ParmID(rs.getString(names[0]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void nullSafeSet(PreparedStatement statement, Object value, int index)
|
||||
throws HibernateException, SQLException {
|
||||
public void nullSafeSet(PreparedStatement st, Object value, int index,
|
||||
SessionImplementor session) throws HibernateException, SQLException {
|
||||
if(value == null){
|
||||
statement.setString(index, null);
|
||||
st.setString(index, null);
|
||||
}else{
|
||||
statement.setString(index, value.toString());
|
||||
st.setString(index, value.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -118,6 +121,4 @@ public class ParmIdType implements UserType{
|
|||
public int[] sqlTypes() {
|
||||
return ParmIdType.SQL_TYPES;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ import java.sql.SQLException;
|
|||
import java.sql.Types;
|
||||
|
||||
import org.hibernate.HibernateException;
|
||||
import org.hibernate.engine.spi.SessionImplementor;
|
||||
import org.hibernate.usertype.UserType;
|
||||
|
||||
import com.raytheon.uf.common.message.WsId;
|
||||
|
@ -39,6 +40,7 @@ import com.raytheon.uf.common.message.WsId;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jun 10, 2009 randerso Initial creation
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -116,40 +118,28 @@ public class WsIdType implements UserType {
|
|||
public boolean isMutable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.hibernate.usertype.UserType#nullSafeGet(java.sql.ResultSet,
|
||||
* java.lang.String[], java.lang.Object)
|
||||
*/
|
||||
|
||||
@Override
|
||||
public Object nullSafeGet(ResultSet resultSet, String[] names, Object owner)
|
||||
public Object nullSafeGet(ResultSet rs, String[] names,
|
||||
SessionImplementor session, Object owner)
|
||||
throws HibernateException, SQLException {
|
||||
String s = resultSet.getString(names[0]);
|
||||
String s = rs.getString(names[0]);
|
||||
if (s == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new WsId(resultSet.getString(names[0]));
|
||||
return new WsId(rs.getString(names[0]));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.hibernate.usertype.UserType#nullSafeSet(java.sql.PreparedStatement,
|
||||
* java.lang.Object, int)
|
||||
*/
|
||||
@Override
|
||||
public void nullSafeSet(PreparedStatement statement, Object value, int index)
|
||||
throws HibernateException, SQLException {
|
||||
public void nullSafeSet(PreparedStatement st, Object value, int index,
|
||||
SessionImplementor session) throws HibernateException, SQLException {
|
||||
if (value == null) {
|
||||
statement.setString(index, null);
|
||||
st.setString(index, null);
|
||||
} else {
|
||||
statement.setString(index, value.toString());
|
||||
st.setString(index, value.toString());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -183,5 +173,4 @@ public class WsIdType implements UserType {
|
|||
public int[] sqlTypes() {
|
||||
return WsIdType.SQL_TYPES;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -65,6 +65,7 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
* Jul 16, 2013 2181 bsteffen Convert geometry types to use hibernate-
|
||||
* spatial
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -94,7 +95,7 @@ public class GOESSounding extends PersistablePluginDataObject implements
|
|||
|
||||
// The bounding box that contains this observation.
|
||||
@Column
|
||||
@Type(type = "org.hibernatespatial.GeometryUserType")
|
||||
@Type(type = "org.hibernate.spatial.GeometryType")
|
||||
@DynamicSerializeElement
|
||||
private Geometry boxGeometry;
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
|
@ -53,11 +53,11 @@ import com.raytheon.uf.common.util.mapping.Mapper;
|
|||
|
||||
/**
|
||||
* Data access factory for accessing data from the Grid plugin as grid types.
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Jan 17, 2013 bsteffen Initial creation
|
||||
|
@ -66,10 +66,11 @@ import com.raytheon.uf.common.util.mapping.Mapper;
|
|||
* Feb 04, 2014 2672 bsteffen Enable requesting subgrids.
|
||||
* Jul 30, 2014 3184 njensen Renamed valid identifiers to optional
|
||||
* Sep 09, 2014 3356 njensen Remove CommunicationException
|
||||
*
|
||||
*
|
||||
* Oct 16, 2014 3598 nabowle Accept level identifiers.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @author bsteffen
|
||||
* @version 1.0
|
||||
*/
|
||||
|
@ -81,7 +82,9 @@ public class GridDataAccessFactory extends AbstractGridDataPluginFactory
|
|||
|
||||
private static final String[] VALID_IDENTIFIERS = {
|
||||
GridConstants.DATASET_ID, GridConstants.SECONDARY_ID,
|
||||
GridConstants.ENSEMBLE_ID, NAMESPACE };
|
||||
GridConstants.ENSEMBLE_ID, NAMESPACE,
|
||||
GridConstants.MASTER_LEVEL_NAME, GridConstants.LEVEL_ONE,
|
||||
GridConstants.LEVEL_TWO };
|
||||
|
||||
@Override
|
||||
public String[] getOptionalIdentifiers() {
|
||||
|
@ -109,6 +112,9 @@ public class GridDataAccessFactory extends AbstractGridDataPluginFactory
|
|||
}
|
||||
|
||||
if (request.getLevels() != null) {
|
||||
checkForLevelConflict(request.getLevels(),
|
||||
request.getIdentifiers());
|
||||
|
||||
for (Level level : request.getLevels()) {
|
||||
assembler.setMasterLevelName(level.getMasterLevel()
|
||||
.getName());
|
||||
|
@ -152,6 +158,18 @@ public class GridDataAccessFactory extends AbstractGridDataPluginFactory
|
|||
assembler.setSecondaryId(identifiers.get(
|
||||
GridConstants.SECONDARY_ID).toString());
|
||||
}
|
||||
if (identifiers.containsKey(GridConstants.MASTER_LEVEL_NAME)) {
|
||||
assembler.setMasterLevelName(identifiers.get(
|
||||
GridConstants.MASTER_LEVEL_NAME).toString());
|
||||
}
|
||||
if (identifiers.containsKey(GridConstants.LEVEL_ONE)) {
|
||||
assembler.setLevelOneValue((Double) identifiers
|
||||
.get(GridConstants.LEVEL_ONE));
|
||||
}
|
||||
if (identifiers.containsKey(GridConstants.LEVEL_TWO)) {
|
||||
assembler.setLevelTwoValue((Double) identifiers
|
||||
.get(GridConstants.LEVEL_TWO));
|
||||
}
|
||||
}
|
||||
mergeConstraintMaps(assembler.getConstraintMap(), result);
|
||||
} catch (CommunicationException e) {
|
||||
|
@ -160,10 +178,37 @@ public class GridDataAccessFactory extends AbstractGridDataPluginFactory
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for possible level conflicts.
|
||||
*
|
||||
* @param levels
|
||||
* The request levels. Assumed to not be null.
|
||||
* @param identifiers
|
||||
* The request identifiers.
|
||||
* @throws DataRetrievalException
|
||||
* if levels is not empty and at least one of the
|
||||
* {@link GridConstants#MASTER_LEVEL_NAME},
|
||||
* {@link GridConstants#LEVEL_ONE}, or
|
||||
* {@link GridConstants#LEVEL_TWO} identifiers is specified.
|
||||
*/
|
||||
private void checkForLevelConflict(Level[] levels,
|
||||
Map<String, Object> identifiers) {
|
||||
if (levels.length > 0
|
||||
&& identifiers != null
|
||||
&& (identifiers.containsKey(GridConstants.MASTER_LEVEL_NAME)
|
||||
|| identifiers.containsKey(GridConstants.LEVEL_ONE) || identifiers
|
||||
.containsKey(GridConstants.LEVEL_TWO))) {
|
||||
throw new DataRetrievalException(
|
||||
"Conflict between the request levels and request "
|
||||
+ "identifiers. Please set the levels either as"
|
||||
+ " identifiers or as levels, not both.");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy all constraints from source to target. If target already contains a
|
||||
* constraint for a key then merge the values into target.
|
||||
*
|
||||
*
|
||||
* @param target
|
||||
* @param source
|
||||
*/
|
||||
|
|
|
@ -54,6 +54,7 @@ import com.vividsolutions.jts.geom.Point;
|
|||
* Jul 24, 2007 353 bphillip Initial Check in
|
||||
* Jul 16, 2013 2181 bsteffen Convert geometry types to use hibernate-
|
||||
* spatial
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -118,7 +119,7 @@ public class RadarStation extends PersistableDataObject implements
|
|||
private Float lon;
|
||||
|
||||
@Column(name = "the_geom")
|
||||
@Type(type = "org.hibernatespatial.GeometryUserType")
|
||||
@Type(type = "org.hibernate.spatial.GeometryType")
|
||||
@XmlJavaTypeAdapter(value = GeometryAdapter.class)
|
||||
@DynamicSerializeElement
|
||||
private Point station;
|
||||
|
|
|
@ -23,8 +23,6 @@ import java.util.Arrays;
|
|||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Access;
|
||||
import javax.persistence.AccessType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
|
@ -70,6 +68,7 @@ import com.raytheon.uf.common.time.DataTime;
|
|||
* Nov 04, 2013 2361 njensen Remove XML annotations
|
||||
* Mar 13, 2014 2907 njensen split edex.redbook plugin into common and
|
||||
* edex redbook plugins
|
||||
* Oct 10, 2014 3720 mapeters Removed dataURI column.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -78,7 +77,9 @@ import com.raytheon.uf.common.time.DataTime;
|
|||
*/
|
||||
@Entity
|
||||
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "redbookseq")
|
||||
@Table(name = "redbook", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
|
||||
@Table(name = "redbook", uniqueConstraints = { @UniqueConstraint(columnNames = {
|
||||
"wmoTTAAii", "corIndicator", "fcstHours", "productId", "fileId",
|
||||
"originatorId" }) })
|
||||
/*
|
||||
* Both refTime and forecastTime are included in the refTimeIndex since
|
||||
* forecastTime is unlikely to be used.
|
||||
|
@ -226,12 +227,6 @@ public class RedbookRecord extends PersistablePluginDataObject implements
|
|||
this.timeObs = timeObs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDataURI(String dataURI) {
|
||||
super.setDataURI(dataURI);
|
||||
identifier = dataURI;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the retentionHours
|
||||
*/
|
||||
|
@ -464,13 +459,6 @@ public class RedbookRecord extends PersistablePluginDataObject implements
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Column
|
||||
@Access(AccessType.PROPERTY)
|
||||
public String getDataURI() {
|
||||
return super.getDataURI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "redbook";
|
||||
|
|
|
@ -74,6 +74,7 @@ import com.vividsolutions.jts.geom.Polygon;
|
|||
* Sep 30, 2013 2333 mschenke Refactored to store coordinates in CRS
|
||||
* space
|
||||
* Apr 11, 2014 2947 bsteffen Fix equals
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
|
@ -151,7 +152,7 @@ public class SatMapCoverage extends PersistableDataObject<Object> implements
|
|||
|
||||
/** The map coverage */
|
||||
@Column(name = "the_geom")
|
||||
@Type(type = "org.hibernatespatial.GeometryUserType")
|
||||
@Type(type = "org.hibernate.spatial.GeometryType")
|
||||
@XmlJavaTypeAdapter(value = GeometryAdapter.class)
|
||||
@DynamicSerializeElement
|
||||
private Geometry location;
|
||||
|
|
|
@ -57,6 +57,7 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
* Aug 08, 2013 2243 jsanchez Removed super method in copy constructor.
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Jun 11, 2014 2061 bsteffen Remove IDecoderGettable
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -150,7 +151,7 @@ public abstract class AbstractWarningRecord extends PluginDataObject {
|
|||
private boolean ufn;
|
||||
|
||||
@Column
|
||||
@Type(type = "org.hibernatespatial.GeometryUserType")
|
||||
@Type(type = "org.hibernate.spatial.GeometryType")
|
||||
@DynamicSerializeElement
|
||||
private Geometry geometry;
|
||||
|
||||
|
|
|
@ -79,6 +79,7 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
* Oct 15, 2013 2473 bsteffen add @XmlSeeAlso for self contained JAXB
|
||||
* context.
|
||||
* Apr 11, 2014 2947 bsteffen Implement IGridGeometryProvider.
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -124,7 +125,7 @@ public abstract class GridCoverage extends PersistableDataObject<Integer>
|
|||
|
||||
/** Geometry object holding the corner points of the grid */
|
||||
@Column(name = "the_geom")
|
||||
@Type(type = "org.hibernatespatial.GeometryUserType")
|
||||
@Type(type = "org.hibernate.spatial.GeometryType")
|
||||
@XmlJavaTypeAdapter(value = GeometryAdapter.class)
|
||||
@DynamicSerializeElement
|
||||
protected Geometry geometry;
|
||||
|
|
85
edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/FSSObsMonitorConfigurationManager.java
Executable file → Normal file
85
edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/FSSObsMonitorConfigurationManager.java
Executable file → Normal file
|
@ -127,15 +127,21 @@ public class FSSObsMonitorConfigurationManager implements
|
|||
ss, fog, snow
|
||||
};
|
||||
|
||||
/** Instance of SAFESEAS monitor configuration manager. */
|
||||
private static FSSObsMonitorConfigurationManager ssInstance = new FSSObsMonitorConfigurationManager(
|
||||
MonName.ss.name());
|
||||
|
||||
/** Instance of Fog monitor configuration manager. */
|
||||
private static FSSObsMonitorConfigurationManager fogInstance = new FSSObsMonitorConfigurationManager(
|
||||
MonName.fog.name());
|
||||
|
||||
/** Instance of SNOW monitor configuration manager. */
|
||||
private static FSSObsMonitorConfigurationManager snowInstance = new FSSObsMonitorConfigurationManager(
|
||||
MonName.snow.name());
|
||||
|
||||
/** Localization Area Configuration File. */
|
||||
private LocalizationFile lacf = null;
|
||||
|
||||
/** Configuration XML is updated and saved */
|
||||
protected boolean isPopulated;
|
||||
|
||||
/** Singleton instance of this class */
|
||||
private static FSSObsMonitorConfigurationManager instance = null;
|
||||
|
||||
/**
|
||||
* Private Constructor
|
||||
*
|
||||
|
@ -143,7 +149,6 @@ public class FSSObsMonitorConfigurationManager implements
|
|||
*/
|
||||
public FSSObsMonitorConfigurationManager(String monitorName) {
|
||||
setMonitorName(monitorName);
|
||||
setPopulated(false);
|
||||
// Avoid confusion in file path
|
||||
if (monitorName == MonName.ss.name()) {
|
||||
pluginName = "safeseas";
|
||||
|
@ -163,21 +168,6 @@ public class FSSObsMonitorConfigurationManager implements
|
|||
readConfigXml();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an instance of Configuration manager for FSSObs monitors.
|
||||
*
|
||||
* @param monitor
|
||||
* Name of monitor
|
||||
* @return Instance of manager
|
||||
*/
|
||||
public static synchronized FSSObsMonitorConfigurationManager getInstance(
|
||||
String monitor) {
|
||||
if (instance == null) {
|
||||
instance = new FSSObsMonitorConfigurationManager(monitor);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads the XML configuration data for the current XML file name. filename:
|
||||
* monitor area config file name adjAreaFileName: adjacent areas config file
|
||||
|
@ -193,11 +183,11 @@ public class FSSObsMonitorConfigurationManager implements
|
|||
LocalizationType.COMMON_STATIC, LocalizationLevel.SITE);
|
||||
this.currentSite = lc.getContextName();
|
||||
lacf = pm.getLocalizationFile(lc, configFileName);
|
||||
lacf.addFileUpdatedObserver(this);
|
||||
String monitorAreaFilePath = lacf.getFile().getAbsolutePath();
|
||||
MonAreaConfigXML configXmltmp = jaxb
|
||||
.unmarshalFromXmlFile(monitorAreaFilePath.toString());
|
||||
configXml = configXmltmp;
|
||||
setPopulated(true);
|
||||
} catch (Exception e) {
|
||||
statusHandler
|
||||
.handle(Priority.WARN,
|
||||
|
@ -327,7 +317,6 @@ public class FSSObsMonitorConfigurationManager implements
|
|||
newXmlFile.save();
|
||||
lacf = newXmlFile;
|
||||
lacf.addFileUpdatedObserver(this);
|
||||
setPopulated(true);
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.ERROR, e.getMessage());
|
||||
}
|
||||
|
@ -953,24 +942,6 @@ public class FSSObsMonitorConfigurationManager implements
|
|||
FSSObsMonitorConfigurationManager.monitorName = monitorName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Flag is true if config file updated and saved.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isPopulated() {
|
||||
return isPopulated;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets flag indicating that config file has been updated and saved.
|
||||
*
|
||||
* @param isPopulated
|
||||
*/
|
||||
public void setPopulated(boolean isPopulated) {
|
||||
this.isPopulated = isPopulated;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Adjacent Area.
|
||||
*
|
||||
|
@ -1009,4 +980,34 @@ public class FSSObsMonitorConfigurationManager implements
|
|||
adjAreaConfigXml.addAreaId(area);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Fog monitor area configuration manager.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static FSSObsMonitorConfigurationManager getFogObsManager() {
|
||||
fogInstance.readConfigXml();
|
||||
return fogInstance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get SAFESEAS monitor area configuration manager.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static FSSObsMonitorConfigurationManager getSsObsManager() {
|
||||
ssInstance.readConfigXml();
|
||||
return ssInstance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get SNOW monitor area configuration manager.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static FSSObsMonitorConfigurationManager getSnowObsManager() {
|
||||
snowInstance.readConfigXml();
|
||||
return snowInstance;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ import javax.xml.datatype.DatatypeFactory;
|
|||
import javax.xml.datatype.Duration;
|
||||
|
||||
import org.hibernate.HibernateException;
|
||||
import org.hibernate.engine.spi.SessionImplementor;
|
||||
import org.hibernate.usertype.UserType;
|
||||
|
||||
/**
|
||||
|
@ -44,6 +45,7 @@ import org.hibernate.usertype.UserType;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 6, 2012 bphillip Initial creation
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -89,11 +91,12 @@ public class DurationType implements UserType {
|
|||
public boolean isMutable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object nullSafeGet(ResultSet resultSet, String[] names, Object owner)
|
||||
public Object nullSafeGet(ResultSet rs, String[] names,
|
||||
SessionImplementor session, Object owner)
|
||||
throws HibernateException, SQLException {
|
||||
long durationInMilliSeconds = resultSet.getLong((names[0]));
|
||||
long durationInMilliSeconds = rs.getLong((names[0]));
|
||||
|
||||
try {
|
||||
return DatatypeFactory.newInstance().newDuration(
|
||||
|
@ -105,15 +108,15 @@ public class DurationType implements UserType {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void nullSafeSet(PreparedStatement statement, Object value, int index)
|
||||
throws HibernateException, SQLException {
|
||||
public void nullSafeSet(PreparedStatement st, Object value, int index,
|
||||
SessionImplementor session) throws HibernateException, SQLException {
|
||||
if (value == null) {
|
||||
statement.setLong(index, 0);
|
||||
st.setLong(index, 0);
|
||||
} else {
|
||||
Duration dur = (Duration) value;
|
||||
statement.setLong(index, dur.getTimeInMillis(new java.util.Date()));
|
||||
st.setLong(index, dur.getTimeInMillis(new java.util.Date()));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
package com.raytheon.uf.common.registry.schemas.ebxml.util;
|
||||
|
||||
import org.hibernate.HibernateException;
|
||||
import org.hibernate.engine.SessionImplementor;
|
||||
import org.hibernate.engine.spi.SessionImplementor;
|
||||
import org.hibernate.id.IdentifierGenerator;
|
||||
|
||||
/**
|
||||
|
@ -33,6 +33,7 @@ import org.hibernate.id.IdentifierGenerator;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 11, 2012 bphillip Initial creation
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
@ -29,6 +29,7 @@ import java.sql.Types;
|
|||
import javax.xml.datatype.XMLGregorianCalendar;
|
||||
|
||||
import org.hibernate.HibernateException;
|
||||
import org.hibernate.engine.spi.SessionImplementor;
|
||||
import org.hibernate.usertype.UserType;
|
||||
|
||||
/**
|
||||
|
@ -44,6 +45,7 @@ import org.hibernate.usertype.UserType;
|
|||
* Oct 31, 2013 2361 njensen Use specific JAXBManager instead of SerializationUtil
|
||||
* Nov 14, 2013 2552 bkowal EbxmlJaxbManager is now accessed via getInstance
|
||||
* Dec 04, 2013 2584 dhladky Version based EbxmlJaxbManager
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -89,9 +91,10 @@ public class SerializedType implements UserType {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object nullSafeGet(ResultSet resultSet, String[] names, Object owner)
|
||||
public Object nullSafeGet(ResultSet rs, String[] names,
|
||||
SessionImplementor session, Object owner)
|
||||
throws HibernateException, SQLException {
|
||||
String obj = resultSet.getString(names[0]);
|
||||
String obj = rs.getString(names[0]);
|
||||
|
||||
if (obj != null) {
|
||||
try { // We always marshall to current version for to XML conversions
|
||||
|
@ -106,18 +109,19 @@ public class SerializedType implements UserType {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void nullSafeSet(PreparedStatement statement, Object value, int index)
|
||||
throws HibernateException, SQLException {
|
||||
public void nullSafeSet(PreparedStatement st, Object value, int index,
|
||||
SessionImplementor session) throws HibernateException, SQLException {
|
||||
if (value == null) {
|
||||
statement.setString(index, null);
|
||||
st.setString(index, null);
|
||||
} else {
|
||||
try { // We always marshall to current version for to XML conversions
|
||||
statement.setString(index, EbxmlJaxbManager.getInstance()
|
||||
st.setString(index, EbxmlJaxbManager.getInstance()
|
||||
.getJaxbManager().marshalToXml(value));
|
||||
} catch (Exception e) {
|
||||
throw new HibernateException("Error storing AnyType data", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -135,5 +139,4 @@ public class SerializedType implements UserType {
|
|||
public int[] sqlTypes() {
|
||||
return SerializedType.SQL_TYPES;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ import javax.xml.datatype.DatatypeFactory;
|
|||
import javax.xml.datatype.XMLGregorianCalendar;
|
||||
|
||||
import org.hibernate.HibernateException;
|
||||
import org.hibernate.engine.spi.SessionImplementor;
|
||||
import org.hibernate.usertype.UserType;
|
||||
|
||||
/**
|
||||
|
@ -47,6 +48,7 @@ import org.hibernate.usertype.UserType;
|
|||
* Feb 21, 2012 #184 bphillip Initial creation
|
||||
* 4/9/2013 1802 bphillip Added null check
|
||||
* 7/29/2013 2191 bphillip Fixed equals method
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -99,10 +101,11 @@ public class XMLGregorianCalendarType implements UserType {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object nullSafeGet(ResultSet resultSet, String[] names, Object owner)
|
||||
public Object nullSafeGet(ResultSet rs, String[] names,
|
||||
SessionImplementor session, Object owner)
|
||||
throws HibernateException, SQLException {
|
||||
GregorianCalendar cal = new GregorianCalendar();
|
||||
Timestamp date = resultSet.getTimestamp(names[0]);
|
||||
Timestamp date = rs.getTimestamp(names[0]);
|
||||
if (date == null) {
|
||||
return null;
|
||||
}
|
||||
|
@ -117,16 +120,16 @@ public class XMLGregorianCalendarType implements UserType {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void nullSafeSet(PreparedStatement statement, Object value, int index)
|
||||
throws HibernateException, SQLException {
|
||||
public void nullSafeSet(PreparedStatement st, Object value, int index,
|
||||
SessionImplementor session) throws HibernateException, SQLException {
|
||||
if (value == null) {
|
||||
statement.setDate(index, null);
|
||||
st.setDate(index, null);
|
||||
} else {
|
||||
XMLGregorianCalendar cal = (XMLGregorianCalendar) value;
|
||||
statement.setTimestamp(index, new Timestamp(cal
|
||||
st.setTimestamp(index, new Timestamp(cal
|
||||
.toGregorianCalendar().getTime().getTime()));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -144,5 +147,4 @@ public class XMLGregorianCalendarType implements UserType {
|
|||
public int[] sqlTypes() {
|
||||
return XMLGregorianCalendarType.SQL_TYPES;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
116
edexOsgi/com.raytheon.uf.edex.dat.utils/src/com/raytheon/uf/edex/dat/utils/DatMenuUtil.java
Executable file → Normal file
116
edexOsgi/com.raytheon.uf.edex.dat.utils/src/com/raytheon/uf/edex/dat/utils/DatMenuUtil.java
Executable file → Normal file
|
@ -43,7 +43,6 @@ import com.raytheon.uf.common.monitor.config.FFMPRunConfigurationManager;
|
|||
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager.DATA_TYPE;
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
|
||||
import com.raytheon.uf.common.monitor.config.SCANRunSiteConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.xml.FFMPRunXML;
|
||||
import com.raytheon.uf.common.monitor.xml.ProductRunXML;
|
||||
|
@ -479,30 +478,29 @@ public class DatMenuUtil extends AbstractMenuUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates Safeseas Menu.
|
||||
* Creates SAFESEAS Menu.
|
||||
*/
|
||||
private void createSafeseasMenu() {
|
||||
FSSObsMonitorConfigurationManager ssConfig = FSSObsMonitorConfigurationManager
|
||||
.getInstance(MonName.ss.name());
|
||||
Set<String> ssStns = ssConfig.getStationIDs();
|
||||
StringBuilder stations = new StringBuilder();
|
||||
for (String s : ssStns) {
|
||||
if (stations.length() > 0) {
|
||||
stations.append(",");
|
||||
}
|
||||
stations.append(s);
|
||||
.getSsObsManager();
|
||||
Set<String> ssStns = ssConfig.getStationIDs();
|
||||
StringBuilder stations = new StringBuilder();
|
||||
for (String s : ssStns) {
|
||||
if (stations.length() > 0) {
|
||||
stations.append(",");
|
||||
}
|
||||
String ssStations = stations.toString();
|
||||
CommonMenuContributionFile safeMenuContributionFile = new CommonMenuContributionFile();
|
||||
safeMenuContributionFile.contribution = new CommonIncludeMenuItem[1];
|
||||
safeMenuContributionFile.contribution[0] = new CommonIncludeMenuItem();
|
||||
safeMenuContributionFile.contribution[0] = processOtherContribution(
|
||||
ssStations, "menus/safeseas/baseSafeSeas.xml",
|
||||
"menu:obs?before=EndOfMaritime", "SAFESEAS",
|
||||
safeMenuContributionFile.contribution[0]);
|
||||
toXml(safeMenuContributionFile, "menus" + File.separator
|
||||
+ "safeseas" + File.separator + "index.xml");
|
||||
ssConfig = null;
|
||||
stations.append(s);
|
||||
}
|
||||
String ssStations = stations.toString();
|
||||
CommonMenuContributionFile safeMenuContributionFile = new CommonMenuContributionFile();
|
||||
safeMenuContributionFile.contribution = new CommonIncludeMenuItem[1];
|
||||
safeMenuContributionFile.contribution[0] = new CommonIncludeMenuItem();
|
||||
safeMenuContributionFile.contribution[0] = processOtherContribution(
|
||||
ssStations, "menus/safeseas/baseSafeSeas.xml",
|
||||
"menu:obs?before=EndOfMaritime", "SAFESEAS",
|
||||
safeMenuContributionFile.contribution[0]);
|
||||
toXml(safeMenuContributionFile, "menus" + File.separator + "safeseas"
|
||||
+ File.separator + "index.xml");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -510,53 +508,51 @@ public class DatMenuUtil extends AbstractMenuUtil {
|
|||
*/
|
||||
private void createFogMenu() {
|
||||
FSSObsMonitorConfigurationManager fogConfig = FSSObsMonitorConfigurationManager
|
||||
.getInstance(MonName.fog.name());
|
||||
Set<String> fogStns = fogConfig.getStationIDs();
|
||||
StringBuilder stations = new StringBuilder();
|
||||
for (String s : fogStns) {
|
||||
if (stations.length() > 0) {
|
||||
stations.append(",");
|
||||
}
|
||||
stations.append(s);
|
||||
.getFogObsManager();
|
||||
Set<String> fogStns = fogConfig.getStationIDs();
|
||||
StringBuilder stations = new StringBuilder();
|
||||
for (String s : fogStns) {
|
||||
if (stations.length() > 0) {
|
||||
stations.append(",");
|
||||
}
|
||||
String fogStations = stations.toString();
|
||||
CommonMenuContributionFile fogMenuContributionFile = new CommonMenuContributionFile();
|
||||
fogMenuContributionFile.contribution = new CommonIncludeMenuItem[1];
|
||||
fogMenuContributionFile.contribution[0] = new CommonIncludeMenuItem();
|
||||
fogMenuContributionFile.contribution[0] = processOtherContribution(
|
||||
fogStations, "menus/fog/baseFog.xml",
|
||||
"menu:obs?after=FOGPLACEHOLDER", "Fog Monitor",
|
||||
fogMenuContributionFile.contribution[0]);
|
||||
toXml(fogMenuContributionFile, "menus" + File.separator + "fog"
|
||||
+ File.separator + "index.xml");
|
||||
fogConfig = null;
|
||||
stations.append(s);
|
||||
}
|
||||
String fogStations = stations.toString();
|
||||
CommonMenuContributionFile fogMenuContributionFile = new CommonMenuContributionFile();
|
||||
fogMenuContributionFile.contribution = new CommonIncludeMenuItem[1];
|
||||
fogMenuContributionFile.contribution[0] = new CommonIncludeMenuItem();
|
||||
fogMenuContributionFile.contribution[0] = processOtherContribution(
|
||||
fogStations, "menus/fog/baseFog.xml",
|
||||
"menu:obs?after=FOGPLACEHOLDER", "Fog Monitor",
|
||||
fogMenuContributionFile.contribution[0]);
|
||||
toXml(fogMenuContributionFile, "menus" + File.separator + "fog"
|
||||
+ File.separator + "index.xml");
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates Snow Menu.
|
||||
* Creates SNOW Menu.
|
||||
*/
|
||||
private void createSnowMenu() {
|
||||
FSSObsMonitorConfigurationManager snowConfig = FSSObsMonitorConfigurationManager
|
||||
.getInstance(MonName.snow.name());
|
||||
Set<String> snowStns = snowConfig.getStationIDs();
|
||||
StringBuilder stations = new StringBuilder();
|
||||
for (String s : snowStns) {
|
||||
if (stations.length() > 0) {
|
||||
stations.append(",");
|
||||
}
|
||||
stations.append(s);
|
||||
.getSnowObsManager();
|
||||
Set<String> snowStns = snowConfig.getStationIDs();
|
||||
StringBuilder stations = new StringBuilder();
|
||||
for (String s : snowStns) {
|
||||
if (stations.length() > 0) {
|
||||
stations.append(",");
|
||||
}
|
||||
String snowStations = stations.toString();
|
||||
CommonMenuContributionFile snowMenuContributionFile = new CommonMenuContributionFile();
|
||||
snowMenuContributionFile.contribution = new CommonIncludeMenuItem[1];
|
||||
snowMenuContributionFile.contribution[0] = new CommonIncludeMenuItem();
|
||||
snowMenuContributionFile.contribution[0] = processOtherContribution(
|
||||
snowStations, "menus/snow/baseSnow.xml",
|
||||
"menu:obs?after=SNOWPLACEHOLDER", "SNOW",
|
||||
snowMenuContributionFile.contribution[0]);
|
||||
toXml(snowMenuContributionFile, "menus" + File.separator + "snow"
|
||||
+ File.separator + "index.xml");
|
||||
snowConfig = null;
|
||||
stations.append(s);
|
||||
}
|
||||
String snowStations = stations.toString();
|
||||
CommonMenuContributionFile snowMenuContributionFile = new CommonMenuContributionFile();
|
||||
snowMenuContributionFile.contribution = new CommonIncludeMenuItem[1];
|
||||
snowMenuContributionFile.contribution[0] = new CommonIncludeMenuItem();
|
||||
snowMenuContributionFile.contribution[0] = processOtherContribution(
|
||||
snowStations, "menus/snow/baseSnow.xml",
|
||||
"menu:obs?after=SNOWPLACEHOLDER", "SNOW",
|
||||
snowMenuContributionFile.contribution[0]);
|
||||
toXml(snowMenuContributionFile, "menus" + File.separator + "snow"
|
||||
+ File.separator + "index.xml");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,7 +9,8 @@ Require-Bundle: com.raytheon.edex.common;bundle-version="1.11.1",
|
|||
com.raytheon.uf.edex.decodertools;bundle-version="1.0.0",
|
||||
org.geotools,
|
||||
javax.persistence,
|
||||
javax.measure
|
||||
javax.measure,
|
||||
com.raytheon.uf.common.status;bundle-version="1.14.1"
|
||||
Import-Package: com.raytheon.edex.plugin.obs.metar,
|
||||
com.raytheon.uf.common.dataplugin.obs.metar,
|
||||
com.raytheon.uf.common.wmo,
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
</bean>
|
||||
|
||||
<bean id="hmdbTxManager"
|
||||
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
|
||||
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
|
||||
<property name="sessionFactory" ref="hmdbSessionFactory" />
|
||||
</bean>
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ import org.hibernate.Criteria;
|
|||
import org.hibernate.HibernateException;
|
||||
import org.hibernate.criterion.CriteriaQuery;
|
||||
import org.hibernate.criterion.Criterion;
|
||||
import org.hibernate.engine.TypedValue;
|
||||
import org.hibernate.engine.spi.TypedValue;
|
||||
|
||||
/**
|
||||
* Hibernate criterion that allows for direct SQL restrictions
|
||||
|
@ -28,6 +28,7 @@ import org.hibernate.engine.TypedValue;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 20, 2013 bclement Initial creation
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
</bean>
|
||||
|
||||
<bean id="ihfsTxManager"
|
||||
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
|
||||
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
|
||||
<property name="sessionFactory" ref="ihfsSessionFactory" />
|
||||
</bean>
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
|||
</bean>
|
||||
|
||||
<bean id="damTxManager"
|
||||
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
|
||||
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
|
||||
<property name="sessionFactory" ref="damSessionFactory" />
|
||||
</bean>
|
||||
</beans>
|
|
@ -11,7 +11,8 @@ Require-Bundle: com.raytheon.uf.edex.plugin.acars;bundle-version="1.11.4",
|
|||
javax.measure,
|
||||
com.raytheon.edex.common,
|
||||
javax.persistence,
|
||||
com.raytheon.uf.edex.pointdata;bundle-version="1.12.1174"
|
||||
com.raytheon.uf.edex.pointdata;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.status;bundle-version="1.14.1"
|
||||
Import-Package: com.raytheon.uf.common.dataplugin.acars,
|
||||
com.raytheon.uf.common.dataplugin.acarssounding,
|
||||
com.raytheon.uf.common.pointdata.spatial,
|
||||
|
|
|
@ -29,6 +29,7 @@ import org.springframework.transaction.support.TransactionCallback;
|
|||
import com.raytheon.edex.db.dao.DefaultPluginDao;
|
||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||
import com.raytheon.uf.common.dataplugin.acarssounding.ACARSSoundingRecord;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||
import com.raytheon.uf.edex.plugin.acarssounding.tools.ACARSSoundingTools;
|
||||
|
||||
|
@ -126,7 +127,7 @@ public class ACARSSoundingDao extends DefaultPluginDao {
|
|||
String query = String.format(QUERY_TIMELIMITS, tailNumber, startTime,
|
||||
stopTime);
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
if (logger.isPriorityEnabled(Priority.DEBUG)) {
|
||||
logger.debug(query);
|
||||
}
|
||||
|
||||
|
|
71
edexOsgi/com.raytheon.uf.edex.plugin.fssobs/src/com/raytheon/uf/edex/plugin/fssobs/FSSObsGenerator.java
Executable file → Normal file
71
edexOsgi/com.raytheon.uf.edex.plugin.fssobs/src/com/raytheon/uf/edex/plugin/fssobs/FSSObsGenerator.java
Executable file → Normal file
|
@ -21,13 +21,14 @@
|
|||
package com.raytheon.uf.edex.plugin.fssobs;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.raytheon.edex.site.SiteUtil;
|
||||
import com.raytheon.edex.urifilter.URIFilter;
|
||||
import com.raytheon.edex.urifilter.URIGenerateMessage;
|
||||
import com.raytheon.uf.common.dataplugin.fssobs.FSSObsRecord;
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
|
||||
import com.raytheon.uf.common.monitor.events.MonitorConfigEvent;
|
||||
import com.raytheon.uf.common.monitor.events.MonitorConfigListener;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
|
@ -69,10 +70,17 @@ public class FSSObsGenerator extends CompositeProductGenerator implements
|
|||
/** Product */
|
||||
private static final String productType = "fssobs";
|
||||
|
||||
/** Sets of all stations to filter for */
|
||||
private HashSet<String> allStations = null;
|
||||
/** All stations to be filtered. */
|
||||
private Set<String> allStations = null;
|
||||
|
||||
private FSSObsMonitorConfigurationManager currManager = null;
|
||||
/** Fog monitor area configuration file */
|
||||
public FSSObsMonitorConfigurationManager fogAreaConfig = null;
|
||||
|
||||
/** SAFESEAS monitor area configuration file */
|
||||
public FSSObsMonitorConfigurationManager ssAreaConfig = null;
|
||||
|
||||
/** SNOW monitor area configuration file */
|
||||
public FSSObsMonitorConfigurationManager snowAreaConfig = null;
|
||||
|
||||
/**
|
||||
* Public construction
|
||||
|
@ -140,12 +148,14 @@ public class FSSObsGenerator extends CompositeProductGenerator implements
|
|||
+ " process Filter Config...");
|
||||
allStations = new HashSet<String>();
|
||||
|
||||
for (MonName mname : MonName.values()) {
|
||||
currManager = new FSSObsMonitorConfigurationManager(mname.name());
|
||||
currManager.addListener(this);
|
||||
allStations.addAll(currManager.getStations());
|
||||
currManager = null;
|
||||
}
|
||||
List<String> ssStations = getSSAreaConfig().getStations();
|
||||
allStations.addAll(ssStations);
|
||||
|
||||
List<String> fogStations = getFogAreaConfig().getStations();
|
||||
allStations.addAll(fogStations);
|
||||
|
||||
List<String> snowStations = getSnowAreaConfig().getStations();
|
||||
allStations.addAll(snowStations);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -187,4 +197,45 @@ public class FSSObsGenerator extends CompositeProductGenerator implements
|
|||
dmu.createMenus();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Fog monitor area configuration file.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public FSSObsMonitorConfigurationManager getFogAreaConfig() {
|
||||
if (fogAreaConfig == null) {
|
||||
fogAreaConfig = FSSObsMonitorConfigurationManager
|
||||
.getFogObsManager();
|
||||
fogAreaConfig.addListener(this);
|
||||
}
|
||||
return fogAreaConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets SAFESEAS monitor area configuration file.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public FSSObsMonitorConfigurationManager getSSAreaConfig() {
|
||||
if (ssAreaConfig == null) {
|
||||
ssAreaConfig = FSSObsMonitorConfigurationManager.getSsObsManager();
|
||||
ssAreaConfig.addListener(this);
|
||||
}
|
||||
return ssAreaConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets SNOW monitor area configuration file.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public FSSObsMonitorConfigurationManager getSnowAreaConfig() {
|
||||
if (snowAreaConfig == null) {
|
||||
snowAreaConfig = FSSObsMonitorConfigurationManager
|
||||
.getSnowObsManager();
|
||||
snowAreaConfig.addListener(this);
|
||||
}
|
||||
return snowAreaConfig;
|
||||
}
|
||||
}
|
||||
|
|
7
edexOsgi/com.raytheon.uf.edex.plugin.fssobs/src/com/raytheon/uf/edex/plugin/fssobs/FSSObsURIFilter.java
Executable file → Normal file
7
edexOsgi/com.raytheon.uf.edex.plugin.fssobs/src/com/raytheon/uf/edex/plugin/fssobs/FSSObsURIFilter.java
Executable file → Normal file
|
@ -3,7 +3,7 @@ package com.raytheon.uf.edex.plugin.fssobs;
|
|||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.TimeZone;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
@ -23,6 +23,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* Dec 5, 2012 #1351 skorolev Cleaned code
|
||||
* Feb 15, 2013 1638 mschenke Moved DataURINotificationMessage to uf.common.dataplugin
|
||||
* Sep 04, 2014 3220 skorolev Removed CWA from filter.
|
||||
* Oct 17, 2014 3220 skorolev Replaced HashSet with Set.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -53,7 +54,7 @@ public class FSSObsURIFilter extends URIFilter {
|
|||
private String dataType;
|
||||
|
||||
/** All filtered stations */
|
||||
private HashSet<String> stations = null;
|
||||
private Set<String> stations = null;
|
||||
|
||||
/** Date format **/
|
||||
private static String datePattern = "yyyy-MM-dd_HH:mm:ss.S";
|
||||
|
@ -72,7 +73,7 @@ public class FSSObsURIFilter extends URIFilter {
|
|||
* @param stations
|
||||
* for FSSObs filter
|
||||
*/
|
||||
public FSSObsURIFilter(String name, HashSet<String> stations) {
|
||||
public FSSObsURIFilter(String name, Set<String> stations) {
|
||||
super(name);
|
||||
logger.info("FSSObsFilter " + name + " Filter construction...");
|
||||
setDataTypes(new String[] { "obs", "sfcobs", "ldadmesonet" });
|
||||
|
|
|
@ -242,7 +242,7 @@ public class GridDao extends PluginDao {
|
|||
record.setInfo(GridInfoCache.getInstance().getGridInfo(
|
||||
record.getInfo()));
|
||||
} catch (DataAccessLayerException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
logger.handle(Priority.PROBLEM,
|
||||
"Cannot load GridInfoRecord from DB for: "
|
||||
+ record.getDataURI(), e);
|
||||
return false;
|
||||
|
@ -398,14 +398,14 @@ public class GridDao extends PluginDao {
|
|||
} else {
|
||||
GridInfoCache.getInstance().purgeCache(
|
||||
new ArrayList<Integer>(orphanedIds));
|
||||
statusHandler
|
||||
logger
|
||||
.warn("Unable to purge model cache of clustered edices");
|
||||
}
|
||||
}
|
||||
} catch (DataAccessLayerException e1) {
|
||||
statusHandler.error("Error purging orphaned grid info entries", e1);
|
||||
logger.error("Error purging orphaned grid info entries", e1);
|
||||
} catch (EdexException e) {
|
||||
statusHandler.error(
|
||||
logger.error(
|
||||
"Error sending message to purge grid info topic", e);
|
||||
}
|
||||
}
|
||||
|
|
11
edexOsgi/com.raytheon.uf.edex.plugin.loctables/src/com/raytheon/uf/edex/plugin/loctables/ingest/LocationTablesIngest.java
Executable file → Normal file
11
edexOsgi/com.raytheon.uf.edex.plugin.loctables/src/com/raytheon/uf/edex/plugin/loctables/ingest/LocationTablesIngest.java
Executable file → Normal file
|
@ -29,7 +29,6 @@ import org.apache.commons.logging.Log;
|
|||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
|
||||
import com.raytheon.uf.edex.ndm.ingest.IDataSetIngester;
|
||||
import com.raytheon.uf.edex.ndm.ingest.INationalDatasetSubscriber;
|
||||
import com.raytheon.uf.edex.plugin.loctables.util.CommonObsSpatialBuilder;
|
||||
|
@ -56,6 +55,7 @@ import com.raytheon.uf.edex.plugin.loctables.util.store.ObStationStoreStrategy;
|
|||
* Mar 06, 2014 2876 mpduff New NDM plugin.
|
||||
* Apr 28, 2014 3086 skorolev Updated setupLocalFiles method
|
||||
* Sep 04, 2014 3220 skorolev Removed parameter currentSite from FSSObs configuration managers.
|
||||
* Oct 17, 2014 3220 skorolev Corrected FSSObsMonitorConfigurationManager instances.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -128,12 +128,9 @@ public class LocationTablesIngest implements INationalDatasetSubscriber {
|
|||
private void setupLocalFiles() {
|
||||
List<FSSObsMonitorConfigurationManager> monitors = new ArrayList<FSSObsMonitorConfigurationManager>();
|
||||
|
||||
monitors.add(FSSObsMonitorConfigurationManager.getInstance(MonName.fog
|
||||
.name()));
|
||||
monitors.add(FSSObsMonitorConfigurationManager.getInstance(MonName.ss
|
||||
.name()));
|
||||
monitors.add(FSSObsMonitorConfigurationManager.getInstance(MonName.snow
|
||||
.name()));
|
||||
monitors.add(FSSObsMonitorConfigurationManager.getSsObsManager());
|
||||
monitors.add(FSSObsMonitorConfigurationManager.getFogObsManager());
|
||||
monitors.add(FSSObsMonitorConfigurationManager.getSnowObsManager());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -110,7 +110,7 @@ public class VIIRSDao extends PluginDao {
|
|||
coverage = (VIIRSSpatialCoverage) obj;
|
||||
break;
|
||||
} else {
|
||||
statusHandler.handle(Priority.WARN,
|
||||
logger.handle(Priority.WARN,
|
||||
"VIIRSSpatialCoverage lookup returned type of: "
|
||||
+ obj != null ? obj.getClass()
|
||||
.getSimpleName() : null);
|
||||
|
@ -118,7 +118,7 @@ public class VIIRSDao extends PluginDao {
|
|||
}
|
||||
}
|
||||
} catch (DataAccessLayerException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
logger.handle(Priority.PROBLEM,
|
||||
"Error querying for viirs spatial object", e);
|
||||
}
|
||||
return coverage;
|
||||
|
|
|
@ -18,22 +18,18 @@ of the Upper Air NDM menus.
|
|||
<menuEntry type="submenu" text="CPC Charts">
|
||||
<menuEntry type="productButton"
|
||||
text="6-10 day mean 500 Hgt" id="ua610daymean500Hgt">
|
||||
<menuEntry type="dataURI">/redbook/%/PHBV50/%</menuEntry>
|
||||
<menuEntry type="substitute" key="wmo" value="PHBV50"/>
|
||||
</menuEntry>
|
||||
<menuEntry type="productButton"
|
||||
text="8-14 day Mean 500 Hgt" id="ua814dayMean500Hgt">
|
||||
<menuEntry type="dataURI">/redbook/%/PHTT50/%</menuEntry>
|
||||
<menuEntry type="substitute" key="wmo" value="PHTT50"/>
|
||||
</menuEntry>
|
||||
<menuEntry type="productButton"
|
||||
text="6-10 day 500 Hgt Anomaly" id="ua610day500HgtAnomaly">
|
||||
<menuEntry type="dataURI">/redbook/%/PHNT50/%</menuEntry>
|
||||
<menuEntry type="substitute" key="wmo" value="PHNT50"/>
|
||||
</menuEntry>
|
||||
<menuEntry type="productButton"
|
||||
text="8-14 day 500 Anom" id="ua814day500Anom">
|
||||
<menuEntry type="dataURI">/redbook/%/PHTT51/%</menuEntry>
|
||||
<menuEntry type="substitute" key="wmo" value="PHTT51"/>
|
||||
</menuEntry>
|
||||
</menuEntry>
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
</bean>
|
||||
|
||||
<bean id="fxaTxManager"
|
||||
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
|
||||
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
|
||||
<property name="sessionFactory" ref="fxaSessionFactory" />
|
||||
</bean>
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ import org.hibernate.criterion.Order;
|
|||
import org.hibernate.criterion.ProjectionList;
|
||||
import org.hibernate.criterion.Projections;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
import org.springframework.orm.hibernate4.SessionFactoryUtils;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.text.db.OperationalStdTextProduct;
|
||||
import com.raytheon.uf.common.dataplugin.text.db.PracticeStdTextProduct;
|
||||
|
@ -91,6 +92,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
|||
* (operational or practice)
|
||||
* May 20, 2014 2536 bclement moved from edex.textdb to edex.plugin.text
|
||||
* Sep 18, 2014 3627 mapeters Updated deprecated {@link TimeTools} usage.
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
* </pre>
|
||||
*
|
||||
* @author garmendariz
|
||||
|
@ -907,7 +909,7 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
conn = session.connection();
|
||||
conn = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
|
||||
String ccc = null;
|
||||
|
||||
|
@ -1122,7 +1124,7 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = session.connection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
ps1 = c.prepareStatement(query1);
|
||||
ps2 = c.prepareStatement(query2);
|
||||
ps3 = c.prepareStatement(query3);
|
||||
|
@ -1246,7 +1248,7 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = session.connection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
ps1 = c.prepareStatement(query);
|
||||
ps1.setString(1, wmoId);
|
||||
ps1.setInt(2, startTimeSeconds);
|
||||
|
@ -1313,7 +1315,7 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = session.connection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
ps1 = c.prepareStatement(query1);
|
||||
ps2 = c.prepareStatement(query2);
|
||||
ps3 = c.prepareStatement(query3);
|
||||
|
@ -1437,7 +1439,7 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = session.connection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
ps1 = c.prepareStatement(query);
|
||||
ps1.setString(1, site);
|
||||
ps1.setInt(2, startTimeSeconds);
|
||||
|
@ -1504,7 +1506,7 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = session.connection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
ps1 = c.prepareStatement(query1);
|
||||
ps2 = c.prepareStatement(query2);
|
||||
ps1.setString(1, nnnId);
|
||||
|
@ -1600,7 +1602,7 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = session.connection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
ps1 = c.prepareStatement(query1);
|
||||
ps1.setString(1, wmoId);
|
||||
ps1.setString(2, site);
|
||||
|
@ -1667,7 +1669,7 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = session.connection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
ps1 = c.prepareStatement(query1);
|
||||
ps1.setString(1, wmoId);
|
||||
ps1.setString(2, site);
|
||||
|
@ -1760,7 +1762,7 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = session.connection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
int count = 0;
|
||||
|
||||
/*
|
||||
|
@ -1909,7 +1911,7 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = session.connection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
ps1 = c.prepareStatement(query);
|
||||
ps1.setString(1, wmoId);
|
||||
ps1.setString(2, site);
|
||||
|
@ -1967,7 +1969,7 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = session.connection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
ps1 = c.prepareStatement(hdrQuery);
|
||||
ps1.setString(1, wmoId);
|
||||
ps1.setString(2, site);
|
||||
|
@ -2057,7 +2059,7 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = session.connection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
ps1 = c.prepareStatement(hdrQuery);
|
||||
ps1.setString(1, wmoId);
|
||||
ps1.setString(2, site);
|
||||
|
@ -2154,7 +2156,7 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = session.connection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
|
||||
if (xxxId == null || xxxId.length() > 0) {
|
||||
ps1 = c.prepareStatement(noXxxQuery);
|
||||
|
@ -2255,7 +2257,7 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = session.connection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
|
||||
ps1 = c.prepareStatement(hdrQuery);
|
||||
ps1.setString(1, wmoId);
|
||||
|
@ -2352,7 +2354,7 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = session.connection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
|
||||
ps1 = c.prepareStatement(hdrQuery);
|
||||
ps1.setString(1, wmoId);
|
||||
|
@ -2452,7 +2454,7 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = session.connection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
|
||||
switch (intlProd) {
|
||||
case 0: // fall through
|
||||
|
@ -2576,7 +2578,7 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = session.connection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
|
||||
switch (intlProd) {
|
||||
case 0: // fall through
|
||||
|
@ -2681,7 +2683,7 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = session.connection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
ret = read_product(c, wmoId, site, cccId, nnnId, xxxId, version);
|
||||
} catch (SQLException e) {
|
||||
// don't need to worry about rolling back transaction
|
||||
|
|
|
@ -25,7 +25,10 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.Query;
|
||||
import org.springframework.transaction.TransactionStatus;
|
||||
import org.springframework.transaction.support.TransactionCallback;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.text.db.SubscriptionRecord;
|
||||
|
@ -53,6 +56,7 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery;
|
|||
* 04/24/13 1949 rjpeter Removed @Override on delete.
|
||||
* Nov 08, 2013 2361 njensen Chaged method signature of saveOrUpdate(Object)
|
||||
* May 22, 2014 2536 bclement moved from autobldsrv to edex.plugin.text
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
* </pre>
|
||||
*
|
||||
* @author mfegan
|
||||
|
@ -146,10 +150,9 @@ public class SubscriptionDAO extends CoreDao {
|
|||
*
|
||||
* @return the list of subscriptions
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<SubscriptionRecord> getSubscriptions() {
|
||||
if ((cachedRecords == null) || dirtyRecords) {
|
||||
List<?> retVal = getHibernateTemplate().loadAll(this.daoClass);
|
||||
List<SubscriptionRecord> retVal = loadAll();
|
||||
if (retVal == null) {
|
||||
logger.info("Unable to perform query, 'null' result returned");
|
||||
cachedRecords = new ArrayList<SubscriptionRecord>();
|
||||
|
@ -162,6 +165,20 @@ public class SubscriptionDAO extends CoreDao {
|
|||
return cachedRecords;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private List<SubscriptionRecord> loadAll() {
|
||||
return (List<SubscriptionRecord>) txTemplate
|
||||
.execute(new TransactionCallback<List<?>>() {
|
||||
@Override
|
||||
public List<SubscriptionRecord> doInTransaction(
|
||||
TransactionStatus status) {
|
||||
Criteria criteria = getSession().createCriteria(
|
||||
daoClass);
|
||||
return criteria.list();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param props
|
||||
|
@ -204,7 +221,7 @@ public class SubscriptionDAO extends CoreDao {
|
|||
return new ArrayList<SubscriptionRecord>();
|
||||
}
|
||||
} catch (DataAccessLayerException e) {
|
||||
logger.info("Unable to perform query, ", e);
|
||||
logger.error("Unable to perform query, ", e);
|
||||
return new ArrayList<SubscriptionRecord>();
|
||||
}
|
||||
rval = (List<SubscriptionRecord>) retVal;
|
||||
|
|
|
@ -70,6 +70,7 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil;
|
|||
* 10/23/2013 1538 bphillip Changed send time slot to be DateTimeValue instead of integer
|
||||
* 12/2/2013 1829 bphillip Changed to use non generic getter of value type
|
||||
* 01/21/2014 2613 bphillip Modified queries to better handle deletes
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -137,7 +138,7 @@ public class AuditableEventTypeDao extends
|
|||
|
||||
@Override
|
||||
public void create(AuditableEventType event) {
|
||||
template.save(event);
|
||||
getCurrentSession().save(event);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -45,7 +45,7 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType;
|
|||
|
||||
import org.apache.commons.beanutils.PropertyUtils;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.hibernate.cfg.AnnotationConfiguration;
|
||||
import org.hibernate.cfg.Configuration;
|
||||
import org.hibernate.jdbc.Work;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
@ -95,6 +95,7 @@ import com.raytheon.uf.edex.registry.ebxml.init.RegistryInitializedListener;
|
|||
* 7/10/2014 1717 bphillip Removed xacml policy admin object
|
||||
* Jul 10, 2014 2914 garmendariz Remove EnvProperties
|
||||
* Jul 28, 2014 3474 dhladky Fixed bad ownership settings.
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
|
@ -319,12 +320,12 @@ public class DbInit extends com.raytheon.uf.edex.database.init.DbInit implements
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected AnnotationConfiguration getAnnotationConfiguration() {
|
||||
protected Configuration getConfiguration() {
|
||||
/*
|
||||
* Create a new configuration object which holds all the classes that
|
||||
* this Hibernate SessionFactory is aware of
|
||||
*/
|
||||
AnnotationConfiguration aConfig = new AnnotationConfiguration();
|
||||
Configuration aConfig = new Configuration();
|
||||
for (Object obj : sessionFactory.getAllClassMetadata().keySet()) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName((String) obj);
|
||||
|
|
|
@ -23,8 +23,8 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.hibernate.cfg.AnnotationConfiguration;
|
||||
import org.hibernate.impl.SessionFactoryImpl;
|
||||
import org.hibernate.cfg.Configuration;
|
||||
import org.hibernate.internal.SessionFactoryImpl;
|
||||
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
|
@ -39,6 +39,7 @@ import com.raytheon.uf.common.status.UFStatus;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 15, 2013 1693 djohnson Initial creation
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -63,7 +64,7 @@ public class EbxmlPostgresValidationStrategy implements
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean isDbValid(AnnotationConfiguration aConfig,
|
||||
public boolean isDbValid(Configuration aConfig,
|
||||
SessionFactory sessionFactory) {
|
||||
statusHandler.info("Verifying RegRep database...");
|
||||
final List<String> existingTables = new ArrayList<String>();
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
package com.raytheon.uf.edex.registry.ebxml.dao;
|
||||
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.hibernate.cfg.AnnotationConfiguration;
|
||||
import org.hibernate.cfg.Configuration;
|
||||
|
||||
/**
|
||||
* Database validation strategy.
|
||||
|
@ -32,6 +32,7 @@ import org.hibernate.cfg.AnnotationConfiguration;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 15, 2013 1693 djohnson Initial creation
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -51,7 +52,7 @@ public interface IEbxmlDatabaseValidationStrategy {
|
|||
* the session factory
|
||||
* @return true if valid
|
||||
*/
|
||||
boolean isDbValid(AnnotationConfiguration aConfig,
|
||||
boolean isDbValid(Configuration aConfig,
|
||||
SessionFactory sessionFactory);
|
||||
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
|
|||
* 2/13/2014 2769 bphillip Added read only flags to query methods
|
||||
* 4/11/2014 3011 bphillip Changed merge to not delete unused slots
|
||||
* 4/21/2014 2992 dhladky General list of Registry server nodes.
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -89,7 +90,7 @@ public class RegistryObjectDao extends
|
|||
public void merge(RegistryObjectType newObject,
|
||||
RegistryObjectType existingObject) {
|
||||
newObject.setId(existingObject.getId());
|
||||
template.merge(newObject);
|
||||
getCurrentSession().merge(newObject);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -168,7 +169,7 @@ public class RegistryObjectDao extends
|
|||
* The persistent object to delete
|
||||
*/
|
||||
public void deleteWithoutMerge(RegistryObjectType obj) {
|
||||
this.template.delete(obj);
|
||||
getCurrentSession().delete(obj);
|
||||
}
|
||||
|
||||
public void deleteObjectWithoutDeletingChildren(RegistryObjectType obj)
|
||||
|
|
|
@ -26,7 +26,6 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType;
|
|||
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.hibernate.criterion.Property;
|
||||
import org.springframework.orm.hibernate3.HibernateTemplate;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
@ -47,6 +46,7 @@ import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants;
|
|||
* 8/1/2013 1693 bphillip Moved the merge method down to RegistryObjectDao
|
||||
* 10/8/2013 1682 bphillip Added like lid method, changed to use criteria queries for simple operations
|
||||
* 2/13/2014 2769 bphillip Added read only flags to query methods
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -245,7 +245,7 @@ public abstract class RegistryObjectTypeDao<ENTITY extends RegistryObjectType>
|
|||
|
||||
@Override
|
||||
public void setSessionFactory(SessionFactory sessionFactory) {
|
||||
template = new HibernateTemplate(sessionFactory);
|
||||
this.sessionFactory = sessionFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -43,6 +43,7 @@ import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants;
|
|||
* 7/11/2013 1707 bphillip Initial implementation
|
||||
* 7/29/2013 2191 bphillip Modified method to get orphaned slots
|
||||
* 12/2/2013 1829 bphillip Changed how orphans are purged
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
|
@ -84,13 +85,15 @@ public class SlotTypeDao extends SessionManagedDao<String, SlotType> {
|
|||
public void deleteBySlotId(String id) {
|
||||
SlotType slot = this.getById(id);
|
||||
if (slot != null) {
|
||||
this.template.delete(slot);
|
||||
getCurrentSession().delete(slot);
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteBySlotId(Collection<String> ids){
|
||||
template.deleteAll(createCriteria().add(
|
||||
for(Object obj: createCriteria().add(
|
||||
Property.forName(QueryConstants.ID).in(ids))
|
||||
.list());
|
||||
.list()){
|
||||
getCurrentSession().delete(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
|
|||
* 3/13/2013 1082 bphillip Initial creation
|
||||
* 9/5/2013 1538 bphillip Added eagerLoadAll method
|
||||
* 2/13/2014 2769 bphillip Added read only flags to query methods
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -78,8 +79,7 @@ public class SubscriptionDao extends RegistryObjectTypeDao<SubscriptionType> {
|
|||
*/
|
||||
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
|
||||
public List<SubscriptionType> eagerLoadAll() throws EbxmlRegistryException {
|
||||
List<SubscriptionType> subs = this.template
|
||||
.loadAll(SubscriptionType.class);
|
||||
List<SubscriptionType> subs = super.loadAll();
|
||||
for (SubscriptionType sub : subs) {
|
||||
try {
|
||||
/*
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
|
||||
<filter>
|
||||
<filter-name>hibernateFilter</filter-name>
|
||||
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
|
||||
<filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter</filter-class>
|
||||
<init-param>
|
||||
<param-name>singleSession</param-name>
|
||||
<param-value>true</param-value>
|
||||
|
|
|
@ -43,7 +43,7 @@ import org.hibernate.criterion.Disjunction;
|
|||
import org.hibernate.criterion.Junction;
|
||||
import org.hibernate.criterion.MatchMode;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
import org.hibernatespatial.criterion.SpatialRestrictions;
|
||||
import org.hibernate.spatial.criterion.SpatialRestrictions;
|
||||
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
|
@ -64,6 +64,7 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 22, 2011 bclement Initial creation
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
@ -42,8 +42,8 @@ import org.hibernate.criterion.Criterion;
|
|||
import org.hibernate.criterion.Disjunction;
|
||||
import org.hibernate.criterion.MatchMode;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
import org.hibernatespatial.criterion.SpatialRelateExpression;
|
||||
import org.hibernatespatial.criterion.SpatialRestrictions;
|
||||
import org.hibernate.spatial.criterion.SpatialRelateExpression;
|
||||
import org.hibernate.spatial.criterion.SpatialRestrictions;
|
||||
|
||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||
import com.raytheon.uf.edex.ogc.common.db.SQLParamRestriction;
|
||||
|
@ -73,6 +73,7 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 17, 2012 bclement Initial creation
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.opengis.filter.v_1_1_0.FilterType;
|
|||
|
||||
import org.geotools.geometry.jts.JTS;
|
||||
import org.hibernate.criterion.Criterion;
|
||||
import org.hibernatespatial.criterion.SpatialRestrictions;
|
||||
import org.hibernate.spatial.criterion.SpatialRestrictions;
|
||||
import org.opengis.feature.simple.SimpleFeature;
|
||||
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
|
@ -62,6 +62,7 @@ import com.vividsolutions.jts.geom.Polygon;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 29, 2011 bclement Initial creation
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
@ -26,8 +26,8 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.hibernate.classic.Session;
|
||||
import org.hibernate.criterion.Criterion;
|
||||
import org.hibernate.criterion.Order;
|
||||
import org.hibernate.criterion.Projections;
|
||||
|
@ -55,6 +55,7 @@ import com.raytheon.uf.edex.wfs.request.SortBy;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* May 9, 2012 bclement Initial creation
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
@ -9,7 +9,6 @@ import org.hibernate.Criteria;
|
|||
import org.hibernate.Session;
|
||||
import org.hibernate.criterion.Criterion;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
import org.springframework.orm.hibernate3.HibernateTemplate;
|
||||
import org.springframework.transaction.TransactionStatus;
|
||||
import org.springframework.transaction.support.TransactionCallback;
|
||||
|
||||
|
@ -27,6 +26,7 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery;
|
|||
* ------------ ---------- ---------------- --------------------------
|
||||
* 08/14/2013 T989 qzhou Initial creation.
|
||||
* 03/13/2014 sgurung Added method purgeDataByRefTime()
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
* </pre>
|
||||
*
|
||||
* @author qzhou
|
||||
|
@ -63,8 +63,7 @@ public class GeoMagAvgDao extends CoreDao {
|
|||
return (List<GeoMagAvg>) txTemplate.execute(new TransactionCallback() {
|
||||
@Override
|
||||
public Object doInTransaction(TransactionStatus status) {
|
||||
HibernateTemplate ht = getHibernateTemplate();
|
||||
Session sess = ht.getSessionFactory().getCurrentSession();
|
||||
Session sess = getCurrentSession();
|
||||
Criteria crit = sess.createCriteria(GeoMagAvg.class);
|
||||
Criterion where1 = Restrictions.eq("stationCode", stationCode);
|
||||
crit.add(where1);
|
||||
|
@ -82,8 +81,7 @@ public class GeoMagAvgDao extends CoreDao {
|
|||
return (List<GeoMagAvg>) txTemplate.execute(new TransactionCallback() {
|
||||
@Override
|
||||
public Object doInTransaction(TransactionStatus status) {
|
||||
HibernateTemplate ht = getHibernateTemplate();
|
||||
Session sess = ht.getSessionFactory().getCurrentSession();
|
||||
Session sess = getCurrentSession();
|
||||
Criteria crit = sess.createCriteria(GeoMagAvg.class);
|
||||
Criterion where1 = Restrictions.eq("stationCode", stationCode);
|
||||
crit.add(where1);
|
||||
|
|
|
@ -9,7 +9,6 @@ import org.hibernate.Criteria;
|
|||
import org.hibernate.Session;
|
||||
import org.hibernate.criterion.Criterion;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
import org.springframework.orm.hibernate3.HibernateTemplate;
|
||||
import org.springframework.transaction.TransactionStatus;
|
||||
import org.springframework.transaction.support.TransactionCallback;
|
||||
|
||||
|
@ -28,6 +27,7 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery;
|
|||
* 08/14/2013 T989 qzhou Initial creation.
|
||||
* 03/03/2014 #1110 qzhou Added method getRangeK1min(), Cleaned code
|
||||
* 03/13/2014 sgurung Added method purgeDataByRefTime()
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
* </pre>
|
||||
*
|
||||
* @author qzhou
|
||||
|
@ -55,9 +55,7 @@ public class GeoMagK1minDao extends CoreDao {
|
|||
.execute(new TransactionCallback() {
|
||||
@Override
|
||||
public Object doInTransaction(TransactionStatus status) {
|
||||
HibernateTemplate ht = getHibernateTemplate();
|
||||
Session sess = ht.getSessionFactory()
|
||||
.getCurrentSession();
|
||||
Session sess = getCurrentSession();
|
||||
Criteria crit = sess.createCriteria(GeoMagK1min.class);
|
||||
Criterion where1 = Restrictions.eq("stationCode",
|
||||
stationCode);
|
||||
|
@ -80,9 +78,7 @@ public class GeoMagK1minDao extends CoreDao {
|
|||
.execute(new TransactionCallback() {
|
||||
@Override
|
||||
public Object doInTransaction(TransactionStatus status) {
|
||||
HibernateTemplate ht = getHibernateTemplate();
|
||||
Session sess = ht.getSessionFactory()
|
||||
.getCurrentSession();
|
||||
Session sess = getCurrentSession();
|
||||
Criteria crit = sess.createCriteria(GeoMagK1min.class);
|
||||
Criterion where1 = Restrictions.eq("stationCode",
|
||||
stationCode);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue