ENH:show n3f/n3s version info

jira:[for n3s]

Change-Id: Ia0056dfdf7157036008cc63a37c9fd8076063a6a
This commit is contained in:
tao wang 2024-09-10 13:56:52 +08:00 committed by lane.wei
parent a16ec053b4
commit a44ff5a95a
5 changed files with 40 additions and 20 deletions

View File

@ -1276,12 +1276,18 @@ wxString MachineObject::get_upgrade_result_str(int err_code)
std::map<int, MachineObject::ModuleVersionInfo> MachineObject::get_ams_version()
{
std::vector<std::string> ams_type = {"ams", "n3f", "n3s"};
std::map<int, ModuleVersionInfo> result;
for (int i = 0; i < 4; i++) {
std::string ams_id = "ams/" + std::to_string(i);
auto it = module_vers.find(ams_id);
if (it != module_vers.end()) {
result.emplace(std::pair(i, it->second));
for (int i = 0; i < 8; i++) {
std::string ams_id;
for (auto type : ams_type )
{
ams_id = type + "/" + std::to_string(i);
auto it = module_vers.find(ams_id);
if (it != module_vers.end()) {
result.emplace(std::pair(i, it->second));
}
}
}
return result;

View File

@ -3941,11 +3941,17 @@ void GUI_App::load_gcode(wxWindow* parent, wxString& input_file) const
wxString GUI_App::transition_tridid(int trid_id)
{
//wxString maping_dict = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
wxString maping_dict[] = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"};
int id_index = ceil(trid_id / 4);
int id_suffix = (trid_id + 1) % 4 == 0 ? 4 : (trid_id + 1) % 4;
return wxString::Format("%s%d", maping_dict[id_index], id_suffix);
wxString maping_dict[] = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" };
if (trid_id >= 128 * 4) {
int id_index = 4 + trid_id % 128;
return wxString::Format("%s", maping_dict[id_index]);
}
else {
int id_index = ceil(trid_id / 4);
int id_suffix = id_suffix = (trid_id + 1) % 4 == 0 ? 4 : (trid_id + 1) % 4;
return wxString::Format("%s%d", maping_dict[id_index], id_suffix);
}
}
//BBS

View File

@ -688,9 +688,23 @@ void MachineInfoPanel::update_ams_ext(MachineObject *obj)
amspanel->Show();
auto it = ver_list.find(atoi(iter->first.c_str()));
if (it == ver_list.end()) {
continue;
}
auto ams_id = std::stoi(iter->second->id);
wxString ams_text = wxString::Format("AMS%s", std::to_string(ams_id + 1));
size_t pos = it->second.name.find('/');
wxString ams_device_name = "AMS-%s";
if (pos != std::string::npos) {
wxString result = it->second.name.substr(0, pos);
result.MakeUpper();
ams_device_name = result + "-%s";
}
wxString ams_text = wxString::Format(ams_device_name, std::to_string(ams_id + 1));
ams_name = ams_text;
if (it == ver_list.end()) {

View File

@ -51,16 +51,10 @@ bool AMSinfo::parse_ams_info(MachineObject *obj, Ams *ams, bool remain_flag, boo
this->ams_humidity = -1;
}
this->ams_type = AMSModel(ams->type);
/*if (humidity_flag) {
this->ams_humidity = ams->humidity;
}
else {
this->ams_humidity = -1;
}*/
nozzle_id = ams->nozzle;
cans.clear();
for (int i = 0; i < 4; i++) {
for (int i = 0; i < ams->trayList.size(); i++) {
auto it = ams->trayList.find(std::to_string(i));
Caninfo info;
// tray is exists

View File

@ -33,11 +33,11 @@
namespace Slic3r { namespace GUI {
enum AMSModel {
EXT_AMS = 0, //ext
EXT_AMS = 0, //ext
GENERIC_AMS = 1,
AMS_LITE = 2, //ams-lite
N3F_AMS = 3,
N3S_AMS = 4 //n3s single_ams
N3S_AMS = 4 //n3s single_ams
};
enum AMSModelOriginType {