• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setTemperature函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中setTemperature函数的典型用法代码示例。如果您正苦于以下问题:C++ setTemperature函数的具体用法?C++ setTemperature怎么用?C++ setTemperature使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setTemperature函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: AvailabilityManager

AvailabilityManagerHighTemperatureTurnOn::AvailabilityManagerHighTemperatureTurnOn(const Model& model)
  : AvailabilityManager(AvailabilityManagerHighTemperatureTurnOn::iddObjectType(),model)
{
  OS_ASSERT(getImpl<detail::AvailabilityManagerHighTemperatureTurnOn_Impl>());

  setTemperature(30);
}
开发者ID:NREL,项目名称:OpenStudio,代码行数:7,代码来源:AvailabilityManagerHighTemperatureTurnOn.cpp


示例2: throw

ChromoConditions::ChromoConditions(double iColumnLength,
                                   double iColumnDiameter,
                                   double iColumnPoreSize,
                                   Gradient iGradient,
                                   double iSecondSolventConcentrationA,
                                   double iSecondSolventConcentrationB,
                                   double iDelayTime,
                                   double iFlowRate,
                                   double iDV,
                                   double iColumnRelativeStrength,
                                   double iColumnVpToVtot,
                                   double iColumnPorosity,
                                   double iTemperature)
                                   throw(ChromoConditionsException)
{
    // Set an empty gradient to prevent recalculation of SSConcentrations.
    mGradient = Gradient();
    setMixingCorrection(false);
    setColumnLength(iColumnLength);
    setColumnDiameter(iColumnDiameter);
    setColumnPoreSize(iColumnPoreSize);
    setColumnVpToVtot(iColumnVpToVtot);
    setColumnPorosity(iColumnPorosity);
    setTemperature(iTemperature);
    setColumnRelativeStrength(iColumnRelativeStrength);
    setFlowRate(iFlowRate);
    setDV(iDV);
    setDelayTime(iDelayTime);
    setSecondSolventConcentrationA(iSecondSolventConcentrationA);
    setSecondSolventConcentrationB(iSecondSolventConcentrationB);
    setGradient(iGradient);
}
开发者ID:DennisGoldfarb,项目名称:MSAcquisitionSimulator,代码行数:32,代码来源:chromoconditions.cpp


示例3: cmd_Start

int cmd_Start(int iStep){
	// Meshing
	if (steps >= iStep){
		unsigned long timePause = 60u * 1000u * params[iStep-1][1];
		char buffer[256];
		displayData(itoa(iStep, buffer, 10));
		displayData(",");
		displayData(itoa(params[iStep-1][1], buffer, 10));
		displayData(",");
		displayData(itoa(durationMillis / 60u / 1000u, buffer, 10));
		displayData(",");

		int maxTemp = params[iStep-1][0];
		if(params[iStep-1][3] == 1 && isWait){
			maxTemp = 0;
			if(readYes())
				iStep++;
		}

		Serial.println(iStep);

		if (setTemperature(maxTemp)){
			Serial.println(maxTemp);
			unsigned long curMillis = millis();
			durationMillis = durationMillis + (curMillis - prevMillis);
			prevMillis = curMillis;
			if (durationMillis > timePause){
				if(params[iStep-1][2] == 0){
					goNext = true;
				}else if((params[iStep-1][2] == 1) && (readYes())){
					goNext = true;
				}else
					isWait = true;
				if(goNext){
					durationMillis = 0;
					prevMillis = millis();
					iStep++;
					displayData("Step: ");
					displayData(itoa(iStep, buffer, 10));
					displayData("\r\n");
					goNext = false;
					isWait = false;
				}
			}
		}else{
			prevMillis = millis();
		}
	}else
		displayData("Finished\r\n");

	// Check gravity

	// Boiling with melt

	// Boiling + hop

	delay(1000);

	return iStep;
}
开发者ID:geosk,项目名称:brewery,代码行数:60,代码来源:main.cpp


示例4: setTemperature

void ThermoPhase::setState_conditional_TP(doublereal t, doublereal p, bool set_p)
{
    setTemperature(t);
    if (set_p) {
        setPressure(p);
    }
}
开发者ID:Niemeyer-Research-Group,项目名称:cantera,代码行数:7,代码来源:ThermoPhase.cpp


示例5: loop

