示例#1
0
        private bool InitDialog()
        {
            if (mConfig != null)
            {
                textBox_name.Text          = mConfig.Name;
                textBox_desc.Text          = mConfig.Desc;
                comboBox_type.SelectedItem = mConfig.SystemContext.VideoSourceTypeManager.GetConfig(mConfig.Type);
                numericUpDown_fps.Value    = mConfig.FPS;
                textBox_ip.Text            = mConfig.IP;
                numericUpDown_port.Value   = mConfig.Port;
                textBox_channel.Text       = mConfig.StrValue("Channel");
                numericUpDown_osd.Value    = mConfig.ShowOSDType;
                dateTimePicker_begin.Value = mConfig.StartTime.Year > 1 ? mConfig.StartTime : DateTime.Now.AddSeconds(-10);
                dateTimePicker_end.Value   = mConfig.StopTime.Year > 1 ? mConfig.StopTime : DateTime.Now;
                textBox_username.Text      = mConfig.UserName;
                textBox_password.Text      = mConfig.Password;
                textBox_filename.Text      = mConfig.FileName;
                checkBox_cycle.Checked     = mConfig.IsCycle;
                checkBox_record.Checked    = mConfig.IsRecord;
                checkBox_enabled.Checked   = mConfig.Enabled;

                comboBox_type.Enabled = false;
            }
            else
            {
                textBox_name.Text          = mType != null ? mType.Name + "_" : "VideoSource_";
                textBox_desc.Text          = mType != null ? "新" + mType.Desc : "视频源";
                comboBox_type.SelectedItem = mType != null?mType.SystemContext.VideoSourceTypeManager.GetConfig(mType.Name) : null;

                numericUpDown_fps.Value    = 18;
                textBox_ip.Text            = "127.0.0.1";
                numericUpDown_port.Value   = 3800;
                textBox_channel.Text       = "1";
                numericUpDown_osd.Value    = 0;
                dateTimePicker_begin.Value = DateTime.Now.AddSeconds(-10);
                dateTimePicker_end.Value   = DateTime.Now;
                textBox_username.Text      = "admin";
                textBox_password.Text      = "";
                textBox_filename.Text      = "";
                checkBox_cycle.Checked     = true;
                checkBox_record.Checked    = false;
                checkBox_enabled.Checked   = true;

                comboBox_type.Enabled = mType == null;
            }

            textBox_name.Enabled = mConfig == null;

            return(true);
        }
示例#2
0
        private bool InitVSUI(IVideoSourceConfig vsConfig)
        {
            if (vsConfig != null)
            {
                comboBox_vsType.SelectedItem  = vsConfig.SystemContext.VideoSourceTypeManager.GetConfig(vsConfig.Type);
                numericUpDown_fps.Value       = vsConfig.FPS;
                textBox_dvr_ip.Text           = vsConfig.IP;
                numericUpDown_dvr_port.Value  = vsConfig.Port;
                textBox_channel.Text          = vsConfig.StrValue("Channel");
                numericUpDown_osd.Value       = vsConfig.ShowOSDType;
                dateTimePicker_begin.Value    = vsConfig.StartTime.Year > 1 ? vsConfig.StartTime : DateTime.Now.AddSeconds(-10);
                dateTimePicker_end.Value      = vsConfig.StopTime.Year > 1 ? vsConfig.StopTime : DateTime.Now;
                textBox_domain.Text           = mVSConfig.StrValue("Domain");
                textBox_username.Text         = vsConfig.UserName;
                textBox_password.Text         = vsConfig.Password;
                textBox_filename.Text         = vsConfig.FileName;
                checkBox_runMode_push.Checked = (mVSConfig.RunMode == VideoSourceRunMode.Push);
                checkBox_cycle.Checked        = vsConfig.IsCycle;

                //comboBox_vsType.Enabled = false;
            }
            else
            {
                //comboBox_type.SelectedItem = mType != null ? mType.SystemContext.VideoSourceTypeManager.GetConfig(mType.Name) : null;
                //numericUpDown_fps.Value = 18;
                //textBox_ip.Text = "127.0.0.1";
                //numericUpDown_port.Value = 3800;
                //numericUpDown_channel.Value = 1;
                //numericUpDown_osd.Value = 0;
                //dateTimePicker_begin.Value = DateTime.Now.AddSeconds(-10);
                //dateTimePicker_end.Value = DateTime.Now;
                //textBox_username.Text = "admin";
                //textBox_password.Text = "";
                //textBox_filename.Text = "";
                //checkBox_cycle.Checked = true;
                //checkBox_record.Checked = false;
                //checkBox_enabled.Checked = true;

                //comboBox_vsType.Enabled = mType == null;
            }

            return(true);
        }
示例#3
0
        protected string GetURL()
        {
            IVideoSourceConfig config = Config;

            if (config != null)
            {
                //rtsp://192.168.1.231:554/192.168.1.250:8000:HIK-DS8000HC:0:0:admin:12345/av_stream

                StringBuilder sb = new StringBuilder("rtsp://");
                sb.Append(config.StrValue("SMServerIP"));
                //sb.Append(":"+config.StrValue("SMServerPort"));
                sb.Append("/" + config.StrValue("DeviceIP"));
                sb.Append(":" + config.StrValue("DevicePort"));
                sb.Append(":HIK-DS8000HC:" + config.StrValue("Channel"));
                sb.Append(":" + config.StrValue("SubChannel") + ":");
                sb.Append(config.StrValue("UserName") + ":");
                sb.Append(config.StrValue("Password") + "/av_stream");

                CLocalSystem.WriteInfoLog(string.Format("StreamMediaURL={0}", sb.ToString()));

                return(sb.ToString());
            }
            return("");
        }