Are you sure you want to report the post shown below? This will send an email to the ATVO administrators. Please include a short reason for reporting.
Users reporting for no reason may be locked out.
using System;
using ATVO.ThemesSDK;
using ATVO.ThemeEditor.ThemeModels;
using ATVO.ThemeEditor.Scripting.DotNET;
using ATVO.ThemesSDK.Data.Results;
namespace Scripts
{
public class test : IScript
{
public object Execute(ThemeContentItem item, object value, string parameter, ISimulation sim)
{
// Bind to "entitysessionresult_object" value
// This puts the session result in the value as a type of IEntitySessionResult
// You must tell the compiler that this is the type you are expecting such
// that it knows what properties are available.
// Tell the compiler the value is of type IEntitySessionResult:
IEntitySessionResult result = (IEntitySessionResult) value;
// Check if driver is in first place
if (result.Position == 1)
{
// If so, return the text you want to display for P1
return "LIVE GAP";
}
else
{
// If not, return the live gap property
// The "ToString("0.0")" part controls how many decimals to display. Try "0.00" or "0.000" for example.
return result.LiveGap.ToString("0.0");
}
}
}
}
using System;
using ATVO.ThemesSDK;
using ATVO.ThemeEditor.ThemeModels;
using ATVO.ThemeEditor.Scripting.DotNET;
using ATVO.ThemesSDK.Data.Results;
namespace Scripts
{
public class test : IScript
{
public object Execute(ThemeContentItem item, object value, string parameter, ISimulation sim)
{
IEntitySessionResult result = (IEntitySessionResult) value;
if (result.Position == 1)
{
return "LIVE GAP";
}
else
{
return result.LiveGap.ToString("0.0");
}
}
}
}