|
|
@ -22,7 +22,9 @@ void AddLiquidService::initialize() { |
|
|
|
|
|
|
|
void AddLiquidService::start(int stopatg) { |
|
|
|
lock_guard<recursive_mutex> lock(lock_); |
|
|
|
auto nowstate = m_ds->getDeviceState(); |
|
|
|
|
|
|
|
auto nowstate = m_ds->getDeviceState(); |
|
|
|
|
|
|
|
if (nowstate != DeviceState::Idle) { |
|
|
|
logger->warn("start add liquid fail, device state is not idle"); |
|
|
|
THROW_APP_EXCEPTION(getDeviceBusyReason(nowstate), ""); |
|
|
@ -32,10 +34,6 @@ void AddLiquidService::start(int stopatg) { |
|
|
|
THROW_APP_EXCEPTION(err::kappe_exception_flag_is_setted, ""); |
|
|
|
} |
|
|
|
|
|
|
|
if (DS->getDeviceState() != DeviceState::Idle) { |
|
|
|
THROW_APP_EXCEPTION(err::kappe_state_is_busy, ""); |
|
|
|
} |
|
|
|
|
|
|
|
if (zsteady_clock().gets() < SENSOR_PREHEART_TIME_S) { |
|
|
|
THROW_APP_EXCEPTION(err::kappe_sensor_is_pre_hearting, ""); |
|
|
|
} |
|
|
@ -67,6 +65,7 @@ void AddLiquidService::start(int stopatg) { |
|
|
|
} |
|
|
|
|
|
|
|
m_workstate = kaddingLiquid; |
|
|
|
DS->setDeviceState(DeviceState::AddingLiquid); |
|
|
|
m_thread.reset(new Thread("addLiquid", [this, stopatg]() { |
|
|
|
ThisThread thisThread; |
|
|
|
bool errorflag = false; |
|
|
@ -83,6 +82,7 @@ void AddLiquidService::start(int stopatg) { |
|
|
|
GET_SERVICE(IflytopFrontEndService)->sendPrompt("加液完成"); |
|
|
|
} |
|
|
|
m_workstate = kidle; |
|
|
|
DS->setDeviceState(DeviceState::Idle); |
|
|
|
})); |
|
|
|
//
|
|
|
|
logger->info("start add liquid success"); |
|
|
|