Implemented handling of complex ConfigOptionFloatOrPercent chains

by the PlaceholderParser.

Namely, all the options with the "ratio_over" reference are now handled
correctly by the PlaceholderParser with the exception
of the "first_layer_extrusion_width", which overrides speed of extrusions
by their respective extrusion type.

Also the various extrusion widths (extrusion_width, first_layer_extrusion_width,
external_perimeter_extrusion_width etc.) produce the same numbers
as if ran through the back-end, with the assumption of not overriding
layer height by the variable layer height editing tool or layer height
modifiers.
This commit is contained in:
bubnikv 2020-02-04 14:43:58 +01:00
parent 617912ecc1
commit 059bdb4711
11 changed files with 236 additions and 89 deletions

View file

@ -46,12 +46,6 @@ enum SeamPosition {
spRandom, spNearest, spAligned, spRear
};
/*
enum FilamentType {
ftPLA, ftABS, ftPET, ftHIPS, ftFLEX, ftSCAFF, ftEDGE, ftNGEN, ftPVA
};
*/
enum SLAMaterial {
slamTough,
slamFlex,
@ -149,24 +143,6 @@ template<> inline const t_config_enum_values& ConfigOptionEnum<SeamPosition>::ge
return keys_map;
}
/*
template<> inline const t_config_enum_values& ConfigOptionEnum<FilamentType>::get_enum_values() {
static t_config_enum_values keys_map;
if (keys_map.empty()) {
keys_map["PLA"] = ftPLA;
keys_map["ABS"] = ftABS;
keys_map["PET"] = ftPET;
keys_map["HIPS"] = ftHIPS;
keys_map["FLEX"] = ftFLEX;
keys_map["SCAFF"] = ftSCAFF;
keys_map["EDGE"] = ftEDGE;
keys_map["NGEN"] = ftNGEN;
keys_map["PVA"] = ftPVA;
}
return keys_map;
}
*/
template<> inline const t_config_enum_values& ConfigOptionEnum<SLADisplayOrientation>::get_enum_values() {
static const t_config_enum_values keys_map = {
{ "landscape", sladoLandscape},
@ -354,6 +330,9 @@ protected:
#define STATIC_PRINT_CONFIG_CACHE_BASE(CLASS_NAME) \
public: \
/* Overrides ConfigBase::optptr(). Find ando/or create a ConfigOption instance for a given name. */ \
const ConfigOption* optptr(const t_config_option_key &opt_key) const override \
{ return s_cache_##CLASS_NAME.optptr(opt_key, this); } \
/* Overrides ConfigBase::optptr(). Find ando/or create a ConfigOption instance for a given name. */ \
ConfigOption* optptr(const t_config_option_key &opt_key, bool create = false) override \
{ return s_cache_##CLASS_NAME.optptr(opt_key, this); } \
/* Overrides ConfigBase::keys(). Collect names of all configuration values maintained by this configuration store. */ \