mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-18 09:52:51 +00:00
ENH: clean codes about device
JIRA: [STUDIO-13609] Change-Id: I591de7033360b9570600006cfbce2148a8d031d5 (cherry picked from commit e9c774be8f4c89b8dafa14ef56913612fb68bd0c)
This commit is contained in:
26
src/slic3r/GUI/DeviceCore/DevCtrl.cpp
Normal file
26
src/slic3r/GUI/DeviceCore/DevCtrl.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#include <nlohmann/json.hpp>
|
||||
#include "DevCtrl.h"
|
||||
|
||||
// TODO: remove this include
|
||||
#include "DevUtil.h"
|
||||
#include "slic3r/GUI/DeviceManager.hpp"
|
||||
|
||||
using namespace nlohmann;
|
||||
|
||||
namespace Slic3r
|
||||
{
|
||||
int DevCtrl::command_select_extruder(int id)
|
||||
{
|
||||
json j;
|
||||
j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
|
||||
j["print"]["command"] = "select_extruder";
|
||||
j["print"]["extruder_index"] = id;
|
||||
int rtn = m_obj->publish_json(j, 1);
|
||||
if (rtn == 0)
|
||||
{
|
||||
m_obj->targ_nozzle_id_from_pc = id;
|
||||
}
|
||||
|
||||
return rtn;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user