// The loop function is called in an endless loop
void loop() {
	delay(SENSOR_CHANGE_TRIGGER_TIME);
	unsigned long unchangedTime = millis() - lastMotionDetected;
	if (unchangedTime < MAX_ON_TIME) {
		lcd.display();
		lcd.backlight();
		switch (sensor) {
		case TEMPERATURE_SENSOR_NUM:
			setTemperature();
			break;
		case HUMIDITY_SENSOR_NUM:
			setHumidity();
			break;
		case SOIL_SENSOR_NUM:
			setSoilHumidity();
			break;
		case PRESSURE_SENSOR_NUM:
			setPressure();
			break;
		}
	} else {
		lcd.noDisplay();
		lcd.noBacklight();
	}
	delay(500);
}
开发者ID:kjetilfjellheim,项目名称:arduino_experiments,代码行数:27,代码来源:Senser.cpp


示例6: setInitialConfig

void LatticeSim::init(){
  lattice->setAA(fn_aa);
  setInitialConfig();
  setTemperature(0.2);
  lattice->stats.getLatticeStats(lattice);
  lattice->setNative();
  lattice->stats.getLatticeStats(lattice);
}
开发者ID:rganti,项目名称:simulations_exercises,代码行数:8,代码来源:LatticeSim.cpp


示例7: CanteraError

void PDSS_ConstVol::setState_TR(doublereal temp, doublereal rho) {
    doublereal rhoStored = m_mw / m_constMolarVolume;
    if (fabs(rhoStored - rho) / (rhoStored + rho) > 1.0E-4) {
        throw CanteraError("PDSS_ConstVol::setState_TR",
                           "Inconsistent supplied rho");
    }
    setTemperature(temp);
}
开发者ID:hkmoffat,项目名称:cantera,代码行数:8,代码来源:PDSS_ConstVol.cpp


示例8: setSolenoid

Status::Status(){
  setSolenoid(0);
  setReedSwitch(0);
  setVibration(0);
  setMic(1023);
  setHumidity(0.0);
  setTemperature(0.0);
}
开发者ID:spotbox,项目名称:slave,代码行数:8,代码来源:Status.cpp


示例9: setTemperature

/// initialise simulation and create lattice
void Simulation2D::init(string fn_pdb){
  
  
  lattice->readPDBMultiChain(fn_pdb);
  setTemperature(0.2);
  lattice->stats.getLatticeStats(lattice);
  lattice->setNative();
  lattice->stats.getLatticeStats(lattice);
}
开发者ID:rganti,项目名称:simulations_exercises,代码行数:10,代码来源:Simulation2D.cpp


示例10: maxEigenvalue

		Integrator::Integrator( double temperature, double frictionCoeff, double stepSize, const Parameters &params )
			: maxEigenvalue( 4.34e5 ), stepsSinceDiagonalize( 0 ), mParameters( params ), mAnalysis( new Analysis ) {
			setTemperature( temperature );
			setFriction( frictionCoeff );
			setStepSize( stepSize );
			setConstraintTolerance( 1e-4 );
			setMinimumLimit( mParameters.minLimit );
			setRandomNumberSeed( ( int ) time( 0 ) );
		}
开发者ID:Omegaice,项目名称:LTMDOpenMM,代码行数:9,代码来源:Integrator.cpp


示例11: setTemperature

bool TemperatureSensor::StoreTemperature(float t) {
	if (t == NAN) {
		// error reading value
		setTemperature (NAN);
		setRawTemperature(NAN);
		return false;
	}
	else {
		// raw, non-corrected, values
		setRawTemperature(t);
		// correct based on calibration values
		t = t * getCal(TEMP_CAL_INDEX_TEMP_SLOPE) + getCal(TEMP_CAL_INDEX_TEMP_OFFSET);

		// store the corrected temperature value
		setTemperature(t);
		return true;
	}
	return false;
}
开发者ID:intrepidor,项目名称:esp8266-Sensor,代码行数:19,代码来源:temperature.cpp


示例12: initSimulation

