Merge remote-tracking branch 'remotes/origin/master' into lh_adaptive_infill_hooks
75
resources/icons/notification_eject_sd.svg
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
version="1.1"
|
||||||
|
id="Layer_1"
|
||||||
|
x="0px"
|
||||||
|
y="0px"
|
||||||
|
viewBox="0 0 800 800"
|
||||||
|
style="enable-background:new 0 0 800 800;"
|
||||||
|
xml:space="preserve"
|
||||||
|
sodipodi:docname="notification_eject_sd_hover.svg"
|
||||||
|
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"><metadata
|
||||||
|
id="metadata15"><rdf:RDF><cc:Work
|
||||||
|
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
|
||||||
|
id="defs13" /><sodipodi:namedview
|
||||||
|
inkscape:document-rotation="0"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1"
|
||||||
|
objecttolerance="10"
|
||||||
|
gridtolerance="10"
|
||||||
|
guidetolerance="10"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-width="3840"
|
||||||
|
inkscape:window-height="2066"
|
||||||
|
id="namedview11"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:zoom="1.26"
|
||||||
|
inkscape:cx="400"
|
||||||
|
inkscape:cy="396.42857"
|
||||||
|
inkscape:window-x="-11"
|
||||||
|
inkscape:window-y="-11"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="Layer_1" />
|
||||||
|
<style
|
||||||
|
type="text/css"
|
||||||
|
id="style2">
|
||||||
|
.st0{fill:#ED6B21;}
|
||||||
|
</style>
|
||||||
|
<path
|
||||||
|
style="stroke-width:0.85"
|
||||||
|
class="st0"
|
||||||
|
d="m 565.50264,534.98775 v 60.775 h -330.565 v -60.775 h 330.565 m 27.88,-48.195 h -386.24 c -11.22,0 -20.315,9.095 -20.315,20.315 v 116.535 c 0,11.22 9.095,20.315 20.315,20.315 h 386.24 c 11.22,0 20.315,-9.095 20.315,-20.315 v -116.45 c 0,-11.22 -9.095,-20.4 -20.315,-20.4 z"
|
||||||
|
id="path4" />
|
||||||
|
<path
|
||||||
|
style="stroke-width:0.85"
|
||||||
|
class="st0"
|
||||||
|
d="m 400.09264,235.70275 116.96,155.295 h -233.75 l 116.79,-155.295 m 0,-66.64 c -6.12,0 -12.155,2.72 -16.235,8.16 l -172.635,229.5 c -10.115,13.43 -0.51,32.555 16.235,32.555 h 345.355 c 16.745,0 26.35,-19.125 16.235,-32.555 l -172.805,-229.5 c -3.995,-5.44 -10.03,-8.16 -16.15,-8.16 z"
|
||||||
|
id="path6" />
|
||||||
|
<g
|
||||||
|
id="g4"
|
||||||
|
transform="matrix(0.9775,0,0,0.9775,53.547,53.54775)">
|
||||||
|
<path
|
||||||
|
id="path2"
|
||||||
|
class="st0"
|
||||||
|
d="M 597.2,701.3 H 110.6 C 53.2,701.3 6.5,654.6 6.5,597.2 V 110.6 C 6.5,53.2 53.2,6.5 110.6,6.5 h 486.6 c 57.4,0 104.1,46.7 104.1,104.1 v 486.6 c 0,57.4 -46.7,104.1 -104.1,104.1 z M 110.6,52.4 c -32,0 -58.2,26 -58.2,58.2 v 486.6 c 0,32 26,58.2 58.2,58.2 h 486.6 c 32,0 58.2,-26 58.2,-58.2 V 110.6 c 0,-32 -26,-58.2 -58.2,-58.2 z" />
|
||||||
|
</g>
|
||||||
|
<path
|
||||||
|
style="fill:#ed6b21;fill-opacity:1;stroke-width:0.674603"
|
||||||
|
d="m 150.65676,738.12999 c -12.4717,-1.39663 -26.66772,-5.94192 -37.84321,-12.11671 -17.754551,-9.80992 -33.768844,-26.68981 -42.418124,-44.71089 -5.985061,-12.4701 -8.760227,-23.35456 -9.821918,-38.52249 -0.48061,-6.8663 -0.640464,-87.42616 -0.497289,-250.61508 0.195544,-222.88027 0.294923,-240.94223 1.356742,-246.58759 4.2349,-22.51562 13.68014,-40.62012 29.200931,-55.97194 14.237938,-14.082924 31.958648,-23.427941 52.602238,-27.739791 5.87892,-1.227937 14.00696,-1.268146 256.3492,-1.268146 h 250.27778 l 7.08334,1.561512 c 21.30688,4.697075 36.90336,13.216072 51.96052,28.381502 14.67865,14.784203 23.1932,30.350373 27.76125,50.752683 l 1.56791,7.00271 v 250.95239 c 0,242.72256 -0.0418,251.15149 -1.26428,257.0238 -9.30592,44.69034 -45.18963,77.43352 -89.75566,81.90028 -9.17898,0.92002 -488.33076,0.87927 -496.55943,-0.0425 z M 652.87275,692.49 c 19.93824,-6.17834 34.6922,-21.42493 40.00111,-41.33675 l 1.51306,-5.67494 V 399.58544 153.69259 l -1.52571,-5.73412 c -5.66288,-21.28292 -21.4158,-36.89778 -42.2051,-41.83523 -5.63965,-1.33941 -7.66026,-1.3488 -253.17948,-1.17613 l -247.49447,0.17405 -4.72222,1.5953 c -18.05932,6.10093 -31.7315,19.23923 -37.4918,36.0278 -1.04762,3.05333 -2.22128,7.52472 -2.60813,9.93642 -0.47859,2.9836 -0.705,81.91876 -0.70847,246.99889 -0.005,218.14117 0.10226,243.1829 1.05916,248.25397 4.27172,22.63802 22.24346,40.86392 44.80877,45.4425 3.58848,0.72811 49.16893,0.87009 250.95237,0.78171 l 246.56747,-0.10801 z"
|
||||||
|
id="path17" /><path
|
||||||
|
style="fill:#ed6b21;fill-opacity:1;stroke-width:0.674603"
|
||||||
|
d="m 218.59688,436.65333 c -4.13129,-2.06443 -6.86895,-4.83026 -9.31331,-9.40915 -1.8345,-3.43648 -1.79343,-12.82008 0.0723,-16.52778 1.6224,-3.22405 174.17376,-232.72362 177.28101,-235.79015 3.40221,-3.35765 7.0012,-4.88322 12.34326,-5.23218 4.15899,-0.27168 5.32913,-0.0718 8.86231,1.51379 2.23886,1.00474 4.97342,2.78734 6.07682,3.96132 4.02813,4.28582 175.25817,232.2757 176.9048,235.54571 2.34584,4.65861 2.38759,12.10251 0.0927,16.52929 -2.00877,3.87485 -5.74351,7.80536 -9.18863,9.67026 l -2.69841,1.4607 -178.1462,0.17362 -178.14619,0.17362 z m 298.67589,-45.66907 c -0.0611,-1.0035 -116.48775,-154.99008 -117.18534,-154.99008 -0.71184,0 -116.84805,154.02591 -116.8632,154.99008 -0.004,0.27827 52.6617,0.50595 117.03571,0.50595 64.374,0 117.02978,-0.22768 117.01283,-0.50595 z"
|
||||||
|
id="path19" /><path
|
||||||
|
style="fill:#ed6b21;fill-opacity:1;stroke-width:0.674603"
|
||||||
|
d="m 202.23056,642.87591 c -4.08272,-1.10499 -7.53117,-3.30912 -10.37477,-6.63124 -4.63948,-5.42019 -4.43387,-2.10678 -4.42657,-71.33297 l 0.007,-62.44927 1.60268,-3.44194 c 1.88877,-4.05635 5.3977,-7.75734 9.36436,-9.8769 l 2.84915,-1.52243 h 199.00794 199.00793 l 2.84915,1.52243 c 3.96665,2.11956 7.47559,5.82055 9.36436,9.8769 l 1.60267,3.44194 0.007,62.44927 c 0.008,69.78764 0.26152,65.98231 -4.79028,71.72146 -1.4904,1.69319 -4.37627,3.87229 -6.52672,4.9283 l -3.85513,1.89304 -196.30953,0.12602 c -153.67069,0.0987 -196.97613,-0.0544 -199.37859,-0.70461 z M 565.87502,565.20052 V 534.50608 H 400.25994 234.64486 v 30.69444 30.69446 h 165.61508 165.61508 z"
|
||||||
|
id="path21" /></svg>
|
After Width: | Height: | Size: 5.7 KiB |
76
resources/icons/notification_eject_sd_hover.svg
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
version="1.1"
|
||||||
|
id="Layer_1"
|
||||||
|
x="0px"
|
||||||
|
y="0px"
|
||||||
|
viewBox="0 0 800 800"
|
||||||
|
style="enable-background:new 0 0 800 800;"
|
||||||
|
xml:space="preserve"
|
||||||
|
sodipodi:docname="notification_eject_sd.svg"
|
||||||
|
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"><metadata
|
||||||
|
id="metadata15"><rdf:RDF><cc:Work
|
||||||
|
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
|
||||||
|
id="defs13" /><sodipodi:namedview
|
||||||
|
inkscape:document-rotation="0"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1"
|
||||||
|
objecttolerance="10"
|
||||||
|
gridtolerance="10"
|
||||||
|
guidetolerance="10"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-width="1918"
|
||||||
|
inkscape:window-height="2054"
|
||||||
|
id="namedview11"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:zoom="1.26"
|
||||||
|
inkscape:cx="400"
|
||||||
|
inkscape:cy="401.5873"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="0"
|
||||||
|
inkscape:window-maximized="0"
|
||||||
|
inkscape:current-layer="Layer_1" />
|
||||||
|
<style
|
||||||
|
type="text/css"
|
||||||
|
id="style2">
|
||||||
|
.st0{fill:#ED6B21;}
|
||||||
|
</style>
|
||||||
|
<path
|
||||||
|
class="st0"
|
||||||
|
d="M594.8,558.9v71.5H205.9v-71.5H594.8 M627.6,502.2H173.2c-13.2,0-23.9,10.7-23.9,23.9v137.1 c0,13.2,10.7,23.9,23.9,23.9h454.4c13.2,0,23.9-10.7,23.9-23.9V526.2C651.5,513,640.8,502.2,627.6,502.2L627.6,502.2z"
|
||||||
|
id="path4" />
|
||||||
|
<path
|
||||||
|
class="st0"
|
||||||
|
d="M400.2,206.8l137.6,182.7h-275L400.2,206.8 M400.2,128.4c-7.2,0-14.3,3.2-19.1,9.6l-203.1,270 c-11.9,15.8-0.6,38.3,19.1,38.3h406.3c19.7,0,31-22.5,19.1-38.3l-203.3-270C414.5,131.6,407.4,128.4,400.2,128.4L400.2,128.4z"
|
||||||
|
id="path6" />
|
||||||
|
<g
|
||||||
|
id="g4"
|
||||||
|
transform="matrix(1.15,0,0,1.15,-7.50075,-7.5)">
|
||||||
|
<path
|
||||||
|
id="path2"
|
||||||
|
class="st0"
|
||||||
|
d="M597.2,701.3H110.6c-57.4,0-104.1-46.7-104.1-104.1V110.6C6.5,53.2,53.2,6.5,110.6,6.5h486.6 c57.4,0,104.1,46.7,104.1,104.1v486.6C701.3,654.6,654.6,701.3,597.2,701.3z M110.6,52.4c-32,0-58.2,26-58.2,58.2v486.6 c0,32,26,58.2,58.2,58.2h486.6c32,0,58.2-26,58.2-58.2V110.6c0-32-26-58.2-58.2-58.2L110.6,52.4z" />
|
||||||
|
</g>
|
||||||
|
<path
|
||||||
|
style="fill:#ed6b21;fill-opacity:1;stroke-width:0.793651"
|
||||||
|
d="M 107.81901,798.00119 C 77.966509,794.83135 49.146122,779.90354 30.060545,757.72544 16.219297,741.64143 7.2605087,723.64471 2.5844311,702.53048 L 0.79365079,694.44444 V 399.60317 104.7619 L 2.5707889,96.74281 C 8.1200484,71.702533 18.222321,53.056007 35.651802,35.682695 53.220959,18.170156 71.802034,8.0954675 96.708127,2.5778576 L 104.7619,0.79365079 h 294.44445 c 281.74132,0 294.75136,0.0623952 301.55851,1.44626191 16.67428,3.3898194 30.80854,9.2277743 44.45639,18.3620833 30.56319,20.455498 49.17772,51.734599 52.83931,88.789134 0.52246,5.28681 0.71992,107.13501 0.57277,295.37077 -0.21452,274.44189 -0.28952,287.63907 -1.67476,294.84127 -9.63677,50.10325 -47.25156,87.71807 -97.3554,97.35548 -7.21079,1.38698 -20.15876,1.45445 -296.82539,1.54754 -159.10715,0.0532 -291.83859,-0.17373 -294.95877,-0.505 z m 582.70983,-52.40653 c 14.11333,-2.49918 25.86756,-8.65506 36.13916,-18.92666 10.4238,-10.4238 16.61917,-22.37735 18.96341,-36.58863 0.59763,-3.62296 0.78014,-91.16224 0.61306,-294.04762 -0.2267,-275.2812 -0.30507,-289.11319 -1.66353,-293.6508 -2.29132,-7.653498 -8.052,-18.790275 -12.80623,-24.757484 -7.93878,-9.964272 -18.57499,-17.346949 -31.48512,-21.854079 l -7.43245,-2.594784 -291.12328,-0.20372 C 142.50327,52.78948 110.02937,52.90047 105.30529,53.98405 79.968659,59.795581 61.031339,78.238321 54.164726,103.78898 l -1.754497,6.52848 -0.240323,282.14286 c -0.151001,177.27655 0.04527,285.53516 0.528069,291.26984 2.318854,27.5434 19.073236,49.76542 44.524247,59.05433 10.087718,3.68173 -4.026285,3.51395 301.243128,3.58099 197.57151,0.0434 288.82563,-0.19746 292.06349,-0.77082 z"
|
||||||
|
id="path19" /><path
|
||||||
|
id="path12"
|
||||||
|
d="M 107.81901,798.00119 C 71.793616,794.17587 39.726024,774.51428 19.725029,743.98814 11.604149,731.59381 6.0410683,718.13847 2.5844311,702.53048 L 0.79365079,694.44444 V 399.20635 103.96825 L 3.035741,94.554887 C 8.7824143,70.427608 18.557382,52.794942 35.676163,35.676161 52.78713,18.565194 70.514246,8.724096 94.444444,3.0513179 l 9.523806,-2.25766869 h 294.84127 c 282.12524,0 295.14809,0.0623746 301.95534,1.44626189 16.66109,3.3871391 30.79289,9.2216269 44.45639,18.3543829 30.53954,20.412782 49.17677,51.732756 52.83931,88.796836 0.52246,5.28681 0.71992,107.13501 0.57277,295.37077 -0.21452,274.44188 -0.28952,287.63907 -1.67476,294.84127 -8.48938,44.13777 -38.62564,78.86883 -80.59962,92.88841 -19.37815,6.47239 11.16453,5.88739 -313.58117,6.0062 -159.10715,0.0579 -291.83859,-0.16532 -294.95877,-0.49659 z m 583.84766,-52.6969 c 13.48971,-2.42242 24.94716,-8.60413 35.32488,-19.05909 10.25229,-10.3286 16.66154,-22.92711 18.61985,-36.60068 0.66689,-4.65647 0.83196,-81.74243 0.62956,-294.0096 C 745.9846,126.77174 745.87745,107.60752 744.6044,102.9114 738.42079,80.100871 721.07257,62.283764 697.9879,55.03493 l -5.92441,-1.860328 H 399.20635 106.34921 L 98.809524,55.78721 C 75.623265,63.821579 59.178748,82.101475 53.902861,105.70593 52.59901,111.53938 52.514615,128.88593 52.47105,400 l -0.04629,288.09524 2.080286,7.60155 c 6.270993,22.91476 22.15377,39.95711 44.384633,47.62505 3.584011,1.23621 7.998091,1.91356 14.999211,2.30168 5.45635,0.30249 136.34921,0.59491 290.87301,0.64982 232.38849,0.0826 281.98128,-0.0849 286.90477,-0.96905 z"
|
||||||
|
style="fill:#ed6b21;fill-opacity:1;stroke-width:0.793651" /><path
|
||||||
|
id="path14"
|
||||||
|
d="m 188.74939,444.33528 c -4.767,-1.68913 -10.12828,-6.7592 -12.71276,-12.02223 -2.90908,-5.92405 -3.07868,-13.78271 -0.41474,-19.21781 1.59087,-3.24578 204.04455,-273.05533 208.24079,-277.52202 0.98764,-1.05129 4.03672,-3.01468 6.77574,-4.3631 4.52929,-2.22976 5.50158,-2.41761 10.74224,-2.07541 6.86047,0.44798 10.76603,2.25377 15.37601,7.10932 3.73681,3.93587 203.30677,268.8636 207.0044,274.79691 2.05716,3.30097 2.4722,4.84315 2.70946,10.06767 0.23771,5.23447 -0.0137,6.8089 -1.6588,10.38763 -2.76417,6.01319 -5.53229,8.93875 -11.0814,11.71167 l -4.85687,2.42701 -208.40498,-0.0627 c -181.84257,-0.0547 -208.82739,-0.21233 -211.71909,-1.23698 z m 348.94902,-54.98925 c 0,-0.9027 -136.36908,-182.10669 -137.30528,-182.44799 -0.54415,-0.19837 -135.36926,178.28524 -137.53574,182.07198 -0.54249,0.9482 19.37332,1.10934 137.10317,1.10934 83.74346,0 137.73785,-0.28747 137.73785,-0.73333 z"
|
||||||
|
style="fill:#ed6b21;fill-opacity:1;stroke-width:0.793651" /><path
|
||||||
|
id="path16"
|
||||||
|
d="m 168.25397,686.16973 c -7.05465,-1.71645 -13.06577,-6.58064 -16.33102,-13.21504 L 150,669.04762 v -74.20635 -74.20635 l 1.8935,-4.19003 c 1.12593,-2.49152 3.46026,-5.59868 5.75857,-7.66505 7.33695,-6.59655 -16.73947,-6.00214 243.08455,-6.00144 l 231.80306,6.3e-4 4.76912,2.2562 c 5.31341,2.5137 9.30333,6.56248 11.81369,11.98794 1.66145,3.59075 1.67116,4.0432 1.67116,77.8181 v 74.20635 l -1.92294,3.90707 c -2.44721,4.97227 -6.5951,9.12016 -11.60261,11.6026 l -3.93477,1.95064 -231.3492,0.12055 c -127.24207,0.0663 -232.42064,-0.14013 -233.73016,-0.45875 z m 426.5873,-91.72529 V 558.33333 H 400 205.15873 v 36.11111 36.11111 H 400 594.84127 Z"
|
||||||
|
style="fill:#ed6b21;fill-opacity:1;stroke-width:0.793651" /></svg>
|
After Width: | Height: | Size: 7.3 KiB |
|
@ -78,7 +78,6 @@ src/libslic3r/ExtrusionEntity.cpp
|
||||||
src/libslic3r/Flow.cpp
|
src/libslic3r/Flow.cpp
|
||||||
src/libslic3r/Format/3mf.cpp
|
src/libslic3r/Format/3mf.cpp
|
||||||
src/libslic3r/Format/AMF.cpp
|
src/libslic3r/Format/AMF.cpp
|
||||||
src/libslic3r/GCode/PreviewData.cpp
|
|
||||||
src/libslic3r/miniz_extension.cpp
|
src/libslic3r/miniz_extension.cpp
|
||||||
src/libslic3r/Preset.cpp
|
src/libslic3r/Preset.cpp
|
||||||
src/libslic3r/Print.cpp
|
src/libslic3r/Print.cpp
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
min_slic3r_version = 2.3.0-alpha2
|
min_slic3r_version = 2.3.0-alpha2
|
||||||
|
0.0.4 Fixed predator output filaname format, infill overlap.
|
||||||
|
0.0.3 Fixed infill_overlap, start_gcode, end_gcode for Anycubic Predator
|
||||||
0.0.2 Added Anycubic Predator
|
0.0.2 Added Anycubic Predator
|
||||||
min_slic3r_version = 2.3.0-alpha0
|
min_slic3r_version = 2.3.0-alpha0
|
||||||
0.0.1 Initial Version
|
0.0.1 Initial Version
|
||||||
|
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 33 KiB |
|
@ -1,4 +1,6 @@
|
||||||
min_slic3r_version = 2.3.0-alpha2
|
min_slic3r_version = 2.3.0-alpha2
|
||||||
|
0.0.6 Added filament profiles, adjusted temperatures, updated start g-code for some models.
|
||||||
|
0.0.5 Added 0.08mm SUPERDETAIL and 0.28mm SUPERDRAFT print profiles. Updated OPTIMAL print profile.
|
||||||
0.0.4 Added initial CR-10 profile, end g-code improvements.
|
0.0.4 Added initial CR-10 profile, end g-code improvements.
|
||||||
min_slic3r_version = 2.3.0-alpha0
|
min_slic3r_version = 2.3.0-alpha0
|
||||||
0.0.3 Added Ender-2, Ender-3 BLTouch, updated Ender-3 bed texture.
|
0.0.3 Added Ender-2, Ender-3 BLTouch, updated Ender-3 bed texture.
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
name = Creality
|
name = Creality
|
||||||
# Configuration version of this file. Config file will only be installed, if the config_version differs.
|
# Configuration version of this file. Config file will only be installed, if the config_version differs.
|
||||||
# This means, the server may force the PrusaSlicer configuration to be downgraded.
|
# This means, the server may force the PrusaSlicer configuration to be downgraded.
|
||||||
config_version = 0.0.4
|
config_version = 0.0.6
|
||||||
# Where to get the updates from?
|
# Where to get the updates from?
|
||||||
config_update_url = https://files.prusa3d.com/wp-content/uploads/repository/PrusaSlicer-settings-master/live/Creality/
|
config_update_url = https://files.prusa3d.com/wp-content/uploads/repository/PrusaSlicer-settings-master/live/Creality/
|
||||||
# changelog_url = https://files.prusa3d.com/?latest=slicer-profiles&lng=%1%
|
# changelog_url = https://files.prusa3d.com/?latest=slicer-profiles&lng=%1%
|
||||||
|
@ -260,6 +260,13 @@ wipe_tower_x = 170
|
||||||
wipe_tower_y = 140
|
wipe_tower_y = 140
|
||||||
xy_size_compensation = 0
|
xy_size_compensation = 0
|
||||||
|
|
||||||
|
[print:*0.08mm*]
|
||||||
|
inherits = *common*
|
||||||
|
layer_height = 0.08
|
||||||
|
perimeters = 3
|
||||||
|
bottom_solid_layers = 9
|
||||||
|
top_solid_layers = 11
|
||||||
|
|
||||||
[print:*0.10mm*]
|
[print:*0.10mm*]
|
||||||
inherits = *common*
|
inherits = *common*
|
||||||
layer_height = 0.1
|
layer_height = 0.1
|
||||||
|
@ -274,9 +281,9 @@ perimeters = 3
|
||||||
bottom_solid_layers = 6
|
bottom_solid_layers = 6
|
||||||
top_solid_layers = 7
|
top_solid_layers = 7
|
||||||
|
|
||||||
[print:*0.15mm*]
|
[print:*0.16mm*]
|
||||||
inherits = *common*
|
inherits = *common*
|
||||||
layer_height = 0.15
|
layer_height = 0.16
|
||||||
bottom_solid_layers = 5
|
bottom_solid_layers = 5
|
||||||
top_solid_layers = 7
|
top_solid_layers = 7
|
||||||
|
|
||||||
|
@ -293,6 +300,17 @@ top_infill_extrusion_width = 0.45
|
||||||
bottom_solid_layers = 3
|
bottom_solid_layers = 3
|
||||||
top_solid_layers = 4
|
top_solid_layers = 4
|
||||||
|
|
||||||
|
[print:*0.28mm*]
|
||||||
|
inherits = *common*
|
||||||
|
layer_height = 0.28
|
||||||
|
top_infill_extrusion_width = 0.45
|
||||||
|
bottom_solid_layers = 3
|
||||||
|
top_solid_layers = 4
|
||||||
|
|
||||||
|
[print:0.08mm SUPERDETAIL @CREALITY]
|
||||||
|
inherits = *0.08mm*
|
||||||
|
compatible_printers_condition = printer_model=~/(ENDER|CR).*/ and nozzle_diameter[0]==0.4
|
||||||
|
|
||||||
[print:0.10mm HIGHDETAIL @CREALITY]
|
[print:0.10mm HIGHDETAIL @CREALITY]
|
||||||
inherits = *0.10mm*
|
inherits = *0.10mm*
|
||||||
renamed_from = "0.10mm HIGHDETAIL @ENDER3"
|
renamed_from = "0.10mm HIGHDETAIL @ENDER3"
|
||||||
|
@ -303,9 +321,9 @@ inherits = *0.12mm*
|
||||||
renamed_from = "0.12mm DETAIL @ENDER3"
|
renamed_from = "0.12mm DETAIL @ENDER3"
|
||||||
compatible_printers_condition = printer_model=~/(ENDER|CR).*/ and nozzle_diameter[0]==0.4
|
compatible_printers_condition = printer_model=~/(ENDER|CR).*/ and nozzle_diameter[0]==0.4
|
||||||
|
|
||||||
[print:0.15mm OPTIMAL @CREALITY]
|
[print:0.16mm OPTIMAL @CREALITY]
|
||||||
inherits = *0.15mm*
|
inherits = *0.16mm*
|
||||||
renamed_from = "0.15mm OPTIMAL @ENDER3"
|
renamed_from = "0.15mm OPTIMAL @ENDER3"; "0.15mm OPTIMAL @CREALITY"
|
||||||
compatible_printers_condition = printer_model=~/(ENDER|CR).*/ and nozzle_diameter[0]==0.4
|
compatible_printers_condition = printer_model=~/(ENDER|CR).*/ and nozzle_diameter[0]==0.4
|
||||||
|
|
||||||
[print:0.20mm NORMAL @CREALITY]
|
[print:0.20mm NORMAL @CREALITY]
|
||||||
|
@ -318,6 +336,10 @@ inherits = *0.24mm*
|
||||||
renamed_from = "0.24mm DRAFT @ENDER3"
|
renamed_from = "0.24mm DRAFT @ENDER3"
|
||||||
compatible_printers_condition = printer_model=~/(ENDER|CR).*/ and nozzle_diameter[0]==0.4
|
compatible_printers_condition = printer_model=~/(ENDER|CR).*/ and nozzle_diameter[0]==0.4
|
||||||
|
|
||||||
|
[print:0.28mm SUPERDRAFT @CREALITY]
|
||||||
|
inherits = *0.28mm*
|
||||||
|
compatible_printers_condition = printer_model=~/(ENDER|CR).*/ and nozzle_diameter[0]==0.4
|
||||||
|
|
||||||
# Common filament preset
|
# Common filament preset
|
||||||
[filament:*common*]
|
[filament:*common*]
|
||||||
cooling = 0
|
cooling = 0
|
||||||
|
@ -337,20 +359,20 @@ compatible_printers_condition = printer_notes=~/.*PRINTER_VENDOR_CREALITY.*/
|
||||||
inherits = *common*
|
inherits = *common*
|
||||||
bed_temperature = 60
|
bed_temperature = 60
|
||||||
fan_below_layer_time = 100
|
fan_below_layer_time = 100
|
||||||
filament_colour = #FF3232
|
filament_colour = #DDDDDD
|
||||||
filament_max_volumetric_speed = 15
|
filament_max_volumetric_speed = 15
|
||||||
filament_type = PLA
|
filament_type = PLA
|
||||||
filament_density = 1.24
|
filament_density = 1.24
|
||||||
filament_cost = 20
|
filament_cost = 20
|
||||||
first_layer_bed_temperature = 40
|
first_layer_bed_temperature = 60
|
||||||
first_layer_temperature = 215
|
first_layer_temperature = 210
|
||||||
fan_always_on = 1
|
fan_always_on = 1
|
||||||
cooling = 1
|
cooling = 1
|
||||||
max_fan_speed = 100
|
max_fan_speed = 100
|
||||||
min_fan_speed = 100
|
min_fan_speed = 100
|
||||||
bridge_fan_speed = 100
|
bridge_fan_speed = 100
|
||||||
disable_fan_first_layers = 1
|
disable_fan_first_layers = 1
|
||||||
temperature = 210
|
temperature = 205
|
||||||
|
|
||||||
[filament:*PET*]
|
[filament:*PET*]
|
||||||
inherits = *common*
|
inherits = *common*
|
||||||
|
@ -358,7 +380,7 @@ bed_temperature = 70
|
||||||
cooling = 1
|
cooling = 1
|
||||||
disable_fan_first_layers = 3
|
disable_fan_first_layers = 3
|
||||||
fan_below_layer_time = 20
|
fan_below_layer_time = 20
|
||||||
filament_colour = #FF8000
|
filament_colour = #DDDDDD
|
||||||
filament_max_volumetric_speed = 8
|
filament_max_volumetric_speed = 8
|
||||||
filament_type = PETG
|
filament_type = PETG
|
||||||
filament_density = 1.27
|
filament_density = 1.27
|
||||||
|
@ -377,7 +399,7 @@ bed_temperature = 100
|
||||||
cooling = 0
|
cooling = 0
|
||||||
disable_fan_first_layers = 3
|
disable_fan_first_layers = 3
|
||||||
fan_below_layer_time = 20
|
fan_below_layer_time = 20
|
||||||
filament_colour = #3A80CA
|
filament_colour = #DDDDDD
|
||||||
filament_max_volumetric_speed = 11
|
filament_max_volumetric_speed = 11
|
||||||
filament_type = ABS
|
filament_type = ABS
|
||||||
filament_density = 1.04
|
filament_density = 1.04
|
||||||
|
@ -412,10 +434,11 @@ filament_vendor = Generic
|
||||||
inherits = *PLA*
|
inherits = *PLA*
|
||||||
renamed_from = "Creality PLA @ENDER3"
|
renamed_from = "Creality PLA @ENDER3"
|
||||||
filament_vendor = Creality
|
filament_vendor = Creality
|
||||||
temperature = 205
|
temperature = 200
|
||||||
bed_temperature = 40
|
bed_temperature = 60
|
||||||
first_layer_temperature = 210
|
first_layer_temperature = 205
|
||||||
first_layer_bed_temperature = 40
|
first_layer_bed_temperature = 60
|
||||||
|
filament_colour = #42BDD8
|
||||||
|
|
||||||
[filament:Creality PETG @CREALITY]
|
[filament:Creality PETG @CREALITY]
|
||||||
inherits = *PET*
|
inherits = *PET*
|
||||||
|
@ -427,6 +450,7 @@ first_layer_temperature = 240
|
||||||
first_layer_bed_temperature = 70
|
first_layer_bed_temperature = 70
|
||||||
max_fan_speed = 40
|
max_fan_speed = 40
|
||||||
min_fan_speed = 20
|
min_fan_speed = 20
|
||||||
|
filament_colour = #42BDD8
|
||||||
|
|
||||||
[filament:Creality ABS @CREALITY]
|
[filament:Creality ABS @CREALITY]
|
||||||
inherits = *ABS*
|
inherits = *ABS*
|
||||||
|
@ -436,17 +460,19 @@ temperature = 240
|
||||||
bed_temperature = 90
|
bed_temperature = 90
|
||||||
first_layer_temperature = 240
|
first_layer_temperature = 240
|
||||||
first_layer_bed_temperature = 90
|
first_layer_bed_temperature = 90
|
||||||
|
filament_colour = #42BDD8
|
||||||
|
|
||||||
[filament:Prusament PLA @CREALITY]
|
[filament:Prusament PLA @CREALITY]
|
||||||
inherits = *PLA*
|
inherits = *PLA*
|
||||||
renamed_from = "Prusament PLA @ENDER3"
|
renamed_from = "Prusament PLA @ENDER3"
|
||||||
filament_vendor = Prusa Polymers
|
filament_vendor = Prusa Polymers
|
||||||
temperature = 215
|
temperature = 210
|
||||||
bed_temperature = 40
|
bed_temperature = 60
|
||||||
first_layer_temperature = 215
|
first_layer_temperature = 215
|
||||||
first_layer_bed_temperature = 40
|
first_layer_bed_temperature = 60
|
||||||
filament_cost = 24.99
|
filament_cost = 24.99
|
||||||
filament_density = 1.24
|
filament_density = 1.24
|
||||||
|
filament_colour = #F94D0C
|
||||||
|
|
||||||
[filament:Prusament PETG @CREALITY]
|
[filament:Prusament PETG @CREALITY]
|
||||||
inherits = *PET*
|
inherits = *PET*
|
||||||
|
@ -458,6 +484,18 @@ first_layer_temperature = 245
|
||||||
first_layer_bed_temperature = 70
|
first_layer_bed_temperature = 70
|
||||||
filament_cost = 24.99
|
filament_cost = 24.99
|
||||||
filament_density = 1.27
|
filament_density = 1.27
|
||||||
|
filament_colour = #F94D0C
|
||||||
|
|
||||||
|
[filament:AzureFilm PLA @CREALITY]
|
||||||
|
inherits = *PLA*
|
||||||
|
filament_vendor = AzureFilm
|
||||||
|
temperature = 210
|
||||||
|
bed_temperature = 60
|
||||||
|
first_layer_temperature = 215
|
||||||
|
first_layer_bed_temperature = 60
|
||||||
|
filament_cost = 19.97
|
||||||
|
filament_density = 1.24
|
||||||
|
filament_colour = #006AA6
|
||||||
|
|
||||||
[filament:Devil Design PLA @CREALITY]
|
[filament:Devil Design PLA @CREALITY]
|
||||||
inherits = *PLA*
|
inherits = *PLA*
|
||||||
|
@ -468,6 +506,18 @@ first_layer_temperature = 215
|
||||||
first_layer_bed_temperature = 60
|
first_layer_bed_temperature = 60
|
||||||
filament_cost = 19.00
|
filament_cost = 19.00
|
||||||
filament_density = 1.24
|
filament_density = 1.24
|
||||||
|
filament_colour = #FF0000
|
||||||
|
|
||||||
|
[filament:Devil Design PLA (Galaxy) @CREALITY]
|
||||||
|
inherits = *PLA*
|
||||||
|
filament_vendor = Devil Design
|
||||||
|
temperature = 225
|
||||||
|
bed_temperature = 65
|
||||||
|
first_layer_temperature = 225
|
||||||
|
first_layer_bed_temperature = 65
|
||||||
|
filament_cost = 19.00
|
||||||
|
filament_density = 1.24
|
||||||
|
filament_colour = #FF0000
|
||||||
|
|
||||||
[filament:Extrudr PLA NX2 @CREALITY]
|
[filament:Extrudr PLA NX2 @CREALITY]
|
||||||
inherits = *PLA*
|
inherits = *PLA*
|
||||||
|
@ -478,6 +528,7 @@ first_layer_temperature = 205
|
||||||
first_layer_bed_temperature = 60
|
first_layer_bed_temperature = 60
|
||||||
filament_cost = 23.63
|
filament_cost = 23.63
|
||||||
filament_density = 1.3
|
filament_density = 1.3
|
||||||
|
filament_colour = #3C4547
|
||||||
|
|
||||||
[filament:Real Filament PLA @CREALITY]
|
[filament:Real Filament PLA @CREALITY]
|
||||||
inherits = *PLA*
|
inherits = *PLA*
|
||||||
|
@ -488,12 +539,47 @@ first_layer_temperature = 200
|
||||||
first_layer_bed_temperature = 60
|
first_layer_bed_temperature = 60
|
||||||
filament_cost = 24.99
|
filament_cost = 24.99
|
||||||
filament_density = 1.24
|
filament_density = 1.24
|
||||||
|
filament_colour = #007ABF
|
||||||
|
|
||||||
|
[filament:Velleman PLA @CREALITY]
|
||||||
|
inherits = *PLA*
|
||||||
|
filament_vendor = Velleman
|
||||||
|
temperature = 200
|
||||||
|
bed_temperature = 60
|
||||||
|
first_layer_temperature = 205
|
||||||
|
first_layer_bed_temperature = 60
|
||||||
|
filament_cost = 27.99
|
||||||
|
filament_density = 1.24
|
||||||
|
filament_colour = #7EA60D
|
||||||
|
|
||||||
|
[filament:3DJAKE ecoPLA @CREALITY]
|
||||||
|
inherits = *PLA*
|
||||||
|
filament_vendor = 3DJAKE
|
||||||
|
temperature = 200
|
||||||
|
bed_temperature = 60
|
||||||
|
first_layer_temperature = 205
|
||||||
|
first_layer_bed_temperature = 60
|
||||||
|
filament_cost = 21.99
|
||||||
|
filament_density = 1.24
|
||||||
|
filament_colour = #125467
|
||||||
|
|
||||||
|
[filament:123-3D Jupiter PLA @CREALITY]
|
||||||
|
inherits = *PLA*
|
||||||
|
filament_vendor = 123-3D
|
||||||
|
temperature = 200
|
||||||
|
bed_temperature = 60
|
||||||
|
first_layer_temperature = 205
|
||||||
|
first_layer_bed_temperature = 60
|
||||||
|
filament_cost = 19.50
|
||||||
|
filament_density = 1.24
|
||||||
|
filament_colour = #FFE200
|
||||||
|
|
||||||
# Common printer preset
|
# Common printer preset
|
||||||
[printer:*common*]
|
[printer:*common*]
|
||||||
printer_technology = FFF
|
printer_technology = FFF
|
||||||
before_layer_gcode = ;BEFORE_LAYER_CHANGE\nG92 E0\n;[layer_z]\n\n
|
before_layer_gcode = ;BEFORE_LAYER_CHANGE\nG92 E0\n;[layer_z]\n\n
|
||||||
between_objects_gcode =
|
between_objects_gcode =
|
||||||
|
pause_print_gcode =
|
||||||
deretract_speed = 0
|
deretract_speed = 0
|
||||||
extruder_colour = #FFFF00
|
extruder_colour = #FFFF00
|
||||||
extruder_offset = 0x0
|
extruder_offset = 0x0
|
||||||
|
@ -551,8 +637,8 @@ inherits = *common*
|
||||||
renamed_from = "Creality ENDER-3"
|
renamed_from = "Creality ENDER-3"
|
||||||
printer_model = ENDER3
|
printer_model = ENDER3
|
||||||
printer_variant = 0.4
|
printer_variant = 0.4
|
||||||
max_layer_height = 0.25
|
max_layer_height = 0.28
|
||||||
min_layer_height = 0.1
|
min_layer_height = 0.08
|
||||||
printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_CREALITY\nPRINTER_MODEL_ENDER3\nPRINTER_HAS_BOWDEN
|
printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_CREALITY\nPRINTER_MODEL_ENDER3\nPRINTER_HAS_BOWDEN
|
||||||
bed_shape = 3x3,228x3,228x228,3x228
|
bed_shape = 3x3,228x3,228x228,3x228
|
||||||
max_print_height = 250
|
max_print_height = 250
|
||||||
|
@ -578,19 +664,22 @@ retract_length = 5
|
||||||
retract_speed = 60
|
retract_speed = 60
|
||||||
deretract_speed = 40
|
deretract_speed = 40
|
||||||
retract_before_wipe = 70%
|
retract_before_wipe = 70%
|
||||||
default_print_profile = 0.15mm OPTIMAL @CREALITY
|
default_print_profile = 0.16mm OPTIMAL @CREALITY
|
||||||
default_filament_profile = Creality PLA @CREALITY
|
default_filament_profile = Creality PLA @CREALITY
|
||||||
start_gcode = G90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S[first_layer_temperature] ; set extruder temp\nM140 S[first_layer_bed_temperature] ; set bed temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG28 ; home all\nG1 Z2 F240\nG1 X2 Y10 F3000\nG1 Z0.28 F240\nG92 E0.0\nG1 Y190 E15.0 F1500.0 ; intro line\nG1 X2.3 F5000\nG1 Y10 E15.0 F1200.0 ; intro line\nG92 E0.0
|
start_gcode = G90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S[first_layer_temperature] ; set extruder temp\nM140 S[first_layer_bed_temperature] ; set bed temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG28 ; home all\nG1 Z2 F240\nG1 X2 Y10 F3000\nG1 Z0.28 F240\nG92 E0.0\nG1 Y190 E15.0 F1500.0 ; intro line\nG1 X2.3 F5000\nG1 Y10 E15.0 F1200.0 ; intro line\nG92 E0.0
|
||||||
end_gcode = M104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\n{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+5, max_print_height)} F600{endif} ; Move print head up\nG1 X5 Y170 F3000 ; present print\n{if layer_z < max_print_height-10}G1 Z{z_offset+min(layer_z+70, max_print_height-10)} F600{endif} ; Move print head up\nM84 X Y E ; disable motors
|
end_gcode = M104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\n{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+5, max_print_height)} F600{endif} ; Move print head up\nG1 X5 Y170 F3000 ; present print\n{if layer_z < max_print_height-10}G1 Z{z_offset+min(layer_z+70, max_print_height-10)} F600{endif} ; Move print head up\nM84 X Y E ; disable motors
|
||||||
|
|
||||||
[printer:*abl*]
|
[printer:*fastabl*]
|
||||||
start_gcode = G90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S150 ; set extruder temp for auto bed leveling\nM140 S[first_layer_bed_temperature] ; set bed temp\nG28 ; home all\nG29 ; auto bed levelling\nG1 Z50 F240\nG1 X2 Y10 F3000\nM104 S[first_layer_temperature] ; set extruder temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG1 Z0.28 F240\nG92 E0.0\nG1 Y190 E15.0 F1500.0 ; intro line\nG1 X2.3 F5000\nG1 Y10 E15.0 F1200.0 ; intro line\nG92 E0.0
|
start_gcode = G90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S150 ; set extruder temp for auto bed leveling\nM140 S[first_layer_bed_temperature] ; set bed temp\nG28 ; home all\nG29 ; auto bed levelling\nG1 Z50 F240\nG1 X2 Y10 F3000\nM104 S[first_layer_temperature] ; set extruder temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG1 Z0.28 F240\nG92 E0.0\nG1 Y190 E15.0 F1500.0 ; intro line\nG1 X2.3 F5000\nG1 Y10 E15.0 F1200.0 ; intro line\nG92 E0.0
|
||||||
|
|
||||||
|
[printer:*slowabl*]
|
||||||
|
start_gcode = G90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S150 ; set extruder temp for auto bed leveling\nM140 S[first_layer_bed_temperature] ; set bed temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nG28 ; home all\nG29 ; auto bed levelling\nG1 Z50 F240\nG1 X2 Y10 F3000\nM104 S[first_layer_temperature] ; set extruder temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG1 Z0.28 F240\nG92 E0.0\nG1 Y190 E15.0 F1500.0 ; intro line\nG1 X2.3 F5000\nG1 Y10 E15.0 F1200.0 ; intro line\nG92 E0.0
|
||||||
|
|
||||||
[printer:*invertedz*]
|
[printer:*invertedz*]
|
||||||
end_gcode = M104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\n{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+5, max_print_height)} F600{endif} ; Move print bed down\nG1 X50 Y50 F3000 ; present print\n{if layer_z < max_print_height-10}G1 Z{z_offset+max_print_height-10} F600{endif} ; Move print bed down\nM84 X Y E ; disable motors
|
end_gcode = M104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\n{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+5, max_print_height)} F600{endif} ; Move print bed down\nG1 X50 Y50 F3000 ; present print\n{if layer_z < max_print_height-10}G1 Z{z_offset+max_print_height-10} F600{endif} ; Move print bed down\nM84 X Y E ; disable motors
|
||||||
|
|
||||||
[printer:Creality Ender-3 BLTouch]
|
[printer:Creality Ender-3 BLTouch]
|
||||||
inherits = Creality Ender-3; *abl*
|
inherits = Creality Ender-3; *fastabl*
|
||||||
renamed_from = "Creality ENDER-3 BLTouch"
|
renamed_from = "Creality ENDER-3 BLTouch"
|
||||||
printer_model = ENDER3BLTOUCH
|
printer_model = ENDER3BLTOUCH
|
||||||
|
|
||||||
|
@ -603,7 +692,7 @@ printer_notes = Don't remove the following keywords! These keywords are used in
|
||||||
max_print_height = 300
|
max_print_height = 300
|
||||||
|
|
||||||
[printer:Creality Ender-5 Plus]
|
[printer:Creality Ender-5 Plus]
|
||||||
inherits = Creality Ender-3; *abl*; *invertedz*
|
inherits = Creality Ender-3; *slowabl*; *invertedz*
|
||||||
retract_length = 6
|
retract_length = 6
|
||||||
bed_shape = 5x5,355x5,355x355,5x355
|
bed_shape = 5x5,355x5,355x355,5x355
|
||||||
printer_model = ENDER5PLUS
|
printer_model = ENDER5PLUS
|
||||||
|
@ -661,7 +750,7 @@ printer_notes = Don't remove the following keywords! These keywords are used in
|
||||||
max_print_height = 400
|
max_print_height = 400
|
||||||
|
|
||||||
[printer:Creality CR-10 S Pro]
|
[printer:Creality CR-10 S Pro]
|
||||||
inherits = Creality Ender-3; *abl*
|
inherits = Creality Ender-3; *slowabl*
|
||||||
retract_length = 6
|
retract_length = 6
|
||||||
bed_shape = 0x0,300x0,300x300,0x300
|
bed_shape = 0x0,300x0,300x300,0x300
|
||||||
printer_model = CR10SPRO
|
printer_model = CR10SPRO
|
||||||
|
@ -669,7 +758,7 @@ printer_notes = Don't remove the following keywords! These keywords are used in
|
||||||
max_print_height = 400
|
max_print_height = 400
|
||||||
|
|
||||||
[printer:Creality CR-10 S Pro V2]
|
[printer:Creality CR-10 S Pro V2]
|
||||||
inherits = Creality Ender-3; *abl*
|
inherits = Creality Ender-3; *slowabl*
|
||||||
retract_length = 6
|
retract_length = 6
|
||||||
bed_shape = 5x5,305x5,305x305,5x305
|
bed_shape = 5x5,305x5,305x305,5x305
|
||||||
printer_model = CR10SPROV2
|
printer_model = CR10SPROV2
|
||||||
|
@ -698,7 +787,7 @@ printer_model = CR20
|
||||||
printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_CREALITY\nPRINTER_MODEL_CR20\nPRINTER_HAS_BOWDEN
|
printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_CREALITY\nPRINTER_MODEL_CR20\nPRINTER_HAS_BOWDEN
|
||||||
|
|
||||||
[printer:Creality CR-20 Pro]
|
[printer:Creality CR-20 Pro]
|
||||||
inherits = Creality Ender-3; *abl*
|
inherits = Creality Ender-3; *fastabl*
|
||||||
retract_length = 4
|
retract_length = 4
|
||||||
printer_model = CR20PRO
|
printer_model = CR20PRO
|
||||||
printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_CREALITY\nPRINTER_MODEL_CR20PRO\nPRINTER_HAS_BOWDEN
|
printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_CREALITY\nPRINTER_MODEL_CR20PRO\nPRINTER_HAS_BOWDEN
|
||||||
|
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 42 KiB |
|
@ -1,3 +1,5 @@
|
||||||
|
min_slic3r_version = 2.3.0-alpha3
|
||||||
|
0.0.3 Added DeltiQ 2, DeltiQ 2 Plus printers, 0.10mm, 0.20mm FLEX print profiles, updated print materials, flexprint extension support
|
||||||
min_slic3r_version = 2.3.0-alpha0
|
min_slic3r_version = 2.3.0-alpha0
|
||||||
0.0.2 Added 0.15mm print profile
|
0.0.2 Added 0.15mm print profile
|
||||||
0.0.1 Initial TriLAB bundle
|
0.0.1 Initial TriLAB bundle
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
# DeltiQ presets for PrusaSlicer
|
# Print profiles for the TriLAB printers
|
||||||
# https://github.com/prusa3d/PrusaSlicer-settings/pull/100
|
# based on https://github.com/trilab3d/PrusaSlicer-settings/tree/master/live/TriLAB
|
||||||
# based on https://github.com/trilab3d/Slicer-profiles/tree/deltiq/Slic3r_PE_1_41_3
|
|
||||||
|
|
||||||
[vendor]
|
[vendor]
|
||||||
# Vendor name will be shown by the Config Wizard.
|
# Vendor name will be shown by the Config Wizard.
|
||||||
name = TriLAB
|
name = TriLAB
|
||||||
# Configuration version of this file. Config file will only be installed, if the config_version differs.
|
# Configuration version of this file. Config file will only be installed, if the config_version differs.
|
||||||
# This means, the server may force the PrusaSlicer configuration to be downgraded.
|
# This means, the server may force the PrusaSlicer configuration to be downgraded.
|
||||||
config_version = 0.0.2
|
config_version = 0.0.3
|
||||||
# Where to get the updates from?
|
# Where to get the updates from?
|
||||||
config_update_url = https://files.prusa3d.com/wp-content/uploads/repository/PrusaSlicer-settings-master/live/TriLAB/
|
config_update_url = https://files.prusa3d.com/wp-content/uploads/repository/PrusaSlicer-settings-master/live/TriLAB/
|
||||||
# changelog_url = https://files.prusa3d.com/?latest=slicer-profiles&lng=%1%
|
# changelog_url = https://files.prusa3d.com/?latest=slicer-profiles&lng=%1%
|
||||||
|
@ -16,215 +15,364 @@ config_update_url = https://files.prusa3d.com/wp-content/uploads/repository/Prus
|
||||||
# also the first model installed & the first nozzle installed will be activated after install.
|
# also the first model installed & the first nozzle installed will be activated after install.
|
||||||
# Printer model name will be shown by the installation wizard.
|
# Printer model name will be shown by the installation wizard.
|
||||||
|
|
||||||
[printer_model:DQM]
|
[printer_model:DQ2]
|
||||||
name = TRILAB DeltiQ M
|
name = DeltiQ 2
|
||||||
variants = 0.4
|
variants = 0.4
|
||||||
technology = FFF
|
technology = FFF
|
||||||
bed_model =
|
family = DeltiQ 2
|
||||||
bed_texture =
|
bed_model = dq2_bed.stl
|
||||||
|
bed_texture = dq2_bed_texture.svg
|
||||||
|
default_materials = DeltiQ PLA; DeltiQ ASA; DeltiQ PET; DeltiQ ABS; DeltiQ CPE
|
||||||
|
|
||||||
|
[printer_model:DQ2P]
|
||||||
|
name = DeltiQ 2 Plus
|
||||||
|
variants = 0.4
|
||||||
|
technology = FFF
|
||||||
|
family = DeltiQ 2
|
||||||
|
bed_model = dq2_bed.stl
|
||||||
|
bed_texture = dq2_bed_texture.svg
|
||||||
|
default_materials = DeltiQ PLA; DeltiQ ASA; DeltiQ PET; DeltiQ ABS; DeltiQ CPE
|
||||||
|
|
||||||
|
[printer_model:DQ2+FP2]
|
||||||
|
name = DeltiQ 2 + FlexPrint 2
|
||||||
|
variants = 0.4
|
||||||
|
technology = FFF
|
||||||
|
family = DeltiQ 2
|
||||||
|
bed_model = dq2_bed.stl
|
||||||
|
bed_texture = dq2_bed_texture.svg
|
||||||
|
default_materials = DeltiQ FlexPrint 2 FLEX; DeltiQ FlexPrint 2 FLEX Smartfil; DeltiQ FlexPrint 2 PLA; DeltiQ FlexPrint 2 ASA; DeltiQ FlexPrint 2 PET; DeltiQ FlexPrint 2 ABS; DeltiQ FlexPrint 2 CPE
|
||||||
|
|
||||||
|
[printer_model:DQ2P+FP2]
|
||||||
|
name = DeltiQ 2 Plus + FlexPrint 2
|
||||||
|
variants = 0.4
|
||||||
|
technology = FFF
|
||||||
|
family = DeltiQ 2
|
||||||
|
bed_model = dq2_bed.stl
|
||||||
|
bed_texture = dq2_bed_texture.svg
|
||||||
|
default_materials = DeltiQ FlexPrint 2 FLEX; DeltiQ FlexPrint 2 FLEX Smartfil; DeltiQ FlexPrint 2 PLA; DeltiQ FlexPrint 2 ASA; DeltiQ FlexPrint 2 PET; DeltiQ FlexPrint 2 ABS; DeltiQ FlexPrint 2 CPE
|
||||||
|
|
||||||
|
[printer_model:DQ2+FP]
|
||||||
|
name = DeltiQ 2 + FlexPrint
|
||||||
|
variants = 0.4
|
||||||
|
technology = FFF
|
||||||
|
family = DeltiQ 2
|
||||||
|
bed_model = dq2_bed.stl
|
||||||
|
bed_texture = dq2_bed_texture.svg
|
||||||
|
default_materials = DeltiQ FlexPrint FLEX; DeltiQ FlexPrint PLA; DeltiQ FlexPrint ASA; DeltiQ FlexPrint PET; DeltiQ FlexPrint ABS; DeltiQ FlexPrint CPE
|
||||||
|
|
||||||
|
[printer_model:DQ2P+FP]
|
||||||
|
name = DeltiQ 2 Plus + FlexPrint
|
||||||
|
variants = 0.4
|
||||||
|
technology = FFF
|
||||||
|
family = DeltiQ 2
|
||||||
|
bed_model = dq2_bed.stl
|
||||||
|
bed_texture = dq2_bed_texture.svg
|
||||||
|
default_materials = DeltiQ FlexPrint FLEX; DeltiQ FlexPrint PLA; DeltiQ FlexPrint ASA; DeltiQ FlexPrint PET; DeltiQ FlexPrint ABS; DeltiQ FlexPrint CPE
|
||||||
|
|
||||||
|
[printer_model:DQM]
|
||||||
|
name = DeltiQ M
|
||||||
|
variants = 0.4
|
||||||
|
technology = FFF
|
||||||
|
family = DeltiQ
|
||||||
default_materials = DeltiQ PLA; DeltiQ ASA; DeltiQ PET; DeltiQ ABS; DeltiQ CPE
|
default_materials = DeltiQ PLA; DeltiQ ASA; DeltiQ PET; DeltiQ ABS; DeltiQ CPE
|
||||||
|
|
||||||
[printer_model:DQL]
|
[printer_model:DQL]
|
||||||
name = TRILAB DeltiQ L
|
name = DeltiQ L
|
||||||
variants = 0.4
|
variants = 0.4
|
||||||
technology = FFF
|
technology = FFF
|
||||||
bed_model =
|
family = DeltiQ
|
||||||
bed_texture =
|
|
||||||
default_materials = DeltiQ PLA; DeltiQ ASA; DeltiQ PET; DeltiQ ABS; DeltiQ CPE
|
default_materials = DeltiQ PLA; DeltiQ ASA; DeltiQ PET; DeltiQ ABS; DeltiQ CPE
|
||||||
|
|
||||||
[printer_model:DQXL]
|
[printer_model:DQXL]
|
||||||
name = TRILAB DeltiQ XL
|
name = DeltiQ XL
|
||||||
variants = 0.4
|
variants = 0.4
|
||||||
technology = FFF
|
technology = FFF
|
||||||
bed_model =
|
family = DeltiQ
|
||||||
bed_texture =
|
|
||||||
default_materials = DeltiQ PLA; DeltiQ ASA; DeltiQ PET; DeltiQ ABS; DeltiQ CPE
|
default_materials = DeltiQ PLA; DeltiQ ASA; DeltiQ PET; DeltiQ ABS; DeltiQ CPE
|
||||||
|
|
||||||
|
|
||||||
# All presets starting with asterisk, for example *common*, are intermediate and they will
|
# All presets starting with asterisk, for example *common*, are intermediate and they will
|
||||||
# not make it into the user interface.
|
# not make it into the user interface.
|
||||||
[print:DeltiQ 0.15mm]
|
|
||||||
inherits = DeltiQ 0.2mm
|
|
||||||
layer_height = 0.15
|
|
||||||
bottom_solid_layers = 5
|
|
||||||
top_solid_layers = 6
|
|
||||||
|
|
||||||
[print:DeltiQ 0.2mm]
|
[print:DeltiQ 0.20mm Normal]
|
||||||
avoid_crossing_perimeters = 0
|
avoid_crossing_perimeters = 0
|
||||||
|
bottom_fill_pattern = rectilinear
|
||||||
bottom_solid_layers = 4
|
bottom_solid_layers = 4
|
||||||
|
bottom_solid_min_thickness = 0.7
|
||||||
bridge_acceleration = 1000
|
bridge_acceleration = 1000
|
||||||
bridge_angle = 0
|
bridge_angle = 0
|
||||||
bridge_flow_ratio = 0.95
|
bridge_flow_ratio = 0.95
|
||||||
bridge_speed = 20
|
bridge_speed = 30
|
||||||
brim_width = 0
|
brim_width = 0
|
||||||
clip_multipart_objects = 0
|
clip_multipart_objects = 1
|
||||||
compatible_printers_condition = printer_notes=~/.*TRILAB.*/
|
compatible_printers =
|
||||||
|
compatible_printers_condition = printer_notes=~/.*PRINTER_VENDOR_TRILAB.*/
|
||||||
complete_objects = 0
|
complete_objects = 0
|
||||||
default_acceleration = 2000
|
default_acceleration = 2000
|
||||||
dont_support_bridges = 1
|
dont_support_bridges = 0
|
||||||
elefant_foot_compensation = 0
|
draft_shield = 0
|
||||||
ensure_vertical_shell_thickness = 1
|
elefant_foot_compensation = 0.2
|
||||||
external_fill_pattern = rectilinear
|
ensure_vertical_shell_thickness = 0
|
||||||
external_perimeter_extrusion_width = 0.4
|
external_perimeter_extrusion_width = 0.45
|
||||||
external_perimeter_speed = 30
|
external_perimeter_speed = 30
|
||||||
external_perimeters_first = 0
|
external_perimeters_first = 0
|
||||||
extra_perimeters = 0
|
extra_perimeters = 0
|
||||||
extruder_clearance_height = 20
|
extruder_clearance_height = 60
|
||||||
extruder_clearance_radius = 20
|
extruder_clearance_radius = 45
|
||||||
extrusion_width = 0.4
|
extrusion_width = 0.45
|
||||||
fill_angle = 45
|
fill_angle = 45
|
||||||
fill_density = 15%
|
fill_density = 20%
|
||||||
fill_pattern = gyroid
|
fill_pattern = grid
|
||||||
first_layer_acceleration = 1000
|
first_layer_acceleration = 1000
|
||||||
first_layer_extrusion_width = 0.4
|
first_layer_extrusion_width = 0.42
|
||||||
first_layer_height = 0.3
|
first_layer_height = 0.2
|
||||||
first_layer_speed = 20
|
first_layer_speed = 20
|
||||||
gap_fill_speed = 50
|
gap_fill_speed = 40
|
||||||
gcode_comments = 0
|
gcode_comments = 0
|
||||||
|
gcode_label_objects = 0
|
||||||
infill_acceleration = 2000
|
infill_acceleration = 2000
|
||||||
infill_every_layers = 1
|
infill_every_layers = 1
|
||||||
infill_extruder = 1
|
infill_extruder = 1
|
||||||
infill_extrusion_width = 0.55
|
infill_extrusion_width = 0.45
|
||||||
infill_first = 0
|
infill_first = 0
|
||||||
infill_only_where_needed = 0
|
infill_only_where_needed = 0
|
||||||
infill_overlap = 25%
|
infill_overlap = 25%
|
||||||
infill_speed = 50
|
infill_speed = 60
|
||||||
inherits =
|
|
||||||
interface_shells = 0
|
interface_shells = 0
|
||||||
|
ironing = 0
|
||||||
|
ironing_flowrate = 15%
|
||||||
|
ironing_spacing = 0.1
|
||||||
|
ironing_speed = 15
|
||||||
|
ironing_type = top
|
||||||
layer_height = 0.2
|
layer_height = 0.2
|
||||||
max_print_speed = 100
|
max_print_speed = 60
|
||||||
max_volumetric_extrusion_rate_slope_negative = 0
|
max_volumetric_speed = 0
|
||||||
max_volumetric_extrusion_rate_slope_positive = 0
|
|
||||||
max_volumetric_speed = 10
|
|
||||||
min_skirt_length = 4
|
min_skirt_length = 4
|
||||||
notes =
|
notes =
|
||||||
only_retract_when_crossing_perimeters = 1
|
only_retract_when_crossing_perimeters = 1
|
||||||
ooze_prevention = 0
|
ooze_prevention = 0
|
||||||
output_filename_format = {input_filename_base}_{layer_height}mm_{filament_type[0]}_{printer_model}.gcode
|
output_filename_format = {input_filename_base}_{printer_model}_{filament_type[0]}_{layer_height}mm_{print_time}.gcode
|
||||||
overhangs = 0
|
overhangs = 1
|
||||||
perimeter_acceleration = 1500
|
perimeter_acceleration = 1500
|
||||||
perimeter_extruder = 1
|
perimeter_extruder = 1
|
||||||
perimeter_extrusion_width = 0.4
|
perimeter_extrusion_width = 0.45
|
||||||
perimeter_speed = 40
|
perimeter_speed = 45
|
||||||
perimeters = 2
|
perimeters = 2
|
||||||
post_process =
|
post_process =
|
||||||
print_settings_id =
|
print_settings_id =
|
||||||
raft_layers = 0
|
raft_layers = 0
|
||||||
resolution = 0
|
resolution = 0
|
||||||
seam_position = nearest
|
seam_position = nearest
|
||||||
single_extruder_multi_material_priming = 1
|
single_extruder_multi_material_priming = 0
|
||||||
skirt_distance = 2
|
skirt_distance = 3
|
||||||
skirt_height = 1
|
skirt_height = 2
|
||||||
skirts = 1
|
skirts = 1
|
||||||
|
slice_closing_radius = 0.049
|
||||||
small_perimeter_speed = 20
|
small_perimeter_speed = 20
|
||||||
solid_infill_below_area = 15
|
solid_infill_below_area = 70
|
||||||
solid_infill_every_layers = 0
|
solid_infill_every_layers = 0
|
||||||
solid_infill_extruder = 1
|
solid_infill_extruder = 1
|
||||||
solid_infill_extrusion_width = 0.4
|
solid_infill_extrusion_width = 0.45
|
||||||
solid_infill_speed = 50
|
solid_infill_speed = 60
|
||||||
spiral_vase = 0
|
spiral_vase = 0
|
||||||
standby_temperature_delta = -5
|
standby_temperature_delta = -5
|
||||||
support_material = 0
|
support_material = 0
|
||||||
support_material_angle = 0
|
support_material_angle = 40
|
||||||
support_material_auto = 1
|
support_material_auto = 1
|
||||||
support_material_buildplate_only = 0
|
support_material_buildplate_only = 0
|
||||||
support_material_contact_distance = 0.15
|
support_material_contact_distance = 0.1
|
||||||
support_material_enforce_layers = 0
|
support_material_enforce_layers = 0
|
||||||
support_material_extruder = 1
|
support_material_extruder = 0
|
||||||
support_material_extrusion_width = 0
|
support_material_extrusion_width = 0.35
|
||||||
support_material_interface_contact_loops = 0
|
support_material_interface_contact_loops = 0
|
||||||
support_material_interface_extruder = 1
|
support_material_interface_extruder = 0
|
||||||
support_material_interface_layers = 3
|
support_material_interface_layers = 4
|
||||||
support_material_interface_spacing = 0
|
support_material_interface_spacing = 0.4
|
||||||
support_material_interface_speed = 100%
|
support_material_interface_speed = 100%
|
||||||
support_material_pattern = rectilinear
|
support_material_pattern = rectilinear
|
||||||
support_material_spacing = 2.5
|
support_material_spacing = 2
|
||||||
support_material_speed = 50
|
support_material_speed = 50
|
||||||
support_material_synchronize_layers = 0
|
support_material_synchronize_layers = 0
|
||||||
support_material_threshold = 55
|
support_material_threshold = 55
|
||||||
support_material_with_sheath = 1
|
support_material_with_sheath = 0
|
||||||
support_material_xy_spacing = 100%
|
support_material_xy_spacing = 0.6
|
||||||
thin_walls = 0
|
thin_walls = 0
|
||||||
threads = 4
|
threads = 12
|
||||||
|
top_fill_pattern = monotonic
|
||||||
top_infill_extrusion_width = 0.4
|
top_infill_extrusion_width = 0.4
|
||||||
top_solid_infill_speed = 30
|
top_solid_infill_speed = 40
|
||||||
top_solid_layers = 5
|
top_solid_layers = 5
|
||||||
|
top_solid_min_thickness = 0.7
|
||||||
travel_speed = 150
|
travel_speed = 150
|
||||||
wipe_tower = 0
|
wipe_tower = 0
|
||||||
wipe_tower_bridging = 10
|
wipe_tower_bridging = 10
|
||||||
|
wipe_tower_no_sparse_layers = 0
|
||||||
wipe_tower_rotation_angle = 0
|
wipe_tower_rotation_angle = 0
|
||||||
wipe_tower_width = 60
|
wipe_tower_width = 60
|
||||||
wipe_tower_x = 180
|
wipe_tower_x = 180
|
||||||
wipe_tower_y = 140
|
wipe_tower_y = 140
|
||||||
xy_size_compensation = 0
|
xy_size_compensation = 0
|
||||||
|
|
||||||
|
[print:DeltiQ 0.10mm Normal]
|
||||||
|
inherits = DeltiQ 0.20mm Normal
|
||||||
|
bottom_solid_layers = 7
|
||||||
|
bottom_solid_min_thickness = 0.7
|
||||||
|
bridge_flow_ratio = 0.7
|
||||||
|
bridge_speed = 30
|
||||||
|
ensure_vertical_shell_thickness = 1
|
||||||
|
layer_height = 0.1
|
||||||
|
first_layer_height = 0.2
|
||||||
|
top_solid_layers = 9
|
||||||
|
top_solid_min_thickness = 0.7
|
||||||
|
top_infill_extrusion_width = 0.4
|
||||||
|
fill_pattern = grid
|
||||||
|
fill_density = 20%
|
||||||
|
|
||||||
|
[print:DeltiQ 0.15mm Normal]
|
||||||
|
inherits = DeltiQ 0.20mm Normal
|
||||||
|
bottom_solid_layers = 5
|
||||||
|
bottom_solid_min_thickness = 0.7
|
||||||
|
bridge_flow_ratio = 0.7
|
||||||
|
bridge_speed = 30
|
||||||
|
ensure_vertical_shell_thickness = 1
|
||||||
|
layer_height = 0.15
|
||||||
|
first_layer_height = 0.2
|
||||||
|
top_solid_layers = 7
|
||||||
|
top_solid_min_thickness = 0.7
|
||||||
|
fill_pattern = grid
|
||||||
|
fill_density = 20%
|
||||||
|
|
||||||
|
[print:DeltiQ 0.20mm Vase]
|
||||||
|
inherits = DeltiQ 0.20mm Normal
|
||||||
|
perimeters = 1
|
||||||
|
top_solid_layers = 0
|
||||||
|
fill_density = 0
|
||||||
|
support_material = 0
|
||||||
|
spiral_vase = 1
|
||||||
|
ensure_vertical_shell_thickness = 1
|
||||||
|
thin_walls = 0
|
||||||
|
|
||||||
|
[print:DeltiQ 0.20mm FLEX]
|
||||||
|
inherits = DeltiQ 0.20mm Normal
|
||||||
|
avoid_crossing_perimeters = 0
|
||||||
|
bridge_flow_ratio = 0.90
|
||||||
|
compatible_printers_condition = printer_notes=~/.*PRINTER_VENDOR_TRILAB.*/ and printer_notes=~/.*FLEXPRINT.*/
|
||||||
|
only_retract_when_crossing_perimeters = 1
|
||||||
|
overhangs = 0
|
||||||
|
seam_position = nearest
|
||||||
|
thin_walls = 0
|
||||||
|
bridge_speed = 20
|
||||||
|
external_perimeter_speed = 20
|
||||||
|
first_layer_speed = 20
|
||||||
|
gap_fill_speed = 25
|
||||||
|
infill_speed = 30
|
||||||
|
perimeter_speed = 25
|
||||||
|
small_perimeter_speed = 20
|
||||||
|
solid_infill_speed = 30
|
||||||
|
support_material_contact_distance = 0.3
|
||||||
|
top_solid_infill_speed = 20
|
||||||
|
top_fill_pattern = rectilinear
|
||||||
|
fill_pattern = grid
|
||||||
|
fill_density = 25%
|
||||||
|
travel_speed = 200
|
||||||
|
max_print_speed = 30
|
||||||
|
complete_objects = 1
|
||||||
|
|
||||||
|
|
||||||
[filament:*DeltiQ common*]
|
[filament:*DeltiQ common*]
|
||||||
bed_temperature = 90
|
compatible_printers =
|
||||||
bridge_fan_speed = 50
|
compatible_printers_condition = printer_notes=~/.*PRINTER_VENDOR_TRILAB.*/ and printer_notes=~/.*PRINTER_FAMILY_DQ.*/ and !(printer_notes=~/.*FLEXPRINT.*/)
|
||||||
compatible_printers_condition = printer_notes=~/.*TRILAB.*/
|
|
||||||
cooling = 1
|
|
||||||
filament_vendor = Generic
|
|
||||||
disable_fan_first_layers = 3
|
disable_fan_first_layers = 3
|
||||||
end_filament_gcode = ""
|
|
||||||
extrusion_multiplier = 1
|
extrusion_multiplier = 1
|
||||||
fan_always_on = 1
|
filament_colour = #FF0000
|
||||||
fan_below_layer_time = 60
|
|
||||||
filament_colour = #FF3232
|
|
||||||
filament_cooling_final_speed = 3.4
|
|
||||||
filament_cooling_initial_speed = 2.2
|
|
||||||
filament_cooling_moves = 4
|
|
||||||
filament_cost = 0
|
|
||||||
filament_density = 1.25
|
|
||||||
filament_diameter = 1.75
|
filament_diameter = 1.75
|
||||||
filament_load_time = 0
|
|
||||||
filament_loading_speed = 28
|
|
||||||
filament_loading_speed_start = 3
|
|
||||||
filament_max_volumetric_speed = 10
|
|
||||||
filament_minimal_purge_on_wipe_tower = 15
|
filament_minimal_purge_on_wipe_tower = 15
|
||||||
filament_notes = ""
|
filament_notes = ""
|
||||||
filament_ramming_parameters = "120 100 6.6 6.8 7.2 7.6 7.9 8.2 8.7 9.4 9.9 10.0| 0.05 6.6 0.45 6.8 0.95 7.8 1.45 8.3 1.95 9.7 2.45 10 2.95 7.6 3.45 7.6 3.95 7.6 4.45 7.6 4.95 7.6"
|
filament_ramming_parameters = "120 100 6.6 6.8 7.2 7.6 7.9 8.2 8.7 9.4 9.9 10.0| 0.05 6.6 0.45 6.8 0.95 7.8 1.45 8.3 1.95 9.7 2.45 10 2.95 7.6 3.45 7.6 3.95 7.6 4.45 7.6 4.95 7.6"
|
||||||
filament_settings_id = ""
|
filament_settings_id = ""
|
||||||
filament_soluble = 0
|
filament_soluble = 0
|
||||||
filament_toolchange_delay = 0
|
filament_toolchange_delay = 0
|
||||||
|
start_filament_gcode = "; FILAMENT_START_GCODE"
|
||||||
|
end_filament_gcode = "; FILAMENT_END_GCODE"
|
||||||
|
|
||||||
|
[filament:DeltiQ PET]
|
||||||
|
inherits = *DeltiQ common*
|
||||||
|
bed_temperature = 90
|
||||||
|
bridge_fan_speed = 50
|
||||||
|
cooling = 1
|
||||||
|
fan_always_on = 1
|
||||||
|
fan_below_layer_time = 20
|
||||||
|
filament_vendor = DevilDesign
|
||||||
|
filament_cost = 480
|
||||||
|
filament_density = 1.27
|
||||||
|
filament_deretract_speed = 25
|
||||||
|
filament_max_volumetric_speed = 8
|
||||||
|
filament_retract_before_travel = 2
|
||||||
|
filament_retract_before_wipe = 70%
|
||||||
|
filament_retract_layer_change = 1
|
||||||
|
filament_retract_length = 4.1
|
||||||
|
filament_retract_lift = 0.2
|
||||||
|
filament_retract_speed = 45
|
||||||
filament_type = PET
|
filament_type = PET
|
||||||
filament_unload_time = 0
|
filament_wipe = 1
|
||||||
filament_unloading_speed = 90
|
|
||||||
filament_unloading_speed_start = 100
|
|
||||||
first_layer_bed_temperature = 90
|
first_layer_bed_temperature = 90
|
||||||
first_layer_temperature = 240
|
first_layer_temperature = 240
|
||||||
max_fan_speed = 50
|
max_fan_speed = 50
|
||||||
min_fan_speed = 30
|
min_fan_speed = 30
|
||||||
min_print_speed = 10
|
min_print_speed = 10
|
||||||
slowdown_below_layer_time = 5
|
slowdown_below_layer_time = 5
|
||||||
start_filament_gcode = ""
|
|
||||||
temperature = 245
|
temperature = 245
|
||||||
|
|
||||||
[filament:DeltiQ PET]
|
|
||||||
inherits = *DeltiQ common*
|
|
||||||
|
|
||||||
[filament:DeltiQ PLA]
|
[filament:DeltiQ PLA]
|
||||||
inherits = *DeltiQ common*
|
inherits = *DeltiQ common*
|
||||||
bed_temperature = 55
|
bed_temperature = 55
|
||||||
bridge_fan_speed = 100
|
bridge_fan_speed = 100
|
||||||
disable_fan_first_layers = 1
|
cooling = 1
|
||||||
|
fan_always_on = 1
|
||||||
|
fan_below_layer_time = 100
|
||||||
|
filament_vendor = Fillamentum
|
||||||
|
filament_cost = 767
|
||||||
|
filament_density = 1.24
|
||||||
|
filament_max_volumetric_speed = 8
|
||||||
|
filament_retract_before_travel = 2
|
||||||
|
filament_retract_before_wipe = 90%
|
||||||
|
filament_retract_layer_change = 1
|
||||||
|
filament_retract_length = 4.0
|
||||||
|
filament_retract_lift = 0.2
|
||||||
|
filament_retract_speed = 30
|
||||||
filament_type = PLA
|
filament_type = PLA
|
||||||
|
filament_wipe = 1
|
||||||
first_layer_bed_temperature = 55
|
first_layer_bed_temperature = 55
|
||||||
first_layer_temperature = 215
|
first_layer_temperature = 220
|
||||||
max_fan_speed = 100
|
max_fan_speed = 100
|
||||||
min_fan_speed = 85
|
min_fan_speed = 100
|
||||||
|
min_print_speed = 10
|
||||||
slowdown_below_layer_time = 4
|
slowdown_below_layer_time = 4
|
||||||
temperature = 210
|
temperature = 215
|
||||||
|
|
||||||
[filament:DeltiQ ABS]
|
[filament:DeltiQ ABS]
|
||||||
inherits = *DeltiQ common*
|
inherits = *DeltiQ common*
|
||||||
bed_temperature = 100
|
bed_temperature = 100
|
||||||
bridge_fan_speed = 20
|
bridge_fan_speed = 25
|
||||||
filament_density = 1.04
|
cooling = 1
|
||||||
|
fan_always_on = 1
|
||||||
|
fan_below_layer_time = 20
|
||||||
|
filament_vendor = Fillamentum
|
||||||
|
filament_cost = 774
|
||||||
|
filament_density = 1.08
|
||||||
|
filament_max_volumetric_speed = 4
|
||||||
|
filament_retract_before_travel = 3
|
||||||
|
filament_retract_before_wipe = 70%
|
||||||
|
filament_retract_layer_change = 1
|
||||||
|
filament_retract_length = 4.1
|
||||||
|
filament_retract_lift = 0.2
|
||||||
|
filament_retract_speed = 25
|
||||||
filament_type = ABS
|
filament_type = ABS
|
||||||
|
filament_wipe = 1
|
||||||
first_layer_bed_temperature = 100
|
first_layer_bed_temperature = 100
|
||||||
first_layer_temperature = 255
|
first_layer_temperature = 255
|
||||||
max_fan_speed = 20
|
max_fan_speed = 15
|
||||||
min_fan_speed = 5
|
min_fan_speed = 5
|
||||||
|
min_print_speed = 10
|
||||||
slowdown_below_layer_time = 15
|
slowdown_below_layer_time = 15
|
||||||
temperature = 255
|
temperature = 255
|
||||||
|
|
||||||
|
@ -237,11 +385,160 @@ temperature = 265
|
||||||
|
|
||||||
[filament:DeltiQ CPE]
|
[filament:DeltiQ CPE]
|
||||||
inherits = *DeltiQ common*
|
inherits = *DeltiQ common*
|
||||||
bed_temperature = 85
|
bed_temperature = 90
|
||||||
|
bridge_fan_speed = 50
|
||||||
|
cooling = 1
|
||||||
|
fan_always_on = 1
|
||||||
|
fan_below_layer_time = 20
|
||||||
|
filament_vendor = Fillamentum
|
||||||
|
filament_cost = 1214
|
||||||
|
filament_density = 1.25
|
||||||
|
filament_deretract_speed = 25
|
||||||
|
filament_max_volumetric_speed = 8
|
||||||
|
filament_retract_before_travel = 2
|
||||||
|
filament_retract_before_wipe = 70%
|
||||||
|
filament_retract_layer_change = 0
|
||||||
|
filament_retract_length = 4.3
|
||||||
|
filament_retract_lift = 0.2
|
||||||
|
filament_retract_speed = 45
|
||||||
filament_type = CPE
|
filament_type = CPE
|
||||||
first_layer_bed_temperature = 85
|
filament_wipe = 1
|
||||||
first_layer_temperature = 260
|
first_layer_bed_temperature = 90
|
||||||
temperature = 265
|
first_layer_temperature = 265
|
||||||
|
max_fan_speed = 50
|
||||||
|
min_fan_speed = 30
|
||||||
|
min_print_speed = 10
|
||||||
|
slowdown_below_layer_time = 5
|
||||||
|
temperature = 260
|
||||||
|
|
||||||
|
|
||||||
|
[filament:DeltiQ FlexPrint 2 PET]
|
||||||
|
inherits = DeltiQ PET
|
||||||
|
compatible_printers_condition = printer_notes=~/.*PRINTER_VENDOR_TRILAB.*/ and printer_notes=~/.*PRINTER_FAMILY_DQ.*/ and printer_notes=~/.*FLEXPRINT2.*/
|
||||||
|
filament_retract_length = 1.4
|
||||||
|
filament_retract_speed = 35
|
||||||
|
filament_retract_before_wipe = 0%
|
||||||
|
|
||||||
|
[filament:DeltiQ FlexPrint 2 PLA]
|
||||||
|
inherits = DeltiQ PLA
|
||||||
|
compatible_printers_condition = printer_notes=~/.*PRINTER_VENDOR_TRILAB.*/ and printer_notes=~/.*PRINTER_FAMILY_DQ.*/ and printer_notes=~/.*FLEXPRINT2.*/
|
||||||
|
filament_retract_length = 1.2
|
||||||
|
filament_retract_speed = 28
|
||||||
|
|
||||||
|
[filament:DeltiQ FlexPrint 2 ABS]
|
||||||
|
inherits = DeltiQ ABS
|
||||||
|
compatible_printers_condition = printer_notes=~/.*PRINTER_VENDOR_TRILAB.*/ and printer_notes=~/.*PRINTER_FAMILY_DQ.*/ and printer_notes=~/.*FLEXPRINT2.*/
|
||||||
|
filament_retract_length = 0.8
|
||||||
|
filament_retract_speed = 25
|
||||||
|
|
||||||
|
[filament:DeltiQ FlexPrint 2 ASA]
|
||||||
|
inherits = DeltiQ ASA
|
||||||
|
compatible_printers_condition = printer_notes=~/.*PRINTER_VENDOR_TRILAB.*/ and printer_notes=~/.*PRINTER_FAMILY_DQ.*/ and printer_notes=~/.*FLEXPRINT2.*/
|
||||||
|
|
||||||
|
[filament:DeltiQ FlexPrint 2 CPE]
|
||||||
|
inherits = DeltiQ CPE
|
||||||
|
compatible_printers_condition = printer_notes=~/.*PRINTER_VENDOR_TRILAB.*/ and printer_notes=~/.*PRINTER_FAMILY_DQ.*/ and printer_notes=~/.*FLEXPRINT2.*/
|
||||||
|
filament_retract_length = 0.8
|
||||||
|
filament_retract_speed = 35
|
||||||
|
filament_deretract_speed = 0
|
||||||
|
filament_retract_before_wipe = 0%
|
||||||
|
|
||||||
|
[filament:DeltiQ FlexPrint 2 FLEX]
|
||||||
|
inherits = *DeltiQ common*
|
||||||
|
compatible_printers_condition = printer_notes=~/.*PRINTER_VENDOR_TRILAB.*/ and printer_notes=~/.*PRINTER_FAMILY_DQ.*/ and printer_notes=~/.*FLEXPRINT2.*/
|
||||||
|
bed_temperature = 50
|
||||||
|
bridge_fan_speed = 80
|
||||||
|
cooling = 1
|
||||||
|
disable_fan_first_layers = 1
|
||||||
|
extrusion_multiplier = 1.07
|
||||||
|
fan_always_on = 1
|
||||||
|
fan_below_layer_time = 20
|
||||||
|
filament_vendor = Fillamentum
|
||||||
|
filament_cost = 1870
|
||||||
|
filament_density = 1.22
|
||||||
|
filament_deretract_speed = 0
|
||||||
|
filament_max_volumetric_speed = 2.9
|
||||||
|
filament_retract_before_travel = 1
|
||||||
|
filament_retract_before_wipe = 70%
|
||||||
|
filament_retract_layer_change = 0
|
||||||
|
filament_retract_length = 1.6
|
||||||
|
filament_retract_lift = 0.2
|
||||||
|
filament_retract_restart_extra = nil
|
||||||
|
filament_retract_speed = 20
|
||||||
|
filament_type = FLEX
|
||||||
|
filament_wipe = 1
|
||||||
|
first_layer_bed_temperature = 50
|
||||||
|
first_layer_temperature = 225
|
||||||
|
max_fan_speed = 50
|
||||||
|
min_fan_speed = 30
|
||||||
|
min_print_speed = 5
|
||||||
|
slowdown_below_layer_time = 4
|
||||||
|
temperature = 225
|
||||||
|
|
||||||
|
[filament:DeltiQ FlexPrint 2 FLEX Smartfil]
|
||||||
|
inherits = *DeltiQ common*
|
||||||
|
compatible_printers_condition = printer_notes=~/.*PRINTER_VENDOR_TRILAB.*/ and printer_notes=~/.*PRINTER_FAMILY_DQ.*/ and printer_notes=~/.*FLEXPRINT2.*/
|
||||||
|
bed_temperature = 50
|
||||||
|
bridge_fan_speed = 80
|
||||||
|
cooling = 0
|
||||||
|
disable_fan_first_layers = 3
|
||||||
|
extrusion_multiplier = 1.07
|
||||||
|
fan_always_on = 1
|
||||||
|
fan_below_layer_time = 20
|
||||||
|
filament_vendor = Smart Materials 3D
|
||||||
|
filament_cost = 1209
|
||||||
|
filament_density = 1.21
|
||||||
|
filament_deretract_speed = 0
|
||||||
|
filament_max_volumetric_speed = 2.5
|
||||||
|
filament_retract_before_travel = 1
|
||||||
|
filament_retract_before_wipe = nil
|
||||||
|
filament_retract_layer_change = 0
|
||||||
|
filament_retract_length = 1.2
|
||||||
|
filament_retract_lift = 0.2
|
||||||
|
filament_retract_restart_extra = nil
|
||||||
|
filament_retract_speed = 20
|
||||||
|
filament_type = FLEX
|
||||||
|
filament_wipe = 0
|
||||||
|
first_layer_bed_temperature = 50
|
||||||
|
first_layer_temperature = 240
|
||||||
|
max_fan_speed = 50
|
||||||
|
min_fan_speed = 50
|
||||||
|
min_print_speed = 10
|
||||||
|
slowdown_below_layer_time = 4
|
||||||
|
temperature = 240
|
||||||
|
|
||||||
|
|
||||||
|
[filament:DeltiQ FlexPrint PET]
|
||||||
|
inherits = DeltiQ PET
|
||||||
|
compatible_printers_condition = printer_notes=~/.*PRINTER_VENDOR_TRILAB.*/ and printer_notes=~/.*PRINTER_FAMILY_DQ.*/ and printer_notes=~/.*FLEXPRINT1.*/
|
||||||
|
filament_retract_length = 0.7
|
||||||
|
filament_retract_speed = 25
|
||||||
|
|
||||||
|
[filament:DeltiQ FlexPrint PLA]
|
||||||
|
inherits = DeltiQ PLA
|
||||||
|
compatible_printers_condition = printer_notes=~/.*PRINTER_VENDOR_TRILAB.*/ and printer_notes=~/.*PRINTER_FAMILY_DQ.*/ and printer_notes=~/.*FLEXPRINT1.*/
|
||||||
|
filament_retract_length = 0.7
|
||||||
|
filament_retract_speed = 28
|
||||||
|
|
||||||
|
[filament:DeltiQ FlexPrint ABS]
|
||||||
|
inherits = DeltiQ ABS
|
||||||
|
compatible_printers_condition = printer_notes=~/.*PRINTER_VENDOR_TRILAB.*/ and printer_notes=~/.*PRINTER_FAMILY_DQ.*/ and printer_notes=~/.*FLEXPRINT1.*/
|
||||||
|
filament_retract_length = 0.7
|
||||||
|
filament_retract_speed = 25
|
||||||
|
|
||||||
|
[filament:DeltiQ FlexPrint ASA]
|
||||||
|
inherits = DeltiQ ASA
|
||||||
|
compatible_printers_condition = printer_notes=~/.*PRINTER_VENDOR_TRILAB.*/ and printer_notes=~/.*PRINTER_FAMILY_DQ.*/ and printer_notes=~/.*FLEXPRINT1.*/
|
||||||
|
filament_retract_length = 0.7
|
||||||
|
filament_retract_speed = 25
|
||||||
|
|
||||||
|
[filament:DeltiQ FlexPrint CPE]
|
||||||
|
inherits = DeltiQ CPE
|
||||||
|
compatible_printers_condition = printer_notes=~/.*PRINTER_VENDOR_TRILAB.*/ and printer_notes=~/.*PRINTER_FAMILY_DQ.*/ and printer_notes=~/.*FLEXPRINT1.*/
|
||||||
|
filament_retract_length = 0.7
|
||||||
|
filament_retract_speed = 25
|
||||||
|
filament_deretract_speed = 0
|
||||||
|
filament_retract_before_wipe = 0%
|
||||||
|
|
||||||
|
|
||||||
[printer:*DeltiQ*]
|
[printer:*DeltiQ*]
|
||||||
|
@ -251,63 +548,116 @@ before_layer_gcode = ;BEFORE_LAYER_CHANGE\nG92 E0\n;[layer_z]
|
||||||
between_objects_gcode =
|
between_objects_gcode =
|
||||||
cooling_tube_length = 5
|
cooling_tube_length = 5
|
||||||
cooling_tube_retraction = 91.5
|
cooling_tube_retraction = 91.5
|
||||||
default_filament_profile = ""
|
default_filament_profile = "DeltiQ PLA"
|
||||||
default_print_profile =
|
default_print_profile = DeltiQ 0.20mm Normal
|
||||||
deretract_speed = 25
|
deretract_speed = 0
|
||||||
end_gcode = ;END\nM104 S0 ; Turn extruder heater off\nM140 S0 ; Turn bed heater off\nG28 ; Home all axes\nM84 S5 ; Stop all axes and hold inidle for 5 seconds\nG90 ; Absolute positioning
|
end_gcode = ;END\nM104 S0 ; Turn extruder heater off\nM140 S0 ; Turn bed heater off\nG28 ; Home all axes\nM84 S5 ; Stop all axes and hold inidle for 5 seconds\nG90 ; Absolute positioning
|
||||||
extra_loading_move = -2
|
extra_loading_move = -2
|
||||||
extruder_colour = ""
|
extruder_colour = #FF0000
|
||||||
extruder_offset = 0x0
|
extruder_offset = 0x0
|
||||||
gcode_flavor = repetier
|
gcode_flavor = repetier
|
||||||
|
host_type = octoprint
|
||||||
layer_gcode = ;AFTER_LAYER_CHANGE\nM117 layer [layer_num] at [layer_z]mm\n;[layer_z]\n
|
layer_gcode = ;AFTER_LAYER_CHANGE\nM117 layer [layer_num] at [layer_z]mm\n;[layer_z]\n
|
||||||
machine_max_acceleration_e = 10000,5000
|
|
||||||
machine_max_acceleration_extruding = 1500,1250
|
|
||||||
machine_max_acceleration_retracting = 1500,1250
|
|
||||||
machine_max_acceleration_x = 9000,1000
|
|
||||||
machine_max_acceleration_y = 9000,1000
|
|
||||||
machine_max_acceleration_z = 500,200
|
|
||||||
machine_max_feedrate_e = 120,120
|
|
||||||
machine_max_feedrate_x = 500,200
|
|
||||||
machine_max_feedrate_y = 500,200
|
|
||||||
machine_max_feedrate_z = 12,12
|
|
||||||
machine_max_jerk_e = 2.5,2.5
|
|
||||||
machine_max_jerk_x = 10,10
|
|
||||||
machine_max_jerk_y = 10,10
|
|
||||||
machine_max_jerk_z = 0.2,0.4
|
|
||||||
machine_min_extruding_rate = 0,0
|
|
||||||
machine_min_travel_rate = 0,0
|
|
||||||
max_layer_height = 0.25
|
max_layer_height = 0.25
|
||||||
max_print_height = 320
|
max_print_height = 320
|
||||||
min_layer_height = 0.15
|
min_layer_height = 0.15
|
||||||
nozzle_diameter = 0.4
|
nozzle_diameter = 0.4
|
||||||
parking_pos_retraction = 92
|
parking_pos_retraction = 92
|
||||||
|
print_host =
|
||||||
printer_model =
|
printer_model =
|
||||||
printer_notes = TRILAB
|
printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_TRILAB\nPRINTER_FAMILY_DQ\nPRINTER_MODEL_DQL
|
||||||
printer_settings_id =
|
printer_settings_id =
|
||||||
printer_variant =
|
printer_variant =
|
||||||
printer_vendor =
|
printer_vendor = TriLAB Group s.r.o.
|
||||||
|
printhost_apikey =
|
||||||
|
printhost_cafile =
|
||||||
remaining_times = 0
|
remaining_times = 0
|
||||||
retract_before_travel = 2
|
retract_before_travel = 3
|
||||||
retract_before_wipe = 100%
|
retract_before_wipe = 100%
|
||||||
retract_layer_change = 1
|
retract_layer_change = 1
|
||||||
retract_length = 4.1
|
retract_length = 4.0
|
||||||
retract_length_toolchange = 10
|
retract_length_toolchange = 10
|
||||||
retract_lift = 0.3
|
retract_lift = 0.2
|
||||||
retract_lift_above = 0
|
retract_lift_above = 0
|
||||||
retract_lift_below = 0
|
retract_lift_below = 319
|
||||||
retract_restart_extra = 0
|
retract_restart_extra = 0
|
||||||
retract_restart_extra_toolchange = 0
|
retract_restart_extra_toolchange = 0
|
||||||
retract_speed = 33
|
retract_speed = 30
|
||||||
silent_mode = 1
|
serial_port =
|
||||||
|
serial_speed = 250000
|
||||||
|
silent_mode = 0
|
||||||
single_extruder_multi_material = 0
|
single_extruder_multi_material = 0
|
||||||
start_gcode = ;START\nM220 S100 ; Set feedmultiply back to 100percent\nG90 ; Absolute positioning\nM83 ; Relative extruder\nM107 ; Layer fan OFF\nM190 S[first_layer_bed_temperature] ; Set bed temperature and wait\nM104 S[first_layer_temperature] ; Set extruder temperature\nG28 ; Home all axes\nG33 ; auto leveling rutine\nG1 X-62 Y-108 Z0.3 F6000 ; Go to purge position start\nG92 E0 ; Zero extruder\nM109 S[first_layer_temperature] ; Set and wait - hotend temperature\nG3 X62 Y-108 I62 J108 E10 F200 ; Go ARC to purge end\nG92 E0 ; Zero extruder
|
start_gcode = ;START\nM220 S100 ; Set feedmultiply back to 100percent\nG90 ; Absolute positioning\nM83 ; Relative extruder\nM107 ; Layer fan OFF\nM190 S[first_layer_bed_temperature] ; Set bed temperature and wait\nM104 S[first_layer_temperature] ; Set extruder temperature\nG28 ; Home all axes\nG33 ; auto leveling rutine\nG1 X-62 Y-108 Z0.3 F6000 ; Go to purge position start\nG92 E0 ; Zero extruder\nM109 S[first_layer_temperature] ; Set and wait - hotend temperature\nG3 X62 Y-108 I62 J108 E10 F200 ; Go ARC to purge end\nG92 E0 ; Zero extruder
|
||||||
|
thumbnails =
|
||||||
toolchange_gcode =
|
toolchange_gcode =
|
||||||
use_firmware_retraction = 0
|
use_firmware_retraction = 0
|
||||||
use_relative_e_distances = 1
|
use_relative_e_distances = 1
|
||||||
use_volumetric_e = 0
|
use_volumetric_e = 0
|
||||||
variable_layer_height = 0
|
variable_layer_height = 0
|
||||||
wipe = 0
|
wipe = 1
|
||||||
z_offset = 0
|
z_offset = 0
|
||||||
|
|
||||||
|
[printer:*DeltiQ 2*]
|
||||||
|
inherits = *DeltiQ*
|
||||||
|
before_layer_gcode = ; BEFORE_LAYER_CHANGE\n;[layer_z]\nG92 E0\n
|
||||||
|
end_gcode = ; END_GCODE\n\nM140 S0 ; Turn off bed\n\nG28 ; Home\n\nM104 S0 ; Turn off extruder\nM107 ; Turn off fan\n\nG90 ; Absolute positioning\nM220 S100 ; Feedmultiply back to 100percent\n\nM84 S5; Disable motors
|
||||||
|
gcode_flavor = reprap
|
||||||
|
layer_gcode = ; AFTER_LAYER_CHANGE\n;[layer_z]
|
||||||
|
pause_print_gcode = M0
|
||||||
|
start_gcode = ; START_GCODE\n\nM220 S100 ; Set feedmultiply back to 100percent\n\nT0 ; Select Titan extruder\n\nG90 ; Absolute positioning\nM83; Relative Extruder\n\nM190 S[first_layer_bed_temperature] ; Set and wait - bed temperature\nM104 S[first_layer_temperature]\n\nG28 ; Home all axes\nG32 ; Probe Z and calculate Z plane\n\nG29 ; Mesh bed probe\n\nG1009 ; Go ARC to purge end\n\nG92 E0 ; Zero extruder
|
||||||
|
printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_TRILAB\nPRINTER_FAMILY_DQ\nPRINTER_MODEL_DQ2
|
||||||
|
|
||||||
|
[printer:*DeltiQ 2 FlexPrint*]
|
||||||
|
inherits = *DeltiQ 2*
|
||||||
|
start_gcode = ; START_GCODE\n\nM220 S100 ; Set feedmultiply back to 100percent\n\nT1 ; Select FlexPrint extruder\n\nG90 ; Absolute positioning\nM83; Relative Extruder\n\nM190 S[first_layer_bed_temperature] ; Set and wait - bed temperature\nM104 S[first_layer_temperature]\n\nG28 ; Home all axes\nG32 ; Probe Z and calculate Z plane\n\nG29 ; Mesh bed probe\n\nG1009 ; Go ARC to purge end\n\nG92 E0 ; Zero extruder
|
||||||
|
default_print_profile = DeltiQ 0.20mm FLEX
|
||||||
|
default_filament_profile = "DeltiQ FlexPrint 2 FLEX"
|
||||||
|
retract_length = 0.7
|
||||||
|
retract_speed = 25
|
||||||
|
printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_TRILAB\nPRINTER_FAMILY_DQ\nPRINTER_MODEL_DQ2+FP\nFLEXPRINT1
|
||||||
|
|
||||||
|
[printer:*DeltiQ 2 FlexPrint 2*]
|
||||||
|
inherits = *DeltiQ 2 FlexPrint*
|
||||||
|
default_filament_profile = "DeltiQ FlexPrint 2 FLEX"
|
||||||
|
retract_length = 0.8
|
||||||
|
retract_speed = 25
|
||||||
|
printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_TRILAB\nPRINTER_FAMILY_DQ\nPRINTER_MODEL_DQ2+FP\nFLEXPRINT2
|
||||||
|
|
||||||
|
[printer:DeltiQ 2]
|
||||||
|
inherits = *DeltiQ 2*
|
||||||
|
printer_model = DQ2
|
||||||
|
printer_variant = 0.4
|
||||||
|
max_print_height = 320
|
||||||
|
|
||||||
|
[printer:DeltiQ 2 Plus]
|
||||||
|
inherits = *DeltiQ 2*
|
||||||
|
printer_model = DQ2P
|
||||||
|
printer_variant = 0.4
|
||||||
|
max_print_height = 500
|
||||||
|
|
||||||
|
[printer:DeltiQ 2 + FlexPrint 2]
|
||||||
|
inherits = *DeltiQ 2 FlexPrint 2*
|
||||||
|
printer_model = DQ2+FP2
|
||||||
|
printer_variant = 0.4
|
||||||
|
max_print_height = 320
|
||||||
|
|
||||||
|
[printer:DeltiQ 2 Plus + FlexPrint 2]
|
||||||
|
inherits = *DeltiQ 2 FlexPrint 2*
|
||||||
|
printer_model = DQ2P+FP2
|
||||||
|
printer_variant = 0.4
|
||||||
|
max_print_height = 500
|
||||||
|
|
||||||
|
[printer:DeltiQ 2 + FlexPrint]
|
||||||
|
inherits = *DeltiQ 2 FlexPrint*
|
||||||
|
printer_model = DQ2+FP
|
||||||
|
printer_variant = 0.4
|
||||||
|
max_print_height = 320
|
||||||
|
|
||||||
|
[printer:DeltiQ 2 Plus + FlexPrint]
|
||||||
|
inherits = *DeltiQ 2 FlexPrint*
|
||||||
|
printer_model = DQ2P+FP
|
||||||
|
printer_variant = 0.4
|
||||||
|
max_print_height = 500
|
||||||
|
|
||||||
[printer:DeltiQ L]
|
[printer:DeltiQ L]
|
||||||
inherits = *DeltiQ*
|
inherits = *DeltiQ*
|
||||||
|
@ -337,6 +687,6 @@ retract_length = 4.5
|
||||||
retract_speed = 35
|
retract_speed = 35
|
||||||
|
|
||||||
[presets]
|
[presets]
|
||||||
print = DeltiQ 0.2mm
|
print = DeltiQ 0.20mm Normal
|
||||||
printer = DeltiQ L
|
printer = DeltiQ 2
|
||||||
filament = DeltiQ PLA
|
filament = DeltiQ PLA
|
BIN
resources/profiles/TriLAB/DQ2+FP2_thumbnail.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
resources/profiles/TriLAB/DQ2+FP_thumbnail.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
resources/profiles/TriLAB/DQ2P+FP2_thumbnail.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
resources/profiles/TriLAB/DQ2P+FP_thumbnail.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
resources/profiles/TriLAB/DQ2P_thumbnail.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
resources/profiles/TriLAB/DQ2_thumbnail.png
Normal file
After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 34 KiB |
BIN
resources/profiles/TriLAB/dq2_bed.stl
Normal file
|
@ -1,11 +1,22 @@
|
||||||
#version 110
|
#version 110
|
||||||
|
|
||||||
|
uniform bool use_fixed_screen_size;
|
||||||
uniform float zoom;
|
uniform float zoom;
|
||||||
uniform float point_size;
|
uniform float point_size;
|
||||||
uniform float near_plane_height;
|
uniform float near_plane_height;
|
||||||
|
|
||||||
|
float fixed_screen_size()
|
||||||
|
{
|
||||||
|
return point_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
float fixed_world_size()
|
||||||
|
{
|
||||||
|
return (gl_Position.w == 1.0) ? zoom * near_plane_height * point_size : near_plane_height * point_size / gl_Position.w;
|
||||||
|
}
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
gl_Position = ftransform();
|
gl_Position = ftransform();
|
||||||
gl_PointSize = (gl_Position.w == 1.0) ? zoom * near_plane_height * point_size : near_plane_height * point_size / gl_Position.w;
|
gl_PointSize = use_fixed_screen_size ? fixed_screen_size() : fixed_world_size();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,22 @@
|
||||||
#version 120
|
#version 120
|
||||||
|
|
||||||
|
uniform bool use_fixed_screen_size;
|
||||||
uniform float zoom;
|
uniform float zoom;
|
||||||
uniform float point_size;
|
uniform float point_size;
|
||||||
uniform float near_plane_height;
|
uniform float near_plane_height;
|
||||||
|
|
||||||
|
float fixed_screen_size()
|
||||||
|
{
|
||||||
|
return point_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
float fixed_world_size()
|
||||||
|
{
|
||||||
|
return (gl_Position.w == 1.0) ? zoom * near_plane_height * point_size : near_plane_height * point_size / gl_Position.w;
|
||||||
|
}
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
gl_Position = ftransform();
|
gl_Position = ftransform();
|
||||||
gl_PointSize = (gl_Position.w == 1.0) ? zoom * near_plane_height * point_size : near_plane_height * point_size / gl_Position.w;
|
gl_PointSize = use_fixed_screen_size ? fixed_screen_size() : fixed_world_size();
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,7 +138,6 @@ int CLI::run(int argc, char **argv)
|
||||||
m_print_config.apply(config);
|
m_print_config.apply(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
// are we starting as gcodeviewer ?
|
// are we starting as gcodeviewer ?
|
||||||
for (auto it = m_actions.begin(); it != m_actions.end(); ++it) {
|
for (auto it = m_actions.begin(); it != m_actions.end(); ++it) {
|
||||||
if (*it == "gcodeviewer") {
|
if (*it == "gcodeviewer") {
|
||||||
|
@ -148,10 +147,8 @@ int CLI::run(int argc, char **argv)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
// Read input file(s) if any.
|
// Read input file(s) if any.
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
for (const std::string& file : m_input_files) {
|
for (const std::string& file : m_input_files) {
|
||||||
std::string ext = boost::filesystem::path(file).extension().string();
|
std::string ext = boost::filesystem::path(file).extension().string();
|
||||||
if (ext == ".gcode" || ext == ".g") {
|
if (ext == ".gcode" || ext == ".g") {
|
||||||
|
@ -162,7 +159,6 @@ int CLI::run(int argc, char **argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!start_as_gcodeviewer) {
|
if (!start_as_gcodeviewer) {
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
for (const std::string& file : m_input_files) {
|
for (const std::string& file : m_input_files) {
|
||||||
if (!boost::filesystem::exists(file)) {
|
if (!boost::filesystem::exists(file)) {
|
||||||
boost::nowide::cerr << "No such file: " << file << std::endl;
|
boost::nowide::cerr << "No such file: " << file << std::endl;
|
||||||
|
@ -195,9 +191,7 @@ int CLI::run(int argc, char **argv)
|
||||||
}
|
}
|
||||||
m_models.push_back(model);
|
m_models.push_back(model);
|
||||||
}
|
}
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
}
|
}
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
// Apply command line options to a more specific DynamicPrintConfig which provides normalize()
|
// Apply command line options to a more specific DynamicPrintConfig which provides normalize()
|
||||||
// (command line options override --load files)
|
// (command line options override --load files)
|
||||||
|
@ -504,11 +498,7 @@ int CLI::run(int argc, char **argv)
|
||||||
print->process();
|
print->process();
|
||||||
if (printer_technology == ptFFF) {
|
if (printer_technology == ptFFF) {
|
||||||
// The outfile is processed by a PlaceholderParser.
|
// The outfile is processed by a PlaceholderParser.
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
outfile = fff_print.export_gcode(outfile, nullptr, nullptr);
|
outfile = fff_print.export_gcode(outfile, nullptr, nullptr);
|
||||||
#else
|
|
||||||
outfile = fff_print.export_gcode(outfile, nullptr);
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
outfile_final = fff_print.print_statistics().finalize_output_path(outfile);
|
outfile_final = fff_print.print_statistics().finalize_output_path(outfile);
|
||||||
} else {
|
} else {
|
||||||
outfile = sla_print.output_filepath(outfile);
|
outfile = sla_print.output_filepath(outfile);
|
||||||
|
@ -559,11 +549,6 @@ int CLI::run(int argc, char **argv)
|
||||||
<< " (" << print.total_extruded_volume()/1000 << "cm3)" << std::endl;
|
<< " (" << print.total_extruded_volume()/1000 << "cm3)" << std::endl;
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
} else if (opt_key == "gcodeviewer") {
|
|
||||||
start_gui = true;
|
|
||||||
start_as_gcodeviewer = true;
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
} else {
|
} else {
|
||||||
boost::nowide::cerr << "error: option not supported yet: " << opt_key << std::endl;
|
boost::nowide::cerr << "error: option not supported yet: " << opt_key << std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -7,4 +7,6 @@ THIS DIRECTORY CONTAINS THE imgui-1.75 58b3e02 SOURCE DISTRIBUTION.
|
||||||
Customized with the following commits:
|
Customized with the following commits:
|
||||||
042880ba2df913916b2cc77f7bb677e07bfd2c58
|
042880ba2df913916b2cc77f7bb677e07bfd2c58
|
||||||
67c55c74901f1d337ef08f2090a87cfb4263bb0f
|
67c55c74901f1d337ef08f2090a87cfb4263bb0f
|
||||||
a94c952b40d36b1505fb77b87c0dd739e1034659
|
a94c952b40d36b1505fb77b87c0dd739e1034659
|
||||||
|
3ca3a544a87cc569b69351a77996c287763388a5
|
||||||
|
6586a46ea23e86d54d228c55c63ca55680d25d56
|
||||||
|
|
|
@ -113,14 +113,16 @@ namespace ImGui
|
||||||
const char PrinterSlaIconMarker = 0x6;
|
const char PrinterSlaIconMarker = 0x6;
|
||||||
const char FilamentIconMarker = 0x7;
|
const char FilamentIconMarker = 0x7;
|
||||||
const char MaterialIconMarker = 0x8;
|
const char MaterialIconMarker = 0x8;
|
||||||
const char CloseIconMarker = 0xB;
|
const char CloseNotifButton = 0xB;
|
||||||
const char CloseIconHoverMarker = 0xC;
|
const char CloseNotifHoverButton = 0xC;
|
||||||
// const char TimerDotMarker = 0xE;
|
// const char TimerDotMarker = 0xE;
|
||||||
// const char TimerDotEmptyMarker = 0xF;
|
// const char TimerDotEmptyMarker = 0xF;
|
||||||
const char MinimalizeMarker = 0xE;
|
const char MinimalizeButton = 0xE;
|
||||||
const char MinimalizeHoverMarker = 0xF;
|
const char MinimalizeHoverButton = 0xF;
|
||||||
const char WarningMarker = 0x10;
|
const char WarningMarker = 0x10;
|
||||||
const char ErrorMarker = 0x11;
|
const char ErrorMarker = 0x11;
|
||||||
|
const char EjectButton = 0x12;
|
||||||
|
const char EjectHoverButton = 0x13;
|
||||||
// void MyFunction(const char* name, const MyMatrix44& v);
|
// void MyFunction(const char* name, const MyMatrix44& v);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,9 +38,7 @@ void AppConfig::reset()
|
||||||
// Override missing or keys with their defaults.
|
// Override missing or keys with their defaults.
|
||||||
void AppConfig::set_defaults()
|
void AppConfig::set_defaults()
|
||||||
{
|
{
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
if (m_mode == EAppMode::Editor) {
|
if (m_mode == EAppMode::Editor) {
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
// Reset the empty fields to defaults.
|
// Reset the empty fields to defaults.
|
||||||
if (get("autocenter").empty())
|
if (get("autocenter").empty())
|
||||||
set("autocenter", "0");
|
set("autocenter", "0");
|
||||||
|
@ -57,6 +55,11 @@ void AppConfig::set_defaults()
|
||||||
if (get("show_incompatible_presets").empty())
|
if (get("show_incompatible_presets").empty())
|
||||||
set("show_incompatible_presets", "0");
|
set("show_incompatible_presets", "0");
|
||||||
|
|
||||||
|
if (get("show_drop_project_dialog").empty())
|
||||||
|
set("show_drop_project_dialog", "1");
|
||||||
|
if (get("drop_project_action").empty())
|
||||||
|
set("drop_project_action", "1");
|
||||||
|
|
||||||
if (get("version_check").empty())
|
if (get("version_check").empty())
|
||||||
set("version_check", "1");
|
set("version_check", "1");
|
||||||
if (get("preset_update").empty())
|
if (get("preset_update").empty())
|
||||||
|
@ -98,17 +101,6 @@ void AppConfig::set_defaults()
|
||||||
if (get("auto_toolbar_size").empty())
|
if (get("auto_toolbar_size").empty())
|
||||||
set("auto_toolbar_size", "100");
|
set("auto_toolbar_size", "100");
|
||||||
|
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
if (get("use_perspective_camera").empty())
|
|
||||||
set("use_perspective_camera", "1");
|
|
||||||
|
|
||||||
if (get("use_free_camera").empty())
|
|
||||||
set("use_free_camera", "0");
|
|
||||||
|
|
||||||
if (get("reverse_mouse_wheel_zoom").empty())
|
|
||||||
set("reverse_mouse_wheel_zoom", "0");
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
#if ENABLE_ENVIRONMENT_MAP
|
#if ENABLE_ENVIRONMENT_MAP
|
||||||
if (get("use_environment_map").empty())
|
if (get("use_environment_map").empty())
|
||||||
set("use_environment_map", "0");
|
set("use_environment_map", "0");
|
||||||
|
@ -116,7 +108,6 @@ void AppConfig::set_defaults()
|
||||||
|
|
||||||
if (get("use_inches").empty())
|
if (get("use_inches").empty())
|
||||||
set("use_inches", "0");
|
set("use_inches", "0");
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get("seq_top_layer_only").empty())
|
if (get("seq_top_layer_only").empty())
|
||||||
|
@ -130,7 +121,6 @@ void AppConfig::set_defaults()
|
||||||
|
|
||||||
if (get("reverse_mouse_wheel_zoom").empty())
|
if (get("reverse_mouse_wheel_zoom").empty())
|
||||||
set("reverse_mouse_wheel_zoom", "0");
|
set("reverse_mouse_wheel_zoom", "0");
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
if (get("show_splash_screen").empty())
|
if (get("show_splash_screen").empty())
|
||||||
set("show_splash_screen", "1");
|
set("show_splash_screen", "1");
|
||||||
|
@ -247,14 +237,10 @@ void AppConfig::save()
|
||||||
|
|
||||||
boost::nowide::ofstream c;
|
boost::nowide::ofstream c;
|
||||||
c.open(path_pid, std::ios::out | std::ios::trunc);
|
c.open(path_pid, std::ios::out | std::ios::trunc);
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
if (m_mode == EAppMode::Editor)
|
if (m_mode == EAppMode::Editor)
|
||||||
c << "# " << Slic3r::header_slic3r_generated() << std::endl;
|
c << "# " << Slic3r::header_slic3r_generated() << std::endl;
|
||||||
else
|
else
|
||||||
c << "# " << Slic3r::header_gcodeviewer_generated() << std::endl;
|
c << "# " << Slic3r::header_gcodeviewer_generated() << std::endl;
|
||||||
#else
|
|
||||||
c << "# " << Slic3r::header_slic3r_generated() << std::endl;
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
// Make sure the "no" category is written first.
|
// Make sure the "no" category is written first.
|
||||||
for (const std::pair<std::string, std::string> &kvp : m_storage[""])
|
for (const std::pair<std::string, std::string> &kvp : m_storage[""])
|
||||||
c << kvp.first << " = " << kvp.second << std::endl;
|
c << kvp.first << " = " << kvp.second << std::endl;
|
||||||
|
@ -455,15 +441,11 @@ void AppConfig::reset_selections()
|
||||||
|
|
||||||
std::string AppConfig::config_path()
|
std::string AppConfig::config_path()
|
||||||
{
|
{
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
std::string path = (m_mode == EAppMode::Editor) ?
|
std::string path = (m_mode == EAppMode::Editor) ?
|
||||||
(boost::filesystem::path(Slic3r::data_dir()) / (SLIC3R_APP_KEY ".ini")).make_preferred().string() :
|
(boost::filesystem::path(Slic3r::data_dir()) / (SLIC3R_APP_KEY ".ini")).make_preferred().string() :
|
||||||
(boost::filesystem::path(Slic3r::data_dir()) / (GCODEVIEWER_APP_KEY ".ini")).make_preferred().string();
|
(boost::filesystem::path(Slic3r::data_dir()) / (GCODEVIEWER_APP_KEY ".ini")).make_preferred().string();
|
||||||
|
|
||||||
return path;
|
return path;
|
||||||
#else
|
|
||||||
return (boost::filesystem::path(Slic3r::data_dir()) / (SLIC3R_APP_KEY ".ini")).make_preferred().string();
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string AppConfig::version_check_url() const
|
std::string AppConfig::version_check_url() const
|
||||||
|
@ -474,11 +456,7 @@ std::string AppConfig::version_check_url() const
|
||||||
|
|
||||||
bool AppConfig::exists()
|
bool AppConfig::exists()
|
||||||
{
|
{
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
return boost::filesystem::exists(config_path());
|
return boost::filesystem::exists(config_path());
|
||||||
#else
|
|
||||||
return boost::filesystem::exists(AppConfig::config_path());
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}; // namespace Slic3r
|
}; // namespace Slic3r
|
||||||
|
|
|
@ -15,7 +15,6 @@ namespace Slic3r {
|
||||||
class AppConfig
|
class AppConfig
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
enum class EAppMode : unsigned char
|
enum class EAppMode : unsigned char
|
||||||
{
|
{
|
||||||
Editor,
|
Editor,
|
||||||
|
@ -23,14 +22,9 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
explicit AppConfig(EAppMode mode) :
|
explicit AppConfig(EAppMode mode) :
|
||||||
#else
|
|
||||||
AppConfig() :
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
m_dirty(false),
|
m_dirty(false),
|
||||||
m_orig_version(Semver::invalid()),
|
m_orig_version(Semver::invalid()),
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
m_mode(mode),
|
m_mode(mode),
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
m_legacy_datadir(false)
|
m_legacy_datadir(false)
|
||||||
{
|
{
|
||||||
this->reset();
|
this->reset();
|
||||||
|
@ -135,11 +129,7 @@ public:
|
||||||
void reset_selections();
|
void reset_selections();
|
||||||
|
|
||||||
// Get the default config path from Slic3r::data_dir().
|
// Get the default config path from Slic3r::data_dir().
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
std::string config_path();
|
std::string config_path();
|
||||||
#else
|
|
||||||
static std::string config_path();
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
// Returns true if the user's data directory comes from before Slic3r 1.40.0 (no updating)
|
// Returns true if the user's data directory comes from before Slic3r 1.40.0 (no updating)
|
||||||
bool legacy_datadir() const { return m_legacy_datadir; }
|
bool legacy_datadir() const { return m_legacy_datadir; }
|
||||||
|
@ -154,11 +144,7 @@ public:
|
||||||
Semver orig_version() const { return m_orig_version; }
|
Semver orig_version() const { return m_orig_version; }
|
||||||
|
|
||||||
// Does the config file exist?
|
// Does the config file exist?
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
bool exists();
|
bool exists();
|
||||||
#else
|
|
||||||
static bool exists();
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
std::vector<std::string> get_recent_projects() const;
|
std::vector<std::string> get_recent_projects() const;
|
||||||
void set_recent_projects(const std::vector<std::string>& recent_projects);
|
void set_recent_projects(const std::vector<std::string>& recent_projects);
|
||||||
|
@ -196,10 +182,8 @@ private:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
// Type of application: Editor or GCodeViewer
|
||||||
EAppMode m_mode { EAppMode::Editor };
|
EAppMode m_mode { EAppMode::Editor };
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
// Map of section, name -> value
|
// Map of section, name -> value
|
||||||
std::map<std::string, std::map<std::string, std::string>> m_storage;
|
std::map<std::string, std::map<std::string, std::string>> m_storage;
|
||||||
// Map of enabled vendors / models / variants
|
// Map of enabled vendors / models / variants
|
||||||
|
|
|
@ -87,8 +87,6 @@ add_library(libslic3r STATIC
|
||||||
GCode/PostProcessor.hpp
|
GCode/PostProcessor.hpp
|
||||||
# GCode/PressureEqualizer.cpp
|
# GCode/PressureEqualizer.cpp
|
||||||
# GCode/PressureEqualizer.hpp
|
# GCode/PressureEqualizer.hpp
|
||||||
GCode/PreviewData.cpp
|
|
||||||
GCode/PreviewData.hpp
|
|
||||||
GCode/PrintExtents.cpp
|
GCode/PrintExtents.cpp
|
||||||
GCode/PrintExtents.hpp
|
GCode/PrintExtents.hpp
|
||||||
GCode/SpiralVase.cpp
|
GCode/SpiralVase.cpp
|
||||||
|
|
|
@ -192,6 +192,23 @@ bool unescape_strings_cstyle(const std::string &str, std::vector<std::string> &o
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string escape_ampersand(const std::string& str)
|
||||||
|
{
|
||||||
|
// Allocate a buffer 2 times the input string length,
|
||||||
|
// so the output will fit even if all input characters get escaped.
|
||||||
|
std::vector<char> out(str.size() * 6, 0);
|
||||||
|
char* outptr = out.data();
|
||||||
|
for (size_t i = 0; i < str.size(); ++i) {
|
||||||
|
char c = str[i];
|
||||||
|
if (c == '&') {
|
||||||
|
(*outptr++) = '&';
|
||||||
|
(*outptr++) = '&';
|
||||||
|
} else
|
||||||
|
(*outptr++) = c;
|
||||||
|
}
|
||||||
|
return std::string(out.data(), outptr - out.data());
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<std::string> ConfigOptionDef::cli_args(const std::string &key) const
|
std::vector<std::string> ConfigOptionDef::cli_args(const std::string &key) const
|
||||||
{
|
{
|
||||||
std::vector<std::string> args;
|
std::vector<std::string> args;
|
||||||
|
|
|
@ -34,6 +34,8 @@ extern std::string escape_strings_cstyle(const std::vector<std::string> &strs);
|
||||||
extern bool unescape_string_cstyle(const std::string &str, std::string &out);
|
extern bool unescape_string_cstyle(const std::string &str, std::string &out);
|
||||||
extern bool unescape_strings_cstyle(const std::string &str, std::vector<std::string> &out);
|
extern bool unescape_strings_cstyle(const std::string &str, std::vector<std::string> &out);
|
||||||
|
|
||||||
|
extern std::string escape_ampersand(const std::string& str);
|
||||||
|
|
||||||
/// Specialization of std::exception to indicate that an unknown config option has been encountered.
|
/// Specialization of std::exception to indicate that an unknown config option has been encountered.
|
||||||
class UnknownOptionException : public Slic3r::RuntimeError {
|
class UnknownOptionException : public Slic3r::RuntimeError {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
#include "CustomGCode.hpp"
|
#include "CustomGCode.hpp"
|
||||||
#include "Config.hpp"
|
#include "Config.hpp"
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
#include "GCode.hpp"
|
#include "GCode.hpp"
|
||||||
#else
|
|
||||||
#include "GCode/PreviewData.hpp"
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
#include "GCodeWriter.hpp"
|
#include "GCodeWriter.hpp"
|
||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
@ -21,11 +17,7 @@ extern void update_custom_gcode_per_print_z_from_config(Info& info, DynamicPrint
|
||||||
return;
|
return;
|
||||||
if (info.gcodes.empty() && ! colorprint_heights->values.empty()) {
|
if (info.gcodes.empty() && ! colorprint_heights->values.empty()) {
|
||||||
// Convert the old colorprint_heighs only if there is no equivalent data in a new format.
|
// Convert the old colorprint_heighs only if there is no equivalent data in a new format.
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
const std::vector<std::string>& colors = ColorPrintColors::get();
|
const std::vector<std::string>& colors = ColorPrintColors::get();
|
||||||
#else
|
|
||||||
const std::vector<std::string>& colors = GCodePreviewData::ColorPrintColors();
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
const auto& colorprint_values = colorprint_heights->values;
|
const auto& colorprint_values = colorprint_heights->values;
|
||||||
info.gcodes.clear();
|
info.gcodes.clear();
|
||||||
info.gcodes.reserve(colorprint_values.size());
|
info.gcodes.reserve(colorprint_values.size());
|
||||||
|
|
|
@ -20,6 +20,7 @@ SLIC3R_DERIVE_EXCEPTION(OutOfRange, LogicError);
|
||||||
SLIC3R_DERIVE_EXCEPTION(IOError, CriticalException);
|
SLIC3R_DERIVE_EXCEPTION(IOError, CriticalException);
|
||||||
SLIC3R_DERIVE_EXCEPTION(FileIOError, IOError);
|
SLIC3R_DERIVE_EXCEPTION(FileIOError, IOError);
|
||||||
SLIC3R_DERIVE_EXCEPTION(HostNetworkError, IOError);
|
SLIC3R_DERIVE_EXCEPTION(HostNetworkError, IOError);
|
||||||
|
SLIC3R_DERIVE_EXCEPTION(ExportError, CriticalException);
|
||||||
// Runtime exception produced by Slicer. Such exception cancels the slicing process and it shall be shown in notifications.
|
// Runtime exception produced by Slicer. Such exception cancels the slicing process and it shall be shown in notifications.
|
||||||
SLIC3R_DERIVE_EXCEPTION(SlicingError, Exception);
|
SLIC3R_DERIVE_EXCEPTION(SlicingError, Exception);
|
||||||
#undef SLIC3R_DERIVE_EXCEPTION
|
#undef SLIC3R_DERIVE_EXCEPTION
|
||||||
|
|
|
@ -306,11 +306,7 @@ double ExtrusionLoop::min_mm3_per_mm() const
|
||||||
std::string ExtrusionEntity::role_to_string(ExtrusionRole role)
|
std::string ExtrusionEntity::role_to_string(ExtrusionRole role)
|
||||||
{
|
{
|
||||||
switch (role) {
|
switch (role) {
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
case erNone : return L("Unknown");
|
case erNone : return L("Unknown");
|
||||||
#else
|
|
||||||
case erNone : return L("None");
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
case erPerimeter : return L("Perimeter");
|
case erPerimeter : return L("Perimeter");
|
||||||
case erExternalPerimeter : return L("External perimeter");
|
case erExternalPerimeter : return L("External perimeter");
|
||||||
case erOverhangPerimeter : return L("Overhang perimeter");
|
case erOverhangPerimeter : return L("Overhang perimeter");
|
||||||
|
|
|
@ -546,9 +546,7 @@ namespace Slic3r {
|
||||||
return gcode;
|
return gcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
const std::vector<std::string> ColorPrintColors::Colors = { "#C0392B", "#E67E22", "#F1C40F", "#27AE60", "#1ABC9C", "#2980B9", "#9B59B6" };
|
const std::vector<std::string> ColorPrintColors::Colors = { "#C0392B", "#E67E22", "#F1C40F", "#27AE60", "#1ABC9C", "#2980B9", "#9B59B6" };
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
#define EXTRUDER_CONFIG(OPT) m_config.OPT.get_at(m_writer.extruder()->id())
|
#define EXTRUDER_CONFIG(OPT) m_config.OPT.get_at(m_writer.extruder()->id())
|
||||||
|
|
||||||
|
@ -687,7 +685,6 @@ std::vector<std::pair<coordf_t, std::vector<GCode::LayerToPrint>>> GCode::collec
|
||||||
return layers_to_print;
|
return layers_to_print;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
// free functions called by GCode::do_export()
|
// free functions called by GCode::do_export()
|
||||||
namespace DoExport {
|
namespace DoExport {
|
||||||
static void update_print_estimated_times_stats(const GCodeProcessor& processor, PrintStatistics& print_statistics)
|
static void update_print_estimated_times_stats(const GCodeProcessor& processor, PrintStatistics& print_statistics)
|
||||||
|
@ -700,9 +697,6 @@ namespace DoExport {
|
||||||
} // namespace DoExport
|
} // namespace DoExport
|
||||||
|
|
||||||
void GCode::do_export(Print* print, const char* path, GCodeProcessor::Result* result, ThumbnailsGeneratorCallback thumbnail_cb)
|
void GCode::do_export(Print* print, const char* path, GCodeProcessor::Result* result, ThumbnailsGeneratorCallback thumbnail_cb)
|
||||||
#else
|
|
||||||
void GCode::do_export(Print* print, const char* path, GCodePreviewData* preview_data, ThumbnailsGeneratorCallback thumbnail_cb)
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
{
|
{
|
||||||
PROFILE_CLEAR();
|
PROFILE_CLEAR();
|
||||||
|
|
||||||
|
@ -724,10 +718,6 @@ void GCode::do_export(Print* print, const char* path, GCodePreviewData* preview_
|
||||||
if (file == nullptr)
|
if (file == nullptr)
|
||||||
throw Slic3r::RuntimeError(std::string("G-code export to ") + path + " failed.\nCannot open the file for writing.\n");
|
throw Slic3r::RuntimeError(std::string("G-code export to ") + path + " failed.\nCannot open the file for writing.\n");
|
||||||
|
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
m_enable_analyzer = preview_data != nullptr;
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
m_placeholder_parser_failed_templates.clear();
|
m_placeholder_parser_failed_templates.clear();
|
||||||
this->_do_export(*print, file, thumbnail_cb);
|
this->_do_export(*print, file, thumbnail_cb);
|
||||||
|
@ -759,35 +749,12 @@ void GCode::do_export(Print* print, const char* path, GCodePreviewData* preview_
|
||||||
throw Slic3r::RuntimeError(msg);
|
throw Slic3r::RuntimeError(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
BOOST_LOG_TRIVIAL(debug) << "Start processing gcode, " << log_memory_info();
|
BOOST_LOG_TRIVIAL(debug) << "Start processing gcode, " << log_memory_info();
|
||||||
m_processor.process_file(path_tmp, [print]() { print->throw_if_canceled(); });
|
m_processor.process_file(path_tmp, true, [print]() { print->throw_if_canceled(); });
|
||||||
DoExport::update_print_estimated_times_stats(m_processor, print->m_print_statistics);
|
DoExport::update_print_estimated_times_stats(m_processor, print->m_print_statistics);
|
||||||
if (result != nullptr)
|
if (result != nullptr)
|
||||||
*result = std::move(m_processor.extract_result());
|
*result = std::move(m_processor.extract_result());
|
||||||
BOOST_LOG_TRIVIAL(debug) << "Finished processing gcode, " << log_memory_info();
|
BOOST_LOG_TRIVIAL(debug) << "Finished processing gcode, " << log_memory_info();
|
||||||
#else
|
|
||||||
GCodeTimeEstimator::PostProcessData normal_data = m_normal_time_estimator.get_post_process_data();
|
|
||||||
GCodeTimeEstimator::PostProcessData silent_data = m_silent_time_estimator.get_post_process_data();
|
|
||||||
|
|
||||||
bool remaining_times_enabled = print->config().remaining_times.value;
|
|
||||||
|
|
||||||
BOOST_LOG_TRIVIAL(debug) << "Time estimator post processing" << log_memory_info();
|
|
||||||
GCodeTimeEstimator::post_process(path_tmp, 60.0f, remaining_times_enabled ? &normal_data : nullptr, (remaining_times_enabled && m_silent_time_estimator_enabled) ? &silent_data : nullptr);
|
|
||||||
|
|
||||||
if (remaining_times_enabled) {
|
|
||||||
m_normal_time_estimator.reset();
|
|
||||||
if (m_silent_time_estimator_enabled)
|
|
||||||
m_silent_time_estimator.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
// starts analyzer calculations
|
|
||||||
if (m_enable_analyzer) {
|
|
||||||
BOOST_LOG_TRIVIAL(debug) << "Preparing G-code preview data" << log_memory_info();
|
|
||||||
m_analyzer.calc_gcode_preview_data(*preview_data, [print]() { print->throw_if_canceled(); });
|
|
||||||
m_analyzer.reset();
|
|
||||||
}
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
if (rename_file(path_tmp, path))
|
if (rename_file(path_tmp, path))
|
||||||
throw Slic3r::RuntimeError(
|
throw Slic3r::RuntimeError(
|
||||||
|
@ -804,88 +771,6 @@ void GCode::do_export(Print* print, const char* path, GCodePreviewData* preview_
|
||||||
|
|
||||||
// free functions called by GCode::_do_export()
|
// free functions called by GCode::_do_export()
|
||||||
namespace DoExport {
|
namespace DoExport {
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
static void init_time_estimators(const PrintConfig &config, GCodeTimeEstimator &normal_time_estimator, GCodeTimeEstimator &silent_time_estimator, bool &silent_time_estimator_enabled)
|
|
||||||
{
|
|
||||||
// resets time estimators
|
|
||||||
normal_time_estimator.reset();
|
|
||||||
normal_time_estimator.set_dialect(config.gcode_flavor);
|
|
||||||
normal_time_estimator.set_extrusion_axis(config.get_extrusion_axis()[0]);
|
|
||||||
silent_time_estimator_enabled = (config.gcode_flavor == gcfMarlin) && config.silent_mode;
|
|
||||||
|
|
||||||
// Until we have a UI support for the other firmwares than the Marlin, use the hardcoded default values
|
|
||||||
// and let the user to enter the G-code limits into the start G-code.
|
|
||||||
// If the following block is enabled for other firmwares than the Marlin, then the function
|
|
||||||
// this->print_machine_envelope(file, print);
|
|
||||||
// shall be adjusted as well to produce a G-code block compatible with the particular firmware flavor.
|
|
||||||
if (config.gcode_flavor.value == gcfMarlin) {
|
|
||||||
if (config.machine_limits_usage.value != MachineLimitsUsage::Ignore) {
|
|
||||||
normal_time_estimator.set_max_acceleration((float)config.machine_max_acceleration_extruding.values[0]);
|
|
||||||
normal_time_estimator.set_retract_acceleration((float)config.machine_max_acceleration_retracting.values[0]);
|
|
||||||
normal_time_estimator.set_minimum_feedrate((float)config.machine_min_extruding_rate.values[0]);
|
|
||||||
normal_time_estimator.set_minimum_travel_feedrate((float)config.machine_min_travel_rate.values[0]);
|
|
||||||
normal_time_estimator.set_axis_max_acceleration(GCodeTimeEstimator::X, (float)config.machine_max_acceleration_x.values[0]);
|
|
||||||
normal_time_estimator.set_axis_max_acceleration(GCodeTimeEstimator::Y, (float)config.machine_max_acceleration_y.values[0]);
|
|
||||||
normal_time_estimator.set_axis_max_acceleration(GCodeTimeEstimator::Z, (float)config.machine_max_acceleration_z.values[0]);
|
|
||||||
normal_time_estimator.set_axis_max_acceleration(GCodeTimeEstimator::E, (float)config.machine_max_acceleration_e.values[0]);
|
|
||||||
normal_time_estimator.set_axis_max_feedrate(GCodeTimeEstimator::X, (float)config.machine_max_feedrate_x.values[0]);
|
|
||||||
normal_time_estimator.set_axis_max_feedrate(GCodeTimeEstimator::Y, (float)config.machine_max_feedrate_y.values[0]);
|
|
||||||
normal_time_estimator.set_axis_max_feedrate(GCodeTimeEstimator::Z, (float)config.machine_max_feedrate_z.values[0]);
|
|
||||||
normal_time_estimator.set_axis_max_feedrate(GCodeTimeEstimator::E, (float)config.machine_max_feedrate_e.values[0]);
|
|
||||||
normal_time_estimator.set_axis_max_jerk(GCodeTimeEstimator::X, (float)config.machine_max_jerk_x.values[0]);
|
|
||||||
normal_time_estimator.set_axis_max_jerk(GCodeTimeEstimator::Y, (float)config.machine_max_jerk_y.values[0]);
|
|
||||||
normal_time_estimator.set_axis_max_jerk(GCodeTimeEstimator::Z, (float)config.machine_max_jerk_z.values[0]);
|
|
||||||
normal_time_estimator.set_axis_max_jerk(GCodeTimeEstimator::E, (float)config.machine_max_jerk_e.values[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (silent_time_estimator_enabled)
|
|
||||||
{
|
|
||||||
silent_time_estimator.reset();
|
|
||||||
silent_time_estimator.set_dialect(config.gcode_flavor);
|
|
||||||
silent_time_estimator.set_extrusion_axis(config.get_extrusion_axis()[0]);
|
|
||||||
|
|
||||||
if (config.machine_limits_usage.value != MachineLimitsUsage::Ignore) {
|
|
||||||
/* "Stealth mode" values can be just a copy of "normal mode" values
|
|
||||||
* (when they aren't input for a printer preset).
|
|
||||||
* Thus, use back value from values, instead of second one, which could be absent
|
|
||||||
*/
|
|
||||||
silent_time_estimator.set_max_acceleration((float)config.machine_max_acceleration_extruding.values.back());
|
|
||||||
silent_time_estimator.set_retract_acceleration((float)config.machine_max_acceleration_retracting.values.back());
|
|
||||||
silent_time_estimator.set_minimum_feedrate((float)config.machine_min_extruding_rate.values.back());
|
|
||||||
silent_time_estimator.set_minimum_travel_feedrate((float)config.machine_min_travel_rate.values.back());
|
|
||||||
silent_time_estimator.set_axis_max_acceleration(GCodeTimeEstimator::X, (float)config.machine_max_acceleration_x.values.back());
|
|
||||||
silent_time_estimator.set_axis_max_acceleration(GCodeTimeEstimator::Y, (float)config.machine_max_acceleration_y.values.back());
|
|
||||||
silent_time_estimator.set_axis_max_acceleration(GCodeTimeEstimator::Z, (float)config.machine_max_acceleration_z.values.back());
|
|
||||||
silent_time_estimator.set_axis_max_acceleration(GCodeTimeEstimator::E, (float)config.machine_max_acceleration_e.values.back());
|
|
||||||
silent_time_estimator.set_axis_max_feedrate(GCodeTimeEstimator::X, (float)config.machine_max_feedrate_x.values.back());
|
|
||||||
silent_time_estimator.set_axis_max_feedrate(GCodeTimeEstimator::Y, (float)config.machine_max_feedrate_y.values.back());
|
|
||||||
silent_time_estimator.set_axis_max_feedrate(GCodeTimeEstimator::Z, (float)config.machine_max_feedrate_z.values.back());
|
|
||||||
silent_time_estimator.set_axis_max_feedrate(GCodeTimeEstimator::E, (float)config.machine_max_feedrate_e.values.back());
|
|
||||||
silent_time_estimator.set_axis_max_jerk(GCodeTimeEstimator::X, (float)config.machine_max_jerk_x.values.back());
|
|
||||||
silent_time_estimator.set_axis_max_jerk(GCodeTimeEstimator::Y, (float)config.machine_max_jerk_y.values.back());
|
|
||||||
silent_time_estimator.set_axis_max_jerk(GCodeTimeEstimator::Z, (float)config.machine_max_jerk_z.values.back());
|
|
||||||
silent_time_estimator.set_axis_max_jerk(GCodeTimeEstimator::E, (float)config.machine_max_jerk_e.values.back());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config.single_extruder_multi_material) {
|
|
||||||
// As of now the fields are shown at the UI dialog in the same combo box as the ramming values, so they
|
|
||||||
// are considered to be active for the single extruder multi-material printers only.
|
|
||||||
silent_time_estimator.set_filament_load_times(config.filament_load_time.values);
|
|
||||||
silent_time_estimator.set_filament_unload_times(config.filament_unload_time.values);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Filament load / unload times are not specific to a firmware flavor. Let anybody use it if they find it useful.
|
|
||||||
if (config.single_extruder_multi_material) {
|
|
||||||
// As of now the fields are shown at the UI dialog in the same combo box as the ramming values, so they
|
|
||||||
// are considered to be active for the single extruder multi-material printers only.
|
|
||||||
normal_time_estimator.set_filament_load_times(config.filament_load_time.values);
|
|
||||||
normal_time_estimator.set_filament_unload_times(config.filament_unload_time.values);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
static void init_gcode_processor(const PrintConfig& config, GCodeProcessor& processor, bool& silent_time_estimator_enabled)
|
static void init_gcode_processor(const PrintConfig& config, GCodeProcessor& processor, bool& silent_time_estimator_enabled)
|
||||||
{
|
{
|
||||||
silent_time_estimator_enabled = (config.gcode_flavor == gcfMarlin) && config.silent_mode;
|
silent_time_estimator_enabled = (config.gcode_flavor == gcfMarlin) && config.silent_mode;
|
||||||
|
@ -893,33 +778,6 @@ namespace DoExport {
|
||||||
processor.apply_config(config);
|
processor.apply_config(config);
|
||||||
processor.enable_stealth_time_estimator(silent_time_estimator_enabled);
|
processor.enable_stealth_time_estimator(silent_time_estimator_enabled);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
static void init_gcode_analyzer(const PrintConfig &config, GCodeAnalyzer &analyzer)
|
|
||||||
{
|
|
||||||
// resets analyzer
|
|
||||||
analyzer.reset();
|
|
||||||
|
|
||||||
// send extruder offset data to analyzer
|
|
||||||
GCodeAnalyzer::ExtruderOffsetsMap extruder_offsets;
|
|
||||||
unsigned int num_extruders = static_cast<unsigned int>(config.nozzle_diameter.values.size());
|
|
||||||
for (unsigned int extruder_id = 0; extruder_id < num_extruders; ++ extruder_id)
|
|
||||||
{
|
|
||||||
Vec2d offset = config.extruder_offset.get_at(extruder_id);
|
|
||||||
if (!offset.isApprox(Vec2d::Zero()))
|
|
||||||
extruder_offsets[extruder_id] = offset;
|
|
||||||
}
|
|
||||||
analyzer.set_extruder_offsets(extruder_offsets);
|
|
||||||
|
|
||||||
// tell analyzer about the extrusion axis
|
|
||||||
analyzer.set_extrusion_axis(config.get_extrusion_axis()[0]);
|
|
||||||
|
|
||||||
// send extruders count to analyzer to allow it to detect invalid extruder idxs
|
|
||||||
analyzer.set_extruders_count(num_extruders);
|
|
||||||
|
|
||||||
// tell analyzer about the gcode flavor
|
|
||||||
analyzer.set_gcode_flavor(config.gcode_flavor);
|
|
||||||
}
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
static double autospeed_volumetric_limit(const Print &print)
|
static double autospeed_volumetric_limit(const Print &print)
|
||||||
{
|
{
|
||||||
|
@ -1043,11 +901,6 @@ namespace DoExport {
|
||||||
|
|
||||||
// Fill in print_statistics and return formatted string containing filament statistics to be inserted into G-code comment section.
|
// Fill in print_statistics and return formatted string containing filament statistics to be inserted into G-code comment section.
|
||||||
static std::string update_print_stats_and_format_filament_stats(
|
static std::string update_print_stats_and_format_filament_stats(
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
const GCodeTimeEstimator &normal_time_estimator,
|
|
||||||
const GCodeTimeEstimator &silent_time_estimator,
|
|
||||||
const bool silent_time_estimator_enabled,
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
const bool has_wipe_tower,
|
const bool has_wipe_tower,
|
||||||
const WipeTowerData &wipe_tower_data,
|
const WipeTowerData &wipe_tower_data,
|
||||||
const std::vector<Extruder> &extruders,
|
const std::vector<Extruder> &extruders,
|
||||||
|
@ -1056,13 +909,6 @@ namespace DoExport {
|
||||||
std::string filament_stats_string_out;
|
std::string filament_stats_string_out;
|
||||||
|
|
||||||
print_statistics.clear();
|
print_statistics.clear();
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
print_statistics.estimated_normal_print_time = normal_time_estimator.get_time_dhm/*s*/();
|
|
||||||
print_statistics.estimated_silent_print_time = silent_time_estimator_enabled ? silent_time_estimator.get_time_dhm/*s*/() : "N/A";
|
|
||||||
print_statistics.estimated_normal_custom_gcode_print_times = normal_time_estimator.get_custom_gcode_times_dhm(true);
|
|
||||||
if (silent_time_estimator_enabled)
|
|
||||||
print_statistics.estimated_silent_custom_gcode_print_times = silent_time_estimator.get_custom_gcode_times_dhm(true);
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
print_statistics.total_toolchanges = std::max(0, wipe_tower_data.number_of_toolchanges);
|
print_statistics.total_toolchanges = std::max(0, wipe_tower_data.number_of_toolchanges);
|
||||||
if (! extruders.empty()) {
|
if (! extruders.empty()) {
|
||||||
std::pair<std::string, unsigned int> out_filament_used_mm ("; filament used [mm] = ", 0);
|
std::pair<std::string, unsigned int> out_filament_used_mm ("; filament used [mm] = ", 0);
|
||||||
|
@ -1153,29 +999,16 @@ void GCode::_do_export(Print& print, FILE* file, ThumbnailsGeneratorCallback thu
|
||||||
{
|
{
|
||||||
PROFILE_FUNC();
|
PROFILE_FUNC();
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
// modifies m_silent_time_estimator_enabled
|
// modifies m_silent_time_estimator_enabled
|
||||||
DoExport::init_gcode_processor(print.config(), m_processor, m_silent_time_estimator_enabled);
|
DoExport::init_gcode_processor(print.config(), m_processor, m_silent_time_estimator_enabled);
|
||||||
#else
|
|
||||||
DoExport::init_time_estimators(print.config(),
|
|
||||||
// modifies the following:
|
|
||||||
m_normal_time_estimator, m_silent_time_estimator, m_silent_time_estimator_enabled);
|
|
||||||
DoExport::init_gcode_analyzer(print.config(), m_analyzer);
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
// resets analyzer's tracking data
|
// resets analyzer's tracking data
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
m_last_height = 0.0f;
|
m_last_height = 0.0f;
|
||||||
m_last_layer_z = 0.0f;
|
m_last_layer_z = 0.0f;
|
||||||
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
m_last_mm3_per_mm = 0.0;
|
m_last_mm3_per_mm = 0.0;
|
||||||
m_last_width = 0.0f;
|
m_last_width = 0.0f;
|
||||||
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
#else
|
|
||||||
m_last_mm3_per_mm = GCodeAnalyzer::Default_mm3_per_mm;
|
|
||||||
m_last_width = GCodeAnalyzer::Default_Width;
|
|
||||||
m_last_height = GCodeAnalyzer::Default_Height;
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
// How many times will be change_layer() called?
|
// How many times will be change_layer() called?
|
||||||
// change_layer() in turn increments the progress bar status.
|
// change_layer() in turn increments the progress bar status.
|
||||||
|
@ -1266,16 +1099,8 @@ void GCode::_do_export(Print& print, FILE* file, ThumbnailsGeneratorCallback thu
|
||||||
print.throw_if_canceled();
|
print.throw_if_canceled();
|
||||||
|
|
||||||
// adds tags for time estimators
|
// adds tags for time estimators
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
if (print.config().remaining_times.value)
|
if (print.config().remaining_times.value)
|
||||||
_writeln(file, GCodeProcessor::First_Line_M73_Placeholder_Tag);
|
_writeln(file, GCodeProcessor::First_Line_M73_Placeholder_Tag);
|
||||||
#else
|
|
||||||
if (print.config().remaining_times.value) {
|
|
||||||
_writeln(file, GCodeTimeEstimator::Normal_First_M73_Output_Placeholder_Tag);
|
|
||||||
if (m_silent_time_estimator_enabled)
|
|
||||||
_writeln(file, GCodeTimeEstimator::Silent_First_M73_Output_Placeholder_Tag);
|
|
||||||
}
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
// Prepare the helper object for replacing placeholders in custom G-code and output filename.
|
// Prepare the helper object for replacing placeholders in custom G-code and output filename.
|
||||||
m_placeholder_parser = print.placeholder_parser();
|
m_placeholder_parser = print.placeholder_parser();
|
||||||
|
@ -1380,14 +1205,8 @@ void GCode::_do_export(Print& print, FILE* file, ThumbnailsGeneratorCallback thu
|
||||||
// Set extruder(s) temperature before and after start G-code.
|
// Set extruder(s) temperature before and after start G-code.
|
||||||
this->_print_first_layer_extruder_temperatures(file, print, start_gcode, initial_extruder_id, false);
|
this->_print_first_layer_extruder_temperatures(file, print, start_gcode, initial_extruder_id, false);
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
// adds tag for processor
|
// adds tag for processor
|
||||||
_write_format(file, ";%s%s\n", GCodeProcessor::Extrusion_Role_Tag.c_str(), ExtrusionEntity::role_to_string(erCustom).c_str());
|
_write_format(file, ";%s%s\n", GCodeProcessor::Extrusion_Role_Tag.c_str(), ExtrusionEntity::role_to_string(erCustom).c_str());
|
||||||
#else
|
|
||||||
if (m_enable_analyzer)
|
|
||||||
// adds tag for analyzer
|
|
||||||
_write_format(file, ";%s%d\n", GCodeAnalyzer::Extrusion_Role_Tag.c_str(), erCustom);
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
// Write the custom start G-code
|
// Write the custom start G-code
|
||||||
_writeln(file, start_gcode);
|
_writeln(file, start_gcode);
|
||||||
|
@ -1541,14 +1360,8 @@ void GCode::_do_export(Print& print, FILE* file, ThumbnailsGeneratorCallback thu
|
||||||
_write(file, this->retract());
|
_write(file, this->retract());
|
||||||
_write(file, m_writer.set_fan(false));
|
_write(file, m_writer.set_fan(false));
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
// adds tag for processor
|
// adds tag for processor
|
||||||
_write_format(file, ";%s%s\n", GCodeProcessor::Extrusion_Role_Tag.c_str(), ExtrusionEntity::role_to_string(erCustom).c_str());
|
_write_format(file, ";%s%s\n", GCodeProcessor::Extrusion_Role_Tag.c_str(), ExtrusionEntity::role_to_string(erCustom).c_str());
|
||||||
#else
|
|
||||||
if (m_enable_analyzer)
|
|
||||||
// adds tag for analyzer
|
|
||||||
_write_format(file, ";%s%d\n", GCodeAnalyzer::Extrusion_Role_Tag.c_str(), erCustom);
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
// Process filament-specific gcode in extruder order.
|
// Process filament-specific gcode in extruder order.
|
||||||
{
|
{
|
||||||
|
@ -1573,32 +1386,14 @@ void GCode::_do_export(Print& print, FILE* file, ThumbnailsGeneratorCallback thu
|
||||||
_write(file, m_writer.postamble());
|
_write(file, m_writer.postamble());
|
||||||
|
|
||||||
// adds tags for time estimators
|
// adds tags for time estimators
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
if (print.config().remaining_times.value)
|
if (print.config().remaining_times.value)
|
||||||
_writeln(file, GCodeProcessor::Last_Line_M73_Placeholder_Tag);
|
_writeln(file, GCodeProcessor::Last_Line_M73_Placeholder_Tag);
|
||||||
#else
|
|
||||||
if (print.config().remaining_times.value) {
|
|
||||||
_writeln(file, GCodeTimeEstimator::Normal_Last_M73_Output_Placeholder_Tag);
|
|
||||||
if (m_silent_time_estimator_enabled)
|
|
||||||
_writeln(file, GCodeTimeEstimator::Silent_Last_M73_Output_Placeholder_Tag);
|
|
||||||
}
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
print.throw_if_canceled();
|
print.throw_if_canceled();
|
||||||
|
|
||||||
// calculates estimated printing time
|
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
m_normal_time_estimator.calculate_time(false);
|
|
||||||
if (m_silent_time_estimator_enabled)
|
|
||||||
m_silent_time_estimator.calculate_time(false);
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
// Get filament stats.
|
// Get filament stats.
|
||||||
_write(file, DoExport::update_print_stats_and_format_filament_stats(
|
_write(file, DoExport::update_print_stats_and_format_filament_stats(
|
||||||
// Const inputs
|
// Const inputs
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
m_normal_time_estimator, m_silent_time_estimator, m_silent_time_estimator_enabled,
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
has_wipe_tower, print.wipe_tower_data(),
|
has_wipe_tower, print.wipe_tower_data(),
|
||||||
m_writer.extruders(),
|
m_writer.extruders(),
|
||||||
// Modifies
|
// Modifies
|
||||||
|
@ -1608,13 +1403,7 @@ void GCode::_do_export(Print& print, FILE* file, ThumbnailsGeneratorCallback thu
|
||||||
_write_format(file, "; total filament cost = %.2lf\n", print.m_print_statistics.total_cost);
|
_write_format(file, "; total filament cost = %.2lf\n", print.m_print_statistics.total_cost);
|
||||||
if (print.m_print_statistics.total_toolchanges > 0)
|
if (print.m_print_statistics.total_toolchanges > 0)
|
||||||
_write_format(file, "; total toolchanges = %i\n", print.m_print_statistics.total_toolchanges);
|
_write_format(file, "; total toolchanges = %i\n", print.m_print_statistics.total_toolchanges);
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
_writeln(file, GCodeProcessor::Estimated_Printing_Time_Placeholder_Tag);
|
_writeln(file, GCodeProcessor::Estimated_Printing_Time_Placeholder_Tag);
|
||||||
#else
|
|
||||||
_write_format(file, "; estimated printing time (normal mode) = %s\n", m_normal_time_estimator.get_time_dhms().c_str());
|
|
||||||
if (m_silent_time_estimator_enabled)
|
|
||||||
_write_format(file, "; estimated printing time (silent mode) = %s\n", m_silent_time_estimator.get_time_dhms().c_str());
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
// Append full config.
|
// Append full config.
|
||||||
_write(file, "\n");
|
_write(file, "\n");
|
||||||
|
@ -1896,15 +1685,8 @@ namespace ProcessLayer
|
||||||
{
|
{
|
||||||
assert(m600_extruder_before_layer >= 0);
|
assert(m600_extruder_before_layer >= 0);
|
||||||
// Color Change or Tool Change as Color Change.
|
// Color Change or Tool Change as Color Change.
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
// add tag for processor
|
// add tag for processor
|
||||||
gcode += "; " + GCodeProcessor::Color_Change_Tag + ",T" + std::to_string(m600_extruder_before_layer) + "\n";
|
gcode += ";" + GCodeProcessor::Color_Change_Tag + ",T" + std::to_string(m600_extruder_before_layer) + "\n";
|
||||||
#else
|
|
||||||
// add tag for analyzer
|
|
||||||
gcode += "; " + GCodeAnalyzer::Color_Change_Tag + ",T" + std::to_string(m600_extruder_before_layer) + "\n";
|
|
||||||
// add tag for time estimator
|
|
||||||
gcode += "; " + GCodeTimeEstimator::Color_Change_Tag + "\n";
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
if (!single_extruder_printer && m600_extruder_before_layer >= 0 && first_extruder_id != (unsigned)m600_extruder_before_layer
|
if (!single_extruder_printer && m600_extruder_before_layer >= 0 && first_extruder_id != (unsigned)m600_extruder_before_layer
|
||||||
// && !MMU1
|
// && !MMU1
|
||||||
|
@ -1923,33 +1705,17 @@ namespace ProcessLayer
|
||||||
{
|
{
|
||||||
if (gcode_type == CustomGCode::PausePrint) // Pause print
|
if (gcode_type == CustomGCode::PausePrint) // Pause print
|
||||||
{
|
{
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
// add tag for processor
|
// add tag for processor
|
||||||
gcode += "; " + GCodeProcessor::Pause_Print_Tag + "\n";
|
gcode += ";" + GCodeProcessor::Pause_Print_Tag + "\n";
|
||||||
#else
|
|
||||||
// add tag for analyzer
|
|
||||||
gcode += "; " + GCodeAnalyzer::Pause_Print_Tag + "\n";
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
//! FIXME_in_fw show message during print pause
|
//! FIXME_in_fw show message during print pause
|
||||||
if (!pause_print_msg.empty())
|
if (!pause_print_msg.empty())
|
||||||
gcode += "M117 " + pause_print_msg + "\n";
|
gcode += "M117 " + pause_print_msg + "\n";
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
// add tag for time estimator
|
|
||||||
gcode += "; " + GCodeTimeEstimator::Pause_Print_Tag + "\n";
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
gcode += config.pause_print_gcode;
|
gcode += config.pause_print_gcode;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
// add tag for processor
|
// add tag for processor
|
||||||
gcode += "; " + GCodeProcessor::Custom_Code_Tag + "\n";
|
gcode += ";" + GCodeProcessor::Custom_Code_Tag + "\n";
|
||||||
#else
|
|
||||||
// add tag for analyzer
|
|
||||||
gcode += "; " + GCodeAnalyzer::Custom_Code_Tag + "\n";
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
// add tag for time estimator
|
|
||||||
//gcode += "; " + GCodeTimeEstimator::Custom_Code_Tag + "\n";
|
|
||||||
if (gcode_type == CustomGCode::Template) // Template Cistom Gcode
|
if (gcode_type == CustomGCode::Template) // Template Cistom Gcode
|
||||||
gcode += config.template_custom_gcode;
|
gcode += config.template_custom_gcode;
|
||||||
else // custom Gcode
|
else // custom Gcode
|
||||||
|
@ -2091,7 +1857,6 @@ void GCode::process_layer(
|
||||||
|
|
||||||
std::string gcode;
|
std::string gcode;
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
// add tag for processor
|
// add tag for processor
|
||||||
gcode += "; " + GCodeProcessor::Layer_Change_Tag + "\n";
|
gcode += "; " + GCodeProcessor::Layer_Change_Tag + "\n";
|
||||||
// export layer z
|
// export layer z
|
||||||
|
@ -2105,7 +1870,6 @@ void GCode::process_layer(
|
||||||
// update caches
|
// update caches
|
||||||
m_last_layer_z = static_cast<float>(print_z);
|
m_last_layer_z = static_cast<float>(print_z);
|
||||||
m_last_height = height;
|
m_last_height = height;
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
// Set new layer - this will change Z and force a retraction if retract_layer_change is enabled.
|
// Set new layer - this will change Z and force a retraction if retract_layer_change is enabled.
|
||||||
if (! print.config().before_layer_gcode.value.empty()) {
|
if (! print.config().before_layer_gcode.value.empty()) {
|
||||||
|
@ -2320,15 +2084,9 @@ void GCode::process_layer(
|
||||||
m_wipe_tower->tool_change(*this, extruder_id, extruder_id == layer_tools.extruders.back()) :
|
m_wipe_tower->tool_change(*this, extruder_id, extruder_id == layer_tools.extruders.back()) :
|
||||||
this->set_extruder(extruder_id, print_z);
|
this->set_extruder(extruder_id, print_z);
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
// let analyzer tag generator aware of a role type change
|
// let analyzer tag generator aware of a role type change
|
||||||
if (layer_tools.has_wipe_tower && m_wipe_tower)
|
if (layer_tools.has_wipe_tower && m_wipe_tower)
|
||||||
m_last_processor_extrusion_role = erWipeTower;
|
m_last_processor_extrusion_role = erWipeTower;
|
||||||
#else
|
|
||||||
// let analyzer tag generator aware of a role type change
|
|
||||||
if (m_enable_analyzer && layer_tools.has_wipe_tower && m_wipe_tower)
|
|
||||||
m_last_analyzer_extrusion_role = erWipeTower;
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
if (auto loops_it = skirt_loops_per_extruder.find(extruder_id); loops_it != skirt_loops_per_extruder.end()) {
|
if (auto loops_it = skirt_loops_per_extruder.find(extruder_id); loops_it != skirt_loops_per_extruder.end()) {
|
||||||
const std::pair<size_t, size_t> loops = loops_it->second;
|
const std::pair<size_t, size_t> loops = loops_it->second;
|
||||||
|
@ -2432,14 +2190,6 @@ void GCode::process_layer(
|
||||||
if (m_cooling_buffer)
|
if (m_cooling_buffer)
|
||||||
gcode = m_cooling_buffer->process_layer(gcode, layer.id());
|
gcode = m_cooling_buffer->process_layer(gcode, layer.id());
|
||||||
|
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
// add tag for analyzer
|
|
||||||
if (gcode.find(GCodeAnalyzer::Pause_Print_Tag) != gcode.npos)
|
|
||||||
gcode += "\n; " + GCodeAnalyzer::End_Pause_Print_Or_Custom_Code_Tag + "\n";
|
|
||||||
else if (gcode.find(GCodeAnalyzer::Custom_Code_Tag) != gcode.npos)
|
|
||||||
gcode += "\n; " + GCodeAnalyzer::End_Pause_Print_Or_Custom_Code_Tag + "\n";
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
#ifdef HAS_PRESSURE_EQUALIZER
|
#ifdef HAS_PRESSURE_EQUALIZER
|
||||||
// Apply pressure equalization if enabled;
|
// Apply pressure equalization if enabled;
|
||||||
// printf("G-code before filter:\n%s\n", gcode.c_str());
|
// printf("G-code before filter:\n%s\n", gcode.c_str());
|
||||||
|
@ -2449,17 +2199,8 @@ void GCode::process_layer(
|
||||||
#endif /* HAS_PRESSURE_EQUALIZER */
|
#endif /* HAS_PRESSURE_EQUALIZER */
|
||||||
|
|
||||||
_write(file, gcode);
|
_write(file, gcode);
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
BOOST_LOG_TRIVIAL(trace) << "Exported layer " << layer.id() << " print_z " << print_z <<
|
BOOST_LOG_TRIVIAL(trace) << "Exported layer " << layer.id() << " print_z " << print_z <<
|
||||||
log_memory_info();
|
log_memory_info();
|
||||||
#else
|
|
||||||
BOOST_LOG_TRIVIAL(trace) << "Exported layer " << layer.id() << " print_z " << print_z <<
|
|
||||||
", time estimator memory: " <<
|
|
||||||
format_memsize_MB(m_normal_time_estimator.memory_used() + (m_silent_time_estimator_enabled ? m_silent_time_estimator.memory_used() : 0)) <<
|
|
||||||
", analyzer memory: " <<
|
|
||||||
format_memsize_MB(m_analyzer.memory_used()) <<
|
|
||||||
log_memory_info();
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GCode::apply_print_config(const PrintConfig &print_config)
|
void GCode::apply_print_config(const PrintConfig &print_config)
|
||||||
|
@ -2790,21 +2531,9 @@ std::string GCode::extrude_support(const ExtrusionEntityCollection &support_fill
|
||||||
void GCode::_write(FILE* file, const char *what)
|
void GCode::_write(FILE* file, const char *what)
|
||||||
{
|
{
|
||||||
if (what != nullptr) {
|
if (what != nullptr) {
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
const char* gcode = what;
|
const char* gcode = what;
|
||||||
#else
|
|
||||||
// apply analyzer, if enabled
|
|
||||||
const char* gcode = m_enable_analyzer ? m_analyzer.process_gcode(what).c_str() : what;
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
// writes string to file
|
// writes string to file
|
||||||
fwrite(gcode, 1, ::strlen(gcode), file);
|
fwrite(gcode, 1, ::strlen(gcode), file);
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
// updates time estimator and gcode lines vector
|
|
||||||
m_normal_time_estimator.add_gcode_block(gcode);
|
|
||||||
if (m_silent_time_estimator_enabled)
|
|
||||||
m_silent_time_estimator.add_gcode_block(gcode);
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2944,70 +2673,36 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
|
||||||
}
|
}
|
||||||
|
|
||||||
// adds processor tags and updates processor tracking data
|
// adds processor tags and updates processor tracking data
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
// PrusaMultiMaterial::Writer may generate GCodeProcessor::Height_Tag lines without updating m_last_height
|
// PrusaMultiMaterial::Writer may generate GCodeProcessor::Height_Tag lines without updating m_last_height
|
||||||
// so, if the last role was erWipeTower we force export of GCodeProcessor::Height_Tag lines
|
// so, if the last role was erWipeTower we force export of GCodeProcessor::Height_Tag lines
|
||||||
bool last_was_wipe_tower = (m_last_processor_extrusion_role == erWipeTower);
|
bool last_was_wipe_tower = (m_last_processor_extrusion_role == erWipeTower);
|
||||||
#else
|
char buf[64];
|
||||||
if (m_enable_analyzer) {
|
|
||||||
// PrusaMultiMaterial::Writer may generate GCodeAnalyzer::Height_Tag and GCodeAnalyzer::Width_Tag lines without updating m_last_height and m_last_width
|
|
||||||
// so, if the last role was erWipeTower we force export of GCodeAnalyzer::Height_Tag and GCodeAnalyzer::Width_Tag lines
|
|
||||||
bool last_was_wipe_tower = (m_last_analyzer_extrusion_role == erWipeTower);
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
char buf[64];
|
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
if (path.role() != m_last_processor_extrusion_role) {
|
||||||
if (path.role() != m_last_processor_extrusion_role) {
|
m_last_processor_extrusion_role = path.role();
|
||||||
m_last_processor_extrusion_role = path.role();
|
sprintf(buf, ";%s%s\n", GCodeProcessor::Extrusion_Role_Tag.c_str(), ExtrusionEntity::role_to_string(m_last_processor_extrusion_role).c_str());
|
||||||
sprintf(buf, ";%s%s\n", GCodeProcessor::Extrusion_Role_Tag.c_str(), ExtrusionEntity::role_to_string(m_last_processor_extrusion_role).c_str());
|
gcode += buf;
|
||||||
gcode += buf;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
if (last_was_wipe_tower || (m_last_mm3_per_mm != path.mm3_per_mm)) {
|
if (last_was_wipe_tower || (m_last_mm3_per_mm != path.mm3_per_mm)) {
|
||||||
m_last_mm3_per_mm = path.mm3_per_mm;
|
m_last_mm3_per_mm = path.mm3_per_mm;
|
||||||
sprintf(buf, ";%s%f\n", GCodeProcessor::Mm3_Per_Mm_Tag.c_str(), m_last_mm3_per_mm);
|
sprintf(buf, ";%s%f\n", GCodeProcessor::Mm3_Per_Mm_Tag.c_str(), m_last_mm3_per_mm);
|
||||||
gcode += buf;
|
gcode += buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (last_was_wipe_tower || m_last_width != path.width) {
|
if (last_was_wipe_tower || m_last_width != path.width) {
|
||||||
m_last_width = path.width;
|
m_last_width = path.width;
|
||||||
sprintf(buf, ";%s%g\n", GCodeProcessor::Width_Tag.c_str(), m_last_width);
|
sprintf(buf, ";%s%g\n", GCodeProcessor::Width_Tag.c_str(), m_last_width);
|
||||||
gcode += buf;
|
gcode += buf;
|
||||||
}
|
}
|
||||||
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
|
|
||||||
if (last_was_wipe_tower || std::abs(m_last_height - path.height) > EPSILON) {
|
if (last_was_wipe_tower || std::abs(m_last_height - path.height) > EPSILON) {
|
||||||
m_last_height = path.height;
|
m_last_height = path.height;
|
||||||
sprintf(buf, ";%s%g\n", GCodeProcessor::Height_Tag.c_str(), m_last_height);
|
sprintf(buf, ";%s%g\n", GCodeProcessor::Height_Tag.c_str(), m_last_height);
|
||||||
gcode += buf;
|
gcode += buf;
|
||||||
}
|
|
||||||
#else
|
|
||||||
if (path.role() != m_last_analyzer_extrusion_role) {
|
|
||||||
m_last_analyzer_extrusion_role = path.role();
|
|
||||||
sprintf(buf, ";%s%d\n", GCodeAnalyzer::Extrusion_Role_Tag.c_str(), int(m_last_analyzer_extrusion_role));
|
|
||||||
gcode += buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (last_was_wipe_tower || (m_last_mm3_per_mm != path.mm3_per_mm)) {
|
|
||||||
m_last_mm3_per_mm = path.mm3_per_mm;
|
|
||||||
sprintf(buf, ";%s%f\n", GCodeAnalyzer::Mm3_Per_Mm_Tag.c_str(), m_last_mm3_per_mm);
|
|
||||||
gcode += buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (last_was_wipe_tower || m_last_width != path.width) {
|
|
||||||
m_last_width = path.width;
|
|
||||||
sprintf(buf, ";%s%f\n", GCodeAnalyzer::Width_Tag.c_str(), m_last_width);
|
|
||||||
gcode += buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (last_was_wipe_tower || m_last_height != path.height) {
|
|
||||||
m_last_height = path.height;
|
|
||||||
sprintf(buf, ";%s%f\n", GCodeAnalyzer::Height_Tag.c_str(), m_last_height);
|
|
||||||
gcode += buf;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
std::string comment;
|
std::string comment;
|
||||||
if (m_enable_cooling_markers) {
|
if (m_enable_cooling_markers) {
|
||||||
|
|
|
@ -14,12 +14,7 @@
|
||||||
#include "GCode/ToolOrdering.hpp"
|
#include "GCode/ToolOrdering.hpp"
|
||||||
#include "GCode/WipeTower.hpp"
|
#include "GCode/WipeTower.hpp"
|
||||||
#include "GCode/SeamPlacer.hpp"
|
#include "GCode/SeamPlacer.hpp"
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
#include "GCode/GCodeProcessor.hpp"
|
#include "GCode/GCodeProcessor.hpp"
|
||||||
#else
|
|
||||||
#include "GCode/Analyzer.hpp"
|
|
||||||
#include "GCodeTimeEstimator.hpp"
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
#include "EdgeGrid.hpp"
|
#include "EdgeGrid.hpp"
|
||||||
#include "GCode/ThumbnailData.hpp"
|
#include "GCode/ThumbnailData.hpp"
|
||||||
|
|
||||||
|
@ -34,9 +29,6 @@ namespace Slic3r {
|
||||||
|
|
||||||
// Forward declarations.
|
// Forward declarations.
|
||||||
class GCode;
|
class GCode;
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
class GCodePreviewData;
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
namespace { struct Item; }
|
namespace { struct Item; }
|
||||||
struct PrintInstance;
|
struct PrintInstance;
|
||||||
|
@ -146,14 +138,12 @@ private:
|
||||||
double m_last_wipe_tower_print_z = 0.f;
|
double m_last_wipe_tower_print_z = 0.f;
|
||||||
};
|
};
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
class ColorPrintColors
|
class ColorPrintColors
|
||||||
{
|
{
|
||||||
static const std::vector<std::string> Colors;
|
static const std::vector<std::string> Colors;
|
||||||
public:
|
public:
|
||||||
static const std::vector<std::string>& get() { return Colors; }
|
static const std::vector<std::string>& get() { return Colors; }
|
||||||
};
|
};
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
class GCode {
|
class GCode {
|
||||||
public:
|
public:
|
||||||
|
@ -161,13 +151,8 @@ public:
|
||||||
m_origin(Vec2d::Zero()),
|
m_origin(Vec2d::Zero()),
|
||||||
m_enable_loop_clipping(true),
|
m_enable_loop_clipping(true),
|
||||||
m_enable_cooling_markers(false),
|
m_enable_cooling_markers(false),
|
||||||
m_enable_extrusion_role_markers(false),
|
m_enable_extrusion_role_markers(false),
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
m_last_processor_extrusion_role(erNone),
|
m_last_processor_extrusion_role(erNone),
|
||||||
#else
|
|
||||||
m_enable_analyzer(false),
|
|
||||||
m_last_analyzer_extrusion_role(erNone),
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
m_layer_count(0),
|
m_layer_count(0),
|
||||||
m_layer_index(-1),
|
m_layer_index(-1),
|
||||||
m_layer(nullptr),
|
m_layer(nullptr),
|
||||||
|
@ -178,17 +163,8 @@ public:
|
||||||
m_last_mm3_per_mm(0.0),
|
m_last_mm3_per_mm(0.0),
|
||||||
m_last_width(0.0f),
|
m_last_width(0.0f),
|
||||||
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
m_last_mm3_per_mm(GCodeAnalyzer::Default_mm3_per_mm),
|
|
||||||
m_last_width(GCodeAnalyzer::Default_Width),
|
|
||||||
m_last_height(GCodeAnalyzer::Default_Height),
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
m_brim_done(false),
|
m_brim_done(false),
|
||||||
m_second_layer_things_done(false),
|
m_second_layer_things_done(false),
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
m_normal_time_estimator(GCodeTimeEstimator::Normal),
|
|
||||||
m_silent_time_estimator(GCodeTimeEstimator::Silent),
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
m_silent_time_estimator_enabled(false),
|
m_silent_time_estimator_enabled(false),
|
||||||
m_last_obj_copy(nullptr, Point(std::numeric_limits<coord_t>::max(), std::numeric_limits<coord_t>::max()))
|
m_last_obj_copy(nullptr, Point(std::numeric_limits<coord_t>::max(), std::numeric_limits<coord_t>::max()))
|
||||||
{}
|
{}
|
||||||
|
@ -196,11 +172,7 @@ public:
|
||||||
|
|
||||||
// throws std::runtime_exception on error,
|
// throws std::runtime_exception on error,
|
||||||
// throws CanceledException through print->throw_if_canceled().
|
// throws CanceledException through print->throw_if_canceled().
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
void do_export(Print* print, const char* path, GCodeProcessor::Result* result = nullptr, ThumbnailsGeneratorCallback thumbnail_cb = nullptr);
|
void do_export(Print* print, const char* path, GCodeProcessor::Result* result = nullptr, ThumbnailsGeneratorCallback thumbnail_cb = nullptr);
|
||||||
#else
|
|
||||||
void do_export(Print* print, const char* path, GCodePreviewData* preview_data = nullptr, ThumbnailsGeneratorCallback thumbnail_cb = nullptr);
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
// Exported for the helper classes (OozePrevention, Wipe) and for the Perl binding for unit tests.
|
// Exported for the helper classes (OozePrevention, Wipe) and for the Perl binding for unit tests.
|
||||||
const Vec2d& origin() const { return m_origin; }
|
const Vec2d& origin() const { return m_origin; }
|
||||||
|
@ -363,16 +335,8 @@ private:
|
||||||
// Markers for the Pressure Equalizer to recognize the extrusion type.
|
// Markers for the Pressure Equalizer to recognize the extrusion type.
|
||||||
// The Pressure Equalizer removes the markers from the final G-code.
|
// The Pressure Equalizer removes the markers from the final G-code.
|
||||||
bool m_enable_extrusion_role_markers;
|
bool m_enable_extrusion_role_markers;
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
// Keeps track of the last extrusion role passed to the processor
|
// Keeps track of the last extrusion role passed to the processor
|
||||||
ExtrusionRole m_last_processor_extrusion_role;
|
ExtrusionRole m_last_processor_extrusion_role;
|
||||||
#else
|
|
||||||
// Enableds the G-code Analyzer.
|
|
||||||
// Extended markers will be added during G-code generation.
|
|
||||||
// The G-code Analyzer will remove these comments from the final G-code.
|
|
||||||
bool m_enable_analyzer;
|
|
||||||
ExtrusionRole m_last_analyzer_extrusion_role;
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
// How many times will change_layer() be called?
|
// How many times will change_layer() be called?
|
||||||
// change_layer() will update the progress bar.
|
// change_layer() will update the progress bar.
|
||||||
unsigned int m_layer_count;
|
unsigned int m_layer_count;
|
||||||
|
@ -384,7 +348,6 @@ private:
|
||||||
double m_volumetric_speed;
|
double m_volumetric_speed;
|
||||||
// Support for the extrusion role markers. Which marker is active?
|
// Support for the extrusion role markers. Which marker is active?
|
||||||
ExtrusionRole m_last_extrusion_role;
|
ExtrusionRole m_last_extrusion_role;
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
// Support for G-Code Processor
|
// Support for G-Code Processor
|
||||||
float m_last_height{ 0.0f };
|
float m_last_height{ 0.0f };
|
||||||
float m_last_layer_z{ 0.0f };
|
float m_last_layer_z{ 0.0f };
|
||||||
|
@ -392,12 +355,6 @@ private:
|
||||||
double m_last_mm3_per_mm;
|
double m_last_mm3_per_mm;
|
||||||
float m_last_width{ 0.0f };
|
float m_last_width{ 0.0f };
|
||||||
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
#else
|
|
||||||
// Support for G-Code Analyzer
|
|
||||||
double m_last_mm3_per_mm;
|
|
||||||
float m_last_width;
|
|
||||||
float m_last_height;
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
Point m_last_pos;
|
Point m_last_pos;
|
||||||
bool m_last_pos_defined;
|
bool m_last_pos_defined;
|
||||||
|
@ -418,20 +375,10 @@ private:
|
||||||
// Index of a last object copy extruded.
|
// Index of a last object copy extruded.
|
||||||
std::pair<const PrintObject*, Point> m_last_obj_copy;
|
std::pair<const PrintObject*, Point> m_last_obj_copy;
|
||||||
|
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
// Time estimators
|
|
||||||
GCodeTimeEstimator m_normal_time_estimator;
|
|
||||||
GCodeTimeEstimator m_silent_time_estimator;
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
bool m_silent_time_estimator_enabled;
|
bool m_silent_time_estimator_enabled;
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
// Processor
|
// Processor
|
||||||
GCodeProcessor m_processor;
|
GCodeProcessor m_processor;
|
||||||
#else
|
|
||||||
// Analyzer
|
|
||||||
GCodeAnalyzer m_analyzer;
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
// Write a string into a file.
|
// Write a string into a file.
|
||||||
void _write(FILE* file, const std::string& what) { this->_write(file, what.c_str()); }
|
void _write(FILE* file, const std::string& what) { this->_write(file, what.c_str()); }
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
|
||||||
static const float INCHES_TO_MM = 25.4f;
|
static const float INCHES_TO_MM = 25.4f;
|
||||||
|
@ -508,6 +507,7 @@ void GCodeProcessor::apply_config(const PrintConfig& config)
|
||||||
m_flavor = config.gcode_flavor;
|
m_flavor = config.gcode_flavor;
|
||||||
|
|
||||||
size_t extruders_count = config.nozzle_diameter.values.size();
|
size_t extruders_count = config.nozzle_diameter.values.size();
|
||||||
|
m_result.extruders_count = extruders_count;
|
||||||
|
|
||||||
m_extruder_offsets.resize(extruders_count);
|
m_extruder_offsets.resize(extruders_count);
|
||||||
for (size_t i = 0; i < extruders_count; ++i) {
|
for (size_t i = 0; i < extruders_count; ++i) {
|
||||||
|
@ -561,9 +561,17 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config)
|
||||||
if (bed_shape != nullptr)
|
if (bed_shape != nullptr)
|
||||||
m_result.bed_shape = bed_shape->values;
|
m_result.bed_shape = bed_shape->values;
|
||||||
|
|
||||||
|
const ConfigOptionString* print_settings_id = config.option<ConfigOptionString>("print_settings_id");
|
||||||
|
if (print_settings_id != nullptr)
|
||||||
|
m_result.settings_ids.print = print_settings_id->value;
|
||||||
|
|
||||||
|
const ConfigOptionStrings* filament_settings_id = config.option<ConfigOptionStrings>("filament_settings_id");
|
||||||
|
if (filament_settings_id != nullptr)
|
||||||
|
m_result.settings_ids.filament = filament_settings_id->values;
|
||||||
|
|
||||||
const ConfigOptionString* printer_settings_id = config.option<ConfigOptionString>("printer_settings_id");
|
const ConfigOptionString* printer_settings_id = config.option<ConfigOptionString>("printer_settings_id");
|
||||||
if (printer_settings_id != nullptr)
|
if (printer_settings_id != nullptr)
|
||||||
m_result.printer_settings_id = printer_settings_id->value;
|
m_result.settings_ids.printer = printer_settings_id->value;
|
||||||
|
|
||||||
const ConfigOptionFloats* filament_diameters = config.option<ConfigOptionFloats>("filament_diameter");
|
const ConfigOptionFloats* filament_diameters = config.option<ConfigOptionFloats>("filament_diameter");
|
||||||
if (filament_diameters != nullptr) {
|
if (filament_diameters != nullptr) {
|
||||||
|
@ -572,6 +580,8 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_result.extruders_count = config.option<ConfigOptionFloats>("nozzle_diameter")->values.size();
|
||||||
|
|
||||||
const ConfigOptionPoints* extruder_offset = config.option<ConfigOptionPoints>("extruder_offset");
|
const ConfigOptionPoints* extruder_offset = config.option<ConfigOptionPoints>("extruder_offset");
|
||||||
if (extruder_offset != nullptr) {
|
if (extruder_offset != nullptr) {
|
||||||
m_extruder_offsets.resize(extruder_offset->values.size());
|
m_extruder_offsets.resize(extruder_offset->values.size());
|
||||||
|
@ -750,7 +760,7 @@ void GCodeProcessor::reset()
|
||||||
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
}
|
}
|
||||||
|
|
||||||
void GCodeProcessor::process_file(const std::string& filename, std::function<void()> cancel_callback)
|
void GCodeProcessor::process_file(const std::string& filename, bool apply_postprocess, std::function<void()> cancel_callback)
|
||||||
{
|
{
|
||||||
auto last_cancel_callback_time = std::chrono::high_resolution_clock::now();
|
auto last_cancel_callback_time = std::chrono::high_resolution_clock::now();
|
||||||
|
|
||||||
|
@ -808,7 +818,8 @@ void GCodeProcessor::process_file(const std::string& filename, std::function<voi
|
||||||
update_estimated_times_stats();
|
update_estimated_times_stats();
|
||||||
|
|
||||||
// post-process to add M73 lines into the gcode
|
// post-process to add M73 lines into the gcode
|
||||||
m_time_processor.post_process(filename);
|
if (apply_postprocess)
|
||||||
|
m_time_processor.post_process(filename);
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
std::cout << "\n";
|
std::cout << "\n";
|
||||||
|
@ -2216,4 +2227,3 @@ void GCodeProcessor::update_estimated_times_stats()
|
||||||
|
|
||||||
} /* namespace Slic3r */
|
} /* namespace Slic3r */
|
||||||
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#ifndef slic3r_GCodeProcessor_hpp_
|
#ifndef slic3r_GCodeProcessor_hpp_
|
||||||
#define slic3r_GCodeProcessor_hpp_
|
#define slic3r_GCodeProcessor_hpp_
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
#include "libslic3r/GCodeReader.hpp"
|
#include "libslic3r/GCodeReader.hpp"
|
||||||
#include "libslic3r/Point.hpp"
|
#include "libslic3r/Point.hpp"
|
||||||
#include "libslic3r/ExtrusionEntity.hpp"
|
#include "libslic3r/ExtrusionEntity.hpp"
|
||||||
|
@ -266,10 +265,24 @@ namespace Slic3r {
|
||||||
|
|
||||||
struct Result
|
struct Result
|
||||||
{
|
{
|
||||||
|
struct SettingsIds
|
||||||
|
{
|
||||||
|
std::string print;
|
||||||
|
std::vector<std::string> filament;
|
||||||
|
std::string printer;
|
||||||
|
|
||||||
|
void reset()
|
||||||
|
{
|
||||||
|
print = "";
|
||||||
|
filament = std::vector<std::string>();
|
||||||
|
printer = "";
|
||||||
|
}
|
||||||
|
};
|
||||||
unsigned int id;
|
unsigned int id;
|
||||||
std::vector<MoveVertex> moves;
|
std::vector<MoveVertex> moves;
|
||||||
Pointfs bed_shape;
|
Pointfs bed_shape;
|
||||||
std::string printer_settings_id;
|
SettingsIds settings_ids;
|
||||||
|
size_t extruders_count;
|
||||||
std::vector<std::string> extruder_colors;
|
std::vector<std::string> extruder_colors;
|
||||||
PrintEstimatedTimeStatistics time_statistics;
|
PrintEstimatedTimeStatistics time_statistics;
|
||||||
|
|
||||||
|
@ -281,6 +294,8 @@ namespace Slic3r {
|
||||||
moves = std::vector<MoveVertex>();
|
moves = std::vector<MoveVertex>();
|
||||||
bed_shape = Pointfs();
|
bed_shape = Pointfs();
|
||||||
extruder_colors = std::vector<std::string>();
|
extruder_colors = std::vector<std::string>();
|
||||||
|
extruders_count = 0;
|
||||||
|
settings_ids.reset();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
void reset()
|
void reset()
|
||||||
|
@ -288,6 +303,8 @@ namespace Slic3r {
|
||||||
moves = std::vector<MoveVertex>();
|
moves = std::vector<MoveVertex>();
|
||||||
bed_shape = Pointfs();
|
bed_shape = Pointfs();
|
||||||
extruder_colors = std::vector<std::string>();
|
extruder_colors = std::vector<std::string>();
|
||||||
|
extruders_count = 0;
|
||||||
|
settings_ids.reset();
|
||||||
}
|
}
|
||||||
#endif // ENABLE_GCODE_VIEWER_STATISTICS
|
#endif // ENABLE_GCODE_VIEWER_STATISTICS
|
||||||
};
|
};
|
||||||
|
@ -433,7 +450,7 @@ namespace Slic3r {
|
||||||
|
|
||||||
// Process the gcode contained in the file with the given filename
|
// Process the gcode contained in the file with the given filename
|
||||||
// throws CanceledException through print->throw_if_canceled() (sent by the caller as callback).
|
// throws CanceledException through print->throw_if_canceled() (sent by the caller as callback).
|
||||||
void process_file(const std::string& filename, std::function<void()> cancel_callback = nullptr);
|
void process_file(const std::string& filename, bool apply_postprocess, std::function<void()> cancel_callback = nullptr);
|
||||||
|
|
||||||
float get_time(PrintEstimatedTimeStatistics::ETimeMode mode) const;
|
float get_time(PrintEstimatedTimeStatistics::ETimeMode mode) const;
|
||||||
std::string get_time_dhm(PrintEstimatedTimeStatistics::ETimeMode mode) const;
|
std::string get_time_dhm(PrintEstimatedTimeStatistics::ETimeMode mode) const;
|
||||||
|
@ -566,8 +583,6 @@ namespace Slic3r {
|
||||||
|
|
||||||
} /* namespace Slic3r */
|
} /* namespace Slic3r */
|
||||||
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
#endif /* slic3r_GCodeProcessor_hpp_ */
|
#endif /* slic3r_GCodeProcessor_hpp_ */
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,521 +0,0 @@
|
||||||
#include "PreviewData.hpp"
|
|
||||||
#include <I18N.hpp>
|
|
||||||
#include "Utils.hpp"
|
|
||||||
|
|
||||||
#include <boost/format.hpp>
|
|
||||||
|
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
//! macro used to mark string used at localization,
|
|
||||||
#define L(s) (s)
|
|
||||||
|
|
||||||
namespace Slic3r {
|
|
||||||
|
|
||||||
std::vector<unsigned char> Color::as_bytes() const
|
|
||||||
{
|
|
||||||
std::vector<unsigned char> ret;
|
|
||||||
for (unsigned int i = 0; i < 4; ++i)
|
|
||||||
{
|
|
||||||
ret.push_back((unsigned char)(255.0f * rgba[i]));
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
GCodePreviewData::Extrusion::Layer::Layer(float z, const Paths& paths)
|
|
||||||
: z(z)
|
|
||||||
, paths(paths)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
GCodePreviewData::Travel::Polyline::Polyline(EType type, EDirection direction, float feedrate, unsigned int extruder_id, const Polyline3& polyline)
|
|
||||||
: type(type)
|
|
||||||
, direction(direction)
|
|
||||||
, feedrate(feedrate)
|
|
||||||
, extruder_id(extruder_id)
|
|
||||||
, polyline(polyline)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
GCodePreviewData::Range::Range()
|
|
||||||
{
|
|
||||||
reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
void GCodePreviewData::Range::reset()
|
|
||||||
{
|
|
||||||
min_val = FLT_MAX;
|
|
||||||
max_val = -FLT_MAX;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GCodePreviewData::Range::empty() const
|
|
||||||
{
|
|
||||||
return min_val >= max_val;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GCodePreviewData::Range::update_from(float value)
|
|
||||||
{
|
|
||||||
min_val = std::min(min_val, value);
|
|
||||||
max_val = std::max(max_val, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GCodePreviewData::Range::update_from(const RangeBase& other)
|
|
||||||
{
|
|
||||||
min_val = std::min(min_val, other.min());
|
|
||||||
max_val = std::max(max_val, other.max());
|
|
||||||
}
|
|
||||||
|
|
||||||
float GCodePreviewData::RangeBase::step_size() const
|
|
||||||
{
|
|
||||||
return (max() - min()) / static_cast<float>(range_rainbow_colors.size() - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
Color GCodePreviewData::RangeBase::get_color_at(float value) const
|
|
||||||
{
|
|
||||||
// Input value scaled to the color range
|
|
||||||
float step = step_size();
|
|
||||||
const float global_t = (step != 0.0f) ? std::max(0.0f, value - min()) / step : 0.0f; // lower limit of 0.0f
|
|
||||||
|
|
||||||
constexpr std::size_t color_max_idx = range_rainbow_colors.size() - 1;
|
|
||||||
|
|
||||||
// Compute the two colors just below (low) and above (high) the input value
|
|
||||||
const std::size_t color_low_idx = std::clamp(static_cast<std::size_t>(global_t), std::size_t{ 0 }, color_max_idx);
|
|
||||||
const std::size_t color_high_idx = std::clamp(color_low_idx + 1, std::size_t{ 0 }, color_max_idx);
|
|
||||||
|
|
||||||
// Compute how far the value is between the low and high colors so that they can be interpolated
|
|
||||||
const float local_t = std::min(global_t - static_cast<float>(color_low_idx), 1.0f); // upper limit of 1.0f
|
|
||||||
|
|
||||||
// Interpolate between the low and high colors in RGB space to find exactly which color the input value should get
|
|
||||||
Color ret;
|
|
||||||
for (unsigned int i = 0; i < 4; ++i)
|
|
||||||
{
|
|
||||||
ret.rgba[i] = lerp(range_rainbow_colors[color_low_idx].rgba[i], range_rainbow_colors[color_high_idx].rgba[i], local_t);
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
float GCodePreviewData::Range::min() const
|
|
||||||
{
|
|
||||||
return min_val;
|
|
||||||
}
|
|
||||||
|
|
||||||
float GCodePreviewData::Range::max() const
|
|
||||||
{
|
|
||||||
return max_val;
|
|
||||||
}
|
|
||||||
|
|
||||||
GCodePreviewData::LegendItem::LegendItem(const std::string& text, const Color& color)
|
|
||||||
: text(text)
|
|
||||||
, color(color)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
const Color GCodePreviewData::Extrusion::Default_Extrusion_Role_Colors[erCount] =
|
|
||||||
{
|
|
||||||
Color(0.0f, 0.0f, 0.0f, 1.0f), // erNone
|
|
||||||
Color(1.0f, 0.0f, 0.0f, 1.0f), // erPerimeter
|
|
||||||
Color(0.0f, 1.0f, 0.0f, 1.0f), // erExternalPerimeter
|
|
||||||
Color(0.0f, 0.0f, 1.0f, 1.0f), // erOverhangPerimeter
|
|
||||||
Color(1.0f, 1.0f, 0.0f, 1.0f), // erInternalInfill
|
|
||||||
Color(1.0f, 0.0f, 1.0f, 1.0f), // erSolidInfill
|
|
||||||
Color(0.0f, 1.0f, 1.0f, 1.0f), // erTopSolidInfill
|
|
||||||
// Color(1.0f, 0.7f, 0.61f, 1.0f), // erIroning
|
|
||||||
Color(1.0f, 0.55f, 0.41f, 1.0f), // erIroning
|
|
||||||
Color(0.5f, 0.5f, 0.5f, 1.0f), // erBridgeInfill
|
|
||||||
Color(1.0f, 1.0f, 1.0f, 1.0f), // erGapFill
|
|
||||||
Color(0.5f, 0.0f, 0.0f, 1.0f), // erSkirt
|
|
||||||
Color(0.0f, 0.5f, 0.0f, 1.0f), // erSupportMaterial
|
|
||||||
Color(0.0f, 0.0f, 0.5f, 1.0f), // erSupportMaterialInterface
|
|
||||||
Color(0.7f, 0.89f, 0.67f, 1.0f), // erWipeTower
|
|
||||||
Color(1.0f, 1.0f, 0.0f, 1.0f), // erCustom
|
|
||||||
Color(0.0f, 0.0f, 0.0f, 1.0f) // erMixed
|
|
||||||
};
|
|
||||||
|
|
||||||
const GCodePreviewData::Extrusion::EViewType GCodePreviewData::Extrusion::Default_View_Type = GCodePreviewData::Extrusion::FeatureType;
|
|
||||||
|
|
||||||
void GCodePreviewData::Extrusion::set_default()
|
|
||||||
{
|
|
||||||
view_type = Default_View_Type;
|
|
||||||
|
|
||||||
::memcpy((void*)role_colors, (const void*)Default_Extrusion_Role_Colors, erCount * sizeof(Color));
|
|
||||||
|
|
||||||
for (unsigned int i = 0; i < erCount; ++i)
|
|
||||||
role_names[i] = ExtrusionEntity::role_to_string(ExtrusionRole(i));
|
|
||||||
|
|
||||||
role_flags = 0;
|
|
||||||
for (unsigned int i = 0; i < erCount; ++i)
|
|
||||||
role_flags |= 1 << i;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GCodePreviewData::Extrusion::is_role_flag_set(ExtrusionRole role) const
|
|
||||||
{
|
|
||||||
return is_role_flag_set(role_flags, role);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GCodePreviewData::Extrusion::is_role_flag_set(unsigned int flags, ExtrusionRole role)
|
|
||||||
{
|
|
||||||
return GCodeAnalyzer::is_valid_extrusion_role(role) && (flags & (1 << (role - erPerimeter))) != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t GCodePreviewData::Extrusion::memory_used() const
|
|
||||||
{
|
|
||||||
size_t out = sizeof(*this);
|
|
||||||
out += SLIC3R_STDVEC_MEMSIZE(this->layers, Layer);
|
|
||||||
for (const Layer &layer : this->layers) {
|
|
||||||
out += SLIC3R_STDVEC_MEMSIZE(layer.paths, Path);
|
|
||||||
for (const Path &path : layer.paths)
|
|
||||||
out += SLIC3R_STDVEC_MEMSIZE(path.polyline.points, Point);
|
|
||||||
}
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
const float GCodePreviewData::Travel::Default_Width = 0.075f;
|
|
||||||
const float GCodePreviewData::Travel::Default_Height = 0.075f;
|
|
||||||
const Color GCodePreviewData::Travel::Default_Type_Colors[Num_Types] =
|
|
||||||
{
|
|
||||||
Color(0.0f, 0.0f, 0.75f, 1.0f), // Move
|
|
||||||
Color(0.0f, 0.75f, 0.0f, 1.0f), // Extrude
|
|
||||||
Color(0.75f, 0.0f, 0.0f, 1.0f), // Retract
|
|
||||||
};
|
|
||||||
|
|
||||||
void GCodePreviewData::Travel::set_default()
|
|
||||||
{
|
|
||||||
width = Default_Width;
|
|
||||||
height = Default_Height;
|
|
||||||
::memcpy((void*)type_colors, (const void*)Default_Type_Colors, Num_Types * sizeof(Color));
|
|
||||||
color_print_idx = 0;
|
|
||||||
|
|
||||||
is_visible = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t GCodePreviewData::Travel::memory_used() const
|
|
||||||
{
|
|
||||||
size_t out = sizeof(*this);
|
|
||||||
out += SLIC3R_STDVEC_MEMSIZE(this->polylines, Polyline);
|
|
||||||
for (const Polyline &polyline : this->polylines)
|
|
||||||
out += SLIC3R_STDVEC_MEMSIZE(polyline.polyline.points, Vec3crd);
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Color GCodePreviewData::Retraction::Default_Color = Color(1.0f, 1.0f, 1.0f, 1.0f);
|
|
||||||
|
|
||||||
GCodePreviewData::Retraction::Position::Position(const Vec3crd& position, float width, float height)
|
|
||||||
: position(position)
|
|
||||||
, width(width)
|
|
||||||
, height(height)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void GCodePreviewData::Retraction::set_default()
|
|
||||||
{
|
|
||||||
color = Default_Color;
|
|
||||||
is_visible = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t GCodePreviewData::Retraction::memory_used() const
|
|
||||||
{
|
|
||||||
return sizeof(*this) + SLIC3R_STDVEC_MEMSIZE(this->positions, Position);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GCodePreviewData::Shell::set_default()
|
|
||||||
{
|
|
||||||
is_visible = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
GCodePreviewData::GCodePreviewData()
|
|
||||||
{
|
|
||||||
set_default();
|
|
||||||
}
|
|
||||||
|
|
||||||
void GCodePreviewData::set_default()
|
|
||||||
{
|
|
||||||
extrusion.set_default();
|
|
||||||
travel.set_default();
|
|
||||||
retraction.set_default();
|
|
||||||
unretraction.set_default();
|
|
||||||
shell.set_default();
|
|
||||||
|
|
||||||
// Configure the color range for feedrate to match the default for travels and to enable extrusions since they are always visible
|
|
||||||
ranges.feedrate.set_mode(FeedrateKind::TRAVEL, travel.is_visible);
|
|
||||||
ranges.feedrate.set_mode(FeedrateKind::EXTRUSION, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GCodePreviewData::reset()
|
|
||||||
{
|
|
||||||
ranges.width.reset();
|
|
||||||
ranges.height.reset();
|
|
||||||
ranges.feedrate.reset();
|
|
||||||
ranges.fan_speed.reset();
|
|
||||||
ranges.volumetric_rate.reset();
|
|
||||||
extrusion.layers.clear();
|
|
||||||
travel.polylines.clear();
|
|
||||||
retraction.positions.clear();
|
|
||||||
unretraction.positions.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GCodePreviewData::empty() const
|
|
||||||
{
|
|
||||||
return extrusion.layers.empty() && travel.polylines.empty() && retraction.positions.empty() && unretraction.positions.empty();
|
|
||||||
}
|
|
||||||
|
|
||||||
Color GCodePreviewData::get_extrusion_role_color(ExtrusionRole role) const
|
|
||||||
{
|
|
||||||
return extrusion.role_colors[role];
|
|
||||||
}
|
|
||||||
|
|
||||||
Color GCodePreviewData::get_height_color(float height) const
|
|
||||||
{
|
|
||||||
return ranges.height.get_color_at(height);
|
|
||||||
}
|
|
||||||
|
|
||||||
Color GCodePreviewData::get_width_color(float width) const
|
|
||||||
{
|
|
||||||
return ranges.width.get_color_at(width);
|
|
||||||
}
|
|
||||||
|
|
||||||
Color GCodePreviewData::get_feedrate_color(float feedrate) const
|
|
||||||
{
|
|
||||||
return ranges.feedrate.get_color_at(feedrate);
|
|
||||||
}
|
|
||||||
|
|
||||||
Color GCodePreviewData::get_fan_speed_color(float fan_speed) const
|
|
||||||
{
|
|
||||||
return ranges.fan_speed.get_color_at(fan_speed);
|
|
||||||
}
|
|
||||||
|
|
||||||
Color GCodePreviewData::get_volumetric_rate_color(float rate) const
|
|
||||||
{
|
|
||||||
return ranges.volumetric_rate.get_color_at(rate);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GCodePreviewData::set_extrusion_role_color(const std::string& role_name, float red, float green, float blue, float alpha)
|
|
||||||
{
|
|
||||||
for (unsigned int i = 0; i < erCount; ++i)
|
|
||||||
{
|
|
||||||
if (role_name == extrusion.role_names[i])
|
|
||||||
{
|
|
||||||
extrusion.role_colors[i] = Color(red, green, blue, alpha);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void GCodePreviewData::set_extrusion_paths_colors(const std::vector<std::string>& colors)
|
|
||||||
{
|
|
||||||
unsigned int size = (unsigned int)colors.size();
|
|
||||||
|
|
||||||
if (size % 2 != 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (unsigned int i = 0; i < size; i += 2)
|
|
||||||
{
|
|
||||||
const std::string& color_str = colors[i + 1];
|
|
||||||
|
|
||||||
if (color_str.size() == 6)
|
|
||||||
{
|
|
||||||
bool valid = true;
|
|
||||||
for (int c = 0; c < 6; ++c)
|
|
||||||
{
|
|
||||||
if (::isxdigit(color_str[c]) == 0)
|
|
||||||
{
|
|
||||||
valid = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (valid)
|
|
||||||
{
|
|
||||||
unsigned int color;
|
|
||||||
std::stringstream ss;
|
|
||||||
ss << std::hex << color_str;
|
|
||||||
ss >> color;
|
|
||||||
|
|
||||||
float den = 1.0f / 255.0f;
|
|
||||||
|
|
||||||
float r = (float)((color & 0xFF0000) >> 16) * den;
|
|
||||||
float g = (float)((color & 0x00FF00) >> 8) * den;
|
|
||||||
float b = (float)(color & 0x0000FF) * den;
|
|
||||||
|
|
||||||
this->set_extrusion_role_color(colors[i], r, g, b, 1.0f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string GCodePreviewData::get_legend_title() const
|
|
||||||
{
|
|
||||||
switch (extrusion.view_type)
|
|
||||||
{
|
|
||||||
case Extrusion::FeatureType:
|
|
||||||
return L("Feature type");
|
|
||||||
case Extrusion::Height:
|
|
||||||
return L("Height (mm)");
|
|
||||||
case Extrusion::Width:
|
|
||||||
return L("Width (mm)");
|
|
||||||
case Extrusion::Feedrate:
|
|
||||||
return L("Speed (mm/s)");
|
|
||||||
case Extrusion::FanSpeed:
|
|
||||||
return L("Fan Speed (%)");
|
|
||||||
case Extrusion::VolumetricRate:
|
|
||||||
return L("Volumetric flow rate (mm³/s)");
|
|
||||||
case Extrusion::Tool:
|
|
||||||
return L("Tool");
|
|
||||||
case Extrusion::ColorPrint:
|
|
||||||
return L("Color Print");
|
|
||||||
case Extrusion::Num_View_Types:
|
|
||||||
break; // just to supress warning about non-handled value
|
|
||||||
}
|
|
||||||
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
GCodePreviewData::LegendItemsList GCodePreviewData::get_legend_items(const std::vector<float>& tool_colors,
|
|
||||||
const std::vector<std::string>& cp_items) const
|
|
||||||
{
|
|
||||||
struct Helper
|
|
||||||
{
|
|
||||||
static void FillListFromRange(LegendItemsList& list, const RangeBase& range, unsigned int decimals, float scale_factor)
|
|
||||||
{
|
|
||||||
list.reserve(range_rainbow_colors.size());
|
|
||||||
|
|
||||||
float step = range.step_size();
|
|
||||||
if (step == 0.0f)
|
|
||||||
{
|
|
||||||
char buf[1024];
|
|
||||||
sprintf(buf, "%.*f", decimals, scale_factor * range.min());
|
|
||||||
list.emplace_back(buf, range_rainbow_colors[0]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (int i = static_cast<int>(range_rainbow_colors.size()) - 1; i >= 0; --i)
|
|
||||||
{
|
|
||||||
char buf[1024];
|
|
||||||
sprintf(buf, "%.*f", decimals, scale_factor * (range.min() + (float)i * step));
|
|
||||||
list.emplace_back(buf, range_rainbow_colors[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
LegendItemsList items;
|
|
||||||
|
|
||||||
switch (extrusion.view_type)
|
|
||||||
{
|
|
||||||
case Extrusion::FeatureType:
|
|
||||||
{
|
|
||||||
ExtrusionRole first_valid = erPerimeter;
|
|
||||||
ExtrusionRole last_valid = erCustom;
|
|
||||||
|
|
||||||
items.reserve(last_valid - first_valid + 1);
|
|
||||||
for (unsigned int i = (unsigned int)first_valid; i <= (unsigned int)last_valid; ++i)
|
|
||||||
{
|
|
||||||
items.emplace_back(Slic3r::I18N::translate(extrusion.role_names[i]), extrusion.role_colors[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case Extrusion::Height:
|
|
||||||
{
|
|
||||||
Helper::FillListFromRange(items, ranges.height, 3, 1.0f);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case Extrusion::Width:
|
|
||||||
{
|
|
||||||
Helper::FillListFromRange(items, ranges.width, 3, 1.0f);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case Extrusion::Feedrate:
|
|
||||||
{
|
|
||||||
Helper::FillListFromRange(items, ranges.feedrate, 1, 1.0f);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case Extrusion::FanSpeed:
|
|
||||||
{
|
|
||||||
Helper::FillListFromRange(items, ranges.fan_speed, 0, 1.0f);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case Extrusion::VolumetricRate:
|
|
||||||
{
|
|
||||||
Helper::FillListFromRange(items, ranges.volumetric_rate, 3, 1.0f);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case Extrusion::Tool:
|
|
||||||
{
|
|
||||||
unsigned int tools_colors_count = (unsigned int)tool_colors.size() / 4;
|
|
||||||
items.reserve(tools_colors_count);
|
|
||||||
for (unsigned int i = 0; i < tools_colors_count; ++i)
|
|
||||||
{
|
|
||||||
Color color;
|
|
||||||
::memcpy((void*)color.rgba.data(), (const void*)(tool_colors.data() + i * 4), 4 * sizeof(float));
|
|
||||||
items.emplace_back((boost::format(Slic3r::I18N::translate(L("Extruder %d"))) % (i + 1)).str(), color);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case Extrusion::ColorPrint:
|
|
||||||
{
|
|
||||||
const int color_cnt = (int)tool_colors.size()/4;
|
|
||||||
const auto color_print_cnt = (int)cp_items.size();
|
|
||||||
if (color_print_cnt == 1) // means "Default print color"
|
|
||||||
{
|
|
||||||
Color color;
|
|
||||||
::memcpy((void*)color.rgba.data(), (const void*)(tool_colors.data()), 4 * sizeof(float));
|
|
||||||
|
|
||||||
items.emplace_back(cp_items[0], color);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (color_cnt != color_print_cnt)
|
|
||||||
break;
|
|
||||||
|
|
||||||
for (int i = 0 ; i < color_print_cnt; ++i)
|
|
||||||
{
|
|
||||||
Color color;
|
|
||||||
::memcpy((void*)color.rgba.data(), (const void*)(tool_colors.data() + i * 4), 4 * sizeof(float));
|
|
||||||
|
|
||||||
items.emplace_back(cp_items[i], color);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case Extrusion::Num_View_Types:
|
|
||||||
break; // just to supress warning about non-handled value
|
|
||||||
}
|
|
||||||
|
|
||||||
return items;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return an estimate of the memory consumed by the time estimator.
|
|
||||||
size_t GCodePreviewData::memory_used() const
|
|
||||||
{
|
|
||||||
return
|
|
||||||
this->extrusion.memory_used() +
|
|
||||||
this->travel.memory_used() +
|
|
||||||
this->retraction.memory_used() +
|
|
||||||
this->unretraction.memory_used() +
|
|
||||||
sizeof(shell) + sizeof(ranges);
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::vector<std::string>& GCodePreviewData::ColorPrintColors()
|
|
||||||
{
|
|
||||||
static std::vector<std::string> color_print = {"#C0392B", "#E67E22", "#F1C40F", "#27AE60", "#1ABC9C", "#2980B9", "#9B59B6"};
|
|
||||||
return color_print;
|
|
||||||
}
|
|
||||||
|
|
||||||
Color operator + (const Color& c1, const Color& c2)
|
|
||||||
{
|
|
||||||
return Color(std::clamp(c1.rgba[0] + c2.rgba[0], 0.0f, 1.0f),
|
|
||||||
std::clamp(c1.rgba[1] + c2.rgba[1], 0.0f, 1.0f),
|
|
||||||
std::clamp(c1.rgba[2] + c2.rgba[2], 0.0f, 1.0f),
|
|
||||||
std::clamp(c1.rgba[3] + c2.rgba[3], 0.0f, 1.0f));
|
|
||||||
}
|
|
||||||
|
|
||||||
Color operator * (float f, const Color& color)
|
|
||||||
{
|
|
||||||
return Color(std::clamp(f * color.rgba[0], 0.0f, 1.0f),
|
|
||||||
std::clamp(f * color.rgba[1], 0.0f, 1.0f),
|
|
||||||
std::clamp(f * color.rgba[2], 0.0f, 1.0f),
|
|
||||||
std::clamp(f * color.rgba[3], 0.0f, 1.0f));
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Slic3r
|
|
||||||
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
|
@ -1,398 +0,0 @@
|
||||||
#ifndef slic3r_GCode_PreviewData_hpp_
|
|
||||||
#define slic3r_GCode_PreviewData_hpp_
|
|
||||||
|
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
#include "../libslic3r.h"
|
|
||||||
#include "../ExtrusionEntity.hpp"
|
|
||||||
#include "../Point.hpp"
|
|
||||||
|
|
||||||
#include <tuple>
|
|
||||||
#include <array>
|
|
||||||
#include <vector>
|
|
||||||
#include <bitset>
|
|
||||||
#include <cstddef>
|
|
||||||
#include <algorithm>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include <float.h>
|
|
||||||
|
|
||||||
namespace Slic3r {
|
|
||||||
|
|
||||||
// Represents an RGBA color
|
|
||||||
struct Color
|
|
||||||
{
|
|
||||||
std::array<float,4> rgba;
|
|
||||||
|
|
||||||
Color(const float *argba)
|
|
||||||
{
|
|
||||||
memcpy(this->rgba.data(), argba, sizeof(float) * 4);
|
|
||||||
}
|
|
||||||
constexpr Color(float r = 1.f, float g = 1.f, float b = 1.f, float a = 1.f) : rgba{r,g,b,a}
|
|
||||||
{
|
|
||||||
// Intentionally empty
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<unsigned char> as_bytes() const;
|
|
||||||
};
|
|
||||||
Color operator + (const Color& c1, const Color& c2);
|
|
||||||
Color operator * (float f, const Color& color);
|
|
||||||
|
|
||||||
// Default colors for Ranges
|
|
||||||
constexpr std::array<Color, 10> range_rainbow_colors{
|
|
||||||
Color{0.043f, 0.173f, 0.478f, 1.0f},
|
|
||||||
Color{0.075f, 0.349f, 0.522f, 1.0f},
|
|
||||||
Color{0.110f, 0.533f, 0.569f, 1.0f},
|
|
||||||
Color{0.016f, 0.839f, 0.059f, 1.0f},
|
|
||||||
Color{0.667f, 0.949f, 0.000f, 1.0f},
|
|
||||||
Color{0.988f, 0.975f, 0.012f, 1.0f},
|
|
||||||
Color{0.961f, 0.808f, 0.039f, 1.0f},
|
|
||||||
Color{0.890f, 0.533f, 0.125f, 1.0f},
|
|
||||||
Color{0.820f, 0.408f, 0.188f, 1.0f},
|
|
||||||
Color{0.761f, 0.322f, 0.235f, 1.0f}};
|
|
||||||
|
|
||||||
class GCodePreviewData
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Color mapping to convert a float into a smooth rainbow of 10 colors.
|
|
||||||
class RangeBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual void reset() = 0;
|
|
||||||
virtual bool empty() const = 0;
|
|
||||||
virtual float min() const = 0;
|
|
||||||
virtual float max() const = 0;
|
|
||||||
|
|
||||||
// Gets the step size using min(), max() and colors
|
|
||||||
float step_size() const;
|
|
||||||
|
|
||||||
// Gets the color at a value using colors, min(), and max()
|
|
||||||
Color get_color_at(float value) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Color mapping converting a float in a range between a min and a max into a smooth rainbow of 10 colors.
|
|
||||||
class Range : public RangeBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Range();
|
|
||||||
|
|
||||||
// RangeBase Overrides
|
|
||||||
void reset() override;
|
|
||||||
bool empty() const override;
|
|
||||||
float min() const override;
|
|
||||||
float max() const override;
|
|
||||||
|
|
||||||
// Range-specific methods
|
|
||||||
void update_from(float value);
|
|
||||||
void update_from(const RangeBase& other);
|
|
||||||
|
|
||||||
private:
|
|
||||||
float min_val;
|
|
||||||
float max_val;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Like Range, but stores multiple ranges internally that are used depending on mode.
|
|
||||||
// Template param EnumRangeType must be an enum with values for each type of range that needs to be tracked in this MultiRange.
|
|
||||||
// The last enum value should be num_values. The numerical values of all enum values should range from 0 to num_values.
|
|
||||||
template <typename EnumRangeType>
|
|
||||||
class MultiRange : public RangeBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
void reset() override
|
|
||||||
{
|
|
||||||
bounds = decltype(bounds){};
|
|
||||||
}
|
|
||||||
|
|
||||||
bool empty() const override
|
|
||||||
{
|
|
||||||
for (std::size_t i = 0; i < bounds.size(); ++i)
|
|
||||||
{
|
|
||||||
if (bounds[i].min != bounds[i].max)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
float min() const override
|
|
||||||
{
|
|
||||||
float min = FLT_MAX;
|
|
||||||
for (std::size_t i = 0; i < bounds.size(); ++i)
|
|
||||||
{
|
|
||||||
// Only use bounds[i] if the current mode includes it
|
|
||||||
if (mode.test(i))
|
|
||||||
{
|
|
||||||
min = std::min(min, bounds[i].min);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return min;
|
|
||||||
}
|
|
||||||
|
|
||||||
float max() const override
|
|
||||||
{
|
|
||||||
float max = -FLT_MAX;
|
|
||||||
for (std::size_t i = 0; i < bounds.size(); ++i)
|
|
||||||
{
|
|
||||||
// Only use bounds[i] if the current mode includes it
|
|
||||||
if (mode.test(i))
|
|
||||||
{
|
|
||||||
max = std::max(max, bounds[i].max);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return max;
|
|
||||||
}
|
|
||||||
|
|
||||||
void update_from(const float value, EnumRangeType range_type_value)
|
|
||||||
{
|
|
||||||
bounds[static_cast<std::size_t>(range_type_value)].update_from(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
void update_from(const MultiRange& other)
|
|
||||||
{
|
|
||||||
for (std::size_t i = 0; i < bounds.size(); ++i)
|
|
||||||
{
|
|
||||||
bounds[i].update_from(other.bounds[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void set_mode(const EnumRangeType range_type_value, const bool enable)
|
|
||||||
{
|
|
||||||
mode.set(static_cast<std::size_t>(range_type_value), enable);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
// Interval bounds
|
|
||||||
struct Bounds
|
|
||||||
{
|
|
||||||
float min{FLT_MAX};
|
|
||||||
float max{-FLT_MAX};
|
|
||||||
void update_from(const float value)
|
|
||||||
{
|
|
||||||
min = std::min(min, value);
|
|
||||||
max = std::max(max, value);
|
|
||||||
}
|
|
||||||
void update_from(const Bounds other_bounds)
|
|
||||||
{
|
|
||||||
min = std::min(min, other_bounds.min);
|
|
||||||
max = std::max(max, other_bounds.max);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
std::array<Bounds, static_cast<std::size_t>(EnumRangeType::num_values)> bounds;
|
|
||||||
std::bitset<static_cast<std::size_t>(EnumRangeType::num_values)> mode;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Enum distinguishing different kinds of feedrate data
|
|
||||||
enum class FeedrateKind
|
|
||||||
{
|
|
||||||
EXTRUSION = 0, // values must go from 0 up to num_values
|
|
||||||
TRAVEL,
|
|
||||||
num_values //must be last in the list of values
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Ranges
|
|
||||||
{
|
|
||||||
// Color mapping by layer height.
|
|
||||||
Range height;
|
|
||||||
// Color mapping by extrusion width.
|
|
||||||
Range width;
|
|
||||||
// Color mapping by feedrate.
|
|
||||||
MultiRange<FeedrateKind> feedrate;
|
|
||||||
// Color mapping by fan speed.
|
|
||||||
Range fan_speed;
|
|
||||||
// Color mapping by volumetric extrusion rate.
|
|
||||||
Range volumetric_rate;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct LegendItem
|
|
||||||
{
|
|
||||||
std::string text;
|
|
||||||
Color color;
|
|
||||||
|
|
||||||
LegendItem(const std::string& text, const Color& color);
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef std::vector<LegendItem> LegendItemsList;
|
|
||||||
|
|
||||||
struct Extrusion
|
|
||||||
{
|
|
||||||
enum EViewType : unsigned char
|
|
||||||
{
|
|
||||||
FeatureType,
|
|
||||||
Height,
|
|
||||||
Width,
|
|
||||||
Feedrate,
|
|
||||||
FanSpeed,
|
|
||||||
VolumetricRate,
|
|
||||||
Tool,
|
|
||||||
ColorPrint,
|
|
||||||
Num_View_Types
|
|
||||||
};
|
|
||||||
|
|
||||||
static const Color Default_Extrusion_Role_Colors[erCount];
|
|
||||||
static const std::string Default_Extrusion_Role_Names[erCount];
|
|
||||||
static const EViewType Default_View_Type;
|
|
||||||
|
|
||||||
class Path
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Polyline polyline;
|
|
||||||
ExtrusionRole extrusion_role;
|
|
||||||
// Volumetric velocity. mm^3 of plastic per mm of linear head motion. Used by the G-code generator.
|
|
||||||
float mm3_per_mm;
|
|
||||||
// Width of the extrusion, used for visualization purposes.
|
|
||||||
float width;
|
|
||||||
// Height of the extrusion, used for visualization purposes.
|
|
||||||
float height;
|
|
||||||
// Feedrate of the extrusion, used for visualization purposes.
|
|
||||||
float feedrate;
|
|
||||||
// Id of the extruder, used for visualization purposes.
|
|
||||||
uint32_t extruder_id;
|
|
||||||
// Id of the color, used for visualization purposes in the color printing case.
|
|
||||||
uint32_t cp_color_id;
|
|
||||||
// Fan speed for the extrusion, used for visualization purposes.
|
|
||||||
float fan_speed;
|
|
||||||
};
|
|
||||||
using Paths = std::vector<Path>;
|
|
||||||
|
|
||||||
struct Layer
|
|
||||||
{
|
|
||||||
float z;
|
|
||||||
Paths paths;
|
|
||||||
|
|
||||||
Layer(float z, const Paths& paths);
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef std::vector<Layer> LayersList;
|
|
||||||
|
|
||||||
EViewType view_type;
|
|
||||||
Color role_colors[erCount];
|
|
||||||
std::string role_names[erCount];
|
|
||||||
LayersList layers;
|
|
||||||
unsigned int role_flags;
|
|
||||||
|
|
||||||
void set_default();
|
|
||||||
bool is_role_flag_set(ExtrusionRole role) const;
|
|
||||||
|
|
||||||
// Return an estimate of the memory consumed by the time estimator.
|
|
||||||
size_t memory_used() const;
|
|
||||||
|
|
||||||
static bool is_role_flag_set(unsigned int flags, ExtrusionRole role);
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Travel
|
|
||||||
{
|
|
||||||
enum EType : unsigned char
|
|
||||||
{
|
|
||||||
Move,
|
|
||||||
Extrude,
|
|
||||||
Retract,
|
|
||||||
Num_Types
|
|
||||||
};
|
|
||||||
|
|
||||||
static const float Default_Width;
|
|
||||||
static const float Default_Height;
|
|
||||||
static const Color Default_Type_Colors[Num_Types];
|
|
||||||
|
|
||||||
struct Polyline
|
|
||||||
{
|
|
||||||
enum EDirection
|
|
||||||
{
|
|
||||||
Vertical,
|
|
||||||
Generic,
|
|
||||||
Num_Directions
|
|
||||||
};
|
|
||||||
|
|
||||||
EType type;
|
|
||||||
EDirection direction;
|
|
||||||
float feedrate;
|
|
||||||
unsigned int extruder_id;
|
|
||||||
Polyline3 polyline;
|
|
||||||
|
|
||||||
Polyline(EType type, EDirection direction, float feedrate, unsigned int extruder_id, const Polyline3& polyline);
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef std::vector<Polyline> PolylinesList;
|
|
||||||
|
|
||||||
PolylinesList polylines;
|
|
||||||
float width;
|
|
||||||
float height;
|
|
||||||
Color type_colors[Num_Types];
|
|
||||||
bool is_visible;
|
|
||||||
size_t color_print_idx;
|
|
||||||
|
|
||||||
void set_default();
|
|
||||||
|
|
||||||
// Return an estimate of the memory consumed by the time estimator.
|
|
||||||
size_t memory_used() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Retraction
|
|
||||||
{
|
|
||||||
static const Color Default_Color;
|
|
||||||
|
|
||||||
struct Position
|
|
||||||
{
|
|
||||||
Vec3crd position;
|
|
||||||
float width;
|
|
||||||
float height;
|
|
||||||
|
|
||||||
Position(const Vec3crd& position, float width, float height);
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef std::vector<Position> PositionsList;
|
|
||||||
|
|
||||||
PositionsList positions;
|
|
||||||
Color color;
|
|
||||||
bool is_visible;
|
|
||||||
|
|
||||||
void set_default();
|
|
||||||
|
|
||||||
// Return an estimate of the memory consumed by the time estimator.
|
|
||||||
size_t memory_used() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Shell
|
|
||||||
{
|
|
||||||
bool is_visible;
|
|
||||||
|
|
||||||
void set_default();
|
|
||||||
};
|
|
||||||
|
|
||||||
Extrusion extrusion;
|
|
||||||
Travel travel;
|
|
||||||
Retraction retraction;
|
|
||||||
Retraction unretraction;
|
|
||||||
Shell shell;
|
|
||||||
Ranges ranges;
|
|
||||||
|
|
||||||
GCodePreviewData();
|
|
||||||
|
|
||||||
void set_default();
|
|
||||||
void reset();
|
|
||||||
bool empty() const;
|
|
||||||
|
|
||||||
Color get_extrusion_role_color(ExtrusionRole role) const;
|
|
||||||
Color get_height_color(float height) const;
|
|
||||||
Color get_width_color(float width) const;
|
|
||||||
Color get_feedrate_color(float feedrate) const;
|
|
||||||
Color get_fan_speed_color(float fan_speed) const;
|
|
||||||
Color get_volumetric_rate_color(float rate) const;
|
|
||||||
|
|
||||||
void set_extrusion_role_color(const std::string& role_name, float red, float green, float blue, float alpha);
|
|
||||||
void set_extrusion_paths_colors(const std::vector<std::string>& colors);
|
|
||||||
|
|
||||||
std::string get_legend_title() const;
|
|
||||||
LegendItemsList get_legend_items(const std::vector<float>& tool_colors, const std::vector<std::string>& cp_items) const;
|
|
||||||
|
|
||||||
// Return an estimate of the memory consumed by the time estimator.
|
|
||||||
size_t memory_used() const;
|
|
||||||
|
|
||||||
static const std::vector<std::string>& ColorPrintColors();
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Slic3r
|
|
||||||
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
#endif /* slic3r_GCode_PreviewData_hpp_ */
|
|
|
@ -5,11 +5,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
#include "GCodeProcessor.hpp"
|
#include "GCodeProcessor.hpp"
|
||||||
#else
|
|
||||||
#include "Analyzer.hpp"
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
#include "BoundingBox.hpp"
|
#include "BoundingBox.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,25 +34,18 @@ public:
|
||||||
m_extrusion_flow(0.f),
|
m_extrusion_flow(0.f),
|
||||||
m_preview_suppressed(false),
|
m_preview_suppressed(false),
|
||||||
m_elapsed_time(0.f),
|
m_elapsed_time(0.f),
|
||||||
#if !ENABLE_GCODE_VIEWER || ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
m_default_analyzer_line_width(line_width),
|
m_default_analyzer_line_width(line_width),
|
||||||
#endif // !ENABLE_GCODE_VIEWER || ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
m_gcode_flavor(flavor),
|
m_gcode_flavor(flavor),
|
||||||
m_filpar(filament_parameters)
|
m_filpar(filament_parameters)
|
||||||
{
|
{
|
||||||
// adds tag for analyzer:
|
// adds tag for analyzer:
|
||||||
char buf[64];
|
char buf[64];
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
sprintf(buf, ";%s%f\n", GCodeProcessor::Height_Tag.c_str(), m_layer_height); // don't rely on GCodeAnalyzer knowing the layer height - it knows nothing at priming
|
sprintf(buf, ";%s%f\n", GCodeProcessor::Height_Tag.c_str(), m_layer_height); // don't rely on GCodeAnalyzer knowing the layer height - it knows nothing at priming
|
||||||
m_gcode += buf;
|
m_gcode += buf;
|
||||||
sprintf(buf, ";%s%s\n", GCodeProcessor::Extrusion_Role_Tag.c_str(), ExtrusionEntity::role_to_string(erWipeTower).c_str());
|
sprintf(buf, ";%s%s\n", GCodeProcessor::Extrusion_Role_Tag.c_str(), ExtrusionEntity::role_to_string(erWipeTower).c_str());
|
||||||
m_gcode += buf;
|
m_gcode += buf;
|
||||||
#else
|
|
||||||
sprintf(buf, ";%s%f\n", GCodeAnalyzer::Height_Tag.c_str(), m_layer_height); // don't rely on GCodeAnalyzer knowing the layer height - it knows nothing at priming
|
|
||||||
m_gcode += buf;
|
|
||||||
sprintf(buf, ";%s%d\n", GCodeAnalyzer::Extrusion_Role_Tag.c_str(), erWipeTower);
|
|
||||||
m_gcode += buf;
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
change_analyzer_line_width(line_width);
|
change_analyzer_line_width(line_width);
|
||||||
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
|
@ -80,26 +69,6 @@ public:
|
||||||
m_gcode += buf;
|
m_gcode += buf;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
WipeTowerWriter& change_analyzer_line_width(float line_width) {
|
|
||||||
// adds tag for analyzer:
|
|
||||||
char buf[64];
|
|
||||||
sprintf(buf, ";%s%f\n", GCodeAnalyzer::Width_Tag.c_str(), line_width);
|
|
||||||
m_gcode += buf;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
WipeTowerWriter& change_analyzer_mm3_per_mm(float len, float e) {
|
|
||||||
static const float area = float(M_PI) * 1.75f * 1.75f / 4.f;
|
|
||||||
float mm3_per_mm = (len == 0.f ? 0.f : area * e / len);
|
|
||||||
// adds tag for analyzer:
|
|
||||||
char buf[64];
|
|
||||||
sprintf(buf, ";%s%f\n", GCodeAnalyzer::Mm3_Per_Mm_Tag.c_str(), mm3_per_mm);
|
|
||||||
m_gcode += buf;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
|
|
||||||
WipeTowerWriter& set_initial_position(const Vec2f &pos, float width = 0.f, float depth = 0.f, float internal_angle = 0.f) {
|
WipeTowerWriter& set_initial_position(const Vec2f &pos, float width = 0.f, float depth = 0.f, float internal_angle = 0.f) {
|
||||||
|
@ -135,13 +104,13 @@ public:
|
||||||
// Suppress / resume G-code preview in Slic3r. Slic3r will have difficulty to differentiate the various
|
// Suppress / resume G-code preview in Slic3r. Slic3r will have difficulty to differentiate the various
|
||||||
// filament loading and cooling moves from normal extrusion moves. Therefore the writer
|
// filament loading and cooling moves from normal extrusion moves. Therefore the writer
|
||||||
// is asked to suppres output of some lines, which look like extrusions.
|
// is asked to suppres output of some lines, which look like extrusions.
|
||||||
#if !ENABLE_GCODE_VIEWER || ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
WipeTowerWriter& suppress_preview() { change_analyzer_line_width(0.f); m_preview_suppressed = true; return *this; }
|
WipeTowerWriter& suppress_preview() { change_analyzer_line_width(0.f); m_preview_suppressed = true; return *this; }
|
||||||
WipeTowerWriter& resume_preview() { change_analyzer_line_width(m_default_analyzer_line_width); m_preview_suppressed = false; return *this; }
|
WipeTowerWriter& resume_preview() { change_analyzer_line_width(m_default_analyzer_line_width); m_preview_suppressed = false; return *this; }
|
||||||
#else
|
#else
|
||||||
WipeTowerWriter& suppress_preview() { m_preview_suppressed = true; return *this; }
|
WipeTowerWriter& suppress_preview() { m_preview_suppressed = true; return *this; }
|
||||||
WipeTowerWriter& resume_preview() { m_preview_suppressed = false; return *this; }
|
WipeTowerWriter& resume_preview() { m_preview_suppressed = false; return *this; }
|
||||||
#endif // !ENABLE_GCODE_VIEWER || ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
|
|
||||||
WipeTowerWriter& feedrate(float f)
|
WipeTowerWriter& feedrate(float f)
|
||||||
{
|
{
|
||||||
|
@ -180,10 +149,6 @@ public:
|
||||||
if (! m_preview_suppressed && e > 0.f && len > 0.f) {
|
if (! m_preview_suppressed && e > 0.f && len > 0.f) {
|
||||||
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
change_analyzer_mm3_per_mm(len, e);
|
change_analyzer_mm3_per_mm(len, e);
|
||||||
#else
|
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
change_analyzer_mm3_per_mm(len, e);
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
// Width of a squished extrusion, corrected for the roundings of the squished extrusions.
|
// Width of a squished extrusion, corrected for the roundings of the squished extrusions.
|
||||||
// This is left zero if it is a travel move.
|
// This is left zero if it is a travel move.
|
||||||
|
@ -463,9 +428,9 @@ private:
|
||||||
float m_wipe_tower_depth = 0.f;
|
float m_wipe_tower_depth = 0.f;
|
||||||
unsigned m_last_fan_speed = 0;
|
unsigned m_last_fan_speed = 0;
|
||||||
int current_temp = -1;
|
int current_temp = -1;
|
||||||
#if !ENABLE_GCODE_VIEWER || ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
const float m_default_analyzer_line_width;
|
const float m_default_analyzer_line_width;
|
||||||
#endif // !ENABLE_GCODE_VIEWER || ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
float m_used_filament_length = 0.f;
|
float m_used_filament_length = 0.f;
|
||||||
GCodeFlavor m_gcode_flavor;
|
GCodeFlavor m_gcode_flavor;
|
||||||
const std::vector<WipeTower::FilamentParameters>& m_filpar;
|
const std::vector<WipeTower::FilamentParameters>& m_filpar;
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
#include "GCodeReader.hpp"
|
#include "GCodeReader.hpp"
|
||||||
#include <boost/algorithm/string/classification.hpp>
|
#include <boost/algorithm/string/classification.hpp>
|
||||||
#include <boost/algorithm/string/split.hpp>
|
#include <boost/algorithm/string/split.hpp>
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
#include <boost/nowide/fstream.hpp>
|
#include <boost/nowide/fstream.hpp>
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
@ -116,18 +114,10 @@ void GCodeReader::update_coordinates(GCodeLine &gline, std::pair<const char*, co
|
||||||
|
|
||||||
void GCodeReader::parse_file(const std::string &file, callback_t callback)
|
void GCodeReader::parse_file(const std::string &file, callback_t callback)
|
||||||
{
|
{
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
boost::nowide::ifstream f(file);
|
boost::nowide::ifstream f(file);
|
||||||
#else
|
|
||||||
std::ifstream f(file);
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
std::string line;
|
std::string line;
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
m_parsing_file = true;
|
m_parsing_file = true;
|
||||||
while (m_parsing_file && std::getline(f, line))
|
while (m_parsing_file && std::getline(f, line))
|
||||||
#else
|
|
||||||
while (std::getline(f, line))
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
this->parse_line(line, callback);
|
this->parse_line(line, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -108,9 +108,7 @@ public:
|
||||||
{ GCodeLine gline; this->parse_line(line.c_str(), gline, callback); }
|
{ GCodeLine gline; this->parse_line(line.c_str(), gline, callback); }
|
||||||
|
|
||||||
void parse_file(const std::string &file, callback_t callback);
|
void parse_file(const std::string &file, callback_t callback);
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
void quit_parsing_file() { m_parsing_file = false; }
|
void quit_parsing_file() { m_parsing_file = false; }
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
float& x() { return m_position[X]; }
|
float& x() { return m_position[X]; }
|
||||||
float x() const { return m_position[X]; }
|
float x() const { return m_position[X]; }
|
||||||
|
@ -149,9 +147,7 @@ private:
|
||||||
char m_extrusion_axis;
|
char m_extrusion_axis;
|
||||||
float m_position[NUM_AXES];
|
float m_position[NUM_AXES];
|
||||||
bool m_verbose;
|
bool m_verbose;
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
bool m_parsing_file{ false };
|
bool m_parsing_file{ false };
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} /* namespace Slic3r */
|
} /* namespace Slic3r */
|
||||||
|
|
|
@ -22,9 +22,6 @@
|
||||||
#include "SVG.hpp"
|
#include "SVG.hpp"
|
||||||
#include <Eigen/Dense>
|
#include <Eigen/Dense>
|
||||||
#include "GCodeWriter.hpp"
|
#include "GCodeWriter.hpp"
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
#include "GCode/PreviewData.hpp"
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
|
||||||
|
|
|
@ -1836,7 +1836,6 @@ namespace PresetUtils {
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
std::string system_printer_bed_model(const Preset& preset)
|
std::string system_printer_bed_model(const Preset& preset)
|
||||||
{
|
{
|
||||||
std::string out;
|
std::string out;
|
||||||
|
@ -1854,7 +1853,6 @@ namespace PresetUtils {
|
||||||
out = Slic3r::resources_dir() + "/profiles/" + preset.vendor->id + "/" + pm->bed_texture;
|
out = Slic3r::resources_dir() + "/profiles/" + preset.vendor->id + "/" + pm->bed_texture;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
} // namespace PresetUtils
|
} // namespace PresetUtils
|
||||||
|
|
||||||
} // namespace Slic3r
|
} // namespace Slic3r
|
||||||
|
|
|
@ -537,10 +537,8 @@ public:
|
||||||
namespace PresetUtils {
|
namespace PresetUtils {
|
||||||
// PrinterModel of a system profile, from which this preset is derived, or null if it is not derived from a system profile.
|
// PrinterModel of a system profile, from which this preset is derived, or null if it is not derived from a system profile.
|
||||||
const VendorProfile::PrinterModel* system_printer_model(const Preset &preset);
|
const VendorProfile::PrinterModel* system_printer_model(const Preset &preset);
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
std::string system_printer_bed_model(const Preset& preset);
|
std::string system_printer_bed_model(const Preset& preset);
|
||||||
std::string system_printer_bed_texture(const Preset& preset);
|
std::string system_printer_bed_texture(const Preset& preset);
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
} // namespace PresetUtils
|
} // namespace PresetUtils
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1661,21 +1661,13 @@ void Print::process()
|
||||||
// The export_gcode may die for various reasons (fails to process output_filename_format,
|
// The export_gcode may die for various reasons (fails to process output_filename_format,
|
||||||
// write error into the G-code, cannot execute post-processing scripts).
|
// write error into the G-code, cannot execute post-processing scripts).
|
||||||
// It is up to the caller to show an error message.
|
// It is up to the caller to show an error message.
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
std::string Print::export_gcode(const std::string& path_template, GCodeProcessor::Result* result, ThumbnailsGeneratorCallback thumbnail_cb)
|
std::string Print::export_gcode(const std::string& path_template, GCodeProcessor::Result* result, ThumbnailsGeneratorCallback thumbnail_cb)
|
||||||
#else
|
|
||||||
std::string Print::export_gcode(const std::string& path_template, GCodePreviewData* preview_data, ThumbnailsGeneratorCallback thumbnail_cb)
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
{
|
{
|
||||||
// output everything to a G-code file
|
// output everything to a G-code file
|
||||||
// The following call may die if the output_filename_format template substitution fails.
|
// The following call may die if the output_filename_format template substitution fails.
|
||||||
std::string path = this->output_filepath(path_template);
|
std::string path = this->output_filepath(path_template);
|
||||||
std::string message;
|
std::string message;
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
if (!path.empty() && result == nullptr) {
|
if (!path.empty() && result == nullptr) {
|
||||||
#else
|
|
||||||
if (! path.empty() && preview_data == nullptr) {
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
// Only show the path if preview_data is not set -> running from command line.
|
// Only show the path if preview_data is not set -> running from command line.
|
||||||
message = L("Exporting G-code");
|
message = L("Exporting G-code");
|
||||||
message += " to ";
|
message += " to ";
|
||||||
|
@ -1686,11 +1678,7 @@ std::string Print::export_gcode(const std::string& path_template, GCodePreviewDa
|
||||||
|
|
||||||
// The following line may die for multiple reasons.
|
// The following line may die for multiple reasons.
|
||||||
GCode gcode;
|
GCode gcode;
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
gcode.do_export(this, path.c_str(), result, thumbnail_cb);
|
gcode.do_export(this, path.c_str(), result, thumbnail_cb);
|
||||||
#else
|
|
||||||
gcode.do_export(this, path.c_str(), preview_data, thumbnail_cb);
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
return path.c_str();
|
return path.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,9 +11,7 @@
|
||||||
#include "GCode/ToolOrdering.hpp"
|
#include "GCode/ToolOrdering.hpp"
|
||||||
#include "GCode/WipeTower.hpp"
|
#include "GCode/WipeTower.hpp"
|
||||||
#include "GCode/ThumbnailData.hpp"
|
#include "GCode/ThumbnailData.hpp"
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
#include "GCode/GCodeProcessor.hpp"
|
#include "GCode/GCodeProcessor.hpp"
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
#include "libslic3r.h"
|
#include "libslic3r.h"
|
||||||
|
|
||||||
|
@ -23,9 +21,6 @@ class Print;
|
||||||
class PrintObject;
|
class PrintObject;
|
||||||
class ModelObject;
|
class ModelObject;
|
||||||
class GCode;
|
class GCode;
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
class GCodePreviewData;
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
enum class SlicingMode : uint32_t;
|
enum class SlicingMode : uint32_t;
|
||||||
class Layer;
|
class Layer;
|
||||||
class SupportLayer;
|
class SupportLayer;
|
||||||
|
@ -312,10 +307,6 @@ struct PrintStatistics
|
||||||
PrintStatistics() { clear(); }
|
PrintStatistics() { clear(); }
|
||||||
std::string estimated_normal_print_time;
|
std::string estimated_normal_print_time;
|
||||||
std::string estimated_silent_print_time;
|
std::string estimated_silent_print_time;
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
std::vector<std::pair<CustomGCode::Type, std::string>> estimated_normal_custom_gcode_print_times;
|
|
||||||
std::vector<std::pair<CustomGCode::Type, std::string>> estimated_silent_custom_gcode_print_times;
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
double total_used_filament;
|
double total_used_filament;
|
||||||
double total_extruded_volume;
|
double total_extruded_volume;
|
||||||
double total_cost;
|
double total_cost;
|
||||||
|
@ -333,12 +324,6 @@ struct PrintStatistics
|
||||||
std::string finalize_output_path(const std::string &path_in) const;
|
std::string finalize_output_path(const std::string &path_in) const;
|
||||||
|
|
||||||
void clear() {
|
void clear() {
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
estimated_normal_print_time.clear();
|
|
||||||
estimated_silent_print_time.clear();
|
|
||||||
estimated_normal_custom_gcode_print_times.clear();
|
|
||||||
estimated_silent_custom_gcode_print_times.clear();
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
total_used_filament = 0.;
|
total_used_filament = 0.;
|
||||||
total_extruded_volume = 0.;
|
total_extruded_volume = 0.;
|
||||||
total_cost = 0.;
|
total_cost = 0.;
|
||||||
|
@ -380,11 +365,7 @@ public:
|
||||||
void process() override;
|
void process() override;
|
||||||
// Exports G-code into a file name based on the path_template, returns the file path of the generated G-code file.
|
// Exports G-code into a file name based on the path_template, returns the file path of the generated G-code file.
|
||||||
// If preview_data is not null, the preview_data is filled in for the G-code visualization (not used by the command line Slic3r).
|
// If preview_data is not null, the preview_data is filled in for the G-code visualization (not used by the command line Slic3r).
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
std::string export_gcode(const std::string& path_template, GCodeProcessor::Result* result, ThumbnailsGeneratorCallback thumbnail_cb = nullptr);
|
std::string export_gcode(const std::string& path_template, GCodeProcessor::Result* result, ThumbnailsGeneratorCallback thumbnail_cb = nullptr);
|
||||||
#else
|
|
||||||
std::string export_gcode(const std::string& path_template, GCodePreviewData* preview_data, ThumbnailsGeneratorCallback thumbnail_cb = nullptr);
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
// methods for handling state
|
// methods for handling state
|
||||||
bool is_step_done(PrintStep step) const { return Inherited::is_step_done(step); }
|
bool is_step_done(PrintStep step) const { return Inherited::is_step_done(step); }
|
||||||
|
|
|
@ -957,9 +957,9 @@ void PrintConfigDef::init_fff_params()
|
||||||
|
|
||||||
def = this->add("first_layer_temperature", coInts);
|
def = this->add("first_layer_temperature", coInts);
|
||||||
def->label = L("First layer");
|
def->label = L("First layer");
|
||||||
def->full_label = L("First layer extruder temperature");
|
def->full_label = L("First layer nozzle temperature");
|
||||||
def->tooltip = L("Extruder temperature for first layer. If you want to control temperature manually "
|
def->tooltip = L("Nozzle temperature for the first layer. If you want to control temperature manually "
|
||||||
"during print, set this to zero to disable temperature control commands in the output file.");
|
"during print, set this to zero to disable temperature control commands in the output G-code.");
|
||||||
def->sidetext = L("°C");
|
def->sidetext = L("°C");
|
||||||
def->min = 0;
|
def->min = 0;
|
||||||
def->max = max_temp;
|
def->max = max_temp;
|
||||||
|
@ -1180,9 +1180,9 @@ void PrintConfigDef::init_fff_params()
|
||||||
def->set_default_value(new ConfigOptionFloat(0.1));
|
def->set_default_value(new ConfigOptionFloat(0.1));
|
||||||
|
|
||||||
def = this->add("ironing_speed", coFloat);
|
def = this->add("ironing_speed", coFloat);
|
||||||
def->label = L("Ironing speed");
|
def->label = L("Ironing");
|
||||||
def->category = L("Speed");
|
def->category = L("Speed");
|
||||||
def->tooltip = L("Ironing speed");
|
def->tooltip = L("Ironing");
|
||||||
def->sidetext = L("mm/s");
|
def->sidetext = L("mm/s");
|
||||||
def->min = 0;
|
def->min = 0;
|
||||||
def->mode = comAdvanced;
|
def->mode = comAdvanced;
|
||||||
|
@ -1216,7 +1216,7 @@ void PrintConfigDef::init_fff_params()
|
||||||
def->set_default_value(new ConfigOptionBool(true));
|
def->set_default_value(new ConfigOptionBool(true));
|
||||||
|
|
||||||
def = this->add("machine_limits_usage", coEnum);
|
def = this->add("machine_limits_usage", coEnum);
|
||||||
def->label = L("How to apply");
|
def->label = L("How to apply limits");
|
||||||
def->full_label = L("Purpose of Machine Limits");
|
def->full_label = L("Purpose of Machine Limits");
|
||||||
def->category = L("Machine limits");
|
def->category = L("Machine limits");
|
||||||
def->tooltip = L("How to apply the Machine Limits");
|
def->tooltip = L("How to apply the Machine Limits");
|
||||||
|
@ -1224,9 +1224,9 @@ void PrintConfigDef::init_fff_params()
|
||||||
def->enum_values.push_back("emit_to_gcode");
|
def->enum_values.push_back("emit_to_gcode");
|
||||||
def->enum_values.push_back("time_estimate_only");
|
def->enum_values.push_back("time_estimate_only");
|
||||||
def->enum_values.push_back("ignore");
|
def->enum_values.push_back("ignore");
|
||||||
def->enum_labels.push_back("Emit to G-code");
|
def->enum_labels.push_back(L("Emit to G-code"));
|
||||||
def->enum_labels.push_back("Use for time estimate");
|
def->enum_labels.push_back(L("Use for time estimate"));
|
||||||
def->enum_labels.push_back("Ignore");
|
def->enum_labels.push_back(L("Ignore"));
|
||||||
def->mode = comAdvanced;
|
def->mode = comAdvanced;
|
||||||
def->set_default_value(new ConfigOptionEnum<MachineLimitsUsage>(MachineLimitsUsage::EmitToGCode));
|
def->set_default_value(new ConfigOptionEnum<MachineLimitsUsage>(MachineLimitsUsage::EmitToGCode));
|
||||||
|
|
||||||
|
@ -2205,10 +2205,10 @@ void PrintConfigDef::init_fff_params()
|
||||||
|
|
||||||
def = this->add("temperature", coInts);
|
def = this->add("temperature", coInts);
|
||||||
def->label = L("Other layers");
|
def->label = L("Other layers");
|
||||||
def->tooltip = L("Extruder temperature for layers after the first one. Set this to zero to disable "
|
def->tooltip = L("Nozzle temperature for layers after the first one. Set this to zero to disable "
|
||||||
"temperature control commands in the output.");
|
"temperature control commands in the output G-code.");
|
||||||
def->sidetext = L("°C");
|
def->sidetext = L("°C");
|
||||||
def->full_label = L("Extruder temperature");
|
def->full_label = L("Nozzle temperature");
|
||||||
def->min = 0;
|
def->min = 0;
|
||||||
def->max = max_temp;
|
def->max = max_temp;
|
||||||
def->set_default_value(new ConfigOptionInts { 200 });
|
def->set_default_value(new ConfigOptionInts { 200 });
|
||||||
|
@ -3696,7 +3696,7 @@ CLIMiscConfigDef::CLIMiscConfigDef()
|
||||||
def->cli = "output|o";
|
def->cli = "output|o";
|
||||||
|
|
||||||
def = this->add("single_instance", coBool);
|
def = this->add("single_instance", coBool);
|
||||||
def->label = L("Single Instance");
|
def->label = L("Single instance mode");
|
||||||
def->tooltip = L("If enabled, the command line arguments are sent to an existing instance of GUI PrusaSlicer, "
|
def->tooltip = L("If enabled, the command line arguments are sent to an existing instance of GUI PrusaSlicer, "
|
||||||
"or an existing PrusaSlicer window is activated. "
|
"or an existing PrusaSlicer window is activated. "
|
||||||
"Overrides the \"single_instance\" configuration value from application preferences.");
|
"Overrides the \"single_instance\" configuration value from application preferences.");
|
||||||
|
|
|
@ -64,4 +64,13 @@
|
||||||
|
|
||||||
#define ENABLE_CTRL_M_ON_WINDOWS (0 && ENABLE_2_3_0_ALPHA3)
|
#define ENABLE_CTRL_M_ON_WINDOWS (0 && ENABLE_2_3_0_ALPHA3)
|
||||||
|
|
||||||
|
|
||||||
|
//===================
|
||||||
|
// 2.3.0.alpha4 techs
|
||||||
|
//===================
|
||||||
|
#define ENABLE_2_3_0_ALPHA4 1
|
||||||
|
|
||||||
|
#define ENABLE_FIXED_SCREEN_SIZE_POINT_MARKERS (1 && ENABLE_GCODE_VIEWER && ENABLE_2_3_0_ALPHA4)
|
||||||
|
|
||||||
|
|
||||||
#endif // _prusaslicer_technologies_h_
|
#endif // _prusaslicer_technologies_h_
|
||||||
|
|
|
@ -110,30 +110,13 @@ std::string string_printf(const char *format, ...);
|
||||||
// to be placed at the top of Slic3r generated files.
|
// to be placed at the top of Slic3r generated files.
|
||||||
std::string header_slic3r_generated();
|
std::string header_slic3r_generated();
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
// Standard "generated by PrusaGCodeViewer version xxx timestamp xxx" header string,
|
// Standard "generated by PrusaGCodeViewer version xxx timestamp xxx" header string,
|
||||||
// to be placed at the top of Slic3r generated files.
|
// to be placed at the top of Slic3r generated files.
|
||||||
std::string header_gcodeviewer_generated();
|
std::string header_gcodeviewer_generated();
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
// getpid platform wrapper
|
// getpid platform wrapper
|
||||||
extern unsigned get_current_pid();
|
extern unsigned get_current_pid();
|
||||||
|
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
template <typename Real>
|
|
||||||
Real round_nearest(Real value, unsigned int decimals)
|
|
||||||
{
|
|
||||||
Real res = (Real)0;
|
|
||||||
if (decimals == 0)
|
|
||||||
res = ::round(value);
|
|
||||||
else {
|
|
||||||
Real power = ::pow((Real)10, (int)decimals);
|
|
||||||
res = ::round(value * power + (Real)0.5) / power;
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
// Compute the next highest power of 2 of 32-bit v
|
// Compute the next highest power of 2 of 32-bit v
|
||||||
// http://graphics.stanford.edu/~seander/bithacks.html
|
// http://graphics.stanford.edu/~seander/bithacks.html
|
||||||
inline uint16_t next_highest_power_of_2(uint16_t v)
|
inline uint16_t next_highest_power_of_2(uint16_t v)
|
||||||
|
|
|
@ -25,12 +25,12 @@ public:
|
||||||
std::string formatted_errorstr() const
|
std::string formatted_errorstr() const
|
||||||
{
|
{
|
||||||
return L("Error with zip archive") + " " + m_zipname + ": " +
|
return L("Error with zip archive") + " " + m_zipname + ": " +
|
||||||
get_errorstr() + "!";
|
get_errorstr();
|
||||||
}
|
}
|
||||||
|
|
||||||
SLIC3R_NORETURN void blow_up() const
|
SLIC3R_NORETURN void blow_up() const
|
||||||
{
|
{
|
||||||
throw Slic3r::RuntimeError(formatted_errorstr());
|
throw Slic3r::ExportError(formatted_errorstr());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_alive()
|
bool is_alive()
|
||||||
|
|
|
@ -429,24 +429,20 @@ CopyFileResult copy_file_inner(const std::string& from, const std::string& to, s
|
||||||
// the copy_file() function will fail appropriately and we don't want the permission()
|
// the copy_file() function will fail appropriately and we don't want the permission()
|
||||||
// calls to cause needless failures on permissionless filesystems (ie. FATs on SD cards etc.)
|
// calls to cause needless failures on permissionless filesystems (ie. FATs on SD cards etc.)
|
||||||
// or when the target file doesn't exist.
|
// or when the target file doesn't exist.
|
||||||
|
|
||||||
//This error code is ignored
|
|
||||||
boost::system::error_code ec;
|
boost::system::error_code ec;
|
||||||
|
|
||||||
boost::filesystem::permissions(target, perms, ec);
|
boost::filesystem::permissions(target, perms, ec);
|
||||||
//if (ec)
|
if (ec)
|
||||||
// BOOST_LOG_TRIVIAL(error) << "Copy file permisions before copy error message: " << ec.message();
|
BOOST_LOG_TRIVIAL(error) << "boost::filesystem::permisions before copy error message (this could be irrelevant message based on file system): " << ec.message();
|
||||||
// This error code is passed up
|
|
||||||
ec.clear();
|
ec.clear();
|
||||||
boost::filesystem::copy_file(source, target, boost::filesystem::copy_option::overwrite_if_exists, ec);
|
boost::filesystem::copy_file(source, target, boost::filesystem::copy_option::overwrite_if_exists, ec);
|
||||||
if (ec) {
|
if (ec) {
|
||||||
error_message = ec.message();
|
error_message = ec.message();
|
||||||
return FAIL_COPY_FILE;
|
return FAIL_COPY_FILE;
|
||||||
}
|
}
|
||||||
//ec.clear();
|
ec.clear();
|
||||||
boost::filesystem::permissions(target, perms, ec);
|
boost::filesystem::permissions(target, perms, ec);
|
||||||
//if (ec)
|
if (ec)
|
||||||
// BOOST_LOG_TRIVIAL(error) << "Copy file permisions after copy error message: " << ec.message();
|
BOOST_LOG_TRIVIAL(error) << "boost::filesystem::permisions after copy error message (this could be irrelevant message based on file system): " << ec.message();
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -618,12 +614,10 @@ std::string header_slic3r_generated()
|
||||||
return std::string("generated by " SLIC3R_APP_NAME " " SLIC3R_VERSION " on " ) + Utils::utc_timestamp();
|
return std::string("generated by " SLIC3R_APP_NAME " " SLIC3R_VERSION " on " ) + Utils::utc_timestamp();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
std::string header_gcodeviewer_generated()
|
std::string header_gcodeviewer_generated()
|
||||||
{
|
{
|
||||||
return std::string("generated by " GCODEVIEWER_APP_NAME " " SLIC3R_VERSION " on ") + Utils::utc_timestamp();
|
return std::string("generated by " GCODEVIEWER_APP_NAME " " SLIC3R_VERSION " on ") + Utils::utc_timestamp();
|
||||||
}
|
}
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
unsigned get_current_pid()
|
unsigned get_current_pid()
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,15 +16,9 @@
|
||||||
#include "libslic3r/ExtrusionEntity.hpp"
|
#include "libslic3r/ExtrusionEntity.hpp"
|
||||||
#include "libslic3r/ExtrusionEntityCollection.hpp"
|
#include "libslic3r/ExtrusionEntityCollection.hpp"
|
||||||
#include "libslic3r/Geometry.hpp"
|
#include "libslic3r/Geometry.hpp"
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
#include "libslic3r/GCode/PreviewData.hpp"
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
#include "libslic3r/Print.hpp"
|
#include "libslic3r/Print.hpp"
|
||||||
#include "libslic3r/SLAPrint.hpp"
|
#include "libslic3r/SLAPrint.hpp"
|
||||||
#include "libslic3r/Slicing.hpp"
|
#include "libslic3r/Slicing.hpp"
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
#include "libslic3r/GCode/Analyzer.hpp"
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
#include "slic3r/GUI/BitmapCache.hpp"
|
#include "slic3r/GUI/BitmapCache.hpp"
|
||||||
#include "libslic3r/Format/STL.hpp"
|
#include "libslic3r/Format/STL.hpp"
|
||||||
#include "libslic3r/Utils.hpp"
|
#include "libslic3r/Utils.hpp"
|
||||||
|
|
|
@ -38,12 +38,12 @@ void AboutDialogLogo::onRepaint(wxEvent &event)
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
CopyrightsDialog::CopyrightsDialog()
|
CopyrightsDialog::CopyrightsDialog()
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
: DPIDialog(NULL, wxID_ANY, from_u8((boost::format("%1% - %2%")
|
: DPIDialog((wxWindow*)wxGetApp().mainframe, wxID_ANY, from_u8((boost::format("%1% - %2%")
|
||||||
% (wxGetApp().is_editor() ? SLIC3R_APP_NAME : GCODEVIEWER_APP_NAME)
|
% (wxGetApp().is_editor() ? SLIC3R_APP_NAME : GCODEVIEWER_APP_NAME)
|
||||||
% _utf8(L("Portions copyright"))).str()),
|
% _utf8(L("Portions copyright"))).str()),
|
||||||
wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
||||||
#else
|
#else
|
||||||
: DPIDialog(NULL, wxID_ANY, from_u8((boost::format("%1% - %2%")
|
: DPIDialog((wxWindow*)wxGetApp().mainframe, wxID_ANY, from_u8((boost::format("%1% - %2%")
|
||||||
% SLIC3R_APP_NAME
|
% SLIC3R_APP_NAME
|
||||||
% _utf8(L("Portions copyright"))).str()),
|
% _utf8(L("Portions copyright"))).str()),
|
||||||
wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
||||||
|
@ -209,10 +209,10 @@ void CopyrightsDialog::onCloseDialog(wxEvent &)
|
||||||
|
|
||||||
AboutDialog::AboutDialog()
|
AboutDialog::AboutDialog()
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
: DPIDialog(NULL, wxID_ANY, from_u8((boost::format(_utf8(L("About %s"))) % (wxGetApp().is_editor() ? SLIC3R_APP_NAME : GCODEVIEWER_APP_NAME)).str()), wxDefaultPosition,
|
: DPIDialog((wxWindow*)wxGetApp().mainframe, wxID_ANY, from_u8((boost::format(_utf8(L("About %s"))) % (wxGetApp().is_editor() ? SLIC3R_APP_NAME : GCODEVIEWER_APP_NAME)).str()), wxDefaultPosition,
|
||||||
wxDefaultSize, /*wxCAPTION*/wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
wxDefaultSize, /*wxCAPTION*/wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
||||||
#else
|
#else
|
||||||
: DPIDialog(NULL, wxID_ANY, from_u8((boost::format(_utf8(L("About %s"))) % SLIC3R_APP_NAME).str()), wxDefaultPosition,
|
: DPIDialog((wxWindow*)wxGetApp().mainframe, wxID_ANY, from_u8((boost::format(_utf8(L("About %s"))) % SLIC3R_APP_NAME).str()), wxDefaultPosition,
|
||||||
wxDefaultSize, /*wxCAPTION*/wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
wxDefaultSize, /*wxCAPTION*/wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
{
|
{
|
||||||
|
|
|
@ -19,9 +19,6 @@
|
||||||
#include "libslic3r/SLAPrint.hpp"
|
#include "libslic3r/SLAPrint.hpp"
|
||||||
#include "libslic3r/Utils.hpp"
|
#include "libslic3r/Utils.hpp"
|
||||||
#include "libslic3r/GCode/PostProcessor.hpp"
|
#include "libslic3r/GCode/PostProcessor.hpp"
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
#include "libslic3r/GCode/PreviewData.hpp"
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
#include "libslic3r/Format/SL1.hpp"
|
#include "libslic3r/Format/SL1.hpp"
|
||||||
#include "libslic3r/Thread.hpp"
|
#include "libslic3r/Thread.hpp"
|
||||||
#include "libslic3r/libslic3r.h"
|
#include "libslic3r/libslic3r.h"
|
||||||
|
@ -53,6 +50,24 @@ bool SlicingProcessCompletedEvent::critical_error() const
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SlicingProcessCompletedEvent::invalidate_plater() const
|
||||||
|
{
|
||||||
|
if (critical_error())
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
this->rethrow_exception();
|
||||||
|
}
|
||||||
|
catch (const Slic3r::ExportError&) {
|
||||||
|
// Exception thrown by copying file does not ivalidate plater
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
catch (...) {
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
std::string SlicingProcessCompletedEvent::format_error_message() const
|
std::string SlicingProcessCompletedEvent::format_error_message() const
|
||||||
{
|
{
|
||||||
std::string error;
|
std::string error;
|
||||||
|
@ -142,19 +157,19 @@ void BackgroundSlicingProcess::process_fff()
|
||||||
switch (copy_ret_val) {
|
switch (copy_ret_val) {
|
||||||
case SUCCESS: break; // no error
|
case SUCCESS: break; // no error
|
||||||
case FAIL_COPY_FILE:
|
case FAIL_COPY_FILE:
|
||||||
throw Slic3r::RuntimeError((boost::format(_utf8(L("Copying of the temporary G-code to the output G-code failed. Maybe the SD card is write locked?\nError message: %1%"))) % error_message).str());
|
throw Slic3r::ExportError((boost::format(_utf8(L("Copying of the temporary G-code to the output G-code failed. Maybe the SD card is write locked?\nError message: %1%"))) % error_message).str());
|
||||||
break;
|
break;
|
||||||
case FAIL_FILES_DIFFERENT:
|
case FAIL_FILES_DIFFERENT:
|
||||||
throw Slic3r::RuntimeError((boost::format(_utf8(L("Copying of the temporary G-code to the output G-code failed. There might be problem with target device, please try exporting again or using different device. The corrupted output G-code is at %1%.tmp."))) % export_path).str());
|
throw Slic3r::ExportError((boost::format(_utf8(L("Copying of the temporary G-code to the output G-code failed. There might be problem with target device, please try exporting again or using different device. The corrupted output G-code is at %1%.tmp."))) % export_path).str());
|
||||||
break;
|
break;
|
||||||
case FAIL_RENAMING:
|
case FAIL_RENAMING:
|
||||||
throw Slic3r::RuntimeError((boost::format(_utf8(L("Renaming of the G-code after copying to the selected destination folder has failed. Current path is %1%.tmp. Please try exporting again."))) % export_path).str());
|
throw Slic3r::ExportError((boost::format(_utf8(L("Renaming of the G-code after copying to the selected destination folder has failed. Current path is %1%.tmp. Please try exporting again."))) % export_path).str());
|
||||||
break;
|
break;
|
||||||
case FAIL_CHECK_ORIGIN_NOT_OPENED:
|
case FAIL_CHECK_ORIGIN_NOT_OPENED:
|
||||||
throw Slic3r::RuntimeError((boost::format(_utf8(L("Copying of the temporary G-code has finished but the original code at %1% couldn't be opened during copy check. The output G-code is at %2%.tmp."))) % m_temp_output_path % export_path).str());
|
throw Slic3r::ExportError((boost::format(_utf8(L("Copying of the temporary G-code has finished but the original code at %1% couldn't be opened during copy check. The output G-code is at %2%.tmp."))) % m_temp_output_path % export_path).str());
|
||||||
break;
|
break;
|
||||||
case FAIL_CHECK_TARGET_NOT_OPENED:
|
case FAIL_CHECK_TARGET_NOT_OPENED:
|
||||||
throw Slic3r::RuntimeError((boost::format(_utf8(L("Copying of the temporary G-code has finished but the exported code couldn't be opened during copy check. The output G-code is at %1%.tmp."))) % export_path).str());
|
throw Slic3r::ExportError((boost::format(_utf8(L("Copying of the temporary G-code has finished but the exported code couldn't be opened during copy check. The output G-code is at %1%.tmp."))) % export_path).str());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw Slic3r::RuntimeError(_utf8(L("Unknown error occured during exporting G-code.")));
|
throw Slic3r::RuntimeError(_utf8(L("Unknown error occured during exporting G-code.")));
|
||||||
|
|
|
@ -57,6 +57,8 @@ public:
|
||||||
bool error() const { return m_status == Error; }
|
bool error() const { return m_status == Error; }
|
||||||
// Unhandled error produced by stdlib or a Win32 structured exception, or unhandled Slic3r's own critical exception.
|
// Unhandled error produced by stdlib or a Win32 structured exception, or unhandled Slic3r's own critical exception.
|
||||||
bool critical_error() const;
|
bool critical_error() const;
|
||||||
|
// Critical errors does invalidate plater except CopyFileError.
|
||||||
|
bool invalidate_plater() const;
|
||||||
// Only valid if error()
|
// Only valid if error()
|
||||||
void rethrow_exception() const { assert(this->error()); assert(m_exception); std::rethrow_exception(m_exception); }
|
void rethrow_exception() const { assert(this->error()); assert(m_exception); std::rethrow_exception(m_exception); }
|
||||||
// Produce a human readable message to be displayed by a notification or a message box.
|
// Produce a human readable message to be displayed by a notification or a message box.
|
||||||
|
|
|
@ -127,7 +127,7 @@ public:
|
||||||
|
|
||||||
void look_at(const Vec3d& position, const Vec3d& target, const Vec3d& up);
|
void look_at(const Vec3d& position, const Vec3d& target, const Vec3d& up);
|
||||||
|
|
||||||
double max_zoom() const { return 100.0; }
|
double max_zoom() const { return 250.0; }
|
||||||
double min_zoom() const;
|
double min_zoom() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -109,7 +109,7 @@ static wxString generate_html_page(const Config::SnapshotDB &snapshot_db, const
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigSnapshotDialog::ConfigSnapshotDialog(const Config::SnapshotDB &snapshot_db, const wxString &on_snapshot)
|
ConfigSnapshotDialog::ConfigSnapshotDialog(const Config::SnapshotDB &snapshot_db, const wxString &on_snapshot)
|
||||||
: DPIDialog(NULL, wxID_ANY, _(L("Configuration Snapshots")), wxDefaultPosition,
|
: DPIDialog((wxWindow*)wxGetApp().mainframe, wxID_ANY, _(L("Configuration Snapshots")), wxDefaultPosition,
|
||||||
wxSize(45 * wxGetApp().em_unit(), 40 * wxGetApp().em_unit()),
|
wxSize(45 * wxGetApp().em_unit(), 40 * wxGetApp().em_unit()),
|
||||||
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMAXIMIZE_BOX)
|
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMAXIMIZE_BOX)
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include <wx/debug.h>
|
#include <wx/debug.h>
|
||||||
|
|
||||||
#include "libslic3r/Utils.hpp"
|
#include "libslic3r/Utils.hpp"
|
||||||
|
#include "libslic3r/Config.hpp"
|
||||||
#include "GUI.hpp"
|
#include "GUI.hpp"
|
||||||
#include "GUI_App.hpp"
|
#include "GUI_App.hpp"
|
||||||
#include "GUI_Utils.hpp"
|
#include "GUI_Utils.hpp"
|
||||||
|
@ -191,10 +192,12 @@ PrinterPicker::PrinterPicker(wxWindow *parent, const VendorProfile &vendor, wxSt
|
||||||
|
|
||||||
wxBitmap bitmap;
|
wxBitmap bitmap;
|
||||||
int bitmap_width = 0;
|
int bitmap_width = 0;
|
||||||
|
int bitmap_height = 0;
|
||||||
const wxString bitmap_file = GUI::from_u8(Slic3r::resources_dir() + "/profiles/" + vendor.id + "/" + model.id + "_thumbnail.png");
|
const wxString bitmap_file = GUI::from_u8(Slic3r::resources_dir() + "/profiles/" + vendor.id + "/" + model.id + "_thumbnail.png");
|
||||||
if (wxFileExists(bitmap_file)) {
|
if (wxFileExists(bitmap_file)) {
|
||||||
bitmap.LoadFile(bitmap_file, wxBITMAP_TYPE_PNG);
|
bitmap.LoadFile(bitmap_file, wxBITMAP_TYPE_PNG);
|
||||||
bitmap_width = bitmap.GetWidth();
|
bitmap_width = bitmap.GetWidth();
|
||||||
|
bitmap_height = bitmap.GetHeight();
|
||||||
} else {
|
} else {
|
||||||
BOOST_LOG_TRIVIAL(warning) << boost::format("Can't find bitmap file `%1%` for vendor `%2%`, printer `%3%`, using placeholder icon instead")
|
BOOST_LOG_TRIVIAL(warning) << boost::format("Can't find bitmap file `%1%` for vendor `%2%`, printer `%3%`, using placeholder icon instead")
|
||||||
% bitmap_file
|
% bitmap_file
|
||||||
|
@ -205,6 +208,7 @@ PrinterPicker::PrinterPicker(wxWindow *parent, const VendorProfile &vendor, wxSt
|
||||||
if (wxFileExists(placeholder_file)) {
|
if (wxFileExists(placeholder_file)) {
|
||||||
bitmap.LoadFile(placeholder_file, wxBITMAP_TYPE_PNG);
|
bitmap.LoadFile(placeholder_file, wxBITMAP_TYPE_PNG);
|
||||||
bitmap_width = bitmap.GetWidth();
|
bitmap_width = bitmap.GetWidth();
|
||||||
|
bitmap_height = bitmap.GetHeight();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,25 +274,22 @@ PrinterPicker::PrinterPicker(wxWindow *parent, const VendorProfile &vendor, wxSt
|
||||||
const size_t odd_items = titles.size() % cols;
|
const size_t odd_items = titles.size() % cols;
|
||||||
|
|
||||||
for (size_t i = 0; i < titles.size() - odd_items; i += cols) {
|
for (size_t i = 0; i < titles.size() - odd_items; i += cols) {
|
||||||
for (size_t j = i; j < i + cols; j++) { printer_grid->Add(titles[j], 0, wxBOTTOM, 3); }
|
|
||||||
for (size_t j = i; j < i + cols; j++) { printer_grid->Add(bitmaps[j], 0, wxBOTTOM, 20); }
|
for (size_t j = i; j < i + cols; j++) { printer_grid->Add(bitmaps[j], 0, wxBOTTOM, 20); }
|
||||||
|
for (size_t j = i; j < i + cols; j++) { printer_grid->Add(titles[j], 0, wxBOTTOM, 3); }
|
||||||
for (size_t j = i; j < i + cols; j++) { printer_grid->Add(variants_panels[j]); }
|
for (size_t j = i; j < i + cols; j++) { printer_grid->Add(variants_panels[j]); }
|
||||||
|
|
||||||
// Add separator space
|
// Add separator space to multiliners
|
||||||
if (i > 0) {
|
if (titles.size() > cols) {
|
||||||
for (size_t j = i; j < i + cols; j++) { printer_grid->Add(1, 100); }
|
for (size_t j = i; j < i + cols; j++) { printer_grid->Add(1, 30); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (odd_items > 0) {
|
if (odd_items > 0) {
|
||||||
for (size_t i = 0; i < cols; i++) { printer_grid->Add(1, 100); }
|
|
||||||
|
|
||||||
const size_t rem = titles.size() - odd_items;
|
const size_t rem = titles.size() - odd_items;
|
||||||
|
|
||||||
for (size_t i = rem; i < titles.size(); i++) { printer_grid->Add(titles[i], 0, wxBOTTOM, 3); }
|
|
||||||
for (size_t i = 0; i < cols - odd_items; i++) { printer_grid->AddSpacer(1); }
|
|
||||||
for (size_t i = rem; i < titles.size(); i++) { printer_grid->Add(bitmaps[i], 0, wxBOTTOM, 20); }
|
for (size_t i = rem; i < titles.size(); i++) { printer_grid->Add(bitmaps[i], 0, wxBOTTOM, 20); }
|
||||||
for (size_t i = 0; i < cols - odd_items; i++) { printer_grid->AddSpacer(1); }
|
for (size_t i = 0; i < cols - odd_items; i++) { printer_grid->AddSpacer(1); }
|
||||||
|
for (size_t i = rem; i < titles.size(); i++) { printer_grid->Add(titles[i], 0, wxBOTTOM, 3); }
|
||||||
|
for (size_t i = 0; i < cols - odd_items; i++) { printer_grid->AddSpacer(1); }
|
||||||
for (size_t i = rem; i < titles.size(); i++) { printer_grid->Add(variants_panels[i]); }
|
for (size_t i = rem; i < titles.size(); i++) { printer_grid->Add(variants_panels[i]); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1389,7 +1390,7 @@ void PageDiameters::apply_custom_config(DynamicPrintConfig &config)
|
||||||
}
|
}
|
||||||
|
|
||||||
PageTemperatures::PageTemperatures(ConfigWizard *parent)
|
PageTemperatures::PageTemperatures(ConfigWizard *parent)
|
||||||
: ConfigWizardPage(parent, _(L("Extruder and Bed Temperatures")), _(L("Temperatures")), 1)
|
: ConfigWizardPage(parent, _(L("Nozzle and Bed Temperatures")), _(L("Temperatures")), 1)
|
||||||
, spin_extr(new wxSpinCtrlDouble(this, wxID_ANY))
|
, spin_extr(new wxSpinCtrlDouble(this, wxID_ANY))
|
||||||
, spin_bed(new wxSpinCtrlDouble(this, wxID_ANY))
|
, spin_bed(new wxSpinCtrlDouble(this, wxID_ANY))
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
#include "libslic3r/GCode.hpp"
|
#include "libslic3r/GCode.hpp"
|
||||||
#else
|
#else
|
||||||
#include "wxExtensions.hpp"
|
#include "wxExtensions.hpp"
|
||||||
#include "libslic3r/GCode/PreviewData.hpp"
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
#include "GUI.hpp"
|
#include "GUI.hpp"
|
||||||
#include "GUI_App.hpp"
|
#include "GUI_App.hpp"
|
||||||
|
@ -53,11 +52,6 @@ static std::string gcode(Type type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool is_lower_thumb_editable()
|
|
||||||
{
|
|
||||||
return Slic3r::GUI::get_app_config()->get("seq_top_layer_only") == "0";
|
|
||||||
}
|
|
||||||
|
|
||||||
Control::Control( wxWindow *parent,
|
Control::Control( wxWindow *parent,
|
||||||
wxWindowID id,
|
wxWindowID id,
|
||||||
int lowerValue,
|
int lowerValue,
|
||||||
|
@ -299,6 +293,8 @@ wxSize Control::get_size() const
|
||||||
void Control::get_size(int* w, int* h) const
|
void Control::get_size(int* w, int* h) const
|
||||||
{
|
{
|
||||||
GetSize(w, h);
|
GetSize(w, h);
|
||||||
|
if (m_draw_mode == dmSequentialGCodeView)
|
||||||
|
return; // we have no more icons for drawing
|
||||||
is_horizontal() ? *w -= m_lock_icon_dim : *h -= m_lock_icon_dim;
|
is_horizontal() ? *w -= m_lock_icon_dim : *h -= m_lock_icon_dim;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -914,6 +910,10 @@ void Control::draw_revert_icon(wxDC& dc)
|
||||||
|
|
||||||
void Control::draw_cog_icon(wxDC& dc)
|
void Control::draw_cog_icon(wxDC& dc)
|
||||||
{
|
{
|
||||||
|
#if ENABLE_GCODE_VIEWER
|
||||||
|
if (m_draw_mode == dmSequentialGCodeView)
|
||||||
|
return;
|
||||||
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
int width, height;
|
int width, height;
|
||||||
get_size(&width, &height);
|
get_size(&width, &height);
|
||||||
|
|
||||||
|
@ -960,6 +960,13 @@ int Control::get_value_from_position(const wxCoord x, const wxCoord y)
|
||||||
return int(m_min_value + double(height - SLIDER_MARGIN - y) / step + 0.5);
|
return int(m_min_value + double(height - SLIDER_MARGIN - y) / step + 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Control::is_lower_thumb_editable()
|
||||||
|
{
|
||||||
|
if (m_draw_mode == dmSequentialGCodeView)
|
||||||
|
return Slic3r::GUI::get_app_config()->get("seq_top_layer_only") == "0";
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool Control::detect_selected_slider(const wxPoint& pt)
|
bool Control::detect_selected_slider(const wxPoint& pt)
|
||||||
{
|
{
|
||||||
if (is_point_in_rect(pt, m_rect_lower_thumb))
|
if (is_point_in_rect(pt, m_rect_lower_thumb))
|
||||||
|
|
|
@ -293,6 +293,7 @@ protected:
|
||||||
void draw_thumb_text(wxDC& dc, const wxPoint& pos, const SelectedSlider& selection) const;
|
void draw_thumb_text(wxDC& dc, const wxPoint& pos, const SelectedSlider& selection) const;
|
||||||
|
|
||||||
void update_thumb_rect(const wxCoord begin_x, const wxCoord begin_y, const SelectedSlider& selection);
|
void update_thumb_rect(const wxCoord begin_x, const wxCoord begin_y, const SelectedSlider& selection);
|
||||||
|
bool is_lower_thumb_editable();
|
||||||
bool detect_selected_slider(const wxPoint& pt);
|
bool detect_selected_slider(const wxPoint& pt);
|
||||||
void correct_lower_value();
|
void correct_lower_value();
|
||||||
void correct_higher_value();
|
void correct_higher_value();
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace Slic3r {
|
||||||
namespace GUI {
|
namespace GUI {
|
||||||
|
|
||||||
ExtruderSequenceDialog::ExtruderSequenceDialog(const DoubleSlider::ExtrudersSequence& sequence)
|
ExtruderSequenceDialog::ExtruderSequenceDialog(const DoubleSlider::ExtrudersSequence& sequence)
|
||||||
: DPIDialog(NULL, wxID_ANY, wxString(SLIC3R_APP_NAME) + " - " + _(L("Set extruder sequence")),
|
: DPIDialog((wxWindow*)wxGetApp().mainframe, wxID_ANY, wxString(SLIC3R_APP_NAME) + " - " + _(L("Set extruder sequence")),
|
||||||
wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER),
|
wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER),
|
||||||
m_sequence(sequence)
|
m_sequence(sequence)
|
||||||
{
|
{
|
||||||
|
@ -36,7 +36,7 @@ ExtruderSequenceDialog::ExtruderSequenceDialog(const DoubleSlider::ExtrudersSequ
|
||||||
|
|
||||||
auto option_sizer = new wxBoxSizer(wxVERTICAL);
|
auto option_sizer = new wxBoxSizer(wxVERTICAL);
|
||||||
|
|
||||||
auto intervals_box = new wxStaticBox(this, wxID_ANY, _(L("Set extruder change for every"))+ " : ");
|
auto intervals_box = new wxStaticBox(this, wxID_ANY, _(L("Set extruder change for every"))+ ": ");
|
||||||
auto intervals_box_sizer = new wxStaticBoxSizer(intervals_box, wxVERTICAL);
|
auto intervals_box_sizer = new wxStaticBoxSizer(intervals_box, wxVERTICAL);
|
||||||
|
|
||||||
m_intervals_grid_sizer = new wxFlexGridSizer(3, 5, em);
|
m_intervals_grid_sizer = new wxFlexGridSizer(3, 5, em);
|
||||||
|
@ -114,26 +114,26 @@ ExtruderSequenceDialog::ExtruderSequenceDialog(const DoubleSlider::ExtrudersSequ
|
||||||
rb_by_mm->SetValue(true);
|
rb_by_mm->SetValue(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
m_interval_by_mm->Bind(wxEVT_KILL_FOCUS, [this, change_value](wxFocusEvent& event)
|
m_interval_by_mm->Bind(wxEVT_KILL_FOCUS, [change_value](wxFocusEvent& event)
|
||||||
{
|
{
|
||||||
change_value();
|
change_value();
|
||||||
event.Skip();
|
event.Skip();
|
||||||
});
|
});
|
||||||
|
|
||||||
m_interval_by_mm->Bind(wxEVT_TEXT_ENTER, [this, change_value](wxEvent&)
|
m_interval_by_mm->Bind(wxEVT_TEXT_ENTER, [change_value](wxEvent&)
|
||||||
{
|
{
|
||||||
change_value();
|
change_value();
|
||||||
});
|
});
|
||||||
|
|
||||||
m_intervals_grid_sizer->Add(rb_by_mm, 0, wxALIGN_CENTER_VERTICAL);
|
m_intervals_grid_sizer->Add(rb_by_mm, 0, wxALIGN_CENTER_VERTICAL);
|
||||||
m_intervals_grid_sizer->Add(m_interval_by_mm,0, wxALIGN_CENTER_VERTICAL);
|
m_intervals_grid_sizer->Add(m_interval_by_mm, 0, wxALIGN_CENTER_VERTICAL);
|
||||||
m_intervals_grid_sizer->Add(st_by_mm,0, wxALIGN_CENTER_VERTICAL);
|
m_intervals_grid_sizer->Add(st_by_mm,0, wxALIGN_CENTER_VERTICAL);
|
||||||
|
|
||||||
intervals_box_sizer->Add(m_intervals_grid_sizer, 0, wxLEFT, em);
|
intervals_box_sizer->Add(m_intervals_grid_sizer, 0, wxLEFT, em);
|
||||||
option_sizer->Add(intervals_box_sizer, 0, wxEXPAND);
|
option_sizer->Add(intervals_box_sizer, 0, wxEXPAND);
|
||||||
|
|
||||||
|
|
||||||
auto extruders_box = new wxStaticBox(this, wxID_ANY, _(L("Set extruder(tool) sequence"))+ " : ");
|
auto extruders_box = new wxStaticBox(this, wxID_ANY, _(L("Set extruder(tool) sequence"))+ ": ");
|
||||||
auto extruders_box_sizer = new wxStaticBoxSizer(extruders_box, wxVERTICAL);
|
auto extruders_box_sizer = new wxStaticBoxSizer(extruders_box, wxVERTICAL);
|
||||||
|
|
||||||
m_extruders_grid_sizer = new wxFlexGridSizer(3, 5, em);
|
m_extruders_grid_sizer = new wxFlexGridSizer(3, 5, em);
|
||||||
|
|
|
@ -693,6 +693,11 @@ void SpinCtrl::BUILD() {
|
||||||
|
|
||||||
auto temp = new wxSpinCtrl(m_parent, wxID_ANY, text_value, wxDefaultPosition, size,
|
auto temp = new wxSpinCtrl(m_parent, wxID_ANY, text_value, wxDefaultPosition, size,
|
||||||
0|wxTE_PROCESS_ENTER, min_val, max_val, default_value);
|
0|wxTE_PROCESS_ENTER, min_val, max_val, default_value);
|
||||||
|
#ifdef __WXGTK3__
|
||||||
|
wxSize best_sz = temp->GetBestSize();
|
||||||
|
if (best_sz.x > size.x)
|
||||||
|
temp->SetSize(wxSize(size.x + 2 * best_sz.y, best_sz.y));
|
||||||
|
#endif //__WXGTK3__
|
||||||
temp->SetFont(Slic3r::GUI::wxGetApp().normal_font());
|
temp->SetFont(Slic3r::GUI::wxGetApp().normal_font());
|
||||||
if (!wxOSX) temp->SetBackgroundStyle(wxBG_STYLE_PAINT);
|
if (!wxOSX) temp->SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||||
|
|
||||||
|
|
|
@ -112,16 +112,14 @@ bool GCodeViewer::Path::matches(const GCodeProcessor::MoveVertex& move) const
|
||||||
case EMoveType::Custom_GCode:
|
case EMoveType::Custom_GCode:
|
||||||
case EMoveType::Retract:
|
case EMoveType::Retract:
|
||||||
case EMoveType::Unretract:
|
case EMoveType::Unretract:
|
||||||
case EMoveType::Extrude:
|
case EMoveType::Extrude: {
|
||||||
{
|
|
||||||
// use rounding to reduce the number of generated paths
|
// use rounding to reduce the number of generated paths
|
||||||
return type == move.type && role == move.extrusion_role && height == round_to_nearest(move.height, 2) &&
|
return type == move.type && move.position[2] <= first.position[2] && role == move.extrusion_role && height == round_to_nearest(move.height, 2) &&
|
||||||
width == round_to_nearest(move.width, 2) && feedrate == move.feedrate && fan_speed == move.fan_speed &&
|
width == round_to_nearest(move.width, 2) && feedrate == move.feedrate && fan_speed == move.fan_speed &&
|
||||||
volumetric_rate == round_to_nearest(move.volumetric_rate(), 2) && extruder_id == move.extruder_id &&
|
volumetric_rate == round_to_nearest(move.volumetric_rate(), 2) && extruder_id == move.extruder_id &&
|
||||||
cp_color_id == move.cp_color_id;
|
cp_color_id == move.cp_color_id;
|
||||||
}
|
}
|
||||||
case EMoveType::Travel:
|
case EMoveType::Travel: {
|
||||||
{
|
|
||||||
return type == move.type && feedrate == move.feedrate && extruder_id == move.extruder_id && cp_color_id == move.cp_color_id;
|
return type == move.type && feedrate == move.feedrate && extruder_id == move.extruder_id && cp_color_id == move.cp_color_id;
|
||||||
}
|
}
|
||||||
default: { return false; }
|
default: { return false; }
|
||||||
|
@ -302,9 +300,11 @@ void GCodeViewer::load(const GCodeProcessor::Result& gcode_result, const Print&
|
||||||
reset();
|
reset();
|
||||||
|
|
||||||
load_toolpaths(gcode_result);
|
load_toolpaths(gcode_result);
|
||||||
if (m_layers_zs.empty())
|
if (m_layers.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
m_settings_ids = gcode_result.settings_ids;
|
||||||
|
|
||||||
if (wxGetApp().is_editor())
|
if (wxGetApp().is_editor())
|
||||||
load_shells(print, initialized);
|
load_shells(print, initialized);
|
||||||
else {
|
else {
|
||||||
|
@ -316,8 +316,8 @@ void GCodeViewer::load(const GCodeProcessor::Result& gcode_result, const Print&
|
||||||
// bed shape detected in the gcode
|
// bed shape detected in the gcode
|
||||||
bed_shape = gcode_result.bed_shape;
|
bed_shape = gcode_result.bed_shape;
|
||||||
auto bundle = wxGetApp().preset_bundle;
|
auto bundle = wxGetApp().preset_bundle;
|
||||||
if (bundle != nullptr && !gcode_result.printer_settings_id.empty()) {
|
if (bundle != nullptr && !m_settings_ids.printer.empty()) {
|
||||||
const Preset* preset = bundle->printers.find_preset(gcode_result.printer_settings_id);
|
const Preset* preset = bundle->printers.find_preset(m_settings_ids.printer);
|
||||||
if (preset != nullptr) {
|
if (preset != nullptr) {
|
||||||
model = PresetUtils::system_printer_bed_model(*preset);
|
model = PresetUtils::system_printer_bed_model(*preset);
|
||||||
texture = PresetUtils::system_printer_bed_texture(*preset);
|
texture = PresetUtils::system_printer_bed_texture(*preset);
|
||||||
|
@ -412,6 +412,9 @@ void GCodeViewer::refresh(const GCodeProcessor::Result& gcode_result, const std:
|
||||||
|
|
||||||
void GCodeViewer::reset()
|
void GCodeViewer::reset()
|
||||||
{
|
{
|
||||||
|
m_initialized = false;
|
||||||
|
m_gl_data_initialized = false;
|
||||||
|
|
||||||
m_moves_count = 0;
|
m_moves_count = 0;
|
||||||
for (TBuffer& buffer : m_buffers) {
|
for (TBuffer& buffer : m_buffers) {
|
||||||
buffer.reset();
|
buffer.reset();
|
||||||
|
@ -420,12 +423,13 @@ void GCodeViewer::reset()
|
||||||
m_paths_bounding_box = BoundingBoxf3();
|
m_paths_bounding_box = BoundingBoxf3();
|
||||||
m_max_bounding_box = BoundingBoxf3();
|
m_max_bounding_box = BoundingBoxf3();
|
||||||
m_tool_colors = std::vector<Color>();
|
m_tool_colors = std::vector<Color>();
|
||||||
|
m_extruders_count = 0;
|
||||||
m_extruder_ids = std::vector<unsigned char>();
|
m_extruder_ids = std::vector<unsigned char>();
|
||||||
m_extrusions.reset_role_visibility_flags();
|
m_extrusions.reset_role_visibility_flags();
|
||||||
m_extrusions.reset_ranges();
|
m_extrusions.reset_ranges();
|
||||||
m_shells.volumes.clear();
|
m_shells.volumes.clear();
|
||||||
m_layers_zs = std::vector<double>();
|
m_layers.reset();
|
||||||
m_layers_z_range = { 0.0, 0.0 };
|
m_layers_z_range = { 0, 0 };
|
||||||
m_roles = std::vector<ExtrusionRole>();
|
m_roles = std::vector<ExtrusionRole>();
|
||||||
m_time_statistics.reset();
|
m_time_statistics.reset();
|
||||||
m_time_estimate_mode = PrintEstimatedTimeStatistics::ETimeMode::Normal;
|
m_time_estimate_mode = PrintEstimatedTimeStatistics::ETimeMode::Normal;
|
||||||
|
@ -438,46 +442,39 @@ void GCodeViewer::reset()
|
||||||
void GCodeViewer::render() const
|
void GCodeViewer::render() const
|
||||||
{
|
{
|
||||||
auto init_gl_data = [this]() {
|
auto init_gl_data = [this]() {
|
||||||
static bool first_run = true;
|
// initializes opengl data of TBuffers
|
||||||
if (first_run) {
|
for (size_t i = 0; i < m_buffers.size(); ++i) {
|
||||||
// initializes opengl data of TBuffers
|
TBuffer& buffer = m_buffers[i];
|
||||||
for (size_t i = 0; i < m_buffers.size(); ++i) {
|
switch (buffer_type(i)) {
|
||||||
TBuffer& buffer = m_buffers[i];
|
default: { break; }
|
||||||
switch (buffer_type(i))
|
case EMoveType::Tool_change:
|
||||||
{
|
case EMoveType::Color_change:
|
||||||
default: { break; }
|
case EMoveType::Pause_Print:
|
||||||
case EMoveType::Tool_change:
|
case EMoveType::Custom_GCode:
|
||||||
case EMoveType::Color_change:
|
case EMoveType::Retract:
|
||||||
case EMoveType::Pause_Print:
|
case EMoveType::Unretract: {
|
||||||
case EMoveType::Custom_GCode:
|
buffer.shader = wxGetApp().is_glsl_version_greater_or_equal_to(1, 20) ? "options_120" : "options_110";
|
||||||
case EMoveType::Retract:
|
break;
|
||||||
case EMoveType::Unretract:
|
}
|
||||||
{
|
case EMoveType::Extrude: {
|
||||||
buffer.shader = wxGetApp().is_glsl_version_greater_or_equal_to(1, 20) ? "options_120" : "options_110";
|
buffer.shader = "gouraud_light";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EMoveType::Extrude:
|
case EMoveType::Travel: {
|
||||||
{
|
buffer.shader = "toolpaths_lines";
|
||||||
buffer.shader = "gouraud_light";
|
break;
|
||||||
break;
|
}
|
||||||
}
|
|
||||||
case EMoveType::Travel:
|
|
||||||
{
|
|
||||||
buffer.shader = "toolpaths_lines";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// initializes tool marker
|
|
||||||
m_sequential_view.marker.init();
|
|
||||||
|
|
||||||
// initializes point sizes
|
|
||||||
std::array<int, 2> point_sizes;
|
|
||||||
::glGetIntegerv(GL_ALIASED_POINT_SIZE_RANGE, point_sizes.data());
|
|
||||||
m_detected_point_sizes = { static_cast<float>(point_sizes[0]), static_cast<float>(point_sizes[1]) };
|
|
||||||
first_run = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// initializes tool marker
|
||||||
|
m_sequential_view.marker.init();
|
||||||
|
|
||||||
|
// initializes point sizes
|
||||||
|
std::array<int, 2> point_sizes;
|
||||||
|
::glGetIntegerv(GL_ALIASED_POINT_SIZE_RANGE, point_sizes.data());
|
||||||
|
m_detected_point_sizes = { static_cast<float>(point_sizes[0]), static_cast<float>(point_sizes[1]) };
|
||||||
|
m_gl_data_initialized = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER_STATISTICS
|
#if ENABLE_GCODE_VIEWER_STATISTICS
|
||||||
|
@ -486,7 +483,8 @@ void GCodeViewer::render() const
|
||||||
|
|
||||||
// OpenGL data must be initialized after the glContext has been created.
|
// OpenGL data must be initialized after the glContext has been created.
|
||||||
// This is ensured when this method is called by GLCanvas3D::_render_gcode().
|
// This is ensured when this method is called by GLCanvas3D::_render_gcode().
|
||||||
init_gl_data();
|
if (!m_gl_data_initialized)
|
||||||
|
init_gl_data();
|
||||||
|
|
||||||
if (m_roles.empty())
|
if (m_roles.empty())
|
||||||
return;
|
return;
|
||||||
|
@ -601,7 +599,7 @@ void GCodeViewer::set_options_visibility_from_flags(unsigned int flags)
|
||||||
enable_legend(is_flag_set(static_cast<unsigned int>(Preview::OptionType::Legend)));
|
enable_legend(is_flag_set(static_cast<unsigned int>(Preview::OptionType::Legend)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GCodeViewer::set_layers_z_range(const std::array<double, 2>& layers_z_range)
|
void GCodeViewer::set_layers_z_range(const std::array<unsigned int, 2>& layers_z_range)
|
||||||
{
|
{
|
||||||
bool keep_sequential_current_first = layers_z_range[0] >= m_layers_z_range[0];
|
bool keep_sequential_current_first = layers_z_range[0] >= m_layers_z_range[0];
|
||||||
bool keep_sequential_current_last = layers_z_range[1] <= m_layers_z_range[1];
|
bool keep_sequential_current_last = layers_z_range[1] <= m_layers_z_range[1];
|
||||||
|
@ -967,6 +965,8 @@ void GCodeViewer::load_toolpaths(const GCodeProcessor::Result& gcode_result)
|
||||||
new wxProgressDialog(_L("Generating toolpaths"), "...",
|
new wxProgressDialog(_L("Generating toolpaths"), "...",
|
||||||
100, wxGetApp().plater(), wxPD_AUTO_HIDE | wxPD_APP_MODAL) : nullptr;
|
100, wxGetApp().plater(), wxPD_AUTO_HIDE | wxPD_APP_MODAL) : nullptr;
|
||||||
|
|
||||||
|
m_extruders_count = gcode_result.extruders_count;
|
||||||
|
|
||||||
for (size_t i = 0; i < m_moves_count; ++i) {
|
for (size_t i = 0; i < m_moves_count; ++i) {
|
||||||
const GCodeProcessor::MoveVertex& move = gcode_result.moves[i];
|
const GCodeProcessor::MoveVertex& move = gcode_result.moves[i];
|
||||||
if (wxGetApp().is_gcode_viewer())
|
if (wxGetApp().is_gcode_viewer())
|
||||||
|
@ -1532,36 +1532,35 @@ void GCodeViewer::load_toolpaths(const GCodeProcessor::Result& gcode_result)
|
||||||
std::vector<MultiIndexBuffer>().swap(indices);
|
std::vector<MultiIndexBuffer>().swap(indices);
|
||||||
|
|
||||||
// layers zs / roles / extruder ids / cp color ids -> extract from result
|
// layers zs / roles / extruder ids / cp color ids -> extract from result
|
||||||
|
size_t last_travel_s_id = 0;
|
||||||
for (size_t i = 0; i < m_moves_count; ++i) {
|
for (size_t i = 0; i < m_moves_count; ++i) {
|
||||||
const GCodeProcessor::MoveVertex& move = gcode_result.moves[i];
|
const GCodeProcessor::MoveVertex& move = gcode_result.moves[i];
|
||||||
if (move.type == EMoveType::Extrude)
|
if (move.type == EMoveType::Extrude) {
|
||||||
m_layers_zs.emplace_back(static_cast<double>(move.position[2]));
|
// layers zs
|
||||||
|
const double* const last_z = m_layers.empty() ? nullptr : &m_layers.get_zs().back();
|
||||||
|
double z = static_cast<double>(move.position[2]);
|
||||||
|
if (last_z == nullptr || z < *last_z - EPSILON || *last_z + EPSILON < z)
|
||||||
|
m_layers.append(z, { last_travel_s_id, i });
|
||||||
|
else
|
||||||
|
m_layers.get_endpoints().back().last = i;
|
||||||
|
// extruder ids
|
||||||
|
m_extruder_ids.emplace_back(move.extruder_id);
|
||||||
|
// roles
|
||||||
|
if (i > 0)
|
||||||
|
m_roles.emplace_back(move.extrusion_role);
|
||||||
|
}
|
||||||
|
else if (move.type == EMoveType::Travel) {
|
||||||
|
if (i - last_travel_s_id > 1 && !m_layers.empty())
|
||||||
|
m_layers.get_endpoints().back().last = i;
|
||||||
|
|
||||||
m_extruder_ids.emplace_back(move.extruder_id);
|
last_travel_s_id = i;
|
||||||
|
}
|
||||||
if (i > 0)
|
|
||||||
m_roles.emplace_back(move.extrusion_role);
|
|
||||||
}
|
|
||||||
|
|
||||||
// layers zs -> replace intervals of layers with similar top positions with their average value.
|
|
||||||
std::sort(m_layers_zs.begin(), m_layers_zs.end());
|
|
||||||
int n = int(m_layers_zs.size());
|
|
||||||
int k = 0;
|
|
||||||
for (int i = 0; i < n;) {
|
|
||||||
int j = i + 1;
|
|
||||||
double zmax = m_layers_zs[i] + EPSILON;
|
|
||||||
for (; j < n && m_layers_zs[j] <= zmax; ++j);
|
|
||||||
m_layers_zs[k++] = (j > i + 1) ? (0.5 * (m_layers_zs[i] + m_layers_zs[j - 1])) : m_layers_zs[i];
|
|
||||||
i = j;
|
|
||||||
}
|
|
||||||
if (k < n) {
|
|
||||||
m_layers_zs.erase(m_layers_zs.begin() + k, m_layers_zs.end());
|
|
||||||
m_layers_zs.shrink_to_fit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// set layers z range
|
// set layers z range
|
||||||
if (!m_layers_zs.empty())
|
if (!m_layers.empty()) {
|
||||||
m_layers_z_range = { m_layers_zs.front(), m_layers_zs.back() };
|
m_layers_z_range = { 0, static_cast<unsigned int>(m_layers.size() - 1) };
|
||||||
|
}
|
||||||
|
|
||||||
// roles -> remove duplicates
|
// roles -> remove duplicates
|
||||||
std::sort(m_roles.begin(), m_roles.end());
|
std::sort(m_roles.begin(), m_roles.end());
|
||||||
|
@ -1670,34 +1669,46 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool
|
||||||
Travel_Colors[0] /* Move */);
|
Travel_Colors[0] /* Move */);
|
||||||
};
|
};
|
||||||
|
|
||||||
auto is_in_z_range = [](const Path& path, double min_z, double max_z) {
|
auto is_in_layers_range = [this](const Path& path, size_t min_id, size_t max_id) {
|
||||||
auto in_z_range = [min_z, max_z](double z) {
|
auto in_layers_range = [this, min_id, max_id](size_t id) {
|
||||||
return z > min_z - EPSILON && z < max_z + EPSILON;
|
return m_layers.get_endpoints_at(min_id).first <= id && id <= m_layers.get_endpoints_at(max_id).last;
|
||||||
};
|
};
|
||||||
|
|
||||||
return in_z_range(path.first.position[2]) || in_z_range(path.last.position[2]);
|
return in_layers_range(path.first.s_id) || in_layers_range(path.last.s_id);
|
||||||
};
|
};
|
||||||
|
|
||||||
auto is_travel_in_z_range = [this, is_in_z_range](size_t path_id, double min_z, double max_z) {
|
auto is_travel_in_layers_range = [this](size_t path_id, size_t min_id, size_t max_id) {
|
||||||
|
auto is_in_z_range = [](const Path& path, double min_z, double max_z) {
|
||||||
|
auto in_z_range = [min_z, max_z](double z) {
|
||||||
|
return min_z - EPSILON < z&& z < max_z + EPSILON;
|
||||||
|
};
|
||||||
|
|
||||||
|
return in_z_range(path.first.position[2]) || in_z_range(path.last.position[2]);
|
||||||
|
};
|
||||||
|
|
||||||
const TBuffer& buffer = m_buffers[buffer_id(EMoveType::Travel)];
|
const TBuffer& buffer = m_buffers[buffer_id(EMoveType::Travel)];
|
||||||
if (path_id >= buffer.paths.size())
|
if (path_id >= buffer.paths.size())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Path path = buffer.paths[path_id];
|
Path path = buffer.paths[path_id];
|
||||||
int first = static_cast<int>(path_id);
|
size_t first = path_id;
|
||||||
unsigned int last = static_cast<unsigned int>(path_id);
|
size_t last = path_id;
|
||||||
|
|
||||||
// check adjacent paths
|
// check adjacent paths
|
||||||
while (first > 0 && path.first.position.isApprox(buffer.paths[first - 1].last.position)) {
|
while (first > 0 && path.first.position.isApprox(buffer.paths[first - 1].last.position)) {
|
||||||
--first;
|
--first;
|
||||||
path.first = buffer.paths[first].first;
|
path.first = buffer.paths[first].first;
|
||||||
}
|
}
|
||||||
while (last < static_cast<unsigned int>(buffer.paths.size() - 1) && path.last.position.isApprox(buffer.paths[last + 1].first.position)) {
|
while (last < buffer.paths.size() - 1 && path.last.position.isApprox(buffer.paths[last + 1].first.position)) {
|
||||||
++last;
|
++last;
|
||||||
path.last = buffer.paths[last].last;
|
path.last = buffer.paths[last].last;
|
||||||
}
|
}
|
||||||
|
|
||||||
return is_in_z_range(path, min_z, max_z);
|
size_t min_s_id = m_layers.get_endpoints_at(min_id).first;
|
||||||
|
size_t max_s_id = m_layers.get_endpoints_at(max_id).last;
|
||||||
|
|
||||||
|
return (min_s_id <= path.first.s_id && path.first.s_id <= max_s_id) ||
|
||||||
|
(min_s_id <= path.last.s_id && path.last.s_id <= max_s_id);
|
||||||
};
|
};
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER_STATISTICS
|
#if ENABLE_GCODE_VIEWER_STATISTICS
|
||||||
|
@ -1723,10 +1734,10 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool
|
||||||
for (size_t i = 0; i < buffer.paths.size(); ++i) {
|
for (size_t i = 0; i < buffer.paths.size(); ++i) {
|
||||||
const Path& path = buffer.paths[i];
|
const Path& path = buffer.paths[i];
|
||||||
if (path.type == EMoveType::Travel) {
|
if (path.type == EMoveType::Travel) {
|
||||||
if (!is_travel_in_z_range(i, m_layers_z_range[0], m_layers_z_range[1]))
|
if (!is_travel_in_layers_range(i, m_layers_z_range[0], m_layers_z_range[1]))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (!is_in_z_range(path, m_layers_z_range[0], m_layers_z_range[1]))
|
else if (!is_in_layers_range(path, m_layers_z_range[0], m_layers_z_range[1]))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (path.type == EMoveType::Extrude && !is_visible(path))
|
if (path.type == EMoveType::Extrude && !is_visible(path))
|
||||||
|
@ -1740,12 +1751,12 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool
|
||||||
|
|
||||||
if (top_layer_only) {
|
if (top_layer_only) {
|
||||||
if (path.type == EMoveType::Travel) {
|
if (path.type == EMoveType::Travel) {
|
||||||
if (is_travel_in_z_range(i, m_layers_z_range[1], m_layers_z_range[1])) {
|
if (is_travel_in_layers_range(i, m_layers_z_range[1], m_layers_z_range[1])) {
|
||||||
top_layer_endpoints.first = std::min(top_layer_endpoints.first, path.first.s_id);
|
top_layer_endpoints.first = std::min(top_layer_endpoints.first, path.first.s_id);
|
||||||
top_layer_endpoints.last = std::max(top_layer_endpoints.last, path.last.s_id);
|
top_layer_endpoints.last = std::max(top_layer_endpoints.last, path.last.s_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (is_in_z_range(path, m_layers_z_range[1], m_layers_z_range[1])) {
|
else if (is_in_layers_range(path, m_layers_z_range[1], m_layers_z_range[1])) {
|
||||||
top_layer_endpoints.first = std::min(top_layer_endpoints.first, path.first.s_id);
|
top_layer_endpoints.first = std::min(top_layer_endpoints.first, path.first.s_id);
|
||||||
top_layer_endpoints.last = std::max(top_layer_endpoints.last, path.last.s_id);
|
top_layer_endpoints.last = std::max(top_layer_endpoints.last, path.last.s_id);
|
||||||
}
|
}
|
||||||
|
@ -1802,7 +1813,9 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool
|
||||||
switch (path.type)
|
switch (path.type)
|
||||||
{
|
{
|
||||||
case EMoveType::Extrude: {
|
case EMoveType::Extrude: {
|
||||||
if (!top_layer_only || m_sequential_view.current.last == global_endpoints.last || is_in_z_range(path, m_layers_z_range[1], m_layers_z_range[1]))
|
if (!top_layer_only ||
|
||||||
|
m_sequential_view.current.last == global_endpoints.last ||
|
||||||
|
is_in_layers_range(path, m_layers_z_range[1], m_layers_z_range[1]))
|
||||||
color = extrusion_color(path);
|
color = extrusion_color(path);
|
||||||
else
|
else
|
||||||
color = { 0.25f, 0.25f, 0.25f };
|
color = { 0.25f, 0.25f, 0.25f };
|
||||||
|
@ -1810,7 +1823,7 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EMoveType::Travel: {
|
case EMoveType::Travel: {
|
||||||
if (!top_layer_only || m_sequential_view.current.last == global_endpoints.last || is_travel_in_z_range(path_id, m_layers_z_range[1], m_layers_z_range[1]))
|
if (!top_layer_only || m_sequential_view.current.last == global_endpoints.last || is_travel_in_layers_range(path_id, m_layers_z_range[1], m_layers_z_range[1]))
|
||||||
color = (m_view_type == EViewType::Feedrate || m_view_type == EViewType::Tool || m_view_type == EViewType::ColorPrint) ? extrusion_color(path) : travel_color(path);
|
color = (m_view_type == EViewType::Feedrate || m_view_type == EViewType::Tool || m_view_type == EViewType::ColorPrint) ? extrusion_color(path) : travel_color(path);
|
||||||
else
|
else
|
||||||
color = { 0.25f, 0.25f, 0.25f };
|
color = { 0.25f, 0.25f, 0.25f };
|
||||||
|
@ -1870,7 +1883,11 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool
|
||||||
|
|
||||||
void GCodeViewer::render_toolpaths() const
|
void GCodeViewer::render_toolpaths() const
|
||||||
{
|
{
|
||||||
|
#if ENABLE_FIXED_SCREEN_SIZE_POINT_MARKERS
|
||||||
|
float point_size = 20.0f;
|
||||||
|
#else
|
||||||
float point_size = 0.8f;
|
float point_size = 0.8f;
|
||||||
|
#endif // ENABLE_FIXED_SCREEN_SIZE_POINT_MARKERS
|
||||||
std::array<float, 4> light_intensity = { 0.25f, 0.70f, 0.75f, 0.75f };
|
std::array<float, 4> light_intensity = { 0.25f, 0.70f, 0.75f, 0.75f };
|
||||||
const Camera& camera = wxGetApp().plater()->get_camera();
|
const Camera& camera = wxGetApp().plater()->get_camera();
|
||||||
double zoom = camera.get_zoom();
|
double zoom = camera.get_zoom();
|
||||||
|
@ -1886,6 +1903,11 @@ void GCodeViewer::render_toolpaths() const
|
||||||
auto render_as_points = [this, zoom, point_size, near_plane_height, set_uniform_color]
|
auto render_as_points = [this, zoom, point_size, near_plane_height, set_uniform_color]
|
||||||
(const TBuffer& buffer, unsigned int index_buffer_id, EOptionsColors color_id, GLShaderProgram& shader) {
|
(const TBuffer& buffer, unsigned int index_buffer_id, EOptionsColors color_id, GLShaderProgram& shader) {
|
||||||
set_uniform_color(Options_Colors[static_cast<unsigned int>(color_id)], shader);
|
set_uniform_color(Options_Colors[static_cast<unsigned int>(color_id)], shader);
|
||||||
|
#if ENABLE_FIXED_SCREEN_SIZE_POINT_MARKERS
|
||||||
|
shader.set_uniform("use_fixed_screen_size", 1);
|
||||||
|
#else
|
||||||
|
shader.set_uniform("use_fixed_screen_size", 0);
|
||||||
|
#endif // ENABLE_FIXED_SCREEN_SIZE_POINT_MARKERS
|
||||||
shader.set_uniform("zoom", zoom);
|
shader.set_uniform("zoom", zoom);
|
||||||
shader.set_uniform("percent_outline_radius", 0.0f);
|
shader.set_uniform("percent_outline_radius", 0.0f);
|
||||||
shader.set_uniform("percent_center_radius", 0.33f);
|
shader.set_uniform("percent_center_radius", 0.33f);
|
||||||
|
@ -2057,17 +2079,14 @@ void GCodeViewer::render_legend() const
|
||||||
if (!visible)
|
if (!visible)
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, 0.3333f);
|
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, 0.3333f);
|
||||||
ImVec2 pos = ImGui::GetCursorScreenPos();
|
ImVec2 pos = ImGui::GetCursorScreenPos();
|
||||||
switch (type)
|
switch (type) {
|
||||||
{
|
|
||||||
default:
|
default:
|
||||||
case EItemType::Rect:
|
case EItemType::Rect: {
|
||||||
{
|
|
||||||
draw_list->AddRectFilled({ pos.x + 1.0f, pos.y + 1.0f }, { pos.x + icon_size - 1.0f, pos.y + icon_size - 1.0f },
|
draw_list->AddRectFilled({ pos.x + 1.0f, pos.y + 1.0f }, { pos.x + icon_size - 1.0f, pos.y + icon_size - 1.0f },
|
||||||
ImGui::GetColorU32({ color[0], color[1], color[2], 1.0f }));
|
ImGui::GetColorU32({ color[0], color[1], color[2], 1.0f }));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EItemType::Circle:
|
case EItemType::Circle: {
|
||||||
{
|
|
||||||
ImVec2 center(0.5f * (pos.x + pos.x + icon_size), 0.5f * (pos.y + pos.y + icon_size));
|
ImVec2 center(0.5f * (pos.x + pos.x + icon_size), 0.5f * (pos.y + pos.y + icon_size));
|
||||||
if (m_buffers[buffer_id(EMoveType::Retract)].shader == "options_120") {
|
if (m_buffers[buffer_id(EMoveType::Retract)].shader == "options_120") {
|
||||||
draw_list->AddCircleFilled(center, 0.5f * icon_size,
|
draw_list->AddCircleFilled(center, 0.5f * icon_size,
|
||||||
|
@ -2082,14 +2101,12 @@ void GCodeViewer::render_legend() const
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EItemType::Hexagon:
|
case EItemType::Hexagon: {
|
||||||
{
|
|
||||||
ImVec2 center(0.5f * (pos.x + pos.x + icon_size), 0.5f * (pos.y + pos.y + icon_size));
|
ImVec2 center(0.5f * (pos.x + pos.x + icon_size), 0.5f * (pos.y + pos.y + icon_size));
|
||||||
draw_list->AddNgonFilled(center, 0.5f * icon_size, ImGui::GetColorU32({ color[0], color[1], color[2], 1.0f }), 6);
|
draw_list->AddNgonFilled(center, 0.5f * icon_size, ImGui::GetColorU32({ color[0], color[1], color[2], 1.0f }), 6);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EItemType::Line:
|
case EItemType::Line: {
|
||||||
{
|
|
||||||
draw_list->AddLine({ pos.x + 1, pos.y + icon_size - 1 }, { pos.x + icon_size - 1, pos.y + 1 }, ImGui::GetColorU32({ color[0], color[1], color[2], 1.0f }), 3.0f);
|
draw_list->AddLine({ pos.x + 1, pos.y + icon_size - 1 }, { pos.x + icon_size - 1, pos.y + 1 }, ImGui::GetColorU32({ color[0], color[1], color[2], 1.0f }), 3.0f);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2201,13 +2218,13 @@ void GCodeViewer::render_legend() const
|
||||||
if (item.type != ColorChange)
|
if (item.type != ColorChange)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
auto lower_b = std::lower_bound(m_layers_zs.begin(), m_layers_zs.end(), item.print_z - Slic3r::DoubleSlider::epsilon());
|
const std::vector<double> zs = m_layers.get_zs();
|
||||||
|
auto lower_b = std::lower_bound(zs.begin(), zs.end(), item.print_z - Slic3r::DoubleSlider::epsilon());
|
||||||
if (lower_b == m_layers_zs.end())
|
if (lower_b == zs.end())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
double current_z = *lower_b;
|
double current_z = *lower_b;
|
||||||
double previous_z = lower_b == m_layers_zs.begin() ? 0.0 : *(--lower_b);
|
double previous_z = (lower_b == zs.begin()) ? 0.0 : *(--lower_b);
|
||||||
|
|
||||||
// to avoid duplicate values, check adding values
|
// to avoid duplicate values, check adding values
|
||||||
if (ret.empty() || !(ret.back().second.first == previous_z && ret.back().second.second == current_z))
|
if (ret.empty() || !(ret.back().second.first == previous_z && ret.back().second.second == current_z))
|
||||||
|
@ -2322,8 +2339,7 @@ void GCodeViewer::render_legend() const
|
||||||
case EViewType::ColorPrint:
|
case EViewType::ColorPrint:
|
||||||
{
|
{
|
||||||
const std::vector<CustomGCode::Item>& custom_gcode_per_print_z = wxGetApp().plater()->model().custom_gcode_per_print_z.gcodes;
|
const std::vector<CustomGCode::Item>& custom_gcode_per_print_z = wxGetApp().plater()->model().custom_gcode_per_print_z.gcodes;
|
||||||
const int extruders_count = wxGetApp().extruders_edited_cnt();
|
if (m_extruders_count == 1) { // single extruder use case
|
||||||
if (extruders_count == 1) { // single extruder use case
|
|
||||||
std::vector<std::pair<Color, std::pair<double, double>>> cp_values = color_print_ranges(0, custom_gcode_per_print_z);
|
std::vector<std::pair<Color, std::pair<double, double>>> cp_values = color_print_ranges(0, custom_gcode_per_print_z);
|
||||||
const int items_cnt = static_cast<int>(cp_values.size());
|
const int items_cnt = static_cast<int>(cp_values.size());
|
||||||
if (items_cnt == 0) { // There are no color changes, but there are some pause print or custom Gcode
|
if (items_cnt == 0) { // There are no color changes, but there are some pause print or custom Gcode
|
||||||
|
@ -2415,28 +2431,26 @@ void GCodeViewer::render_legend() const
|
||||||
for (const auto& time_rec : times) {
|
for (const auto& time_rec : times) {
|
||||||
switch (time_rec.first)
|
switch (time_rec.first)
|
||||||
{
|
{
|
||||||
case CustomGCode::PausePrint:
|
case CustomGCode::PausePrint: {
|
||||||
{
|
|
||||||
auto it = std::find_if(custom_gcode_per_print_z.begin(), custom_gcode_per_print_z.end(), [time_rec](const CustomGCode::Item& item) { return item.type == time_rec.first; });
|
auto it = std::find_if(custom_gcode_per_print_z.begin(), custom_gcode_per_print_z.end(), [time_rec](const CustomGCode::Item& item) { return item.type == time_rec.first; });
|
||||||
if (it != custom_gcode_per_print_z.end()) {
|
if (it != custom_gcode_per_print_z.end()) {
|
||||||
items.push_back({ PartialTime::EType::Print, it->extruder, Color(), Color(), time_rec.second });
|
items.push_back({ PartialTime::EType::Print, it->extruder, last_color[it->extruder - 1], Color(), time_rec.second });
|
||||||
items.push_back({ PartialTime::EType::Pause, it->extruder, Color(), Color(), time_rec.second });
|
items.push_back({ PartialTime::EType::Pause, it->extruder, Color(), Color(), time_rec.second });
|
||||||
custom_gcode_per_print_z.erase(it);
|
custom_gcode_per_print_z.erase(it);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CustomGCode::ColorChange:
|
case CustomGCode::ColorChange: {
|
||||||
{
|
|
||||||
auto it = std::find_if(custom_gcode_per_print_z.begin(), custom_gcode_per_print_z.end(), [time_rec](const CustomGCode::Item& item) { return item.type == time_rec.first; });
|
auto it = std::find_if(custom_gcode_per_print_z.begin(), custom_gcode_per_print_z.end(), [time_rec](const CustomGCode::Item& item) { return item.type == time_rec.first; });
|
||||||
if (it != custom_gcode_per_print_z.end()) {
|
if (it != custom_gcode_per_print_z.end()) {
|
||||||
items.push_back({ PartialTime::EType::Print, it->extruder, Color(), Color(), time_rec.second });
|
items.push_back({ PartialTime::EType::Print, it->extruder, last_color[it->extruder - 1], Color(), time_rec.second });
|
||||||
items.push_back({ PartialTime::EType::ColorChange, it->extruder, last_color[it->extruder - 1], decode_color(it->color), time_rec.second });
|
items.push_back({ PartialTime::EType::ColorChange, it->extruder, last_color[it->extruder - 1], decode_color(it->color), time_rec.second });
|
||||||
last_color[it->extruder - 1] = decode_color(it->color);
|
last_color[it->extruder - 1] = decode_color(it->color);
|
||||||
last_extruder_id = it->extruder;
|
last_extruder_id = it->extruder;
|
||||||
custom_gcode_per_print_z.erase(it);
|
custom_gcode_per_print_z.erase(it);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
items.push_back({ PartialTime::EType::Print, last_extruder_id, Color(), Color(), time_rec.second });
|
items.push_back({ PartialTime::EType::Print, last_extruder_id, last_color[last_extruder_id - 1], Color(), time_rec.second });
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2447,7 +2461,7 @@ void GCodeViewer::render_legend() const
|
||||||
return items;
|
return items;
|
||||||
};
|
};
|
||||||
|
|
||||||
auto append_color = [this, &imgui](const Color& color1, const Color& color2, std::array<float, 2>& offsets, const Times& times) {
|
auto append_color_change = [this, &imgui](const Color& color1, const Color& color2, const std::array<float, 2>& offsets, const Times& times) {
|
||||||
imgui.text(_u8L("Color change"));
|
imgui.text(_u8L("Color change"));
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
|
||||||
|
@ -2466,6 +2480,24 @@ void GCodeViewer::render_legend() const
|
||||||
imgui.text(short_time(get_time_dhms(times.second - times.first)));
|
imgui.text(short_time(get_time_dhms(times.second - times.first)));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
auto append_print = [this, &imgui](const Color& color, const std::array<float, 2>& offsets, const Times& times) {
|
||||||
|
imgui.text(_u8L("Print"));
|
||||||
|
ImGui::SameLine();
|
||||||
|
|
||||||
|
float icon_size = ImGui::GetTextLineHeight();
|
||||||
|
ImDrawList* draw_list = ImGui::GetWindowDrawList();
|
||||||
|
ImVec2 pos = ImGui::GetCursorScreenPos();
|
||||||
|
pos.x -= 0.5f * ImGui::GetStyle().ItemSpacing.x;
|
||||||
|
|
||||||
|
draw_list->AddRectFilled({ pos.x + 1.0f, pos.y + 1.0f }, { pos.x + icon_size - 1.0f, pos.y + icon_size - 1.0f },
|
||||||
|
ImGui::GetColorU32({ color[0], color[1], color[2], 1.0f }));
|
||||||
|
|
||||||
|
ImGui::SameLine(offsets[0]);
|
||||||
|
imgui.text(short_time(get_time_dhms(times.second)));
|
||||||
|
ImGui::SameLine(offsets[1]);
|
||||||
|
imgui.text(short_time(get_time_dhms(times.first)));
|
||||||
|
};
|
||||||
|
|
||||||
PartialTimes partial_times = generate_partial_times(time_mode.custom_gcode_times);
|
PartialTimes partial_times = generate_partial_times(time_mode.custom_gcode_times);
|
||||||
if (!partial_times.empty()) {
|
if (!partial_times.empty()) {
|
||||||
labels.clear();
|
labels.clear();
|
||||||
|
@ -2474,8 +2506,8 @@ void GCodeViewer::render_legend() const
|
||||||
for (const PartialTime& item : partial_times) {
|
for (const PartialTime& item : partial_times) {
|
||||||
switch (item.type)
|
switch (item.type)
|
||||||
{
|
{
|
||||||
case PartialTime::EType::Print: { labels.push_back(_u8L("Print")); break; }
|
case PartialTime::EType::Print: { labels.push_back(_u8L("Print")); break; }
|
||||||
case PartialTime::EType::Pause: { labels.push_back(_u8L("Pause")); break; }
|
case PartialTime::EType::Pause: { labels.push_back(_u8L("Pause")); break; }
|
||||||
case PartialTime::EType::ColorChange: { labels.push_back(_u8L("Color change")); break; }
|
case PartialTime::EType::ColorChange: { labels.push_back(_u8L("Color change")); break; }
|
||||||
}
|
}
|
||||||
times.push_back(short_time(get_time_dhms(item.times.second)));
|
times.push_back(short_time(get_time_dhms(item.times.second)));
|
||||||
|
@ -2487,25 +2519,18 @@ void GCodeViewer::render_legend() const
|
||||||
for (const PartialTime& item : partial_times) {
|
for (const PartialTime& item : partial_times) {
|
||||||
switch (item.type)
|
switch (item.type)
|
||||||
{
|
{
|
||||||
case PartialTime::EType::Print:
|
case PartialTime::EType::Print: {
|
||||||
{
|
append_print(item.color1, offsets, item.times);
|
||||||
imgui.text(_u8L("Print"));
|
|
||||||
ImGui::SameLine(offsets[0]);
|
|
||||||
imgui.text(short_time(get_time_dhms(item.times.second)));
|
|
||||||
ImGui::SameLine(offsets[1]);
|
|
||||||
imgui.text(short_time(get_time_dhms(item.times.first)));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PartialTime::EType::Pause:
|
case PartialTime::EType::Pause: {
|
||||||
{
|
|
||||||
imgui.text(_u8L("Pause"));
|
imgui.text(_u8L("Pause"));
|
||||||
ImGui::SameLine(offsets[0]);
|
ImGui::SameLine(offsets[0]);
|
||||||
imgui.text(short_time(get_time_dhms(item.times.second - item.times.first)));
|
imgui.text(short_time(get_time_dhms(item.times.second - item.times.first)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PartialTime::EType::ColorChange:
|
case PartialTime::EType::ColorChange: {
|
||||||
{
|
append_color_change(item.color1, item.color2, offsets, item.times);
|
||||||
append_color(item.color1, item.color2, offsets, item.times);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2519,12 +2544,10 @@ void GCodeViewer::render_legend() const
|
||||||
{
|
{
|
||||||
case EViewType::Feedrate:
|
case EViewType::Feedrate:
|
||||||
case EViewType::Tool:
|
case EViewType::Tool:
|
||||||
case EViewType::ColorPrint:
|
case EViewType::ColorPrint: {
|
||||||
{
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default: {
|
||||||
{
|
|
||||||
// title
|
// title
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
imgui.title(_u8L("Travel"));
|
imgui.title(_u8L("Travel"));
|
||||||
|
@ -2570,8 +2593,58 @@ void GCodeViewer::render_legend() const
|
||||||
add_option(EMoveType::Unretract, EOptionsColors::Unretractions, _u8L("Deretractions"));
|
add_option(EMoveType::Unretract, EOptionsColors::Unretractions, _u8L("Deretractions"));
|
||||||
add_option(EMoveType::Tool_change, EOptionsColors::ToolChanges, _u8L("Tool changes"));
|
add_option(EMoveType::Tool_change, EOptionsColors::ToolChanges, _u8L("Tool changes"));
|
||||||
add_option(EMoveType::Color_change, EOptionsColors::ColorChanges, _u8L("Color changes"));
|
add_option(EMoveType::Color_change, EOptionsColors::ColorChanges, _u8L("Color changes"));
|
||||||
add_option(EMoveType::Pause_Print, EOptionsColors::PausePrints, _u8L("Pause prints"));
|
add_option(EMoveType::Pause_Print, EOptionsColors::PausePrints, _u8L("Print pauses"));
|
||||||
add_option(EMoveType::Custom_GCode, EOptionsColors::CustomGCodes, _u8L("Custom GCodes"));
|
add_option(EMoveType::Custom_GCode, EOptionsColors::CustomGCodes, _u8L("Custom G-codes"));
|
||||||
|
}
|
||||||
|
|
||||||
|
// settings section
|
||||||
|
if (wxGetApp().is_gcode_viewer() &&
|
||||||
|
(m_view_type == EViewType::FeatureType || m_view_type == EViewType::Tool) &&
|
||||||
|
(!m_settings_ids.print.empty() || !m_settings_ids.filament.empty() || !m_settings_ids.printer.empty())) {
|
||||||
|
|
||||||
|
auto calc_offset = [this]() {
|
||||||
|
float ret = 0.0f;
|
||||||
|
if (!m_settings_ids.printer.empty())
|
||||||
|
ret = std::max(ret, ImGui::CalcTextSize((_u8L("Printer") + std::string(":")).c_str()).x);
|
||||||
|
if (!m_settings_ids.print.empty())
|
||||||
|
ret = std::max(ret, ImGui::CalcTextSize((_u8L("Print settings") + std::string(":")).c_str()).x);
|
||||||
|
if (!m_settings_ids.filament.empty()) {
|
||||||
|
for (unsigned char i : m_extruder_ids) {
|
||||||
|
ret = std::max(ret, ImGui::CalcTextSize((_u8L("Filament") + " " + std::to_string(i + 1) + ":").c_str()).x);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ret > 0.0f)
|
||||||
|
ret += 2.0f * ImGui::GetStyle().ItemSpacing.x;
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
ImGui::Spacing();
|
||||||
|
ImGui::Spacing();
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_Separator, { 1.0f, 1.0f, 1.0f, 1.0f });
|
||||||
|
ImGui::Separator();
|
||||||
|
ImGui::PopStyleColor();
|
||||||
|
ImGui::Spacing();
|
||||||
|
|
||||||
|
float offset = calc_offset();
|
||||||
|
|
||||||
|
if (!m_settings_ids.printer.empty()) {
|
||||||
|
imgui.text(_u8L("Printer") + ":");
|
||||||
|
ImGui::SameLine(offset);
|
||||||
|
imgui.text(m_settings_ids.printer);
|
||||||
|
}
|
||||||
|
if (!m_settings_ids.print.empty()) {
|
||||||
|
imgui.text(_u8L("Print settings") + ":");
|
||||||
|
ImGui::SameLine(offset);
|
||||||
|
imgui.text(m_settings_ids.print);
|
||||||
|
}
|
||||||
|
if (!m_settings_ids.filament.empty()) {
|
||||||
|
for (unsigned char i : m_extruder_ids) {
|
||||||
|
imgui.text(_u8L("Filament") + " " + std::to_string(i + 1) + ":");
|
||||||
|
ImGui::SameLine(offset);
|
||||||
|
imgui.text(m_settings_ids.filament[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// total estimated printing time section
|
// total estimated printing time section
|
||||||
|
@ -2620,15 +2693,12 @@ void GCodeViewer::render_legend() const
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
switch (m_time_estimate_mode)
|
switch (m_time_estimate_mode) {
|
||||||
{
|
case PrintEstimatedTimeStatistics::ETimeMode::Normal: {
|
||||||
case PrintEstimatedTimeStatistics::ETimeMode::Normal:
|
|
||||||
{
|
|
||||||
show_mode_button(_u8L("Show stealth mode"), PrintEstimatedTimeStatistics::ETimeMode::Stealth);
|
show_mode_button(_u8L("Show stealth mode"), PrintEstimatedTimeStatistics::ETimeMode::Stealth);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PrintEstimatedTimeStatistics::ETimeMode::Stealth:
|
case PrintEstimatedTimeStatistics::ETimeMode::Stealth: {
|
||||||
{
|
|
||||||
show_mode_button(_u8L("Show normal mode"), PrintEstimatedTimeStatistics::ETimeMode::Normal);
|
show_mode_button(_u8L("Show normal mode"), PrintEstimatedTimeStatistics::ETimeMode::Normal);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2745,9 +2815,10 @@ void GCodeViewer::log_memory_used(const std::string& label, long long additional
|
||||||
render_paths_size += SLIC3R_STDVEC_MEMSIZE(path.offsets, size_t);
|
render_paths_size += SLIC3R_STDVEC_MEMSIZE(path.offsets, size_t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
long long layers_zs_size = SLIC3R_STDVEC_MEMSIZE(m_layers_zs, double);
|
long long layers_size = SLIC3R_STDVEC_MEMSIZE(m_layers.get_zs(), double);
|
||||||
|
layers_size += SLIC3R_STDVEC_MEMSIZE(m_layers.get_endpoints(), Layers::Endpoints);
|
||||||
BOOST_LOG_TRIVIAL(trace) << label
|
BOOST_LOG_TRIVIAL(trace) << label
|
||||||
<< format_memsize_MB(additional + paths_size + render_paths_size + layers_zs_size)
|
<< format_memsize_MB(additional + paths_size + render_paths_size + layers_size)
|
||||||
<< log_memory_info();
|
<< log_memory_info();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -272,6 +272,41 @@ class GCodeViewer
|
||||||
void reset_ranges() { ranges.reset(); }
|
void reset_ranges() { ranges.reset(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Layers
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
struct Endpoints
|
||||||
|
{
|
||||||
|
size_t first{ 0 };
|
||||||
|
size_t last{ 0 };
|
||||||
|
};
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::vector<double> m_zs;
|
||||||
|
std::vector<Endpoints> m_endpoints;
|
||||||
|
|
||||||
|
public:
|
||||||
|
void append(double z, Endpoints endpoints)
|
||||||
|
{
|
||||||
|
m_zs.emplace_back(z);
|
||||||
|
m_endpoints.emplace_back(endpoints);
|
||||||
|
}
|
||||||
|
|
||||||
|
void reset()
|
||||||
|
{
|
||||||
|
m_zs = std::vector<double>();
|
||||||
|
m_endpoints = std::vector<Endpoints>();
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t size() const { return m_zs.size(); }
|
||||||
|
bool empty() const { return m_zs.empty(); }
|
||||||
|
const std::vector<double>& get_zs() const { return m_zs; }
|
||||||
|
const std::vector<Endpoints>& get_endpoints() const { return m_endpoints; }
|
||||||
|
std::vector<Endpoints>& get_endpoints() { return m_endpoints; }
|
||||||
|
double get_z_at(unsigned int id) const { return (id < m_zs.size()) ? m_zs[id] : 0.0; }
|
||||||
|
Endpoints get_endpoints_at(unsigned int id) const { return (id < m_endpoints.size()) ? m_endpoints[id] : Endpoints(); }
|
||||||
|
};
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER_STATISTICS
|
#if ENABLE_GCODE_VIEWER_STATISTICS
|
||||||
struct Statistics
|
struct Statistics
|
||||||
{
|
{
|
||||||
|
@ -388,6 +423,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_initialized{ false };
|
bool m_initialized{ false };
|
||||||
|
mutable bool m_gl_data_initialized{ false };
|
||||||
unsigned int m_last_result_id{ 0 };
|
unsigned int m_last_result_id{ 0 };
|
||||||
size_t m_moves_count{ 0 };
|
size_t m_moves_count{ 0 };
|
||||||
mutable std::vector<TBuffer> m_buffers{ static_cast<size_t>(EMoveType::Extrude) };
|
mutable std::vector<TBuffer> m_buffers{ static_cast<size_t>(EMoveType::Extrude) };
|
||||||
|
@ -396,9 +432,10 @@ private:
|
||||||
// bounding box of toolpaths + marker tools
|
// bounding box of toolpaths + marker tools
|
||||||
BoundingBoxf3 m_max_bounding_box;
|
BoundingBoxf3 m_max_bounding_box;
|
||||||
std::vector<Color> m_tool_colors;
|
std::vector<Color> m_tool_colors;
|
||||||
std::vector<double> m_layers_zs;
|
Layers m_layers;
|
||||||
std::array<double, 2> m_layers_z_range;
|
std::array<unsigned int, 2> m_layers_z_range;
|
||||||
std::vector<ExtrusionRole> m_roles;
|
std::vector<ExtrusionRole> m_roles;
|
||||||
|
size_t m_extruders_count;
|
||||||
std::vector<unsigned char> m_extruder_ids;
|
std::vector<unsigned char> m_extruder_ids;
|
||||||
mutable Extrusions m_extrusions;
|
mutable Extrusions m_extrusions;
|
||||||
mutable SequentialView m_sequential_view;
|
mutable SequentialView m_sequential_view;
|
||||||
|
@ -411,6 +448,7 @@ private:
|
||||||
mutable Statistics m_statistics;
|
mutable Statistics m_statistics;
|
||||||
#endif // ENABLE_GCODE_VIEWER_STATISTICS
|
#endif // ENABLE_GCODE_VIEWER_STATISTICS
|
||||||
mutable std::array<float, 2> m_detected_point_sizes = { 0.0f, 0.0f };
|
mutable std::array<float, 2> m_detected_point_sizes = { 0.0f, 0.0f };
|
||||||
|
GCodeProcessor::Result::SettingsIds m_settings_ids;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GCodeViewer() = default;
|
GCodeViewer() = default;
|
||||||
|
@ -428,7 +466,7 @@ public:
|
||||||
|
|
||||||
const BoundingBoxf3& get_paths_bounding_box() const { return m_paths_bounding_box; }
|
const BoundingBoxf3& get_paths_bounding_box() const { return m_paths_bounding_box; }
|
||||||
const BoundingBoxf3& get_max_bounding_box() const { return m_max_bounding_box; }
|
const BoundingBoxf3& get_max_bounding_box() const { return m_max_bounding_box; }
|
||||||
const std::vector<double>& get_layers_zs() const { return m_layers_zs; };
|
const std::vector<double>& get_layers_zs() const { return m_layers.get_zs(); };
|
||||||
|
|
||||||
const SequentialView& get_sequential_view() const { return m_sequential_view; }
|
const SequentialView& get_sequential_view() const { return m_sequential_view; }
|
||||||
void update_sequential_view_current(unsigned int first, unsigned int last);
|
void update_sequential_view_current(unsigned int first, unsigned int last);
|
||||||
|
@ -447,7 +485,7 @@ public:
|
||||||
void set_toolpath_role_visibility_flags(unsigned int flags) { m_extrusions.role_visibility_flags = flags; }
|
void set_toolpath_role_visibility_flags(unsigned int flags) { m_extrusions.role_visibility_flags = flags; }
|
||||||
unsigned int get_options_visibility_flags() const;
|
unsigned int get_options_visibility_flags() const;
|
||||||
void set_options_visibility_from_flags(unsigned int flags);
|
void set_options_visibility_from_flags(unsigned int flags);
|
||||||
void set_layers_z_range(const std::array<double, 2>& layers_z_range);
|
void set_layers_z_range(const std::array<unsigned int, 2>& layers_z_range);
|
||||||
|
|
||||||
bool is_legend_enabled() const { return m_legend_enabled; }
|
bool is_legend_enabled() const { return m_legend_enabled; }
|
||||||
void enable_legend(bool enable) { m_legend_enabled = enable; }
|
void enable_legend(bool enable) { m_legend_enabled = enable; }
|
||||||
|
|
|
@ -5,9 +5,6 @@
|
||||||
#include "polypartition.h"
|
#include "polypartition.h"
|
||||||
#include "libslic3r/ClipperUtils.hpp"
|
#include "libslic3r/ClipperUtils.hpp"
|
||||||
#include "libslic3r/PrintConfig.hpp"
|
#include "libslic3r/PrintConfig.hpp"
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
#include "libslic3r/GCode/PreviewData.hpp"
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
#include "libslic3r/GCode/ThumbnailData.hpp"
|
#include "libslic3r/GCode/ThumbnailData.hpp"
|
||||||
#include "libslic3r/Geometry.hpp"
|
#include "libslic3r/Geometry.hpp"
|
||||||
#include "libslic3r/ExtrusionEntity.hpp"
|
#include "libslic3r/ExtrusionEntity.hpp"
|
||||||
|
@ -1415,7 +1412,7 @@ void GLCanvas3D::Tooltip::render(const Vec2d& mouse_position, GLCanvas3D& canvas
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, alpha);
|
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, alpha);
|
||||||
imgui.set_next_window_pos(position(0), position(1), ImGuiCond_Always, 0.0f, 0.0f);
|
imgui.set_next_window_pos(position(0), position(1), ImGuiCond_Always, 0.0f, 0.0f);
|
||||||
|
|
||||||
imgui.begin(_L("canvas_tooltip"), ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoFocusOnAppearing);
|
imgui.begin(wxString("canvas_tooltip"), ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoFocusOnAppearing);
|
||||||
ImGui::BringWindowToDisplayFront(ImGui::GetCurrentWindow());
|
ImGui::BringWindowToDisplayFront(ImGui::GetCurrentWindow());
|
||||||
ImGui::TextUnformatted(m_text.c_str());
|
ImGui::TextUnformatted(m_text.c_str());
|
||||||
|
|
||||||
|
@ -1457,6 +1454,7 @@ wxDEFINE_EVENT(EVT_GLCANVAS_MOVE_LAYERS_SLIDER, wxKeyEvent);
|
||||||
wxDEFINE_EVENT(EVT_GLCANVAS_MOVE_DOUBLE_SLIDER, wxKeyEvent);
|
wxDEFINE_EVENT(EVT_GLCANVAS_MOVE_DOUBLE_SLIDER, wxKeyEvent);
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
wxDEFINE_EVENT(EVT_GLCANVAS_EDIT_COLOR_CHANGE, wxKeyEvent);
|
wxDEFINE_EVENT(EVT_GLCANVAS_EDIT_COLOR_CHANGE, wxKeyEvent);
|
||||||
|
wxDEFINE_EVENT(EVT_GLCANVAS_JUMP_TO, wxKeyEvent);
|
||||||
wxDEFINE_EVENT(EVT_GLCANVAS_UNDO, SimpleEvent);
|
wxDEFINE_EVENT(EVT_GLCANVAS_UNDO, SimpleEvent);
|
||||||
wxDEFINE_EVENT(EVT_GLCANVAS_REDO, SimpleEvent);
|
wxDEFINE_EVENT(EVT_GLCANVAS_REDO, SimpleEvent);
|
||||||
wxDEFINE_EVENT(EVT_GLCANVAS_COLLAPSE_SIDEBAR, SimpleEvent);
|
wxDEFINE_EVENT(EVT_GLCANVAS_COLLAPSE_SIDEBAR, SimpleEvent);
|
||||||
|
@ -2178,9 +2176,13 @@ void GLCanvas3D::set_toolpath_view_type(GCodeViewer::EViewType type)
|
||||||
m_gcode_viewer.set_view_type(type);
|
m_gcode_viewer.set_view_type(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLCanvas3D::set_toolpaths_z_range(const std::array<double, 2>& range)
|
void GLCanvas3D::set_volumes_z_range(const std::array<double, 2>& range)
|
||||||
{
|
{
|
||||||
m_volumes.set_range(range[0] - 1e-6, range[1] + 1e-6);
|
m_volumes.set_range(range[0] - 1e-6, range[1] + 1e-6);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GLCanvas3D::set_toolpaths_z_range(const std::array<unsigned int, 2>& range)
|
||||||
|
{
|
||||||
if (m_gcode_viewer.has_data())
|
if (m_gcode_viewer.has_data())
|
||||||
m_gcode_viewer.set_layers_z_range(range);
|
m_gcode_viewer.set_layers_z_range(range);
|
||||||
}
|
}
|
||||||
|
@ -2899,6 +2901,7 @@ void GLCanvas3D::on_char(wxKeyEvent& evt)
|
||||||
// see include/wx/defs.h enum wxKeyCode
|
// see include/wx/defs.h enum wxKeyCode
|
||||||
int keyCode = evt.GetKeyCode();
|
int keyCode = evt.GetKeyCode();
|
||||||
int ctrlMask = wxMOD_CONTROL;
|
int ctrlMask = wxMOD_CONTROL;
|
||||||
|
int shiftMask = wxMOD_SHIFT;
|
||||||
|
|
||||||
auto imgui = wxGetApp().imgui();
|
auto imgui = wxGetApp().imgui();
|
||||||
if (imgui->update_key_data(evt)) {
|
if (imgui->update_key_data(evt)) {
|
||||||
|
@ -2996,6 +2999,18 @@ void GLCanvas3D::on_char(wxKeyEvent& evt)
|
||||||
post_event(SimpleEvent(EVT_GLTOOLBAR_DELETE_ALL)); break;
|
post_event(SimpleEvent(EVT_GLTOOLBAR_DELETE_ALL)); break;
|
||||||
default: evt.Skip();
|
default: evt.Skip();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else if ((evt.GetModifiers() & shiftMask) != 0) {
|
||||||
|
switch (keyCode) {
|
||||||
|
case 'g':
|
||||||
|
case 'G': {
|
||||||
|
if (dynamic_cast<Preview*>(m_canvas->GetParent()) != nullptr)
|
||||||
|
post_event(wxKeyEvent(EVT_GLCANVAS_JUMP_TO, evt));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
evt.Skip();
|
||||||
|
}
|
||||||
} else if (evt.HasModifiers()) {
|
} else if (evt.HasModifiers()) {
|
||||||
evt.Skip();
|
evt.Skip();
|
||||||
} else {
|
} else {
|
||||||
|
@ -4385,7 +4400,7 @@ bool GLCanvas3D::_render_search_list(float pos_x) const
|
||||||
|
|
||||||
std::string& search_line = sidebar.get_search_line();
|
std::string& search_line = sidebar.get_search_line();
|
||||||
char *s = new char[255];
|
char *s = new char[255];
|
||||||
strcpy(s, search_line.empty() ? _u8L("Type here to search").c_str() : search_line.c_str());
|
strcpy(s, search_line.empty() ? _u8L("Enter a search term").c_str() : search_line.c_str());
|
||||||
|
|
||||||
imgui->search_list(ImVec2(45 * em, 30 * em), &search_string_getter, s,
|
imgui->search_list(ImVec2(45 * em, 30 * em), &search_string_getter, s,
|
||||||
sidebar.get_searcher().view_params,
|
sidebar.get_searcher().view_params,
|
||||||
|
@ -4393,7 +4408,7 @@ bool GLCanvas3D::_render_search_list(float pos_x) const
|
||||||
|
|
||||||
search_line = s;
|
search_line = s;
|
||||||
delete [] s;
|
delete [] s;
|
||||||
if (search_line == _u8L("Type here to search"))
|
if (search_line == _u8L("Enter a search term"))
|
||||||
search_line.clear();
|
search_line.clear();
|
||||||
|
|
||||||
if (edited)
|
if (edited)
|
||||||
|
|
|
@ -114,6 +114,7 @@ wxDECLARE_EVENT(EVT_GLCANVAS_MOVE_LAYERS_SLIDER, wxKeyEvent);
|
||||||
wxDECLARE_EVENT(EVT_GLCANVAS_MOVE_DOUBLE_SLIDER, wxKeyEvent);
|
wxDECLARE_EVENT(EVT_GLCANVAS_MOVE_DOUBLE_SLIDER, wxKeyEvent);
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
wxDECLARE_EVENT(EVT_GLCANVAS_EDIT_COLOR_CHANGE, wxKeyEvent);
|
wxDECLARE_EVENT(EVT_GLCANVAS_EDIT_COLOR_CHANGE, wxKeyEvent);
|
||||||
|
wxDECLARE_EVENT(EVT_GLCANVAS_JUMP_TO, wxKeyEvent);
|
||||||
wxDECLARE_EVENT(EVT_GLCANVAS_UNDO, SimpleEvent);
|
wxDECLARE_EVENT(EVT_GLCANVAS_UNDO, SimpleEvent);
|
||||||
wxDECLARE_EVENT(EVT_GLCANVAS_REDO, SimpleEvent);
|
wxDECLARE_EVENT(EVT_GLCANVAS_REDO, SimpleEvent);
|
||||||
wxDECLARE_EVENT(EVT_GLCANVAS_COLLAPSE_SIDEBAR, SimpleEvent);
|
wxDECLARE_EVENT(EVT_GLCANVAS_COLLAPSE_SIDEBAR, SimpleEvent);
|
||||||
|
@ -650,7 +651,8 @@ public:
|
||||||
unsigned int get_toolpath_role_visibility_flags() const { return m_gcode_viewer.get_toolpath_role_visibility_flags(); }
|
unsigned int get_toolpath_role_visibility_flags() const { return m_gcode_viewer.get_toolpath_role_visibility_flags(); }
|
||||||
void set_toolpath_role_visibility_flags(unsigned int flags);
|
void set_toolpath_role_visibility_flags(unsigned int flags);
|
||||||
void set_toolpath_view_type(GCodeViewer::EViewType type);
|
void set_toolpath_view_type(GCodeViewer::EViewType type);
|
||||||
void set_toolpaths_z_range(const std::array<double, 2>& range);
|
void set_volumes_z_range(const std::array<double, 2>& range);
|
||||||
|
void set_toolpaths_z_range(const std::array<unsigned int, 2>& range);
|
||||||
#else
|
#else
|
||||||
std::vector<double> get_current_print_zs(bool active_only) const;
|
std::vector<double> get_current_print_zs(bool active_only) const;
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
|
|
|
@ -86,7 +86,7 @@ class SplashScreen : public wxSplashScreen
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SplashScreen(const wxBitmap& bitmap, long splashStyle, int milliseconds, wxPoint pos = wxDefaultPosition)
|
SplashScreen(const wxBitmap& bitmap, long splashStyle, int milliseconds, wxPoint pos = wxDefaultPosition)
|
||||||
: wxSplashScreen(bitmap, splashStyle, milliseconds, nullptr, wxID_ANY, wxDefaultPosition, wxDefaultSize,
|
: wxSplashScreen(bitmap, splashStyle, milliseconds, (wxWindow*)wxGetApp().mainframe, wxID_ANY, wxDefaultPosition, wxDefaultSize,
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
wxSIMPLE_BORDER | wxFRAME_NO_TASKBAR | wxSTAY_ON_TOP
|
wxSIMPLE_BORDER | wxFRAME_NO_TASKBAR | wxSTAY_ON_TOP
|
||||||
#else
|
#else
|
||||||
|
@ -892,7 +892,7 @@ bool GUI_App::on_init_inner()
|
||||||
#else
|
#else
|
||||||
if (scrn)
|
if (scrn)
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
scrn->SetText(_L("Creating settings tabs..."));
|
scrn->SetText(_L("Preparing settings tabs..."));
|
||||||
|
|
||||||
mainframe = new MainFrame();
|
mainframe = new MainFrame();
|
||||||
// hide settings tabs after first Layout
|
// hide settings tabs after first Layout
|
||||||
|
@ -1149,8 +1149,8 @@ void GUI_App::check_printer_presets()
|
||||||
for (const std::string& preset_name : preset_names)
|
for (const std::string& preset_name : preset_names)
|
||||||
msg_text += "\n \"" + from_u8(preset_name) + "\",";
|
msg_text += "\n \"" + from_u8(preset_name) + "\",";
|
||||||
msg_text.RemoveLast();
|
msg_text.RemoveLast();
|
||||||
msg_text += "\n\n" + _L("But from this version of PrusaSlicer we don't show/use this information in Printer Settings.\n"
|
msg_text += "\n\n" + _L("But since this version of PrusaSlicer we don't show this information in Printer Settings anymore.\n"
|
||||||
"Now, this information will be exposed in physical printers settings.") + "\n\n" +
|
"Settings will be available in physical printers settings.") + "\n\n" +
|
||||||
_L("By default new Printer devices will be named as \"Printer N\" during its creation.\n"
|
_L("By default new Printer devices will be named as \"Printer N\" during its creation.\n"
|
||||||
"Note: This name can be changed later from the physical printers settings");
|
"Note: This name can be changed later from the physical printers settings");
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
#include "libslic3r/libslic3r.h"
|
#include "libslic3r/libslic3r.h"
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
#include "libslic3r/GCode/PreviewData.hpp"
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
#include "GUI_Preview.hpp"
|
#include "GUI_Preview.hpp"
|
||||||
#include "GUI_App.hpp"
|
#include "GUI_App.hpp"
|
||||||
#include "GUI.hpp"
|
#include "GUI.hpp"
|
||||||
|
@ -557,6 +554,16 @@ void Preview::msw_rescale()
|
||||||
refresh_print();
|
refresh_print();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Preview::jump_layers_slider(wxKeyEvent& evt)
|
||||||
|
{
|
||||||
|
#if ENABLE_GCODE_VIEWER
|
||||||
|
if (m_layers_slider) m_layers_slider->OnChar(evt);
|
||||||
|
#else
|
||||||
|
if (m_slider)
|
||||||
|
m_slider->OnKeyDown(evt);
|
||||||
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
|
}
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
void Preview::move_layers_slider(wxKeyEvent& evt)
|
void Preview::move_layers_slider(wxKeyEvent& evt)
|
||||||
{
|
{
|
||||||
|
@ -1282,13 +1289,12 @@ void Preview::load_print_as_fff(bool keep_z_range)
|
||||||
// set color print values, if it si selected "ColorPrint" view type
|
// set color print values, if it si selected "ColorPrint" view type
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
if (gcode_view_type == GCodeViewer::EViewType::ColorPrint) {
|
if (gcode_view_type == GCodeViewer::EViewType::ColorPrint) {
|
||||||
|
colors = wxGetApp().plater()->get_colors_for_color_print(m_gcode_result);
|
||||||
#else
|
#else
|
||||||
if (m_gcode_preview_data->extrusion.view_type == GCodePreviewData::Extrusion::ColorPrint) {
|
if (m_gcode_preview_data->extrusion.view_type == GCodePreviewData::Extrusion::ColorPrint) {
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
colors = wxGetApp().plater()->get_colors_for_color_print();
|
colors = wxGetApp().plater()->get_colors_for_color_print();
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
colors.push_back("#808080"); // gray color for pause print or custom G-code
|
colors.push_back("#808080"); // gray color for pause print or custom G-code
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
|
|
||||||
if (!gcode_preview_data_valid) {
|
if (!gcode_preview_data_valid) {
|
||||||
color_print_values = wxGetApp().plater()->model().custom_gcode_per_print_z.gcodes;
|
color_print_values = wxGetApp().plater()->model().custom_gcode_per_print_z.gcodes;
|
||||||
|
@ -1299,10 +1305,11 @@ void Preview::load_print_as_fff(bool keep_z_range)
|
||||||
}
|
}
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
else if (gcode_preview_data_valid || gcode_view_type == GCodeViewer::EViewType::Tool) {
|
else if (gcode_preview_data_valid || gcode_view_type == GCodeViewer::EViewType::Tool) {
|
||||||
|
colors = wxGetApp().plater()->get_extruder_colors_from_plater_config(m_gcode_result);
|
||||||
#else
|
#else
|
||||||
else if (gcode_preview_data_valid || (m_gcode_preview_data->extrusion.view_type == GCodePreviewData::Extrusion::Tool) ) {
|
else if (gcode_preview_data_valid || (m_gcode_preview_data->extrusion.view_type == GCodePreviewData::Extrusion::Tool) ) {
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
colors = wxGetApp().plater()->get_extruder_colors_from_plater_config();
|
colors = wxGetApp().plater()->get_extruder_colors_from_plater_config();
|
||||||
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
color_print_values.clear();
|
color_print_values.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1417,13 +1424,12 @@ void Preview::on_layers_slider_scroll_changed(wxCommandEvent& event)
|
||||||
void Preview::on_sliders_scroll_changed(wxCommandEvent& event)
|
void Preview::on_sliders_scroll_changed(wxCommandEvent& event)
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
{
|
{
|
||||||
if (IsShown())
|
if (IsShown()) {
|
||||||
{
|
|
||||||
PrinterTechnology tech = m_process->current_printer_technology();
|
PrinterTechnology tech = m_process->current_printer_technology();
|
||||||
if (tech == ptFFF)
|
if (tech == ptFFF) {
|
||||||
{
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
m_canvas->set_toolpaths_z_range({ m_layers_slider->GetLowerValueD(), m_layers_slider->GetHigherValueD() });
|
m_canvas->set_volumes_z_range({ m_layers_slider->GetLowerValueD(), m_layers_slider->GetHigherValueD() });
|
||||||
|
m_canvas->set_toolpaths_z_range({ static_cast<unsigned int>(m_layers_slider->GetLowerValue()), static_cast<unsigned int>(m_layers_slider->GetHigherValue()) });
|
||||||
m_canvas->set_as_dirty();
|
m_canvas->set_as_dirty();
|
||||||
#else
|
#else
|
||||||
m_canvas->set_toolpaths_range(m_slider->GetLowerValueD() - 1e-6, m_slider->GetHigherValueD() + 1e-6);
|
m_canvas->set_toolpaths_range(m_slider->GetLowerValueD() - 1e-6, m_slider->GetHigherValueD() + 1e-6);
|
||||||
|
@ -1431,8 +1437,7 @@ void Preview::on_sliders_scroll_changed(wxCommandEvent& event)
|
||||||
m_canvas->set_use_clipping_planes(false);
|
m_canvas->set_use_clipping_planes(false);
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
}
|
}
|
||||||
else if (tech == ptSLA)
|
else if (tech == ptSLA) {
|
||||||
{
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
m_canvas->set_clipping_plane(0, ClippingPlane(Vec3d::UnitZ(), -m_layers_slider->GetLowerValueD()));
|
m_canvas->set_clipping_plane(0, ClippingPlane(Vec3d::UnitZ(), -m_layers_slider->GetLowerValueD()));
|
||||||
m_canvas->set_clipping_plane(1, ClippingPlane(-Vec3d::UnitZ(), m_layers_slider->GetHigherValueD()));
|
m_canvas->set_clipping_plane(1, ClippingPlane(-Vec3d::UnitZ(), m_layers_slider->GetHigherValueD()));
|
||||||
|
@ -1463,8 +1468,8 @@ wxString Preview::get_option_type_string(OptionType type) const
|
||||||
case OptionType::Unretractions: { return _L("Deretractions"); }
|
case OptionType::Unretractions: { return _L("Deretractions"); }
|
||||||
case OptionType::ToolChanges: { return _L("Tool changes"); }
|
case OptionType::ToolChanges: { return _L("Tool changes"); }
|
||||||
case OptionType::ColorChanges: { return _L("Color changes"); }
|
case OptionType::ColorChanges: { return _L("Color changes"); }
|
||||||
case OptionType::PausePrints: { return _L("Pause prints"); }
|
case OptionType::PausePrints: { return _L("Print pauses"); }
|
||||||
case OptionType::CustomGCodes: { return _L("Custom GCodes"); }
|
case OptionType::CustomGCodes: { return _L("Custom G-codes"); }
|
||||||
case OptionType::Shells: { return _L("Shells"); }
|
case OptionType::Shells: { return _L("Shells"); }
|
||||||
case OptionType::ToolMarker: { return _L("Tool marker"); }
|
case OptionType::ToolMarker: { return _L("Tool marker"); }
|
||||||
case OptionType::Legend: { return _L("Legend/Estimated printing time"); }
|
case OptionType::Legend: { return _L("Legend/Estimated printing time"); }
|
||||||
|
|
|
@ -179,6 +179,7 @@ Preview(wxWindow* parent, Model* model, DynamicPrintConfig* config,
|
||||||
void refresh_print();
|
void refresh_print();
|
||||||
|
|
||||||
void msw_rescale();
|
void msw_rescale();
|
||||||
|
void jump_layers_slider(wxKeyEvent& evt);
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
void move_layers_slider(wxKeyEvent& evt);
|
void move_layers_slider(wxKeyEvent& evt);
|
||||||
void edit_layers_slider(wxKeyEvent& evt);
|
void edit_layers_slider(wxKeyEvent& evt);
|
||||||
|
|
|
@ -95,6 +95,7 @@ public:
|
||||||
#ifndef __WXOSX__ // Don't call SetFont under OSX to avoid name cutting in ObjectList
|
#ifndef __WXOSX__ // Don't call SetFont under OSX to avoid name cutting in ObjectList
|
||||||
this->SetFont(m_normal_font);
|
this->SetFont(m_normal_font);
|
||||||
#endif
|
#endif
|
||||||
|
this->CenterOnParent();
|
||||||
|
|
||||||
// Linux specific issue : get_dpi_for_window(this) still doesn't responce to the Display's scale in new wxWidgets(3.1.3).
|
// Linux specific issue : get_dpi_for_window(this) still doesn't responce to the Display's scale in new wxWidgets(3.1.3).
|
||||||
// So, calculate the m_em_unit value from the font size, as before
|
// So, calculate the m_em_unit value from the font size, as before
|
||||||
|
|
|
@ -41,8 +41,8 @@ bool GLGizmoFdmSupports::on_init()
|
||||||
|
|
||||||
m_desc["clipping_of_view"] = _L("Clipping of view") + ": ";
|
m_desc["clipping_of_view"] = _L("Clipping of view") + ": ";
|
||||||
m_desc["reset_direction"] = _L("Reset direction");
|
m_desc["reset_direction"] = _L("Reset direction");
|
||||||
m_desc["cursor_size"] = _L("Cursor size") + ": ";
|
m_desc["cursor_size"] = _L("Brush size") + ": ";
|
||||||
m_desc["cursor_type"] = _L("Cursor type") + ": ";
|
m_desc["cursor_type"] = _L("Brush shape") + ": ";
|
||||||
m_desc["enforce_caption"] = _L("Left mouse button") + ": ";
|
m_desc["enforce_caption"] = _L("Left mouse button") + ": ";
|
||||||
m_desc["enforce"] = _L("Enforce supports");
|
m_desc["enforce"] = _L("Enforce supports");
|
||||||
m_desc["block_caption"] = _L("Right mouse button") + " ";
|
m_desc["block_caption"] = _L("Right mouse button") + " ";
|
||||||
|
@ -126,7 +126,7 @@ void GLGizmoFdmSupports::on_render_input_window(float x, float y, float bottom_l
|
||||||
|
|
||||||
m_imgui->text("");
|
m_imgui->text("");
|
||||||
|
|
||||||
if (m_imgui->button("Autoset by angle...")) {
|
if (m_imgui->button(_L("Autoset by angle") + "...")) {
|
||||||
m_setting_angle = true;
|
m_setting_angle = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,9 +232,12 @@ void GLGizmoFdmSupports::on_render_input_window(float x, float y, float bottom_l
|
||||||
else {
|
else {
|
||||||
m_imgui->begin(_L("Autoset custom supports"), ImGuiWindowFlags_NoMove | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoCollapse);
|
m_imgui->begin(_L("Autoset custom supports"), ImGuiWindowFlags_NoMove | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoCollapse);
|
||||||
ImGui::AlignTextToFramePadding();
|
ImGui::AlignTextToFramePadding();
|
||||||
m_imgui->text(_L("Threshold:") + " " + _L("deg"));
|
m_imgui->text(_L("Threshold:"));
|
||||||
|
std::string format_str = std::string("%.f") + I18N::translate_utf8("°",
|
||||||
|
"Degree sign to use in the respective slider in FDM supports gizmo,"
|
||||||
|
"placed after the number with no whitespace in between.");
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (m_imgui->slider_float("", &m_angle_threshold_deg, 0.f, 90.f, "%.f"))
|
if (m_imgui->slider_float("", &m_angle_threshold_deg, 0.f, 90.f, format_str.data()))
|
||||||
m_parent.set_slope_normal_angle(90.f - m_angle_threshold_deg);
|
m_parent.set_slope_normal_angle(90.f - m_angle_threshold_deg);
|
||||||
if (m_imgui->button(_L("Enforce")))
|
if (m_imgui->button(_L("Enforce")))
|
||||||
select_facets_by_angle(m_angle_threshold_deg, false);
|
select_facets_by_angle(m_angle_threshold_deg, false);
|
||||||
|
|
|
@ -36,16 +36,16 @@ void GLGizmoPainterBase::activate_internal_undo_redo_stack(bool activate)
|
||||||
{
|
{
|
||||||
if (activate && ! m_internal_stack_active) {
|
if (activate && ! m_internal_stack_active) {
|
||||||
wxString str = get_painter_type() == PainterGizmoType::FDM_SUPPORTS
|
wxString str = get_painter_type() == PainterGizmoType::FDM_SUPPORTS
|
||||||
? _L("Supports gizmo turned on")
|
? _L("Entering Paint-on supports")
|
||||||
: _L("Seam gizmo turned on");
|
: _L("Entering Seam painting");
|
||||||
Plater::TakeSnapshot(wxGetApp().plater(), str);
|
Plater::TakeSnapshot(wxGetApp().plater(), str);
|
||||||
wxGetApp().plater()->enter_gizmos_stack();
|
wxGetApp().plater()->enter_gizmos_stack();
|
||||||
m_internal_stack_active = true;
|
m_internal_stack_active = true;
|
||||||
}
|
}
|
||||||
if (! activate && m_internal_stack_active) {
|
if (! activate && m_internal_stack_active) {
|
||||||
wxString str = get_painter_type() == PainterGizmoType::SEAM
|
wxString str = get_painter_type() == PainterGizmoType::SEAM
|
||||||
? _L("Seam gizmo turned off")
|
? _L("Leaving Seam painting")
|
||||||
: _L("Supports gizmo turned off");
|
: _L("Leaving Paint-on supports");
|
||||||
wxGetApp().plater()->leave_gizmos_stack();
|
wxGetApp().plater()->leave_gizmos_stack();
|
||||||
Plater::TakeSnapshot(wxGetApp().plater(), str);
|
Plater::TakeSnapshot(wxGetApp().plater(), str);
|
||||||
m_internal_stack_active = false;
|
m_internal_stack_active = false;
|
||||||
|
|