本文整理汇总了C++中Stage::currentStep方法的典型用法代码示例。如果您正苦于以下问题:C++ Stage::currentStep方法的具体用法?C++ Stage::currentStep怎么用?C++ Stage::currentStep使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stage
的用法示例。
在下文中一共展示了Stage::currentStep方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: holdStepCallback
void ExperimentController::holdStepCallback(Poco::Timer &)
{
bool isLast = false;
{
Poco::RWLock::ScopedWriteLock lock(*_machineMutex);
if (_machineState != RunningMachineState)
return;
if (_experiment.protocol()->currentStage()->type() != Stage::Meltcurve)
_dbControl->addFluorescenceData(_experiment, OpticsInstance::getInstance()->getFluorescenceData());
if (_experiment.protocol()->hasNextStep())
{
_experiment.protocol()->advanceNextStep();
Stage *stage = _experiment.protocol()->currentStage();
double temperature = stage->currentStep()->temperature();
if (stage->autoDelta() && stage->currentCycle() > stage->autoDeltaStartCycle())
{
temperature += stage->currentStep()->deltaTemperature() * (stage->currentCycle() - stage->autoDeltaStartCycle());
if (temperature < HeatBlockInstance::getInstance()->minTargetTemperature())
temperature = HeatBlockInstance::getInstance()->minTargetTemperature();
else if (temperature > HeatBlockInstance::getInstance()->maxTargetTemperature())
temperature = HeatBlockInstance::getInstance()->maxTargetTemperature();
}
if (stage->currentRamp()->collectData())
{
OpticsInstance::getInstance()->setCollectData(true, stage->type() == Stage::Meltcurve);
if (stage->type() == Stage::Meltcurve)
{
_meltCurveTimer->setPeriodicInterval(STORE_MELT_CURVE_DATA_INTERVAL);
_meltCurveTimer->start(Poco::TimerCallback<ExperimentController>(*this, &ExperimentController::meltCurveCallback));
}
}
_thermalState = HeatBlockInstance::getInstance()->temperature() < temperature ? HeatingThermalState : CoolingThermalState;
OpticsInstance::getInstance()->getLedController()->setIntensity(stage->currentRamp()->excitationIntensity());
HeatBlockInstance::getInstance()->setTargetTemperature(temperature, stage->currentRamp()->rate());
HeatBlockInstance::getInstance()->enableStepProcessing();
}
else
isLast = true;
}
if (!isLast)
calculateEstimatedDuration();
else
{
complete();
stop();
}
}
示例2: stop
void ExperimentController::stop()
{
MachineState state = IdleMachineState;
{
Poco::RWLock::ScopedWriteLock lock(*_machineMutex);
if (_machineState == IdleMachineState)
return;
else if (_machineState == CompleteMachineState && _experiment.protocol()->currentStage()->type() != Stage::Meltcurve)
{
//Check if it was infinite hold step
Stage *stage = _experiment.protocol()->currentStage();
std::time_t holdTime = stage->currentStep()->holdTime();
if (stage->autoDelta() && stage->currentCycle() > stage->autoDeltaStartCycle())
{
holdTime += stage->currentStep()->deltaDuration() * (stage->currentCycle() - stage->autoDeltaStartCycle());
if (holdTime < 0)
holdTime = 0;
}
if (holdTime == 0)
_dbControl->addFluorescenceData(_experiment, OpticsInstance::getInstance()->getFluorescenceData());
}
LidInstance::getInstance()->setEnableMode(false);
HeatBlockInstance::getInstance()->setEnableMode(false);
OpticsInstance::getInstance()->setCollectData(false);
if (_machineState != CompleteMachineState)
{
_experiment.setCompletionStatus(Experiment::Aborted);
_experiment.setCompletedAt(boost::posix_time::microsec_clock::local_time());
_dbControl->completeExperiment(_experiment);
}
state = _machineState;
_machineState = IdleMachineState;
_thermalState = IdleThermalState;
_experiment = Experiment();
}
if (state != CompleteMachineState)
{
stopLogging();
_holdStepTimer->stop();
_meltCurveTimer->stop();
}
}
示例3: stepBegun
void ExperimentController::stepBegun()
{
bool onPause = false;
_holdStepTimer->stop();
{
Poco::RWLock::ScopedWriteLock lock(*_machineMutex);
if (_machineState != RunningMachineState)
return;
Stage *stage = _experiment.protocol()->currentStage();
if (!stage->currentStep()->pauseState())
{
std::time_t holdTime = stage->currentStep()->holdTime();
if (stage->autoDelta() && stage->currentCycle() > stage->autoDeltaStartCycle())
{
holdTime += stage->currentStep()->deltaDuration() * (stage->currentCycle() - stage->autoDeltaStartCycle());
if (holdTime < 0)
holdTime = 0;
}
if (holdTime > 0 || _experiment.protocol()->hasNextStep())
{
_holdStepTimer->setStartInterval(holdTime * 1000);
_holdStepTimer->start(Poco::TimerCallback<ExperimentController>(*this, &ExperimentController::holdStepCallback));
return;
}
}
else
{
_experiment.setPauseTime(boost::posix_time::microsec_clock::local_time());
_machineState = PausedMachineState;
onPause = true;
}
}
if (!onPause)
complete();
else
calculateEstimatedDuration();
}
示例4: calculateEstimatedDuration
void ExperimentController::calculateEstimatedDuration()
{
Experiment experiment = this->experiment();
double duration = (boost::posix_time::microsec_clock::local_time() - experiment.startedAt()).total_milliseconds() - (experiment.pausedDuration() * 1000);
double previousTargetTemp = HeatBlockInstance::getInstance()->temperature();
do
{
Stage *stage = experiment.protocol()->currentStage();
std::time_t holdTime = stage->currentStep()->holdTime();
double temperature = stage->currentStep()->temperature();
if (stage->autoDelta() && stage->currentCycle() > stage->autoDeltaStartCycle())
{
holdTime += stage->currentStep()->deltaDuration() * (stage->currentCycle() - stage->autoDeltaStartCycle());
if (holdTime < 0)
holdTime = 0;
temperature += stage->currentStep()->deltaTemperature() * (stage->currentCycle() - stage->autoDeltaStartCycle());
if (temperature < HeatBlockInstance::getInstance()->minTargetTemperature())
temperature = HeatBlockInstance::getInstance()->minTargetTemperature();
else if (temperature > HeatBlockInstance::getInstance()->maxTargetTemperature())
temperature = HeatBlockInstance::getInstance()->maxTargetTemperature();
}
double rate = stage->currentRamp()->rate();
rate = rate > 0 && rate <= kDurationCalcHeatBlockRampSpeed ? rate : kDurationCalcHeatBlockRampSpeed;
if (previousTargetTemp < temperature)
duration += (((temperature - previousTargetTemp) / rate) + holdTime) * 1000;
else
duration += (((previousTargetTemp - temperature) / rate) + holdTime) * 1000;
previousTargetTemp = temperature;
}
while (experiment.protocol()->advanceNextStep());
{
Poco::RWLock::ScopedWriteLock lock(*_machineMutex);
_experiment.setEstimatedDuration(std::round(duration / 1000));
}
}