mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-16 23:42:11 +00:00
jira: [STUDIO-14068] [STUDIO-14330] Change-Id: I6281fbf56f3bf406ef28103998790a2a98c3f5c0 (cherry picked from commit 8ee02ec73076691c482ea6d089a49ea1c99ad10c)
29 lines
859 B
C++
29 lines
859 B
C++
#include "DevFilaAmsSetting.h"
|
|
#include "DevFilaSystem.h"
|
|
|
|
#include "slic3r/GUI/DeviceManager.hpp"
|
|
|
|
namespace Slic3r {
|
|
int DevAmsSystemFirmwareSwitch::CrtlSwitchFirmware(int firmware_idx)
|
|
{
|
|
if (!m_owner) {
|
|
return -1;
|
|
}
|
|
|
|
MachineObject* obj_ = m_owner->GetOwner();
|
|
|
|
json command_json;
|
|
command_json["upgrade"]["command"] = "mc_for_ams_firmware_upgrade";
|
|
command_json["upgrade"]["sequence_id"] = std::to_string(obj_->m_sequence_id++);
|
|
command_json["upgrade"]["src_id"] = 1;// 1-Studio
|
|
command_json["upgrade"]["id"] = firmware_idx;
|
|
|
|
int rtn = obj_->publish_json(command_json);
|
|
if (rtn == 0) {
|
|
m_status = "SWITCHING";
|
|
m_ctrl_switching = DevCtrlInfo(obj_, obj_->m_sequence_id - 1, command_json, 3, 1);
|
|
}
|
|
|
|
return rtn;
|
|
};
|
|
} |