fieldOfView / Cura-CustomJobPrefix

A Cura plugin that lets the user set a custom print job prefix
GNU Affero General Public License v3.0
24 stars 5 forks source link

Base name gets removed when there's a ; in it #16

Closed Ashteroide closed 4 years ago

Ashteroide commented 4 years ago

I found another bug, I'll upload a screenshot, the original STL was named Case1;2 which I suspect would be because of the ; but when I save the Gcode it removes the actual name of it and just puts the prefix 85191758-5d4fb500-b303-11ea-9706-545716f3855a Here is my prefix I used for it {print_time_hours},{print_time_minutes}. and no postfix

Ashteroide commented 4 years ago

Also this mainly happens with Save to Removable Drive

fieldOfView commented 4 years ago

Thanks for opening a new issue. Just so I can reproduce this, what strings did you used for the prefix and postfix?

You say the original STL was named Case1;2, but in the screenshot I see the base name is Middle. Was the file named Case1;2.stl or something with Middle in it?

Ashteroide commented 4 years ago

@fieldOfView Yes the original file loaded was named case1;2, I had problems with it not saving properly and then I changed it to Middle. Here is the prefix {print_time_hours},{print_time_minutes}., no postfix

fieldOfView commented 4 years ago

I can't reproduce it, but that may be because I don't have a removable drive with me to test with.

Can you try reproducing the issue without the . in the prefix? I may end up disabling entering the . in the prefix and the postfix because it has a tendency to screw things up.

fieldOfView commented 4 years ago

What OS do you use?

Ashteroide commented 4 years ago

@fieldOfView I use MacOS 10.15.5 Catalina

Ashteroide commented 4 years ago

I think it was more to do with the STL File, You can't add ; to the name when in Cura, but since the file had a ;, it allowed it which then created problems with your extension

fieldOfView commented 4 years ago

Could you test this development snapshot with the option to "sanitize jobname parts" checked?

Ashteroide commented 4 years ago

Hi @fieldOfView, I tested the snapshot and the Santise Job Parts does seem to be working, it doesn't show in Cura itself but when I saved the file to my drive or my computer it added in the _ replacing spaces. One thing I am curious about is the Path option, at first it gave me this error when it was blank Screen Shot 2020-06-30 at 12 08 56 pm

I changed it to I3 MEGA and it saved a folder to the drive, personally I'd prefer the path to have an option to be disabled because I only have one printer but it would be nice for people with multiple printers but you have to change the Path name every time. If it was adaptive to the printer settings chosen, i3 Mega or Ender 3 then that would be a nice addition.

It does thankfully replace any ; or other accents, but if I rename the file in Cura and then try to save it, it doesn't apply the _ to spaces until I move and reslice the model Here is a zip file containing the sliced Gcode results, I'll give you some info about each one

Archive.zip

0,32_0,32ThisIs_1_2.gcode this is a bug I was supposed to mention a while ago where it moves the prefix into the actual name of the file and doubles up, this occurs when you sometimes rename or move the file.

0,32_This___is___a___test.gcode the original file name was This ; is ; a ; test which was to test the plugin capabilities, it works however the double __ is a bit odd but would be expected in the plugin code.

0,32_This_is_a_test.gcode was named This is a test and works as intended too, replacing spaces with _

Quick Notes:

  1. Make an option to disable the Path
  2. Allow the user to make a custom space replacement (e.g . or ,) instead of _ the whole time, . or , can help conserve space
  3. Have a look to see if you can find the bug for the prefix double up
  4. The Sanitise Job Parts should mainly be enforced for certain characters so it removes ;
  5. Take your time with this, don't worry too much about the long list. I understand it is hard to code this kind of stuff so just relax and I will wait patiently
fieldOfView commented 4 years ago

The main problem in this issue is fixed. The path problem is also fixed.

Version 3.5.2 is now in the Marketplace. If there are any remaining problems, please open new issues. One per problem, please, or I will loose track.