WiFi configuration plugin - first experiences (1 Viewer)

chefkoch

Retired Team Member
  • Premium Supporter
  • October 5, 2004
    3,129
    1,634
    Dresden / Munich / Maastricht
    Home Country
    Germany Germany
    I am currently the WiFi plugin using my custom build https://github.com/chefkoch/MediaPortal-2/commits/CustomBuilds/130712

    And I have to admit that I really like it :) It looks pretty nice having having the connection bar on the right side of the list items :)
    20130712_164401.png


    The design can be improved, but that is not a top priority for a developer ;) Designers should bring up improvements for such things, even if the only draw the svg or xaml for it, and then get support "converting" it to MP2 compatible stuff with support by MP2 devs.
    • could the signal indicator colored red if signal is < 40% and
    • colored green if signal is > 90 or 85% ?
    Now to the dev-related things:
    • When disconnecting from wifi and reconnecting again, it the reconnected state is not detected and applied to the list item. Scanning for wifi networks again, displays the connection state correctly.
    • Would it be possible to scan for networks continuously while being in this screen? This would allow updating the signal and available networks.
    • If scanning for networks is kept as manual trigger by pressing the button it would be nice to have an indicator that something is going on, because from start to finish and updated network list there is a delay of a (only) a few seconds.
      Since this is not the only use case for a progress notifications, it might require additional code changes in core instead specifically to this plugin.
     
    Last edited:

    chefkoch

    Retired Team Member
  • Premium Supporter
  • October 5, 2004
    3,129
    1,634
    Dresden / Munich / Maastricht
    Home Country
    Germany Germany
    And again I have to notice: It is unbelievable what will be possible within MP2 :)
    Check out the definitions of the signal bars (beginning at <Path x:Name="signalBars" and ending at </Path>, of course):
    XML:
      <DataTemplate x:Key="WifiItemDataTemplate" DataType="{x:Type collections:ListItem}">
    	<DockPanel x:Name="ItemControl" LastChildFill="True">
     
    	  <Grid Width="30" DockPanel.Dock="Left">
    		<Path x:Name="selectedCheckMark" Width="26" Height="26" Stretch="None" IsVisible="{Binding Selected}"
    				Stroke="{ThemeResource ControlHandleColor}" StrokeThickness="1" Data="M8,13 L11,18 L18,6"/>
    	  </Grid>
     
    	  <StackPanel DockPanel.Dock="Right" Orientation="Horizontal">
     
    		<Path x:Name="signalBars" Width="25" Height="25" Stretch="None"
    				  Stroke="{ThemeResource ControlHandleColor}" StrokeThickness="1" Data="M0,25 L25,25 L25,0 L20,0 L20,5 L15,5 L15,10 L10,10 L10,15 L5,15 L5,20 L0,20 z">
    		  <Path.Fill>
    			<LinearGradientBrush StartPoint="0,1" EndPoint="1,1">
    			  <GradientStop Offset="0" Color="{ThemeResource PlayControlsFillColor1}"/>
    			  <GradientStop Offset="{Binding AdditionalProperties[SignalStrength]}" Color="{ThemeResource PlayControlsFillColor1}"/>
    			  <GradientStop Color="Transparent">
    				<GradientStop.Offset>
    				  <Binding Path="AdditionalProperties[SignalStrength]" Converter="{StaticResource ExpressionValueConverter}" ConverterParameter="{}{0} + 0.01f"/>
    				</GradientStop.Offset>
    			  </GradientStop>
    			  <GradientStop Offset="1" Color="Transparent"/>
    			</LinearGradientBrush >
    		  </Path.Fill>
    		</Path>
     
    		<Label HorizontalAlignment="Right" HorizontalContentAlignment="Right" VerticalAlignment="Center" FontSize="{ThemeResource SmallFontSize}" Color="{ThemeResource TextColor}" Width="70">
    		  <Label.Content>
    			<Binding Path="AdditionalProperties[SignalStrength]" Converter="{StaticResource StringFormatConverter}" ConverterParameter="{}{0:P0}"/>
    		  </Label.Content>
    		</Label>
     
    	  </StackPanel>
     
    	  <Label x:Name="ItemLabel" DockPanel.Dock="Center" Content="{Binding [Name]}"
    					HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="{ThemeResource SmallFontSize}"
    					Color="{ThemeResource TextColor}"/>
    	</DockPanel>
      </DataTemplate>

    These are defined once for the default skin, but are immediately available this way in all skins:
    20130712_172611.png 20130712_172638.png

    There are already so much other things available in MP2 like anyimations / storybords, etc... which are not used at all, but offer so much great skinning and design possibilities. :)
     
    Last edited:

    offbyone

    Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    Thanks :)
    Colors->Shouldn't be a problem with a converter.
    The "hardware" WLAN API is completely async, so a scan is triggered and then the other side must wait for the results. Could be that somewhere something is not catching a result.
    Automatic repeated scanning all the time is probably not a good idea. But I am not hardware guru on this :)
    And yes some kind of progress or general notification build into the core is needed a lot!
     

    chefkoch

    Retired Team Member
  • Premium Supporter
  • October 5, 2004
    3,129
    1,634
    Dresden / Munich / Maastricht
    Home Country
    Germany Germany
    Regarding continuously scan, I forgot to add that it might be enough to auto-trigger a scan every 15 seconds and only if you are within the network listing, which should not have any negative affects to the performance or the hardware.

    When I saw this thread https://forum.team-mediaportal.com/threads/request-wifi-plugin.49003/ (within our similar thread ;) ) I got the idea that skinners might want to put connection information also on the homescreen. So maybe an updated signal value is needed even if you are not within the network listing?
     

    offbyone

    Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    Not sure if this is really wanted/needed - usual use case would be that neither the box with MP2 installed nor the Wfi Router will move around :) So nothing ever changes about the signal strength - superfluous information :)
     

    chefkoch

    Retired Team Member
  • Premium Supporter
  • October 5, 2004
    3,129
    1,634
    Dresden / Munich / Maastricht
    Home Country
    Germany Germany
    It's a bit unfair to zoom into a screenshot to illustrate very minor issue, which I was not able to notice normally on my display (which is only 23") ;)
    Again this is something that can be solved in future by designers, if there will be some ;)

    20130712_180944.png
     

    offbyone

    Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    No it can't, because it is a skinengine bug :) I have tried to find it but was unsuccessfull :(

    I am using a fill for the path, as you can see in the xaml above, with the % set to the wifi strength. The skinengine fills the wrong pixels.
     
    Last edited:

    offbyone

    Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    But then you can`t easily set a precentage for the fill.
     

    chefkoch

    Retired Team Member
  • Premium Supporter
  • October 5, 2004
    3,129
    1,634
    Dresden / Munich / Maastricht
    Home Country
    Germany Germany
    yep, not linear, but atleast every 20% or similar.

    If keeping the current single "path" and xaml code for intended style (filling within bounds only) is correct, but displayed wrong, then it's a skin engine bug that should be added to JIRA.
     
    Last edited:

    Users who are viewing this thread

    Top Bottom