本文整理汇总了Java中org.vast.data.DataRecordImpl类的典型用法代码示例。如果您正苦于以下问题:Java DataRecordImpl类的具体用法?Java DataRecordImpl怎么用?Java DataRecordImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DataRecordImpl类属于org.vast.data包,在下文中一共展示了DataRecordImpl类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCommandDescription
import org.vast.data.DataRecordImpl; //导入依赖的package包/类
@Override
public DataComponent getCommandDescription()
{
DataComponent record = new DataRecordImpl(3);
record.setName(this.name);
record.setDefinition("urn:blabla:command");
Quantity q = new QuantityImpl();
q.setDefinition("urn:blabla:samplingPeriod");
q.getUom().setCode("s");
record.addComponent("samplingPeriod", q);
Category c = new CategoryImpl();
c.setDefinition("urn:blabla:sensitivity");
AllowedTokens tokens = new AllowedTokensImpl();
tokens.addValue("HIGH");
tokens.addValue("LOW");
c.setConstraint(tokens);
record.addComponent("sens", c);
return record;
}
示例2: createDs2
import org.vast.data.DataRecordImpl; //导入依赖的package包/类
protected DataComponent createDs2() throws Exception
{
DataComponent recordDesc = new DataRecordImpl();
recordDesc.setName("ds2");
recordDesc.setDefinition("urn:auth:blabla:record-stuff");
Quantity q = new QuantityImpl();
q.setLabel("My Quantity");
q.getUom().setCode("m.s-2.kg-1");
recordDesc.addComponent("c1", q);
recordDesc.addComponent("c2", new CountImpl());
recordDesc.addComponent("c3", new TextImpl());
storage.addRecordStore(recordDesc.getName(), recordDesc, new TextEncodingImpl());
return recordDesc;
}
示例3: getRecordDescription
import org.vast.data.DataRecordImpl; //导入依赖的package包/类
@Override
public DataComponent getRecordDescription()
{
DataComponent record = new DataRecordImpl(3);
record.setName(this.name);
record.setDefinition("urn:blabla:weatherData");
Time time = new TimeImpl();
time.setDefinition(SWEConstants.DEF_SAMPLING_TIME);
time.getUom().setHref(Time.ISO_TIME_UNIT);
record.addComponent("time", time);
Quantity temp = new QuantityImpl();
temp.setDefinition("urn:blabla:temperature");
temp.getUom().setCode("Cel");
record.addComponent("temp", temp);
Quantity wind = new QuantityImpl();
wind.setDefinition("urn:blabla:windSpeed");
wind.getUom().setCode("m/s");
record.addComponent("windSpeed", wind);
Quantity press = new QuantityImpl();
press.setDefinition("urn:blabla:pressure");
press.getUom().setCode("hPa");
record.addComponent("press", press);
return record;
}
示例4: init
import org.vast.data.DataRecordImpl; //导入依赖的package包/类
@Override
protected void init() throws SensorException
{
V4LCameraParams camParams = parentSensor.camParams;
// init frame grabber
try
{
frameGrabber = parentSensor.videoDevice.getRGBFrameGrabber(camParams.imgWidth, camParams.imgHeight, 0, V4L4JConstants.STANDARD_WEBCAM);
//frameGrabber.setFrameInterval(1, camParams.frameRate);
// adjust params to what was actually set up by V4L
camParams.imgWidth = frameGrabber.getWidth();
camParams.imgHeight = frameGrabber.getHeight();
camParams.frameRate = frameGrabber.getFrameInterval().denominator / frameGrabber.getFrameInterval().numerator;
camParams.imgFormat = frameGrabber.getImageFormat().getName();
frameGrabber.setCaptureCallback(this);
if (camParams.doCapture)
frameGrabber.startCapture();
}
catch (V4L4JException e)
{
throw new SensorException("Error while initializing frame grabber", e);
}
// build output structure
camDataStruct = new DataArrayImpl(camParams.imgHeight);
camDataStruct.setName(getName());
camDataStruct.setDefinition("http://sensorml.com/ont/swe/property/VideoFrame");
DataArray imgRow = new DataArrayImpl(camParams.imgWidth);
((DataArray)camDataStruct).addComponent("row", imgRow);
DataRecord imgPixel = new DataRecordImpl(3);
imgPixel.addComponent("red", new CountImpl(DataType.BYTE));
imgPixel.addComponent("green", new CountImpl(DataType.BYTE));
imgPixel.addComponent("blue", new CountImpl(DataType.BYTE));
imgRow.addComponent("pixel", imgPixel);
}
示例5: DISABLED_testJP2KDecompression
import org.vast.data.DataRecordImpl; //导入依赖的package包/类
public void DISABLED_testJP2KDecompression() throws Exception
{
String filePath = "F:\\Data\\ErdasTigerShark\\2008-07-21\\images\\A121665541042.jp2";//.small.jpc";
File file = new File(filePath);
FileInputStream is = new FileInputStream(file);
DataArrayImpl imgData = new DataArrayImpl();
DataRecordImpl pixelData = new DataRecordImpl(3);
pixelData.addComponent("red", new CountImpl());
pixelData.addComponent("green", new CountImpl());
pixelData.addComponent("blue", new CountImpl());
imgData.addComponent("pixel", pixelData);
JP2KStreamDecoder decoder = new JP2KStreamDecoder(file.length());
decoder.decode(new DataInputStreamBI(is), imgData);
System.out.println(imgData.getData());
BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream("D:\\subset.raw"));
for (int p=0; p<imgData.getComponentCount(); p++)
{
DataBlock dataBlk = imgData.getComponent(p).getData();
/*int tmp1 = dataBlk.getIntValue(0)+128;
int tmp2 = dataBlk.getIntValue(1)+128;
int tmp3 = dataBlk.getIntValue(2)+128;
os.write(tmp1 > 255 ? 255 : (tmp1 < 0 ? 0 : tmp1));
os.write(tmp2 > 255 ? 255 : (tmp2 < 0 ? 0 : tmp2));
os.write(tmp3 > 255 ? 255 : (tmp3 < 0 ? 0 : tmp3));*/
os.write(dataBlk.getByteValue(0));
os.write(dataBlk.getByteValue(1));
os.write(dataBlk.getByteValue(2));
}
os.close();
}
示例6: combineInputBlocks
import org.vast.data.DataRecordImpl; //导入依赖的package包/类
public void combineInputBlocks()
{
for (int i = 0; i < inputData.size(); i++)
{
DataComponent input = inputData.getComponent(i);
if (input instanceof DataRecordImpl)
((DataRecordImpl)input).combineDataBlocks();
}
}
示例7: combineOutputBlocks
import org.vast.data.DataRecordImpl; //导入依赖的package包/类
public void combineOutputBlocks()
{
// make sure sub processes connected to the output
// also uses these new DataBlocks for their output
for (int i = 0; i < outputData.size(); i++)
{
DataComponent output = outputData.getComponent(i);
if (output instanceof DataRecordImpl)
((DataRecordImpl)output).combineDataBlocks();
}
}
示例8: buildInsertSensor
import org.vast.data.DataRecordImpl; //导入依赖的package包/类
protected InsertSensorRequest buildInsertSensor() throws Exception
{
// create procedure
PhysicalSystem procedure = new PhysicalSystemImpl();
procedure.setName("My weather station");
procedure.setUniqueIdentifier(SENSOR_UID);
// output 1
DataStream tempOutput = new DataList();
procedure .addOutput("tempOut", tempOutput);
DataRecord tempRec = new DataRecordImpl(2);
tempOutput.setElementType("elt", tempRec);
Time timeTag = new TimeImpl();
timeTag.setDefinition(SWEConstants.DEF_SAMPLING_TIME);
timeTag.getUom().setHref(Time.ISO_TIME_UNIT);
tempRec.addComponent("time", timeTag);
Quantity tempVal = new QuantityImpl();
tempVal.setDefinition("http://mmisw.org/ont/cf/parameter/air_temperature");
tempVal.getUom().setCode("Cel");
tempRec.addComponent("temp", tempVal);
tempOutput.setEncoding(new TextEncodingImpl());
// output 2
DataStream posOutput = new DataList();
procedure.addOutput("posOut", posOutput);
DataRecord posRec = new DataRecordImpl(2);
posOutput.setElementType("elt", posRec);
posRec.addComponent("time", timeTag.copy());
Vector posVector = new VectorImpl(3);
posVector.setDefinition(SWEConstants.DEF_SAMPLING_LOC);
posVector.setReferenceFrame("http://www.opengis.net/def/crs/EPSG/0/4979");
posVector.addComponent("lat", new QuantityImpl());
posVector.addComponent("lon", new QuantityImpl());
posVector.addComponent("alt", new QuantityImpl());
posRec.addComponent("pos", posVector);
posOutput.setEncoding(new TextEncodingImpl());
// build insert sensor request
InsertSensorRequest req = new InsertSensorRequest();
req.setPostServer(getSosEndpointUrl());
req.setVersion("2.0");
req.setProcedureDescription(procedure);
req.setProcedureDescriptionFormat(InsertSensorRequest.DEFAULT_PROCEDURE_FORMAT);
req.getObservationTypes().add(IObservation.OBS_TYPE_GENERIC);
req.getObservationTypes().add(IObservation.OBS_TYPE_RECORD);
req.getObservableProperties().add(SWEConstants.DEF_SAMPLING_LOC);
req.getObservableProperties().add("http://mmisw.org/ont/cf/parameter/air_temperature");
req.getFoiTypes().add("urn:blabla:myfoi1");
req.getFoiTypes().add("urn:blabla:myfoi2");
return req;
}