import smartpaging import helper from System.Threading.Tasks import Task from System.IO import Path, File highlightStart = 0.0 highlightSubtract = 0.184 def __onStart(graphicOnAirItem, momentExecution, workFlowtype, graphicOnAirItems): Scheduler.ClearScheduler() extradata = graphicOnAirItem.ExtraData graphicOnAir = IntelliflowController.GetGraphicOnAirItems(graphicOnAirItem.Graphic, OutputManager.ActiveChannelOutput) if not graphicOnAir: list = [] for player in Game.AwayTeam.InPlayByKeeperAndShirt: list.append(player) list.append(Game.AwayTeam.Coach) results = list #Game.AwayTeam.InPlayByKeeperAndShirt counter = len(results) + 1 if counter == 0 or counter == 1: momentExecution.Message = "AWAY LINEUP: No players In play!" momentExecution.Cancel = True return extradata["index"] = 0 extradata["pageIndex"] = 0 extradata["pages"] = smartpaging.NonUniformPaging(counter, 1 if counter > 2 else 2) extradata["players"] = results extradata["highlightStart"] = highlightStart else: if not "pageIndex" in extradata: momentExecution.Cancel = True return def __getData(graphicOnAirItem, viewBag, momentExecution): extradata = graphicOnAirItem.ExtraData viewBag.SetString("tCaptainInfo", "C") viewBag.SetString("tPlayerInfo", "GK") viewBag.SetFloat("vHighlightType", 1) ### TEAM INFORMATION logosPath = Path.Combine(graphicOnAirItem.GraphicsEngine.Options.RootPath, graphicOnAirItem.Scene.Path, "Images", "Badges") team_path = Path.Combine(logosPath, "%s.png"%(Game.AwayTeam.RefName)) if File.Exists(team_path): viewBag.SetImage("lgTeamBadge", "Images\Badges\%s.png" % Game.AwayTeam.RefName) else: viewBag.SetImage("lgTeamBadge", "Images\\vaz.png") viewBag.SetString("tTeamName", Game.AwayTeam.ShortName.upper()) ### COACH INFORMATION viewBag.SetTranslatedText("tCoachFunction", "{{%s}}.{{CoachLineUp}}|filter:ToUpper " % Game.AwayTeam.Coach.Function) viewBag.SetString("tCoachFirstName", Game.AwayTeam.Coach.FirstName) viewBag.SetString("tCoachLastName", Game.AwayTeam.Coach.LastName) viewBag.SetVisibility("vCoachAtRiskVisibility", Game.AwayTeam.Coach.AtRisk) for enum,player in enumerate(Game.AwayTeam.InPlayByKeeperAndShirt): viewBag.SetVisibility("vAtRiskVisibility%02d" % (enum+1), player.AtRisk) viewBag.SetVisibility("vPlayerInfo%02dVisibility" % (enum+1), player.IsGoalKeeper) viewBag.SetString("tNumber%02d" % (enum+1), player.Number) if player.IsCaptain: viewBag.SetFloat("vTypeCaptain", enum+1) if player.OtherNames: viewBag.SetString("tLastName%02d" % (enum+1), player.OtherNames.upper()) else: viewBag.SetString("tName%02d" % (enum+1), player.FirstName.upper()) viewBag.SetString("tLastName%02d" % (enum+1), player.LastName.upper()) playerPath = Path.Combine(graphicOnAirItem.GraphicsEngine.Options.RootPath, graphicOnAirItem.Scene.Path, "Images", "Photos", Game.AwayTeam.RefName.ToString(), "%s.png" % Game.AwayTeam.InPlayByKeeperAndShirt[0].RefName.ToString()) if File.Exists(playerPath): viewBag.SetImage("lgPhoto", "Images\Photos\%s\%s.png" % (Game.AwayTeam.RefName.ToString(), Game.AwayTeam.InPlayByKeeperAndShirt[0].RefName.ToString())) else: viewBag.SetImage("lgPhoto", "Images\Photos\\vaz.png") viewBag.SetFloat("vHighlightStart", 0) viewBag.SetFloat("vHighlightEnd", 0) def __continueGraphic(args): graphicOnAirItem, momentExecution, graphicOnAirItems = args extradata = graphicOnAirItem.ExtraData pages = extradata["pages"] total = extradata["total"] index = extradata["index"] players = extradata["players"] viewBag = IntelliflowController.CreateViewBag() if int(index) == 0: for g in graphicOnAirItems: g.Scene.Show("BadgeToPhoto") g.Scene.Wait("BadgeToPhoto") g.Scene.Show("Highlight_In") g.Scene.Show("Highlight_Scroll") else: if index == 11: viewBag.SetFloat("vHighlightType", 2) playerPath = Path.Combine(graphicOnAirItem.GraphicsEngine.Options.RootPath, graphicOnAirItem.Scene.Path, "Images", "Photos", Game.AwayTeam.RefName.ToString(), "%s.png" % players[int(index)].RefName.ToString()) if File.Exists(playerPath): viewBag.SetImage("lgPhoto", "Images\Photos\%s\%s.png" % (Game.AwayTeam.RefName.ToString(), players[int(index)].RefName.ToString())) else: viewBag.SetImage("lgPhoto", "Images\Photos\\vaz.png") viewBag.SetFloat("vHighlightStart", extradata["highlightStart"] + 0.184) viewBag.SetFloat("vHighlightEnd", extradata["highlightStart"]) for render in graphicOnAirItems: render.Scene.FillTags(viewBag) for g in graphicOnAirItems: g.Scene.Show("PhotoChange_In") g.Scene.Show("Highlight_Scroll") helper.SetExtraData(extradata, "highlightStart", extradata["highlightStart"] - highlightSubtract) delay = int(Project.ProjectSettings["LineUpTactical Timer (ms)"]) / extradata["pages"].Count if index < 11: extradata["index"] = extradata["index"] + 1 args = [graphicOnAirItem, momentExecution, graphicOnAirItems] Scheduler.Add(Script.RefName, "__continueGraphic", Project.Name, args, delay) else: Scheduler.Add(Script.RefName, "__takeOut", Project.Name, graphicOnAirItem, delay) def __afterProgram(graphicOnAirItem, momentExecution, graphicOnAirItems): extradata = graphicOnAirItem.ExtraData pages = extradata["pages"] index = extradata["index"] delay = int(Project.ProjectSettings["LineUpTactical Timer (ms)"]) / extradata["pages"].Count if index < pages: args = [graphicOnAirItem, momentExecution, graphicOnAirItems] Scheduler.Add(Script.RefName, "__continueGraphic", Project.Name, args, delay) def __takeOut(graphicOnAirItem): IntelliflowController.TakeOut(graphicOnAirItem.Graphic, OutputManager.ActiveChannelOutput) def __beforeProgramOut(graphicOnAirItem, momentExecution): Scheduler.ClearScheduler() def __afterPanic(graphicOnAirItem, momentExecution): Scheduler.ClearScheduler()