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
hpages  
#1 Posted : Tuesday, October 6, 2020 5:09:04 AM(UTC)
hpages

Rank: Member

Groups: Registered
Joined: 8/26/2020(UTC)
Posts: 16
Man
United States
Location: Charlotte

Thanks: 1 times
So I have a title and script that I have running with race scoring data. The race data outputs a text of "+1 lap" when in reality it should just be blank. So because i cant change how the data is created I have a script running to replace the text "+1 lap" with "" (blank). This for the most part works, however the "+1 lap" text flashes periodically, so its not a clean replacement. Is there something I'm missing that could eliminate this flashing? I've included the script I'm running for the timing and a video example below.

Thanks for any assistance.


video example (position 5)


Script:

Quote:
while (true)

if Input.Find("Time Side Bar").Text("Time 2.Text")="+1 lap"

Input.Find("Time Side Bar").Text("Time 2.Text")=""

end if

if Input.Find("Time Side Bar").Text("Time 3.Text")="+1 lap"

Input.Find("Time Side Bar").Text("Time 3.Text")=""

end if

if Input.Find("Time Side Bar").Text("Time 4.Text")="+1 lap"

Input.Find("Time Side Bar").Text("Time 4.Text")=""

end if

if Input.Find("Time Side Bar").Text("Time 5.Text")="+1 lap"

Input.Find("Time Side Bar").Text("Time 5.Text")=""

end if

if Input.Find("Time Side Bar").Text("Time 6.Text")="+1 lap"

Input.Find("Time Side Bar").Text("Time 6.Text")=""

end if

if Input.Find("Time Side Bar").Text("Time 7.Text")="+1 lap"

Input.Find("Time Side Bar").Text("Time 7.Text")=""

end if

if Input.Find("Time Side Bar").Text("Time 8.Text")="+1 lap"

Input.Find("Time Side Bar").Text("Time 8.Text")=""

end if

if Input.Find("Time Side Bar").Text("Time 9.Text")="+1 lap"

Input.Find("Time Side Bar").Text("Time 9.Text")=""

end if

if Input.Find("Time Side Bar").Text("Time 10.Text")="+1 lap"

Input.Find("Time Side Bar").Text("Time 10.Text")=""


end if
End While


doggy  
#2 Posted : Tuesday, October 6, 2020 5:22:26 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
That's completely normal as you do your value checking after it has been loaaded/displayed already (textblock received the value first)

best option is to use duplicate hidden textboxes , check and proces their values and plce the result in the visible textboxes

Also refine the code (less then 10 lines) with a loop and nr variable = less code written as they are all the same test anyway , only thing that changes is the textbox number value
hpages  
#3 Posted : Tuesday, October 6, 2020 6:37:06 AM(UTC)
hpages

Rank: Member

Groups: Registered
Joined: 8/26/2020(UTC)
Posts: 16
Man
United States
Location: Charlotte

Thanks: 1 times
I see, I'll give the hidden boxes a run and see how it works for me.

Not sure how to go about the loop and nr variable as I'm just figuring out scripts for these things.
doggy  
#4 Posted : Tuesday, October 6, 2020 6:39:02 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: hpages Go to Quoted Post
I see, I'll give the hidden boxes a run and see how it works for me.

Not sure how to go about the loop and nr variable as I'm just figuring out scripts for these things.


something like this (partially tested)

Code:
dim HiddenTextBox As string = ""
do while true
   For X As Integer = 1 To 10
	HiddenTextBox = Input.Find("Time Side Bar").Text("TestBlock"  + X.tostring + ".Text")

	if HiddenText = "+1 lap"
		Input.Find("Time Side Bar").Text("Time "  + X.tostring + ".Text")= ""
	else
		Input.Find("Time Side Bar").Text("Time "  + X.tostring + ".Text")= HiddenTextBox
	end if
   next
loop
hpages  
#5 Posted : Tuesday, October 6, 2020 7:23:04 AM(UTC)
hpages

Rank: Member

Groups: Registered
Joined: 8/26/2020(UTC)
Posts: 16
Man
United States
Location: Charlotte

Thanks: 1 times
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: hpages Go to Quoted Post
I see, I'll give the hidden boxes a run and see how it works for me.

Not sure how to go about the loop and nr variable as I'm just figuring out scripts for these things.


something like this (partially tested)

Code:
dim HiddenTextBox As string = ""
do while true
   For X As Integer = 1 To 10
	HiddenTextBox = Input.Find("Time Side Bar").Text("TestBlock"  + X.tostring + ".Text")

	if HiddenText = "+1 lap"
		Input.Find("Time Side Bar").Text("Time "  + X.tostring + ".Text")= ""
	else
		Input.Find("Time Side Bar").Text("Time "  + X.tostring + ".Text")= HiddenTextBox
	end if
   next
