1 (edited by CoolArts 2017-01-26 18:10:35)

Topic: OS X 3w file temperature modifier App

In order to use this app you need to have threedub installed. A single search in this forum will tell you how.

This is a very very simple app that will modify temperature setting of 3w files in batch process, it's maded in Automator so you can open the app with automator and see everything inside.
This is my very first Shell Script or OSX Script, so please don't blame me smile, i't will be great if you help me to enhance the code so we all can learn a bit, I will thank you alot.

Apart of the Automator processes, this is the script that does everything.

CoolArts wrote:

#Define a temporary file to work with
tmpFile="/tmp/3w2GcodeTemp"

#Silent delete the file for if garbage exists
rm -f "$tmpFile"

#Loop trough arguments passed by automator
for file in "$@"
do
    #Conditional check for .3w extension
    if [ "${file: -3}" == ".3w" ]; then
        #Extract original name of the file
        filename=$(basename "$file")
       
        #Create temporary .gcode file with treedub and wait till it's processed
        /usr/local/bin/threedub -f gcode "$file" "$tmpFile"
        wait
       
        #Inyect temperature to temporary file
        echo -e "M104 S$1\nM109 S$1\n$(cat $tmpFile)" > "$tmpFile"
       
        #Create the .3w back inside the chosen folder and wait till processed
        /usr/local/bin/threedub "$tmpFile" "$2/$filename"
        wait
       
        #Delete temporary .gcode file
        rm -f "$tmpFile"
    fi
done

Steps:
First you need to download (2.4 Mb), uncompress, mount & copy the app to your drive (or just use it from mounted dmg)
Edit: Replaced link -> 3wTemp.dmg.zip -> to post attachment.

Create your 3w file with XYZWare as you always do, or choose an already processed bunch of 3w files and throw them to the app icon.

As you can see in the code abobe there's no need to drop only 3w files, the script will filter the files and process only 3w files. Do not throw a folder since the script doesn't check folder contents, that means that you will probably not process a single file that is inside a selected folder.

http://soliforum.com/i/?xNYiaKU.png

The app will ask you to choose a folder, just select where do you want to store final 3w temperature modified files.

http://soliforum.com/i/?eGtjd5Z.png

Then you will be asked to insert the temperature

http://soliforum.com/i/?r703ZRL.png

Once the batch process ends you will have a notification under notifications system tab

http://soliforum.com/i/?3LQ0jhi.png

Check your choosen folder, and voila modified files will be there to print at your desired temperature.

http://soliforum.com/i/?F6cxQo6.png


I wish this can be usefull to any one.
Best regards,
CoolArts.


...

Post's attachments

3wTemp.dmg.zip 2.41 mb, 3 downloads since 2017-01-26 

You don't have the permssions to download the attachments of this post.
XYZ Junior/Mini Passwords Thread
If you are in a hurry and need your password NOW, or if it takes me too long for you, you can read the posts from 1851. I'm not going to be as effective as Bozo or Cgrillo, but you can give a try with me. If PASSWORDS thread follow it's current flow: asking for repeated passwords, not returning or false PACKS... I will end up with it as others before me.

2 (edited by CoolArts 2017-01-24 20:14:23)

Re: OS X 3w file temperature modifier App

Added poll to header post.

I voted no need ;P

XYZ Junior/Mini Passwords Thread
If you are in a hurry and need your password NOW, or if it takes me too long for you, you can read the posts from 1851. I'm not going to be as effective as Bozo or Cgrillo, but you can give a try with me. If PASSWORDS thread follow it's current flow: asking for repeated passwords, not returning or false PACKS... I will end up with it as others before me.

3

Re: OS X 3w file temperature modifier App

Working good in OSX 10.12.3. Thanksss!

4

Re: OS X 3w file temperature modifier App

fonsinho wrote:

Working good in OSX 10.12.3. Thanksss!

I very glad you've found it usefull.
You're very welcome.

Regards!

XYZ Junior/Mini Passwords Thread
If you are in a hurry and need your password NOW, or if it takes me too long for you, you can read the posts from 1851. I'm not going to be as effective as Bozo or Cgrillo, but you can give a try with me. If PASSWORDS thread follow it's current flow: asking for repeated passwords, not returning or false PACKS... I will end up with it as others before me.