Move the incompatible to the file for consistency.

This commit is contained in:
Joseph Lenox 2018-11-18 16:42:35 -06:00 committed by Joseph Lenox
parent fd455d75dc
commit 5f8075585c
2 changed files with 66 additions and 5 deletions

View File

@ -7,7 +7,7 @@
#include <iostream>
#include "testableframe.h"
#include "Log.hpp"
#include "Print.hpp"
#include "Preset.hpp"
@ -46,9 +46,8 @@ std::array<Presets, preset_types> sample_compatible() {
preset_list[get_preset(preset_t::Print)].push_back(Preset(testfile_dir + "test_preset_chooser"s, "print-profile.ini", preset_t::Print));
preset_list[get_preset(preset_t::Print)].push_back(Preset(true, "- default -", preset_t::Print));
preset_list[get_preset(preset_t::Material)].push_back(Preset(testfile_dir + "test_preset_chooser"s, "material-profile.ini", preset_t::Material));
// set the material to be compatible to printer-profile-2, not 1
preset_list[get_preset(preset_t::Material)][0].config().lock()->get_ptr<ConfigOptionStrings>("compatible_printers"s)->values.push_back("printer-profile-2"s);
// set the material to be compatible to printer-profile-2 only
preset_list[get_preset(preset_t::Material)].push_back(Preset(testfile_dir + "test_preset_chooser"s, "incompat-material-profile.ini", preset_t::Material));
preset_list[get_preset(preset_t::Material)].push_back(Preset(true, "- default -", preset_t::Material));
preset_list[get_preset(preset_t::Printer)].push_back(Preset(true, "- default -", preset_t::Printer));
@ -100,7 +99,44 @@ SCENARIO( "PresetChooser changed printer") {
}
THEN( "Selected material profile entry is \"material-profile\"" ) {
for (auto* chooser : cut.preset_choosers[get_preset(preset_t::Material)]) {
REQUIRE(chooser->GetString(chooser->GetSelection()) == wxString("material-profile"));
REQUIRE(chooser->GetString(chooser->GetSelection()) == wxString("incompat-material-profile"));
}
}
}
WHEN( "Printer profile is changed to printer-profile-2 via combobox event" ) {
auto* printer_chooser = cut.preset_choosers[get_preset(preset_t::Printer)].at(0);
printer_chooser->SetSelection(0);
auto ev {wxCommandEvent(wxEVT_COMBOBOX, printer_chooser->GetId())};
ev.SetEventObject(printer_chooser);
Slic3r::Log::debug("test") << "Firing combobox event" << "\n";
printer_chooser->ProcessWindowEvent(ev);
wxYield();
wxMilliSleep(150);
THEN( "Selected printer profile entry is \"printer-profile-2\"" ) {
for (auto* chooser : cut.preset_choosers[get_preset(preset_t::Printer)]) {
REQUIRE(chooser->GetString(chooser->GetSelection()) == wxString("printer-profile-2"));
}
}
THEN( "Print profile chooser has 1 entry" ) {
for (auto* chooser : cut.preset_choosers[get_preset(preset_t::Print)]) {
REQUIRE(chooser->GetCount() == 1);
}
}
THEN( "Selected print profile entry is \"print-profile\"" ) {
for (auto* chooser : cut.preset_choosers[get_preset(preset_t::Print)]) {
REQUIRE(chooser->GetString(chooser->GetSelection()) == wxString("print-profile"));
}
}
THEN( "Material profile chooser has one entry" ) {
for (auto* chooser : cut.preset_choosers[get_preset(preset_t::Material)]) {
REQUIRE(chooser->GetCount() == 1);
}
}
THEN( "Selected material profile entry is \"material-profile\"" ) {
for (auto* chooser : cut.preset_choosers[get_preset(preset_t::Material)]) {
REQUIRE(chooser->GetString(chooser->GetSelection()) == wxString("incompat-material-profile"));
}
}
}

View File

@ -0,0 +1,25 @@
# generated by Slic3r 1.3.0-dev on 2018-03-23 03:49:17
bed_temperature = 70
bridge_fan_speed = 100
compatible_printers = printer-profile-2;nothing
cooling = 1
disable_fan_first_layers = 4
end_filament_gcode = "; Filament-specific end gcode \n;END gcode for filament\n"
extrusion_multiplier = 1
fan_always_on = 1
fan_below_layer_time = 10
filament_colour = #4EFF00
filament_cost = 30
filament_density = 1.25
filament_diameter = 1.73
filament_max_volumetric_speed = 0
filament_notes = ""
filament_settings_id =
first_layer_bed_temperature = 70
first_layer_temperature = 220
max_fan_speed = 100
min_fan_speed = 100
min_print_speed = 10
slowdown_below_layer_time = 60
start_filament_gcode = "; Filament gcode\n; ATOMIC PLA"
temperature = 218