Ejemplo n.º 1
0
        private void InitPropGrid()
        {
            MotionArgs Args = new MotionArgs();

            this.pGridCamera.Items.Clear();

            this.mItemName = new CustomProperty(Translator.Instance.T("摄像头名称"), this.Camera.Name, false, Translator.Instance.T("摄像头设置"), Translator.Instance.T("为本摄像头分配一个名称"), true);
            this.pGridCamera.Items.Add(this.mItemName);

            string sv = "";

            if (this.Camera.PlugInVideoSource != null)
            {
                sv = this.Camera.PlugInVideoSource.LabelText;
            }
            this.mItemStream               = new CustomProperty(Translator.Instance.T("视频来源"), sv, false, Translator.Instance.T("摄像头设置"), Translator.Instance.T("设置视频来源"), true);
            this.mItemStream.ValueMember   = "Key";
            this.mItemStream.DisplayMember = "Value";
            this.mItemStream.Datasource    = this.Camera.VideoSourceCollection;
            //this.mItemStream.SelectedValue = this.Camera.Stream;
            this.pGridCamera.Items.Add(this.mItemStream);

            this.mItemCaptureFlag               = new CustomProperty(Translator.Instance.T("录像方式"), Args.GetValue(this.Camera.Capture), false, Translator.Instance.T("录像设置"), Translator.Instance.T("设置录像方式"), true);
            this.mItemCaptureFlag.ValueMember   = "Key";
            this.mItemCaptureFlag.DisplayMember = "Value";
            this.mItemCaptureFlag.Datasource    = Args.CAPTUREFLAGS;
            //this.mItemCaptureFlag.SelectedValue = this.Camera.Capture;
            this.pGridCamera.Items.Add(this.mItemCaptureFlag);

            this.mItemCaptureElapse               = new CustomProperty(Translator.Instance.T("存储方式"), Args.GetValue(this.Camera.CaptureElapse), false, Translator.Instance.T("录像设置"), Translator.Instance.T("设置录像存储的方式, 你可以选择将录像按照指定的时间段分割存储, 或者连续存储."), true);
            this.mItemCaptureElapse.ValueMember   = "Key";
            this.mItemCaptureElapse.DisplayMember = "Value";
            this.mItemCaptureElapse.Datasource    = Args.CAPTURE_ELAPSE;
            //this.mItemCaptureElapse.SelectedValue = this.Camera.CaptureElapse;
            this.pGridCamera.Items.Add(this.mItemCaptureElapse);

            CodecCollection cc = new CodecCollection();

            if (cc.KVs.Count > 0)
            {
                string codec = cc.GetValue(this.Camera.Codec, Translator.Instance.T("请指定录像编码格式."));
                this.mItemCodec                     = new CustomProperty(Translator.Instance.T("录像编码格式"), codec, false, Translator.Instance.T("录像设置"), Translator.Instance.T("设置录像采用的编码格式"), true);
                this.mItemCodec.ValueMember         = "Key";
                this.mItemCodec.DisplayMember       = "Value";
                this.mItemCodec.Datasource          = cc.KVs;
                this.mItemCodec.IsDropdownResizable = true;
                //this.mItemCodec.SelectedValue = this.Camera.Codec;
            }
            else
            {
                this.mItemCodec            = new CustomProperty(Translator.Instance.T("录像编码格式"), Translator.Instance.T("未找到合适的录像编码格式."), false, Translator.Instance.T("录像设置"), Translator.Instance.T("未找到合适的录像编码格式, 您需要安装视频编码驱动."), true);
                this.mItemCodec.IsReadOnly = true;
            }
            this.pGridCamera.Items.Add(this.mItemCodec);
            this.Camera.PlugIns.PropertyGridItemsInitialization(this.pGridCamera.Items);

            this.SetVideoSourceItemVisible(true);
            this.pGridCamera.Refresh();
        }
Ejemplo n.º 2
0
        private void FillRow(AVIClass v, int pos)
        {
            this.FillRowMark(v, pos);
            if (v.Owner == null)
            {
                this.gridList[pos, 1] = new SourceGrid.Cells.Cell(Translator.Instance.T("**未知摄像头**"));
            }
            else
            {
                this.gridList[pos, 1] = new SourceGrid.Cells.Cell(v.Owner.FullName);
            }
            this.gridList[pos, 2] = new SourceGrid.Cells.Cell(v.TimeStamp);
            this.gridList[pos, 3] = new SourceGrid.Cells.Cell(v.Length);
            this.gridList[pos, 4] = new SourceGrid.Cells.Cell(v.FileSize);

            string codec = mCC.GetValue(v.Codec, string.Format(Translator.Instance.T("录像格式 ({0})"), v.Codec));

            this.gridList[pos, 5]       = new SourceGrid.Cells.Cell(codec);
            this.gridList.Rows[pos].Tag = v;
        }
Ejemplo n.º 3
0
        private void InitPropGrid()
        {
            MotionArgs Args = new MotionArgs();
            this.pGridCamera.Items.Clear();

            this.mItemName = new CustomProperty(Translator.Instance.T("摄像头名称"), this.Camera.Name, false, Translator.Instance.T("摄像头设置"), Translator.Instance.T("为本摄像头分配一个名称"), true);
            this.pGridCamera.Items.Add(this.mItemName);

            string sv = "";
            if (this.Camera.PlugInVideoSource != null)
            {
                sv = this.Camera.PlugInVideoSource.LabelText;
            }
            this.mItemStream = new CustomProperty(Translator.Instance.T("视频来源"), sv, false, Translator.Instance.T("摄像头设置"), Translator.Instance.T("设置视频来源"), true);
            this.mItemStream.ValueMember = "Key";
            this.mItemStream.DisplayMember = "Value";
            this.mItemStream.Datasource = this.Camera.VideoSourceCollection;
            //this.mItemStream.SelectedValue = this.Camera.Stream;
            this.pGridCamera.Items.Add(this.mItemStream);

            this.mItemCaptureFlag = new CustomProperty(Translator.Instance.T("录像方式"), Args.GetValue(this.Camera.Capture), false, Translator.Instance.T("录像设置"), Translator.Instance.T("设置录像方式"), true);
            this.mItemCaptureFlag.ValueMember = "Key";
            this.mItemCaptureFlag.DisplayMember = "Value";
            this.mItemCaptureFlag.Datasource = Args.CAPTUREFLAGS;
            //this.mItemCaptureFlag.SelectedValue = this.Camera.Capture;
            this.pGridCamera.Items.Add(this.mItemCaptureFlag);

            this.mItemCaptureElapse = new CustomProperty(Translator.Instance.T("存储方式"), Args.GetValue(this.Camera.CaptureElapse), false, Translator.Instance.T("录像设置"), Translator.Instance.T("设置录像存储的方式, 你可以选择将录像按照指定的时间段分割存储, 或者连续存储."), true);
            this.mItemCaptureElapse.ValueMember = "Key";
            this.mItemCaptureElapse.DisplayMember = "Value";
            this.mItemCaptureElapse.Datasource = Args.CAPTURE_ELAPSE;
            //this.mItemCaptureElapse.SelectedValue = this.Camera.CaptureElapse;
            this.pGridCamera.Items.Add(this.mItemCaptureElapse);

            CodecCollection cc = new CodecCollection();
            if (cc.KVs.Count > 0)
            {
                string codec = cc.GetValue(this.Camera.Codec, Translator.Instance.T("请指定录像编码格式."));
                this.mItemCodec = new CustomProperty(Translator.Instance.T("录像编码格式"), codec, false, Translator.Instance.T("录像设置"), Translator.Instance.T("设置录像采用的编码格式"), true);
                this.mItemCodec.ValueMember = "Key";
                this.mItemCodec.DisplayMember = "Value";
                this.mItemCodec.Datasource = cc.KVs;
                this.mItemCodec.IsDropdownResizable = true;
                //this.mItemCodec.SelectedValue = this.Camera.Codec;
            }
            else
            {
                this.mItemCodec = new CustomProperty(Translator.Instance.T("录像编码格式"), Translator.Instance.T("未找到合适的录像编码格式."), false, Translator.Instance.T("录像设置"), Translator.Instance.T("未找到合适的录像编码格式, 您需要安装视频编码驱动."), true);
                this.mItemCodec.IsReadOnly = true;
            }
            this.pGridCamera.Items.Add(this.mItemCodec);
            this.Camera.PlugIns.PropertyGridItemsInitialization(this.pGridCamera.Items);

            this.SetVideoSourceItemVisible(true);
            this.pGridCamera.Refresh();
        }