Issue #2060 fill in units on GridRecords created from URIs

Change-Id: Ic7c1594c1442d8463c5050bdefb434995ffc7f8a

Former-commit-id: 1d38804eb2 [formerly 3719c41d2b] [formerly 71b4227061] [formerly 1d38804eb2 [formerly 3719c41d2b] [formerly 71b4227061] [formerly 7cea97ab15 [formerly 71b4227061 [formerly 949d132cf3260db5f75ea665f21601ab91440958]]]]
Former-commit-id: 7cea97ab15
Former-commit-id: e8ca9729eb [formerly 5bf1554597] [formerly 4cf3887df369f38b75f0a2c9f9f7949057e50e42 [formerly 6bdbfb7e1a]]
Former-commit-id: 0fc7bbac68e600996cc014bbf843e66d5484e6e9 [formerly 66cd43313a]
Former-commit-id: ad7a69f2e3
This commit is contained in:
Nate Jensen 2014-05-06 10:47:50 -05:00
parent 4a44bbed48
commit 8a31b5edf5
6 changed files with 70 additions and 12 deletions

View file

@ -100,6 +100,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* rules.
* Apr 09, 2014 2947 bsteffen Improve flexibility of sat derived
* parameters, implement ImageProvider
* May 06, 2014 njensen Improve error message
*
* </pre>
*
@ -257,7 +258,7 @@ public class SatResource extends
initializeFirstFrame((SatelliteRecord) pdo);
} catch (VizException e) {
throw new IllegalStateException(
"Unable to initialize the satellite resource");
"Unable to initialize the satellite resource", e);
}
initialized = true;
}

View file

@ -36,6 +36,7 @@ import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject;
import com.raytheon.uf.common.gridcoverage.GridCoverage;
import com.raytheon.uf.common.gridcoverage.convert.GridCoverageConverter;
import com.raytheon.uf.common.parameter.Parameter;
import com.raytheon.uf.common.parameter.ParameterConverter;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@ -106,7 +107,7 @@ public class GridInfoRecord extends PersistableDataObject<Integer> {
@ManyToOne
@PrimaryKeyJoinColumn
@DataURI(position = 4, embedded = true)
@DataURI(position = 4, converter = ParameterConverter.class)
@DynamicSerializeElement
private Parameter parameter;

View file

@ -34,7 +34,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject;
import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
@ -71,7 +70,6 @@ public class Parameter extends PersistableDataObject implements
@Id
@DynamicSerializeElement
@XmlElement
@DataURI(position = 0)
private String abbreviation;
@Column(nullable = false)

View file

@ -0,0 +1,59 @@
/**
* 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.common.parameter;
import com.raytheon.uf.common.dataplugin.annotations.DataURIFieldConverter;
import com.raytheon.uf.common.parameter.lookup.ParameterLookup;
/**
* A DataURIFieldConverter that ensures that a String parameter abbreviation
* will be looked up to potentially contain all the fields.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 6, 2014 2060 njensen Initial creation
*
* </pre>
*
* @author njensen
* @version 1.0
*/
public class ParameterConverter implements DataURIFieldConverter<Parameter> {
@Override
public String toString(Parameter field) {
return field.getAbbreviation();
}
@Override
public Parameter fromString(String string) {
Parameter p = ParameterLookup.getInstance().getParameter(string);
if (p == null) {
p = new Parameter(string);
}
return p;
}
}

View file

@ -2,11 +2,10 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: DatUtils Plug-in
Bundle-SymbolicName: com.raytheon.uf.edex.dat.utils
Bundle-Version: 1.12.1174.qualifier
Bundle-Version: 1.14.0.qualifier
Bundle-Vendor: RAYTHEON
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: com.raytheon.uf.common.dataplugin.ffmp,
com.raytheon.uf.common.dataplugin.grid,
Import-Package: com.raytheon.uf.common.dataplugin.grid,
com.raytheon.uf.common.dataplugin.scan.data,
com.raytheon.uf.common.localization,
com.raytheon.uf.common.monitor.xml,
@ -14,7 +13,6 @@ Import-Package: com.raytheon.uf.common.dataplugin.ffmp,
org.apache.commons.logging
Export-Package: com.raytheon.uf.edex.dat.utils
Require-Bundle: com.raytheon.edex.common;bundle-version="1.12.2",
com.raytheon.uf.common.dataplugin.ffmp;bundle-version="1.12.2",
com.raytheon.uf.common.monitor;bundle-version="1.12.2",
com.raytheon.uf.common.dataplugin.shef;bundle-version="1.12.1174",
com.raytheon.uf.edex.menus;bundle-version="1.0.0"
com.raytheon.uf.edex.menus;bundle-version="1.0.0",
com.raytheon.uf.common.parameter

View file

@ -1,5 +1,3 @@
package com.raytheon.uf.edex.dat.utils;
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
@ -19,6 +17,9 @@ package com.raytheon.uf.edex.dat.utils;
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.dat.utils;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;