Sponsored links

Go Back   MP3Car.com > Mp3Car Technical > Software & Software Development > Front Ends > Road Runner > RR Plugins


Reply
 
Share Thread Tools Display Modes
Old 08-02-2008, 02:07 PM   #16
Wants to make it harder
 
monkeyracer's Avatar
 
Join Date: May 2007
Location: Lakehood, CO
Posts: 1,414
monkeyracer is an unknown quantity at this point
Quote: Originally Posted by Enforcer View Post
Please don't use AI.

ok
__________________
2007 Chrysler PT Cruiser TE
Car PC Progress:
Planning.......[---------X-] 95%
Parts...........[---------X-] 90%
Fabrication...[---------X-] 90%
RR Skin........[---------X-] 95%
View my
Worklog
Road Runner Skins
Website
Favorite thread EVER!
monkeyracer is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Old 08-03-2008, 10:12 AM   #17
Wants to make it harder
 
monkeyracer's Avatar
 
Join Date: May 2007
Location: Lakehood, CO
Posts: 1,414
monkeyracer is an unknown quantity at this point
Quote: Originally Posted by guino View Post
If you haven't done that yet, you should be able to export the class into a .tlb file using "regasm /codebase /tlb P2140API.dll" then load it up to use it with the extension plugin sources.. or you could simply edit their demo in C# and have it send commands to RR regularly to set variables with the desired values -- just suggestions of course.

ok, i've got the P2140API.dll exported to P2140API.tlb...

I've looked through the example plugin, and it looks like for all my labels, I would use this code:

Code:
'***************************************************************** '* This Function will be called with a requested label code and '* format specified at the skin file. Simply return any text to '* be displayed for the specified format. '***************************************************************** Public Function ReturnLabel(ByRef LBL As String, ByRef FMT As String) As String Select Case LCase(LBL) Case "mylabel" 'This example returns a "hello" text to show it works ReturnLabel = "Hello from Extension!" 'Specify whatever and whichever labels you wish to create 'You can add as many as you'd like, and you can process complex labels as long 'as you parse them yourself (i.e. "mycomplexlabel;parameter") 'Case "mycommand2" 'Insert Command code here End Select End Function


So first I have to reference the codes from the API, then send those codes as a label to RR with returnlabel right? How do I reference the API in the code?

so if I want to turn Batt_V (from P2140API) into psuBATT_V (in RR) the code might look something like this:

Code:
Public Function ReturnLabel(ByRef LBL As String, ByRef FMT As String) As String Select Case LCase(LBL) Case "psuBATT_V" ReturnLabel = $Batt_V End Select End Function

As long as I create the $Batt_V variable from the Batt_V command right?

Or, am I way off base?
__________________
2007 Chrysler PT Cruiser TE
Car PC Progress:
Planning.......[---------X-] 95%
Parts...........[---------X-] 90%
Fabrication...[---------X-] 90%
RR Skin........[---------X-] 95%
View my
Worklog
Road Runner Skins
Website
Favorite thread EVER!
monkeyracer is offline   Reply With Quote
Old 08-03-2008, 12:03 PM   #18
Confusion Master
 
Enforcer's Avatar
 
Join Date: Sep 2003
Location: If you go down to the woods today, You're sure of
Posts: 11,938
Enforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant future
Yep, you seem to have the idea.
Enforcer is offline   Reply With Quote
Old 08-03-2008, 02:39 PM   #19
Wants to make it harder
 
monkeyracer's Avatar
 
Join Date: May 2007
Location: Lakehood, CO
Posts: 1,414
monkeyracer is an unknown quantity at this point
Quote: Originally Posted by Enforcer View Post
Yep, you seem to have the idea.

Thanks, I feel like I might have a grasp on this, but then again, a fellow forum member had an idea about solar panels, it's all about the practice though. If I can't practice the idea, it means nothing.

I think I can get it, but how do I reference the P2140API.dll in the code so that the variables actually work?
__________________
2007 Chrysler PT Cruiser TE
Car PC Progress:
Planning.......[---------X-] 95%
Parts...........[---------X-] 90%
Fabrication...[---------X-] 90%
RR Skin........[---------X-] 95%
View my
Worklog
Road Runner Skins
Website
Favorite thread EVER!

Last edited by monkeyracer; 08-03-2008 at 02:48 PM.
monkeyracer is offline   Reply With Quote
Old 08-03-2008, 03:11 PM   #20
Confusion Master
 
Enforcer's Avatar
 
Join Date: Sep 2003
Location: If you go down to the woods today, You're sure of
Posts: 11,938
Enforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant future
Have you

1. registered te dll
2. added it in Project --> references

?
Enforcer is offline   Reply With Quote
Old 08-03-2008, 03:56 PM   #21
Wants to make it harder
 
monkeyracer's Avatar
 
Join Date: May 2007
Location: Lakehood, CO
Posts: 1,414
monkeyracer is an unknown quantity at this point
Quote: Originally Posted by Enforcer View Post
Have you

1. registered te dll
2. added it in Project --> references

?

1. can not find entry point... i think, I'll have to check again,
2. nope, will do...

thanks....
__________________
2007 Chrysler PT Cruiser TE
Car PC Progress:
Planning.......[---------X-] 95%
Parts...........[---------X-] 90%
Fabrication...[---------X-] 90%
RR Skin........[---------X-] 95%
View my
Worklog
Road Runner Skins
Website
Favorite thread EVER!
monkeyracer is offline   Reply With Quote
Old 08-03-2008, 07:54 PM   #22
Confusion Master
 
Enforcer's Avatar
 
Join Date: Sep 2003
Location: If you go down to the woods today, You're sure of
Posts: 11,938
Enforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant futureEnforcer has a brilliant future
Which VB are you doing this in, it looks like it needs VB .net as it requires .NET 2.0
Enforcer is offline   Reply With Quote
Old 08-03-2008, 08:29 PM   #23
Wants to make it harder
 
monkeyracer's Avatar
 
Join Date: May 2007
Location: Lakehood, CO
Posts: 1,414
monkeyracer is an unknown quantity at this point
I added the .dll as a resource, but it still couldn't find the entry point to register it...

I'm using the free Visual Basic 2008 Express Edition with the .net 3.5 framework...

Also, Visual C# 2008 Express Edition, since the API was done in c#.

------------------------------------------------------------

I think I've got the beginnings of the plugin started:

Code:
Option Strict Off Option Explicit On <System.Runtime.InteropServices.ProgId("RRExtension_NET.RRExtension")> Public Class RRExtension Public Function ReturnLabel(ByRef LBL As String, ByRef FMT As String) As String Select Case LCase(LBL) Case "psuBATT_V" ReturnLabel = "P2140.P2140Board.cbP2140.Batt_V" Case "psuBATT_C" ReturnLabel = "P2140.P2140Board.cbP2140.Batt_C" End Select End Function

So theoretically, if this were all I needed for codes, In RR, I could use this:

Code:
L01,20,429,101,33,#FRed#,#FGreen#,#FBlue#,20,"BankGothic Md BT","psuBATT_V","CENTER" L01,20,489,101,33,#FRed#,#FGreen#,#FBlue#,20,"BankGothic Md BT","psuBATT_C","CENTER"

with the "X,PSUmonitoRR" extension referenced in menu.skin

Right?

Is the
Code:
ReturnLabel = "P2140.P2140Board.cbP2140.Batt_C"

in the right syntax? or should it have a $ in front of the p2140? and with or without quotes?
Code:
ReturnLabel = "$P2140.P2140Board.cbP2140.Batt_C"

Sorry if that's a noob question, but I've so far had about 30 minutes of experience with VB and/or C# etc...
__________________
2007 Chrysler PT Cruiser TE
Car PC Progress:
Planning.......[---------X-] 95%
Parts...........[---------X-] 90%
Fabrication...[---------X-] 90%
RR Skin........[---------X-] 95%
View my
Worklog
Road Runner Skins
Website
Favorite thread EVER!
monkeyracer is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Old 08-05-2008, 09:33 AM   #24
RoadRunner Mastermind
 
guino's Avatar
 
Join Date: Nov 2004
Location: Vitória, ES - Brazil
Posts: 9,064
guino will become famous soon enoughguino will become famous soon enough
You're in the right track... I have never tried to make an extension plugin with VS2008, but it should be possible.

You don't have to add the DLL to the references of the project, instead, you add the TLB you made and it should give you access to the classes/objects of the DLL -- so you'll be able to create the objects defined in the class to read the data from the PSU.
__________________
Ride Runner RR's Myspace

"Being happy is not about having what you want, it's about wanting what you have."
"The best things in life are always free - but that doesn't mean money can't buy you good things."
guino is offline   Reply With Quote
Old 08-05-2008, 09:39 AM   #25
Terminal flasher
 
Sonicxtacy02's Avatar
 
Join Date: Sep 2004
Location: Woodbridge, VA
Posts: 6,307
Sonicxtacy02 has a spectacular aura aboutSonicxtacy02 has a spectacular aura about
Quote: Originally Posted by monkeyracer View Post
I added the .dll as a resource, but it still couldn't find the entry point to register it...

I'm using the free Visual Basic 2008 Express Edition with the .net 3.5 framework...

Also, Visual C# 2008 Express Edition, since the API was done in c#.

------------------------------------------------------------

I think I've got the beginnings of the plugin started:

Code:
Option Strict Off Option Explicit On <System.Runtime.InteropServices.ProgId("RRExtension_NET.RRExtension")> Public Class RRExtension Public Function ReturnLabel(ByRef LBL As String, ByRef FMT As String) As String Select Case LCase(LBL) Case "psuBATT_V" ReturnLabel = "P2140.P2140Board.cbP2140.Batt_V" Case "psuBATT_C" ReturnLabel = "P2140.P2140Board.cbP2140.Batt_C" End Select End Function

So theoretically, if this were all I needed for codes, In RR, I could use this:

Code:
L01,20,429,101,33,#FRed#,#FGreen#,#FBlue#,20,"BankGothic Md BT","psuBATT_V","CENTER" L01,20,489,101,33,#FRed#,#FGreen#,#FBlue#,20,"BankGothic Md BT","psuBATT_C","CENTER"

with the "X,PSUmonitoRR" extension referenced in menu.skin

Right?

Is the
Code:
ReturnLabel = "P2140.P2140Board.cbP2140.Batt_C"

in the right syntax? or should it have a $ in front of the p2140? and with or without quotes?
Code:
ReturnLabel = "$P2140.P2140Board.cbP2140.Batt_C"

Sorry if that's a noob question, but I've so far had about 30 minutes of experience with VB and/or C# etc...

shouldnt need the $, and definitely no quotes. Quotes are only used for strings not variables. That all looks like it should work aside from that. Test it. Run it in RR with debug=TRUE and see what error message if any you get. If you get the activeX message your .dll is not communicating with RR .. probably because of the issue we discussed (cant register COM in the free version). If u'd like i can send you a source of RRFusion done in VB2008 so u can see the proper formatting.. but it looks like u've got a good grasp of it all.
__________________
03 Acura RSX Coupe
Developer of: RRFusion, MovieTimes.NET, (new)RRMail, RRShoutcast, & RRVehicle Maintenance
Currently working on: RRVehicle Maintenance

Last edited by Sonicxtacy02; 08-05-2008 at 09:42 AM.
Sonicxtacy02 is offline   Reply With Quote
Old 08-05-2008, 09:59 AM   #26
Wants to make it harder
 
monkeyracer's Avatar
 
Join Date: May 2007
Location: Lakehood, CO
Posts: 1,414
monkeyracer is an unknown quantity at this point
Quote: Originally Posted by guino View Post
You don't have to add the DLL to the references of the project, instead, you add the TLB you made and it should give you access to the classes/objects of the DLL -- so you'll be able to create the objects defined in the class to read the data from the PSU.

When I try, I get the error:
Quote:
A reference to 'C:\P2140API.tlb' could not be added.

The ActiveX type library 'C:\P2140API.tlb' was exported from a .NET assembly and cannot be added as a reference.

