logo

Live Production Software Forums


Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
JonnyNoblett  
#1 Posted : Friday, April 7, 2017 8:57:44 AM(UTC)
JonnyNoblett

Rank: Advanced Member

Groups: Registered
Joined: 2/18/2017(UTC)
Posts: 46
Location: Edinburgh

Thanks: 23 times
Was thanked: 3 time(s) in 3 post(s)
Hi - I have a JSON file with some live results

https://www.zwiftpower.c...ache/live/5490_8700.json

I want to show the top 10 and certain columns but I also want to show particular information from selected rows and columns.

I made this title I was hoping to use but I hit the stumbling block of how to get the data out i wanted.
File Attachment(s):
LIVE-POS.xaml (7kb) downloaded 17 time(s).

You cannot view/download attachments. Try to login or register.
DWAM  
#2 Posted : Friday, April 7, 2017 9:10:36 AM(UTC)
DWAM

Rank: Advanced Member

Groups: Registered
Joined: 3/20/2014(UTC)
Posts: 2,721
Man
France
Location: Bordeaux, France

Thanks: 243 times
Was thanked: 794 time(s) in 589 post(s)
Hi!

Quote:
I want to show the top 10

You can't do that with this JSON source. It'd require you to convert rows to columns which, I just tried, don't seem to work in vMix

However you can use this datasource for displaying information in your titles based on rows selection and picking the good columns.

Guillaume
thanks 1 user thanked DWAM for this useful post.
JonnyNoblett on 4/8/2017(UTC)
JonnyNoblett  
#3 Posted : Friday, April 7, 2017 9:16:47 AM(UTC)
JonnyNoblett

Rank: Advanced Member

Groups: Registered
Joined: 2/18/2017(UTC)
Posts: 46
Location: Edinburgh

Thanks: 23 times
Was thanked: 3 time(s) in 3 post(s)
But I can't do multiple row selection to display multiple rows in the same title?
DWAM  
#4 Posted : Friday, April 7, 2017 9:30:58 AM(UTC)
DWAM

Rank: Advanced Member

Groups: Registered
Joined: 3/20/2014(UTC)
Posts: 2,721
Man
France
Location: Bordeaux, France

Thanks: 243 times
Was thanked: 794 time(s) in 589 post(s)
Nope!

the only way to do a top10 in vMix is to have all 10 information as a single row, like:

ID1, name1, ranking1, ID2, name2, ranking2, ID3, name3, ranking3, etc...

vMix can only work with one row at a time
thanks 1 user thanked DWAM for this useful post.
JonnyNoblett on 4/8/2017(UTC)
JonnyNoblett  
#5 Posted : Saturday, April 8, 2017 5:30:41 AM(UTC)
JonnyNoblett

Rank: Advanced Member

Groups: Registered
Joined: 2/18/2017(UTC)
Posts: 46
Location: Edinburgh

Thanks: 23 times
Was thanked: 3 time(s) in 3 post(s)
Thanks DWAM for the help - we now have it working as the JSON files were written for our use.

Within the title fields do you know how to limit the number of shown characters in the xaml file? e.g. limit the characters from a JSON field to show first 10 only?

DWAM  
#6 Posted : Saturday, April 8, 2017 5:37:39 AM(UTC)
DWAM

Rank: Advanced Member

Groups: Registered
Joined: 3/20/2014(UTC)
Posts: 2,721
Man
France
Location: Bordeaux, France

Thanks: 243 times
Was thanked: 794 time(s) in 589 post(s)
Quote:
Within the title fields do you know how to limit the number of shown characters in the xaml file?


With vMix Title Designer you can simply do this by setting the width of the text area to match your need.

Otherwise you need to use Expression Blend to create the XAML file
thanks 1 user thanked DWAM for this useful post.
JonnyNoblett on 4/8/2017(UTC)
JonnyNoblett  
#7 Posted : Saturday, April 8, 2017 5:41:00 AM(UTC)
JonnyNoblett

Rank: Advanced Member

Groups: Registered
Joined: 2/18/2017(UTC)
Posts: 46
Location: Edinburgh

