コード例 #1
0
 public EditCategoryDialog(ProjectLongoMatch project, DashboardButton tagger, Window parent)
 {
     TransientFor = parent;
     this.Build ();
     timenodeproperties2.Tagger = tagger;
     timenodeproperties2.Dashboard = project.Dashboard;
 }
コード例 #2
0
 public void ShowStats(ProjectLongoMatch project)
 {
     StatsDialog statsui = new StatsDialog ();
     statsui.LoadStats (project);
     statsui.Run ();
     statsui.Destroy ();
 }
コード例 #3
0
        public static void Render(object item, ProjectLongoMatch project, int count, bool isExpanded, IDrawingToolkit tk,
		                           IContext context, Area backgroundArea, Area cellArea, CellState state)
        {
            if (item is EventType) {
                RenderAnalysisCategory (item as EventType, count, isExpanded, tk,
                    context, backgroundArea, cellArea);
            } else if (item is SubstitutionEvent) {
                SubstitutionEvent s = item as SubstitutionEvent;
                RenderSubstitution (s.Color, s.EventTime, s.In, s.Out, s.Playing, isExpanded, tk, context,
                    backgroundArea, cellArea, state);
            } else if (item is TimelineEvent) {
                TimelineEventLongoMatch p = item as TimelineEventLongoMatch;
                // always add local first.
                RenderPlay (p.Color, p.Miniature, p.Players, p.Teams, p.Playing, p.Description, count, isExpanded, tk,
                    context, backgroundArea, cellArea, state);
            } else if (item is Player) {
                RenderPlayer (item as PlayerLongoMatch, count, isExpanded, tk, context, backgroundArea, cellArea);
            } else if (item is Playlist) {
                RenderPlaylist (item as Playlist, count, isExpanded, tk, context, backgroundArea, cellArea);
            } else if (item is PlaylistPlayElement) {
                PlaylistPlayElement p = item as PlaylistPlayElement;
                RenderPlay (p.Play.EventType.Color, p.Miniature, null, null, p.Selected, p.Description, count, isExpanded, tk,
                    context, backgroundArea, cellArea, state);
            } else if (item is IPlaylistElement) {
                IPlaylistElement p = item as IPlaylistElement;
                RenderPlay (App.Current.Style.PaletteActive, p.Miniature, null, null, p.Selected, p.Description,
                    count, isExpanded, tk, context, backgroundArea, cellArea, state);
            } else {
                Log.Error ("No renderer for type " + item.GetType ());
            }
        }
コード例 #4
0
 public EditCategoryDialog(ProjectLongoMatch project, EventType eventType, Window parent)
 {
     TransientFor = parent;
     this.Build ();
     timenodeproperties2.EventType = eventType;
     timenodeproperties2.Dashboard = project.Dashboard;
 }
コード例 #5
0
 public void LoadStats(ProjectStats pstats, ProjectLongoMatch project)
 {
     categoryviewer1.HomeName = project.LocalTeamTemplate.TeamName;
     categoryviewer1.AwayName = project.VisitorTeamTemplate.TeamName;
     categoryviewer1.LoadBackgrounds (project);
     this.pstats = pstats;
     ReloadStats ();
 }
コード例 #6
0
 public EventTypeStats(ProjectLongoMatch project, EventsFilter filter, EventType evType)
 {
     Name = evType.Name;
     events = new List<TimelineEventLongoMatch> ();
     this.project = project;
     this.filter = filter;
     this.eventType = evType;
 }
コード例 #7
0
 public void SetFilter(EventsFilter filter, ProjectLongoMatch project)
 {
     this.local = project.LocalTeamTemplate;
     this.visitor = project.VisitorTeamTemplate;
     localTeam.Name = local.TeamName;
     visitorTeam.Name = visitor.TeamName;
     this.filter = filter;
     FillTree ();
 }
コード例 #8
0
ファイル: StatsDialog.cs プロジェクト: LongoMatch/longomatch
 public void LoadStats(ProjectLongoMatch project)
 {
     if (stats != null)
         stats.Dispose ();
     stats = new ProjectStats (project);
     categoriesviewer.LoadStats (stats, project);
     gameviewer.LoadProject (project, stats);
     /* Player stats are filtered */
     playersviewer.LoadProject (project, new ProjectStats (project));
 }
コード例 #9
0
        public PositionTagger(IWidget widget, ProjectLongoMatch project, List<TimelineEventLongoMatch> plays,
		                       Image background, FieldPositionType position)
            : base(widget)
        {
            Project = project;
            Background = background;
            Plays = plays;
            FieldPosition = position;
            BackgroundColor = App.Current.Style.PaletteBackground;
        }
コード例 #10
0
        public void ShowMenu(ProjectLongoMatch project, EventType eventType,
							  IList<TimelineEventLongoMatch> events)
        {
            this.eventType = eventType;
            this.events = events;
            SetupSortMenu ();
            MenuHelpers.FillAddToPlaylistMenu (addToPlaylistMenuItem, project.Playlists, events);
            MenuHelpers.FillExportToVideoFileMenu (exportToVideoFileItem, project, events, Catalog.GetString ("Export to video file"));
            Popup ();
        }
コード例 #11
0
ファイル: TimerStats.cs プロジェクト: LongoMatch/longomatch
 public TimerStats(ProjectLongoMatch project, TimerLongoMatch timer)
 {
     this.timer = timer;
     Name = timer.Name;
     if (timer.Team == TeamType.LOCAL) {
         TeamImage = project.LocalTeamTemplate.Shield;
     } else if (timer.Team == TeamType.VISITOR) {
         TeamImage = project.VisitorTeamTemplate.Shield;
     }
 }
コード例 #12
0
 public void SetProject(ProjectLongoMatch project, EventsFilter filter)
 {
     this.project = project;
     playsList.Filter = filter;
     localPlayersList.Filter = filter;
     visitorPlayersList.Filter = filter;
     playsList.Project = project;
     visitorPlayersList.Project = project;
     localPlayersList.Project = project;
     LoadIcons ();
     UpdateTeamsModels (new TeamTagsChangedEvent ());
 }
コード例 #13
0
		/// <summary>
		/// Migrate the specified project to the current version format.
		/// </summary>
		/// <param name="project">Project.</param>
		public static void Migrate (ProjectLongoMatch project)
		{
			/* Apply all the migration steps starting from the current version*/
			switch (project.Version) {
			case 0:
				Migrate0 (project);
				break;
			default:
				return;
			}
			Migrate (project);
		}
コード例 #14
0
ファイル: PlayerStats.cs プロジェクト: LongoMatch/longomatch
 public PlayerStats(ProjectLongoMatch project, EventsFilter filter, PlayerLongoMatch player)
 {
     this.project = project;
     this.filter = filter;
     this.Player = player;
     PlayerEventStats = new List<PlayerEventTypeStats> ();
     foreach (EventType evtType in project.EventTypes) {
         if (!(evtType is SubstitutionEventType)) {
             PlayerEventStats.Add (new PlayerEventTypeStats (project, filter, player, evtType));
         }
     }
     UpdateTimePlayed ();
 }
コード例 #15
0
        public void LoadProject(ProjectLongoMatch project, ProjectStats stats)
        {
            TreePath path;

            store.Clear ();
            pstats = stats;
            categoriesviewer.LoadStats (pstats, project);
            AddTeam (project.LocalTeamTemplate, project.Dashboard);
            AddTeam (project.VisitorTeamTemplate, project.Dashboard);
            path = new TreePath ("0:0");
            treeview1.ExpandAll ();
            treeview1.SetCursor (path, null, false);
        }
コード例 #16
0
ファイル: TestDatabase.cs プロジェクト: LongoMatch/longomatch
 public void TestAddProject()
 {
     string dbdir = Path.Combine (tmpdir, "test.ldb");
     DataBase db = new DataBase (dbdir);
     ProjectDescriptionLongoMatch pd1 = new ProjectDescriptionLongoMatch ();
     ProjectLongoMatch p1 = new ProjectLongoMatch {Description = pd1};
     Assert.IsTrue (db.AddProject (p1));
     Assert.IsTrue (File.Exists (Path.Combine (dbdir, p1.ID.ToString())));
     Assert.IsTrue (db.AddProject (p1));
     Assert.AreEqual (db.Count, 1);
     db = new DataBase (dbdir);
     Assert.AreEqual (db.Count, 1);
 }
コード例 #17
0
ファイル: TeamStats.cs プロジェクト: LongoMatch/longomatch
 public TeamStats(ProjectLongoMatch project, EventsFilter filter, TeamType team)
 {
     this.project = project;
     this.filter = filter;
     this.team = team;
     if (team == TeamType.LOCAL) {
         this.template = project.LocalTeamTemplate;
     } else {
         this.template = project.VisitorTeamTemplate;
     }
     PlayersStats = new List<PlayerStats> ();
     foreach (PlayerLongoMatch p in this.template.List) {
         PlayersStats.Add (new PlayerStats (project, filter, p));
     }
 }
コード例 #18
0
        public void LoadProject(ProjectLongoMatch project, EventsFilter filter)
        {
            this.project = project;
            if (project != null) {
                var timeLine = project.Timeline.OfType<TimelineEventLongoMatch> ();

                field.Tagger.Project = project;
                hfield.Tagger.Project = project;
                goal.Tagger.Project = project;
                field.Tagger.Background = project.GetBackground (FieldPositionType.Field);
                hfield.Tagger.Background = project.GetBackground (FieldPositionType.HalfField);
                goal.Tagger.Background = project.GetBackground (FieldPositionType.Goal);
                field.Tagger.Plays = timeLine;
                hfield.Tagger.Plays = timeLine;
                goal.Tagger.Plays = timeLine;
                field.Tagger.Filter = filter;
                hfield.Tagger.Filter = filter;
                goal.Tagger.Filter = filter;
            }
        }
コード例 #19
0
ファイル: PlayEditor.cs プロジェクト: LongoMatch/longomatch
        public void LoadPlay(TimelineEventLongoMatch play, ProjectLongoMatch project, bool editTags, bool editPos,
		                      bool editPlayers, bool editNotes)
        {
            this.play = play;
            notesframe.Visible = editNotes;
            tagger.Visible = editPos && (play.EventType.TagFieldPosition ||
            play.EventType.TagHalfFieldPosition ||
            play.EventType.TagGoalPosition);
            drawingarea3.Visible = editPlayers;
            nameframe.Visible = editTags;
            tagsvbox.Visible = editTags;

            nameentry.Text = play.Name;
            nameentry.GrabFocus ();

            if (editPos) {
                tagger.LoadBackgrounds (project);
                tagger.LoadPlay (play);
            }

            if (editNotes) {
                notes.Play = play;
            }
            if (editPlayers) {
                teamtagger.Project = project;
                teamtagger.LoadTeams (project.LocalTeamTemplate, project.VisitorTeamTemplate,
                    project.Dashboard.FieldBackground);
                /* Force lineup update */
                teamtagger.CurrentTime = play.EventTime;
                teamtagger.Select (play.Players.Cast<PlayerLongoMatch> ().ToList (),
                    play.Teams.Cast<SportsTeam> ().ToList ());
            }

            if (editTags) {
                FillTags (project, play);
            }
        }
コード例 #20
0
 void AddProject(string competition, string season, string homeTeam, string awayTeam)
 {
     ProjectLongoMatch p = new ProjectLongoMatch ();
     p.Description = new ProjectDescription {
         Competition = competition,
         Season = season,
         LocalName = homeTeam,
         VisitorName = awayTeam,
     };
     projects.Add (p);
 }
コード例 #21
0
        /// <summary>
        /// Updates the project description with a matching ID to the new description.
        /// </summary>
        /// <param name="description">Project Description.</param>
        public void UpdateProject(ProjectLongoMatch project)
        {
            TreeIter first;

            /* Projects are only update in the treeview mode */
            store.GetIterFirst (out first);
            while (store.IterIsValid (first)) {
                Project p = store.GetValue (first, COL_PROJECT) as Project;
                if (project.ID == p.ID) {
                    // Change value in model
                    store.SetValue (first, COL_DISPLAY_NAME, FormatDesc (project.Description));
                    store.SetValue (first, COL_PROJECT, project);
                    // Also update our internal list. Although it's a new instance of Project the ID is the same
                    // and IndexOf should return the index of the old project to replace.
                    projects [projects.IndexOf (project)] = project;
                    break;
                }
                store.IterNext (ref first);
            }
        }
コード例 #22
0
 public static bool ShowStats(ProjectLongoMatch project)
 {
     IStatsUI statsUI = AddinManager.GetExtensionObjects<IStatsUI> ().OrderByDescending (p => p.Priority).FirstOrDefault ();
     if (statsUI != null) {
         statsUI.ShowStats (project);
         return true;
     }
     return false;
 }
コード例 #23
0
ファイル: TestProject.cs プロジェクト: LongoMatch/longomatch
        public void TestEquals()
        {
            ProjectLongoMatch p1 = CreateProject ();
            ProjectLongoMatch p2 = Utils.SerializeDeserialize (p1);
            ProjectLongoMatch p3 = new ProjectLongoMatch ();

            Assert.IsTrue (p1.Equals (p2));
            Assert.IsFalse (p1.Equals (p3));
        }
コード例 #24
0
ファイル: TestProject.cs プロジェクト: LongoMatch/longomatch
        ProjectLongoMatch CreateProject(bool fill = true)
        {
            ProjectLongoMatch p = new ProjectLongoMatch ();
            p.Dashboard = DashboardLongoMatch.DefaultTemplate (10);
            p.UpdateEventTypesAndTimers ();
            p.LocalTeamTemplate = SportsTeam.DefaultTemplate (10);
            p.VisitorTeamTemplate = SportsTeam.DefaultTemplate (12);
            MediaFile mf = new MediaFile ("path", 34000, 25, true, true, "mp4", "h264",
                               "aac", 320, 240, 1.3, null, "Test asset");
            var pd = new ProjectDescription ();
            pd.FileSet = new MediaFileSet ();
            pd.FileSet.Add (mf);
            p.Description = pd;
            if (fill) {
                p.AddEvent (p.EventTypes [0], new Time (1000), new Time (2000), null, null);
                p.AddEvent (p.EventTypes [0], new Time (1000), new Time (2000), null, null);
                p.AddEvent (p.EventTypes [1], new Time (1000), new Time (2000), null, null);
                p.AddEvent (p.EventTypes [2], new Time (1000), new Time (2000), null, null);
                p.AddEvent (p.EventTypes [2], new Time (1000), new Time (2000), null, null);
                p.AddEvent (p.EventTypes [2], new Time (1000), new Time (2000), null, null);
                p.AddEvent (p.EventTypes [6], new Time (1000), new Time (2000), null, null);
            }

            return p;
        }
コード例 #25
0
ファイル: TestProject.cs プロジェクト: LongoMatch/longomatch
        public void TestUpdateEventTypesAndTimers()
        {
            ProjectLongoMatch p = new ProjectLongoMatch ();
            p.Dashboard = DashboardLongoMatch.DefaultTemplate (5);
            Assert.AreEqual (0, p.Timers.Count);
            Assert.AreEqual (0, p.EventTypes.Count);
            p.UpdateEventTypesAndTimers ();
            Assert.AreEqual (1, p.Timers.Count);
            Assert.AreEqual (10, p.EventTypes.Count);

            // Delete a category button with no events
            p.Dashboard.List.Remove (p.Dashboard.List.OfType<AnalysisEventButton> ().First ());
            p.UpdateEventTypesAndTimers ();
            Assert.AreEqual (1, p.Timers.Count);
            Assert.AreEqual (9, p.EventTypes.Count);

            // Delete a category button with events in the timeline
            AnalysisEventButton button = p.Dashboard.List.OfType<AnalysisEventButton> ().First ();
            p.Timeline.Add (new TimelineEventLongoMatch { EventType = button.EventType });
            p.UpdateEventTypesAndTimers ();
            Assert.AreEqual (1, p.Timers.Count);
            Assert.AreEqual (9, p.EventTypes.Count);
            p.Dashboard.List.Remove (button);
            p.UpdateEventTypesAndTimers ();
            Assert.AreEqual (1, p.Timers.Count);
            Assert.AreEqual (9, p.EventTypes.Count);

            // Remove the event from the timeline, the event type is no longuer in the dashboard or the timeline
            p.Timeline.Clear ();
            p.UpdateEventTypesAndTimers ();
            Assert.AreEqual (1, p.Timers.Count);
            Assert.AreEqual (8, p.EventTypes.Count);
        }
コード例 #26
0
ファイル: TestProject.cs プロジェクト: LongoMatch/longomatch
        public void TestSerialization()
        {
            ProjectLongoMatch p = new ProjectLongoMatch ();

            Utils.CheckSerialization (p);

            p = CreateProject ();
            Utils.CheckSerialization (p);
            p.AddEvent (new TimelineEventLongoMatch ());
            Utils.CheckSerialization (p);

            ProjectLongoMatch newp = Utils.SerializeDeserialize (p);
            Assert.AreEqual (newp.CompareTo (p), 0);
            Assert.AreEqual (newp.Timeline.Count, p.Timeline.Count);
        }
コード例 #27
0
ファイル: TestProject.cs プロジェクト: LongoMatch/longomatch
 public void TestIsFakeCapture()
 {
     ProjectLongoMatch p = new ProjectLongoMatch ();
     Assert.IsFalse (p.IsFakeCapture);
     p.Description = new ProjectDescription ();
     Assert.IsFalse (p.IsFakeCapture);
     p.Description.FileSet = new MediaFileSet ();
     Assert.IsFalse (p.IsFakeCapture);
     p.Description.FileSet.Add (new MediaFile ());
     Assert.IsFalse (p.IsFakeCapture);
     p.Description.FileSet [0].FilePath = Constants.FAKE_PROJECT;
     Assert.IsTrue (p.IsFakeCapture);
 }
コード例 #28
0
ファイル: TestProject.cs プロジェクト: LongoMatch/longomatch
 public void TestIsChanged()
 {
     ProjectLongoMatch p = new ProjectLongoMatch ();
     Assert.IsTrue (p.IsChanged);
     p.IsChanged = false;
     p.Dashboard = new DashboardLongoMatch ();
     Assert.IsTrue (p.IsChanged);
     p.IsChanged = false;
     p.LocalTeamTemplate = new SportsTeam ();
     Assert.IsTrue (p.IsChanged);
     p.IsChanged = false;
     p.VisitorTeamTemplate = new SportsTeam ();
     Assert.IsTrue (p.IsChanged);
     p.IsChanged = false;
     p.Description = new ProjectDescription ();
     Assert.IsTrue (p.IsChanged);
     p.IsChanged = false;
     p.Timeline.Add (new TimelineEventLongoMatch ());
     Assert.IsTrue (p.IsChanged);
     p.IsChanged = false;
     p.Timeline = null;
     Assert.IsTrue (p.IsChanged);
     p.IsChanged = false;
     p.EventTypes.Add (new EventType ());
     Assert.IsTrue (p.IsChanged);
     p.IsChanged = false;
     p.EventTypes = null;
     Assert.IsTrue (p.IsChanged);
     p.IsChanged = false;
     p.Playlists.Add (new Playlist ());
     Assert.IsTrue (p.IsChanged);
     p.IsChanged = false;
     p.Playlists = null;
     Assert.IsTrue (p.IsChanged);
     p.IsChanged = false;
     p.Periods.Add (new Period ());
     Assert.IsTrue (p.IsChanged);
     p.IsChanged = false;
     p.Periods = null;
     Assert.IsTrue (p.IsChanged);
     p.IsChanged = false;
     p.Timers.Add (new Timer ());
     Assert.IsTrue (p.IsChanged);
     p.IsChanged = false;
     p.Timers = null;
     Assert.IsTrue (p.IsChanged);
     p.IsChanged = false;
 }
コード例 #29
0
        public SportCategoryTimeline(ProjectLongoMatch project, List<TimelineEvent> plays, Time maxTime,
									  double offsetY, Color background, EventsFilter filter)
            : base(project, plays, maxTime,
																									 offsetY, background, filter)
        {
        }
コード例 #30
0
 void HandleOpenedProjectChanged(OpenedProjectEvent e)
 {
     OpenedProject = e.Project as ProjectLongoMatch;
 }