[Finished] Improvement suggestion for Weather Plugin (4 Viewers)

morpheus_xx

Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    I get no output but a XmlParser exception and crash
     

    Valk

    Portal Pro
    February 25, 2006
    302
    108
    Home Country
    Australia Australia
    I get no output but a XmlParser exception and crash

    Interesting... Not sure what's going on there.
    Considering some people will get things like "Reserved" a backup method will be needed.

    @morpheus_xx is there an event that triggers only on the first initialisation of the weather plugin? I don't want to keep setting the default location if people clear the list themselves.
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Sorry, I was wrong about exception type (it's about xaml, not xml ;)), here is the full output:
    Problemsignatur:
    Problemereignisname: CLR20r3
    Problemsignatur 01: locationfinder.exe
    Problemsignatur 02: 1.0.0.0
    Problemsignatur 03: 5143ca6d
    Problemsignatur 04: LocationFinder
    Problemsignatur 05: 1.0.0.0
    Problemsignatur 06: 5143ca6d
    Problemsignatur 07: 1d
    Problemsignatur 08: c
    Problemsignatur 09: System.Windows.Markup.XamlParse
    Betriebsystemversion: 6.1.7601.2.1.0.256.1
    Gebietsschema-ID: 1031
    Zusatzinformation 1: 0a9e
    Zusatzinformation 2: 0a9e372d3b4ad19135b953a78882e789
    Zusatzinformation 3: 0a9e
    Zusatzinformation 4: 0a9e372d3b4ad19135b953a78882e789
    @morpheus_xx is there an event that triggers only on the first initialisation of the weather plugin? I don't want to keep setting the default location if people clear the list themselves.
    No there is no "first run" indicator: the models load the location from settings, when it has not been filled before the list is empty. If it is really required to do only a first-run setup, we might add a bool field to WeatherSettings ("FirstRun") to avoid unwanted creation of locations (if list is empty again).
    In any case the configuration of location should get a new button "suggest location", to invoke the new detection on demand.
     

    Valk

    Portal Pro
    February 25, 2006
    302
    108
    Home Country
    Australia Australia
    I was just wondering if there was a nice way.

    Xaml makes more sense mind you there isn't much:

    Code:
    <Window x:Class="LocationFinder.MainWindow"
     
    		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     
    		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     
    		Title="Location Finder" Height="350" Width="525">
     
    	<Grid>
     
    		<TextBlock Name="Console" Text="" HorizontalAlignment="Center" VerticalAlignment="Center" />
     
    	</Grid>
     
    </Window>

    Alwell.
     

    Valk

    Portal Pro
    February 25, 2006
    302
    108
    Home Country
    Australia Australia
    Well I spent a little time and implemented the detection method into the weather plugin and I updated the testing tool to hopefully get around the "Reserved" issue (I move onto the next node).

    Attached is an updated testing tool (based on the code I used in MP2) so if people could give it a shot and give some feedback.

    Oh and to anyone who's familiar with MP2 I used HttpServer.Helpers.XmlHelper to deserialize the XML from freegeoip by adding a reference to HttpServer. I'm not sure if that's the preferred way to do it or just implement my own deserializer, thoughts?
     

    Attachments

    • LocationFinder.zip
      6.7 KB
    Last edited:

    Valk

    Portal Pro
    February 25, 2006
    302
    108
    Home Country
    Australia Australia
    I took out the reference to the json lib.

    Shouldn't need anything else (checks).[DOUBLEPOST=1363492620][/DOUBLEPOST]Did you download the new version @kiwijunglist it says no views?
     

    kiwijunglist

    Super Moderator
  • Team MediaPortal
  • June 10, 2008
    6,746
    1,751
    New Zealand
    Home Country
    New Zealand New Zealand
    ^ yup, failed to find location (old version worked).
     

    Valk

    Portal Pro
    February 25, 2006
    302
    108
    Home Country
    Australia Australia
    Ok now you have me seriously confused. If the old version worked then this should have worked also.
     

    Users who are viewing this thread

    Top Bottom