mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-01-04 13:57:43 -07:00
FIX: ams control display bug
jira: none Change-Id: I72c5977ff4246c19f4bf5ce7e20f797c0efe9e9a (cherry picked from commit 7f43d427c30779f8e992a9893eed1ae57ae12446)
This commit is contained in:
parent
508ee2760d
commit
27e30373c8
2 changed files with 16 additions and 2 deletions
|
|
@ -784,9 +784,11 @@ public:
|
|||
txt1->SetForegroundColour(0x6B6B6B);
|
||||
int ams4 = 0, ams1 = 0;
|
||||
GetAMSCount(index, ams4, ams1);
|
||||
auto val4 = new SpinInput(this, {}, {}, wxDefaultPosition, {FromDIP(60), -1}, 0, 0, 4, ams4);
|
||||
auto val1 = new SpinInput(this, {}, {}, wxDefaultPosition, {FromDIP(60), -1}, 0, 0, 8, ams1);
|
||||
auto val4 = new SpinInput(this, {}, {}, wxDefaultPosition, {FromDIP(60), -1}, 0, 0, 4 - ams1, ams4);
|
||||
auto val1 = new SpinInput(this, {}, {}, wxDefaultPosition, {FromDIP(60), -1}, 0, 0, 4 - ams4, ams1);
|
||||
auto event_handler = [index, val4, val1, extruder](auto &evt) {
|
||||
val4->SetRange(0, 4 - val1->GetValue());
|
||||
val1->SetRange(0, 4 - val4->GetValue());
|
||||
SetAMSCount(index, val4->GetValue(), val1->GetValue());
|
||||
UpdateAMSCount(index, extruder);
|
||||
};
|
||||
|
|
@ -954,6 +956,10 @@ ExtruderGroup::ExtruderGroup(wxWindow * parent, int index, wxString const &title
|
|||
void ExtruderGroup::update_ams()
|
||||
{
|
||||
int display_capacity = 8;
|
||||
|
||||
if (ams_n4 * 4 + ams_n1 * 2 <= 8)
|
||||
is_upward = false;
|
||||
|
||||
bool display_front_ams = !is_upward;
|
||||
size_t i = 0;
|
||||
for (; i < ams_n4 && i < 4; ++i) {
|
||||
|
|
|
|||
|
|
@ -1719,6 +1719,14 @@ void AMSPreview::Update(AMSinfo amsinfo)
|
|||
{
|
||||
m_amsinfo = amsinfo;
|
||||
m_ams_item_type = amsinfo.ams_type;
|
||||
|
||||
if (m_ams_item_type == AMSModel::GENERIC_AMS || m_ams_item_type == AMSModel::AMS_LITE || m_ams_item_type == AMSModel::N3F_AMS) {
|
||||
SetMinSize(AMS_ITEM_SIZE);
|
||||
SetMaxSize(AMS_ITEM_SIZE);
|
||||
} else {
|
||||
SetMinSize(AMS_ITEM_SIZE);
|
||||
SetMaxSize(AMS_ITEM_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
void AMSPreview::create(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue