コード例 #1
0
        public bool Init(IUnityContainer container, StreamInfoArgs args, odm.ui.activities.ConfigureAnalyticView.ModuleDescriptor modulDescr)
        {
            this.modulDescr = modulDescr;
            this.container  = container;

            this.videoDescr = new ConfigureAnalyticView.AnalyticsVideoDescriptor()
            {
                videoInfo = new VideoInfo()
                {
                    MediaUri = args.streamUri, Resolution = new Size()
                    {
                        Width = args.sourceResolution.Width, Height = args.sourceResolution.Height
                    }
                },
                videoSourceResolution = new Size()
                {
                    Width = args.encoderResolution.Width, Height = args.encoderResolution.Height
                }
            };


            model = new SynesisAnalyticsModel();

            FillData(modulDescr.config.parameters.simpleItem, model);
            BindData();
            VideoStartup(args);
            return(true);
        }
コード例 #2
0
		public bool Init(IUnityContainer container, StreamInfoArgs args, odm.ui.activities.ConfigureAnalyticView.ModuleDescriptor modulDescr) {
			this.modulDescr = modulDescr;
			this.container = container;

			this.videoDescr = new ConfigureAnalyticView.AnalyticsVideoDescriptor() {
				videoInfo = new VideoInfo() { MediaUri = args.streamUri, Resolution = new Size() { Width = args.sourceResolution.Width, Height = args.sourceResolution.Height } },
				videoSourceResolution = new Size() { Width = args.encoderResolution.Width, Height = args.encoderResolution.Height }
			};

			this.videoInfo = videoDescr.videoInfo;


			try {
				modulDescr.schema.GlobalTypes.Values.ForEach(x => {
					var val = x as global::System.Xml.Schema.XmlSchemaSimpleType;
					if (val == null)
						return;
					if (val.QualifiedName.Name == "sensitivity") {
						var tm1 = val.Content as System.Xml.Schema.XmlSchemaSimpleTypeRestriction;
						if (tm1 == null)
							return;
						var tm2 = tm1.Facets as System.Collections.CollectionBase;
						if (tm2 == null)
							return;

						tm2.ForEach(xx => {
							var min = xx as System.Xml.Schema.XmlSchemaMinInclusiveFacet;
							if (min != null) {
								int mval = 0;
								Int32.TryParse(min.Value, out mval);
								valueSensitivity.Minimum = mval;
							}
							var max = xx as System.Xml.Schema.XmlSchemaMaxInclusiveFacet;
							if (max != null) {
								int mval = 0;
								Int32.TryParse(max.Value, out mval);
								valueSensitivity.Maximum = mval;
							}
						});
					}
				});
			} catch (Exception err) {
				dbg.Error(err);
			}
			try {
				VideoStartup(args);
				InitApproEditor();
			} catch (Exception err) {
				dbg.Error(err);
				return false;
			}

			return true;
		}
コード例 #3
0
        public bool Init(IUnityContainer container, StreamInfoArgs args, odm.ui.activities.ConfigureAnalyticView.ModuleDescriptor modulDescr)
        {
            this.modulDescr = modulDescr;
            this.container  = container;

            this.videoDescr = new ConfigureAnalyticView.AnalyticsVideoDescriptor()
            {
                videoInfo = new VideoInfo()
                {
                    MediaUri = args.streamUri, Resolution = new Size()
                    {
                        Width = args.sourceResolution.Width, Height = args.sourceResolution.Height
                    }
                },
                videoSourceResolution = new Size()
                {
                    Width = args.encoderResolution.Width, Height = args.encoderResolution.Height
                }
            };

            this.videoInfo = videoDescr.videoInfo;

            videoSourceSize  = new Size(videoDescr.videoSourceResolution.Width, videoDescr.videoSourceResolution.Height);
            videoEncoderSize = new Size(videoDescr.videoInfo.Resolution.Width, videoDescr.videoInfo.Resolution.Height);

            model = new SynesisTripWireRuleModel();

            try {
                FillSimpleItems(modulDescr.config.parameters.simpleItem, model);
            } catch (Exception err) {
                dbg.Error(err);
                return(false);
            }
            try{
                FillElementItems(modulDescr.config.parameters.elementItem, model);
            } catch (Exception err) {
                dbg.Error(err);
                return(false);
            }

            try{
                BindData();
                VideoStartup(args);
            } catch (Exception err) {
                dbg.Error(err);
                return(false);
            }
            return(true);
        }
コード例 #4
0
		public bool Init(IUnityContainer container, StreamInfoArgs args, odm.ui.activities.ConfigureAnalyticView.ModuleDescriptor modulDescr) {
			this.modulDescr = modulDescr;
			this.container = container;

			this.videoDescr = new ConfigureAnalyticView.AnalyticsVideoDescriptor() {
				videoInfo = new VideoInfo() { MediaUri = args.streamUri, Resolution = new Size() { Width = args.sourceResolution.Width, Height = args.sourceResolution.Height } },
				videoSourceResolution = new Size() { Width = args.encoderResolution.Width, Height = args.encoderResolution.Height }
			};

			this.videoInfo = videoDescr.videoInfo;

			videoSourceSize = new Size(videoDescr.videoSourceResolution.Width, videoDescr.videoSourceResolution.Height);
			videoEncoderSize = new Size(videoDescr.videoInfo.Resolution.Width, videoDescr.videoInfo.Resolution.Height);

			model = new SynesisRegionRuleModel();

			try {
				FillElementItems(modulDescr.config.parameters.elementItem, model);
			} catch (Exception err) {
				dbg.Error(err);
				return false;
			}
			try {
				BindData();
				VideoStartup(args);
			} catch (Exception err) {
				dbg.Error(err);
				return false;
			}
			return true;
		}
コード例 #5
0
        public bool Init(IUnityContainer container, StreamInfoArgs args, odm.ui.activities.ConfigureAnalyticView.ModuleDescriptor modulDescr) {
			this.modulDescr = modulDescr;
			this.container = container;

			this.videoDescr = new ConfigureAnalyticView.AnalyticsVideoDescriptor() {
				videoInfo = new VideoInfo() { MediaUri = args.streamUri, Resolution = new Size() {  Width = args.sourceResolution.Width, Height = args.sourceResolution.Height } },
				videoSourceResolution = new Size() { Width = args.encoderResolution.Width, Height = args.encoderResolution.Height } 
			};


            model = new SynesisAnalyticsModel();
            
            FillData(modulDescr.config.parameters.simpleItem, model);
            BindData();
			VideoStartup(args);
            return true;
        }
コード例 #6
0
        public bool Init(IUnityContainer container, StreamInfoArgs args, odm.ui.activities.ConfigureAnalyticView.ModuleDescriptor modulDescr)
        {
            this.modulDescr = modulDescr;
            this.container  = container;

            try {
                this.videoDescr = new ConfigureAnalyticView.AnalyticsVideoDescriptor()
                {
                    videoInfo = new VideoInfo()
                    {
                        MediaUri = args.streamUri, Resolution = new Size()
                        {
                            Width = args.sourceResolution.Width, Height = args.sourceResolution.Height
                        }
                    },
                    videoSourceResolution = new Size()
                    {
                        Width = args.encoderResolution.Width, Height = args.encoderResolution.Height
                    }
                };

                VideoStartup(args);                //, videoDescr.profileToken);

                videoSourceSize  = new Size(videoDescr.videoSourceResolution.Width, videoDescr.videoSourceResolution.Height);
                videoEncoderSize = new Size(videoDescr.videoInfo.Resolution.Width, videoDescr.videoInfo.Resolution.Height);

                model = new SynesisAnalyticsModel(modulDescr.schema);
            } catch (Exception err) {
                return(false);
            }

            try {
                FillSimpleItems(modulDescr.config.parameters.simpleItem, model);
            } catch (Exception err) {
                dbg.Error(err);
                return(false);
            }
            try {
                FillElementItems(modulDescr.config.parameters.elementItem, model);
            } catch (Exception err) {
                dbg.Error(err);
                return(false);
            }
            try {
                pageAntishaker.Init(container, model, videoDescr.videoInfo);                //, videoDescr.profileToken);
            } catch (Exception err) {
                dbg.Error(err);
                return(false);
            }
            try {
                pageDepthCalibration.Init(container, model, videoDescr.videoInfo);                //, videoDescr.profileToken);
            } catch (Exception err) {
                dbg.Error(err);
                return(false);
            }
            try {
                pageObjectTracker.Init(container, model, videoDescr.videoInfo);                //, videoDescr.profileToken);
            } catch (Exception err) {
                dbg.Error(err);
                return(false);
            }
            try {
                pageTampering.Init(container, model, videoDescr.videoInfo);                //, videoDescr.profileToken);
            } catch (Exception err) {
                dbg.Error(err);
                return(false);
            }

            analyticsTabCtrl.RequestBringIntoView += new RequestBringIntoViewEventHandler((sender, evargs) => {
                var tab   = ((System.Windows.Controls.Primitives.Selector)(sender)).SelectedItem;
                var tctrl = tab as TabItem;
                if (tctrl.Name == tabAntishaker.Name)
                {
                    pageAntishaker.SetPlayer(null);
                    pageDepthCalibration.SetPlayer(null);
                    pageObjectTracker.SetPlayer(null);
                    pageTampering.SetPlayer(null);

                    pageAntishaker.SetPlayer(player);
                }
                else if (tctrl.Name == tabDepthCalibration.Name)
                {
                    pageAntishaker.SetPlayer(null);
                    pageDepthCalibration.SetPlayer(null);
                    pageObjectTracker.SetPlayer(null);
                    pageTampering.SetPlayer(null);

                    pageDepthCalibration.SetPlayer(player);
                }
                else if (tctrl.Name == tabObjectTracker.Name)
                {
                    pageAntishaker.SetPlayer(null);
                    pageDepthCalibration.SetPlayer(null);
                    pageObjectTracker.SetPlayer(null);
                    pageTampering.SetPlayer(null);

                    pageObjectTracker.SetPlayer(player);
                }
                else if (tctrl.Name == tabTampering.Name)
                {
                    pageAntishaker.SetPlayer(null);
                    pageDepthCalibration.SetPlayer(null);
                    pageObjectTracker.SetPlayer(null);
                    pageTampering.SetPlayer(null);

                    pageTampering.SetPlayer(player);
                }
            });

            //TODO: Stub fix for #225 Remove this with plugin functionality
            last = container.Resolve <odm.ui.activities.ILastChangedModule>();
            analyticsTabCtrl.SelectionChanged += new SelectionChangedEventHandler((obj, arg) => {
                var selection  = analyticsTabCtrl.SelectedItem as TabItem;
                var antishaker = selection.Content as AntishakerView;
                if (antishaker != null)
                {
                    last.Tag = "pageAntishaker";
                }
                var calibration = selection.Content as DepthCalibrationView;
                if (calibration != null)
                {
                    last.Tag = "pageDepthCalibration";
                }
                var objecttracker = selection.Content as ObjectTrackerView;
                if (objecttracker != null)
                {
                    last.Tag = "pageObjectTracker";
                }
                var tampering = selection.Content as TamperingDetectorsView;
                if (tampering != null)
                {
                    last.Tag = "pageTampering";
                }
            });
            if (last.Tag != "")
            {
                switch (last.Tag)
                {
                case "pageAntishaker":
                    analyticsTabCtrl.SelectedItem = tabAntishaker;

                    pageDepthCalibration.SetPlayer(null);
                    pageTampering.SetPlayer(null);
                    pageObjectTracker.SetPlayer(null);

                    pageAntishaker.SetPlayer(player);
                    break;

                case "pageDepthCalibration":
                    analyticsTabCtrl.SelectedItem = tabDepthCalibration;

                    pageTampering.SetPlayer(null);
                    pageAntishaker.SetPlayer(null);
                    pageObjectTracker.SetPlayer(null);

                    pageDepthCalibration.SetPlayer(player);
                    break;

                case "pageObjectTracker":
                    analyticsTabCtrl.SelectedItem = tabObjectTracker;

                    pageDepthCalibration.SetPlayer(null);
                    pageTampering.SetPlayer(null);
                    pageAntishaker.SetPlayer(null);

                    pageObjectTracker.SetPlayer(player);

                    break;

                case "pageTampering":
                    analyticsTabCtrl.SelectedItem = tabTampering;

                    pageDepthCalibration.SetPlayer(null);
                    pageObjectTracker.SetPlayer(null);
                    pageAntishaker.SetPlayer(null);

                    pageTampering.SetPlayer(player);
                    break;
                }
            }
            else
            {
                pageDepthCalibration.SetPlayer(null);
                pageTampering.SetPlayer(null);
                pageAntishaker.SetPlayer(null);
                pageObjectTracker.SetPlayer(player);
            }
            //

            return(true);
        }
コード例 #7
0
        public bool Init(IUnityContainer container, StreamInfoArgs args, odm.ui.activities.ConfigureAnalyticView.ModuleDescriptor modulDescr)
        {
            this.modulDescr = modulDescr;
            this.container  = container;

            this.videoDescr = new ConfigureAnalyticView.AnalyticsVideoDescriptor()
            {
                videoInfo = new VideoInfo()
                {
                    MediaUri = args.streamUri, Resolution = new Size()
                    {
                        Width = args.sourceResolution.Width, Height = args.sourceResolution.Height
                    }
                },
                videoSourceResolution = new Size()
                {
                    Width = args.encoderResolution.Width, Height = args.encoderResolution.Height
                }
            };

            this.videoInfo = videoDescr.videoInfo;


            try {
                modulDescr.schema.GlobalTypes.Values.ForEach(x => {
                    var val = x as global::System.Xml.Schema.XmlSchemaSimpleType;
                    if (val == null)
                    {
                        return;
                    }
                    if (val.QualifiedName.Name == "sensitivity")
                    {
                        var tm1 = val.Content as System.Xml.Schema.XmlSchemaSimpleTypeRestriction;
                        if (tm1 == null)
                        {
                            return;
                        }
                        var tm2 = tm1.Facets as System.Collections.CollectionBase;
                        if (tm2 == null)
                        {
                            return;
                        }

                        tm2.ForEach(xx => {
                            var min = xx as System.Xml.Schema.XmlSchemaMinInclusiveFacet;
                            if (min != null)
                            {
                                int mval = 0;
                                Int32.TryParse(min.Value, out mval);
                                valueSensitivity.Minimum = mval;
                            }
                            var max = xx as System.Xml.Schema.XmlSchemaMaxInclusiveFacet;
                            if (max != null)
                            {
                                int mval = 0;
                                Int32.TryParse(max.Value, out mval);
                                valueSensitivity.Maximum = mval;
                            }
                        });
                    }
                });
            } catch (Exception err) {
                dbg.Error(err);
            }
            try {
                VideoStartup(args);
                InitApproEditor();
            } catch (Exception err) {
                dbg.Error(err);
                return(false);
            }

            return(true);
        }
コード例 #8
0
		public bool Init(IUnityContainer container, StreamInfoArgs args, odm.ui.activities.ConfigureAnalyticView.ModuleDescriptor modulDescr) {
			this.modulDescr = modulDescr;
			this.container = container;

			try {
				this.videoDescr = new ConfigureAnalyticView.AnalyticsVideoDescriptor() {
					videoInfo = new VideoInfo() { MediaUri = args.streamUri, Resolution = new Size() { Width = args.sourceResolution.Width, Height = args.sourceResolution.Height } },
					videoSourceResolution = new Size() { Width = args.encoderResolution.Width, Height = args.encoderResolution.Height }
				};

				VideoStartup(args);//, videoDescr.profileToken);

				videoSourceSize = new Size(videoDescr.videoSourceResolution.Width, videoDescr.videoSourceResolution.Height);
				videoEncoderSize = new Size(videoDescr.videoInfo.Resolution.Width, videoDescr.videoInfo.Resolution.Height);

				model = new SynesisAnalyticsModel(modulDescr.schema);

			} catch (Exception err) {
				return false;
			}

			try {
				FillSimpleItems(modulDescr.config.parameters.simpleItem, model);
			} catch (Exception err) {
				dbg.Error(err);
				return false;
			}
			try {
				FillElementItems(modulDescr.config.parameters.elementItem, model);
			} catch (Exception err) {
				dbg.Error(err);
				return false;
			}
			try {
				pageAntishaker.Init(container, model, videoDescr.videoInfo);//, videoDescr.profileToken);
			} catch (Exception err) {
				dbg.Error(err);
				return false;
			}
			try {
				pageDepthCalibration.Init(container, model, videoDescr.videoInfo);//, videoDescr.profileToken);
			} catch (Exception err) {
				dbg.Error(err);
				return false;
			}
			try {
				pageObjectTracker.Init(container, model, videoDescr.videoInfo);//, videoDescr.profileToken);
			} catch (Exception err) {
				dbg.Error(err);
				return false;
			}
			try {
				pageTampering.Init(container, model, videoDescr.videoInfo);//, videoDescr.profileToken);
			} catch (Exception err) {
				dbg.Error(err);
				return false;
			}

			analyticsTabCtrl.RequestBringIntoView += new RequestBringIntoViewEventHandler((sender, evargs) => {
				var tab = ((System.Windows.Controls.Primitives.Selector)(sender)).SelectedItem;
				var tctrl = tab as TabItem;
				if (tctrl.Name == tabAntishaker.Name) {
					pageAntishaker.SetPlayer(null);
					pageDepthCalibration.SetPlayer(null);
					pageObjectTracker.SetPlayer(null);
					pageTampering.SetPlayer(null);

					pageAntishaker.SetPlayer(player);
				} else if (tctrl.Name == tabDepthCalibration.Name) {
					pageAntishaker.SetPlayer(null);
					pageDepthCalibration.SetPlayer(null);
					pageObjectTracker.SetPlayer(null);
					pageTampering.SetPlayer(null);

					pageDepthCalibration.SetPlayer(player);

				} else if (tctrl.Name == tabObjectTracker.Name) {
					pageAntishaker.SetPlayer(null);
					pageDepthCalibration.SetPlayer(null);
					pageObjectTracker.SetPlayer(null);
					pageTampering.SetPlayer(null);

					pageObjectTracker.SetPlayer(player);

				} else if (tctrl.Name == tabTampering.Name) {
					pageAntishaker.SetPlayer(null);
					pageDepthCalibration.SetPlayer(null);
					pageObjectTracker.SetPlayer(null);
					pageTampering.SetPlayer(null);

					pageTampering.SetPlayer(player);

				}
			});

			//TODO: Stub fix for #225 Remove this with plugin functionality
			last = container.Resolve<odm.ui.activities.ILastChangedModule>();
			analyticsTabCtrl.SelectionChanged += new SelectionChangedEventHandler((obj, arg) => {
				var selection = analyticsTabCtrl.SelectedItem as TabItem;
				var antishaker = selection.Content as AntishakerView;
				if (antishaker != null) {
					last.Tag = "pageAntishaker";
				}
				var calibration = selection.Content as DepthCalibrationView;
				if (calibration != null) {
					last.Tag = "pageDepthCalibration";
				}
				var objecttracker = selection.Content as ObjectTrackerView;
				if (objecttracker != null) {
					last.Tag = "pageObjectTracker";
				}
				var tampering = selection.Content as TamperingDetectorsView;
				if (tampering != null) {
					last.Tag = "pageTampering";
				}
			});
			if (last.Tag != "") {
				switch (last.Tag) {
					case "pageAntishaker":
						analyticsTabCtrl.SelectedItem = tabAntishaker;

						pageDepthCalibration.SetPlayer(null);
						pageTampering.SetPlayer(null);
						pageObjectTracker.SetPlayer(null);

						pageAntishaker.SetPlayer(player);
						break;
					case "pageDepthCalibration":
						analyticsTabCtrl.SelectedItem = tabDepthCalibration;

						pageTampering.SetPlayer(null);
						pageAntishaker.SetPlayer(null);
						pageObjectTracker.SetPlayer(null);

						pageDepthCalibration.SetPlayer(player);
						break;
					case "pageObjectTracker":
						analyticsTabCtrl.SelectedItem = tabObjectTracker;

						pageDepthCalibration.SetPlayer(null);
						pageTampering.SetPlayer(null);
						pageAntishaker.SetPlayer(null);

						pageObjectTracker.SetPlayer(player);

						break;
					case "pageTampering":
						analyticsTabCtrl.SelectedItem = tabTampering;

						pageDepthCalibration.SetPlayer(null);
						pageObjectTracker.SetPlayer(null);
						pageAntishaker.SetPlayer(null);

						pageTampering.SetPlayer(player);
						break;
				}
			} else {
				pageDepthCalibration.SetPlayer(null);
				pageTampering.SetPlayer(null);
				pageAntishaker.SetPlayer(null);
				pageObjectTracker.SetPlayer(player);
			}
			//

			return true;
		}