本文整理汇总了Java中javax.measure.quantity.Pressure类的典型用法代码示例。如果您正苦于以下问题:Java Pressure类的具体用法?Java Pressure怎么用?Java Pressure使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Pressure类属于javax.measure.quantity包,在下文中一共展示了Pressure类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: update
import javax.measure.quantity.Pressure; //导入依赖的package包/类
protected void update() {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
editTop.setTopComponent(new Editor(f));
editTop.setBottomComponent(new Editor(f.getCombustionProduct()));
if (burnRate != null)
AbstractFuelEditor.this.remove(burnRate);
try {
burnRate = new Chart<Pressure, Velocity>(
SI.MEGA(SI.PASCAL), SI.MILLIMETER.divide(SI.SECOND)
.asType(Velocity.class), f, "burnRate", "Chamber Pressure", "Burn Rate");
} catch (NoSuchMethodException e) {
throw new Error(e);
}
burnRate.setDomain(burnRate.new IntervalDomain(Amount.valueOf(
0, SI.MEGA(SI.PASCAL)), Amount.valueOf(11, SI
.MEGA(SI.PASCAL)), 50));
AbstractFuelEditor.this.setRightComponent(burnRate);
AbstractFuelEditor.this.revalidate();
}
});
}
示例2: reset
import javax.measure.quantity.Pressure; //导入依赖的package包/类
private void reset(){
if (nMap != null && aMap != null && nMap.size() == aMap.size()){
for ( Amount<Pressure> p : aMap.keySet() ){
add(p, aMap.get(p), nMap.get(p));
}
}
}
示例3: burnRate
import javax.measure.quantity.Pressure; //导入依赖的package包/类
@Override
public Amount<Velocity> burnRate(final Amount<Pressure> pressure) {
if ( pressure.isLessThan(ZERO_PRESSURE) )
return ZERO_VELOCITY;
if ( entries.size() == 1 ){
return entries.get(entries.firstKey()).burnRate;
}
if ( entries.containsKey(pressure) ){
return entries.get(pressure).burnRate;
}
Entry low = null;
low = entries.get(entries.headMap(pressure).lastKey());
Entry high = null;
try {
high = entries.get(entries.tailMap(pressure).firstKey());
} catch ( NoSuchElementException e ){
log.warn("Pressure " + pressure + " is outside of expiermental range for " + this.getName());
high = low;
low = entries.get(entries.headMap(low.pressure).lastKey());
}
Amount<Pressure> lowToHigh = high.pressure.minus(low.pressure);
Amount<Pressure> lowToTarget = pressure.minus(low.pressure);
Amount<Dimensionless> frac = lowToTarget.divide(lowToHigh).to(Dimensionless.UNIT);
Amount<Velocity> vdiff = high.burnRate.minus(low.burnRate);
Amount<Velocity> ret = low.burnRate.plus(vdiff.times(frac));
if ( ret.isLessThan(ZERO_VELOCITY) )
return ZERO_VELOCITY;
return ret;
}
示例4: setValueAt
import javax.measure.quantity.Pressure; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void setValueAt(Object value, int row, int col) {
Entry e = entries.get(row);
try {
switch (col) {
case 0:
try {
e.p = (Amount<Pressure>) Amount.valueOf((String) value);
} catch ( Exception ee ){
double d = Double.parseDouble((String)value);
e.p = (Amount<Pressure>)Amount.valueOf(d, e.p.getUnit());
}
break;
case 1:
e.a = Double.valueOf((String) value);
break;
case 2:
e.n = Double.valueOf((String) value);
}
} catch (Exception ex) {
ex.printStackTrace();
}
Collections.sort(entries);
fireTableDataChanged();
//f = new EditablePSRFuel(SaintRobertFuel.Type.NONSI);
f.clear();
for (Entry en : entries) {
f.add(en.p, en.a, en.n);
}
f.firePropertyChange(new PropertyChangeEvent(f,"entries", null, null));
update();
}
示例5: SRFuelEditor
import javax.measure.quantity.Pressure; //导入依赖的package包/类
public SRFuelEditor(EditablePiecewiseSaintRobertFuel f) {
super( f);
this.f = f;
for ( Amount<Pressure> p : f.getAMap().keySet() ){
Entry e = new Entry();
e.a = f.getAMap().get(p);
e.n = f.getNMap().get(p);
entries.add(e);
}
Collections.sort(entries);
}
示例6: LinearFuelEditor
import javax.measure.quantity.Pressure; //导入依赖的package包/类
public LinearFuelEditor(EditablePiecewiseLinearFuel f) {
super( f );
this.f = f;
for ( Map.Entry<Amount<Pressure>, Amount<Velocity>> e : f.getEntries().entrySet() ){
Entry n = new Entry();
n.p = e.getKey();
n.v = e.getValue();
entries.add(n);
}
Collections.sort(entries);
}
示例7: createSeries
import javax.measure.quantity.Pressure; //导入依赖的package包/类
private XYSeries createSeries(Fuel f) {
double max = 11;
double steps = 50;
XYSeries s = new XYSeries(f.getName());
for ( double dp = 0; dp <= max; dp += max/steps ){
Amount<Pressure> p = Amount.valueOf(dp, SI.MEGA(SI.PASCAL));
Amount<Velocity> r = f.burnRate(p);
s.add(p.doubleValue(pressureUnit), r.doubleValue(rateUnit));
}
return s;
}
示例8: testThrust
import javax.measure.quantity.Pressure; //导入依赖的package包/类
@Test
public void testThrust() {
Amount<Pressure> Patm = Amount.valueOf(101000, SI.PASCAL);
Amount<Pressure> Po = Amount.valueOf(2046491, SI.PASCAL);
Amount<Pressure> Pe = Patm;
KNSU f = new KNSU();
Amount<Force> t = n.thrust(Po, Pe, Patm, f.getCombustionProduct().getRatioOfSpecificHeats2Phase());
Amount<Force> expected = Amount.valueOf(87.2, .1, SI.NEWTON);
assertApproximate(t, expected);
}
示例9: testNonTimeIndex
import javax.measure.quantity.Pressure; //导入依赖的package包/类
@Test
public void testNonTimeIndex() throws Exception
{
File file = getDataFile("non_time/BalloonAscentData.csv");
assertTrue(file.isFile());
final String absPath = file.getAbsolutePath();
List<IStoreItem> items = new CsvParser().parse(absPath);
assertEquals("correct group", 1, items.size());
StoreGroup group = (StoreGroup) items.get(0);
assertEquals("correct num collections", 9, group.size());
IDocument<?> firstColl = (IDocument<?>) group.get(0);
assertEquals("correct num rows", 185, firstColl.size());
// check we have the correct data types
int ctr = 0;
NumberDocument thisN = (NumberDocument) group.get(ctr++);
assertTrue("correct data type", thisN instanceof NumberDocument);
assertEquals("correct units", SECOND, thisN.getUnits());
assertEquals("correct name", "BalloonAscentData-Time", thisN.getName());
assertEquals("correct index units", METER, thisN.getIndexUnits());
thisN = (NumberDocument) group.get(ctr++);
assertTrue("correct data type", thisN instanceof NumberDocument);
assertEquals("correct units",MILLI(BAR).asType(
Pressure.class), thisN.getUnits());
assertEquals("correct name", "BalloonAscentData-Pressure", thisN.getName());
assertEquals("correct index units", METER, thisN.getIndexUnits());
thisN = (NumberDocument) group.get(ctr++);
assertTrue("correct data type", thisN instanceof NumberDocument);
assertEquals("correct units",CELSIUS, thisN.getUnits());
assertEquals("correct name", "BalloonAscentData-Air Temperature", thisN.getName());
assertEquals("correct index units", METER, thisN.getIndexUnits());
thisN = (NumberDocument) group.get(ctr++);
assertTrue("correct data type", thisN instanceof NumberDocument);
assertEquals("correct units",CELSIUS, thisN.getUnits());
assertEquals("correct name", "BalloonAscentData-Dewpoint", thisN.getName());
assertEquals("correct index units", METER, thisN.getIndexUnits());
thisN = (NumberDocument) group.get(ctr++);
assertTrue("correct data type", thisN instanceof NumberDocument);
assertEquals("correct units",GRAM
.divide(CENTI(METER).pow(3)).asType(VolumetricDensity.class), thisN.getUnits());
assertEquals("correct name", "BalloonAscentData-Water density", thisN.getName());
assertEquals("correct index units", METER, thisN.getIndexUnits());
thisN = (NumberDocument) group.get(ctr++);
assertTrue("correct data type", thisN instanceof NumberDocument);
assertEquals("correct units",Dimensionless.UNIT, thisN.getUnits());
assertEquals("correct name", "BalloonAscentData-Humidity", thisN.getName());
assertEquals("correct index units", METER, thisN.getIndexUnits());
thisN = (NumberDocument) group.get(ctr++);
assertTrue("correct data type", thisN instanceof NumberDocument);
assertEquals("correct units",METRE.divide(SECOND).asType(
Velocity.class), thisN.getUnits());
assertEquals("correct name", "BalloonAscentData-Wind speed", thisN.getName());
assertEquals("correct index units", METER, thisN.getIndexUnits());
thisN = (NumberDocument) group.get(ctr++);
assertTrue("correct data type", thisN instanceof NumberDocument);
assertEquals("correct units",SampleData.DEGREE_ANGLE
.asType(Angle.class), thisN.getUnits());
assertEquals("correct name", "BalloonAscentData-Wind direction", thisN.getName());
assertEquals("correct index units", METER, thisN.getIndexUnits());
StringDocument thisS = (StringDocument) group.get(8);
assertTrue("correct data type", thisS instanceof StringDocument);
assertEquals("correct index units", METER, thisS.getIndexUnits());
}
示例10: createImporters
import javax.measure.quantity.Pressure; //导入依赖的package包/类
private void createImporters()
{
if (_candidates != null)
{
return;
}
_candidates = new ArrayList<DataImporter>();
_candidates.add(new AbsoluteLocationImporter());
_candidates.add(new RelativeLocationImporter());
_candidates.add(new TemporalSeriesSupporter(SECOND.asType(Duration.class),
null, new String[]
{"secs", "s"}));
_candidates.add(new TemporalSeriesSupporter(MILLI(SECOND).asType(
Duration.class), null, "ms"));
_candidates.add(new TemporalSeriesSupporter(HERTZ.asType(Frequency.class),
null, "Hz"));
_candidates.add(new TemporalSeriesSupporter(SampleData.DEGREE_ANGLE.divide(
SECOND).asType(AngularVelocity.class), null, "Degs/sec"));
_candidates.add(new TemporalSeriesSupporter(METRE.asType(Length.class),
null, "m"));
_candidates.add(new TemporalSeriesSupporter(MILLI(BAR).asType(
Pressure.class), null, new String[]
{"mb", "millibars"}));
_candidates.add(new TemporalSeriesSupporter(YARD.asType(Length.class),
null, "yds"));
_candidates.add(new TemporalSeriesSupporter(SampleData.DEGREE_ANGLE
.asType(Angle.class), null, new String[]
{"Degs", "Degr", "Deg"}));
_candidates.add(new TemporalSeriesSupporter(GRAM
.divide(CENTI(METER).pow(3)).asType(VolumetricDensity.class), null,
new String[]
{"g/cm3", "g/cm"}));
_candidates.add(new TemporalSeriesSupporter(NAUTICAL_MILE.divide(
SECOND.times(3600)).asType(Velocity.class), null, "kts"));
_candidates.add(new TemporalSeriesSupporter(NonSI.MILE.divide(
SI.SECOND.times(60 * 60)).asType(Velocity.class), null, new String[]
{"mph"}));
_candidates.add(new TemporalSeriesSupporter(NonSI.REVOLUTION.divide(SECOND
.times(60)), null, new String[]
{"rpm"}));
_candidates.add(new TemporalSeriesSupporter(METRE.divide(SECOND).asType(
Velocity.class), null, new String[]
{"M/Sec", "m/s"}));
_candidates.add(new TemporalSeriesSupporter(SI.CELSIUS
.asType(Temperature.class), null, new String[]
{"C", "DegC"}));
_candidates.add(new TemporalSeriesSupporter(DECIBEL
.asType(Dimensionless.class), null, new String[]
{"dB"}));
}
示例11: getUnit
import javax.measure.quantity.Pressure; //导入依赖的package包/类
@Override
public Unit<Pressure> getUnit() {
return UNIT;
}
示例12: getLastValue
import javax.measure.quantity.Pressure; //导入依赖的package包/类
@Override
public DataPoint<Pressure> getLastValue() {
WeatherConditions conditions = command.execute();
return new DataPoint<>(conditions.getPressure(), Instant.now());
}
示例13: getPressure
import javax.measure.quantity.Pressure; //导入依赖的package包/类
public Measurable<Pressure> getPressure() {
return pressure;
}
示例14: setPressure
import javax.measure.quantity.Pressure; //导入依赖的package包/类
public void setPressure(Measurable<Pressure> pressure) {
this.pressure = pressure;
}
示例15: thrust
import javax.measure.quantity.Pressure; //导入依赖的package包/类
public Amount<Force> thrust(Amount<Pressure> Po, Amount<Pressure> Pe, Amount<Pressure> Patm, final double k ){
double cF = thrustCoefficient(Po, Pe, Patm, k);
return Po.times(throatArea()).times(cF).to(Force.UNIT);
}