Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 28

Thread: Plugin noob looking to start

  1. #11
    Maximum Bitrate jmullan99's Avatar
    Join Date
    Feb 2009
    Location
    Niagara Falls, Ontario
    Posts
    682
    Thanks Justin. That got it.

    Cheers!
    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. #12
    Maximum Bitrate jmullan99's Avatar
    Join Date
    Feb 2009
    Location
    Niagara Falls, Ontario
    Posts
    682
    Quote 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
    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

  3. #13
    Maximum Bitrate jmullan99's Avatar
    Join Date
    Feb 2009
    Location
    Niagara Falls, Ontario
    Posts
    682
    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.
    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

  4. #14
    Raw Wave
    Auto Apps:loading...
    justchat_1's Avatar
    Join Date
    Jul 2008
    Location
    Boston, Ma or NY,NY
    Posts
    2,359
    Quote 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

  5. #15
    Maximum Bitrate jmullan99's Avatar
    Join Date
    Feb 2009
    Location
    Niagara Falls, Ontario
    Posts
    682
    Quote 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
    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

  6. #16
    Maximum Bitrate jmullan99's Avatar
    Join Date
    Feb 2009
    Location
    Niagara Falls, Ontario
    Posts
    682
    Well, time for new glasses? Time to go back to school? Or how about a new day, some sleep, and fresh eyes.

    Everywhere in my plugin I use "OMArduino.ComPort". Okay, makes sense. Only that the 2 lines that reload the existing value, because it is Not Null or Empty, loads in "OMArduino.comport".

    How quick did you notice the problem above? DOH! Case sensitivity. I can't believe it took me a few hours to pin that down.

    I'm happy again, until the next blunder.

    Cheers,
    John
    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

  7. #17
    Raw Wave
    Auto Apps:loading...
    justchat_1's Avatar
    Join Date
    Jul 2008
    Location
    Boston, Ma or NY,NY
    Posts
    2,359
    DOh...if it makes you feel any better I looked over that a dozen times and missed it too lol

  8. #18
    Maximum Bitrate jmullan99's Avatar
    Join Date
    Feb 2009
    Location
    Niagara Falls, Ontario
    Posts
    682
    Quote Originally Posted by justchat_1 View Post
    DOh...if it makes you feel any better I looked over that a dozen times and missed it too lol
    Oh yes, I'm sure we've ALL been there before. I'm not afraid to admit overlooking the same thing 100 times and every time it just "looks" right.

    Now I can't wait for the Arduino to arrive (tomorrow hopefully) to begin the real work.

    Im lovin the challenge.

    Cheers,
    John
    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

  9. #19
    Maximum Bitrate jmullan99's Avatar
    Join Date
    Feb 2009
    Location
    Niagara Falls, Ontario
    Posts
    682
    Okay. I would like to request a favor.

    I need some snippets to show me how to get/send data to a selected com port. I can easily do it with an MSCOMCTL object on form based project (basically drag-n-drop the control), but not sure what I should do with just a class library.

    Is there related routines in the framework?

    John
    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

  10. #20
    Maximum Bitrate Borte's Avatar
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    529
    Quote Originally Posted by jmullan99 View Post
    Okay. I would like to request a favor.

    I need some snippets to show me how to get/send data to a selected com port. I can easily do it with an MSCOMCTL object on form based project (basically drag-n-drop the control), but not sure what I should do with just a class library.

    Is there related routines in the framework?

    John
    There's no serial port interface in the framework as of now (at least not any that I'm aware of...)

    Found this link after a quick google for "c# com port interface", it should help you along for serial communication: http://www.dreamincode.net/forums/to...ation-in-c%23/
    Failure is not an option...
    __________________________________________________ ______________________________
    The only full multizone / multiscreen cross platform open source Front End -> OpenMobile

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Need Alpine wired remote control pinout.
    By FordNoMore in forum Input Devices
    Replies: 31
    Last Post: 11-17-2012, 06:24 AM
  2. eyeR Interceptor: Automated Engine Start How-to
    By Civic Modz in forum Fusion Brain Innovations
    Replies: 2
    Last Post: 03-04-2010, 04:27 AM
  3. nGhost 2.0.0 Final is out!
    By tripzero in forum LinuxICE
    Replies: 53
    Last Post: 07-16-2009, 09:16 PM
  4. noob car pc start up question
    By IZNICE in forum Power Supplies
    Replies: 0
    Last Post: 11-04-2008, 06:22 AM
  5. IRMAN plugin
    By knyarko in forum StreetDeck
    Replies: 3
    Last Post: 01-05-2007, 08:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •