grs.pds.edr
Class PefEdrRecord

java.lang.Object
  |
  +--grs.pds.BasePdsRecord
        |
        +--grs.pds.TimeSeriesRecord
              |
              +--grs.pds.edr.PefEdrRecord
All Implemented Interfaces:
PdsRecord

public class PefEdrRecord
extends TimeSeriesRecord

PEF records are lists of commands sent to the FIS. Each record has a UTC time when it was sent to the FIS, a count of commands sent, and an array of command id's with opcodes.


Field Summary
 Command[] cmds
           
 short count
           
 Date fis_time
           
 
Fields inherited from class grs.pds.BasePdsRecord
PdsTimeFormat
 
Fields inherited from interface grs.pds.PdsRecord
GAMMA_CHANNELS, int10, int12, int2, int3, logger, MESSAGE_LENGTH, NS_MAX_EVENTS, PEF_COMMANDS, prec10, prec12, prec13, prec14, prec15, prec16, prec17, prec5, prec6, prec7, PROFILE_LENGTH, PROFILE_SIZE, PULSER_CHANNELS, QUERY_DATE_FMT, SC_ID
 
Constructor Summary
PefEdrRecord(DataInputStream in)
          Read a PefEdrRecord in from a DataInputStream.
PefEdrRecord(ResultSet rs)
          Create a PefEdrRecord from a ResultSet.
 
Method Summary
static String[] createInsertString(String schema)
          SQL to retrieve PEF records from a specific schema.
static String[] createSelectString(String schema)
          SQL to retrieve PEF records from a specific schema.
 long getSCLK()
          Get the Date (time) of record.
 Date getUTC()
          Get the UTC time that this record was observed on.
static void main(String[] args)
          Demonstrates use of this class to parse a Pef EDR record.
 int prepareInsert(PreparedStatement pstmt)
          Bind values to the PreparedStatement
 String[] toStringArray()
          Display the values in this record.
 void writeTo(DataOutputStream out)
          Write this PefEdrRecord to a DataOutputStream
 
Methods inherited from class grs.pds.BasePdsRecord
endianSwapShort
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fis_time

public Date fis_time

count

public short count

cmds

public Command[] cmds
Constructor Detail

PefEdrRecord

public PefEdrRecord(ResultSet rs)
             throws SQLException
Create a PefEdrRecord from a ResultSet.

Throws:
SQLException - Error reading from ResultSet.
IOException - Error reading from the stream.

PefEdrRecord

public PefEdrRecord(DataInputStream in)
             throws ParseException,
                    IOException
Read a PefEdrRecord in from a DataInputStream.

Parameters:
in - Binary stream of PEF data.
Throws:
ParseException - Invalid time format in stream.
IOException - Error reading from strea,.
Method Detail

createSelectString

public static String[] createSelectString(String schema)
SQL to retrieve PEF records from a specific schema.

Parameters:
schema - Schema to use (e.g. "map1").
Returns:
SQL to be used in PreparedStatement(s)

createInsertString

public static String[] createInsertString(String schema)
SQL to retrieve PEF records from a specific schema.

Parameters:
schema - Schema to use (e.g. "map1").
Returns:
SQL to be used in PreparedStatement(s)

prepareInsert

public int prepareInsert(PreparedStatement pstmt)
                  throws SQLException
Bind values to the PreparedStatement

Specified by:
prepareInsert in class BasePdsRecord
Parameters:
pstmt - prepared statement
Returns:
number of values bound
Throws:
SQLException - Error in binding binding

writeTo

public void writeTo(DataOutputStream out)
             throws IOException
Write this PefEdrRecord to a DataOutputStream

Specified by:
writeTo in class BasePdsRecord
Parameters:
out - Binary output stream.
Throws:
IOException - Error writing to the stream.

toStringArray

public String[] toStringArray()
Display the values in this record.

Specified by:
toStringArray in class BasePdsRecord
Returns:
This record as a String array.

getSCLK

public long getSCLK()
Get the Date (time) of record.

Specified by:
getSCLK in class TimeSeriesRecord
Returns:
Date

getUTC

public Date getUTC()
Description copied from class: TimeSeriesRecord
Get the UTC time that this record was observed on.

Specified by:
getUTC in class TimeSeriesRecord
Returns:
UTC.

main

public static final void main(String[] args)
Demonstrates use of this class to parse a Pef EDR record.

Parameters:
args - Filename


2001 Mars Odyssey Gamma Ray Spectrometer Team