Unit Converter

Discuss the creation and usage of Wizards

Unit Converter

Postby Dan911 » Thu Sep 27, 2018 1:06 am

This plugin/Wizard will convert a Gcode file loaded in UCCNC from mm to inches or inches to mm.

Some new features were added by request, suggestions, and help from Vmax549....

Scaling - Will scale gcode file size smaller or larger by inputted scale factor.
Add Line numbering.

Using Scaling has no change to Z axis only X and Y. All UCCNC Gcode variables will remain the same unless G2 or G3, R for radius will be scaled to scale factor input. If I'm missing any other Gcode variables please let me know.

To use this wizard you need to create a button with button # 55555 or create a hot key with function # 55555 or use Multiple Macro button plugin that could be found in the Tool Box with instructions.

This plugin will NOT edit or make any changes to original Gcode file

There's a help button on interface with instructions how to use.

The attachment UC5.JPG is no longer available



UC5.JPG


Dan
Dan911
 
Posts: 468
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Unit Converter

Postby Dan911 » Sun Sep 30, 2018 2:17 pm

Fixes....
Added all UCCNC Gcode variables.
Fixed variables that needed scaling using Scale conversion.
Fixed unhandled exception when Test Scale pressed and no Gcode file open.


Unit Converter6.zip
Dan911
 
Posts: 468
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Unit Converter

Postby Vmax549 » Sun Sep 30, 2018 7:23 pm

# vars are a special breed of programing. I am not sure I would include then in a scaling function as not all #vars are axial position values. To me it might be best to abort the function IF the Gcode included # vars. OR at least give an option to scale #vars or not. Only the USER would really know if it were safe to do so.

The same problem exists with G50/51.

Also you may want to consider and option for 2d applications where Z is not a scaleable value. For instance Plasma where you only scale XY. And of course ABC should never be scaled as a rotary axis.

Also just a note but teh Plugin has a FIT under Vista. It will lock up UCCNC when it goes to write to file. The only way out is to crash out and that closes UCCNC. It works fine with other OS such as XP so I would not spend any time on it just for Vista. It is probably an exception that Vista throws that is unhandled by teh plugin. Vista has a strange sense of humor about file operations.

Just a thought, (;-) TP
Vmax549
 
Posts: 1379
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: Unit Converter

Postby Dan911 » Sun Sep 30, 2018 10:39 pm

Vista seems very quirky and It's something I wouldn't attempt to address because most likely would need to be addressed on users end. Tested on WinXP 32 bit Win8.1 and Win10 64 bit without a glitch.

"G" code parameter will be written as is.
On mm and inch conversions Parameters X, Y, Z, I, J, K, F, R, Q, will be converted to chosen mm or inch conversion. Parameters M, S, P, T, H, L, will be written as is.

On Scale Factor conversion only Parameters X, Y, I, J, K will be converted to scale. R if on a G2 or G3 line. Rest will remain as original file.

Tested on Gcode generated from Alphacam, Aspire, Cambam 2D files. Worked well. Any suggestions for improvement or further development I'm always happy to oblige.

As always thanks for your input and help,
Dan
Dan911
 
Posts: 468
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Unit Converter

Postby Vmax549 » Mon Oct 01, 2018 2:20 am

OK when you said parameters I thought #var sorry. :oops:

(;-) TP
Vmax549
 
Posts: 1379
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: Unit Converter

Postby Dan911 » Sat Nov 03, 2018 2:35 am

I recently learned this plugin had problems in the newer test release versions so I fixed, Thanks Dezsoe!

I received a few request in the past if it was possible to give a specific size to scale to so I went ahead and updated to that also. Now how the scaling works is to give a size in X or Y and will scale the other in loaded g-code file in proportion. I updated help file also.

Instruction are the same, create a button or hotkey with #55555 or use the multiple button macro that could be found in toolbox.

The attachment Capture.JPG is no longer available


Capture.JPG
Dan911
 
Posts: 468
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Unit Converter

Postby Dan911 » Sat Nov 03, 2018 10:31 am

Unit Converter7.rar.zip
(9.63 KiB) Downloaded 11 times
Dan911
 
Posts: 468
Joined: Mon Oct 31, 2016 1:22 am
Location: USA


Return to Conversational Wizards

Who is online

Users browsing this forum: No registered users and 1 guest