M130 UccncMediaViewer

Here is where you can drop off Examples of WORKING macros,plugins,Gcode programs , macro Wizards etc.
Please give a brief description of what it is and how it works.

M130 UccncMediaViewer

Postby Vmax549 » Fri Sep 14, 2018 12:43 am

UPDATED::

I went head and updated this macro to include other graphics formats as Robert suggested AND also included displaying HTM/HTML format documents such as Vetric uses for Job summaries.

*************************************************************************************************************************************************



THis is a macro that emulates the Haas G130 media viewer gcode.It can process a text file ( SampleFile.txt) or a Bitmapped file as a JPG format ( SampleFile.jpg) or a Video File as a WMV format (SampleFile.wmv). It will ONLY recognize txt, jpg or wmv file formats.

It will ONLY work if used in a Gcode program file. It will NOT work from MDI.

You store teh media file in a folder under UCCNC/Media so you will need to create that folder and store your files there.

When using you call teh M130 macro then specify teh file name in brackets. Then add a M01 on teh next gcode line.

G0 X0 Y0 Z0
M130(samplefile.txt) << will call up the samplefile.txt document in a Window
M01
G0 X10 Y10
etc

When you are done veiwing teh doc then close down teh window and it will go into M01 hold where you will need to push cycle start to continue teh program.

G0 X0 Y0 Z0
M130(samplefile.jpg) will call up a bitmapped file in a window
M01
G0 X10 Y10
etc

G0 X0 Y0 Z0
M130(samplefile.wmv) will call up a video file veiwed from windows media player
M01
X10 Y10
etc

IF you call a file that does not exist you get a warning then it proceeds to teh M01 and allows you to proceed or Stop teh program run.

Play with it and see what you think.

It really should be done as an internal Gcode BUT ??? it is what it is :mrgreen:

(;-) TP
Attachments
M130.txt
(3.36 KiB) Downloaded 14 times
Vmax549
 
Posts: 1201
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: M130 UccncMediaViewer

Postby Robertspark » Fri Sep 14, 2018 8:31 am

I think {not sure, not tried it} it may be possible to change:

Code: Select all
if(result == "jpg")
{....


to

Code: Select all
if(result == "jpg" || result == "bmp" || result == "gif" || result == "png" || result == "tiff" || result == "wmf" )
{...


given the system drawing namespace can open / display a number of image formats and is not just limited to jpeg
https://docs.microsoft.com/en-us/dotnet ... work-4.7.2

I personally like png as the file size is so much smaller and therefore can load quicker from my experience.

each to their own.

Good work terry,
Rob
Einstein ― “If you can't explain it to a six year old, you don't understand it yourself”
...working my way through the 1000+ ways things don't work to find the one that does
UC400eth, UC300eth, UCCNC v1.2106, Neuron Lite
UCCNC v1.2105 Macro Manual
Robertspark
 
Posts: 898
Joined: Sat Sep 03, 2016 4:27 pm
Location: Nr Liverpool, England

Re: M130 UccncMediaViewer

Postby Dan911 » Fri Sep 14, 2018 9:00 am

Hey Terry this was done already, you replied in the thread. I also showed an example how to use the .html file Vectric software outputs.

viewtopic.php?f=13&t=1183&p=8928#p8928
Dan911
 
Posts: 394
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: M130 UccncMediaViewer

Postby Vmax549 » Fri Sep 14, 2018 12:06 pm

Hi Dan,
Process.Start(path) was throwing up errors when trying to run a Video file that way. Also this way teh text file and graphics file are shown in a window and do not depend on it bringing up a text editor or a graphics editor to display the files. Also there was not any error checking IF the file was not found and HOW to handle it if it was not found.

Hi Robert YES you could ;). Just trying to keep it simple.

Just another way of doing it, (;-) TP
Vmax549
 
Posts: 1201
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: M130 UccncMediaViewer

Postby Dan911 » Sat Sep 15, 2018 1:36 am

Took a better look tonight and see you created a universal MediaVeiwer macro...Nice work. I only tested on the OP request for Fusion where the M130.png is automatically generated in Gcode.

To automatically generate with Vectric software adding this to the header of your post processor "[N] M130 ([TOOLPATH_NAME].html)" works and what I did, you just need to name the job summary the same as the generated toolpath.

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

Re: M130 UccncMediaViewer

Postby Vmax549 » Sat Sep 15, 2018 12:18 pm

Thanks for teh help DAN ;) Now IF you are looking for something to do :o Look into being able to add media player to a form as a macro, and look into writing teh HTML into a text box. That would enable teh macro to work with a LOT less resources than having to shell out to teh applications (MediaPlayer, Internext Explorer). I looked at it and it is way above my pay grade to make happen. It also may be easier to do it as a plugin.

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


Return to UCCNC TOOL BOX

Who is online

Users browsing this forum: No registered users and 1 guest