loop


I've attempted the hidden text box method with both my script and the one you provided. The issue still occurs like it has been with my script even though I have it reading the hidden text boxes (ex: Hide Time 2.text)

When I used the code you provided, it actually wiped all of the timing data off regardless of the +1 lap requirement. I used the code below

Code:
dim HiddenTextBox As string = ""
do while true
   For X As Integer = 2 To 10
	HiddenTextBox = Input.Find("Time Side Bar").Text("Hide Time"  + X.tostring + ".Text")

	if HiddenTextBox = "+1 lap"
		Input.Find("Time Side Bar").Text("Time "  + X.tostring + ".Text")= ""
	else
		Input.Find("Time Side Bar").Text("Time "  + X.tostring + ".Text")= HiddenTextBox
	end if
   next
loop


doggy  
#6 Posted : Tuesday, October 6, 2020 5:27:51 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Quote:
I've attempted the hidden text box method with both my script and the one you provided. The issue still occurs like it has been with my script even though I have it reading the hidden text boxes (ex: Hide Time 2.text)

When I used the code you provided, it actually wiped all of the timing data off regardless of the +1 lap requirement. I used the code below


Did you change the data connection too? your source connected to the "Hide Time" textblocks ?

also i noticed you have a habit of using spaces in the names (bad habit) and following your habit you might have missed one after "Hide Time" in the code
thanks 1 user thanked doggy for this useful post.
hpages on 10/8/2020(UTC)
hpages  
#7 Posted : Thursday, October 8, 2020 5:27:23 AM(UTC)
hpages

Rank: Member

Groups: Registered
Joined: 8/26/2020(UTC)
Posts: 16
Man
United States
Location: Charlotte

Thanks: 1 times
Originally Posted by: doggy Go to Quoted Post
Quote:
I've attempted the hidden text box method with both my script and the one you provided. The issue still occurs like it has been with my script even though I have it reading the hidden text boxes (ex: Hide Time 2.text)

When I used the code you provided, it actually wiped all of the timing data off regardless of the +1 lap requirement. I used the code below


Did you change the data connection too? your source connected to the "Hide Time" textblocks ?

also i noticed you have a habit of using spaces in the names (bad habit) and following your habit you might have missed one after "Hide Time" in the code


Thank you for your script and guidance! I was able to figure out what I was doing wrong and managed to make some additions to your script to suit our needs as well! Everything works great now!

I'm also making a note to not use spaces in my titling from now on.

Script I ended up with:

Code:

dim HiddenTextBox As string = ""
do while true
   For X As Integer = 2 To 10
   
	HiddenTextBox = Input.Find("Time Side Bar").Text("Hide_Time_"+X.tostring+".Text")

	if HiddenTextBox = "+1 lap" or HiddenTextBox = ""
		Input.Find("Time Side Bar").Text("Time "  + X.tostring + ".Text")= ""
            Input.Find("Time Side Bar").Text("Plus Sign "  + X.tostring + ".Text")= ""
            
     elseif HiddenTextBox = "+2 laps"
		Input.Find("Time Side Bar").Text("Time "  + X.tostring + ".Text")= "1 lap"
            Input.Find("Time Side Bar").Text("Plus Sign "  + X.tostring + ".Text")= "+"

      else
		Input.Find("Time Side Bar").Text("Time "  + X.tostring + ".Text")= HiddenTextBox
	      Input.Find("Time Side Bar").Text("Plus Sign "  + X.tostring + ".Text")= "+"
      end if
   next
loop
hpages  
#8 Posted : Friday, October 9, 2020 4:55:51 AM(UTC)
hpages

Rank: Member

Groups: Registered
Joined: 8/26/2020(UTC)
Posts: 16
Man
United States
Location: Charlotte

Thanks: 1 times
Quote:

something like this (partially tested)

Code:
dim HiddenTextBox As string = ""
do while true
   For X As Integer = 1 To 10
	HiddenTextBox = Input.Find("Time Side Bar").Text("TestBlock"  + X.tostring + ".Text")

	if HiddenText = "+1 lap"
		Input.Find("Time Side Bar").Text("Time "  + X.tostring + ".Text")= ""
	else
		Input.Find("Time Side Bar").Text("Time "  + X.tostring + ".Text")= HiddenTextBox
	end if
   next
loop


Follow up to this,

Is there a way I can make the text boxes fill in three numbers after the decimal point? I know there's a way to format the text and I haven't stumbled across a solution yet.

EX: "0.6" would be displayed "0.600" and "2" would be displayed "2.000"

Users browsing this topic
Guest (2)
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.