/// Initialized the main CoMD data stucture, SimFlat, based on command
/// line input from the user.  Also performs certain sanity checks on
/// the input to screen out certain non-sensical inputs.
///
/// Simple data members such as the time step dt are initialized
/// directly, substructures such as the potential, the link cells, the
/// atoms, etc., are initialized by calling additional initialization
/// functions (initPotential(), initLinkCells(), initAtoms(), etc.).
/// Initialization order is set by the natural dependencies of the
/// substructure such as the atoms need the link cells so the link cells
/// must be initialized before the atoms.
SimFlat* initSimulation(Command cmd)
{
   SimFlat* sim = comdMalloc(sizeof(SimFlat));
   sim->nSteps = cmd.nSteps;
   sim->printRate = cmd.printRate;
   sim->dt = cmd.dt;
   sim->domain = NULL;
   sim->boxes = NULL;
   sim->atoms = NULL;
   sim->ePotential = 0.0;
   sim->eKinetic = 0.0;
   sim->atomExchange = NULL;

   sim->pot = initPotential(cmd.doeam, cmd.potDir, cmd.potName, cmd.potType);
   real_t latticeConstant = cmd.lat;
   if (cmd.lat < 0.0)
      latticeConstant = sim->pot->lat;

   // ensure input parameters make sense.
   sanityChecks(cmd, sim->pot->cutoff, latticeConstant, sim->pot->latticeType);

   sim->species = initSpecies(sim->pot);

   real3 globalExtent;
   globalExtent[0] = cmd.nx * latticeConstant;
   globalExtent[1] = cmd.ny * latticeConstant;
   globalExtent[2] = cmd.nz * latticeConstant;

   sim->domain = initDecomposition(
      cmd.xproc, cmd.yproc, cmd.zproc, globalExtent);

   sim->boxes = initLinkCells(sim->domain, sim->pot->cutoff);
   sim->atoms = initAtoms(sim->boxes);

   // create lattice with desired temperature and displacement.
   createFccLattice(cmd.nx, cmd.ny, cmd.nz, latticeConstant, sim);
   setTemperature(sim, cmd.temperature);
   randomDisplacements(sim, cmd.initialDelta);

   sim->atomExchange = initAtomHaloExchange(sim->domain, sim->boxes);

   // Forces must be computed before we call the time stepper.
   startTimer(redistributeTimer);
   redistributeAtoms(sim);
   stopTimer(redistributeTimer);

   startTimer(computeForceTimer);
   computeForce(sim);
   stopTimer(computeForceTimer);

   kineticEnergy(sim);

   return sim;
}
开发者ID:shamouda,项目名称:ocr-apps,代码行数:65,代码来源:CoMD.c


示例13: setMassFractions_NoNorm

void Phase::restoreState(size_t lenstate, const doublereal* state)
{
    if (lenstate >= nSpecies() + 2) {
        setMassFractions_NoNorm(state + 2);
        setTemperature(state[0]);
        setDensity(state[1]);
    } else {
        throw ArraySizeError("Phase::restoreState",
                             lenstate,nSpecies()+2);
    }
}
开发者ID:MrKingKong,项目名称:cantera,代码行数:11,代码来源:Phase.cpp


示例14: setTemperature

  void SurfPhase::setStateFromXML(const XML_Node& state) {

    double t;
    if (getOptionalFloat(state, "temperature", t, "temperature")) {
      setTemperature(t);
    }

    if (state.hasChild("coverages")) {
      string comp = getChildValue(state,"coverages");
      setCoveragesByName(comp);
    }
  }
开发者ID:anujg1991,项目名称:cantera,代码行数:12,代码来源:SurfPhase.cpp


示例15: WaterPropsIAPWS

void PDSS_Water::constructSet()
{
    if (m_sub) {
        delete m_sub;
    }
    m_sub = new WaterPropsIAPWS();
    if (m_sub == 0) {
        throw CanteraError("PDSS_Water::initThermo",
                           "could not create new substance object.");
    }
    /*
     * Calculate the molecular weight.
     *  hard coded to Cantera's elements and Water.
     */
    m_mw = 2 * 1.00794 + 15.9994;

    /*
     * Set the baseline
     */
    doublereal T = 298.15;

    m_p0 = OneAtm;

    doublereal presLow = 1.0E-2;
    doublereal oneBar = 1.0E5;
    doublereal dens = 1.0E-9;
    m_dens = m_sub->density(T, presLow, WATER_GAS, dens);
    m_pres = presLow;
    SW_Offset = 0.0;
    doublereal s = entropy_mole();
    s -=  GasConstant * log(oneBar/presLow);
    if (s != 188.835E3) {
        SW_Offset = 188.835E3 - s;
    }
    s = entropy_mole();
    s -=  GasConstant * log(oneBar/presLow);
    //printf("s = %g\n", s);

    doublereal h = enthalpy_mole();
    if (h != -241.826E6) {
        EW_Offset = -241.826E6 - h;
    }
    h = enthalpy_mole();
    //printf("h = %g\n", h);

    /*
     * Set the initial state of the system to 298.15 K and
     * 1 bar.
     */
    setTemperature(298.15);
    m_dens = m_sub->density(298.15, OneAtm, WATER_LIQUID);
    m_pres = OneAtm;
}
开发者ID:anujg1991,项目名称:cantera,代码行数:53,代码来源:PDSS_Water.cpp


示例16: syncSettings

void PreferencesUnits::syncSettings()
{
	auto units = SettingsObjectWrapper::instance()->unit_settings;
	QString unitSystem[] = {"metric", "imperial", "personal"};
	short unitValue = ui->metric->isChecked() ? METRIC : (ui->imperial->isChecked() ? IMPERIAL : PERSONALIZE);

	units->setUnitSystem(unitSystem[unitValue]);
	units->setTemperature(ui->fahrenheit->isChecked() ? units::FAHRENHEIT : units::CELSIUS);
	units->setLength(ui->feet->isChecked() ? units::FEET : units::METERS);
	units->setPressure(ui->psi->isChecked() ? units::PSI : units::BAR);
	units->setVolume(ui->cuft->isChecked() ? units::CUFT : units::LITER);
	units->setWeight(ui->lbs->isChecked() ? units::LBS : units::KG);
	units->setVerticalSpeedTime(ui->vertical_speed_minutes->isChecked() ? units::MINUTES : units::SECONDS);
	units->setCoordinatesTraditional(ui->gpsTraditional->isChecked());
}
开发者ID:atdotde,项目名称:subsurface,代码行数:15,代码来源:preferences_units.cpp


示例17: setDensity

  void SingleSpeciesTP::setState_SV(doublereal s, doublereal v, 
				    doublereal tol) {
    doublereal dt;
    setDensity(1.0/v);
    for (int n = 0; n < 50; n++) {
      dt = (s - entropy_mass())*temperature()/cv_mass();
      if (dt > 100.0) dt = 100.0;
      else if (dt < -100.0) dt = -100.0; 
      setTemperature(temperature() + dt);
      if (fabs(dt) < tol) {
	return;
      }
    }
    throw CanteraError("setState_SV","no convergence. dt = " + fp2str(dt));
  }
开发者ID:anujg1991,项目名称:cantera,代码行数:15,代码来源:SingleSpeciesTP.cpp


示例18: setWalkMax

SampleSAT::SampleSAT(SatProblem* sat, samplesatparams* ssparams, bool csmode, learnparams* lparams)
{
  sat_ = sat;
  ssparams_ = ssparams;
  lparams_ = lparams;
  setWalkMax(ssparams_->walkmax);
  setNumSample(ssparams_->numSample);
  setWalkSatProb(ssparams_->walksatProb);
  setRandomWalkProb(ssparams_->randomWalkProb);
  setTemperature(ssparams_->temperature);
  numAtom   = sat_->getNumVariables();
  numClause = sat_->getNumClauses();
  numSample = 0;
  stepAve = 0;
  csmode_ = csmode;
}
开发者ID:yamaguchimsf,项目名称:git,代码行数:16,代码来源:samplesat.cpp


示例19: setDensity

void SingleSpeciesTP::setState_SV(doublereal s, doublereal v,
                                  doublereal tol)
{
    doublereal dt;
    if (v == 0.0) {
        setDensity(1.0E100);
    } else {
        setDensity(1.0/v);
    }
    for (int n = 0; n < 50; n++) {
        dt = clip((s - entropy_mass())*temperature()/cv_mass(), -100.0, 100.0);
        setTemperature(temperature() + dt);
        if (fabs(dt) < tol) {
            return;
        }
    }
    throw CanteraError("setState_SV","no convergence. dt = " + fp2str(dt));
}
开发者ID:hgossler,项目名称:cantera,代码行数:18,代码来源:SingleSpeciesTP.cpp


示例20: setEnergy

HardwareState::HardwareState() {
	// set initial states and values of modules
	setEnergy((MIN_PROPER_VOLTAGE + MAX_PROPER_VOLTAGE)/2);
	setEnergyCurrent(MAX_PROPER_CURRENT);
	setEnergyStatus(MODULE_ON);

	setTemperature((MAX_PROPER_TEMPERATURE + MIN_PROPER_TEMPERATURE)/2);
	setTemperatureStatus(MODULE_ON);

	setPayload(1);
	setPayloadStatus(MODULE_STANDBY);
	setSband(1);
	setSbandStatus(MODULE_STANDBY);
	setSolarPanels(1);
	setSolarPanelsStatus(MODULE_ON);
	setThermalControl(1);
	setThermalControlStatus(MODULE_STANDBY);
}
开发者ID:genzel,项目名称:NegevSat,代码行数:18,代码来源:HardwareState.cpp



注:本文中的setTemperature函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setTempo函数代码示例发布时间:2022-05-30
下一篇:
C++ setTargetHotend2函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap