Ultimaker / CuraEngine

Powerful, fast and robust engine for converting 3D models into g-code instructions for 3D printers. It is part of the larger open source project Cura.
https://ultimaker.com/en/products/cura-software
GNU Affero General Public License v3.0
1.68k stars 882 forks source link

Cura 8889 fix one at a time initial temperature #1942

Closed wawanbreton closed 1 year ago

wawanbreton commented 1 year ago

In order to fix the last bed temperature setting bugs, I changed the way GCodeExport handles it. The writeBedTemperatureCommand method has a check to ensure that the same temperature is not send twice in a row. So I removed checks done before calling this method, and made sure that the initial temperature is properly initialized in the preSetup method. This way, the writeBedTemperatureCommand method will be called a bit more often, and it is fully in charge of knowing wheter the given temperature is different from the old one.

An other change on the writeBedTemperatureCommand is that we don't send any GCode command in case it is called with the same temperature as before, but with a wait command. Before, we would have set the wait command anyway. This does make sense, but actually the wait case is used only once, in the situation that is being heavily refined and retested, so I think changing this behavior does not create an unwanted side-effect.

Maybe we should also cache the "machine_heated_bed" setting in GCodeExport so that it would take care of it in writeBedTemperatureCommand, making calls to this method simpler.

github-actions[bot] commented 1 year ago

Unit Test Results

26 tests  ±0   26 :heavy_check_mark: ±0   15s :stopwatch: +6s   1 suites ±0     0 :zzz: ±0    1 files   ±0     0 :x: ±0 

Results for commit c92f8363. ± Comparison against base commit 559db006.

:recycle: This comment has been updated with latest results.