mirror of
https://github.com/QIDITECH/QIDIStudio.git
synced 2026-02-02 18:08:51 +03:00
Updated to 1.9.5, and optimize calibration and device
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#include "DeviceManager.hpp"
|
||||
#include "libslic3r/Time.hpp"
|
||||
#include "libslic3r/Thread.hpp"
|
||||
#include "slic3r/Utils/ColorSpaceConvert.hpp"
|
||||
#include "GuiColor.hpp"
|
||||
|
||||
#include "GUI_App.hpp"
|
||||
#include "MsgDialog.hpp"
|
||||
@@ -790,15 +790,6 @@ bool MachineObject::is_support_ams_mapping()
|
||||
return true;
|
||||
}
|
||||
|
||||
static float calc_color_distance(wxColour c1, wxColour c2)
|
||||
{
|
||||
float lab[2][3];
|
||||
RGB2Lab(c1.Red(), c1.Green(), c1.Blue(), &lab[0][0], &lab[0][1], &lab[0][2]);
|
||||
RGB2Lab(c2.Red(), c2.Green(), c2.Blue(), &lab[1][0], &lab[1][1], &lab[1][2]);
|
||||
|
||||
return DeltaE76(lab[0][0], lab[0][1], lab[0][2], lab[1][0], lab[1][1], lab[1][2]);
|
||||
}
|
||||
|
||||
void MachineObject::get_ams_colors(std::vector<wxColour> &ams_colors) {
|
||||
ams_colors.clear();
|
||||
ams_colors.reserve(amsList.size());
|
||||
@@ -925,7 +916,8 @@ int MachineObject::ams_filament_mapping(std::vector<FilamentInfo> filaments, std
|
||||
val.tray_id = tray->second.id;
|
||||
wxColour c = wxColour(filaments[i].color);
|
||||
wxColour tray_c = AmsTray::decode_color(tray->second.color);
|
||||
val.distance = calc_color_distance(c, tray_c);
|
||||
//1.9.5
|
||||
val.distance = GUI::calc_color_distance(c, tray_c);
|
||||
if (filaments[i].type != tray->second.type) {
|
||||
val.distance = 999999;
|
||||
val.is_type_match = false;
|
||||
@@ -1442,8 +1434,6 @@ void MachineObject::parse_status(int flag)
|
||||
}
|
||||
|
||||
sdcard_state = MachineObject::SdcardState((flag >> 8) & 0x11);
|
||||
|
||||
network_wired = ((flag >> 18) & 0x1) != 0;
|
||||
}
|
||||
|
||||
PrintingSpeedLevel MachineObject::_parse_printing_speed_lvl(int lvl)
|
||||
@@ -3230,6 +3220,14 @@ int MachineObject::parse_json(std::string payload, bool key_field_only)
|
||||
mc_print_line_number = atoi(jj["mc_print_line_number"].get<std::string>().c_str());
|
||||
}
|
||||
}
|
||||
//1.9.5
|
||||
if (!key_field_only) {
|
||||
if (jj.contains("net")) {
|
||||
if (jj["net"].contains("conf")) {
|
||||
network_wired = (jj["net"]["conf"].get<int>() & (0x1)) != 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region online
|
||||
|
||||
Reference in New Issue
Block a user