Merge branch 'move-libslic3r-tests' into merill-merge

This commit is contained in:
remi durand 2021-04-06 23:14:18 +02:00
commit b6d2acfd76
25 changed files with 130 additions and 81 deletions

View File

@ -72,8 +72,8 @@ jobs:
- name: build appimage
working-directory: ./build/package
run: |
chmod +x ../../src/platform/unix/build_appimage.sh
../../src/platform/unix/build_appimage.sh Slic3r_ubu64.AppImage
chmod +x ../build_appimage.sh
../build_appimage.sh Slic3r_ubu64.AppImage
- name: Upload appimage
uses: actions/upload-artifact@v1.0.0
with:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@ -17,3 +17,8 @@ Wipe tower = B3E3AB
Mill = B3B3B3
Custom = 28CC94
Mixed = 000000
Gui_color_very_dark = ada230
Gui_color_dark = cabe39
Gui_color = eddc21
Gui_color_light = ffee38
Gui_color_very_light = fef48b

View File

@ -22,6 +22,7 @@ group:Cooling fan
setting:label$Only for overhangs:fan_speedup_overhangs
end_line
setting:label$Kickstart duration:fan_kickstart
setting:fan_percentage
group:Thumbnails
line:Size for Gcode
setting:id$0:label$Small:thumbnails

View File

@ -91,9 +91,9 @@ endif()
# Create a Slic3r executable
# Process mainfests for various platforms.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/msw/Slic3r.rc.in ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_NAME}.rc @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/msw/gcodeviewer.rc.in ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_NAME}-gcodeviewer.rc @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/msw/PrusaSlicer.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_NAME}.manifest @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/msw/Slic3r.rc.in ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_KEY}.rc @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/msw/gcodeviewer.rc.in ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_KEY}-gcodeviewer.rc @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/msw/PrusaSlicer.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_KEY}.manifest @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/osx/Info.plist.in ${CMAKE_CURRENT_BINARY_DIR}/Info.plist @ONLY)
if (WIN32)
add_library(Slic3r SHARED PrusaSlicer.cpp PrusaSlicer.hpp)
@ -152,7 +152,7 @@ if (WIN32)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libslic3r/libslic3r_version.h.in ${CMAKE_CURRENT_BINARY_DIR}/libslic3r_version.h @ONLY)
add_executable(Slic3r_app_gui WIN32 PrusaSlicer_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_NAME}.rc)
add_executable(Slic3r_app_gui WIN32 PrusaSlicer_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_KEY}.rc)
target_include_directories(Slic3r_app_gui PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
# Generate debug symbols even in release mode.
if(MSVC)
@ -163,7 +163,7 @@ if (WIN32)
set_target_properties(Slic3r_app_gui PROPERTIES OUTPUT_NAME "slic3r")
target_link_libraries(Slic3r_app_gui PRIVATE boost_headeronly)
add_executable(Slic3r_app_console PrusaSlicer_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_NAME}.rc)
add_executable(Slic3r_app_console PrusaSlicer_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_KEY}.rc)
target_include_directories(Slic3r_app_console PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
# Generate debug symbols even in release mode.
if (MSVC)
@ -174,7 +174,7 @@ if (WIN32)
set_target_properties(Slic3r_app_console PROPERTIES OUTPUT_NAME "${SLIC3R_APP_CMD}_console")
target_link_libraries(Slic3r_app_console PRIVATE boost_headeronly)
add_executable(PrusaSlicer_app_gcodeviewer WIN32 PrusaSlicer_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_NAME}-gcodeviewer.rc ${CMAKE_CURRENT_BINARY_DIR}/libslic3r_version.h)
add_executable(PrusaSlicer_app_gcodeviewer WIN32 PrusaSlicer_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_KEY}-gcodeviewer.rc ${CMAKE_CURRENT_BINARY_DIR}/libslic3r_version.h)
target_include_directories(PrusaSlicer_app_gcodeviewer PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
# Generate debug symbols even in release mode.
if (MSVC)

View File

@ -283,11 +283,12 @@ int wmain(int argc, wchar_t **argv)
wchar_t path_to_slic3r[MAX_PATH + 1] = { 0 };
wcscpy(path_to_slic3r, path_to_exe);
wcscat(path_to_slic3r, L"Slic3r.dll");
wcscat(path_to_slic3r, SLIC3R_APP_WKEY);
wcscat(path_to_slic3r, L".dll");
// printf("Loading Slic3r library: %S\n", path_to_slic3r);
HINSTANCE hInstance_Slic3r = LoadLibraryExW(path_to_slic3r, nullptr, 0);
if (hInstance_Slic3r == nullptr) {
printf(SLIC3R_APP_NAME ".dll was not loaded, error code: %d\n", GetLastError());
printf(SLIC3R_APP_KEY ".dll was not loaded, error code: %d\n", GetLastError());
return -1;
}

View File

@ -66,20 +66,45 @@ void AppConfig::set_defaults()
if (get("tab_icon_size").empty())
set("tab_icon_size", "32");
//get default color from the ini file
//try to load colors from ui file
std::map<std::string, std::string> key2color = { {"Gui_color_very_dark", "ada230"}, {"Gui_color_dark", "cabe39"}, {"Gui_color", "eddc21"}, {"Gui_color_light", "ffee38"}, {"Gui_color_very_light", "fef48b"} };
boost::property_tree::ptree tree_colors;
boost::filesystem::path path_colors = boost::filesystem::path(resources_dir()) / "ui_layout" / "colors.ini";
try {
boost::nowide::ifstream ifs;
ifs.imbue(boost::locale::generator()("en_US.UTF-8"));
ifs.open(path_colors.string());
boost::property_tree::read_ini(ifs, tree_colors);
for(std::map<std::string, std::string>::iterator it = key2color.begin(); it != key2color.end() ; ++it) {
std::string color_code = tree_colors.get<std::string>(it->first);
if (color_code.length() == 6)
it->second = color_code;
}
}
catch (const std::ifstream::failure& err) {
trace(1, (std::string("The color file cannot be loaded. Reason: ") + err.what(), path_colors.string()).c_str());
}
catch (const std::runtime_error& err) {
trace(1, (std::string("Failed loading the color file. Reason: ") + err.what(), path_colors.string()).c_str());
}
if (get("color_very_dark").empty())
set("color_very_dark", "0047c7");
set("color_very_dark", key2color["Gui_color_very_dark"]);
if (get("color_dark").empty())
set("color_dark", "2172eb");
set("color_dark", key2color["Gui_color_dark"]);
if (get("color").empty())
set("color", "428dfd");
set("color", key2color["Gui_color"]);
if (get("color_light").empty())
set("color_light", "8bb9fe");
set("color_light", key2color["Gui_color_light"]);
if (get("color_very_light").empty())
set("color_very_light", "428cff");
set("color_very_light", key2color["Gui_color_very_light"]);
if (get("version_check").empty())
set("version_check", "1");

View File

@ -540,7 +540,7 @@ void GCodeProcessor::apply_config(const PrintConfig& config)
m_extruder_names.resize(extruders_count);
for (size_t i = 0; i < extruders_count; ++i) {
m_extruder_names[i] = config.tool_name.values[i];
m_extruder_names[i] = config.tool_name.get_at(i);
}
m_extruder_colors.resize(extruders_count);

View File

@ -669,6 +669,7 @@ const std::vector<std::string>& Preset::printer_options()
"fan_kickstart",
"fan_speedup_overhangs",
"fan_speedup_time",
"fan_percentage",
"gcode_flavor",
"gcode_precision_xyz",
"use_relative_e_distances",

View File

@ -105,6 +105,7 @@ bool Print::invalidate_state_by_config_options(const std::vector<t_config_option
"fan_kickstart",
"fan_speedup_overhangs",
"fan_speedup_time",
"fan_percentage",
"filament_colour",
"filament_diameter",
"filament_density",

View File

@ -5229,6 +5229,7 @@ void PrintConfigDef::to_prusa(t_config_option_key& opt_key, std::string& value,
"exact_last_layer_height",
"fan_speedup_time",
"fan_speedup_overhangs",
"fan_percentage",
"fan_kickstart",
"machine_max_acceleration_travel",
"max_speed_reduction",

View File

@ -4,6 +4,7 @@
#define SLIC3R_APP_NAME "@SLIC3R_APP_NAME@"
#define SLIC3R_APP_WNAME L"@SLIC3R_APP_NAME@"
#define SLIC3R_APP_KEY "@SLIC3R_APP_KEY@"
#define SLIC3R_APP_WKEY L"@SLIC3R_APP_KEY@"
#define SLIC3R_APP_CMD "@SLIC3R_APP_CMD@"
#define SLIC3R_APP_WCMD L"@SLIC3R_APP_CMD@"
#define SLIC3R_VERSION "@SLIC3R_VERSION@"
@ -18,6 +19,7 @@
#define SLIC3R_BASED_ON "@SLIC3R_BASED_ON@"
#define SLIC3R_GITHUB "@SLIC3R_GITHUB@"
#define SLIC3R_DOWNLOAD "@SLIC3R_DOWNLOAD@"
#define SLIC3R_INTRO "@SLIC3R_INTRO@"
#endif /* __SLIC3R_VERSION_H */

View File

@ -6,7 +6,7 @@ PRODUCTVERSION @SLIC3R_RC_VERSION@
{
BLOCK "040904E4"
{
VALUE "CompanyName", "supermerill"
VALUE "CompanyName", "slic3r"
VALUE "FileDescription", "@SLIC3R_APP_NAME@"
VALUE "FileVersion", "@SLIC3R_BUILD_ID@"
VALUE "ProductName", "@SLIC3R_APP_NAME@"
@ -21,5 +21,5 @@ PRODUCTVERSION @SLIC3R_RC_VERSION@
VALUE "Translation", 0x409, 1252
}
}
2 ICON "@SLIC3R_RESOURCES_DIR@/icons/slic3r.ico"
2 ICON "@SLIC3R_RESOURCES_DIR@/icons/@SLIC3R_APP_KEY@.ico"
1 24 "Slic3r.manifest"

View File

@ -1,8 +1,8 @@
[Desktop Entry]
Name=Super GCode viewer
Name=@GCODEVIEWER_APP_NAME@
Comment=G-code viewer of Slic3r
Exec=superslicer --gcodeviewer %F
Icon=Slic3r-gcodeviewer
Exec=@SLIC3R_APP_CMD@ --gcodeviewer %F
Icon=@SLIC3R_APP_KEY@-gcodeviewer
Terminal=false
Type=Application
MimeType=text/x.gcode;

View File

@ -1,13 +1,13 @@
[Desktop Entry]
Name=Slic3r
Name=@SLIC3R_APP_KEY@
GenericName=3D Printing Software
Comment=G-code generator for 3D printers
Icon=Slic3r
Exec=Slic3r %F
Icon=@SLIC3R_APP_KEY@
Exec=@SLIC3R_APP_CMD@ %F
Terminal=false
Type=Application
MimeType=model/stl;application/vnd.ms-3mfdocument;application/prs.wavefront-obj;application/x-amf;
Categories=Graphics;3DGraphics;Engineering;
Keywords=3D;Printing;Slicer;slice;3D;printer;convert;gcode;stl;obj;amf;SLA
StartupNotify=false
StartupWMClass=Slic3r
StartupWMClass=@SLIC3R_APP_KEY@

View File

@ -7,16 +7,16 @@ APP_IMAGE=$1
wget ${APPIMAGETOOLURL} -O ../appimagetool.AppImage
chmod +x ../appimagetool.AppImage
sed -i -e 's#/usr#././#g' bin/Slic3r
mv Slic3r AppRun
sed -i -e 's#/usr#././#g' bin/@SLIC3R_APP_CMD@
mv @SLIC3R_APP_CMD@ AppRun
chmod +x AppRun
cp resources/icons/Slic3r_192px.png Slic3r.png
cp resources/icons/@SLIC3R_APP_KEY@_192px.png @SLIC3R_APP_KEY@.png
cat <<EOF > Slic3r.desktop
[Desktop Entry]
Name=Slic3r
Name=@SLIC3R_APP_NAME@
Exec=AppRun %F
Icon=Slic3r
Icon=@SLIC3R_APP_KEY@
Type=Application
Categories=Utility;
MimeType=model/stl;application/vnd.ms-3mfdocument;application/prs.wavefront-obj;application/x-amf;

View File

@ -61,7 +61,7 @@ CopyrightsDialog::CopyrightsDialog()
std::array<int, 7> size = { fs, fs, fs, fs, fs2, fs2, fs2 };
m_html->SetFonts(font.GetFaceName(), font.GetFaceName(), size.data());
m_html->SetBorders(2);
m_html->SetBorders(2);
m_html->SetPage(get_html_text());
sizer->Add(m_html, 1, wxEXPAND | wxALL, 15);

View File

@ -91,17 +91,18 @@ BundleMap BundleMap::load()
const auto vendor_dir = (boost::filesystem::path(Slic3r::data_dir()) / "vendor").make_preferred();
const auto rsrc_vendor_dir = (boost::filesystem::path(resources_dir()) / "profiles").make_preferred();
auto prusa_bundle_path = (vendor_dir / PresetBundle::PRUSA_BUNDLE).replace_extension(".ini");
auto prusa_bundle_rsrc = false;
if (! boost::filesystem::exists(prusa_bundle_path)) {
prusa_bundle_path = (rsrc_vendor_dir / PresetBundle::PRUSA_BUNDLE).replace_extension(".ini");
prusa_bundle_rsrc = true;
}
{
Bundle prusa_bundle;
if (prusa_bundle.load(std::move(prusa_bundle_path), prusa_bundle_rsrc, true))
res.emplace(PresetBundle::PRUSA_BUNDLE, std::move(prusa_bundle));
}
// commented prusa bundle mandatory check at startup
//auto prusa_bundle_path = (vendor_dir / PresetBundle::PRUSA_BUNDLE).replace_extension(".ini");
//auto prusa_bundle_rsrc = false;
//if (! boost::filesystem::exists(prusa_bundle_path)) {
// prusa_bundle_path = (rsrc_vendor_dir / PresetBundle::PRUSA_BUNDLE).replace_extension(".ini");
// prusa_bundle_rsrc = true;
//}
//{
// Bundle prusa_bundle;
// if (prusa_bundle.load(std::move(prusa_bundle_path), prusa_bundle_rsrc, true))
// res.emplace(PresetBundle::PRUSA_BUNDLE, std::move(prusa_bundle));
//}
// Load the other bundles in the datadir/vendor directory
// and then additionally from resources/profiles.

View File

@ -191,7 +191,9 @@ public:
BitmapCache bmp_cache;
int logo_size = lround(width * 0.25);
//uint32_t color = color_from_hex(Slic3r::GUI::wxGetApp().app_config->get("color_dark")); //uncomment if you also want to modify the icon color
wxBitmap logo_bmp = *bmp_cache.load_svg(wxGetApp().is_editor() ? SLIC3R_APP_KEY "_logo" : "add_gcode", logo_size, logo_size/*, color*/);
wxBitmap* logo_bmp = bmp_cache.load_svg(wxGetApp().is_editor() ? SLIC3R_APP_KEY "_logo" : "add_gcode", logo_size, logo_size/*, color*/);
if(logo_bmp == nullptr) logo_bmp = bmp_cache.load_png(wxGetApp().is_editor() ? SLIC3R_APP_KEY "_logo" : "add_gcode", logo_size, logo_size/*, color*/);
if (logo_bmp == nullptr) return;
wxCoord margin = int(m_scale * 20);
@ -202,7 +204,7 @@ public:
wxMemoryDC memDc(bmp);
// draw logo
memDc.DrawBitmap(logo_bmp, margin, margin, true);
memDc.DrawBitmap(*logo_bmp, margin, margin, true);
// draw the (white) labels inside of our black box (at the left of the splashscreen)
memDc.SetTextForeground(wxColour(255, 255, 255));
@ -702,11 +704,11 @@ void GUI_App::init_app_config()
{
#ifdef SLIC3R_ALPHA
// Profiles for the alpha are stored into the PrusaSlicer-alpha directory to not mix with the current release.
SetAppName(SLIC3R_APP_KEY "-alpha");
SetAppName(SLIC3R_APP_KEY "-alpha");
#else
SetAppName(SLIC3R_APP_KEY);
SetAppName(SLIC3R_APP_KEY);
#endif
// SetAppDisplayName(SLIC3R_APP_NAME);
// SetAppDisplayName(SLIC3R_APP_NAME);
// Set the Slic3r data directory at the Slic3r XS module.
// Unix: ~/ .Slic3r

View File

@ -131,7 +131,7 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_S
default:
case GUI_App::EAppMode::Editor:
m_taskbar_icon = std::make_unique<PrusaSlicerTaskBarIcon>(wxTBI_DOCK);
m_taskbar_icon->SetIcon(wxIcon(Slic3r::var("Slic3r_128px.png"), wxBITMAP_TYPE_PNG), SLIC3R_APP_NAME);
m_taskbar_icon->SetIcon(wxIcon(Slic3r::var("Slic3r_128px.png"), wxBITMAP_TYPE_PNG), SLIC3R_APP_KEY);
break;
case GUI_App::EAppMode::GCodeViewer:
m_taskbar_icon = std::make_unique<GCodeViewerTaskBarIcon>(wxTBI_DOCK);
@ -149,8 +149,8 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_S
if (wxGetApp().is_editor())
m_statusbar->embed(this);
m_statusbar->set_status_text(_L("Version") + " " +
SLIC3R_VERSION +
_L("Remember to check for updates at https://github.com/" SLIC3R_GITHUB "/releases"));
SLIC3R_VERSION + " " +
_L("Remember to check for updates at " SLIC3R_DOWNLOAD));
// initialize tabpanel and menubar
init_tabpanel();
@ -268,10 +268,6 @@ void MainFrame::update_layout()
if (plater_page_id != wxNOT_FOUND)
m_tabpanel->RemovePage(plater_page_id);
for (size_t i = 0; i < m_tabpanel->GetPageCount(); i++)
if (m_tabpanel->GetPage(i)->GetChildren().size() == 1 && m_tabpanel->GetPage(i)->GetChildren().front() == m_plater)
m_tabpanel->GetPage(i)->GetSizer()->Clear();
if (m_plater->GetParent() != this)
m_plater->Reparent(this);
@ -1054,10 +1050,10 @@ static const wxString sep_space = "";
static wxMenu* generate_help_menu()
{
wxMenu* helpMenu = new wxMenu();
append_menu_item(helpMenu, wxID_ANY, _L(SLIC3R_APP_NAME " Releases"), _L("Open the Slic3r releases page in your browser"),
[](wxCommandEvent&) { wxLaunchDefaultBrowser("https://slic3r.org/download/"); });
append_menu_item(helpMenu, wxID_ANY, _L(SLIC3R_APP_NAME " wiki"), _L("Open the Slic3r wiki in your browser"),
[](wxCommandEvent&) { wxLaunchDefaultBrowser("http://github.com/slic3r/Slic3r/wiki"); });
append_menu_item(helpMenu, wxID_ANY, _L(SLIC3R_APP_NAME " Releases"), _L("Open the " SLIC3R_APP_NAME " releases page in your browser"),
[](wxCommandEvent&) { wxLaunchDefaultBrowser(SLIC3R_DOWNLOAD); });
append_menu_item(helpMenu, wxID_ANY, _L(SLIC3R_APP_NAME " wiki"), _L("Open the " SLIC3R_APP_NAME " wiki in your browser"),
[](wxCommandEvent&) { wxLaunchDefaultBrowser("http://github.com/" SLIC3R_GITHUB "/wiki"); });
append_menu_item(helpMenu, wxID_ANY, _L(SLIC3R_APP_NAME " website"), _L("Open the Slic3r website in your browser"),
[](wxCommandEvent&) { wxLaunchDefaultBrowser("http://slic3r.org"); });
//# my $versioncheck = $self->_append_menu_item($helpMenu, "Check for &Updates...", "Check for new Slic3r versions", sub{
@ -1433,7 +1429,7 @@ void MainFrame::init_menubar_as_editor()
append_menu_item(generationMenu, wxID_ANY, _(L("FreeCad python script")), _(L("Create an object by writing little easy script.")),
[this](wxCommandEvent&) { wxGetApp().freecad_script_dialog(); });
append_menu_item(generationMenu, wxID_ANY, _(L("Script help page")), _(L("How to use the FreeCad python script window.")),
[this](wxCommandEvent&) { wxLaunchDefaultBrowser("https://github.com/supermerill/Slic3r/wiki/FreePySCAD-script-window"); });
[this](wxCommandEvent&) { wxLaunchDefaultBrowser("https://github.com/supermerill/SuperSlicer/wiki/FreePySCAD-script-window"); });
}

View File

@ -586,6 +586,7 @@ void PreferencesDialog::create_icon_size_slider()
void PreferencesDialog::create_settings_mode_widget()
{
wxString choices[] = { _L("Regular layout with the tab bar"),
_L("Old PrusaSlicer layout"),
_L("Access via settings button in the top menu"),
_L("Settings in non-modal window") };

View File

@ -2,9 +2,10 @@
#include "slic3r/Utils/Serial.hpp"
#include "Tab.hpp"
#include "PresetHints.hpp"
#include "libslic3r/Log.hpp"
#include "libslic3r/Model.hpp"
#include "libslic3r/PresetBundle.hpp"
#include "libslic3r/Utils.hpp"
#include "libslic3r/Model.hpp"
#include "slic3r/Utils/Http.hpp"
#include "slic3r/Utils/PrintHost.hpp"
@ -1421,8 +1422,8 @@ bool Tab::create_pages(std::string setting_type_name, int idx_page)
if (!boost::filesystem::exists(ui_layout_file)) {
std::cerr << "Error: cannot create " << setting_type_name << "settings, cannot find file " << ui_layout_file << "\n";
return false;
}else
std::cout << "create settings " << setting_type_name << "\n";
} else
Slic3r::slic3r_log->info("settings gui") << "create settings " << setting_type_name << "\n";
bool no_page_yet = true;
#ifdef __WXMSW__
@ -1465,7 +1466,7 @@ bool Tab::create_pages(std::string setting_type_name, int idx_page)
no_page_yet = false;
if (in_line) {
current_group->append_line(current_line);
if (logs) std::cout << "add line\n";
if (logs) Slic3r::slic3r_log->info("settings gui") << "add line\n";
in_line = false;
}
std::vector<std::string> params;
@ -1487,14 +1488,14 @@ bool Tab::create_pages(std::string setting_type_name, int idx_page)
}
}
if(logs) std::cout << "create page " << label.c_str() <<" : "<< params[params.size() - 1] << "\n";
if(logs) Slic3r::slic3r_log->info("settings gui") << "create page " << label.c_str() <<" : "<< params[params.size() - 1] << "\n";
current_page = add_options_page(L(label), params[params.size() - 1]);
}
else if (boost::starts_with(full_line, "end_page"))
{
if (in_line) {
current_group->append_line(current_line);
if (logs) std::cout << "add line\n";
if (logs) Slic3r::slic3r_log->info("settings gui") << "add line\n";
in_line = false;
}
current_page.reset();
@ -1503,7 +1504,7 @@ bool Tab::create_pages(std::string setting_type_name, int idx_page)
{
if (in_line) {
current_group->append_line(current_line);
if (logs) std::cout << "add line\n";
if (logs) Slic3r::slic3r_log->info("settings gui") << "add line\n";
in_line = false;
}
std::vector<std::string> params;
@ -1637,13 +1638,13 @@ bool Tab::create_pages(std::string setting_type_name, int idx_page)
});
}
}
if (logs) std::cout << "create group " << params.back() << "\n";
if (logs) Slic3r::slic3r_log->info("settings gui") << "create group " << params.back() << "\n";
}
else if (boost::starts_with(full_line, "end_group"))
{
if (in_line) {
current_group->append_line(current_line);
if (logs) std::cout << "add line\n";
if (logs) Slic3r::slic3r_log->info("settings gui") << "add line\n";
in_line = false;
}
current_group.reset();
@ -1652,7 +1653,7 @@ bool Tab::create_pages(std::string setting_type_name, int idx_page)
{
if (in_line) {
current_group->append_line(current_line);
if (logs) std::cout << "add line\n";
if (logs) Slic3r::slic3r_log->info("settings gui") << "add line\n";
in_line = false;
}
std::vector<std::string> params;
@ -1669,12 +1670,12 @@ bool Tab::create_pages(std::string setting_type_name, int idx_page)
}
}
in_line = true;
if (logs) std::cout << "create line " << (params.empty() ? "" : params.back()) << "\n";
if (logs) Slic3r::slic3r_log->info("settings gui") << "create line " << (params.empty() ? "" : params.back()) << "\n";
}
else if (boost::starts_with(full_line, "end_line"))
{
current_group->append_line(current_line);
if (logs) std::cout << "add line\n";
if (logs) Slic3r::slic3r_log->info("settings gui") << "add line\n";
in_line = false;
}
else if (boost::starts_with(full_line, "setting"))
@ -1787,7 +1788,7 @@ bool Tab::create_pages(std::string setting_type_name, int idx_page)
} else {
current_line.append_option(option);
}
if (logs) std::cout << "create setting " << setting_id <<" with label "<< option.opt.label << "and height "<< option.opt.height<<" fw:"<< option.opt.full_width << "\n";
if (logs) Slic3r::slic3r_log->info("settings gui") << "create setting " << setting_id <<" with label "<< option.opt.label << "and height "<< option.opt.height<<" fw:"<< option.opt.full_width << "\n";
}
else if (boost::starts_with(full_line, "height")) {
std::string arg = "";
@ -2008,7 +2009,7 @@ bool Tab::create_pages(std::string setting_type_name, int idx_page)
// layout_page(current_page);
#endif
if(logs) std::cout << "END create settings " << setting_type_name << "\n";
if(logs) Slic3r::slic3r_log->info("settings gui") << "END create settings " << setting_type_name << "\n";
return !no_page_yet;
}

View File

@ -390,7 +390,8 @@ void PresetUpdater::priv::sync_config(const VendorMap vendors)
void PresetUpdater::priv::check_install_indices() const
{
BOOST_LOG_TRIVIAL(info) << "Checking if indices need to be installed from resources...";
if (!fs::exists(rsrc_path))
return;
for (auto &dir_entry : boost::filesystem::directory_iterator(rsrc_path))
if (is_idx_file(dir_entry)) {
const auto &path = dir_entry.path();

View File

@ -62,9 +62,9 @@ static void start_new_slicer_or_gcodeviewer(const NewSlicerInstanceType instance
{
// Maybe one day we will be able to run PrusaGCodeViewer, but for now the Apple notarization
// process refuses Apps with multiple binaries and Vojtech does not know any workaround.
// ((instance_type == NewSlicerInstanceType::Slicer) ? SLIC3R_APP_NAME : GCODEVIEWER_APP_NAME);
// ((instance_type == NewSlicerInstanceType::Slicer) ? SLIC3R_APP_CMD : GCODEVIEWER_APP_CMD);
// Just run the slicer and give it a --gcodeviewer parameter.
bin_path = bin_path.parent_path() / SLIC3R_APP_NAME;
bin_path = bin_path.parent_path() / SLIC3R_APP_CMD;
// On Apple the wxExecute fails, thus we use boost::process instead.
BOOST_LOG_TRIVIAL(info) << "Trying to spawn a new slicer \"" << bin_path.string() << "\"";
try {

View File

@ -1,19 +1,29 @@
# Included by CMakeLists, edited by the build script
# (the version numbers are generated by the build script from the git current label)
# name of the slicer
set(SLIC3R_APP_NAME "Slic3r")
# Key fo the slicer, must only contains ascii chars and no spaces
set(SLIC3R_APP_KEY "Slic3r")
# exe name of the slicer, should be lowercase and valid in all os
set(SLIC3R_APP_CMD "Slic3r")
# versions
set(SLIC3R_VERSION "2.0")
set(SLIC3R_VERSION_FULL "2.0.00.0")
set(SLIC3R_BUILD_ID "Slic3r_${SLIC3R_VERSION_FULL}")
set(SLIC3R_RC_VERSION "2,0,00,0")
set(SLIC3R_RC_VERSION_DOTS "${SLIC3R_VERSION_FULL}")
# Same as the slicer name but for gcodeviewer
set(GCODEVIEWER_APP_NAME "G-code Viewer")
set(GCODEVIEWER_APP_KEY "GCodeViewer")
set(GCODEVIEWER_APP_CMD "gcodeviewer")
# string to be added after the SLIC3R_APP_NAME on some places
set(SLIC3R_BASED_ON "")
# to get he github repo
set(SLIC3R_GITHUB "slic3r/Slic3r")
# download url
set(SLIC3R_DOWNLOAD "https://slic3r.org/download")
# string to display in the spalshscreen
set(SLIC3R_INTRO "Slic3r contains sizable contributions from Prusa Research. Original work by Alessandro Ranellucci and the RepRap community.")