Hello Guest it is June 03, 2024, 06:43:48 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - TomHubin

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 »
31
Mach SDK plugin questions and answers. / Posting Open Source Code
« on: May 02, 2009, 05:18:58 PM »
Hello,

I would like to post my c++ source code for my 3d video probe plugin. What do I need to include with my source files?

Tom Hubin
thubin@earthlink.net

32
I suspect it must vary or something, I tried your code in mine, by calling the cleanup from my notivy, and it crashed mach....

so, back to the drawing board..........

scott

Hello Scott,

What msg is myNotify() getting when Mach3 is shutting down?

If the plugin is enabled then Mach3 will call also myCleanUp(). So if you have already cleaned up with myNotfiy() then you need to be sure that myCleanUp() does not cleanup again. I set a flag to true when I create the plugin dialog box. When myCleanUp() cleans up it first tests this flag to see if there is something to clean up. If so, then it does the cleanup job then clears this flag.

Tom

33
Well Spoke with Brian today.

  Here is the deal:  I had asked if he knew of a "Message" or "ID" that we could get that if a user changed the Green Check to a Red X under the plugin config that we could grab that message notification and use it to shut down our Modless window dialogs.

He said at this time there is no message in Mach3 for us to use.

BUT!!!  He said in version 4.0 he will add a Message for that so we can close our modless dialogs under the above user choices.!!!!

scott

Hello Scott,

Personally, I would rather see myCleanUp() called whenever Mach3 shuts down. As I understand it, that is the purpose of myCleanUp().

In the meantime, there may not be a reliable way to do this since James gets 0x12000e and I get 0xe when Mach3 shuts down. Here is my latest version of myNotify that shows the sizeof(msg) to be 4 bytes, as James suggested, and the value I receive as 0x0e or decimal 14.

I wonder what these values are supposed to mean? I wonder if there is a different bit for each plugin?

void myNotify ( int msg )
{
    DbgMsg(("CustomPluginImpl myNotify entry"));

    char tmp[81] ;
    sprintf ( tmp, "sizeof(msg)=%i    msg=0x%x", sizeof(msg), msg ) ;
    DbgMsg((tmp));

    if ( msg == 0xe )
    {
        DbgMsg(("Destroy Scan3d dialog box here"));
        myCleanUp() ;
    }

    DbgMsg(("CustomPluginImpl myNotify exit"));
}   

34
Hello,

My plugin (http://www.machsupport.com/forum/index.php/topic,10958.0.html) uses a wide modeless dialog box which is sometimes being clipped on the right end.

If the screen horizontal resolution is less than about 1000 pixels the dialog box does not fit on the screen. In that case the right end is cropped at the right edge of the screen. Dragging the dialog box to the left does not expose the right end of the dialog box. Resizing can make the dialog box smaller but not larger.

How can I get the right end of my wide modeless dialog box to display on a low resolution screen?

Tom Hubin
thubin@earthlink.net

35
Yes, I use the shutdown notification which SHOULD be 0x12000e to circumvent this issue.  I hope Brian / Art didn't change this.  It was undocumented though...

-James


Hello James,

I am using Mach3 demo version 3.039. The only messages going to myNotify(int msg) are values of 7 and 14 (0x000e). I am testing for 14 then calling myCleanUp() to shut down the plugin modeless dialog box.

void myNotify ( int msg )
{
    DbgMsg(("CustomPluginImpl myNotify entry"));

    char tmp[81] ;
    sprintf ( tmp, "msg=%i", msg ) ;
    DbgMsg((tmp));

    if ( msg == 14 )
    {
        DbgMsg(("Destroy Scan3d dialog box here"));
        myCleanUp() ;
    }

    DbgMsg(("CustomPluginImpl myNotify exit"));
}

Frankly, I don't see how you can use 0x12000e since that is a 24 bit number. How can you ever get that as a 16 bit int value coming in to myNotify(int msg)?

Tom Hubin
thubin@earthlink.net

36
Hello,

I am having trouble with myCleanup(). It does not get executed if the plugin is disabled. This presents me with the problem  of how to cleanup after a plugin has been used and it is disabled just before shutting down Mach3.

I searched around and found some discussion about using myNotify(int msg) to cleanup. One discussion in particular looks for msg=0x12000e (or something like that). When I shutdown Mach3 I get msg=14 so am inclined to use that value to initiate cleanup.

What method do you recommend for cleanup when myCleanup() does not execute?

Tom Hubin
thubin@earthlink.net

37
Finished Plugins for Download / Re: 3d Video Probe
« on: April 01, 2009, 11:54:48 PM »
how do you get it working? i tried and can not even start it, can you explain steps to load it so we can try it and a screen capture?

Hello Joe,

Download the file Scan3d.zip to the Mach3/Plugins/ directory. Unzip to get Scan3d.dll. The zip file can then be deleted. Mach3 will find the file in this directory.

Start Mach3. Go to the top menu and choose Config/Config Plugins. The Scan3d plugin should be on this menu. Enable the Scan3d plugin then restart Mach3 and come back to this point. Click on CONFIG to start the plugin.

I apologize for this unconventional way to start the Scan3d plugin. I have not figured out how to get it to show up in the Plugin Control menu.

Tom Hubin
thubin@earthlink.net

38
Video P*r*o*b*i*n*g / Re: New 3d Video Probe
« on: March 26, 2009, 01:22:12 PM »
Hello Charlie,

> I downloaded the plug in and running it with a Logitech Pro 9000  I am very
> impressed with the resolution and sensitivity.

Experiment with the Format and Source buttons to change the camera setup. The display images show as 320x240 resolution but the calculations are done with whatever resolution the camera is set for.

Experiment with image rotation and mirror. Rotation of zero, 90 CW, 90 CCW, and 180 degrees covers the 4 most likely ways to mount a camera. Mirror is only needed if there is an odd number of reflections in the mirror path. Most likely you will have no mirrors in the camera path so leave the mirror option unchecked.

Rotation of 180 degrees is needed if the camera is mounted upside down like my Watchport/V2 is.

You can experiment with scanning the three axes but the output into the file Scan3d.xyz will be strange until you calibrate. Ii have to leave shortly so will try to write about calibration tonight.

Tom Hubin
thubin@earthlink.net
Tom Hubin
thubin@earthlink.net 

39
Video P*r*o*b*i*n*g / New 3d Video Probe
« on: March 23, 2009, 11:47:05 PM »
I have posted my first 3d Video Probe plugin. Calling it Scan3d.dll. No documentation yet. Iit should show the camera view.

http://www.machsupport.com/forum/index.php/topic,10958.new.html#new

Tom Hubin
thubin@earthlink.net

40
Finished Plugins for Download / 3d Video Probe
« on: March 23, 2009, 11:40:31 PM »
Hello,

Here is my first release of a plugin for 3d Video Probing.

File is called Scan3d.dll. Download to the Mach Plugins directory.

James Leonard's tutorial on writing Mach plugins was very helpful.

Start the plugin with Config. I don't know how to program it to start from the Plugins pulldown menu.

No documentation yet but you can plugin a webcam and see if there is video in the plugin. I have tested with Watchport/V, Watchport/V2 and Eyetoy (silver package). Watchport/V is older camera, doies not use compression, and seems to work ok if machine is fast but does not work well on the 800MHz desktop and the 800MHz laptop that I have tested. Watchport/V2 and Eyetoy use compression but seem to work ok on all the machines that I have gotten access to, whether compression is enabled or not.

Meantime, I will work on documentation.

Tom Hubin
thubin@earthlink.net   

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 »