Thanks: 23 times
Was thanked: 3 time(s) in 3 post(s)
I set the text area but it overlfows onto the next line - which seams odd

File Attachment(s):
LIVE-POS.xaml (13kb) downloaded 2 time(s).

You cannot view/download attachments. Try to login or register.
DWAM  
#8 Posted : Saturday, April 8, 2017 6:02:23 AM(UTC)
DWAM

Rank: Advanced Member

Groups: Registered
Joined: 3/20/2014(UTC)
Posts: 2,721
Man
France
Location: Bordeaux, France

Thanks: 243 times
Was thanked: 794 time(s) in 589 post(s)
Yep sorry my mistake. This is the default behaviour.

I'm afraid you will need to use Blend with a "substring" or a "left" command

If your data source was XML, I think you could do it directly with XPath
thanks 1 user thanked DWAM for this useful post.
JonnyNoblett on 4/8/2017(UTC)
doggy  
#9 Posted : Saturday, April 8, 2017 6:39:05 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,085
Belgium
Location: Belgium

Thanks: 284 times
Was thanked: 920 time(s) in 759 post(s)
or change some of the code

mtl:TextBlockDesign is a vMix asset in the xaml code which allows you to have a colored stroke around the characters

Personally i prefer the standard TextBlock and add TextTrimming="CharacterEllipsis" to it to solve the truncating issue and show text has been shortened


try changing the code : replace mtl:TextBlockDesign with TextBlock and delete Fill="#FFFFFFFF" and add TextTrimming="CharacterEllipsis" in each line and see if that suits you

EDIT: REPLACE Fill with Foreground !
thanks 2 users thanked doggy for this useful post.
DWAM on 4/8/2017(UTC), JonnyNoblett on 4/8/2017(UTC)
doggy  
#10 Posted : Saturday, April 8, 2017 6:42:47 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,085
Belgium
Location: Belgium

Thanks: 284 times
Was thanked: 920 time(s) in 759 post(s)
PS as far as i saw single long words are ok, problem arises when using multiple words in a textblock

edit: when using vMix TextBlockDesign !
thanks 1 user thanked doggy for this useful post.
JonnyNoblett on 4/8/2017(UTC)
JonnyNoblett  
#11 Posted : Saturday, April 8, 2017 10:49:07 AM(UTC)
JonnyNoblett

Rank: Advanced Member

Groups: Registered
Joined: 2/18/2017(UTC)
Posts: 46
Location: Edinburgh

Thanks: 23 times
Was thanked: 3 time(s) in 3 post(s)
Yeah I can't get it to work with multiple words - Will have to think further.
doggy  
#12 Posted : Saturday, April 8, 2017 11:02:59 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,085
Belgium
Location: Belgium

Thanks: 284 times
Was thanked: 920 time(s) in 759 post(s)
JonnyNoblett wrote:
Yeah I can't get it to work with multiple words - Will have to think further.


What not ?
thanks 1 user thanked doggy for this useful post.
JonnyNoblett on 4/8/2017(UTC)
JonnyNoblett  
#13 Posted : Saturday, April 8, 2017 11:31:27 AM(UTC)
JonnyNoblett

Rank: Advanced Member

Groups: Registered
Joined: 2/18/2017(UTC)
Posts: 46
Location: Edinburgh

Thanks: 23 times
Was thanked: 3 time(s) in 3 post(s)
The truncating of the field doesn't work with multiple words
doggy  
#14 Posted : Saturday, April 8, 2017 11:42:19 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,085
Belgium
Location: Belgium

Thanks: 284 times
Was thanked: 920 time(s) in 759 post(s)
Weird as it did before i posted it by making changes to your code
Use TextTrimming a lot myself
thanks 1 user thanked doggy for this useful post.
JonnyNoblett on 4/8/2017(UTC)
doggy  
#15 Posted : Saturday, April 8, 2017 12:06:43 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,085
Belgium
Location: Belgium

