Questions on writing my first plugin (1 Viewer)

huha

Extension Developer
January 3, 2008
890
556
Home Country
Germany Germany
  • Thread starter
  • Moderator
  • #22
Albert,
attached the complete log files and the plugin.xml of the hello world plugin with a dependency on the slim tv plugin.
I would be interested if the error can be reproduced on another system or it is only me.
Thanks in advance for your help!
 

Attachments

  • Debug MP2.zip
    4.7 KB
Last edited:

Albert

MP2 Developer
  • Premium Supporter
  • February 18, 2008
    1,297
    1,130
    45
    Freiburg im Breisgau, Germany
    Home Country
    Germany Germany
    huha, the plugin manager was one of our most stable components for about 4 years now.
    You're the first one (excluding me) who found a bug in the plugin manager :)
    Fixed in branch dev. Thanks very much!
     

    huha

    Extension Developer
    January 3, 2008
    890
    556
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #25
    Albert,
    glad i could help :) and thanks for fixing. I have not changed yet to another version (still on the Easter built).

    Another thing I observed is that about one out of 40 times the Client does not close correctly. The window is closing, but another process is still running. I need to open the process explorer to kill it. If this is unknown i will try to catch a log the next time it happens. I thaugt originally its me with a plugin, but this came at to many different situations.

    I have started now to work on TvWishlist after I have collected all my code pieces and I am making good progress. But there is still a long way ahead.
    greetings, huha
     

    Albert

    MP2 Developer
  • Premium Supporter
  • February 18, 2008
    1,297
    1,130
    45
    Freiburg im Breisgau, Germany
    Home Country
    Germany Germany
    It might be the case that the inproper closure of the client is already fixed in the current dev version. Some weeks ago, I did some bugfixes in the UPnP library which could lead to inproper close orders.
     

    huha

    Extension Developer
    January 3, 2008
    890
    556
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #27
    I am nearly done with tvwishlist, but i am running into a roadblock on the last task. I am trying to implement the "Pog" button, where I can "steal" from another screen information and transfer to TvWishlist.
    I tried to modify the SlimTv DialogprogramActionsFull.xaml and added successfully another button.
    This button should call a function in a different model (and later transfer via parameter the selected program from the EPG guide)



    <?xml version="1.0" encoding="utf-8"?>
    <Include
    xmlns="www.team-mediaportal.com/2008/mpf/directx"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Source="screens\simple_dialog_menu.xaml"
    >
    <Include.Resources>
    <Service x:Key="ScreenManager" InterfaceName="ScreenManager"/>

    <!-- Dialog title -->
    <ResourceWrapper x:Key="Dialog_Header_Text" Resource="[SlimTvClient.ChooseProgramAction]"/>

    <!-- SlimTvMultiChannelGuide model -->
    <Model x:Key="SlimTvMultiChannelGuide" Id="5054408D-C2A9-451f-A702-E84AFCD29C10"/>
    <Model x:Key="MyTestPluginSlimTv" Id="023c44f2-3329-4781-9b4a-c974444c0b0d"/>


    <!-- Command -->
    <CommandStencil x:Key="Execute_Command_Stencil"
    Source="{StaticResource SlimTvMultiChannelGuide}" Path="ExecProgramAction"/>


    <ControlTemplate x:Key="Contents_Template">


    <DockPanel Context="{Model Id=5054408D-C2A9-451f-A702-E84AFCD29C10}" LastChildFill="False">

    <Grid HorizontalAlignment="Stretch">
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="Auto"/>

    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
    <RowDefinition Height="Auto"/>
    <RowDefinition Height="*"/>

    </Grid.RowDefinitions>
    <ListView Name="DialogMenu" Grid.Column="0" Grid.Row="0" ItemsSource="{Binding Source={StaticResource SlimTvMultiChannelGuide},Path=ProgramActions,Mode=OneTime}" Style="{ThemeResource MenuListViewStyle}">

    </ListView>


    <!--<Command Source="{Service ScreenManager}" Path="ShowDialog" Parameters="dialogWeatherSearchResult"/>-->
    <!--<Command Path="SearchLocations" Parameters="{LateBoundValue BindingValue={Binding Path=SearchCity}}"/>-->
    <!--Command="{Command Source={Service WorkflowManager},Path=NavigatePop,Parameters=1}"/>-->
    <!--Command="{Command Source={Service WorkflowManager},Path=NavigatePush,Parameters={StaticResource EditShareNameStateId}}"/>-->

    <Button Style="{ThemeResource DialogButtonStyle}" Grid.Column="0" Grid.Row="1" Context="{Model Id=023c44f2-3329-4781-9b4a-c974444c0b0d}" Content="TvWish" HorizontalAlignment="Center">
    <Button.Command>
    <CommandList>
    <Command Source="{StaticResource MyTestPluginSlimTv}" Path="SlimTv"/>
    <Command Source="{Service ScreenManager}" Path="CloseTopmostDialog"/>
    </CommandList>
    </Button.Command>
    </Button>

    </Grid>

    </DockPanel>
    </ControlTemplate>
    </Include.Resources>
    </Include>

    I have modified the skin in the following way, that I defined first a second Model reference MyTestPluginSlimTV pointing to MyTestPlugin and defined then a button calling a function SlimTv() in my test plugin. The function in the MyTestPlugin model is simply to log the event

    public void SlimTv()
    {
    HelloString = "message from slimtv";
    mylogger.Debug("SlimTv called");
    }

    The error message is
    [InputMgr ] [WARN ] - CommandBaseMarkupExtension: Could not find method, could not execute command ({Command Source=MyTestPlugin.Models.MyTestPlugin,Path=SlimTv})
    It looks like it cannot find the actual instance of the model. The complete log file is attached. Any ideas how this can be done?
     
    Last edited:

    Albert

    MP2 Developer
  • Premium Supporter
  • February 18, 2008
    1,297
    1,130
    45
    Freiburg im Breisgau, Germany
    Home Country
    Germany Germany
    Hmm, strange. For me it all looks fine. I guess the code above is located in file "DialogProgramActionsFull.xaml" and your "MyTestPlugin" is a model which is correctly registered in "plugin.xml" and that class is located in plugin "TvWishListMP2".
    The model seems to be found by the workflow manager, the log output of the Command markup extension writes down the namespace of your model class. The only thing I could imagine is that you run another code of the model class which doesn't contain the "SlimTv" method yet or with another signature.
     

    huha

    Extension Developer
    January 3, 2008
    890
    556
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #29
    Albert,
    a big thanks for your help again. You were right on your suspicion with the model. I got it to work now and will continue with the parameters.
     

    huha

    Extension Developer
    January 3, 2008
    890
    556
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #30
    It's Working! :):):)

    Changing the test plugin function to
    public void SlimTv(string text)
    {
    HelloString = "message from slimtv="+text;
    mylogger.Debug("SlimTv called parameter="+text);
    }

    and using

    <?xml version="1.0" encoding="utf-8"?>
    <Include
    xmlns="www.team-mediaportal.com/2008/mpf/directx"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Source="screens\simple_dialog_menu.xaml"
    >
    <Include.Resources>
    <Service x:Key="ScreenManager" InterfaceName="ScreenManager"/>

    <!-- Dialog title -->
    <ResourceWrapper x:Key="Dialog_Header_Text" Resource="[SlimTvClient.ChooseProgramAction]"/>

    <!-- SlimTvMultiChannelGuide model -->
    <Model x:Key="SlimTvMultiChannelGuide" Id="5054408D-C2A9-451f-A702-E84AFCD29C10"/>
    <Model x:Key="MyTestPluginSlimTv" Id="023c44f2-3329-4781-9b4a-c974444c0b0d"/>


    <!-- Command -->
    <CommandStencil x:Key="Execute_Command_Stencil"
    Source="{StaticResource SlimTvMultiChannelGuide}" Path="ExecProgramAction"/>


    <ControlTemplate x:Key="Contents_Template">


    <DockPanel Context="{Model Id=5054408D-C2A9-451f-A702-E84AFCD29C10}" LastChildFill="False">

    <Grid HorizontalAlignment="Stretch">
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="Auto"/>

    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
    <RowDefinition Height="Auto"/>
    <RowDefinition Height="*"/>

    </Grid.RowDefinitions>
    <ListView Name="DialogMenu" Grid.Column="0" Grid.Row="0" ItemsSource="{Binding Source={StaticResource SlimTvMultiChannelGuide},Path=ProgramActions,Mode=OneTime}" Style="{ThemeResource MenuListViewStyle}">

    </ListView>


    <Button Style="{ThemeResource DialogButtonStyle}" Grid.Column="0" Grid.Row="1" Content="TvWish" HorizontalAlignment="Center">
    <Button.Command>
    <CommandList>

    <!--<Command Source="{StaticResource MyTestPluginSlimTv}" Path="SlimTv" Parameters="huhatest"/>-->
    <!--Parameters="{LateBoundValue BindingValue={Binding Path=SearchCity}}"/>-->

    <Command Source="{StaticResource MyTestPluginSlimTv}" Path="SlimTv" Parameters="{LateBoundValue BindingValue={Binding Source={StaticResource SlimTvMultiChannelGuide},Path=CurrentProgram.Title}}"/>
    <Command Source="{Service ScreenManager}" Path="CloseTopmostDialog"/>
    </CommandList>
    </Button.Command>
    </Button>

    </Grid>

    </DockPanel>
    </ControlTemplate>
    </Include.Resources>
    </Include>

    is transferring now the selected program title from SlimTv to MyTestplugin via parameters.
     
    Last edited:

    Users who are viewing this thread

    Top Bottom