Hello Guest it is April 19, 2024, 11:23:39 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 - iceblu3710

Pages: 1 2 3 »
1
VB and the development of wizards / Re: Detecting Button Presses
« on: May 10, 2010, 09:56:05 PM »
Hey,

Thanks for the interest. The project took a few different turns and is now a visual c++ plugin. However I did get it working and it will detect any button presses globally.

Theirs now alot to the plugin, most of it is the keyhook initialization in the main config form.  I have not touched the file in many months, work sent me around town and back to school and I wont be able to take a crack at it again for a month or two more.

My goal was to add a feature to the keyhook library to consume keypresses and make a better config interface. Good luck!
http://www.4shared.com/file/bmJAjlgU/CustomPluginDLL.html?

2
So im playing with the Trajectory Planner and bloody hell its confusing how you access member variables... For example here is an encoder counter that is in both the Engine and in MAchPlanner:

Engine->Encoders[4].Count[0] = MPG1_Count;
MainPlanner->MPG.Encoders[4]->Count[0] = MPG1_Count;

What is the rhyme & reason for member addressing?

I know you access class/struct/union members directly (.) and access objects with pointers (->) but in the 2nd example how is there a pointer to Count when thats a member of the encoder structure?? Then in later compilers I need to use (::). Anyone care to explain to me this setup or have a good tutorial or web explanation on all this??

NOTE: BSOD = Funny memories

3
Bahaha I got sick of that hook library and used something else.

Here is a working project that detects key events globally and displays a msgbox with the key data. Put the compiled dll and KeyHook.dll in the plugins folder and check it out.

its a great little library, add the KeyHook.lib to your project and include KeyHook.h (very well documented) and away you go.


4
Hey,

I did a VS2008 test with the wizard and i can initialize now buy why on earth is the syntax so different? The documentation states things a bit oversimplified:

Code: [Select]
mouseHook = new MouseHook(); // mouseHook is a member variable

mouseHook.MouseEvent += new MouseHook.MouseEventHandler(mouseHook_MouseEvent);


private void mouseHook_MouseEvent(MouseEvents mEvent, int x, int y)
{
    string msg = string.Format("Mouse event: {0}: ({1},{2}).",
                                           mEvent.ToString(), x, y);
    AddText(msg); // Adds the message to the text box.

}

mouseHook.InstallHook();

mouseHook.UninstallHook();

and says its a pretty standard c++ implementation but its assumed you know how to add all the required files which I don't know how to do.

This is the project I I am basing all this off of

In VS2008 I did what I thought was right, added the Kennedy dll as a resource and with :: member referencing even auto complete works yet in VS2003 it wont. The example projects open in VS2003 without any problems and compile fine yet in VS2008 they need to be converted so its not like im using a compiler older than the examples.

5
Quote
I put this line.

Kennedy::ManagedHooks::KeyboardHook^ keyboardHook = gcnew Kennedy::ManagedHooks::KeyboardHook;

Compiled with no errors

Where did you put that line?? I have tried it in my form initilization, as well as my postinit and customplugininit.cpp header and be it using ::/./-> referencing the compiler does not acknowledge Kennedy as a valad class or namespace at all.

Could you put the line in my project and see if it compile then send the project back? Maybe it works with 2008 but not 2003 but that would suck...

What I don't understand is why in my hook example app does my object work with direct (.) member access and not work in my plugins. I included the Kennedy.ManagedHooks.dll in the same with with both projects and the compile time options are the same (Besides my plugin being a dll that is)

6
Thanks for the response.

I was using VS 2008 myself but I was running into unicode compatibility issues, the same project 2008 would not compile works perfectly in 2003. I followed jemmyell's 'Mach3 Plugin Tutorial Document and Prototype File Set' and had no issues at all besides needing to add the off include to resolve a dependency. My customplugin is a perfect working version of that tutorial that I tried to add the hooks dll to.

I see in your object browser you can actually view the function blocks, in my other projects by adding them to the references they add to the object browser but I have had to manually add system,design,forms,hooks to the object browser manually. This might be normal but usually its automatic for me.

Can you offer any insight to why my null assignments don't work or to why I cannot create a text box?

Also since you can add the dll easily have you been able to initialize the hook object successfully by chance?? (the block of code in pic two)

7
Im trying to integrate my keyboard hook program into a form in my mach 3 plugin.

I have included my project (created as 'CustomPlugin' and compiles and works great) as well as my stand alone KeyboardHook project that also works by itself

Here are my questions:
1) To use my keyboard hook it should be as simple as adding the Kennedy.ManagedHooks.dll to the references and then initilize the component as:
Code: [Select]
private Kennedy.ManagedHooks.KeyboardHook keyboardHook = null;
keyboardHook = new Kennedy.ManagedHooks.KeyboardHook();
keyboardHook.KeyboardEvent += new Kennedy.ManagedHooks.KeyboardHook.KeyboardEventHandler(Hook_KeyboardEvent);

then call install in a button:
Code: [Select]
void CPluginTestDlg::OnBnClickedHookInstall()
{
//  Install Keyboard Hook
DbgMsg(("keyboardHook Installed"));

//keyboardHook.InstallHook();
}

void CPluginTestDlg::OnBnClickedHookRemove()
{
//  Remove Keyboard Hook
DbgMsg(("keyboardHook Removed"));

//keyboardHook.UninstallHook();
//keyboardHook = NULL;
}

But I have no idea where to initialize my object! I have tried it in my CustomPluginInit.cpp's header, in myPostInitControl() and all no luck compiler throws errors. Where should I initialize this object?

2) General issue I don't understand. If I use project wizard and make a blank document then add a forum I can add things like textboxes. In my plugin project I cannot add test boxes.

3) General issue is that for some reason in all my other project having variable = null; is correct, 'null' is blued as normal but in my plugin project compuler says 'null' is not defined but I can use 'NULL' and the error clears but NULL does not blue.

Anyone know if I have some random setting messed up that is causing my issues?

Thanks!

8
Mach SDK plugin questions and answers. / Re: Plugin Function Polling Speed
« on: December 29, 2009, 12:06:44 AM »
Ok I think I will just stick with the SDK examples and the wizard for now as the "Universal" profile will compile but I get over 120 of errors about this:

Code: [Select]
1>c:\mach3\plugins\universalblank\resource.h(62) : warning C4005: 'IDC_FIRMWARE' : macro redefinition
1>        c:\mach3\plugins\machincludes\resource.h(1147) : see previous definition of 'IDC_FIRMWARE'
1>c:\mach3\plugins\universalblank\resource.h(63) : warning C4005: 'IDC_BOARDID' : macro redefinition
1>        c:\mach3\plugins\machincludes\resource.h(933) : see previous definition of 'IDC_BOARDID'
1>c:\mach3\plugins\universalblank\resource.h(65) : warning C4005: 'IDC_MAVG' : macro redefinition
1>        c:\mach3\plugins\machincludes\resource.h(903) : see previous definition of 'IDC_MAVG'
1>c:\mach3\plugins\universalblank\resource.h(145) : warning C4005: 'IDC_STATUS' : macro redefinition
1>        c:\mach3\plugins\machincludes\resource.h(126) : see previous definition of 'IDC_STATUS'


I am an embedded c programmer for micro controllers and am not accustomed to the plethora of compile time options visual studio has available. Also this SDK being written primary in C++ and defiantly multi threaded its way over my head. The structures and things I have seen don't even make sence to me... I have a long way to go. For example I tried to add a forum for the dialog box to your "Universal" template and I got more errors than I even cared to look at. Visual Basic is mind numbingly easy as it handles everything for you, c is so simplistic its easy to follow when one thread is going at a time and I have a main() function to center around.

One thing to help me understand how this plugin structure works is to get access to machs internal engine variables. In the mach3_sdk.wmv at 10:30 into the video on debug he talks about all the variables and how you can setup the velocity and max acceleration and such but I don't see anything. Usually all I get is a mach crash and dissembler view. I have mach3 set as the debugger but how do I get to see its variables?

Other than that anyone recommend a good thread or tutorial or something on how to actually add something like forums to the projects?

9
Mach SDK plugin questions and answers. / Plugin Function Polling Speed
« on: December 27, 2009, 12:38:33 AM »
I have been trying to write a controller app for my keyboard encoder project and am considering move it into a plugin as the Cypress Enable language is to limited for my needs and using Visual Basic in an outside app works but provided stuttered movement. So I am going to test out the plugins capabilities and see where this takes me. My question is:

I saw in the code and videos that the Update() routine is called ~10 times a second and Art's explanation on setting the engine dir/vel/accel parameters and then jog = true was very helpfull but alot of movement can happen in a 100ms period I would think.

Is this internal 10Hz call cycle the fastest any given plugin will ever be able to run? I inquire as if I spin my encoder any faster that that It will loose steps and it causes many issues for me. (eg 100 ppr encoder, quadrature decoded is 400 ppr, 1 second rotation I want my jog function to be updated every 2.5ms)

What am I missing here?

EDIT:

Also I want to load up the JoyStickPlugIn from the SDK examples download but I get errors about wrong defs and need ; before things that are obviously right. How do you guys recommend setting up my environment and placing my projects so its easiest to code?

I copied the JoyStickPlugIn folder to C:\Mach3\PlugIns and setup in the linker ../JoyPlugin.dll and in debugger run C:\Mach3\Mach3.exe in the runtime folder C:\Mach3\ just as in arts video. Do I need to setup includes to wherever mach has its includes hidden? I have installed Mach3Wizard and its default projects will build without error.

10
VB and the development of wizards / Re: Detecting Button Presses
« on: December 26, 2009, 05:03:52 PM »
Ok so I have discovered that macros are VERY SLOW and do not facilitate handling the input from an MPG. When I spun my encoder fast enough it would either miss steps or skit just enough to think it was going the other way. I have watched the Brains tutorial videos but do not find the system intutive AT ALL and the fact that I cant go back a few rungs and add something means I have re-written my program several times and none of them worked anyways.

I also dislike the fact that brains do not have the ability to have buttons as inputs. I assume you just assign a button to toggle an led then use the led to trigger the brains but how do you toggle an led with a button? The only way I know is via a macro and then its back to being slow again...

Is this the only way to get a button press into the brains or is their something I am missing??

Pages: 1 2 3 »