MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.18k stars 19.21k forks source link

[BUG] `fileprop` not declared in scope (HAS_GCODE_PREVIEW) #26212

Closed classicrocker883 closed 11 months ago

classicrocker883 commented 1 year ago

Did you test the latest bugfix-2.1.x code?

Yes, and the problem still exists.

Bug Description

after the recent commit https://github.com/MarlinFirmware/Marlin/commit/8fa6a4da2eebc1dbe120dcac87b159e389e17dc3

where gcode_preview files for PROUI were changed, I get this error

Marlin\src\lcd\e3v2\proui\gcode_preview.cpp: In member function 'void<unnamed struct>::clear()':
Compiling .pio\build\STM32F103RE_creality_maple\src\src\lcd\utf8.cpp.o
Marlin\src\lcd\e3v2\proui\gcode_preview.cpp:66:5: error: 'fileprop' was not declared in this scope     
     fileprop.name[0] = '\0';
     ^~~~~~~~
Marlin\src\lcd\e3v2\proui\gcode_preview.cpp:66:5: note: suggested alternative: 'fileno'
     fileprop.name[0] = '\0';
     ^~~~~~~~
     fileno
*** [.pio\build\STM32F103RE_creality_maple\src\src\lcd\e3v2\proui\gcode_preview.cpp.o] Error 1

Bug Timeline

new, after commit 8fa6a4d

Expected behavior

should compile successful

Actual behavior

error during compile

Steps to Reproduce

  1. enable DWIN_LCD_PROUI
  2. define HAS_GCODE_PREVIEW 1
  3. build firmware

Version of Marlin Firmware

bugfix-2.1.x

Printer model

No response

Electronics

No response

Add-ons

No response

Bed Leveling

None

Your Slicer

None

Host Software

None

Don't forget to include

Additional information & file uploads

No response

classicrocker883 commented 1 year ago

Update

I used CODEGPT and it suggested this fix


  void clear() {
    this->name[0] = '\0';
    this->thumbstart = 0;
    this->thumbsize = 0;
    this->thumbheight = this->thumbwidth = 0;
    this->time = 0;
    this->filament = 0;
    this->layer = 0;
    this->height = this->width = this->length = 0;
  }

I since tested and this works.

I'll post a PR.

classicrocker883 commented 1 year ago

@ellensp yes that fix also works, which is probably even better.

so no your first comment without this-> works fine, the second with void setname can remain no change

github-actions[bot] commented 9 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.