Commit Graph

2019 Commits

Author SHA1 Message Date
Giles Bathgate 8129a14f19 Move layer calibration finish commands into first_layer_cal.cpp 2023-02-17 14:30:20 +01:00
Giles Bathgate 568eec5ee0 Implement first layer cal with calculated extrusion widths 2023-02-17 14:30:20 +01:00
Guðni Már Gilbert b63f5433df Don't show Pause/Stop menus while processing T-codes
PFW-1449

Change in memory:
Flash: +18 bytes
SRAM: +1 bytes
2023-02-12 15:58:07 +01:00
Guðni Már Gilbert 504099bd6c optimisation: reduce code size in rendering cursor
Change in memory:
Flash: -62 bytes
SRAM: 0 bytes
2023-02-11 19:06:14 +01:00
3d-gussner b02e8d9961 Fix First layer cal being stored without confirming with knob 2023-02-10 14:34:16 +01:00
Guðni Már Gilbert ea7e717204 Cleanup: Remove various dead code 2023-02-10 08:17:36 +01:00
3d-gussner ca978080c4 Change to Thermal model
Add prusa.io/tm-cal link
and update all TM related translations
2023-02-08 15:36:59 +01:00
Guðni Már Gilbert 99761bdff7 optimisation: re-use adjust_bed_reset()
Move the code into eeprom.cpp since we're only working with EEPROM

Change in memory:
Flash: -42 bytes
SRAM: 0 bytes
2023-02-08 08:01:55 +01:00
Guðni Már Gilbert b28aa6f42a PFW-1471 Rename 'Toolchange count' to 'Material changes'
Added the string to our message so it can be translated

Change in memory:
Flash: -10 bytes
SRAM: 0 bytes
2023-02-06 08:33:40 +01:00
Guðni Már Gilbert d66e2b66c2 Cleanup: use setTargetHotend consistently for one extruder
Main changes:
* setAllTargetHotends() is removed
* setTargetHotendSafe() is removed
* Extruder parameter on setTargetHotend() is dropped

Change in memory:
Flash: -192 bytes
SRAM: 0 bytes
2023-02-01 08:28:23 +01:00
Guðni Már Gilbert da63d73585 optimisation: don't print floats with lcd_print()
Change in memory:
Flash: -442 bytes
SRAM: 0 bytes
2023-01-25 18:21:22 +00:00
Guðni Már Gilbert 17e6f1b75e optimisation: remove conv2str.cpp
Change in memory:
Flash: -288 bytes
SRAM: -8 bytes
2023-01-25 06:28:00 +00:00
3d-gussner fab4165f4a
Merge pull request #3920 from wavexx/selftest_ok_alert
wizard: Do no set "Self test OK" as an alert message
2023-01-24 14:16:44 +01:00
Yuri D'Elia c9f3a4cfce wizard: Disable TM warnings during calibration
During calibration model warnings are possible/normal. This is
apparently leading some into thinking the hotend might be faulty
and abort the calibration with a hard reset.

Disable warnings/beeps during calibration.

Rely on the error threshold only.
2023-01-23 16:52:27 +01:00
Alex Voinea 0c352ac2d1 Disable M47 if TMC2130 drivers are used
flash: -126B
RAM: 0B
2023-01-17 20:37:27 +01:00
Yuri D'Elia 16a89b9215 wizard: Return to status after calibration 2023-01-16 11:38:56 +01:00
Yuri D'Elia 7529652dca TM: Restore extruder autofan state when stopping/resuming
During thermal errors all fans are set to full speed.

When the print is resumed or stopped *and* the thermal error is gone,
also restore the autofan state.

Fixes #3893
2023-01-16 08:43:36 +01:00
Yuri D'Elia 204df90d6d TM: Set the cal status bit when running `M310 A` directly
Running `M310 A` should set the TM calibration bit status if the
autotune procedure was successful.

Partially addresses #3891 and #3890, since running `M310 A F0` should
*still* count as valid calibration data and is not something that can be
replicated by using the LCD (which enforces self-test).
2023-01-16 07:32:57 +01:00
3d-gussner 2d34535977 Move Z to top during Nozzle change 2023-01-16 07:27:53 +01:00
Guðni Már Gilbert 5582114628 optimisation: re-use delay_keep_alive() in a few places
Change in memory:
Flash: -52 bytes
SRAM: 0 bytes
2023-01-15 19:21:55 +01:00
Yuri D'Elia 9e0e0f5942 wizard: Do no set "Self test OK" as an alert message
Alert messages are intended to persist above "info" messages, thus
preventing further calibration status updates to be shown (such as
thermal model calibration).

Just set the message as a regular status message.

Fixes #3892
2023-01-15 18:25:15 +01:00
Guðni Már Gilbert 9cbf0a28cc
Fix an issue on multilang builds where first two charactes are not rendered (#3781) 2022-12-30 15:18:48 +01:00
D.R.racer 85d27e6e5e Address 3 different start scenarios 1st lay cal + MMU
This PR tries to address the 3 different startup scenarios for 1st layer calibration with the MMU:

- 1st lay cal started with correct filament already loaded in the nozzle - we should continue, but skip the first 58mm (first 2 g-codes in the hard coded sequence) of purge line extrusion
- 1st lay cal started with other filament already loaded in the nozzle - we should unload and then issue a toolchange with no extra unload
- 1st lay cal started without loaded filament - we should just do a toolchange with no extra unload

PFW-1457
2022-12-30 15:04:45 +01:00
D.R.racer 52a3beb931 Cut & Eject: avoid preheat if no filament loaded
and add fullscreen messages for Cut & Eject (messages intentionally reused to save space)
2022-12-30 14:23:44 +01:00
Yuri D'Elia c5d2aedfe4 wizard: Ask about the sheet before doing Z calibration
Ask to install the sheet immediately after removing the test print.
This makes further messages less confusing.
2022-12-30 14:14:01 +01:00
Yuri D'Elia dd99b1ab32 wizard: Disable temperature model during hotend testing
This avoids confusing error messages if the hotend is defective and
caught by selftest itself.

Rearrange Stopped state checks (saves 2 bytes)
2022-12-30 14:14:01 +01:00
Yuri D'Elia 8fa0a22b8d wizard: Allow partial resuming after reset
Update the eeprom FW version as soon as migration is complete, to avoid
resetting the CALIBRATION_V2 variable at each reset.

Do not implicitly reset the calibration steps for WizState::Run: do this
only for the menu action.
2022-12-30 14:14:01 +01:00
Yuri D'Elia 414972c876 Unbreak build with !PINDA_THERMISTOR 2022-12-30 14:14:01 +01:00
Yuri D'Elia 7828788e5c Handle CALIBRATION_STATUS_TEMP_MODEL 2022-12-30 14:14:01 +01:00
Yuri D'Elia 2a13ce4c62 Handle CALIBRATION_STATUS_SELFTEST 2022-12-30 14:14:01 +01:00
Yuri D'Elia b41ece175b Handle CALIBRATION_STATUS_LIVE_ADJUST 2022-12-30 14:14:01 +01:00
Yuri D'Elia 22c0e15047 wizard: Rewrite the wizard handling loop
Simplify status tracking:

- S::Restore to continue to the next logical wizard item
- S::Finish for a successful failure
- S::Failed to exit while showing a failure
2022-12-30 14:14:01 +01:00
Guðni Már Gilbert 4219beed71 Remove initial cursor setting
The cursor position is controlled by
the for-loop

Change in memory:
Flash: -8 bytes
SRAM: 0 bytes
2022-12-30 12:57:07 +01:00
Guðni Már Gilbert 1186b36bfa Remove whitespace at start of new row 2022-12-30 12:57:07 +01:00
Guðni Már Gilbert 7529eaec44 Remove duplicate code
msg_next is NULL, then the end of the message has been reached.

Change in memory:
Flash: -24 bytes
SRAM: 0 bytes
2022-12-30 12:57:07 +01:00
Guðni Már Gilbert 5037d1edbc delay_keep_alive calls manage_heater and manage_inactivity
No need to call them again, the for-loop is very quick

Change in memory:
Flash: -10 bytes
SRAM: 0 bytes
2022-12-30 12:57:07 +01:00
Guðni Már Gilbert 1a9b7d79e6 Don't handle whitespace in a special way
Instead of reading and checking if a character is a whitespace
just print it out onto the LCD. This makes the code a bit less
complex. Whether there is a whitespace character, we always end
up reading from program space, so I doubt this has much performance
impact.

Change in memory:
Flash: -38 bytes
SRAM: 0 bytes
2022-12-30 12:57:07 +01:00
Alex Voinea 96707aadcb Fix timeout making UI freeze 2022-12-30 12:49:57 +01:00
Yuri D'Elia b3790f4094 Typo: meassure -> measure 2022-12-22 12:54:42 +01:00
3d-gussner 9ca7760c2e
Merge pull request #3830 from 3d-gussner/MK3_XYZ_cal_fix
MK3: XYZ cal change message and add LCD ouput
2022-12-20 14:16:49 +01:00
3d-gussner 0bcb4ab59d
Merge pull request #3822 from wavexx/tm_partial_lock
MK3: TM: Prevent lockout on invalid model values
2022-12-20 14:13:56 +01:00
3d-gussner 7fef570d1b Change xyz cal message `up to 24 min.` instead `approx. 12 min.` 2022-12-20 10:30:53 +01:00
3d-gussner 65f5b9e53d
Merge pull request #3818 from wavexx/tm_default_state
TM: Provide full defaults for model data and enable it by default
2022-12-20 07:08:25 +01:00
Yuri D'Elia dba3428ef2 Improve MSG_ACK_ERROR message 2022-12-17 20:25:47 +01:00
Yuri D'Elia 80c7790e87 Also prevent longpress when Stopped 2022-12-17 17:30:44 +01:00
Yuri D'Elia 271523ad45 TM: Disallow preheat/filament actions when stopped
Require acknowledgement first
2022-12-17 17:00:33 +01:00
Yuri D'Elia f8290f25cd TM: Allow to resume without a running print
If there is no running print, and the printer is Stopped, add a new
"Acknowledge error" menu entry to unlock the printer.

This simply calls lcd_print_stop(), which is identical in behavior to a
thermal error with a running print.
2022-12-17 16:48:39 +01:00
Yuri D'Elia 8d719efa79 Do not show/call LCD status updates when unchanged
This mostly prevents useless serial noise
2022-12-17 16:35:26 +01:00
Yuri D'Elia 6e2f016655 TM: Clear the Stopped state when stopping the current print
We allow resuming from the LCD via start print and resume print,
it makes sense to clear the error on stop too.

For this reason distinguish whether the action is performed
automatically or manually (ie: interactively).

The error is only cleared when the command is run interactively.
2022-12-17 16:11:31 +01:00
Yuri D'Elia 119dc10b8f Rename print_stop() to lcd_print_stop_finish() for clarity 2022-12-17 16:03:03 +01:00
Guðni Már Gilbert 2e7c237a17 Cleanup: remove automatic parameter from unload_filament()
In M600 and M702, the Z-lift is taken care of outside this function
so it makes no sense to have a Z-lift within unload_filament()

Only exception to this is in the wizard, there I moved the Z-lift to
happen before we start heating the nozzle.

Change in memory:
Flash: -12 bytes
SRAM: 0 bytes
2022-12-16 16:20:09 +01:00
3d-gussner 090c72367d Minor Fix for PR2235
Shorten message to c=12 as some translation of `Yes/No` are 4 chars long
2022-12-16 16:10:15 +01:00
3d-gussner 74545e2133 Fix `µ` character shown on translations 2022-12-16 15:59:37 +01:00
Yuri D'Elia 36575a4f83 Restore the previous model state when performing a nozzle change
Do not force-enable the model if it was previously disabled.
2022-12-12 20:17:56 +01:00
Yuri D'Elia c5ec77a1ce wizard: Allow finishing the calibration through menus
If the wizard is interrupted during model calibration, allow the
menu to mark "temperature model" calibration as complete.
2022-12-12 18:25:17 +01:00
Yuri D'Elia 118b39da39 wizard: Rework the thermal model calibration logic
- Correctly sequence the enqueued commands in order to check for the
  real calibration result.
- Perform autocalibration with self-check enabled.
- Only save/continue the wizard if autocalibration succeeds.
2022-12-12 18:25:07 +01:00
Yuri D'Elia 38d893589f selftest: Handle thermal errors in lcd_selfcheck_check_heater
- Simplify lcd_selfcheck_check_heater loop
- Check for/abort on Stopped (indicating a thermal failure).
2022-12-12 18:24:58 +01:00
Guðni Már Gilbert 613ea290f5 Add a comment 2022-12-10 10:04:17 +00:00
Guðni Már Gilbert 9ed46df97f Don't show full screen message meant for single color setup
load_filament_to_nozzle will show a more precise full screen message when an MMU is used.
2022-12-10 10:00:58 +00:00
Guðni Már Gilbert 1e39012953
Merge pull request #3793 from gudnimg/PFW-1453
PFW-1453 Stop Print: Don't unload if FINDA is not triggered
2022-12-09 12:54:16 +00:00
Yuri D'Elia 68c5cdce1c
Merge pull request #3780 from gudnimg/stop-print-optimisations
optimisation: Improve Stop Print menu
2022-12-08 19:41:52 +01:00
3d-gussner 92f2281b1a
Merge pull request #2335 from Panayiotis-git/MK3_NoBedHeating_onLoadUnload
@Panayiotis-git Thanks a lot!

Finally after 3 years 21 days your PR gets merged 🦕
2022-12-08 18:45:12 +01:00
3d-gussner 1c9a3a6b25 Add Nozzle change menu to FARM mode under Settings 2022-12-05 18:22:18 +01:00
Guðni Már Gilbert a8fe71df8c PFW-1453 Stop Print: Don't unload if FINDA is not triggered 2022-12-05 16:45:57 +01:00
Panayiotis-git c75c81ce4f Do not heat the bed, on load/unload
If during a paused print, the preheat is canceled, keep the bed target temperature
Display bed temperatures only if bed is also heated
Remove not needed variables nTargetOld and nTargetBedOld from the mFilamentItem function
Define new Setting "HeatBedOnLoad" [Yes/No]
2022-12-04 19:26:34 +02:00
Jakub Dolezal 3e976e04ca
Merge pull request #3777 from 3d-gussner/PFW-1431
PFW-1431: Add "PA Preheat"
2022-12-02 13:34:18 +01:00
3d-gussner 54ef2a6c28
Merge pull request #3769 from 3d-gussner/MK3_Temp_model_cal_wizard
PFW-1434: MK3 Temp model calibration during wizard
2022-11-30 15:33:38 +01:00
3d-gussner 0a6388cc56 Update internal translations
Fix G28 W
2022-11-30 15:01:24 +01:00
Alex Voinea 500131d51d fullscreen message: use \n to force the next word on the next line
Useful for printing short URLs since those contain punctuation characters, which get treated at the end of a word under usual circumstances
2022-11-30 10:17:28 +01:00
3d-gussner 8f44d1102c Add PA preheat menu 2022-11-30 06:42:32 +01:00
Guðni Már Gilbert 23613c7eb1 optimisation: Stop print menu
There is no need to manually track the cursor position.
We can use the menu API:
MENU_BEGIN()
...
// menu items in between here
...
MENU_END()

Change in memory:
Flash: -116 bytes
SRAM: 0 bytes
2022-11-26 10:18:47 +00:00
Alex Voinea 83c9e946e4 Fix recursion 2022-11-24 16:15:51 +01:00
3d-gussner 32673e1681 Nozzle change menu 2022-11-23 11:39:26 +01:00
3d-gussner 2cd42f8433 Fix typo
Add Norwegian translations thanks to @OS-kar
2022-11-22 08:26:20 +01:00
D.R.racer aaebaf163f Cleanup MSG_MMU_POWER_FAILS 2022-11-20 17:27:36 +01:00
D.R.racer 4eaabbf092 Revive MMU stats + LCD screens 2022-11-20 17:27:36 +01:00
Guðni Már Gilbert 603faddd25 Fix bug where toolchange counter is not rendered 2022-11-20 15:42:29 +00:00
Guðni Már Gilbert 5dc539cda5 fixup 2022-11-20 13:12:01 +01:00
Guðni Már Gilbert 62810c5a7c optimisation: lcdui_print_extruder
Simplify the rendering to cover more scenarios:
"[nr.]>?"
"?>?"
Both of these indicate there is a bug in the firmware.
Currently these are not handled and result in the status screen being corrupted.
This is because we are trying to write a 3 digit number
where there is not space on the LCD for it.

Change in memory:
Flash: -52 bytes
SRAM: 0 bytes
2022-11-20 13:12:01 +01:00
3d-gussner f2f54da5b0 Unhack selftest hack during wizard 2022-11-20 10:48:49 +01:00
Guðni Már Gilbert d592586d94 cleanup: remove dead code lcd_adjust_z()
It's only used when MESH_BED_LEVELING is not defined. According to
the configuration files, all printers supported use MESH_BED_LEVELING.
So I think we are safe in removing this dead code.
2022-11-19 22:19:48 +00:00
Alex Voinea ef83fefce1 More optimization 2022-11-18 14:50:07 +01:00
Alex Voinea dcc48c0052 Remove eeprom _int8t functions
flash: -48B
RAM: -4B
2022-11-18 14:50:07 +01:00
Alex Voinea b147fcee77 XYZ calibration fixes 2022-11-18 00:18:42 +01:00
Alex Voinea 384a6d1989 Fix wizard serial messages 2022-11-17 23:03:03 +01:00
3d-gussner 30ec4e8b53 Inital Temp Model cal wizard 2022-11-17 15:19:35 +01:00
Guðni Már Gilbert 2096accc5f Remove unused gcode level check code
This code was introduced with v3.8.0 but was always disabled.
I propose the code be removed since it has not been enabled
for 3 years since its introduction.
2022-11-17 08:05:27 +01:00
Alex Voinea 29882b625b Remove LcdCommands::FarmModeConfirm 2022-11-17 05:46:33 +01:00
Guðni Már Gilbert e11ef11a64 PFW-1425 Rename "Load to Extruder" to "Loading Test" 2022-11-16 06:00:15 +01:00
Guðni Már Gilbert 7b43f322de PFW-1425 Move Reset MMU setting 2022-11-15 17:32:27 +01:00
Guðni Már Gilbert b4920d7fa8 PFW-1425 use mmu2.Enabled instead of EEPROM read 2022-11-15 17:32:27 +01:00
Guðni Már Gilbert 3f4ac254ab PFW-1425 Move MMU settings under a common if statement
We only need to check if the MMU is enabled once,
no need to do it in every submenu.
This way we save little bit of flash memory.

Change in memory:
Flash: -24 bytes
SRAM: 0 bytes
2022-11-15 17:32:27 +01:00
Guðni Már Gilbert 8f3f071fd4 PFW-1425 Move Load to Extruder menu to Settings menu
No change in memory footprint
2022-11-15 17:32:27 +01:00
Guðni Már Gilbert 4f58812478 optimise lcd_sdcard_menu with lcd_print_pad
Change in memory:
Flash: -46 bytes
SRAM: 0 bytes
2022-11-13 09:29:37 +01:00
Guðni Már Gilbert 184e19dd60 further optimise lcdui_print_status_line
We can use lcd_print_pad to determine
whether the end of the file name was reached

lcd_print_pad now returns the last character pointed to.
If the end of the string was reached, it will be the null delimeter which
evaluates to "false" in an if statment (same as NULL).
Else "true" means the end of the string was not reached.

Change in memory:
Flash: -42 bytes
SRAM: 0 bytes
2022-11-13 09:29:37 +01:00
Guðni Már Gilbert 0af7ef0201 optimisation: reduce code size in showing file name being printed
Change in memory:
Flash: -52 bytes
SRAM: 0 bytes
2022-11-13 09:29:37 +01:00
Alex Voinea 661b3a83ff MK2.5: fix swapped yes/no messaged for Z manual alignment 2022-11-10 22:20:46 +01:00
Alex Voinea 1cdc2e712b MK2.5: unblock planner after plan_abort_hard() 2022-11-10 22:20:01 +01:00
3d-gussner fd832f9ccf
Merge pull request #3737 from gudnimg/fix-longpress-inactivity-timeout
Fix long-press LCD inactivity timeout
2022-11-08 14:10:57 +01:00
Guðni Már Gilbert 08460bd403 PFW-1397 Drop ON_MENU_ENTER
Using _menu_data_t turns out to save *just* a little bit more flash. So for now just use it.
2022-11-08 13:49:40 +01:00
Guðni Már Gilbert f160f5594d PFW-1397 cleanup statistics menu
Change in memory:
Flash: -18 bytes
SRAM: -1 byte
2022-11-08 13:49:40 +01:00
Guðni Már Gilbert 82bd9db1d6 PFW-1397 Implement ON_MENU_ENTER to simplify code
ON_MENU_ENTER runs code within the brackets only once
after a new menu is entered.

For the tool change menu, this allows us to display the data and
read from EEPROM only once.
2022-11-08 13:49:40 +01:00
Guðni Már Gilbert fcfb868167 PFW-1397 Add a temporary menu item to show the statistic
The location of the menu has not been decided. Currently I placed it where convenient.
2022-11-08 13:49:40 +01:00
Guðni Már Gilbert 7fe22e8f79 Fix long-press LCD inactivity timeout
Fixes #3715

When a long-press is triggered, the LCD inactivity timer
needs to be restarted. This is done with lcd_timeoutToStatus.start()

This also fixes situations where a long-press is triggered, and the timer
times out immediately (because it was not reset properly)

Change in memory:
Flash: +8 bytes
SRAM: 0 bytes
2022-11-06 13:43:14 +00:00
3d-gussner 7c009cadb8 Bump up Revision to ALPHA1 6051
Temporary fix for MSG_BTN_MORE
pre-release pot and po update
2022-11-04 10:21:39 +01:00
3d-gussner fd6da0e766 Fix typo
Add lcd_setatatus_serial to output lcd status message and serial at the same time
2022-11-02 10:09:32 +01:00
3d-gussner 2ac2cd2255 Fix MK25/S builds 2022-10-26 14:27:22 +02:00
3d-gussner 072b3f8300 Temp Model cal. menu 2022-10-26 13:34:27 +02:00
Alex Voinea edc5d013dd
Merge pull request #3698 from leptun/farm_presort_cache
Farm mode: cache filenames in the presort function
2022-10-21 15:43:49 +02:00
Alex Voinea b485992c9e If in farm mode, force the sorting direction to be reversed
So in an ideal scenario, the newest file is first. This of course breaks as soon as a file is deleted/renamed/moved, but it should at least be fixed now compared to before where the direction could be influenced by a disabled setting
2022-10-18 17:29:31 +02:00
Alex Voinea 798f215f88 Refactor SD menu settings 2022-10-18 17:24:35 +02:00
3d-gussner e83728f72c Change fan RPM display to 5 digits
All credits to @ WarrenSchultz for initial PR https://github.com/prusa3d/Prusa-Firmware/pull/3656
2022-10-17 15:41:05 +02:00
3d-gussner f2fe9a51ee rename `Extruder fan` to `Hotend fan` 2022-10-17 13:49:18 +02:00
Guðni Már Gilbert 2682b64a09 Optimisation: Reduce code size in rendering SD file names and folders
Change in memory:
Flash: -88 bytes
SRAM: 0 bytes
2022-10-12 20:19:21 +00:00
Guðni Már Gilbert 9f3361577e
Merge pull request #3643 from gudnimg/PFW-1358
PFW-1358 More button utilizes text and an empty character on the right
2022-10-10 18:02:22 +00:00
Guðni Már Gilbert 213f0e8c71 PFW-1358 Update second_col description
Value is no longer hardcoded
2022-10-10 17:48:56 +00:00
Guðni Már Gilbert 1c6345a85b Fix issue where MMU status messages were not padded
Also combined common cases to reduce code size
2022-10-09 10:37:33 +00:00
Guðni Már Gilbert 7264391c5f PFW-1358 Fix and optimise button choice positions 2022-10-08 08:50:40 +00:00
Guðni Már Gilbert 9046fb3d44 PFW-1358 Adjust positions of button choices 2022-10-08 08:50:39 +00:00
3d-gussner 992845198d
Merge pull request #3648 from wavexx/more_cleanups
cleanup: Expand tabs to fixup suspicious indentation warnings
2022-10-03 11:53:42 +02:00
Yuri D'Elia 4cc6695195 cleanup: Expand tabs to fixup suspicious indentation warnings 2022-10-02 20:42:36 +02:00
Yuri D'Elia a8e85bd146 cmake: Work-around gcc 7 not supporting SOURCE_DATE_EPOCH 2022-10-02 20:32:32 +02:00
Alex Voinea 7fb53899dc Merge branch 'MK3' into MK3_MMU2_fix1 2022-09-23 14:55:23 +02:00
Yuri D'Elia 26b091d50e Remove unneeded lcd_finishstatus() 2022-09-23 11:54:16 +02:00
Yuri D'Elia 80c06bda55 Improve warning behavior during thermal anomaly
The current code forces any warning to return the user to the status
screen in order to show the message.

Thermal anomaly warnings can repeat at very short intervals, making menu
navigation (to pause/tune the print) impossible.

We now check if the message to be displayed is the same and only force a
kickback for new messages.

This partially reverts https://github.com/prusa3d/Prusa-Firmware/pull/3600
since we need the string to be null terminated for ease of comparison.

We pad the status line at display time instead using the new
lcd_print_pad() function which achieves the same effect.
2022-09-22 16:12:35 +02:00
Yuri D'Elia 9a9aadca87 Do not hang during startup
In ultralcd_init() do not use lcd_setstatuspgm() to initialize the
welcome message.

The internal call to lcd_finishstatus() requires the serial to be
already available. Split the function into lcd_padstatus() to pre-pad
the string and save some space.
2022-09-21 16:12:16 +02:00
DRracer f7d4095479
Merge branch 'MK3' into MK3_MMU2_fix1 2022-09-21 15:18:44 +02:00
3d-gussner 47d7ea5dfd Add MSG_LOAD_ALL and replace it a two loactions -10bytes flash 2022-09-17 16:36:09 +02:00
Guðni Már Gilbert be7c1d55c8 Remove redundant for-loop
Now that lcd_status_message is now initialised correctly at boot-up,
this for-loop is no longer required. Now lcd_status_message is
only set in lcd_updatestatus() which always calls lcd_finishstatus()

lcd_finishstatus() makes sure the message does not exceed 20 characters

Saves 34 bytes of flash
2022-09-17 09:13:07 +00:00
Guðni Már Gilbert 4d6d267aef Don't initialise lcd status message in definition
static variables are automatically zero initialised. Now that the
status line message is initialised in ultralcd_init(), we don't
need to set the variable in global scope.

Saves 22 bytes of flash and 1 byte of SRAM
2022-09-17 08:57:30 +00:00
Guðni Már Gilbert f1e127ace4 Initialise status line message in setup()
Fixes #3581
2022-09-17 08:53:36 +00:00
3d-gussner 88b58cdcd5 Update messages missing c= r=
Change MMU2 KEEPALIVE_STATE to IN_PROCESS
2022-09-16 19:24:11 +02:00
3d-gussner 3f6b05cc35 Remove PAT9125 stats as these aren't different to IR stats 2022-09-16 18:04:21 +02:00
3d-gussner 2ba863d8a5 Reuse MSG_IR_0x_OR_..
fix lowercase
remove todos
2022-09-16 17:23:38 +02:00
3d-gussner edad625cf7 RIP Bondtech long live the Extruder 2022-09-16 16:31:27 +02:00
3d-gussner 37cde856e9 Rename Auto_deplete to Spool_join
Fix some missing MSG_ c= r=
2022-09-16 16:25:47 +02:00
Guðni Már Gilbert 166ecbc7d8 PFW-1362 Fsensor is not required for Spooljoin
Since the Fsensor is not required to use SpoolJoin,
it makes little sense to me that we need the fsensor
to "enable" SpoolJoin
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert d51026d8f7 PFW-1362 Rename settings for consistency 2022-09-16 10:23:47 +02:00
Guðni Már Gilbert 715af8fcc2 Rename files to SpoolJoin 2022-09-16 10:23:47 +02:00
Guðni Már Gilbert afc67332c7 PFW-1362 Initial commit 2022-09-16 10:23:47 +02:00
Guðni Már Gilbert 2276217cbb Optimisation: Remove forceMenuExpire variable
During first layer calibration we have the live Z baby step menu
on the LCD and the user can tune their Z offset live.

Once the first layer calibration is done, we want to exit the menu
immediately. For this purpose it is much more efficient to
call lcd_return_to_status(). There is no visual difference
on the LCD for the user.

Change in memory footprint:
Flash: -34 bytes
SRAM: -1 byte
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert 27ff01cf91 Shorter code
Change in memory:
Flash: 0 bytes
SRAM: 0 bytes
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert f49b88c1a1 Optimisation: lcd_commands "M702 C" should be "M702"
Change in memory:
Flash: -2 bytes
SRAM: 0 bytes
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert f297131792 M600: lcd_change_fil_state does not need to be global
Refactor lcd_alright() to save flash

Change in memory:
Flash: -98 bytes
SRAM: -1 bytes
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert 03b8a6e464 Use raise_z in more places
Change in memory:
Flash: -474 bytes
SRAM: 0 bytes
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert 4758ac3f1b PFW-1399 Don't show cut filament menu if setting is not enabled 2022-09-16 10:23:47 +02:00
Guðni Már Gilbert 66994d010d Fix a few cases where rebase overwrote stuff 2022-09-16 10:23:47 +02:00
D.R.racer 37b50477cd Fixup after rebase onto MK3 2022-09-16 10:23:47 +02:00
Guðni Már Gilbert dfddf3eaa5 Initial commit for MMU statistics 2022-09-16 10:22:39 +02:00
Guðni Már Gilbert 0a90c7ffda PFW-1386 Use Marlin 2 unload sequence for single material
The current unload sequence does not give good results.
The Marlin 2 sequence looks good on my end. This can be later
used to improve M600

Added all the constants from Marlin 2
2022-09-16 10:22:39 +02:00
Guðni Már Gilbert 099c3a1f1f PFW-1386 fixup 2022-09-16 10:22:39 +02:00
Guðni Már Gilbert 38952f1f33 PFW-1386 Optimisation: st_synchronize is not needed after raise_z_above
Saves 16 bytes of flash
2022-09-16 10:22:39 +02:00
Guðni Már Gilbert 20c865c2d4 PFW-1386 Implement 'U' parameter for M702
Similar to 'L' in M701, this does not apply to the MMU
The U parameter controls how much mm the extruder will unload
Default value is 80mm
2022-09-16 10:22:39 +02:00
Guðni Már Gilbert 7e9166976f PFW-1386 Implement 'L' parameter for M701
It is only used when the MMU is disabled. With the MMU we use a defined ramming sequence.

When the MMU is disabled I borrowed the usages from Marlin 2.
The L parameter only defines the length for the "fast" load length.
Default value is 70mm, same as M600
2022-09-16 10:22:39 +02:00
Guðni Már Gilbert d6564d3617 PFW-1386 if automatic = false, raising Z-axis is done via gcode 2022-09-16 10:22:38 +02:00
Guðni Már Gilbert 5b184d885c Add LCD_BUTTON_TIMEOUT to enum 2022-09-16 10:22:38 +02:00
Guðni Már Gilbert 2fc8b50f11 Fix lcd_show_multiscreen_message_yes_no_and_wait_P after rebase 2022-09-16 10:22:38 +02:00
D.R.racer 09cb9c6ecd Fixup after rebase + discussion 2022-09-16 10:22:38 +02:00
Guðni Már Gilbert 6bf2aebf04 Fix typo 2022-09-16 10:22:38 +02:00
Guðni Már Gilbert 80c640deb9 PFW-1373
Fix the unload procedure when the user has paused a print
then stopped the print after the temperature has reached below 175°C
Now the E-motor will move as expected
2022-09-16 10:22:38 +02:00
Guðni Már Gilbert 2aa6cfc1ab Optimise mmu_cut_filament_menu (#40)
preheat_or_continue should be used here to reduce copying code
2022-09-16 10:22:38 +02:00
D.R.racer f94c2cba46 Fix rendering temp. + toolchange on MMU error screen 2022-09-16 10:22:38 +02:00
D.R.racer dab26fe50b Report detected MMU version in the Support menu
It was just subtly broken, all the functionality had already been implemented.
2022-09-16 10:22:38 +02:00
D.R.racer 121d43f896 Add a Try-Load-to-Bondtech operation
PFW-1347
2022-09-16 10:22:38 +02:00
Guðni Már Gilbert 8aa16a6429 Write documentation for lcdui_print_extruder 2022-09-16 10:22:38 +02:00
Guðni Már Gilbert 8fd1653b84 PFW-1343 initial commit 2022-09-16 10:22:38 +02:00
VintagePC e8088b0161 Allow reset if the EEPROM is set to "on" 2022-09-16 10:22:38 +02:00
VintagePC 73c486cc2f - Fix DisableMMU button on FW incompat
5823c14
- Implement eeprom var, fix reset
2022-09-16 10:22:38 +02:00
D.R.racer 1ff7459743 Re-enable filament runout + add debug msgs
Needs a fix on the MMU side (report FeedToBondtech::DisengageIdler)
2022-09-16 10:22:38 +02:00
Guðni Már Gilbert bd932b3b10 Cleanup: Fix two compiler warnings 2022-09-16 10:22:38 +02:00
Guðni Már Gilbert 352a22c22e Cleanup: Remove unused callback
Remove unused callback in lcd_show_multiscreen_message_with_choices_and_wait_P
2022-09-16 10:22:38 +02:00
D.R.racer 0e75a03c8c Reuse FSensor runout blocking impl. throughout the whole FW 2022-09-16 10:22:38 +02:00
D.R.racer eed816d9de Fix build 2022-09-16 10:22:38 +02:00
D.R.racer d7270e0b80 Fix lang build 2022-09-16 10:22:38 +02:00
D.R.racer 5082da78d2 Convert button on LCD into button for MMU
- Dependent on current MMU error being processed
- Includes rename of LEFT_BUTTON_CHOICE -> LCD_LEFT_BUTTON_CHOICE (and right, middle as well) to avoid confusion with MMU buttons' ordering
2022-09-16 10:22:38 +02:00
D.R.racer 0bd3dfdcf7 This starts to print ;)
Temporarily disabled filament runout as this breaks ToolChange operation
yet for unknown reason.
2022-09-16 10:22:38 +02:00
Guðni Már Gilbert 33650c6e56 Remove redundant call to lcd_update_enable 2022-09-16 10:22:37 +02:00
Guðni Már Gilbert f1803357b0 Fix default selection after changes in PFW-1312
The Yes and No are reverted. Before PFW-132 Yes is 1 and No is 0
Now they are Yes is 0, and No is 1
2022-09-16 10:22:37 +02:00
Guðni Már Gilbert 45edc69cc4 Add back menu it confirm if extrusion has correct color after loading to nozzle via LCD
I've added the call to this message via the menu function to ensure it
only appears when interacting with the LCD
2022-09-16 10:22:37 +02:00
Guðni Már Gilbert 1c26875e0e PFW-1318 Implement callback to render status line
To render the thermometer and degree symbols
the CGRAM table will instead swap out
the feedrate and clock symbol when
lcd_set_custom_characters_nextpage()
is called.
2022-09-16 10:22:37 +02:00
Guðni Már Gilbert 452f39dc4b fixup 2022-09-16 10:22:37 +02:00
Guðni Már Gilbert 3b0fba14ac Remove unused parameter nlines to simplify things
This allows us to remove one overload
of lcd_display_message_fullscreen_P
2022-09-16 10:22:37 +02:00
D.R.racer 68b007c759 Fix compile-time conversion MMU2 ErrorCode -> Prusa-Error-Code
and hide some of the implementation details into mmu2_error_converter.cpp
which makes the code in mmu_reporting.cpp much easier to read.
2022-09-16 10:22:37 +02:00
Guðni Már Gilbert 138a0d21c7 Change default selection parameter from bool to uint8_t
This allows us make any of the three button choices the default selection
2022-09-16 10:22:37 +02:00
Guðni Már Gilbert 89e2bc4d6b Change name of variable 'yes' to be more descriptive 2022-09-16 10:22:37 +02:00
Guðni Már Gilbert 031c588802 Make all choice menus return consistent values
Such that left = 0, middle = 1, and right = 2
2022-09-16 10:22:37 +02:00
Guðni Már Gilbert 37bfd8ecd1 Checkpoint
- combined lcd_show_three_choices_prompt_P and lcd_show_two_choices_prompt_P into one function called lcd_show_choices_prompt_P
- Removed third_col parameter
- Added an enum to make the button selection result more readable
2022-09-16 10:22:37 +02:00
Guðni Már Gilbert 83fefe10c1 Checkpoint:
- Rename lcd_show_multiscreen_message_two_choices_and_wait_P to lcd_show_multiscreen_message_with_choices_and_wait_P

- Move MMU error screen from ReportError() to ReportErrorHook()

- Fix the menu selection to work for menus with either two choices or three choices

- The buttons shown on the MMU error menu are now determined by the definition of btnOperation[]
2022-09-16 10:22:37 +02:00
Guðni Már Gilbert ffe8c7c31a Update lcd_show_multiscreen_message_two_choices_and_wait_P
to support 3 choices
2022-09-16 10:22:37 +02:00
Guðni Már Gilbert 74ea9a7e43 Remove class LcdUpdateDisabler
Calling lcd_update_enable directly gives us more control

This also save a bit of flash memory
2022-09-16 10:22:37 +02:00
Guðni Már Gilbert 1ba314d95b Print the MMU progress into status screen 2022-09-16 10:22:37 +02:00
D.R.racer b27f690556 Add ProgressCodes -> text converter 2022-09-16 10:21:53 +02:00
D.R.racer 9140ebba55 Add MMU FW version variables
hardcoded for now, but API ready
2022-09-16 10:21:53 +02:00
D.R.racer 825eed97d4 Fix build after rebase 2022-09-16 10:21:53 +02:00
D.R.racer 4732859a98 Avoid exposing internal variables of fsensor
makes the code a bit shorter as well, because the compiler can be sure
that the variables are not accessed from the outside of the
fsensor.cpp compilation unit.
2022-09-16 10:21:53 +02:00
D.R.racer 2e293e90a0 MMU2 interface overhaul
First port of the new MMU2-printer interface into 8bit FW.
2022-09-16 10:21:53 +02:00
Alex Voinea 329745368e Improve PAT9125 UI implementation 2022-09-16 10:20:32 +02:00
Alex Voinea 340bc87110 Checkpoint: jam detection 2022-09-16 10:20:32 +02:00
Alex Voinea 65b2881b06 PAT9125 first prototype 2022-09-16 10:17:33 +02:00
Alex Voinea c5c4c21124 Update Sensor info menu documentation 2022-09-16 10:17:04 +02:00
Alex Voinea ea23e6d924 Fix MK2 build? 2022-09-16 10:17:04 +02:00
Alex Voinea bbe1b1145e Correct ifdefs for all IR sensor types 2022-09-16 10:17:04 +02:00
Alex Voinea d2bfe422f1 Separate runout and enabled settings 2022-09-16 10:17:04 +02:00
Alex Voinea b741707c0e Fsensor error state 2022-09-16 10:17:04 +02:00
Alex Voinea 5484882758 Checkpoint after a lot of removal 2022-09-16 10:17:04 +02:00
Alex Voinea fc49ba115a Move more IR sensor analog stuff to Filament_sensor.h 2022-09-16 10:09:20 +02:00
Alex Voinea b52022f6c6 More dead code removal 2022-09-16 10:08:39 +02:00
Alex Voinea 6663f719f6 Remove old fsensor_init() 2022-09-16 10:08:39 +02:00
Alex Voinea 43db24e4fe IR_sensor_analog voltage readings 2022-09-16 10:08:39 +02:00
Alex Voinea 7224b5c2b6 Remove OQ and add fancy autoload interaction 2022-09-16 10:08:39 +02:00
Alex Voinea 45e43137a5 Filament sensor refactoring initial 2022-09-16 10:07:49 +02:00
3d-gussner d706ebb556 Update forgotten MSG_ c= 2022-09-14 11:33:24 +02:00
3d-gussner 6e3be50389 Clean up 2022-09-14 11:33:24 +02:00
3d-gussner f65e8ae5dd Add MSG_ALWAYS 2022-09-14 11:33:24 +02:00
3d-gussner 129b646c58 Fix MSG_ c=
Add MSG_ to messages.c/h
2022-09-14 11:33:24 +02:00
3d-gussner 0a68de0bbe Update MSG c=xx
Mark unused strings as `_n`
2022-09-14 11:33:24 +02:00
Yuri D'Elia c7354bdfe8 lang: Fix usage of new non-translated strings
Fix cherry-pick
2022-09-14 11:33:24 +02:00
D.R.racer 996f9943a1 Extract PRINTER_ACTIVE into a noinline function
Having the original PRINTER_ACTIVE macro copied at multiple spots doesn't make sense.
Refactoring it into a non-inline function saved ~400 bytes of code.
It should be safe in terms of performance, all occurrences are at non-time critical spots.
2022-09-14 07:31:39 +02:00
Yuri D'Elia 16d666302b Allow choice positioning. Balance Yes/No messages.
Add an additional parameter to control the position of second choice
prompt position (while defaulting to the old).

This allows Yes/No prompts to be equally spaced.
2022-09-14 07:30:57 +02:00
Yuri D'Elia b41fb8a13a Unify fullscreen/multiscreen/yes-no prompt message handling
Modify lcd_show_multiscreen_message_two_choices_and_wait_P to also
handle single-screen or empty (no-clear) prompts, making other functions
redundant. Saves 76 bytes.

Change existing functions to simply call
lcd_show_multiscreen_message_two_choices_and_wait_P with the correct
arguments.

This changes the prompt of existing Yes/No messages: the previous prompt
would use the last two lines of the LCD, while the new prompt is using
just the last line of the LCD instead.

Translation do not require updates, since the Yes/No translation was
already the same in both implementations.
2022-09-14 07:30:57 +02:00
Alex Voinea 2959cc0b64 Do not compile farm lcd_commands 2022-08-30 13:57:43 +02:00
Alex Voinea 2b4c2127e6 Make lcd function static 2022-08-30 13:57:43 +02:00
Alex Voinea bef7b086e3 Isolate the entire farm and statistics code 2022-08-30 13:57:43 +02:00
Alex Voinea 7d597eb8b0 Move farm mode to separate file 2022-08-30 13:57:43 +02:00
Alex Voinea 7d72f0ee2e better lcd printing for IP address
flash: -46
RAM: 0
2022-08-26 19:33:53 +03:00
Guðni Már Gilbert 89fc9f7a62 Optimise lcd_menu_show_sensors_state()
flash: -22
RAM: 0

menu_lcd_lcdupdate_func() takes care of starting lcd_timeoutToStatus if the knob is clicked.

When the knob is clicked we only want to back out of the menu.
This changes makes the menus slightly more conistant behind the scenes.
2022-08-26 19:22:23 +03:00
Guðni Már Gilbert c2340d3648 lcd_babystep_z should not start lcd_timeoutToStatus
flash: -8
RAM: 0

When the menu is entered and left the function
menu_lcd_lcdupdate_func() takes care of resetting the timer.

Currently the firmware will reset the timer twice when the lcd_babystep_z menu is entered. This commit fixes that.
2022-08-26 19:20:22 +03:00
Guðni Már Gilbert 74d6aead2f Optimise if statements in lcd_tune_menu
flash: -10
RAM: 0

I am basically combining two if statements if(SilentModeMenu == SILENT_MODE_NORMAL)
2022-08-26 19:17:07 +03:00
Alex Voinea 25350dfbbc Remove unused variable bFilamentFirstRun
flash: 0
RAM: -1
2022-08-26 19:14:40 +03:00
Guðni Már Gilbert d87999a020 workDirDepth can be one byte
We set the max working directory depth to 6 (see MAX_DIR_DEPTH)

Changes save 1 byte of SRAM and 50 bytes of flash
2022-08-26 10:56:02 +02:00
DRracer 2e677ea3ee
Merge pull request #3569 from leptun/fix_card_removed
Fix "Card removed" on startup
2022-08-24 19:17:24 +02:00
DRracer 0933fdb6fe
Merge pull request #3552 from wavexx/temp_model_check
Thermal Model protection
2022-08-24 19:16:48 +02:00
Alex Voinea ef8be4dfca Fix "Card removed" on startup 2022-08-24 20:10:09 +03:00
Guðni Már Gilbert ca8d47a6da If lcd_draw_update is set outside lcd_status_screen
then render the sceen without delay

This adds only 10 bytes of flash
2022-07-27 11:55:08 +00:00
Guðni Már Gilbert f6fd91a235 Optimise lcd_status_screen
Saves 20 bytes of flash
2022-07-27 11:14:18 +00:00
Yuri D'Elia 374b829fb6 Generalize menu_block_entering_on_serious_errors for menu lockout
Call this variable menu_block_mask instead. We don't need to know the
exact reason of why we're locking the menu.

We will be able to reuse this to prevent menu entry during more
activities in a cleaner way than testing for each condition as it's
currently done for both menu entry and longpress.
2022-07-25 17:30:22 +02:00
Yuri D'Elia 4ca0012077 Prevent longpress if a serious error is set 2022-07-25 17:30:22 +02:00
Yuri D'Elia 19df196e1f Better differentiation between pause/paused resume/resumed states
Use OCTOPRINT_ASK_* for the present form of actions. In these cases the
host will perform the pausing manouvers for us.

Use OCTOPRINT_* instead for the past tense forms when we are in charge.

Also always emit the action, whether we are or not sd-printing. This is
due to the new Stopped handling behaving correctly in either case.
2022-07-25 17:30:22 +02:00
Yuri D'Elia 39ad53ab11 Simplify fan checks now that lcd pause works correctly 2022-07-25 17:30:22 +02:00
Yuri D'Elia b9fc73c4c3 TM: Pause the print and allow recovery from a thermal error
Do not allow resuming until all thermal and fan errors are clear.

Call the appropriate resume function when resuming a printing depending
on the saved_print state (is saved_print is available, then we always
need to resume from the saved state even when printing via usb).

Clear the Stopped state when resuming, so that commands can be accepted
again.
2022-07-25 17:30:22 +02:00
Yuri D'Elia d1864011f4 Handle pause/stop in the main loop, again
Force processing of the pause and stop "parking" commands _after_ the
main loop completes.

This was/is currently done in lcd_commands, which is a poor place to
continue processing, since it can be called already within an aborted
command. This requires checking for planner_aborted before any action
can be performed.
2022-07-25 17:30:22 +02:00
Yuri D'Elia b3ca70a007 Show thermal warnings using the new LCD_MESSAGE_INFO priority
Add a new LCD_MESSAGE_INFO priority which can be overridden by regular
status updates, but only if a certain amount of time has passed.

Assign a time stamp to all message updates, so that the time since the
last update can be determined. Also switch the message type to Status,
so that the message always becomes visibile.

Always show status or info messages when printing via SD if the message
is recent enough.
2022-07-25 17:30:22 +02:00
Yuri D'Elia dc2d596f40 Do not allow lcd_updatestatus to be called directly
Enfoce the usage of lcd_setalertstatuspgm and lcd_setstatus so what we
consistently have alert severities properly set.
2022-07-25 17:30:22 +02:00
Yuri D'Elia f1d88ebd40 Protect pid_tuning_finished behind temperature.cpp
Setting pid_tuning_finished can result in the heaters stuck to full
power. As a result, we need to ensure that when PID management is
disabled, heaters are also.
2022-07-25 17:30:22 +02:00
Yuri D'Elia 442b2e16de Set pid_tuning_finished globally to true
Use pid_tuning_finished as a flag to prevent automatic PID management.
As a result, set the default start-up state to true and adjust the
dependent code accordingly.
2022-07-25 17:30:22 +02:00
Yuri D'Elia f8de274db3 Split fan checks out of temperature.cpp 2022-07-18 17:53:27 +02:00
Alex Voinea 510c874619 Fix scrolling timing issue when the menu is rendering very slowly 2022-07-15 15:46:01 +03:00
Alex Voinea 8bb451129d Remove compiler bug workaround
These lines had to be done like that because gcc 5.4.0 would throw a segmentation fault when linking. With gcc 7.3.0, this is no longer an issue
2022-07-15 15:46:01 +03:00
Alex Voinea 3a5bc0462a Do not call lcd_update recursively when running presort with many files 2022-07-15 15:45:34 +03:00
Alex Voinea 3c579bf738 Fix fullscreen message lcd_update handling 2022-07-15 15:45:34 +03:00