Issue #1977: Fix NCEP Plugin issues due to merge
Former-commit-id:c311adda88
[formerly82f3d26700
[formerly 3496de5dfddf84fb7130d993a17dcf973018d2f1]] Former-commit-id:82f3d26700
Former-commit-id:61455f533b
This commit is contained in:
parent
49efaf00e0
commit
4d2b51881c
3 changed files with 181 additions and 140 deletions
|
@ -1,7 +1,7 @@
|
|||
package gov.noaa.nws.ncep.common.dataplugin.geomag;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
import javax.persistence.Access;
|
||||
import javax.persistence.AccessType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
|
@ -18,23 +18,22 @@ import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
|||
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
|
||||
import com.raytheon.uf.common.dataplugin.persist.PersistablePluginDataObject;
|
||||
import com.raytheon.uf.common.datastorage.IDataStore;
|
||||
import com.raytheon.uf.common.datastorage.records.ByteDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.IntegerDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.LongDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.StringDataRecord;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
/**
|
||||
* Record implementation for geomag plugin.
|
||||
* Record implementation for geomag plugin.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ---------------- --------------------------
|
||||
* 03/27/2013 975 sgurung Initial creation.
|
||||
* 05/26/2013 bhebbard Added SequenceGenerator annotation.
|
||||
* 05/26/2013 bhebbard Added SequenceGenerator annotation.
|
||||
* 07/22/2013 1977 rjpeter Added getDataURI and annotations.
|
||||
* </pre>
|
||||
*
|
||||
* @author sgurung
|
||||
|
@ -52,13 +51,13 @@ public class GeoMagRecord extends PersistablePluginDataObject {
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String OBS_TIME = "OBS_TIME";
|
||||
|
||||
|
||||
public static final String component1 = "component1";
|
||||
|
||||
|
||||
public static final String component2 = "component2";
|
||||
|
||||
|
||||
public static final String component3 = "component3";
|
||||
|
||||
|
||||
public static final String component4 = "component4";
|
||||
|
||||
/**
|
||||
|
@ -83,43 +82,46 @@ public class GeoMagRecord extends PersistablePluginDataObject {
|
|||
* report type
|
||||
*/
|
||||
@DataURI(position = 3)
|
||||
@Column
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
@XmlAttribute
|
||||
private String reportType;
|
||||
|
||||
|
||||
/**
|
||||
* flag to indicate bad data point
|
||||
*/
|
||||
/*@Column
|
||||
@DynamicSerializeElement
|
||||
@XmlAttribute
|
||||
private String badDataPoint;*/
|
||||
|
||||
/*
|
||||
* @Column
|
||||
*
|
||||
* @DynamicSerializeElement
|
||||
*
|
||||
* @XmlAttribute private String badDataPoint;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Observation Date and Time for the minute values
|
||||
*/
|
||||
@Transient
|
||||
private long[] obs_times;
|
||||
|
||||
|
||||
/**
|
||||
* H or X values
|
||||
*/
|
||||
@Transient
|
||||
private float[] comp1_data;
|
||||
|
||||
|
||||
/**
|
||||
* D or Y values
|
||||
*/
|
||||
@Transient
|
||||
private float[] comp2_data;
|
||||
|
||||
|
||||
/**
|
||||
* Z values
|
||||
*/
|
||||
@Transient
|
||||
private float[] comp3_data;
|
||||
|
||||
|
||||
/**
|
||||
* F values
|
||||
*/
|
||||
|
@ -157,7 +159,7 @@ public class GeoMagRecord extends PersistablePluginDataObject {
|
|||
public void setStationCode(String stationCode) {
|
||||
this.stationCode = stationCode;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the sourceId
|
||||
*/
|
||||
|
@ -172,7 +174,7 @@ public class GeoMagRecord extends PersistablePluginDataObject {
|
|||
public void setSourceId(int sourceId) {
|
||||
this.sourceId = sourceId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the reportType
|
||||
*/
|
||||
|
@ -202,7 +204,7 @@ public class GeoMagRecord extends PersistablePluginDataObject {
|
|||
public void setObsTimes(long[] obs_times) {
|
||||
this.obs_times = obs_times;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the comp1_data
|
||||
*/
|
||||
|
@ -217,7 +219,7 @@ public class GeoMagRecord extends PersistablePluginDataObject {
|
|||
public void setComp1Data(float[] h_data) {
|
||||
this.comp1_data = h_data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the comp2_data
|
||||
*/
|
||||
|
@ -232,7 +234,7 @@ public class GeoMagRecord extends PersistablePluginDataObject {
|
|||
public void setComp2Data(float[] d_data) {
|
||||
this.comp2_data = d_data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the comp3_data
|
||||
*/
|
||||
|
@ -247,7 +249,7 @@ public class GeoMagRecord extends PersistablePluginDataObject {
|
|||
public void setComp3Data(float[] z_data) {
|
||||
this.comp3_data = z_data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the comp4_data
|
||||
*/
|
||||
|
@ -262,37 +264,43 @@ public class GeoMagRecord extends PersistablePluginDataObject {
|
|||
public void setComp4Data(float[] f_data) {
|
||||
this.comp4_data = f_data;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IDecoderGettable getDecoderGettable() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void retrieveFromDataStore(IDataStore dataStore) {
|
||||
|
||||
|
||||
try {
|
||||
IDataRecord[] dataRec = dataStore.retrieve(getDataURI());
|
||||
for (int i = 0; i < dataRec.length; i++) {
|
||||
if (dataRec[i].getName().equals(GeoMagRecord.component1)) {
|
||||
obs_times = (((LongDataRecord) dataRec[i]).getLongData());
|
||||
}
|
||||
if (dataRec[i].getName().equals(GeoMagRecord.component1)) {
|
||||
comp1_data = (((FloatDataRecord) dataRec[i]).getFloatData());
|
||||
}
|
||||
if (dataRec[i].getName().equals(GeoMagRecord.component2)) {
|
||||
comp2_data = (((FloatDataRecord) dataRec[i]).getFloatData());
|
||||
}
|
||||
if (dataRec[i].getName().equals(GeoMagRecord.component3)) {
|
||||
comp3_data = (((FloatDataRecord) dataRec[i]).getFloatData());
|
||||
}
|
||||
if (dataRec[i].getName().equals(GeoMagRecord.component4)) {
|
||||
comp4_data = (((FloatDataRecord) dataRec[i]).getFloatData());
|
||||
}
|
||||
for (IDataRecord element : dataRec) {
|
||||
if (element.getName().equals(GeoMagRecord.component1)) {
|
||||
obs_times = (((LongDataRecord) element).getLongData());
|
||||
}
|
||||
if (element.getName().equals(GeoMagRecord.component1)) {
|
||||
comp1_data = (((FloatDataRecord) element).getFloatData());
|
||||
}
|
||||
if (element.getName().equals(GeoMagRecord.component2)) {
|
||||
comp2_data = (((FloatDataRecord) element).getFloatData());
|
||||
}
|
||||
if (element.getName().equals(GeoMagRecord.component3)) {
|
||||
comp3_data = (((FloatDataRecord) element).getFloatData());
|
||||
}
|
||||
if (element.getName().equals(GeoMagRecord.component4)) {
|
||||
comp4_data = (((FloatDataRecord) element).getFloatData());
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception se) {
|
||||
se.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Column
|
||||
@Access(AccessType.PROPERTY)
|
||||
public String getDataURI() {
|
||||
return super.getDataURI();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,11 +27,12 @@
|
|||
|
||||
package gov.noaa.nws.ncep.common.dataplugin.idft;
|
||||
|
||||
|
||||
import gov.noaa.nws.ncep.common.tools.IDecoderConstantsN;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
import javax.persistence.Access;
|
||||
import javax.persistence.AccessType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
|
@ -50,6 +51,22 @@ import com.raytheon.uf.common.dataplugin.annotations.DataURI;
|
|||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 07/22/2013 1977 rjpeter Added getDataURI and annotations.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author rjpeter
|
||||
* @version 1.0
|
||||
*/
|
||||
@Entity
|
||||
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "idftseq")
|
||||
@Table(name = "idft", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
|
||||
|
@ -57,72 +74,66 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* Both refTime and forecastTime are included in the refTimeIndex since
|
||||
* forecastTime is unlikely to be used.
|
||||
*/
|
||||
@org.hibernate.annotations.Table(
|
||||
appliesTo = "idft",
|
||||
indexes = {
|
||||
@Index(name = "idft_refTimeIndex", columnNames = { "refTime", "forecastTime" } )
|
||||
}
|
||||
)
|
||||
@org.hibernate.annotations.Table(appliesTo = "idft", indexes = { @Index(name = "idft_refTimeIndex", columnNames = {
|
||||
"refTime", "forecastTime" }) })
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@DynamicSerialize
|
||||
public class IdftRecord extends PluginDataObject {
|
||||
|
||||
public class IdftRecord extends PluginDataObject{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** Report type */
|
||||
@Column(length=32)
|
||||
@XmlElement
|
||||
/** Report type */
|
||||
@Column(length = 32)
|
||||
@XmlElement
|
||||
@DataURI(position = 4)
|
||||
@DynamicSerializeElement
|
||||
private String reportType;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
private String reportType;
|
||||
|
||||
@Column
|
||||
@DataURI(position = 1)
|
||||
@DynamicSerializeElement
|
||||
@XmlElement
|
||||
private Calendar issueTime;
|
||||
@XmlElement
|
||||
private Calendar issueTime;
|
||||
|
||||
@Column
|
||||
@Column
|
||||
@DataURI(position = 2)
|
||||
@DynamicSerializeElement
|
||||
@XmlElement
|
||||
private Calendar validTime;
|
||||
@XmlElement
|
||||
private Calendar validTime;
|
||||
|
||||
@XmlElement
|
||||
@DataURI(position = 3)
|
||||
@DynamicSerializeElement
|
||||
private Integer pointNum;
|
||||
private Integer pointNum;
|
||||
|
||||
@XmlElement
|
||||
@DynamicSerializeElement
|
||||
private Float lat;
|
||||
private Float lat;
|
||||
|
||||
@XmlElement
|
||||
@DynamicSerializeElement
|
||||
private Float lon;
|
||||
private Float lon;
|
||||
|
||||
@XmlElement
|
||||
@DynamicSerializeElement
|
||||
private Float direction;
|
||||
private Float direction;
|
||||
|
||||
@XmlElement
|
||||
@DynamicSerializeElement
|
||||
private Float distanceNm;
|
||||
private Float distanceNm;
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Default Constructor
|
||||
*/
|
||||
public IdftRecord() {
|
||||
this.issueTime = null;
|
||||
this.validTime = null;
|
||||
this.pointNum = IDecoderConstantsN.INTEGER_MISSING;
|
||||
this.lat = IDecoderConstantsN.FLOAT_MISSING;
|
||||
this.lon = IDecoderConstantsN.FLOAT_MISSING;
|
||||
this.direction = IDecoderConstantsN.FLOAT_MISSING;
|
||||
this.distanceNm = IDecoderConstantsN.FLOAT_MISSING;
|
||||
this.issueTime = null;
|
||||
this.validTime = null;
|
||||
this.pointNum = IDecoderConstantsN.INTEGER_MISSING;
|
||||
this.lat = IDecoderConstantsN.FLOAT_MISSING;
|
||||
this.lon = IDecoderConstantsN.FLOAT_MISSING;
|
||||
this.direction = IDecoderConstantsN.FLOAT_MISSING;
|
||||
this.distanceNm = IDecoderConstantsN.FLOAT_MISSING;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -140,61 +151,75 @@ public class IdftRecord extends PluginDataObject{
|
|||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getReportType() {
|
||||
return reportType;
|
||||
}
|
||||
public void setReportType(String reportType) {
|
||||
this.reportType = reportType;
|
||||
}
|
||||
|
||||
public Calendar getIssueTime(){
|
||||
return issueTime;
|
||||
}
|
||||
public void setIssueTime(Calendar issueTime){
|
||||
this.issueTime=issueTime;
|
||||
}
|
||||
|
||||
public Calendar getValidTime(){
|
||||
return validTime;
|
||||
}
|
||||
public void setValidTime(Calendar validTime){
|
||||
this.validTime=validTime;
|
||||
}
|
||||
|
||||
public Integer getPointNum(){
|
||||
return pointNum;
|
||||
}
|
||||
public void setPointNum(Integer pointNum){
|
||||
this.pointNum=pointNum;
|
||||
}
|
||||
|
||||
public float getLat(){
|
||||
return lat;
|
||||
}
|
||||
public void setLat(float latitude){
|
||||
this.lat=latitude;
|
||||
}
|
||||
|
||||
public float getLon(){
|
||||
return lon;
|
||||
}
|
||||
public void setLon(float longitude){
|
||||
this.lon=longitude;
|
||||
}
|
||||
|
||||
public float getDirection(){
|
||||
return direction;
|
||||
}
|
||||
public void setDirection(float direction){
|
||||
this.direction=direction;
|
||||
}
|
||||
|
||||
public float getDistanceNm(){
|
||||
return distanceNm;
|
||||
}
|
||||
public void setDistanceNm(float distanceNm){
|
||||
this.distanceNm=distanceNm;
|
||||
}
|
||||
|
||||
public String getReportType() {
|
||||
return reportType;
|
||||
}
|
||||
|
||||
public void setReportType(String reportType) {
|
||||
this.reportType = reportType;
|
||||
}
|
||||
|
||||
public Calendar getIssueTime() {
|
||||
return issueTime;
|
||||
}
|
||||
|
||||
public void setIssueTime(Calendar issueTime) {
|
||||
this.issueTime = issueTime;
|
||||
}
|
||||
|
||||
public Calendar getValidTime() {
|
||||
return validTime;
|
||||
}
|
||||
|
||||
public void setValidTime(Calendar validTime) {
|
||||
this.validTime = validTime;
|
||||
}
|
||||
|
||||
public Integer getPointNum() {
|
||||
return pointNum;
|
||||
}
|
||||
|
||||
public void setPointNum(Integer pointNum) {
|
||||
this.pointNum = pointNum;
|
||||
}
|
||||
|
||||
public float getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setLat(float latitude) {
|
||||
this.lat = latitude;
|
||||
}
|
||||
|
||||
public float getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public void setLon(float longitude) {
|
||||
this.lon = longitude;
|
||||
}
|
||||
|
||||
public float getDirection() {
|
||||
return direction;
|
||||
}
|
||||
|
||||
public void setDirection(float direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
|
||||
public float getDistanceNm() {
|
||||
return distanceNm;
|
||||
}
|
||||
|
||||
public void setDistanceNm(float distanceNm) {
|
||||
this.distanceNm = distanceNm;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Column
|
||||
@Access(AccessType.PROPERTY)
|
||||
public String getDataURI() {
|
||||
return super.getDataURI();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package gov.noaa.nws.ncep.common.dataplugin.pgen;
|
||||
|
||||
import javax.persistence.Access;
|
||||
import javax.persistence.AccessType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
|
@ -30,7 +32,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 22, 2013 sgilbert Initial creation
|
||||
* Jun 26, 2013 bhebbard Added SequenceGenerator annotation
|
||||
*
|
||||
* Jul 22, 2013 1977 rjpeter Added getDataURI and annotations.
|
||||
* </pre>
|
||||
*
|
||||
* @author sgilbert
|
||||
|
@ -262,4 +264,10 @@ public class PgenRecord extends PersistablePluginDataObject {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Column
|
||||
@Access(AccessType.PROPERTY)
|
||||
public String getDataURI() {
|
||||
return super.getDataURI();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue