mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-15 17:55:57 +08:00
Fix "grey" machine limits field for export.
supermerill/SuperSlicer#1960
This commit is contained in:
parent
ed3edaadf2
commit
daae6832a1
@ -4033,49 +4033,77 @@ void TabPrinter::update_machine_limits_description(const MachineLimitsUsage usag
|
|||||||
//update fields used
|
//update fields used
|
||||||
//no need to worry for "silent" version, as it's only for marlin.
|
//no need to worry for "silent" version, as it's only for marlin.
|
||||||
if (usage == MachineLimitsUsage::EmitToGCode) {
|
if (usage == MachineLimitsUsage::EmitToGCode) {
|
||||||
wxColour greay_color(128, 128, 128);
|
wxColour grey_color(128, 128, 128);
|
||||||
|
wxColour black_color = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
|
||||||
Field* field;
|
Field* field;
|
||||||
std::vector<std::string> axes{ "x", "y", "z", "e" };
|
std::vector<std::string> axes{ "x", "y", "z", "e" };
|
||||||
if (std::set<uint8_t>{gcfKlipper, gcfMach3, gcfMachinekit, gcfMakerWare, gcfSailfish, gcfTeacup}.count(flavor) > 0)
|
|
||||||
|
wxColour color = (std::set<uint8_t>{gcfKlipper, gcfMach3, gcfMachinekit, gcfMakerWare, gcfSailfish, gcfTeacup}.count(flavor) > 0) ? grey_color : black_color;
|
||||||
for (const std::string& axis : axes) {
|
for (const std::string& axis : axes) {
|
||||||
field = m_active_page->get_field("machine_max_feedrate_" + axis, 0);
|
field = m_active_page->get_field("machine_max_feedrate_" + axis, 0);
|
||||||
if (field) dynamic_cast<wxTextCtrl*>(field->getWindow())->SetForegroundColour(greay_color);
|
if (field) dynamic_cast<wxTextCtrl*>(field->getWindow())->SetForegroundColour(color);
|
||||||
}
|
}
|
||||||
if (std::set<uint8_t>{gcfKlipper, gcfSmoothie, gcfMach3, gcfMachinekit, gcfMakerWare, gcfSailfish, gcfTeacup}.count(flavor) > 0)
|
color = (std::set<uint8_t>{gcfKlipper, gcfSmoothie, gcfMach3, gcfMachinekit, gcfMakerWare, gcfSailfish, gcfTeacup}.count(flavor) > 0) ? grey_color : black_color;
|
||||||
for (const std::string& axis : axes) {
|
for (const std::string& axis : axes) {
|
||||||
field = m_active_page->get_field("machine_max_acceleration_" + axis, 0);
|
field = m_active_page->get_field("machine_max_acceleration_" + axis, 0);
|
||||||
if (field) dynamic_cast<wxTextCtrl*>(field->getWindow())->SetForegroundColour(greay_color);
|
if (field) dynamic_cast<wxTextCtrl*>(field->getWindow())->SetForegroundColour(color);
|
||||||
}
|
}
|
||||||
if (std::set<uint8_t>{gcfSmoothie, gcfMach3, gcfMachinekit, gcfMakerWare, gcfSailfish, gcfTeacup}.count(flavor) > 0)
|
color = (std::set<uint8_t>{gcfSmoothie, gcfMach3, gcfMachinekit, gcfMakerWare, gcfSailfish, gcfTeacup}.count(flavor) > 0) ? grey_color : black_color;
|
||||||
{
|
{
|
||||||
field = m_active_page->get_field("machine_max_acceleration_extruding", 0);
|
field = m_active_page->get_field("machine_max_acceleration_extruding", 0);
|
||||||
if (field) dynamic_cast<wxTextCtrl*>(field->getWindow())->SetForegroundColour(greay_color);
|
if (field) dynamic_cast<wxTextCtrl*>(field->getWindow())->SetForegroundColour(color);
|
||||||
}
|
}
|
||||||
if (flavor != gcfMarlin)
|
color = (flavor != gcfMarlin) ? grey_color : black_color;
|
||||||
{
|
{
|
||||||
field = m_active_page->get_field("machine_max_acceleration_retracting", 0);
|
field = m_active_page->get_field("machine_max_acceleration_retracting", 0);
|
||||||
if (field) dynamic_cast<wxTextCtrl*>(field->getWindow())->SetForegroundColour(greay_color);
|
if (field) dynamic_cast<wxTextCtrl*>(field->getWindow())->SetForegroundColour(color);
|
||||||
}
|
}
|
||||||
if (std::set<uint8_t>{gcfSmoothie, gcfMach3, gcfMachinekit, gcfMakerWare, gcfSailfish, gcfTeacup}.count(flavor) > 0)
|
color = (std::set<uint8_t>{gcfSmoothie, gcfMach3, gcfMachinekit, gcfMakerWare, gcfSailfish, gcfTeacup}.count(flavor) > 0) ? grey_color : black_color;
|
||||||
{
|
{
|
||||||
field = m_active_page->get_field("machine_max_acceleration_travel", 0);
|
field = m_active_page->get_field("machine_max_acceleration_travel", 0);
|
||||||
if (field) dynamic_cast<wxTextCtrl*>(field->getWindow())->SetForegroundColour(greay_color);
|
if (field) dynamic_cast<wxTextCtrl*>(field->getWindow())->SetForegroundColour(color);
|
||||||
}
|
}
|
||||||
if (std::set<uint8_t>{gcfKlipper, gcfMach3, gcfMachinekit, gcfMakerWare, gcfSailfish, gcfTeacup}.count(flavor) > 0)
|
color = (std::set<uint8_t>{gcfKlipper, gcfMach3, gcfMachinekit, gcfMakerWare, gcfSailfish, gcfTeacup}.count(flavor) > 0) ? grey_color : black_color;
|
||||||
for (const std::string& axis : axes) {
|
for (const std::string& axis : axes) {
|
||||||
field = m_active_page->get_field("machine_max_jerk_" + axis, 0);
|
field = m_active_page->get_field("machine_max_jerk_" + axis, 0);
|
||||||
if (field) dynamic_cast<wxTextCtrl*>(field->getWindow())->SetForegroundColour(greay_color);
|
if (field) dynamic_cast<wxTextCtrl*>(field->getWindow())->SetForegroundColour(color);
|
||||||
}
|
}
|
||||||
if (flavor != gcfMarlin && flavor != gcfRepRap)
|
color = (flavor != gcfMarlin && flavor != gcfRepRap) ? grey_color : black_color;
|
||||||
{
|
{
|
||||||
field = m_active_page->get_field("machine_min_extruding_rate", 0);
|
field = m_active_page->get_field("machine_min_extruding_rate", 0);
|
||||||
if (field) dynamic_cast<wxTextCtrl*>(field->getWindow())->SetForegroundColour(greay_color);
|
if (field) dynamic_cast<wxTextCtrl*>(field->getWindow())->SetForegroundColour(color);
|
||||||
}
|
}
|
||||||
if (flavor != gcfMarlin)
|
color = (flavor != gcfMarlin) ? grey_color : black_color;
|
||||||
{
|
{
|
||||||
field = m_active_page->get_field("machine_min_travel_rate", 0);
|
field = m_active_page->get_field("machine_min_travel_rate", 0);
|
||||||
if (field) dynamic_cast<wxTextCtrl*>(field->getWindow())->SetForegroundColour(greay_color);
|
if (field) dynamic_cast<wxTextCtrl*>(field->getWindow())->SetForegroundColour(color);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Field* field;
|
||||||
|
std::vector<std::string> axes{ "x", "y", "z", "e" };
|
||||||
|
const wxColour color = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
|
||||||
|
for (const std::string& axis : axes) {
|
||||||
|
field = m_active_page->get_field("machine_max_feedrate_" + axis, 0);
|
||||||
|
if (field) dynamic_cast<wxTextCtrl*>(field->getWindow())->SetForegroundColour(color);
|
||||||
|
}
|
||||||
|
for (const std::string& axis : axes) {
|
||||||
|
field = m_active_page->get_field("machine_max_acceleration_" + axis, 0);
|
||||||
|
if (field) dynamic_cast<wxTextCtrl*>(field->getWindow())->SetForegroundColour(color);
|
||||||
|
}
|
||||||
|
field = m_active_page->get_field("machine_max_acceleration_extruding", 0);
|
||||||
|
if (field) dynamic_cast<wxTextCtrl*>(field->getWindow())->SetForegroundColour(color);
|
||||||
|
field = m_active_page->get_field("machine_max_acceleration_retracting", 0);
|
||||||
|
if (field) dynamic_cast<wxTextCtrl*>(field->getWindow())->SetForegroundColour(color);
|
||||||
|
field = m_active_page->get_field("machine_max_acceleration_travel", 0);
|
||||||
|
if (field) dynamic_cast<wxTextCtrl*>(field->getWindow())->SetForegroundColour(color);
|
||||||
|
for (const std::string& axis : axes) {
|
||||||
|
field = m_active_page->get_field("machine_max_jerk_" + axis, 0);
|
||||||
|
if (field) dynamic_cast<wxTextCtrl*>(field->getWindow())->SetForegroundColour(color);
|
||||||
|
}
|
||||||
|
field = m_active_page->get_field("machine_min_extruding_rate", 0);
|
||||||
|
if (field) dynamic_cast<wxTextCtrl*>(field->getWindow())->SetForegroundColour(color);
|
||||||
|
field = m_active_page->get_field("machine_min_travel_rate", 0);
|
||||||
|
if (field) dynamic_cast<wxTextCtrl*>(field->getWindow())->SetForegroundColour(color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user