Add a reference to the .NET assembly instead.

I added the .dll as a reference and it seems it reads it.

Quote: Originally Posted by Sonicxtacy02 View Post
shouldnt need the $, and definitely no quotes. Quotes are only used for strings not variables. That all looks like it should work aside from that. Test it. Run it in RR with debug=TRUE and see what error message if any you get. If you get the activeX message your .dll is not communicating with RR .. probably because of the issue we discussed (cant register COM in the free version). If u'd like i can send you a source of RRFusion done in VB2008 so u can see the proper formatting.. but it looks like u've got a good grasp of it all.

I tried it without the quotes, and it "squiggly-blue-underlined" the "P2140.P2140Board.cbP2140.Batt_V" meaning some syntax is missing.
__________________
2007 Chrysler PT Cruiser TE
Car PC Progress:
Planning.......[---------X-] 95%
Parts...........[---------X-] 90%
Fabrication...[---------X-] 90%
RR Skin........[---------X-] 95%
View my
Worklog
Road Runner Skins
Website
Favorite thread EVER!
monkeyracer is offline   Reply With Quote
Old 08-05-2008, 10:27 AM   #27
Terminal flasher
 
Sonicxtacy02's Avatar
 
Join Date: Sep 2004
Location: Woodbridge, VA
Posts: 6,307
Sonicxtacy02 has a spectacular aura aboutSonicxtacy02 has a spectacular aura about
that means either that func in the dll is not public SHARED or its typed wrong. If you erase and type the first few characters the tooltip should appear to complete the rest of the line. Does that happen?
__________________
03 Acura RSX Coupe
Developer of: RRFusion, MovieTimes.NET, (new)RRMail, RRShoutcast, & RRVehicle Maintenance
Currently working on: RRVehicle Maintenance
Sonicxtacy02 is offline   Reply With Quote
Old 08-05-2008, 10:41 AM   #28
Wants to make it harder
 
monkeyracer's Avatar
 
Join Date: May 2007
Location: Lakehood, CO
Posts: 1,414
monkeyracer is an unknown quantity at this point
"Reference to a non-shared member requires an object reference"
__________________
2007 Chrysler PT Cruiser TE
Car PC Progress:
Planning.......[---------X-] 95%
Parts...........[---------X-] 90%
Fabrication...[---------X-] 90%
RR Skin........[---------X-] 95%
View my
Worklog
Road Runner Skins
Website
Favorite thread EVER!
monkeyracer is offline   Reply With Quote
Old 08-06-2008, 04:50 PM   #29
Maximum Bitrate
 
jonessc's Avatar
 
Join Date: Nov 2006
Location: Wales, UK
Posts: 787
jonessc is an unknown quantity at this point
Quote: Originally Posted by monkeyracer View Post
a fellow forum member had an idea about solar panels



That guys a legend
__________________
CarPuter Progress:
Planning:-----> [||||||||||] 100%
Hardware Buying:-> [||||||||||] 100%
Software:-----> [||||||||||] 100%
Installing:-----> [||||||||||] 100%
Current Project= Making skins in photoshop...
jonessc is offline   Reply With Quote
Old 09-20-2008, 09:24 PM   #30
Newbie
 
rocsell's Avatar
 
Join Date: Mar 2008
Posts: 40
rocsell is an unknown quantity at this point
Any updates on this? How are you coming along??
rocsell is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Plug and play but where AJWatU LCD/Display 4 10-19-2007 05:39 PM
USB plug hard wired to glovebox sky_lennard Power Supplies 5 09-30-2007 12:52 AM
Where to Buy 3 Contact DC Power Plug tallyman General MP3Car Discussion 0 03-18-2007 10:53 PM
EPIA MII 10000 onboard USB plug help guizai General Hardware Discussion 5 01-26-2007 07:08 PM
multiple items on 1 12v accessory plug... also where to find dc-dc supply Valhalla1 Power Supplies 5 07-12-2003 02:43 AM



All times are GMT -5. The time now is 03:46 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.2
Copyright © 1999 - 2008 Mp3Car.com Inc.Ad Management by RedTyger
Message Board Statistics