本文整理汇总了Java中javax.measure.quantity.Pressure类的典型用法代码示例。如果您正苦于以下问题:Java Pressure类的具体用法?Java Pressure怎么用?Java Pressure使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Pressure类属于javax.measure.quantity包,在下文中一共展示了Pressure类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
});
}
开发者ID:bkuker,项目名称:motorsim,代码行数:25,代码来源:AbstractFuelEditor.java
示例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));
}
}
}
开发者ID:bkuker,项目名称:motorsim,代码行数:8,代码来源:EditablePiecewiseSaintRobertFuel.java
示例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;
}
开发者ID:bkuker,项目名称:motorsim,代码行数:38,代码来源:EditablePiecewiseLinearFuel.java
示例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();
}
开发者ID:bkuker,项目名称:motorsim,代码行数:35,代码来源:SRFuelEditor.java
示例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);
}
开发者ID:bkuker,项目名称:motorsim,代码行数:14,代码来源:SRFuelEditor.java
示例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);
}
开发者ID:bkuker,项目名称:motorsim,代码行数:12,代码来源:LinearFuelEditor.java
示例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;
}
开发者ID:bkuker,项目名称:motorsim,代码行数:12,代码来源:MultiFuelChart.java
示例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);
}
开发者ID:bkuker,项目名称:motorsim,代码行数:15,代码来源:ConvergentDivergentNozzleTest.java
示例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());
}
开发者ID:debrief,项目名称:limpet,代码行数:72,代码来源:TestCsvParser.java
示例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"}));
}
开发者ID:debrief,项目名称:limpet,代码行数:52,代码来源:CsvParser.java
示例11: getUnit
import javax.measure.quantity.Pressure; //导入依赖的package包/类
@Override
public Unit<Pressure> getUnit() {
return UNIT;
}
开发者ID:kalixia,项目名称:kha,代码行数:5,代码来源:WundergroundPressureSensor.java
示例12: getLastValue
import javax.measure.quantity.Pressure; //导入依赖的package包/类
@Override
public DataPoint<Pressure> getLastValue() {
WeatherConditions conditions = command.execute();
return new DataPoint<>(conditions.getPressure(), Instant.now());
}
开发者ID:kalixia,项目名称:kha,代码行数:6,代码来源:WundergroundPressureSensor.java
示例13: getPressure
import javax.measure.quantity.Pressure; //导入依赖的package包/类
public Measurable<Pressure> getPressure() {
return pressure;
}
开发者ID:kalixia,项目名称:kha,代码行数:4,代码来源:WeatherConditions.java
示例14: setPressure
import javax.measure.quantity.Pressure; //导入依赖的package包/类
public void setPressure(Measurable<Pressure> pressure) {
this.pressure = pressure;
}
开发者ID:kalixia,项目名称:kha,代码行数:4,代码来源:WeatherConditions.java
示例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);
}
开发者ID:bkuker,项目名称:motorsim,代码行数:5,代码来源:ConvergentDivergentNozzle.java
示例16: thrustCoefficient
import javax.measure.quantity.Pressure; //导入依赖的package包/类
public double thrustCoefficient(Amount<Pressure> Po, Amount<Pressure> Pe, Amount<Pressure> Patm, final double k ){
double pRatio = Pe.divide(Po).to(Dimensionless.UNIT).doubleValue(Dimensionless.UNIT);
double a = (2*k*k)/(k-1);
double b = Math.pow(2/(k+1), (k+1)/(k-1) );
double c = 1.0 - Math.pow(pRatio, (k-1)/k);
Amount<Pressure> pDiff = Pe.minus(Patm);
double d = pDiff.times(exitArea()).divide(Po.times(throatArea())).to(Dimensionless.UNIT).doubleValue(Dimensionless.UNIT);
double Cf = efficiency * Math.sqrt(a*b*c)+d;
return Cf;
}
开发者ID:bkuker,项目名称:motorsim,代码行数:18,代码来源:ConvergentDivergentNozzle.java
示例17: maxPressure
import javax.measure.quantity.Pressure; //导入依赖的package包/类
public Amount<Pressure> maxPressure(){
return maxPressure;
}
开发者ID:bkuker,项目名称:motorsim,代码行数:4,代码来源:BurnSummary.java
示例18: burnrateCoefficient
import javax.measure.quantity.Pressure; //导入依赖的package包/类
@Override
protected double burnrateCoefficient(Amount<Pressure> pressure) {
return .0037;
}
开发者ID:bkuker,项目名称:motorsim,代码行数:5,代码来源:KNER.java
示例19: burnrateExponent
import javax.measure.quantity.Pressure; //导入依赖的package包/类
@Override
protected double burnrateExponent(Amount<Pressure> pressure) {
return .64;
}
开发者ID:bkuker,项目名称:motorsim,代码行数:5,代码来源:KNER.java
示例20: burnrateCoefficient
import javax.measure.quantity.Pressure; //导入依赖的package包/类
@Override
protected double burnrateCoefficient(Amount<Pressure> pressure) {
return a;
}
开发者ID:bkuker,项目名称:motorsim,代码行数:5,代码来源:EditableFuel.java
注:本文中的javax.measure.quantity.Pressure类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论