mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 07:27:41 -06:00
NEW:add remaining capacity detection switch in ams setting
Change-Id: I8f7be78dbf881bb5e2564aea4d0e01d78f1b0433
This commit is contained in:
parent
a316bdfa22
commit
8216265725
7 changed files with 174 additions and 57 deletions
|
@ -54,7 +54,7 @@ static wxColour decode_color(const std::string &color)
|
|||
return wxColour(ret[0], ret[1], ret[2]);
|
||||
}
|
||||
|
||||
bool AMSinfo::parse_ams_info(Ams *ams)
|
||||
bool AMSinfo::parse_ams_info(Ams *ams, bool remain_flag)
|
||||
{
|
||||
if (!ams) return false;
|
||||
this->ams_id = ams->id;
|
||||
|
@ -81,8 +81,14 @@ bool AMSinfo::parse_ams_info(Ams *ams)
|
|||
info.material_state = AMSCanType::AMS_CAN_TYPE_THIRDBRAND;
|
||||
}
|
||||
|
||||
info.material_remain = it->second->remain < 0 ? 100 :it->second->remain;
|
||||
info.material_remain = it->second->remain > 100 ? 100 :info.material_remain;
|
||||
if (!remain_flag) {
|
||||
info.material_remain = 100;
|
||||
}
|
||||
else {
|
||||
info.material_remain = it->second->remain < 0 ? 100 : it->second->remain;
|
||||
info.material_remain = it->second->remain > 100 ? 100 : info.material_remain;
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
info.can_id = it->second->id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue