Commit Graph

1534 Commits

Author SHA1 Message Date
bubnikv
bbfb9a4190 Added regex matching operators to the conditional G-code processor
in a form similar to Perl:

Following expression returns true, if the variable matches the regex:
	variable =~ /regex/
Following expression returns true, if the variable does not match the regex:
	variable !~ /regex/
2017-12-15 17:14:24 +01:00
bubnikv
4bbe328117 Config wizard will prompt user to copy the profiles from Slic3r to Slic3rPE
if the datadir is left to the default value (which is Slic3r),
and Slic3rPE directory exists.
2017-12-14 13:47:22 +01:00
bubnikv
d65835f89b Improvement of region classification numerical stability.
The Clipper library is not stable when calcuating offsets of contours
with holes. Replaced a single call of offset2 with offset_ex(offset_ex()).
This is not the most efficient solution, but it fixes this problem.
Fixes https://github.com/prusa3d/Slic3r/issues/456
2017-12-14 13:26:44 +01:00
bubnikv
cdab27d337 Enabled a long wipe when moving away from the wipe tower
to reduce stringing.
2017-12-14 09:50:38 +01:00
bubnikv
d30c154e79 Reverted the introduction of the "presets" subdir to store
the print/filament/printer profiles.
The change has been reverted to support the upstream slic3r
using the --datadir. While there are breaking changes
in the PlaceholderParser, if the new macro processing is not used,
the two slic3rs are still mostly interchangeable.

The "presets" subdir may be enabled with the SLIC3R_PROFILE_USE_PRESETS_SUBDIR
and it may happen, that it will be activated one day if ever the two
slci3rs diverge too much.
2017-12-14 09:40:45 +01:00
Enrico Turri
0fe855cd6d Time estimate shown in GUI as formatted string / Write to file made by class GCode's private methods 2017-12-14 09:18:28 +01:00
bubnikv
08b74f8caf Fix of the wipe tower priming towers. The priming towers were printed
at the homing height on the MK2MM printer, not at the 1st layer height.
2017-12-13 15:35:00 +01:00
bubnikv
d47dc5da3e Fixed update of "dirty" profile when the "compatible_printers"
option appears (filter is active) or disappears (no filter active,
compatible with any printer).
2017-12-13 14:44:27 +01:00
bubnikv
21b4e62e6e Fixed handling of print and filament presets incompatible
with the newly selected print profile,
fixed loading of print and filament tab pages after the print or filament
preset has been changed to be compatible with a newly selected printer.
2017-12-13 14:00:14 +01:00
bubnikv
91e847cb76 Yet another fix for https://github.com/prusa3d/Slic3r/issues/607.
Use EPSILON to match two layers by their floating point Z height.
2017-12-13 10:32:25 +01:00
Enrico Turri
20234c94ee GCodeTimeEstimator - added retract_acceleration, minimum_travel_feedrate members and process of M201 gcode 2017-12-12 13:44:52 +01:00
bubnikv
74cb74f1fc Increased maximum allowed temperature to 1500 centigrades as someone
is seemingly uses Slic3r to print glass :-)
https://github.com/prusa3d/Slic3r/issues/629
2017-12-12 13:43:36 +01:00
bubnikv
743fc9dbd0 Workaround for buggy Intel HD Graphics OpenGL drivers:
Fall back to OpenGL 1.1 by a "use_legacy_opengl" preferences switch.
https://github.com/prusa3d/Slic3r/issues/233
https://github.com/prusa3d/Slic3r/issues/268
https://github.com/prusa3d/Slic3r/issues/619
2017-12-11 18:00:51 +01:00
bubnikv
61e6f23ed2 Fix of
"Multimaterial printer switches filament at the wrong time during a print"
https://github.com/prusa3d/Slic3r/issues/607

There was a single layer between the raft top and the object first layer
missing on the wipe tower, and after this missing layer all the tool
changes were shifted by one layer, meaning two color print had the colors
switched.
2017-12-11 17:19:55 +01:00
Enrico Turri
e199d0532c GCodeTimeEstimator - added process of G92 gcode 2017-12-11 15:15:21 +01:00
Enrico Turri
34a0a2cb5e GCodeTimeEstimator - added process of M82 and M83 gcodes 2017-12-11 14:03:29 +01:00
Enrico Turri
50a45949d1 merge with master 2017-12-11 12:01:30 +01:00
Enrico Turri
bea9628be0 time estimation shown in GUI after gcode export 2017-12-11 11:11:54 +01:00
bubnikv
1938828520 Slic3r version was not set by the placeholder parser.
https://github.com/prusa3d/Slic3r/issues/615
2017-12-11 09:31:29 +01:00
Enrico Turri
a0a503e4a8 integration of time estimator into gcode export - save time estimation into gcode file 2017-12-11 09:06:29 +01:00
bubnikv
679aa2822c Moved the Slic3rPE/print,filament,printer folders to
Slic3rPE/presets/print,filament,printer
to separate the presets from further data stored into the Slic3rPE
directory.
2017-12-10 22:11:00 +01:00
bubnikv
657f2734f1 Extended the Config Wizard to offer a selection of config bundles
bundled with Slic3r installation, and install it into user's Slic3r profile.
These bundled config bundles will be contained in the Slic3r source
tree under Slic3r/resources/profiles.

Breaking change! The Slic3r user directory has been renamed to Slic3rPE
for the Prusa Edition. Also it is likely, that the Slic3rPE directory
will be reorganized before the final 1.38 release to reserve space
for temporary profiles downloaded from the Internet.
2017-12-10 13:19:44 +01:00
bubnikv
9a80ff57b2 Improved robustness of handling preset files stored into a wrong location.
Fixes https://github.com/prusa3d/Slic3r/issues/616
2017-12-09 18:48:21 +01:00
bubnikv
8509e4b5f5 Fixes regression error introduced in Slic3r 1.38.2:
Slic3r 1.38.3 gcodes not building up bed temperature
https://github.com/prusa3d/Slic3r/issues/614
2017-12-09 16:39:49 +01:00
bubnikv
f0e154d54c Bumped up the build version. 2017-12-09 15:49:43 +01:00
Enrico Turri
092d271fa2 time estimator wip stage 2 2017-12-08 10:50:36 +01:00
bubnikv
75dcdb84b1 Fix of a crash due to the way how the presets are sorted and searched
for in the PresetCollection: The 1st preset is always the "-- default --"
even if there are some presets starting with an ASCII character lower than '-'.
https://github.com/prusa3d/Slic3r/issues/603
2017-12-06 16:47:53 +01:00
Enrico Turri
bc3d184d7c time estimator wip 2017-12-06 14:12:10 +01:00
bubnikv
7892dfd53c Fixed a regression bug in G-code export, where ferror was called on
released FILE structure.
2017-12-05 18:40:46 +01:00
bubnikv
0a2be9d7bf Fixed compilation on unices. 2017-12-05 17:52:12 +01:00
bubnikv
c34ec9b7d3 PlaceholderParser: Improved error reporting https://github.com/prusa3d/Slic3r/issues/600
Fixed '+' operator for strings.
2017-12-05 17:38:29 +01:00
bubnikv
8746f84fa2 Improved error reporting of the PlaceholderParser.
The PlaceholderParser is currently used by the GCode.cpp
and by Printer.cpp to generate a new name for the exported G-code or SVG file.
The PlaceholderParser::process() will throw a runtime_error with
a comprehensive error message.
The G-code export will include these error messages into the G-code text
with !!!!!! separators, and the GUI will inform the user, that the G-code
export failed.
2017-12-05 15:54:24 +01:00
bubnikv
1244fd09eb More efficient utf8 parser for the PlaceholderParser. 2017-12-04 18:22:42 +01:00
bubnikv
fb1bebd982 PlaceholderParser: simplistic extension to parse UTF8 characters
in the G-code and string constants.
Solves https://github.com/prusa3d/Slic3r/issues/600
2017-12-04 17:42:35 +01:00
bubnikv
2b0b8e6e68 Removed the hard-coded priming line when
both single_extruder_multi_material and wipe_tower are enabled,
and the print prints with a single extruder only.

Newly the same situation will be handled through a conditional G-code
in the following format:

{if not has_wipe_tower}
; Do the priming
{endif}
2017-12-04 11:57:54 +01:00
bubnikv
8af329e660 Added Perl to C++ interfaces for creating the preset editor pages
from C++ and to add debugging menus from C++. These lightweigth
interfaces should help new team members to hack the UI without
a Perl knowledge.
2017-12-04 10:48:40 +01:00
bubnikv
16bd3fc624 Fixed an extruder ordering bug on the 1st layer wipe tower.
This is a regression after introducing the extruder priming areas
at the edge of the print bed.
2017-12-03 09:43:00 +01:00
bubnikv
73a539780a Bumped up a version number. 2017-12-01 18:56:32 +01:00
bubnikv
ca0626b168 Fixed regression bugs regarding print validation,
fixed crashes when loading a config.ini with "compatible_printers"
disabled export of "compatible_printers" into gcode and config.ini

Enabled compatibility of printing multiple objects with support / no support
with a wipe tower.
2017-12-01 18:55:57 +01:00
bubnikv
354408c7e6 Load the wxWidgets PNG handler only once. 2017-11-30 20:25:59 +01:00
bubnikv
752d72f58d Increased fill rate of the support 1st layer from 50% to 70%. 2017-11-30 19:04:07 +01:00
bubnikv
cecaf6eabc Slight optimization of the filament_start_gcode insertion:
It is not needed between the purging towers and the wipe tower brim.
2017-11-30 17:55:39 +01:00
bubnikv
bff7065360 Fixed a bug in the support generator: There was half extrusion width
gap created between the support and the support sheath.
Now the support sheath will overlap with the support base by 10%
of the extrusion width by default.
2017-11-30 16:24:48 +01:00
bubnikv
3996535e5d Changed handling of filament_gcode_start and filament_gcode_end custom
G-codes in case of single extruder multiple material setup:
At the start of the print, the filament_gcode_start is executed
for the active extruder only, and the filament_gcode_start /
filament_gcode_end are then executed at each tool change.

When the Prusa MM wipe tower is active, the tool changes are handled
a bit differently: M900 K0 is emited before the wipe tower extrusions start,
and the filament_gcode_start code is executed after the wipe tower extrusions
are done. This rule effectively disables the linear advance over the wipe tower.

Implements https://github.com/prusa3d/Slic3r/issues/568
2017-11-30 16:01:47 +01:00
bubnikv
8807d288d7 Fixed a regression issue when starting Slic3r with non-existent datadir. 2017-11-30 15:51:51 +01:00
bubnikv
830da1f8e4 Fixed a regression bug of handling the obsolete config parameters,
causing crashes.
2017-11-30 13:43:02 +01:00
bubnikv
2f54bf5bca Fixed a random crash in the PlaceholderParser due to deallocating
an undefined pointer.
2017-11-29 20:38:19 +01:00
bubnikv
f754cb422b Bumped up the version number. 2017-11-29 19:34:24 +01:00
bubnikv
ae118519ab Fixed a 32bit build bug in the new PlaceholderParser macro processor. 2017-11-29 19:27:26 +01:00
bubnikv
08e81f2765 Bumped up the build version. 2017-11-29 10:52:54 +01:00
bubnikv
9ca63f16bc New PlaceholderParser variable for sequential prints:
current_object_idx - zero based index of the object printed.
Implements feature request https://github.com/prusa3d/Slic3r/issues/578
2017-11-28 15:30:05 +01:00
bubnikv
672194b475 Ported the between_objects_gcode custom G-code blocks,
thanks @lordofhyphens, https://github.com/alexrj/Slic3r/pull/3275

Improved handling of custom G-code blocks: Slic3r will try to extract
the target extruder and bed temperatures from the custom G-code blocks.
2017-11-28 15:19:57 +01:00
bubnikv
f58b217369 Implemented loading of a Slic3r Config Bundle as a Slic3r Config file. 2017-11-28 11:57:33 +01:00
bubnikv
3c0cd3cbc8 Improve error handling of loading Slic3r profiles. 2017-11-28 10:08:01 +01:00
bubnikv
bb2b180ecc Fixed G-code export of custom G-code sections to not add a newline
if the custom G-code already ends with a newline.
2017-11-26 21:23:18 +01:00
bubnikv
b54a15faa2 Fix of the new PlaceholderParser: Maintain whitespaces and new lines. 2017-11-26 20:43:31 +01:00
bubnikv
571d654e67 Placeholder parser - added a comment with a reference to a C grammar. 2017-11-26 11:52:44 +01:00
bubnikv
5c3ba79c6f PlaceholderParser - added an unary not operator. 2017-11-26 11:16:28 +01:00
bubnikv
2312fa845e Fixed compilation on GCC, changed to handle keywords correctly. 2017-11-26 10:54:54 +01:00
bubnikv
708f416c84 PlaceholderParser extended with {if}/{elsif}{else} blocks and
+ - * / == != <> numeric expressions.
2017-11-26 09:59:14 +01:00
bubnikv
9205c8aab4 Sketch of the PlaceholderParser if/elsif/else macro. 2017-11-17 18:46:03 +01:00
bubnikv
47f193fe2d The PlaceholderParser has been rewritten to use
a real boost::spirit::qi parser, accessing the DynamicConfig repository
directly. This is a first step towards a full fledged expression
interpreter.
2017-11-17 11:15:46 +01:00
bubnikv
200f176951 Fixed compilation on Linux / GTK 2017-11-10 18:50:14 +01:00
bubnikv
4628308415 Oh those compiler differences. 2017-11-10 17:42:30 +01:00
bubnikv
bfce6dba9b Integrated the "compatible printers" idea by @alexrj with Vojtech's twist:
The incompatible presets are hidden in the tabs if show_incompatible_presets
is false. If show_incompatible_presets is true, there is a button to
show / hide the incompatible presets from the tab selector.
2017-11-10 17:27:05 +01:00
bubnikv
b23b9ea1d2 Implemented volumetric flow rate hints,
removed some C++11 conditioned compilation. Slic3r now requires C++11.
2017-11-09 15:10:20 +01:00
bubnikv
9a0100d6de Initial definition of PresetHints C++ class and Perl binding, ported the cooling logic hints to C++.
Removed Perl Flow::new_from_spacing bindings.
Some Fill C++11 beautification.
Fix of a support_material_1st_layer_flow, brim_flow and skirt_flow logic to use the extrusion_width if both first_layer_extrusion_width and support_material_extrusion_width are undefined.
Documented the extrusion width logic in the config tooltips, including the default values.
2017-11-09 10:48:06 +01:00
bubnikv
5fb54ed1f3 Code beautification: PrintConfig tooltips were split to multiple lines. 2017-11-09 10:06:25 +01:00
bubnikv
e4614f301c ConfigBase with option template to do the type conversion
of resolved ConfigOption.
2017-11-09 10:05:37 +01:00
bubnikv
71b58e24a9 Fixed a regression bug in the "first layer extrusion width" G-code comment.
https://github.com/prusa3d/Slic3r/issues/566
2017-11-06 15:43:56 +01:00
bubnikv
e6ecb77d9a Fixed loading of configs and configs from g-codes. 2017-11-03 19:14:33 +01:00
bubnikv
b11d9708ed Updated Controller after the presets C++ port. 2017-11-02 21:51:06 +01:00
bubnikv
dd9e1aff70 When loading Slic3r.ini of older Slic3rs, remove the .ini suffix
from the preset names.
This fixes https://github.com/prusa3d/Slic3r/issues/367
2017-11-02 17:31:24 +01:00
bubnikv
ee84e1773d Fixed an incorrect comment separator in generated g-code. 2017-11-02 16:50:08 +01:00
bubnikv
4ab4a9afe8 Fighting with boost::filesystem::directory_iterator 2017-11-02 16:40:25 +01:00
bubnikv
7551006102 Another fix or Unices of the previous commit. 2017-11-02 16:35:46 +01:00
bubnikv
df5628422c Fixed serial port enumeration on non-Win32 systems. 2017-11-02 16:29:03 +01:00
bubnikv
e8b6d92d4d Looks like the reworked C++ preferences start to work again. 2017-11-02 16:21:34 +01:00
bubnikv
95c284c764 Next step of Perl to C++ configuration layer conversion. 2017-11-01 19:30:05 +01:00
bubnikv
d564fc95df Split Preset.cpp,hpp to Preset.cpp,hpp and PresetBundle.cpp,hpp 2017-10-30 18:41:50 +01:00
bubnikv
1fee3633a0 New C++ class AppConfig for maintaining the config.ini
New helper function for generating a unified "generated by slic3r" header.
2017-10-30 18:15:41 +01:00
bubnikv
835e5b71a8 Reduce UI flicker. 2017-10-28 00:18:02 +02:00
bubnikv
857b78ddca Fix of the previous commit: Slic3r::Config::new_from_defaults_keys
has to be provided with a reference to array of strings.
2017-10-27 22:49:59 +02:00
bubnikv
21633bc0ba throw std::invalid_argument instead of std::exception 2017-10-27 21:28:39 +02:00
bubnikv
2455aee97c Further reduction of Perl Config.pm methods. 2017-10-27 18:52:35 +02:00
bubnikv
3bc79e80d5 Fixed configuration & validate C++ ports. 2017-10-27 16:11:06 +02:00
bubnikv
5a99e694ce Another step towards the C++ presets. 2017-10-26 17:17:39 +02:00
bubnikv
ee645007f2 Another step towards C++ presets. 2017-10-25 12:53:31 +02:00
bubnikv
fe0bf6ebf3 Optimization of Perlglue ConfigBase__get 2017-10-18 14:26:38 +02:00
bubnikv
d9d6d996e9 Utility functions to pass wxWidgets pointers from Perl to C++ code.
C++ var_dir / set_var_dir() interface to access the UI resources
from the C++ code.
2017-10-17 20:00:15 +02:00
bubnikv
af51220f34 Fix of preceding commit. 2017-10-17 19:41:04 +02:00
bubnikv
b9d57483d8 perglue.cpp - use static_cast instead of dynamic_cast if possible,
use switch instead of plenty of ifs,
export clone<DynamicPrintConfig> to Perl XS.
2017-10-17 19:19:41 +02:00
bubnikv
746afbd790 Yet another compilation fix? 2017-10-17 18:49:07 +02:00
bubnikv
9a7d1bb566 Another compilation fix. 2017-10-17 18:41:54 +02:00
bubnikv
de2c6a2a3d exception what() method shall be noexcept. 2017-10-17 17:53:16 +02:00
bubnikv
67ce4d862b One more fix of the preceding commit. 2017-10-17 17:48:04 +02:00
bubnikv
38aca5047f Fix of the preceding commit for gcc & clang:
Add a class name suffix to the s_cache static members
of the StaticPrintConfig derived classes.
2017-10-17 17:37:03 +02:00
bubnikv
3731820c48 Optimization of the configuration layer:
The values of StaticPrintConfig derived objects were searched by a name
walking through a huge chained if.
Now they are being mapped with a std::map.
Also initialization of StaticPrintConfig classes from their ConfigOptionDef
defaults is done by maintaining a single global definition of each
StaticPrintConfig derived class, and a new instance is initialized
from this static copy.

Also the ConfigOption instances are casted using static_cast
wherever possible, and their types are verified by a virtual type() method.
This approach avoids insiginificant performance penalty of a dynamic_cast.

Also the compare and clone methods were added to ConfigOption,
and the cloning & compare work on binary values, not by serialization.
2017-10-17 16:01:18 +02:00
bubnikv
a91d7cb2f7 Redefined the ==, != operators of Point and BoundingBox classes
to become members of their respective classes to avoid type clashes
through implicit casting operators of ConfigOption classes.
2017-10-17 14:36:30 +02:00
bubnikv
a191fbbec8 Fix of a 3D print path preview for the wipe tower: Calculate
the bounding boxes accurately.
2017-10-04 13:50:04 +02:00