LcdStudio.Com Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
DataPlugin SDK Quickstart
Goto page 1, 2, 3, 4, 5, 6, 7  Next
 
Reply to topic    LcdStudio.Com Forum Index » SDK View previous topic
View next topic
DataPlugin SDK Quickstart
Author Message
Ray
Site Admin


Joined: 23 Apr 2005
Posts: 3336

Post DataPlugin SDK Quickstart Reply with quote
1) Open up vs.net and click New Project
2) Choose the language of your choise and create a new Class library project and call it MyPlugin
3) Add a reference to CoreInterfaces.dll located in your lcdstudio folder.
4) Paste the following code into class1.cs (C# is used but this code is that basic it shoudn't be hard to convert to VB.Net)
Code:

using System;
using LcdStudio.CoreInterfaces;

namespace MyPlugin
{
   public class Plugin : AbstractDataPlugin
   {
      public override void RegisterData(IDataService ds)
      {
         ds.RegisterVariable(Group,"MyPlugin.HelloWorld","MyPlugin\\Hello world");
         ds.RegisterVariable(Group,"MyPlugin.TimeMsg","MyPlugin\\Time");
         this.UpdateInterval = 10000; //Update every 10000ms (10 sec)
      }
      
      public override void UpdateData(IDataService ds)
      {
         ds.SetValue("MyPlugin.HelloWorld","Hello world");
         ds.SetValue("MyPlugin.TimeMsg",string.Format("The time is {0} ",DateTime.Now.ToShortTimeString()));
      }

   }
}

5) Compile your project and copy the resulting MyPlugin.dll to your LcdStudio folder
6) Create a file in your LcdStudio folder called MyPlugin.Plugin with the following lines
Code:

<?xml version="1.0" encoding="utf-8" ?>
<Plugins>
   <Plugin ID="My Plugin" Type="MyPlugin.Plugin, MyPlugin" Visible="Yes" >
      <Depends ID="DataService" />
      <Depends ID="DispatchService" />
   </Plugin>
</Plugins>

7) Run LcdStudio and add your Plugin in the config panel.

Can't make it any easyer to extend LcdStudio.

If you guys have questions or need help feel free to ask.

Remember this is just a quickstart sdk a full sdk containing more documentation will be made at a later time.


Last edited by Ray on Fri May 19, 2006 6:44 pm; edited 2 times in total
Sat Jun 25, 2005 3:57 pm View user's profile Send private message Send e-mail Visit poster's website
Ray
Site Admin


Joined: 23 Apr 2005
Posts: 3336

Post Reply with quote
A Vb.Net version

as you can see its not that much different (just ugly... ehhehe)

Code:

Public Class Plugin
    Inherits LcdStudio.CoreInterfaces.AbstractDataPlugin

    Public Overrides Sub RegisterData(ByVal ds As LcdStudio.CoreInterfaces.IDataService)
        ds.RegisterVariable(Group, "MyPlugin.HelloWorld", "MyPlugin\Hello world")
        ds.RegisterVariable(Group, "MyPlugin.TimeMsg", "MyPlugin\Time")
        Me.UpdateInterval = 10000 'Update every 10000ms (10 sec)
    End Sub

    Public Overrides Sub UpdateData(ByVal ds As LcdStudio.CoreInterfaces.IDataService)
        ds.SetValue("MyPlugin.HelloWorld", "Hello VB.NET world")
        ds.SetValue("MyPlugin.TimeMsg", String.Format("The time is {0} ", DateTime.Now.ToShortTimeString()))
    End Sub
End Class

Sat Jun 25, 2005 3:58 pm View user's profile Send private message Send e-mail Visit poster's website
Starbuck3733T



Joined: 08 Jun 2004
Posts: 57
Location: State College, PA (Go Lions!)

Post Reply with quote
Where do I put the code to have a configuration screen ala the MailChecker plugin?
Fri Jul 15, 2005 8:59 pm View user's profile Send private message AIM Address
Ray
Site Admin


Joined: 23 Apr 2005
Posts: 3336

Post Reply with quote
I updated the sample a little showing how to do a basic config panel and saving/loading the settings.

http://updates.lcdstudio.com/~ray/site/MyPlugin.zip
Fri Jul 15, 2005 10:05 pm View user's profile Send private message Send e-mail Visit poster's website
Starbuck3733T



Joined: 08 Jun 2004
Posts: 57
Location: State College, PA (Go Lions!)

Post Reply with quote
A user control - clever!

Is the example's user control size fixed at the appropriate dimensions?
Mon Jul 18, 2005 6:28 pm View user's profile Send private message AIM Address
Ray
Site Admin


Joined: 23 Apr 2005
Posts: 3336

Post Reply with quote
the panel size is indeed fixed, if you make your config control bigger it would just clip at the edges and lose all thats not in sight.
Mon Jul 18, 2005 6:35 pm View user's profile Send private message Send e-mail Visit poster's website
Woodshop



Joined: 15 Nov 2005
Posts: 4

Post Reply with quote
Humm i'm trying your sample here translated to c++;
I got this code i belive it's right:
Code:
using namespace System;
using namespace LcdStudio::CoreInterfaces;

namespace MyPlugin
   {
   public ref class Plugin:AbstractDataPlugin
      {
      public:
      virtual void RegisterData(IDataService ^ds)override
         {
         ds->RegisterVariable(Group,"MyPlugin.HelloWorld","MyPlugin\\Hello world");
         ds->RegisterVariable(Group,"MyPlugin.TimeMsg","MyPlugin\\Time");
         this->UpdateInterval = 10000; //Update every 10000ms (10 sec)
         }
      virtual void UpdateData(IDataService ^ds)override
         {
         ds->SetValue("MyPlugin.HelloWorld","Hello world");
         ds->SetValue("MyPlugin.TimeMsg",String::Format("The time is {0} ",DateTime().Now.ToShortTimeString()));
         }
      };
   }


however unless i add System.Windows.Form as a Reference i get the compile error.


Code:
c:\documents and settings\aanagnos\my documents\visual studio 2005\projects\myplugin\myplugin\MyPlugin.h(24) : error C3766: 'MyPlugin::Plugin' must provide an implementation for the interface method 'System::Windows::Forms::Control ^LcdStudio::CoreInterfaces::IPlugin::ConfigPanel::get(void)'
        c:\documents and settings\aanagnos\my documents\visual studio 2005\projects\myplugin\myplugin\MyPlugin.h(11) : see declaration of 'LcdStudio::CoreInterfaces::IPlugin::ConfigPanel::get'


When i add it it removes the error and i can see the plugin in the LcdStudio's Options Menu but i can't check the Load @ StartUp box nor is their anything regarding it in the DataView tab.
Wed Nov 16, 2005 2:40 am View user's profile Send private message
Ray
Site Admin


Joined: 23 Apr 2005
Posts: 3336

Post Reply with quote
The reference you have to add is normal, in C# of vb you need to do the same thing.

Your code looks fine to me, best thing i can come up with is you have a wrong type entry in your .plugin file?

Please check that if you still can't get it going please send me a copy of your sample project i'd be happy to look at it.
Wed Nov 16, 2005 6:00 am View user's profile Send private message Send e-mail Visit poster's website
Woodshop



Joined: 15 Nov 2005
Posts: 4

Post Reply with quote
Unless their is a change that needs to be made to the .plug example you have posed above it's right.

I made sure to name all the clases the same as in the example.

i'll send my Project via e-mail.. Sry but it's a Visual C++ 2005 project so it won't open right in any of the older versions that i know of..

Source is easy to copy paste though it's only that one MyPlugin.cpp file
Wed Nov 16, 2005 9:18 am View user's profile Send private message
Ray
Site Admin


Joined: 23 Apr 2005
Posts: 3336

Post Reply with quote
Ahh there we go, the dotnet 1.1 runtime refuses to load 2.0 modules thats why its not loading.

Now that vs.net 2005 is final i am looking into compiling studio on that platform but i sadly don't have an eta on that for you.
Wed Nov 16, 2005 9:35 am View user's profile Send private message Send e-mail Visit poster's website
Woodshop



Joined: 15 Nov 2005
Posts: 4

Post Reply with quote
thtas ok since for the time being .nwt 1.1 and 2.0 can be installed side by side i'll just make 1.1 modules for the time being
Wed Nov 16, 2005 5:55 pm View user's profile Send private message
Hu9o



Joined: 29 Nov 2005
Posts: 10

Post Reply with quote
Just a quick question:

"3) Add a reference to CoreInterfaces.dll located in your lcdstudio folder. "

How do I do this in VC++ Express?
Tue Nov 29, 2005 5:06 pm View user's profile Send private message
Ray
Site Admin


Joined: 23 Apr 2005
Posts: 3336

Post Reply with quote
Never tried VC++ express but in C# and VB there is a References tree node underneath your main project file. I assume it's there too in VC++ but not really sure
Tue Nov 29, 2005 7:53 pm View user's profile Send private message Send e-mail Visit poster's website
Hu9o



Joined: 29 Nov 2005
Posts: 10

Post Reply with quote
Ok I compiled this in VC# and it worked right a way!


I created the MyPlugin.plugin file and pasted the text from above. Now the problem is making the checkbox checked in the options menu for MyPlugin... For some reason it can't be check on Sad ?

All 4 MyPlugin.dll's I tried (in bin\release, bin\debug, obj\release and obj\debug)
Tue Nov 29, 2005 9:46 pm View user's profile Send private message
Ray
Site Admin


Joined: 23 Apr 2005
Posts: 3336

Post Reply with quote
you probably messed up the fully qualyfied name you have to specify in the .plugin file.

make sure it matches your class exactly.

if you keep having problems, email me the project i'll take a look at it
Tue Nov 29, 2005 9:52 pm View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:    
Reply to topic    LcdStudio.Com Forum Index » SDK All times are GMT + 1 Hour
Goto page 1, 2, 3, 4, 5, 6, 7  Next
Page 1 of 7

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.