Class MatlabResponse
- java.lang.Object
-
- org.epics.archiverappliance.retrieval.mimeresponses.MatlabResponse
-
- All Implemented Interfaces:
EventConsumer
,MimeResponse
public class MatlabResponse extends Object implements MimeResponse
Generate a ".mat" matlab file The response contains two objects, a header and a data object. The header object is indexed by the stringheader
and is a MLStructure with fields for pvname, start and end times etc. The data object is indexed by the stringdata
and is a MLStructure with these fields.epochSeconds
- contains Java epoch seconds as a 1x1 uint64 array. The times are in UTC; so any conversion to local time needs to happen at the client.values
- contains the values for the samples. All scalars come as a 1x1 double array. Waveforms come as a 1xelementcount double array where elementcount is the EPICS element count of the waveform.nanos
- contains the nano second value of the EPICS record processing timestamp as a 1x1 uint64 array. Some installations embed the beam code/pulse id into this field; however, this is done at the IOC side and as far as this code are concerned, this is the nanoseconds.isDST
- contains booleans that indicate if the time indicated byepochSeconds
was in daylight savings time in the timezone of the server. This is an attempt to get around the deficiencies in Matlab w.r.t timezones.
- Author:
- mshankar
-
-
Field Summary
-
Fields inherited from interface org.epics.archiverappliance.retrieval.mimeresponses.MimeResponse
ACCESS_CONTROL_ALLOW_ORIGIN, CONTENT_TYPE, PROXIED_HEADERS
-
-
Constructor Summary
Constructors Constructor Description MatlabResponse()
-
Method Summary
Modifier and Type Method Description void
close()
void
consumeEvent(Event e)
HashMap<String,String>
getExtraHeaders()
Get extra headers that are to be added to the response.void
processingPV(BasicContext retrievalContext, String pv, Timestamp start, Timestamp end, EventStreamDesc streamDesc)
Called when we swich to a new PV.void
setOutputStream(OutputStream os)
void
swicthingToStream(EventStream strm)
-
-
-
Method Detail
-
consumeEvent
public void consumeEvent(Event e) throws Exception
- Specified by:
consumeEvent
in interfaceEventConsumer
- Throws:
Exception
-
setOutputStream
public void setOutputStream(OutputStream os)
- Specified by:
setOutputStream
in interfaceMimeResponse
-
processingPV
public void processingPV(BasicContext retrievalContext, String pv, Timestamp start, Timestamp end, EventStreamDesc streamDesc)
Description copied from interface:MimeResponse
Called when we swich to a new PV.- Specified by:
processingPV
in interfaceMimeResponse
pv
- The name of PVstart
- Timestampend
- TimestampstreamDesc
- Could be null if we have no data in first store we hit.
-
swicthingToStream
public void swicthingToStream(EventStream strm)
- Specified by:
swicthingToStream
in interfaceMimeResponse
-
close
public void close()
- Specified by:
close
in interfaceMimeResponse
-
getExtraHeaders
public HashMap<String,String> getExtraHeaders()
Description copied from interface:MimeResponse
Get extra headers that are to be added to the response. For this to work correctly in a clustered environment, you'll need to add the header to the set of proxiedHeaders below- Specified by:
getExtraHeaders
in interfaceMimeResponse
- Returns:
- HashMap ExtraHeaders
-
-