Activex Wrapper For Csafe
Hi,<br>I've just taken delivery of my C2 + PM3 and am delighted with it. As a software developer I've also had a look at the API documentation with a view to playing with that. The first step I was going to take was to wrap the CSAFE functionality into an ActiveX component to make it easier to use from scripting languages or Visual Basic. Has anyone else tried this or are there existing solutions?<br><br>Regards<br>Chris<br>
Well, since I was a little bored at work I had a quick play with the API. So far I've wrapped the DDI calls with a _stdcall (_pascal for the oldies) version so that they can be called from native VB app. I've then been able to call the API from VB and determine that there are no PM3s attached to my work PC which didn't shock me in the slightest. Next step is to do some development at home or hide a PM3 under my desk so that I can do some clandestine work on it . I'm thinking that I'll turn the enumerated set of PM3s into a COM collection so that CSAFE calls can be made against any PM3 in the group.<br><br>One small observation:<br><br>tkcmdsetDDI_shutdown is shown as taking a port number in the docs and .h but in the sample code is a void.<br><br>Regards<br><br>Chris
-
- Posts: 0
- Joined: March 18th, 2006, 10:32 pm
Bubble,<br>thanks for the encouragement, I'll keep plugging away.<br>The first test app I've got planned will let you choose a photo and then pixellate it very coarsely and as you progress through your workout it will gradually sharpen up. This is loosely inspired by a round on a UK sports quiz program. No doubt other more practical uses will come to mind but I like cheap graphicy gimmicks.<br><br>Regards<br><br>Chris
-
- Posts: 0
- Joined: March 18th, 2006, 10:32 pm
<!--QuoteBegin-Daren C+Oct 22 2004, 09:19 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td class='genmed'><span class='genmed'><b>QUOTE</b></span> (Daren C @ Oct 22 2004, 09:19 AM)</td></tr><tr><td class='quote'><!--QuoteEBegin--> No doubt some wag will take it one step further - a sequence of images of some nice girl who undresses as you progress through your row. <br><br>It could be timed so that one piece of clothing always remained - unless the rower scored a PB time. =) <!--QuoteEnd--> </td></tr></table><br> Now your talking sense
Actually I think my wife would row harder if it put my clothes back on, but then that's why we bought the rower.<br><br>A progress update if anyone's interested:<br><br>I now have a set of VB classes that can enumerate rowers and issues commands to them through a generic array based function. I've just got an app running that moves a progress bar across the screen as you build up your distance. Getting VB safe versions of the DDI and CSAFE APis has been a bit of a pain with numerous GPFs but I'm there now. All it remains to do is turn the generic API into more meaningful and paramaterised versions i.e<br><br>nDistanceToGo = PMs(0).GetDistanceToGo()<br> rather than the obscure syntax that it is now.<br><br>Can't promise too much more in the short term as its late on Friday night and weekend will be busy (2 children to entertain).<br><br>Does any one know what the procedure is to post binaries to the forum so that I can pass this on ?<br><br>Cheers<br><br>Chris<br>
-
- Posts: 0
- Joined: March 18th, 2006, 10:32 pm
Hello,<br>Well it looks worth a posting now.<br><br>A snippet of code is below, it seems easy to use to me.<br><br>There's a top level class 'cPM3Interface', call Initialise and EnumeratePM3s and that populates a PM3s collection under the main class. Due to excessive poverty I've not checked that it works with >1 rower. Then you can call commands on each PM3. I've only really tried the 'Get' style functions and they seem to match up with what's on the PM3 display. I now want to do some work on working out what some of the 'states' mean, for instance GetStrokestate returns a value 1 to 4 and I'd rather it return an enumeration (eCatch, ePull . . . whatever) but that's going to take some more work. I'll take Bubble's suggestion (thanks) and e-mail Scott to see about posting some binaries if anyone wants to try them<br>Good night<br>Chris<br><br>Dim xx As New cPM3Interface<br>Dim CurrentPM As cPM3<br><br>xx.Initialise<br>xx.EnumeratePM3s<br>Set CurrentPM = xx.PM3s(1)<br>Debug.Print CurrentPM.GetWorktime<br>Debug.Print CurrentPM.GetWorkdistance<br>Debug.Print CurrentPM.GetStrokeRate<br>Debug.Print CurrentPM.GetTotalAvg500mpace<br>Debug.Print CurrentPM.GetStroke500mpace<br>Debug.Print CurrentPM.GetStrokestate<br>
Chris:<br><br>If you wish to post source that YOU have written as part of a message, that's ok for now (until our attorneys tell me that it's a bad idea..., you know, possible copyright issues, etc.), but binarys are another thing. I think the best option would be to open a project on sourceforge or similar site, or make yourself a web site and post the link to it here.<br><br>-- Scott<br>
Scott,<br>Hi, on the face of it, it seems better all round if I host any stuff external to C2 to avoid any trouble. I've had offers from other to host (thanks) or I could use some personal web space. SourceForge is a good thought - I've never set up a project there before so could be a nice learning experience.<br>With regards to the PM3 CSAFE and DDI dlls would you rather that people who wanted to use my code downloaded these through yourselves or should I host a copy of them with my code. I'm easy either way, whatever suits you best.<br><br>regards<br><br>Chris<br><br>
-
- Posts: 0
- Joined: March 18th, 2006, 10:32 pm
Hello again,<br><br>at first I wish to all'ya a happy new year.<br>I've upload a first version of an ActiveX Control that can communicate with the PM3.<br><br>URL:<br><a href='http://www.wstudios.de/PM3ConX.zip' target='_blank'>http://www.wstudios.de/PM3ConX.zip</a><br>It's not tested. So please help me to make it stable. You can inform me at this email: toni@wenzel-frank.de<br><br>I hope this control is helpful.<br><br>~Toni