Page MenuHomePhabricator

ASCII STL files not loaded correctly
Closed, ResolvedPublic

Description

Steps to reproduce:

  • Start a clean workbench using option --BlueBerry.clean
  • Load an ASCII STL file, e.g. /Modules/IGT/Resources/NDIAurora_Dome.stl

--> Surface is visible.

  • Close workbench
  • Start workbench without option --BlueBerry.clean
  • Load the ASCII file again

--> Surface is not visible.

Event Timeline

User eisenman has pushed new remote branch:

bug-19563-MissingLocaleSwitch

Core Change Request

  • On some Linux systems ASCII STL files are not loaded properly on second workbench start.

Actual behavior

  • Loaded surface is not visible.

Expected behavior

  • Loaded surface should be visible.

Cause of the bug

  • During second Workbench start, the locale is changed to German settings (comma instead of point for decimal separation). Hence, the file cannot be read. We tried starting the workbench, killing it (no proper closing) and restarting the workbench and the bug is still present. Therefore it cannot be during closing. First workbench start after blueberry clean also works fine, so it must be during second loading.

Proposed solution

  • Use LocaleSwitch helper in methods SurfaceStlIO::Read() and SurfaceStlIO::Write().

Affected classes

  • SurfaceStlIO

How will the bugfix get tested?

  • Manual loading and saving ASCII STL files. Automatic testing is not possible, as it only occurs on the second workbench start after BlueBerry.clean.

Please remove your comment lines as the LocaleSwitch lines are obvious enough. :-) No need to be redundant here. If you think that your fix is just a workaround, as the locale should be set correctly at a more central place, you can also change the comment lines to something like "See T19563" and add some information here in Bugzilla, that it's probably just a workaround.

[6c2339]: Merge branch 'bug-19563-MissingLocaleSwitch'

Merged commits:

2016-03-02 18:59:25 Matthias Eisenmann [497e9d]
remove redundant comment lines


2016-02-17 14:26:24 Matthias Eisenmann [2104c9]
apply locale switch to STL read and write methods

We could not figure out the difference at the second workbench start. But handling locales in the reader's read and write methods seems reasonable here (see some other reader/writer implementations).