FIX: CLI: fix the filament_map incorrect issue

jira: no-jira
Change-Id: I8f389ae1dca2cbe79a2db7a5e9fbb94da430d037
This commit is contained in:
lane.wei 2025-02-28 20:03:15 +08:00
parent 04ed34ef2e
commit 89308c8676
1 changed files with 20 additions and 17 deletions

View File

@ -1334,27 +1334,28 @@ int CLI::run(int argc, char **argv)
/*BOOST_LOG_TRIVIAL(info) << "begin to setup params, argc=" << argc << std::endl; /*BOOST_LOG_TRIVIAL(info) << "begin to setup params, argc=" << argc << std::endl;
for (int index=0; index < argc; index++) for (int index=0; index < argc; index++)
BOOST_LOG_TRIVIAL(info) << "index="<< index <<", arg is "<< argv[index] <<std::endl; BOOST_LOG_TRIVIAL(info) << "index="<< index <<", arg is "<< argv[index] <<std::endl;
int debug_argc = 6; int debug_argc = 20;
char* debug_argv[] = { char* debug_argv[] = {
"F:\work\projects\bambu_debug\bamboo_slicer\build_debug\src\Debug\bambu-studio.exe", "F:\work\projects\bambu_debug\bamboo_slicer\build_debug\src\Debug\bambu-studio.exe",
"--debug=2", "--debug=2",
"--uptodate", "--uptodate",
//"--load-settings", "--load-settings",
//"machine_A1.json", "machine_H2D.json",
//"--load-defaultfila", "--load-defaultfila",
//"--load-filaments", "--load-filaments",
//"filament_pla_basic_A1.json;filament_pla_basic_A1.json", ";filament_pla_basic_H2D.json;filament_pla_basic_H2D.json;filament_pla_basic_H2D.json;",
"--export-3mf=output.3mf", "--export-3mf=output.3mf",
//"--filament-colour", "--filament-colour",
//"#CD056D;#702829", ";#F4EE2AFF;#FFFFFFFF;#F99963FF;",
//"--nozzle-volume-type", "--nozzle-volume-type",
//"Standard,High Flow", "Standard,Standard",
//"--filament-map-mode", "--filament-map-mode",
//"Auto", "Manual",
//"--filament-map", "--filament-map",
//"1,2,1,2", "2,2,2,1,2",
"--slice=0", "--slice=1",
"stl_test.3mf" "--min-save",
"AMS-A1mini.3mf"
}; };
if (! this->setup(debug_argc, debug_argv))*/ if (! this->setup(debug_argc, debug_argv))*/
if (!this->setup(argc, argv)) if (!this->setup(argc, argv))
@ -5648,8 +5649,10 @@ int CLI::run(int argc, char **argv)
} }
else { else {
std::vector<int> filament_maps; std::vector<int> filament_maps;
if (m_extra_config.option<ConfigOptionInts>("filament_map")) if (m_extra_config.option<ConfigOptionInts>("filament_map")) {
filament_maps = m_extra_config.option<ConfigOptionInts>("filament_map")->values; filament_maps = m_extra_config.option<ConfigOptionInts>("filament_map")->values;
part_plate->set_filament_maps(filament_maps);
}
else else
filament_maps = part_plate->get_real_filament_maps(m_print_config); filament_maps = part_plate->get_real_filament_maps(m_print_config);
for (int index = 0; index < filament_maps.size(); index++) for (int index = 0; index < filament_maps.size(); index++)