mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-18 08:22:06 +00:00
ENH: support AMS switching for A series; clean class AMSSetting
jira: [STUDIO-14068] [STUDIO-14330] Change-Id: I6281fbf56f3bf406ef28103998790a2a98c3f5c0 (cherry picked from commit 8ee02ec73076691c482ea6d089a49ea1c99ad10c)
This commit is contained in:
29
src/slic3r/GUI/DeviceCore/DevFilaAmsSettingCtrl.cpp
Normal file
29
src/slic3r/GUI/DeviceCore/DevFilaAmsSettingCtrl.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user