mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-19 02:13:27 +00:00
ENH: clean codes about device
JIRA: [STUDIO-13609] Change-Id: I591de7033360b9570600006cfbce2148a8d031d5 (cherry picked from commit e9c774be8f4c89b8dafa14ef56913612fb68bd0c)
This commit is contained in:
34
src/slic3r/GUI/DeviceCore/DevStorage.cpp
Normal file
34
src/slic3r/GUI/DeviceCore/DevStorage.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
#include "DevStorage.h"
|
||||
#include "slic3r/GUI/DeviceManager.hpp"
|
||||
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
DevStorage::SdcardState Slic3r::DevStorage::set_sdcard_state(int state)
|
||||
|
||||
{
|
||||
if (state < DevStorage::NO_SDCARD || state > DevStorage::SDCARD_STATE_NUM) {
|
||||
m_sdcard_state = DevStorage::NO_SDCARD;
|
||||
} else {
|
||||
m_sdcard_state = DevStorage::SdcardState(state);
|
||||
}
|
||||
return m_sdcard_state;
|
||||
}
|
||||
|
||||
void DevStorage::ParseV1_0(const json &print_json, DevStorage *system)
|
||||
{
|
||||
if (system)
|
||||
{
|
||||
if (print_json.contains("sdcard")) {
|
||||
if (print_json["sdcard"].get<bool>())
|
||||
system->m_sdcard_state = DevStorage::SdcardState::HAS_SDCARD_NORMAL;
|
||||
else
|
||||
system->m_sdcard_state = DevStorage::SdcardState::NO_SDCARD;
|
||||
} else {
|
||||
system->m_sdcard_state = DevStorage::SdcardState::NO_SDCARD;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // namespace Slic3r
|
||||
Reference in New Issue
Block a user