Hello Guest it is October 15, 2019, 08:37:18 PM

Author Topic: Mach3 Plugin Tutorial Document and Prototype File Set  (Read 106038 times)

0 Members and 1 Guest are viewing this topic.

Re: Mach3 Plugin Tutorial Document and Prototype File Set
« Reply #60 on: January 01, 2009, 11:17:23 AM »
Hello James,

> You can use DirectX or Video For Windows.

I found AMCap and PlayCap video capture source files in DirectX 9.0. I have started a new thread called simply "Video" with instructions for downloading, unzipping, and installing DirectX 9.0.

 I am having trouble figuring out how to use AMCap source as a model for a video based plugin like a video probe.

Can you take a look. Perhaps enhance your tutorial to include video preview and access to a single video frame on demand? Or perhaps modify AMCap just enough that it can run as a standalone and provide a single video frame chunk of memory to a Mach plugin on demand. 

Tom Hubin
thubin@earthlink.net

Hi Tom,
I have visitors in the house, but starting tomorrow it's back to the grind.  I will be happy to have a look and see what we can do.  I intend to make a video setup plugin, so this will be useful work to do.

-James
Re: Mach3 Plugin Tutorial Document and Prototype File Set
« Reply #61 on: January 09, 2009, 04:59:23 AM »
Hello James,

> I intend to make a video setup plugin

Have you made any progress with making a MACH video plugin using AMCAP or other free video methods?

Will you be attending Cabin Fever?

Tom Hubin
thubin@earthlink.net
Re: Mach3 Plugin Tutorial Document and Prototype File Set
« Reply #62 on: January 09, 2009, 07:25:12 AM »
Hello James,

Re: GUID

Your tutorial sent me to a separate program for assigning a GUID.

I notice that the compiler has "Create GUID" as a menu item under tools. This seems to accomplish the same thing. Wouldn't this be more convenient?

Is the GUID truly unique? If so, how is it guaranteed that a GUID created on your computer is different than a GUID created on my computer. Does it include a unique identifier for each computer?

Tom Hubin
thubin@earthlink.net
Re: Mach3 Plugin Tutorial Document and Prototype File Set
« Reply #63 on: January 09, 2009, 11:51:57 AM »
Hello James,

Re: GUID

Your tutorial sent me to a separate program for assigning a GUID.

I notice that the compiler has "Create GUID" as a menu item under tools. This seems to accomplish the same thing. Wouldn't this be more convenient?

Is the GUID truly unique? If so, how is it guaranteed that a GUID created on your computer is different than a GUID created on my computer. Does it include a unique identifier for each computer?

Tom Hubin
thubin@earthlink.net

Hi Tom,

I was unable to get the capture device (webcam) installed on my desktop so I had to wait until my new development laptop (old one died) arrived.  It is almost reinstalled now and has a built-in webcam so I should be able to look at this soon.

A GUID is indeed globally unique.  Hardware info from the platform is used to insure that another guid generated at the EXACT same time will not be identical.  I have always used GUIDGEN for new COM interfaces so I just chose that.

-James
Re: Mach3 Plugin Tutorial Document and Prototype File Set
« Reply #64 on: January 09, 2009, 05:42:23 PM »
Hello James,

If all goes according to plan I will be doing a presentation on my 3d Video Probe at Cabin Fever on Saturday afternoon and attending the Sunday seminar to learn what I can about writing plugins.
 
Will you be attending Cabin Fever?

Tom Hubin
thubin@earthlink.net
Re: Mach3 Plugin Tutorial Document and Prototype File Set
« Reply #65 on: January 09, 2009, 06:20:11 PM »
Hi Tom,

No, I don't have the resources for events like this currently.

Good luck on your presentation and on the seminar.

-James
Re: Mach3 Plugin Tutorial Document and Prototype File Set
« Reply #66 on: February 01, 2009, 07:02:51 AM »
Hello,

I am not accustomed to working with a resource editor. It seems convenient for paste up but I don't how to get window handles for the controls so I can modify them. I have a unique ID for each control but have not found a function that will return the window handle unless I provide the parent window's handle too. And, of course, I don't have that handle either.

So, how do I get a handle on this catch 22?

Tom Hubin
thubin@earthlink.net

Re: Mach3 Plugin Tutorial Document and Prototype File Set
« Reply #67 on: February 01, 2009, 11:44:24 AM »
Hi Tom,

Here are some codeproject articles.  There is a LOT more in the section that I got these from.

MFC based dialogs in an EXE (application)

http://www.codeproject.com/KB/dialog/dialogapptute.aspx

MFC modeless dialogs

http://www.codeproject.com/KB/dialog/gettingmodeless.aspx

MFC Forum FAQ - A wealth of knowledge is here

http://www.codeproject.com/KB/cpp/cppforumfaq.aspx

In general, to get the window handles, you cache them when the dialog is created.  Use a class member variable or a simple global variable.

To get the control window handles use GetDlgItem() which requires that you know the control ID and the Dialog window handle.

http://msdn.microsoft.com/en-us/library/ms645481(VS.85).aspx

MFC Dialogs wrap this process with UpdateData()

Ok, that is a LOT of reading!  What you need to do is become grounded in windows programming and MFC in particular probably.

-James

Re: Mach3 Plugin Tutorial Document and Prototype File Set
« Reply #68 on: February 09, 2009, 11:32:40 PM »
Hello,

With all the help from this group I have made a lot of progress. But I am stuck in a few details.

I was updating the video with the 10 Hz entry of myUpdate(). I do not know why but that no longer works. It appears that myUpdate() and myHighSpeedUpdate() are not being called. I have had several crashes so may have trashed some part of Mach3. I uninstalled Mach3 and reinstalled it. No help there.

First, I need some tips on what might fix this.

Second, I need to know how to add a 100ms timer to a dialog box.

Tom Hubin
thubin@earthlink.net
 

Offline poppabear

*
  • *
  •  2,233 2,233
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Mach3 Plugin Tutorial Document and Prototype File Set
« Reply #69 on: February 10, 2009, 06:49:56 AM »
Tom,

    you might want to open up another vs2003 window, and open up a freash plug in template, and just copy over your code section to section, and see if that clears it up, in case something got corrupted. If not, then something in your code, in your update loop is crashing mach, if you have any type of While..... type stuff that will usually do it.

Timers:

A poor mans way of doing it, is since it will scan at 1/10th of second, set up a "Scan" time variable. And a counter variable. you can write what ever value you want from your dialog box to your Scan var, and increment your counter var by 1 in what ever function your needing to time. resolution would be at 0.1 seconds

so a value of 10 as your scan compare would give you 100 ms.

scott
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/