Merge branch 'omaha_14.4.1' into omaha_pda
Former-commit-id: 1cbff6bc3dd08f5123e8ad052ad89e548ee63578
This commit is contained in:
commit
b5377ec6f1
138 changed files with 9270 additions and 8107 deletions
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<contribute xsi:type="bundleItem" file="bundles/ConvSigmet.xml"
|
||||
menuText="Convective SIGMET" id="ConvSigmet">
|
||||
</contribute>
|
||||
</menuTemplate>
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<contribute xsi:type="bundleItem" file="bundles/NonConvSigmet.xml"
|
||||
menuText="SIGMET" id="SIGMETICING">
|
||||
<substitute key="hazardType" value="ICING" />
|
||||
<substitute key="color" value="#FFFFFF" />
|
||||
<substitute key="name" value="Icing SIGMET" />
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/Airmet.xml"
|
||||
menuText="AIRMET" id="AIRMETICING">
|
||||
<substitute key="hazardType" value="ICING" />
|
||||
<substitute key="color" value="#0000FF" />
|
||||
<substitute key="name" value="Icing AIRMET" />
|
||||
</contribute>
|
||||
</menuTemplate>
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<contribute xsi:type="bundleItem" file="bundles/NonConvSigmet.xml"
|
||||
menuText="SIGMET" id="SIGMETTTOPCYCLONE">
|
||||
<substitute key="hazardType" value="TROPICAL CYCLONE" />
|
||||
<substitute key="color" value="#00FFFF" />
|
||||
<substitute key="name" value="Tropical Cyclone SIGMET" />
|
||||
</contribute>
|
||||
</menuTemplate>
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<contribute xsi:type="bundleItem" file="bundles/NonConvSigmet.xml"
|
||||
menuText="SIGMET" id="SIGMETTURB">
|
||||
<substitute key="hazardType" value="TURBULENCE" />
|
||||
<substitute key="color" value="#FF4444" />
|
||||
<substitute key="name" value="Turbulence SIGMET" />
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/Airmet.xml"
|
||||
menuText="AIRMET" id="AIRMETTURB">
|
||||
<substitute key="hazardType" value="TURBULENCE" />
|
||||
<substitute key="color" value="#00FF00" />
|
||||
<substitute key="name" value="Turbulence AIRMET" />
|
||||
</contribute>
|
||||
</menuTemplate>
|
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<contribute xsi:type="subMenu" menuText="AIRMET">
|
||||
<contribute xsi:type="bundleItem" file="bundles/Airmet.xml"
|
||||
menuText="IFR" id="AIRMETIFR">
|
||||
<substitute key="hazardType" value="INSTRUMENT FLIGHT RULES" />
|
||||
<substitute key="color" value="#00FFFF" />
|
||||
<substitute key="name" value="IFR AIRMET" />
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/Airmet.xml"
|
||||
menuText="Mtn Obscn" id="AIRMETMTNOBSC">
|
||||
<substitute key="hazardType" value="MOUNTAIN OBSCURATION" />
|
||||
<substitute key="color" value="#FF0088" />
|
||||
<substitute key="name" value="Mtn Obscn AIRMET" />
|
||||
</contribute>
|
||||
</contribute>
|
||||
</menuTemplate>
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<contribute xsi:type="bundleItem" file="bundles/NonConvSigmet.xml"
|
||||
menuText="SIGMET" id="SIGMETVOLCANICASH">
|
||||
<substitute key="hazardType" value="VOLCANIC ASH CLOUD" />
|
||||
<substitute key="color" value="#00FF00" />
|
||||
<substitute key="name" value="Volcanic Ash SIGMET" />
|
||||
</contribute>
|
||||
</menuTemplate>
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<menuContributionFile>
|
||||
<include installTo="menu:Aviation?after=ConvectionProductsStart"
|
||||
fileName="menus/aviationadvisory/baseAviationConvectionProducts.xml" />
|
||||
<include installTo="menu:Aviation?before=IcingProductsEnd"
|
||||
fileName="menus/aviationadvisory/baseAviationIcingProducts.xml" />
|
||||
<include installTo="menu:Aviation?before=TurbulenceProductsEnd"
|
||||
fileName="menus/aviationadvisory/baseAviationTurbulenceProducts.xml" />
|
||||
<include installTo="menu:Aviation?before=VisibilityProductsEnd"
|
||||
fileName="menus/aviationadvisory/baseAviationVisibilityProducts.xml" />
|
||||
<include installTo="menu:Aviation?before=TropicalCycloneEnd"
|
||||
fileName="menus/aviationadvisory/baseAviationTropicalCyclone.xml" />
|
||||
<include installTo="menu:Aviation?after=VolcanicAshStart"
|
||||
fileName="menus/aviationadvisory/baseAviationVolcanicAsh.xml" />
|
||||
</menuContributionFile>
|
|
@ -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,14 +591,22 @@ public abstract class AbstractSessionView<T extends IUser> extends
|
|||
}
|
||||
|
||||
@Subscribe
|
||||
public void changeFont(FontData data) {
|
||||
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(), data);
|
||||
messagesTextFont = new Font(Display.getCurrent(), event.getFont());
|
||||
messagesText.setFont(messagesTextFont);
|
||||
if (oldFont != null) {
|
||||
oldFont.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setAlertWords(List<AlertWord> words) {
|
||||
alertWords = words;
|
||||
|
|
|
@ -2,6 +2,5 @@
|
|||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
|
|
@ -2,15 +2,13 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: D2D Upper Air
|
||||
Bundle-SymbolicName: com.raytheon.uf.viz.d2d.ui.upperair;singleton:=true
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-Activator: com.raytheon.uf.viz.d2d.ui.upperair.Activator
|
||||
Bundle-Version: 1.14.0.qualifier
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Require-Bundle: org.eclipse.core.runtime,
|
||||
com.raytheon.uf.viz.d2d.ui;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.d2d.nsharp;bundle-version="1.0.0",
|
||||
com.raytheon.uf.viz.profiler;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.pointdata;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.aviation.advisory;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.vaa;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.cwa;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.bufrsigwx;bundle-version="1.12.1174",
|
||||
|
@ -20,5 +18,5 @@ Require-Bundle: org.eclipse.core.runtime,
|
|||
com.raytheon.uf.viz.ncwf;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.lpi;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.spi;bundle-version="1.12.1174"
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||
Bundle-ActivationPolicy: lazy
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
localization/,\
|
||||
|
|
|
@ -19,86 +19,54 @@
|
|||
further_licensing_information.
|
||||
-->
|
||||
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<contribute xsi:type="subMenu" menuText="Aviation">
|
||||
<contribute xsi:type="titleItem" titleText="------ Convection Products ------" />
|
||||
<contribute xsi:type="bundleItem" file="bundles/ConvSigmet.xml"
|
||||
menuText="Convective SIGMET" id="ConvSigmet">
|
||||
<contribute xsi:type="subMenu" id="Aviation" menuText="Aviation">
|
||||
<contribute xsi:type="titleItem"
|
||||
titleText="------ Convection Products ------" />
|
||||
<contribute xsi:type="separator" id="ConvectionProductsStart"
|
||||
visible="false" />
|
||||
<contribute xsi:type="bundleItem" file="bundles/BufrNcwf.xml"
|
||||
menuText="NCWF" id="NCWF">
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/BufrNcwf.xml" menuText="NCWF" id="NCWF">
|
||||
</contribute>
|
||||
<contribute xsi:type="separator" id="separator1"/>
|
||||
<contribute xsi:type="separator" id="ConvectionProductsEnd" />
|
||||
|
||||
<contribute xsi:type="titleItem" titleText="------ Icing Products ------" />
|
||||
<contribute xsi:type="bundleItem" file="bundles/NonConvSigmet.xml" menuText="SIGMET" id="SIGMETICING">
|
||||
<substitute key="hazardType" value="ICING"/>
|
||||
<substitute key="color" value="#FFFFFF"/>
|
||||
<substitute key="name" value="Icing SIGMET"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/Airmet.xml" menuText="AIRMET" id="AIRMETICING">
|
||||
<substitute key="hazardType" value="ICING"/>
|
||||
<substitute key="color" value="#0000FF"/>
|
||||
<substitute key="name" value="Icing AIRMET"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="separator" id="separator2"/>
|
||||
<contribute xsi:type="separator" id="IcingProductsEnd" />
|
||||
|
||||
<contribute xsi:type="titleItem" titleText="------ Turbulence Products ------" />
|
||||
<contribute xsi:type="bundleItem" file="bundles/NonConvSigmet.xml" menuText="SIGMET" id="SIGMETTURB">
|
||||
<substitute key="hazardType" value="TURBULENCE"/>
|
||||
<substitute key="color" value="#FF4444"/>
|
||||
<substitute key="name" value="Turbulence SIGMET"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/Airmet.xml" menuText="AIRMET" id="AIRMETTURB">
|
||||
<substitute key="hazardType" value="TURBULENCE"/>
|
||||
<substitute key="color" value="#00FF00"/>
|
||||
<substitute key="name" value="Turbulence AIRMET"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="separator" id="separator3"/>
|
||||
<contribute xsi:type="titleItem"
|
||||
titleText="------ Turbulence Products ------" />
|
||||
<contribute xsi:type="separator" id="TurbulenceProductsEnd" />
|
||||
|
||||
<contribute xsi:type="titleItem" titleText="------ Visibility Products ------" />
|
||||
<contribute xsi:type="subMenu" menuText="AIRMET">
|
||||
<contribute xsi:type="bundleItem" file="bundles/Airmet.xml" menuText="IFR" id="AIRMETIFR">
|
||||
<substitute key="hazardType" value="INSTRUMENT FLIGHT RULES"/>
|
||||
<substitute key="color" value="#00FFFF"/>
|
||||
<substitute key="name" value="IFR AIRMET"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/Airmet.xml" menuText="Mtn Obscn" id="AIRMETMTNOBSC">
|
||||
<substitute key="hazardType" value="MOUNTAIN OBSCURATION"/>
|
||||
<substitute key="color" value="#FF0088"/>
|
||||
<substitute key="name" value="Mtn Obscn AIRMET"/>
|
||||
</contribute>
|
||||
</contribute>
|
||||
<contribute xsi:type="separator" id="separator4"/>
|
||||
<contribute xsi:type="titleItem"
|
||||
titleText="------ Visibility Products ------" />
|
||||
<contribute xsi:type="separator" id="VisibilityProductsEnd" />
|
||||
|
||||
<contribute xsi:type="titleItem" titleText="------ Tropical Cyclone ------" />
|
||||
<contribute xsi:type="bundleItem" file="bundles/NonConvSigmet.xml" menuText="SIGMET" id="SIGMETTTOPCYCLONE">
|
||||
<substitute key="hazardType" value="TROPICAL CYCLONE"/>
|
||||
<substitute key="color" value="#00FFFF"/>
|
||||
<substitute key="name" value="Tropical Cyclone SIGMET"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="separator" id="separator5"/>
|
||||
<contribute xsi:type="separator" id="TropicalCycloneEnd" />
|
||||
|
||||
<contribute xsi:type="titleItem" titleText="------ Volcanic Ash ------" />
|
||||
<contribute xsi:type="bundleItem" file="bundles/NonConvSigmet.xml" menuText="SIGMET" id="SIGMETVOLCANICASH">
|
||||
<substitute key="hazardType" value="VOLCANIC ASH CLOUD"/>
|
||||
<substitute key="color" value="#00FF00"/>
|
||||
<substitute key="name" value="Volcanic Ash SIGMET"/>
|
||||
<contribute xsi:type="separator" id="VolcanicAshStart"
|
||||
visible="false" />
|
||||
<contribute xsi:type="bundleItem" file="bundles/VAA.xml"
|
||||
menuText="Volcanic Ash Advisories" id="VAA">
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/VAA.xml" menuText="Volcanic Ash Advisories" id="VAA">
|
||||
</contribute>
|
||||
<contribute xsi:type="separator" id="separator6"/>
|
||||
<contribute xsi:type="separator" id="VolcanicAshEnd" />
|
||||
|
||||
<contribute xsi:type="titleItem" titleText="------Center Weather ------" />
|
||||
<contribute xsi:type="bundleItem" file="bundles/CWA.xml" menuText="Center Weather Advisories" id="cwa">
|
||||
<contribute xsi:type="bundleItem" file="bundles/CWA.xml"
|
||||
menuText="Center Weather Advisories" id="cwa">
|
||||
</contribute>
|
||||
<contribute xsi:type="separator" id="separator7"/>
|
||||
<contribute xsi:type="separator" id="CenterWeatherEnd" />
|
||||
|
||||
<contribute xsi:type="titleItem" titleText="------Significant Weather------" />
|
||||
<contribute xsi:type="bundleItem" file="bundles/BufrSigWx.xml" menuText="Medium Level" id="SigWxMedium">
|
||||
<contribute xsi:type="titleItem"
|
||||
titleText="------Significant Weather------" />
|
||||
<contribute xsi:type="bundleItem" file="bundles/BufrSigWx.xml"
|
||||
menuText="Medium Level" id="SigWxMedium">
|
||||
<substitute key="wxLayer" value="SWM" />
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/BufrSigWx.xml" menuText="High Level" id="SigWxHigh">
|
||||
<contribute xsi:type="bundleItem" file="bundles/BufrSigWx.xml"
|
||||
menuText="High Level" id="SigWxHigh">
|
||||
<substitute key="wxLayer" value="SWH" />
|
||||
</contribute>
|
||||
</contribute>
|
||||
<contribute xsi:type="separator" id="separator8"/>
|
||||
<contribute xsi:type="separator" id="AviationMenuEnd" />
|
||||
</menuTemplate>
|
|
@ -1,30 +0,0 @@
|
|||
package com.raytheon.uf.viz.d2d.ui.upperair;
|
||||
|
||||
import org.osgi.framework.BundleActivator;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
public class Activator implements BundleActivator {
|
||||
|
||||
private static BundleContext context;
|
||||
|
||||
static BundleContext getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void start(BundleContext bundleContext) throws Exception {
|
||||
Activator.context = bundleContext;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void stop(BundleContext bundleContext) throws Exception {
|
||||
Activator.context = null;
|
||||
}
|
||||
|
||||
}
|
|
@ -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,7 +179,7 @@ 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();
|
||||
|
@ -188,14 +189,15 @@ public class FogMonitorMeteoTab extends TabItemComp implements
|
|||
* 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));
|
||||
fmmd.setMeteoVisR(ftm.getThresholdValue(duKey, threshKeyR,
|
||||
areaID, xmlKey));
|
||||
fmmd.setMeteoVisY(ftm.getThresholdValue(duKey, threshKeyY,
|
||||
areaID, xmlKey));
|
||||
|
||||
fogDataArray.add(fmmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Data At First Selection
|
||||
|
|
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,28 +47,27 @@ import com.raytheon.uf.viz.monitor.xml.ThresholdsXML;
|
|||
* 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
|
||||
*/
|
||||
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)
|
||||
{
|
||||
protected void createListHeader(Composite parentComp) {
|
||||
Composite lblComp = new Composite(parentComp, SWT.NONE);
|
||||
GridLayout gl = new GridLayout(5, false);
|
||||
gl.horizontalSpacing = 0;
|
||||
|
@ -95,16 +94,13 @@ public class SSMonitorMeteoTab extends TabItemComp implements IUpdateMonitorMete
|
|||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
|
@ -120,8 +116,7 @@ public class SSMonitorMeteoTab extends TabItemComp implements IUpdateMonitorMete
|
|||
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);
|
||||
|
@ -167,12 +162,9 @@ public class SSMonitorMeteoTab extends TabItemComp implements IUpdateMonitorMete
|
|||
*/
|
||||
sb.append(" ");
|
||||
|
||||
if (update == true)
|
||||
{
|
||||
if (update == true) {
|
||||
dataList.setItem(i, sb.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
dataList.add(sb.toString());
|
||||
}
|
||||
}
|
||||
|
@ -180,8 +172,7 @@ public class SSMonitorMeteoTab extends TabItemComp implements IUpdateMonitorMete
|
|||
packListControls();
|
||||
}
|
||||
|
||||
private void createDataArray()
|
||||
{
|
||||
private void createDataArray() {
|
||||
ssDataArray = new ArrayList<SSMonitorMeteoData>();
|
||||
|
||||
SSThresholdMgr sstm = SSThresholdMgr.getInstance();
|
||||
|
@ -193,8 +184,8 @@ public class SSMonitorMeteoTab extends TabItemComp implements IUpdateMonitorMete
|
|||
|
||||
ArrayList<AreaXML> areasArray = threshXML.getAreas();
|
||||
|
||||
for (AreaXML area : areasArray)
|
||||
{
|
||||
if (areasArray != null) {
|
||||
for (AreaXML area : areasArray) {
|
||||
areaID = area.getAreaId();
|
||||
SSMonitorMeteoData ssmmd = new SSMonitorMeteoData();
|
||||
|
||||
|
@ -204,58 +195,68 @@ public class SSMonitorMeteoTab extends TabItemComp implements IUpdateMonitorMete
|
|||
* 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));
|
||||
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));
|
||||
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));
|
||||
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));
|
||||
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));
|
||||
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()
|
||||
{
|
||||
private SSMonitorMeteoData getDataAtFirstSelection() {
|
||||
int index = dataList.getSelectionIndex();
|
||||
|
||||
return ssDataArray.get(index);
|
||||
}
|
||||
|
||||
private void updateDataArray(SSMonitorMeteoData ssmmd)
|
||||
{
|
||||
private void updateDataArray(SSMonitorMeteoData ssmmd) {
|
||||
int[] dataListIndexes = dataList.getSelectionIndices();
|
||||
int currentIndex = 0;
|
||||
|
||||
for (int i = 0; i < dataListIndexes.length; i++)
|
||||
{
|
||||
for (int i = 0; i < dataListIndexes.length; i++) {
|
||||
currentIndex = dataListIndexes[i];
|
||||
|
||||
ssDataArray.get(currentIndex).updateData(ssmmd);
|
||||
|
@ -263,57 +264,64 @@ public class SSMonitorMeteoTab extends TabItemComp implements IUpdateMonitorMete
|
|||
}
|
||||
|
||||
@Override
|
||||
public void commitDataToXML()
|
||||
{
|
||||
public void commitDataToXML() {
|
||||
SSThresholdMgr sstm = SSThresholdMgr.getInstance();
|
||||
|
||||
String xmlKey;
|
||||
String areaID;
|
||||
|
||||
for (SSMonitorMeteoData ssmmd : ssDataArray)
|
||||
{
|
||||
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;
|
||||
|
@ -322,23 +330,19 @@ public class SSMonitorMeteoTab extends TabItemComp implements IUpdateMonitorMete
|
|||
}
|
||||
|
||||
@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();
|
||||
}
|
||||
|
|
|
@ -36,22 +36,43 @@ 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);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.monitor.ui.dialogs.TabItemComp#createListHeader(org
|
||||
* .eclipse.swt.widgets.Composite)
|
||||
*/
|
||||
@Override
|
||||
protected void createListHeader(Composite parentComp)
|
||||
{
|
||||
protected void createListHeader(Composite parentComp) {
|
||||
Composite lblComp = new Composite(parentComp, SWT.NONE);
|
||||
GridLayout gl = new GridLayout(5, false);
|
||||
gl.horizontalSpacing = 0;
|
||||
|
@ -69,7 +90,8 @@ public class SSMonitorSwellTab extends TabItemComp implements IUpdateDisplayMoni
|
|||
/*
|
||||
* 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);
|
||||
|
@ -78,24 +100,27 @@ public class SSMonitorSwellTab extends TabItemComp implements IUpdateDisplayMoni
|
|||
/*
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -106,8 +131,7 @@ public class SSMonitorSwellTab extends TabItemComp implements IUpdateDisplayMoni
|
|||
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);
|
||||
|
@ -120,10 +144,13 @@ public class SSMonitorSwellTab extends TabItemComp implements IUpdateDisplayMoni
|
|||
/*
|
||||
* Primary Swell
|
||||
*/
|
||||
appendIntData(sb, sssd.getPriSwellHeightR(), sssd.getPriSwellHeightY());
|
||||
appendIntData(sb, sssd.getPriSwellHeightR(),
|
||||
sssd.getPriSwellHeightY());
|
||||
|
||||
double higherThreshold = Math.max(sssd.getPriSwellPeriodR(), sssd.getPriSwellPeriodY());
|
||||
double lowerThreshold = Math.min(sssd.getPriSwellPeriodR(), sssd.getPriSwellPeriodY());
|
||||
double higherThreshold = Math.max(sssd.getPriSwellPeriodR(),
|
||||
sssd.getPriSwellPeriodY());
|
||||
double lowerThreshold = Math.min(sssd.getPriSwellPeriodR(),
|
||||
sssd.getPriSwellPeriodY());
|
||||
if (rankSwellPeriodHigh) {
|
||||
sssd.setRankSwellPeriodHigh(true);
|
||||
sssd.setPriSwellPeriodR(higherThreshold);
|
||||
|
@ -133,18 +160,24 @@ public class SSMonitorSwellTab extends TabItemComp implements IUpdateDisplayMoni
|
|||
sssd.setPriSwellPeriodR(lowerThreshold);
|
||||
sssd.setPriSwellPeriodY(higherThreshold);
|
||||
}
|
||||
appendIntData(sb, sssd.getPriSwellPeriodR(), sssd.getPriSwellPeriodY());
|
||||
appendIntData(sb, sssd.getPriSwellPeriodR(),
|
||||
sssd.getPriSwellPeriodY());
|
||||
|
||||
appendIntData(sb, sssd.getPriSwellDirFromR(), sssd.getPriSwellDirFromY());
|
||||
appendIntData(sb, sssd.getPriSwellDirToR(), sssd.getPriSwellDirToY());
|
||||
appendIntData(sb, sssd.getPriSwellDirFromR(),
|
||||
sssd.getPriSwellDirFromY());
|
||||
appendIntData(sb, sssd.getPriSwellDirToR(),
|
||||
sssd.getPriSwellDirToY());
|
||||
|
||||
/*
|
||||
* Secondary Swell
|
||||
*/
|
||||
appendIntData(sb, sssd.getSecSwellHeightR(), sssd.getSecSwellHeightY());
|
||||
appendIntData(sb, sssd.getSecSwellHeightR(),
|
||||
sssd.getSecSwellHeightY());
|
||||
|
||||
higherThreshold = Math.max(sssd.getSecSwellPeriodR(), sssd.getSecSwellPeriodY());
|
||||
lowerThreshold = Math.min(sssd.getSecSwellPeriodR(), sssd.getSecSwellPeriodY());
|
||||
higherThreshold = Math.max(sssd.getSecSwellPeriodR(),
|
||||
sssd.getSecSwellPeriodY());
|
||||
lowerThreshold = Math.min(sssd.getSecSwellPeriodR(),
|
||||
sssd.getSecSwellPeriodY());
|
||||
if (rankSwellPeriodHigh) {
|
||||
// sssd.setRankSwellPeriodHigh(true);
|
||||
sssd.setSecSwellPeriodR(higherThreshold);
|
||||
|
@ -154,22 +187,22 @@ public class SSMonitorSwellTab extends TabItemComp implements IUpdateDisplayMoni
|
|||
sssd.setSecSwellPeriodR(lowerThreshold);
|
||||
sssd.setSecSwellPeriodY(higherThreshold);
|
||||
}
|
||||
appendIntData(sb, sssd.getSecSwellPeriodR(), sssd.getSecSwellPeriodY());
|
||||
appendIntData(sb, sssd.getSecSwellPeriodR(),
|
||||
sssd.getSecSwellPeriodY());
|
||||
|
||||
appendIntData(sb, sssd.getSecSwellDirFromR(), sssd.getSecSwellDirFromY());
|
||||
appendIntData(sb, sssd.getSecSwellDirToR(), sssd.getSecSwellDirToY());
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
@ -177,8 +210,10 @@ public class SSMonitorSwellTab extends TabItemComp implements IUpdateDisplayMoni
|
|||
packListControls();
|
||||
}
|
||||
|
||||
private void createDataArray()
|
||||
{
|
||||
/**
|
||||
* Create Data Array.
|
||||
*/
|
||||
private void createDataArray() {
|
||||
ssDataArray = new ArrayList<SSDispMonSwellData>();
|
||||
|
||||
SSThresholdMgr sstm = SSThresholdMgr.getInstance();
|
||||
|
@ -190,8 +225,8 @@ public class SSMonitorSwellTab extends TabItemComp implements IUpdateDisplayMoni
|
|||
|
||||
ArrayList<AreaXML> areasArray = threshXML.getAreas();
|
||||
|
||||
for (AreaXML area : areasArray)
|
||||
{
|
||||
if (areasArray != null) {
|
||||
for (AreaXML area : areasArray) {
|
||||
areaID = area.getAreaId();
|
||||
SSDispMonSwellData sssd = new SSDispMonSwellData();
|
||||
|
||||
|
@ -201,39 +236,55 @@ public class SSMonitorSwellTab extends TabItemComp implements IUpdateDisplayMoni
|
|||
* 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));
|
||||
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));
|
||||
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));
|
||||
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));
|
||||
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));
|
||||
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));
|
||||
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));
|
||||
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));
|
||||
sssd.setSecSwellDirToR(sstm.getThresholdValue(duKey,
|
||||
threshKeyR, areaID, xmlKey));
|
||||
sssd.setSecSwellDirToY(sstm.getThresholdValue(duKey,
|
||||
threshKeyY, areaID, xmlKey));
|
||||
|
||||
/*
|
||||
* Add data to array.
|
||||
|
@ -241,82 +292,113 @@ public class SSMonitorSwellTab extends TabItemComp implements IUpdateDisplayMoni
|
|||
ssDataArray.add(sssd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private SSDispMonSwellData getDataAtFirstSelection()
|
||||
{
|
||||
/**
|
||||
* Gets Data at first selection.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private SSDispMonSwellData getDataAtFirstSelection() {
|
||||
int index = dataList.getSelectionIndex();
|
||||
|
||||
return ssDataArray.get(index);
|
||||
}
|
||||
|
||||
private void updateDataArray(SSDispMonSwellData sssd)
|
||||
{
|
||||
/**
|
||||
* 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++)
|
||||
{
|
||||
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()
|
||||
{
|
||||
public void commitDataToXML() {
|
||||
SSThresholdMgr sstm = SSThresholdMgr.getInstance();
|
||||
|
||||
String xmlKey;
|
||||
String areaID;
|
||||
|
||||
for (SSDispMonSwellData sssd : ssDataArray)
|
||||
{
|
||||
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;
|
||||
|
@ -324,24 +406,34 @@ public class SSMonitorSwellTab extends TabItemComp implements IUpdateDisplayMoni
|
|||
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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
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();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
17
cave/com.raytheon.uf.viz.monitor.safeseas/src/com/raytheon/uf/viz/monitor/safeseas/ui/dialogs/SSZoneTableDlg.java
Executable file → Normal file
17
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;
|
||||
|
@ -58,6 +57,7 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants;
|
|||
* 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>
|
||||
*
|
||||
|
@ -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,6 +214,7 @@ public class SnowDisplayMeteoTab extends TabItemComp implements
|
|||
|
||||
List<AreaXML> areasArray = threshXML.getAreas();
|
||||
|
||||
if (areasArray != null) {
|
||||
for (AreaXML area : areasArray) {
|
||||
areaID = area.getAreaId();
|
||||
SnowDisplayMeteoData sdmd = new SnowDisplayMeteoData();
|
||||
|
@ -228,10 +230,10 @@ public class SnowDisplayMeteoTab extends TabItemComp implements
|
|||
|
||||
/* 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));
|
||||
sdmd.setDewpointR(stm.getThresholdValue(duKey, threshKeyR,
|
||||
areaID, xmlKey));
|
||||
sdmd.setDewpointY(stm.getThresholdValue(duKey, threshKeyY,
|
||||
areaID, xmlKey));
|
||||
|
||||
/* Visibility */
|
||||
xmlKey = SnowDisplay.SNOW_DISP_METEO_VIS.getXmlKey();
|
||||
|
@ -249,31 +251,31 @@ public class SnowDisplayMeteoTab extends TabItemComp implements
|
|||
|
||||
/* 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));
|
||||
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));
|
||||
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));
|
||||
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));
|
||||
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();
|
||||
|
@ -284,15 +286,16 @@ public class SnowDisplayMeteoTab extends TabItemComp implements
|
|||
|
||||
/* 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));
|
||||
sdmd.setSnincrTotR(stm.getThresholdValue(duKey, threshKeyR,
|
||||
areaID, xmlKey));
|
||||
sdmd.setSnincrTotY(stm.getThresholdValue(duKey, threshKeyY,
|
||||
areaID, xmlKey));
|
||||
|
||||
/* Add data to array. */
|
||||
snowDataArray.add(sdmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Data At First Selection.
|
||||
|
|
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) {
|
||||
|
|
|
@ -111,8 +111,7 @@ import com.vividsolutions.jts.geom.LineString;
|
|||
* 08-21-2014 DR 15700 Qinglu Lin handle the situation where frameTime is null in paintTrack().
|
||||
* 09-09-2014 RM #657 Qinglu Lin handle StormTrackState.trackType is null.
|
||||
* 09-25-2014 ASM #16773 D. Friedman Fix NPE.
|
||||
*
|
||||
>>>>>>> master_14.2.4
|
||||
* 10-10-2014 ASM #16844 D. Friedman Prevent some errors when moving track.
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
|
@ -841,7 +840,9 @@ public class StormTrackDisplay implements IRenderable {
|
|||
PaintProperties paintProps) throws ImpossibleTrackException {
|
||||
int moveIndex = this.trackUtil.getCurrentFrame(paintProps
|
||||
.getFramesInfo());
|
||||
moveIndex = Math.min(moveIndex, state.timePoints.length - 1);
|
||||
int pivotIndex = state.displayedPivotIndex;
|
||||
pivotIndex = Math.min(pivotIndex, state.timePoints.length - 1);
|
||||
|
||||
double angle;
|
||||
double oppositeAngle;
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
-Dthrift.stream.maxsize=200
|
||||
-Dviz.memory.warn.threshold=98
|
||||
-XX:+UnlockExperimentalVMOptions
|
||||
-XX:G1HeapRegionSize=1
|
||||
-XX:G1HeapRegionSize=4M
|
||||
-XX:InitiatingHeapOccupancyPercent=25
|
||||
-XX:G1MixedGCCountTarget=16
|
||||
-XX:G1MixedGCLiveThresholdPercent=25
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
-Dviz.memory.warn.threshold=99
|
||||
-XX:MaxDirectMemorySize=1G
|
||||
-XX:+UnlockExperimentalVMOptions
|
||||
-XX:G1HeapRegionSize=1
|
||||
-XX:G1HeapRegionSize=4M
|
||||
-XX:InitiatingHeapOccupancyPercent=25
|
||||
-XX:G1MixedGCCountTarget=16
|
||||
-XX:G1MixedGCLiveThresholdPercent=25
|
||||
|
|
|
@ -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;
|
||||
|
@ -70,7 +72,7 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 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,
|
||||
|
|
|
@ -24,26 +24,26 @@
|
|||
222:222:Reflectivity at -20C:dBZ:ReflectivityM20C
|
||||
223:223:Low-Level Rotation Tracks 0-2km AGL (60 min. accum.):1/s:RotationTrackLL60min
|
||||
224:224:Low-Level Rotation Tracks 0-2km AGL (1440 min. accum.):1/s:RotationTrackLL1440min
|
||||
225:225:Mid-Level Rotation Tracks 0-3km AGL (60 min. accum.):1/s:RotationTrackML60min
|
||||
226:226:Mid-Level Rotation Tracks 0-3km AGL (1440 min. accum.):1/s:RotationTrackML1440min
|
||||
225:225:Mid-Level Rotation Tracks 3-6km AGL (60 min. accum.):1/s:RotationTrackML60min
|
||||
226:226:Mid-Level Rotation Tracks 3-6km AGL (1440 min. accum.):1/s:RotationTrackML1440min
|
||||
227:227:Surface Precipitation Type (SPT)::PrecipType
|
||||
228:228:Radar Precipitation Rate (SPR):mm/hr:PrecipRate
|
||||
229:229:Seamless Hybrid Scan Reflectivity (SHSR):dBZ:SeamlessHSR
|
||||
230:230:Radar Quality Index (RQI)::RadarQualityIndex
|
||||
231:231:QPE - Radar Only (1 hr. accum):mm:RadarOnlyQPE01H
|
||||
231:231:QPE - Radar Only (1 hr. accum.):mm:RadarOnlyQPE01H
|
||||
232:232:QPE - Radar Only (3 hr. accum.):RadarOnlyQPE03H
|
||||
233:233:QPE - Radar Only (6 hr. accum.):mm:RadarOnlyQPE06H
|
||||
234:234:QPE - Radar Only (12 hr. accum.):mm:RadarOnlyQPE12H
|
||||
235:235:QPE - Radar Only (24 hr. accum.):mm:RadarOnlyQPE24H
|
||||
236:236:QPE - Radar Only (48 hr. accum.):mm:RadarOnlyQPE48H
|
||||
237:237:QPE - Radar Only (72 hr. accum.):mm:RadarOnlyQPE72H
|
||||
238:238:QPE - Radar w/ Gauge Bias Correction (1 hr. accum.):mm:GaugeCorrQPE01H
|
||||
239:239:QPE - Radar w/ Gauge Bias Correction (3 hr. accum.):mm:GaugeCorrQPE03H
|
||||
240:240:QPE - Radar w/ Gauge Bias Correction (6 hr. accum.):mm:GaugeCorrQPE06H
|
||||
241:241:QPE - Radar w/ Gauge Bias Correction (12 hr. accum.):mm:GaugeCorrQPE12H
|
||||
242:242:QPE - Radar w/ Gauge Bias Correction (24 hr. accum.):mm:GaugeCorrQPE24H
|
||||
243:243:QPE - Radar w/ Gauge Bias Correction (48 hr. accum.):mm:GaugeCorrQPE48H
|
||||
244:244:QPE - Radar w/ Gauge Bias Correction (72 hr. accum.):mm:GaugeCorrQPE72H
|
||||
238:238:QPE - Radar with Gauge Bias Correction (1 hr. accum.):mm:GaugeCorrQPE01H
|
||||
239:239:QPE - Radar with Gauge Bias Correction (3 hr. accum.):mm:GaugeCorrQPE03H
|
||||
240:240:QPE - Radar with Gauge Bias Correction (6 hr. accum.):mm:GaugeCorrQPE06H
|
||||
241:241:QPE - Radar with Gauge Bias Correction (12 hr. accum.):mm:GaugeCorrQPE12H
|
||||
242:242:QPE - Radar with Gauge Bias Correction (24 hr. accum.):mm:GaugeCorrQPE24H
|
||||
243:243:QPE - Radar with Gauge Bias Correction (48 hr. accum.):mm:GaugeCorrQPE48H
|
||||
244:244:QPE - Radar with Gauge Bias Correction (72 hr. accum.):mm:GaugeCorrQPE72H
|
||||
245:245:QPE - Mountain Mapper (1 hr. accum.):mm:MountainMapperQPE01H
|
||||
246:246:QPE - Mountain Mapper (3 hr. accum.):mm:MountainMapperQPE03H
|
||||
247:247:QPE - Mountain Mapper (6 hr. accum.):mm:MountainMapperQPE06H
|
||||
|
|
|
@ -7,12 +7,12 @@
|
|||
5:5:Low-Level Rotation Tracks 0-2km AGL (240 min. accum.):1/s:RotationTrackLL240min
|
||||
6:6:Low-Level Rotation Tracks 0-2km AGL (360 min. accum.):1/s:RotationTrackLL360min
|
||||
7:7:Low-Level Rotation Tracks 0-2km AGL (1440 min. accum.):1/s:RotationTrackLL1440min
|
||||
14:14:Mid-Level Rotation Tracks 0-3km AGL (30 min. accum.):1/s:RotationTrackML30min
|
||||
15:15:Mid-Level Rotation Tracks 0-3km AGL (60 min. accum.):1/s:RotationTrackML60min
|
||||
16:16:Mid-Level Rotation Tracks 0-3km AGL (120 min. accum.):1/s:RotationTrackML120min
|
||||
17:17:Mid-Level Rotation Tracks 0-3km AGL (240 min. accum.):1/s:RotationTrackML240min
|
||||
18:18:Mid-Level Rotation Tracks 0-3km AGL (360 min. accum.):1/s:RotationTrackML360min
|
||||
19:19:Mid-Level Rotation Tracks 0-3km AGL (1440 min. accum.):1/s:RotationTrackML1440min
|
||||
14:14:Mid-Level Rotation Tracks 3-6km AGL (30 min. accum.):1/s:RotationTrackML30min
|
||||
15:15:Mid-Level Rotation Tracks 3-6km AGL (60 min. accum.):1/s:RotationTrackML60min
|
||||
16:16:Mid-Level Rotation Tracks 3-6km AGL (120 min. accum.):1/s:RotationTrackML120min
|
||||
17:17:Mid-Level Rotation Tracks 3-6km AGL (240 min. accum.):1/s:RotationTrackML240min
|
||||
18:18:Mid-Level Rotation Tracks 3-6km AGL (360 min. accum.):1/s:RotationTrackML360min
|
||||
19:19:Mid-Level Rotation Tracks 3-6km AGL (1440 min. accum.):1/s:RotationTrackML1440min
|
||||
26:26:Severe Hail Index (SHI)::SHI
|
||||
27:27:Probability of Severe Hail (POSH):%:POSH
|
||||
28:28:Maximum Estimated Size of Hail (MESH):mm:MESH
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
#Product Discipline 209 - Multi-Radar/Multi-Sensor, Parameter Category 6: QPE Products
|
||||
0:0:Surface Precipitation Type (SPT)::PrecipType
|
||||
1:1:Radar Precipitation Rate (SPR):mm/hr:PrecipRate
|
||||
2:2:QPE - Radar Only (1 hr. accum):mm:RadarOnlyQPE01H
|
||||
2:2:QPE - Radar Only (1 hr. accum.):mm:RadarOnlyQPE01H
|
||||
3:3:QPE - Radar Only (3 hr. accum.):RadarOnlyQPE03H
|
||||
4:4:QPE - Radar Only (6 hr. accum.):mm:RadarOnlyQPE06H
|
||||
5:5:QPE - Radar Only (12 hr. accum.):mm:RadarOnlyQPE12H
|
||||
6:6:QPE - Radar Only (24 hr. accum.):mm:RadarOnlyQPE24H
|
||||
7:7:QPE - Radar Only (48 hr. accum.):mm:RadarOnlyQPE48H
|
||||
8:8:QPE - Radar Only (72 hr. accum.):mm:RadarOnlyQPE72H
|
||||
9:9:QPE - Radar w/ Gauge Bias Correction (1 hr. accum.):mm:GaugeCorrQPE01H
|
||||
10:10:QPE - Radar w/ Gauge Bias Correction (3 hr. accum.):mm:GaugeCorrQPE03H
|
||||
11:11:QPE - Radar w/ Gauge Bias Correction (6 hr. accum.):mm:GaugeCorrQPE06H
|
||||
12:12:QPE - Radar w/ Gauge Bias Correction (12 hr. accum.):mm:GaugeCorrQPE12H
|
||||
13:13:QPE - Radar w/ Gauge Bias Correction (24 hr. accum.):mm:GaugeCorrQPE24H
|
||||
14:14:QPE - Radar w/ Gauge Bias Correction (48 hr. accum.):mm:GaugeCorrQPE48H
|
||||
15:15:QPE - Radar w/ Gauge Bias Correction (72 hr. accum.):mm:GaugeCorrQPE72H
|
||||
9:9:QPE - Radar with Gauge Bias Correction (1 hr. accum.):mm:GaugeCorrQPE01H
|
||||
10:10:QPE - Radar with Gauge Bias Correction (3 hr. accum.):mm:GaugeCorrQPE03H
|
||||
11:11:QPE - Radar with Gauge Bias Correction (6 hr. accum.):mm:GaugeCorrQPE06H
|
||||
12:12:QPE - Radar with Gauge Bias Correction (12 hr. accum.):mm:GaugeCorrQPE12H
|
||||
13:13:QPE - Radar with Gauge Bias Correction (24 hr. accum.):mm:GaugeCorrQPE24H
|
||||
14:14:QPE - Radar with Gauge Bias Correction (48 hr. accum.):mm:GaugeCorrQPE48H
|
||||
15:15:QPE - Radar with Gauge Bias Correction (72 hr. accum.):mm:GaugeCorrQPE72H
|
||||
16:16:QPE - Radar Gauge Only (1 hr. accum.):mm:GaugeOnlyQPE01H
|
||||
17:17:QPE - Radar Gauge Only (3 hr. accum.):mm:GaugeOnlyQPE03H
|
||||
18:18:QPE - Radar Gauge Only (6 hr. accum.):mm:GaugeOnlyQPE06H
|
||||
|
|
|
@ -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>
|
||||
*
|
||||
|
@ -89,20 +91,21 @@ public class OriginHibType 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 {
|
||||
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 "
|
||||
|
@ -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>
|
||||
*
|
||||
|
@ -87,18 +89,19 @@ public class ParmIdType 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 {
|
||||
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>
|
||||
*
|
||||
|
@ -117,37 +119,25 @@ public class WsIdType implements UserType {
|
|||
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;
|
||||
|
||||
|
|
|
@ -66,6 +66,7 @@ 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>
|
||||
|
@ -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,6 +178,33 @@ 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.
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
**/
|
||||
package com.raytheon.uf.common.dataplugin.grid.util;
|
||||
|
||||
import java.lang.ref.SoftReference;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -32,11 +33,14 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
/**
|
||||
* A class for calculating and caching static data for grids.
|
||||
*
|
||||
* Orignally ported from GridAccessor5.C
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 24, 2008 brockwoo Initial creation
|
||||
* Oct 21, 2014 3721 dlovely Optimized for reduced memory usage
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -45,7 +49,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
*/
|
||||
|
||||
public class StaticGridData {
|
||||
private static Map<GridCoverage, StaticGridData> instanceMap = new HashMap<GridCoverage, StaticGridData>();
|
||||
private static Map<GridCoverage, SoftReference<StaticGridData>> instanceMap = new HashMap<GridCoverage, SoftReference<StaticGridData>>();
|
||||
|
||||
private static final double R_EARTH = 6370.0;
|
||||
|
||||
|
@ -61,11 +65,17 @@ public class StaticGridData {
|
|||
|
||||
public static synchronized StaticGridData getInstance(
|
||||
GridCoverage gridCoverage) {
|
||||
StaticGridData rval = instanceMap.get(gridCoverage);
|
||||
SoftReference<StaticGridData> data = instanceMap.get(gridCoverage);
|
||||
|
||||
if (rval == null) {
|
||||
StaticGridData rval = null;
|
||||
if (null != data) {
|
||||
rval = data.get();
|
||||
}
|
||||
|
||||
if (null == data || null == rval) {
|
||||
rval = new StaticGridData(gridCoverage);
|
||||
instanceMap.put(gridCoverage, rval);
|
||||
data = new SoftReference<StaticGridData>(rval);
|
||||
instanceMap.put(gridCoverage, data);
|
||||
}
|
||||
|
||||
return rval;
|
||||
|
@ -83,6 +93,13 @@ public class StaticGridData {
|
|||
return this.dy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the Dx, Dy and Coriolis data from the provided
|
||||
* {@link GridCoverage}.
|
||||
*
|
||||
* @param gridCoverage
|
||||
* Grid Coverage.
|
||||
*/
|
||||
private void initStaticData(GridCoverage gridCoverage) {
|
||||
int nx = gridCoverage.getNx();
|
||||
int ny = gridCoverage.getNy();
|
||||
|
@ -91,52 +108,73 @@ public class StaticGridData {
|
|||
float[] dxPtr = new float[n];
|
||||
float[] dyPtr = new float[n];
|
||||
float[] avgPtr = new float[n];
|
||||
double[] xx = new double[n];
|
||||
double[] yy = new double[n];
|
||||
double[] zz = new double[n];
|
||||
float[] xxU = new float[nx];
|
||||
float[] xxC = new float[nx];
|
||||
float[] xxD = new float[nx];
|
||||
float[] yyU = new float[nx];
|
||||
float[] yyC = new float[nx];
|
||||
float[] yyD = new float[nx];
|
||||
float[] zzU = new float[nx];
|
||||
float[] zzC = new float[nx];
|
||||
float[] zzD = new float[nx];
|
||||
|
||||
float[] tmpXX, tmpYY, tmpZZ;
|
||||
|
||||
int i, j, k;
|
||||
|
||||
for (j = k = 0; j < ny; j++) {
|
||||
for (i = 0; i < nx; i++, k++) {
|
||||
Coordinate location = new Coordinate(i, j);
|
||||
// Populate Up rows.
|
||||
for (i = 0; i < nx; i++) {
|
||||
Coordinate location = new Coordinate(i, 1);
|
||||
Coordinate latLon = MapUtil.gridCoordinateToLatLon(location,
|
||||
PixelOrientation.CENTER, gridCoverage);
|
||||
latLon.x = Math.toRadians(latLon.x);
|
||||
latLon.y = Math.toRadians(latLon.y);
|
||||
xx[k] = Math.cos(latLon.y);
|
||||
yy[k] = xx[k] * Math.sin(latLon.x);
|
||||
xx[k] *= Math.cos(latLon.x);
|
||||
zz[k] = Math.sin(latLon.y);
|
||||
_coriolis[k] = (float) (zz[k] * 1.458e-4);
|
||||
}
|
||||
xxU[i] = (float) Math.cos(latLon.y);
|
||||
yyU[i] = (float) (xxU[i] * Math.sin(latLon.x));
|
||||
xxU[i] *= Math.cos(latLon.x);
|
||||
zzU[i] = (float) Math.sin(latLon.y);
|
||||
}
|
||||
|
||||
this.coriolis = newRecord(_coriolis, nx, ny);
|
||||
// Populate Current rows.
|
||||
for (i = 0; i < nx; i++) {
|
||||
Coordinate location = new Coordinate(i, 0);
|
||||
Coordinate latLon = MapUtil.gridCoordinateToLatLon(location,
|
||||
PixelOrientation.CENTER, gridCoverage);
|
||||
latLon.x = Math.toRadians(latLon.x);
|
||||
latLon.y = Math.toRadians(latLon.y);
|
||||
xxC[i] = (float) Math.cos(latLon.y);
|
||||
yyC[i] = (float) (xxC[i] * Math.sin(latLon.x));
|
||||
xxC[i] *= Math.cos(latLon.x);
|
||||
zzC[i] = (float) Math.sin(latLon.y);
|
||||
}
|
||||
|
||||
int up, dn, lft, rgt;
|
||||
long _nxm = nx - 1;
|
||||
// Init Down as a copy of Current
|
||||
System.arraycopy(xxC, 0, xxD, 0, nx);
|
||||
System.arraycopy(yyC, 0, yyD, 0, nx);
|
||||
System.arraycopy(zzC, 0, zzD, 0, nx);
|
||||
|
||||
int lft, rgt;
|
||||
double d;
|
||||
double icomp, jcomp, kcomp;
|
||||
double dmax = 0.0;
|
||||
dn = 0;
|
||||
up = nx;
|
||||
|
||||
for (j = k = 0; j < ny; j++) {
|
||||
if (up >= n) {
|
||||
up -= nx;
|
||||
}
|
||||
lft = k;
|
||||
|
||||
lft = 0;
|
||||
for (i = 0; i < nx; i++, k++) {
|
||||
rgt = (i < _nxm ? k + 1 : k);
|
||||
icomp = yy[lft] * zz[rgt] - zz[lft] * yy[rgt];
|
||||
jcomp = zz[lft] * xx[rgt] - xx[lft] * zz[rgt];
|
||||
kcomp = xx[lft] * yy[rgt] - yy[lft] * xx[rgt];
|
||||
_coriolis[k] = (float) (zzC[i] * 1.458e-4);
|
||||
rgt = (i < nx - 1 ? i + 1 : i);
|
||||
icomp = yyC[lft] * zzC[rgt] - zzC[lft] * yyC[rgt];
|
||||
jcomp = zzC[lft] * xxC[rgt] - xxC[lft] * zzC[rgt];
|
||||
kcomp = xxC[lft] * yyC[rgt] - yyC[lft] * xxC[rgt];
|
||||
d = Math.sqrt(icomp * icomp + jcomp * jcomp + kcomp * kcomp);
|
||||
dxPtr[k] = (float) (Math.asin(d) * 1000.0 * R_EARTH / (rgt - lft));
|
||||
icomp = yy[dn] * zz[up] - zz[dn] * yy[up];
|
||||
jcomp = zz[dn] * xx[up] - xx[dn] * zz[up];
|
||||
kcomp = xx[dn] * yy[up] - yy[dn] * xx[up];
|
||||
icomp = yyD[i] * zzU[i] - zzD[i] * yyU[i];
|
||||
jcomp = zzD[i] * xxU[i] - xxD[i] * zzU[i];
|
||||
kcomp = xxD[i] * yyU[i] - yyD[i] * xxU[i];
|
||||
d = Math.sqrt(icomp * icomp + jcomp * jcomp + kcomp * kcomp);
|
||||
dyPtr[k] = (float) (Math.asin(d) * 1000.0 * R_EARTH * nx / (up - dn));
|
||||
dyPtr[k] = (float) (Math.asin(d) * 1000.0 * R_EARTH * (j == 0
|
||||
|| j == (ny - 1) ? 1 : 0.5));
|
||||
avgPtr[k] = (dxPtr[k] + dyPtr[k]) / 2.0f;
|
||||
d = dxPtr[k] - dyPtr[k];
|
||||
if (d < 0) {
|
||||
|
@ -146,14 +184,52 @@ public class StaticGridData {
|
|||
if (d > dmax) {
|
||||
dmax = d;
|
||||
}
|
||||
dn++;
|
||||
up++;
|
||||
lft = k;
|
||||
}
|
||||
if (j == 0) {
|
||||
dn = 0;
|
||||
if (i != 0) {
|
||||
lft++;
|
||||
}
|
||||
}
|
||||
|
||||
// Move Current to Down and Up to Current.
|
||||
tmpXX = xxD;
|
||||
xxD = xxC;
|
||||
xxC = xxU;
|
||||
|
||||
tmpYY = yyD;
|
||||
yyD = yyC;
|
||||
yyC = yyU;
|
||||
|
||||
tmpZZ = zzD;
|
||||
zzD = zzC;
|
||||
zzC = zzU;
|
||||
|
||||
// Construct the next Up row with new data unless this is the last
|
||||
// pass then duplicate the current row.
|
||||
if (j < ny - 2) {
|
||||
// Populate the next Up row.
|
||||
xxU = tmpXX;
|
||||
yyU = tmpYY;
|
||||
zzU = tmpZZ;
|
||||
for (i = 0; i < nx; i++) {
|
||||
Coordinate location = new Coordinate(i, j + 2);
|
||||
Coordinate latLon = MapUtil.gridCoordinateToLatLon(
|
||||
location, PixelOrientation.CENTER, gridCoverage);
|
||||
latLon.x = Math.toRadians(latLon.x);
|
||||
latLon.y = Math.toRadians(latLon.y);
|
||||
xxU[i] = (float) Math.cos(latLon.y);
|
||||
yyU[i] = (float) (xxU[i] * Math.sin(latLon.x));
|
||||
xxU[i] *= Math.cos(latLon.x);
|
||||
zzU[i] = (float) Math.sin(latLon.y);
|
||||
}
|
||||
} else {
|
||||
// If the last run, Duplicate the Current row to the Up row.
|
||||
xxU = xxC;
|
||||
yyU = yyC;
|
||||
zzU = zzC;
|
||||
}
|
||||
}
|
||||
|
||||
this.coriolis = newRecord(_coriolis, nx, ny);
|
||||
|
||||
if (dmax > 0.01) {
|
||||
this.dx = newRecord(dxPtr, nx, ny);
|
||||
this.dy = newRecord(dyPtr, nx, ny);
|
||||
|
|
|
@ -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>
|
||||
*
|
||||
|
@ -91,9 +93,10 @@ public class DurationType 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 {
|
||||
long durationInMilliSeconds = resultSet.getLong((names[0]));
|
||||
long durationInMilliSeconds = rs.getLong((names[0]));
|
||||
|
||||
try {
|
||||
return DatatypeFactory.newInstance().newDuration(
|
||||
|
@ -105,13 +108,13 @@ 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()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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,13 +120,13 @@ 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()));
|
||||
}
|
||||
|
||||
|
@ -144,5 +147,4 @@ public class XMLGregorianCalendarType implements UserType {
|
|||
public int[] sqlTypes() {
|
||||
return XMLGregorianCalendarType.SQL_TYPES;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
18
edexOsgi/com.raytheon.uf.edex.dat.utils/src/com/raytheon/uf/edex/dat/utils/DatMenuUtil.java
Executable file → Normal file
18
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,11 +478,11 @@ public class DatMenuUtil extends AbstractMenuUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates Safeseas Menu.
|
||||
* Creates SAFESEAS Menu.
|
||||
*/
|
||||
private void createSafeseasMenu() {
|
||||
FSSObsMonitorConfigurationManager ssConfig = FSSObsMonitorConfigurationManager
|
||||
.getInstance(MonName.ss.name());
|
||||
.getSsObsManager();
|
||||
Set<String> ssStns = ssConfig.getStationIDs();
|
||||
StringBuilder stations = new StringBuilder();
|
||||
for (String s : ssStns) {
|
||||
|
@ -500,9 +499,8 @@ public class DatMenuUtil extends AbstractMenuUtil {
|
|||
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;
|
||||
toXml(safeMenuContributionFile, "menus" + File.separator + "safeseas"
|
||||
+ File.separator + "index.xml");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -510,7 +508,7 @@ public class DatMenuUtil extends AbstractMenuUtil {
|
|||
*/
|
||||
private void createFogMenu() {
|
||||
FSSObsMonitorConfigurationManager fogConfig = FSSObsMonitorConfigurationManager
|
||||
.getInstance(MonName.fog.name());
|
||||
.getFogObsManager();
|
||||
Set<String> fogStns = fogConfig.getStationIDs();
|
||||
StringBuilder stations = new StringBuilder();
|
||||
for (String s : fogStns) {
|
||||
|
@ -529,15 +527,14 @@ public class DatMenuUtil extends AbstractMenuUtil {
|
|||
fogMenuContributionFile.contribution[0]);
|
||||
toXml(fogMenuContributionFile, "menus" + File.separator + "fog"
|
||||
+ File.separator + "index.xml");
|
||||
fogConfig = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates Snow Menu.
|
||||
* Creates SNOW Menu.
|
||||
*/
|
||||
private void createSnowMenu() {
|
||||
FSSObsMonitorConfigurationManager snowConfig = FSSObsMonitorConfigurationManager
|
||||
.getInstance(MonName.snow.name());
|
||||
.getSnowObsManager();
|
||||
Set<String> snowStns = snowConfig.getStationIDs();
|
||||
StringBuilder stations = new StringBuilder();
|
||||
for (String s : snowStns) {
|
||||
|
@ -556,7 +553,6 @@ public class DatMenuUtil extends AbstractMenuUtil {
|
|||
snowMenuContributionFile.contribution[0]);
|
||||
toXml(snowMenuContributionFile, "menus" + File.separator + "snow"
|
||||
+ File.separator + "index.xml");
|
||||
snowConfig = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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" });
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue