Support upload g-code to third-party printers (#2)

* wip

* fix cmake warning

* add UI and config options for Moonraker connection

* wip: copy whole print host UI from PS

* add more needed options

* wip 2

* fix string issue on Mac

* wip3
This commit is contained in:
SoftFever 2022-08-20 15:09:05 +08:00 committed by GitHub
parent 159ff850e4
commit dc5e0eed34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 5543 additions and 19 deletions

View file

@ -1225,7 +1225,9 @@ void Choice::set_value(const boost::any& value, bool change_event)
// BBS
case coEnums: {
int val = boost::any_cast<int>(value);
if (m_opt_id.compare("host_type") == 0 && val != 0 &&
m_opt.enum_values.size() > field->GetCount()) // for case, when PrusaLink isn't used as a HostType
val--;
if (m_opt_id == "top_surface_pattern" || m_opt_id == "bottom_surface_pattern" || m_opt_id == "sparse_infill_pattern")
{
std::string key;
@ -1305,7 +1307,11 @@ boost::any& Choice::get_value()
// BBS
if (m_opt.type == coEnum || m_opt.type == coEnums)
{
if (m_opt_id == "top_surface_pattern" || m_opt_id == "bottom_surface_pattern" || m_opt_id == "sparse_infill_pattern") {
if (m_opt_id.compare("host_type") == 0 && m_opt.enum_values.size() > field->GetCount()) {
// for case, when PrusaLink isn't used as a HostType
m_value = field->GetSelection()+1;
}
else if (m_opt_id == "top_surface_pattern" || m_opt_id == "bottom_surface_pattern" || m_opt_id == "sparse_infill_pattern") {
const std::string& key = m_opt.enum_values[field->GetSelection()];
m_value = int(ConfigOptionEnum<InfillPattern>::get_enum_values().at(key));
}