mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
ENH:accept full package once after switching printers
Change-Id: I561a0f3c0ae86c4215c7e1bd57328245a672a046
This commit is contained in:
@@ -1473,13 +1473,19 @@ int MachineObject::command_get_version(bool with_retry)
|
||||
return this->publish_json(j.dump(), 1);
|
||||
}
|
||||
|
||||
int MachineObject::command_request_push_all()
|
||||
int MachineObject::command_request_push_all(bool request_now)
|
||||
{
|
||||
auto curr_time = std::chrono::system_clock::now();
|
||||
auto diff = std::chrono::duration_cast<std::chrono::milliseconds>(curr_time - last_request_push);
|
||||
if (diff.count() < REQUEST_PUSH_MIN_TIME) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "static: command_request_push_all: send request too fast, dev_id=" << dev_id;
|
||||
return -1;
|
||||
if (request_now) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "static: command_request_push_all, dev_id=" << dev_id;
|
||||
last_request_push = std::chrono::system_clock::now();
|
||||
}
|
||||
else {
|
||||
BOOST_LOG_TRIVIAL(trace) << "static: command_request_push_all: send request too fast, dev_id=" << dev_id;
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
BOOST_LOG_TRIVIAL(trace) << "static: command_request_push_all, dev_id=" << dev_id;
|
||||
last_request_push = std::chrono::system_clock::now();
|
||||
|
||||
Reference in New Issue
Block a user