Thanks: 284 times
Was thanked: 920 time(s) in 759 post(s)
Code:
<UserControl Width="1920" Height="1080" Panel.ZIndex="500" InputMethod.IsInputMethodEnabled="True" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mtl="clr-namespace:vMixTitleLibrary;assembly=vMixTitleLibrary">
  <Grid InputMethod.IsInputMethodEnabled="True">
    <TextBlock FontStyle="Normal" FontWeight="Bold" FontFamily="Proxima Nova Alt" TextTrimming="CharacterEllipsis" Foreground="White" FontSize="20" Text="Word1 Word2 Word3" Name="NAME1" Width="180" Height="24.3600006103516" Margin="5,355,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Visibility="Visible" InputMethod.IsInputMethodEnabled="True"  />
    <TextBlock FontStyle="Normal" FontWeight="Bold" FontFamily="Proxima Nova Alt" TextTrimming="WordEllipsis" Foreground="White" FontSize="20" Text="Word1 Word2 Word3" Name="NAME2" Width="180" Height="24.3600006103516" Margin="5,390,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Visibility="Visible" InputMethod.IsInputMethodEnabled="True" />
    <TextBlock FontStyle="Normal" FontWeight="Bold" FontFamily="Proxima Nova Alt" Foreground="White" FontSize="20" Text="Word1 Word2 Word3" Name="NAME3" Width="180" Height="24.3600006103516" Margin="5,425,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Visibility="Visible" InputMethod.IsInputMethodEnabled="True" />
   </Grid>
</UserControl>


Name1 has TextTrimming="CharacterEllipsis"
Name2 has TextTrimming="WordEllipsis"
Name3 has no trimming

Check the difference
thanks 1 user thanked doggy for this useful post.
JonnyNoblett on 4/8/2017(UTC)
JonnyNoblett  
#16 Posted : Saturday, April 8, 2017 12:08:05 PM(UTC)
JonnyNoblett

Rank: Advanced Member

Groups: Registered
Joined: 2/18/2017(UTC)
Posts: 46
Location: Edinburgh

Thanks: 23 times
Was thanked: 3 time(s) in 3 post(s)
Thanks i will try it - is it maybe because the Text is actually an input from a value from a JSON file?
doggy  
#17 Posted : Saturday, April 8, 2017 12:19:39 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,085
Belgium
Location: Belgium

Thanks: 284 times
Was thanked: 920 time(s) in 759 post(s)
JonnyNoblett wrote:
Thanks i will try it - is it maybe because the Text is actually an input from a value from a JSON file?


Nope as i just tested the example it with your JSON link
You will have a display problem with some of the data in the file though , example name = Lukman &#039;Ascenders Team&#039;
thanks 1 user thanked doggy for this useful post.
JonnyNoblett on 4/8/2017(UTC)
JonnyNoblett  
#18 Posted : Saturday, April 8, 2017 12:45:10 PM(UTC)
JonnyNoblett

Rank: Advanced Member

Groups: Registered
Joined: 2/18/2017(UTC)
Posts: 46
Location: Edinburgh

Thanks: 23 times
Was thanked: 3 time(s) in 3 post(s)
Thank you so much I have managed to get it working!
doggy  
#19 Posted : Saturday, April 8, 2017 12:57:47 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,085
Belgium
Location: Belgium

Thanks: 284 times
Was thanked: 920 time(s) in 759 post(s)
Glad you did

Quote:
the JSON files were written for our use.


now make sure the JSON file (or any other type) is also created properly to get rid of the unreadable characters ;-) (saved as UTF8 compliant or whatever its called)
thanks 1 user thanked doggy for this useful post.
JonnyNoblett on 4/8/2017(UTC)
JonnyNoblett  
#20 Posted : Saturday, April 8, 2017 1:09:35 PM(UTC)
JonnyNoblett

Rank: Advanced Member

Groups: Registered
Joined: 2/18/2017(UTC)
Posts: 46
Location: Edinburgh

Thanks: 23 times
Was thanked: 3 time(s) in 3 post(s)
Yeah - we have that planned so then it will look nice and tidy.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.