Announcement

Collapse
No announcement yet.

Plugin noob looking to start

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Plugin noob looking to start

    Okay. So I had my first computer in 1979. Been coding in various forms since, from ASM, Fortran, Cobol, Basic, Clipper, VBA, and PHP. The closest thing for this project I have done (and still do) is VBA coding in Access. I have a large web based PHP project I developed and maintain at work.

    I have starting playing with VB in Visual Studio Express 2010. I see quite a bit of similarity, and have made a couple of quick form based apps.

    I wish to tackle making a plugin and skin to immerse myself even further and learn the requirements for OM.

    I believe the quickest way for me to begin, at this point, is to have someone supply a very basic skeleton source for each the plugin and skin. Something quite simple but functioning. A simple skin with a textbox and button with perhaps a simple setup screen for the Plugin Settings spot that allows me to set a color or something. The button puts "Hello World" in the text box. Overly complex at this point would just delay my comprehension while tracing through it.

    If somebody could please post such sources it would be very helpful. I also have a (yet unused) Google wave account if it helps.

    PS: If it is unnecessary to have two seperate things (IE; the skin will do everything I need), then that's okay. But my ultimate end will be that the plugin will also have data (sensors?) to share.

    John
    03 Cadillac CTS
    ZOTAC G43ITX-A-E 2.5ghz Core i3 2GB 160GB SSD
    Win7 Ultimate - OpenMobile - Directed HD - Wifi
    OMMaps + MS GPS Puck - WiFi via LTE Android phone
    2 Zones - Matrix Orbital LCD - Arduino - Build Pics

  • #2
    There is a full plugin sample available here: http://openmobile.svn.sourceforge.ne...MPluginSample/

    To download the zipped (full) version: http://openmobile.svn.sourceforge.ne...mple/?view=tar

    PS! This is a VS 2008 project and requires .Net3.5

    We're working on a more advanced sample but this should get you going for now.
    Failure is not an option...
    __________________________________________________ ______________________________
    The only full multizone / multiscreen cross platform open source Front End -> OpenMobile

    Comment


    • #3
      Thank you. I will play with this after work. I look forward to the more advanced sample too.

      Cheers,
      John
      03 Cadillac CTS
      ZOTAC G43ITX-A-E 2.5ghz Core i3 2GB 160GB SSD
      Win7 Ultimate - OpenMobile - Directed HD - Wifi
      OMMaps + MS GPS Puck - WiFi via LTE Android phone
      2 Zones - Matrix Orbital LCD - Arduino - Build Pics

      Comment


      • #4
        The nice part is that all the plugins are open source...so everything is a sample (just some better then others). If you need any of the C# plugins translated to vb just let me know
        openMobile - An open source C# Front End (why choose openMobile?)
        - Always Recruiting Developers -
        Like what you see? Donations are always welcome

        Comment


        • #5
          Oh yes please.

          I am starting with the SampleClass1. I "think" I have it changed to VB except a couple things. So it would wonderful to have that one converted so I can see what I did right and what I did wrong
          03 Cadillac CTS
          ZOTAC G43ITX-A-E 2.5ghz Core i3 2GB 160GB SSD
          Win7 Ultimate - OpenMobile - Directed HD - Wifi
          OMMaps + MS GPS Puck - WiFi via LTE Android phone
          2 Zones - Matrix Orbital LCD - Arduino - Build Pics

          Comment


          • #6
            Plugin sample VB version
            Attached Files
            openMobile - An open source C# Front End (why choose openMobile?)
            - Always Recruiting Developers -
            Like what you see? Donations are always welcome

            Comment


            • #7
              Thanks! Can't wait to get home and compare. I already know I made a couple of errors but most of the syntax checks out.

              Updates to follow.

              John
              03 Cadillac CTS
              ZOTAC G43ITX-A-E 2.5ghz Core i3 2GB 160GB SSD
              Win7 Ultimate - OpenMobile - Directed HD - Wifi
              OMMaps + MS GPS Puck - WiFi via LTE Android phone
              2 Zones - Matrix Orbital LCD - Arduino - Build Pics

              Comment


              • #8
                Well, I did make a few translation errors. But now I match the sample. No compile errors. But I'm afraid that I may be missing something. I put the DLL into the plugin folder and there is no attempt (looking at debug.txt) to load it.

                Additional education appreciated. This is my first standalone library. Perhaps I am "building" it incorrectly.

                I included what I think is the appropriate portion of the debug.txt

                Oh, and I called my plugin: OMArduino

                Code:
                -----------------Software-------------------
                OS: Windows 7
                Framework: Microsoft .Net v4.0
                Open Mobile: v0.8.0.6
                Open GL v.2.0.0 - Build 8.14.10.1930
                ------------------Hardware-------------------
                Processors: 2
                Architecture: x86
                Screens: 1
                Graphics Card: Intel 965/963 Graphics Media Accelerator
                ----------------Inital Assemblies-------------
                0.000: LOADED (mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
                0.000: LOADED (Open Mobile, Version=0.8.0.6, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (OpenMobile.Framework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (OpenMobile.Graphics, Version=1.0.0.201, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
                0.000: LOADED (Mono.Data.Sqlite, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756)
                0.000: LOADED (System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
                0.000: LOADED (System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
                0.000: LOADED (System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
                0.000: LOADED (System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
                0.000: LOADED (System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
                0.000: LOADED (System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
                0.000: LOADED (UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (MainMenu, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (!OMDebug, Version=0.5.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (AudioRouter, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (DirectShowLib-2005, Version=2.0.0.0, Culture=neutral, PublicKeyToken=67e7b740cdfc2d3f)
                0.000: LOADED (DPEmail, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (OpenMobile.Email, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (DPGWeather, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (HDRadioComm, Version=1.6.0.3, Culture=neutral, PublicKeyToken=6059837a14fef3b8)
                0.000: LOADED (iPodDB, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (OpenPOD, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (OMDVD, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
                0.000: LOADED (OMMediaDB, Version=0.0.3.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (OMPlayer, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (OMSpeech, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (OMVisteonRadio, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
                0.000: LOADED (RemovableDB, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (SystemSensors, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (WinWifi, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (EmbedApp1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (EmbedApp2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (EmbedApp3, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (ExternalNav, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (Networking, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (NewMedia, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (OMDir, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (OMNotify, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (OMRadio, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (OMSettings, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (OMWeather, Version=0.2.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (OSK, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
                0.000: LOADED (Video, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
                ---------------------------------------------
                0.078: RenderingWindowResized(0,,)
                0.156: LOADED (System.Speech, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)@file:///C:/Windows/assembly/GAC_MSIL/System.Speech/3.0.0.0__31bf3856ad364e35/System.Speech.dll
                0.421: playlistChanged(0,)
                0.453: LOADED (System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)@file:///C:/Windows/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll
                0.593: RandomChanged(0,Enabled)
                0.609: RandomChanged(1,Disabled)
                0.655: playlistChanged(1,)
                0.655: playlistChanged(2,)
                0.858: RandomChanged(2,Disabled)
                0.921: playlistChanged(4,)
                0.921: playlistChanged(7,)
                0.921: playlistChanged(3,)
                0.921: playlistChanged(6,)
                0.921: playlistChanged(5,)
                0.921: playlistChanged(5,)
                1.123: LOADED (System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)@file:///C:/Windows/assembly/GAC_MSIL/System.Management/2.0.0.0__b03f5f7f11d50a3a/System.Management.dll
                1.716: backgroundOperationStatus(Engine Ready!,Speech,)
                1.763: LOADED (CustomMarshalers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)@file:///C:/Windows/assembly/GAC_32/CustomMarshalers/2.0.0.0__b03f5f7f11d50a3a/CustomMarshalers.dll
                5.304: pluginLoadingComplete(,,)
                5.476: Storage Event(NotSet,False,F:\)
                5.554: ********TaskManager******
                Task Started: Load Artists
                5.569: ********TaskManager******
                Task Ended: Load Artists
                5.569: ********TaskManager******
                Task Started: Refresh Networks
                5.601: ********TaskManager******
                Task Ended: Refresh Networks
                5.601: ********TaskManager******
                Task Started: Lookup CD Info
                5.616: ********TaskManager******
                Task Died: Lookup CD Info
                5.616: ********TaskManager******
                Task Started: Lookup CD Info
                5.616: ********TaskManager******
                Task Died: Lookup CD Info
                5.616: ********TaskManager******
                Task Started: Load Plugin Settings
                5.788: connectedToInternet(,,)
                5.850: TransitionFromPanel(0,MainMenu,)
                5.866: TransitionToPanel(0,OMSettings,)
                6.100: ExecuteTransition(0,Crossfade,)
                6.225: Storage Event(LocalHardware,False,F:\)
                7.083: TransitionFromPanel(0,OMSettings,)
                7.083: TransitionToPanel(0,OMSettings,Plugins)
                7.098: ********TaskManager******
                Task Ended: Load Plugin Settings
                03 Cadillac CTS
                ZOTAC G43ITX-A-E 2.5ghz Core i3 2GB 160GB SSD
                Win7 Ultimate - OpenMobile - Directed HD - Wifi
                OMMaps + MS GPS Puck - WiFi via LTE Android phone
                2 Zones - Matrix Orbital LCD - Arduino - Build Pics

                Comment


                • #9
                  Originally posted by jmullan99 View Post
                  Additional education appreciated. This is my first standalone library. Perhaps I am "building" it incorrectly.
                  Taking a wild guess....but are you building it for .Net v4? It needs to be built against .Net v3.5
                  openMobile - An open source C# Front End (why choose openMobile?)
                  - Always Recruiting Developers -
                  Like what you see? Donations are always welcome

                  Comment


                  • #10
                    Um ya, good guess. I started off v4 never had 3.5

                    I'll try to downgrade.
                    03 Cadillac CTS
                    ZOTAC G43ITX-A-E 2.5ghz Core i3 2GB 160GB SSD
                    Win7 Ultimate - OpenMobile - Directed HD - Wifi
                    OMMaps + MS GPS Puck - WiFi via LTE Android phone
                    2 Zones - Matrix Orbital LCD - Arduino - Build Pics

                    Comment


                    • #11
                      Thanks Justin. That got it.

                      Cheers!
                      03 Cadillac CTS
                      ZOTAC G43ITX-A-E 2.5ghz Core i3 2GB 160GB SSD
                      Win7 Ultimate - OpenMobile - Directed HD - Wifi
                      OMMaps + MS GPS Puck - WiFi via LTE Android phone
                      2 Zones - Matrix Orbital LCD - Arduino - Build Pics

                      Comment


                      • #12
                        Originally posted by jmullan99 View Post
                        Thanks Justin. That got it.

                        Cheers!
                        Okay, I may have spoke too soon. I get the settings screen, with the settings option and OK button. I do not see the sample buttons/labels. And (as I figured anyway) if I set a main menu button to my plugin, nothing happens when I click it (because no skin file?).

                        Where should I see the sample buttons? Why might I not see the samples?

                        John
                        03 Cadillac CTS
                        ZOTAC G43ITX-A-E 2.5ghz Core i3 2GB 160GB SSD
                        Win7 Ultimate - OpenMobile - Directed HD - Wifi
                        OMMaps + MS GPS Puck - WiFi via LTE Android phone
                        2 Zones - Matrix Orbital LCD - Arduino - Build Pics

                        Comment


                        • #13
                          Okay scratch my issues up to this point. My plugins stuff is kinda working right now. Except The whole thing works fine, as long as i stay in OM but exit and come back and the setting is gone. History. All the extra logging stuff i put in says everything works right. Kinda irritating and making me feel inadequate. I don't know if there is something i don't know about or if Im just stupid so i gotta step away. Im giving up for tonight.

                          Tomorrow is a new day.
                          03 Cadillac CTS
                          ZOTAC G43ITX-A-E 2.5ghz Core i3 2GB 160GB SSD
                          Win7 Ultimate - OpenMobile - Directed HD - Wifi
                          OMMaps + MS GPS Puck - WiFi via LTE Android phone
                          2 Zones - Matrix Orbital LCD - Arduino - Build Pics

                          Comment


                          • #14
                            Originally posted by jmullan99 View Post
                            Okay scratch my issues up to this point. My plugins stuff is kinda working right now. Except The whole thing works fine, as long as i stay in OM but exit and come back and the setting is gone. History. All the extra logging stuff i put in says everything works right. Kinda irritating and making me feel inadequate. I don't know if there is something i don't know about or if Im just stupid so i gotta step away. Im giving up for tonight.

                            Tomorrow is a new day.
                            I think I understand what your describing but if not feel free to correct me.

                            This may be a stupid question but are you saving the setting? Each Setting class stores a setting for display purposes only. If that setting is changed, the Settings class fires an OnSettingChanged event with the changed setting. Your plugin will then need to save this setting similar to how the plugin example does it:

                            Code:
                            Using settings As PluginSettings = New PluginSettings
                                   settings.setSetting(s.Name, s.Value)
                            End Using
                            openMobile - An open source C# Front End (why choose openMobile?)
                            - Always Recruiting Developers -
                            Like what you see? Donations are always welcome

                            Comment


                            • #15
                              Originally posted by justchat_1 View Post
                              I think I understand what your describing but if not feel free to correct me.

                              This may be a stupid question but are you saving the setting? Each Setting class stores a setting for display purposes only. If that setting is changed, the Settings class fires an OnSettingChanged event with the changed setting. Your plugin will then need to save this setting similar to how the plugin example does it:
                              Never a stupid question. The quick answer is yes. Here are my loadsettings() and setting_changed():

                              Code:
                                     Public Function loadSettings() As Settings Implements IHighLevel.loadSettings
                              
                                          'Class Level: Private settings As Settings (Settings screen items)
                              
                                          Dim z As String
                                          Dim x As Integer
                              
                                          Dim COMOptions As New Generic.List(Of String)
                                          Dim COMValues As New Generic.List(Of String)
                                          Dim m_Settings As New OpenMobile.Data.PluginSettings ' for the settings data for our plugin
                              
                                          Me.settings = New Settings("OMArduino")
                              
                                          If String.IsNullOrEmpty(m_Settings.getSetting("OMArduino.ComPort")) Then
                                              ' The comport value does not exist
                                              log_msg(".... com port setting not yet created")
                                              m_Settings.setSetting("OMArduino.ComPort", m_ComPort.ToString)
                                              log_msg("........ created with value: " & m_ComPort.ToString)
                                          Else
                                              log_msg("Found existing setting: " & m_ComPort.ToString)
                                              m_ComPort = Val(m_Settings.getSetting("OMArduino.comport"))
                                          End If
                              
                                          ' temporary to write to 'arduino.log' in the OM folder
                                          log_msg("Gathering available com ports")
                              
                                          COMOptions.Add("Auto")
                                          COMOptions.AddRange(System.IO.Ports.SerialPort.GetPortNames)
                              
                                          For Each Port As String In COMOptions
                                              If Port = "Auto" Then
                                                  COMValues.Add("0")
                                                  log_msg(".... adding " & Port & " as 0")
                                              Else
                                                  z = Port.Replace("COM", "")
                                                  COMValues.Add(z)
                                                  log_msg(".... adding " & Port & " as " & z)
                                              End If
                                          Next
                              
                                          x = COMOptions.Count
                              
                                          log_msg(".... list built with " & x & " items")
                              
                                          ' The create the comport multichoice control
                                          If String.IsNullOrEmpty(m_Settings.getSetting("OMArduino.ComPort")) Then
                                              ' The comport value does not exist
                                              log_msg(".... com port setting not yet created")
                                              m_Settings.setSetting("OMArduino.ComPort", m_ComPort.ToString)
                                              log_msg("........ created with value: " & m_ComPort.ToString)
                                          End If
                              
                                          log_msg(".... creating COM port list control for settings screen")
                                          settings.Add(New Setting(SettingTypes.MultiChoice, "OMArduino.ComPort", "COM", "Com Port", COMOptions, COMValues, m_ComPort.ToString))
                                          log_msg("........ created with default " & m_ComPort.ToString)
                              
                                          AddHandler Me.settings.OnSettingChanged, New SettingChanged(AddressOf Setting_Changed)
                              
                                          log_msg("....handler assigned")
                              
                                          log_msg("DONE!")
                              
                                          'Settings collections are automatically laid out by the framework
                                          Return Me.settings
                              
                                      End Function
                              Code:
                                      Private Sub Setting_Changed(ByVal s As Setting)
                              
                                          'When a setting changes you should update your plugin with
                                          'the new setting information
                                          'Then the setting should be saved to the database
                              
                                          Dim z As Integer = 0
                              
                                          Using m_settings As PluginSettings = New PluginSettings
                                              Select Case s.Name
                                                  Case "OMArduino.ComPort"
                                                      m_ComPort = Val(s.Value)
                                                      If (m_settings.setSetting(s.Name, s.Value)) Then
                                                          log_msg("Changed setting " & s.Name & " to " & s.Value)
                                                      Else
                                                          log_msg("Could not set " & s.Name & " to " & s.Value)
                                                      End If
                                                  Case "OMArduino.Pin1"
                                                  Case "OMArduino.Pin2"
                                                  Case "OMArduino.Pin3"
                                                  Case "OMArduino.Pin4"
                                              End Select
                                          End Using
                              
                                      End Sub
                              I am sure I am still missing something, but pretty sure I reach the m_settings.setSettings() and it returns TRUE in the test. My simple logging always finds the setting, but it is always = 0 (should be 5 for my one and only com port).

                              Here is my log output for 1st and 2nd opening of OM then going into settings:

                              Code:
                              Found existing setting: 0
                              Gathering available com ports
                              .... adding Auto as 0
                              .... adding COM5 as 5
                              .... list built with 2 items
                              .... creating COM port list control for settings screen
                              ........ created with default 0
                              ....handler assigned
                              DONE!
                              Changed setting OMArduino.ComPort to 5
                              
                              Found existing setting: 0
                              Gathering available com ports
                              .... adding Auto as 0
                              .... adding COM5 as 5
                              .... list built with 2 items
                              .... creating COM port list control for settings screen
                              ........ created with default 0
                              ....handler assigned
                              DONE!
                              Changed setting OMArduino.ComPort to 5
                              Gotta run. I'm out for most of the morning. Thanks for looking.

                              John
                              John
                              03 Cadillac CTS
                              ZOTAC G43ITX-A-E 2.5ghz Core i3 2GB 160GB SSD
                              Win7 Ultimate - OpenMobile - Directed HD - Wifi
                              OMMaps + MS GPS Puck - WiFi via LTE Android phone
                              2 Zones - Matrix Orbital LCD - Arduino - Build Pics

                              Comment

                              Working...
                              X