示例#1
0
    private VsFileURL getFileUrlOfMotion(string motionID, DateTime motionDateTime)
    {
        string tableName = VsTableName.getMonthTableName("data", motionDateTime);

        MySqlConnection conn = this.connecting(ConnString);
        MySqlCommand    comm = conn.CreateCommand();

        comm.CommandText = String.Format("SELECT   `m_file_name` , `m_date_start` FROM `{0}` WHERE   `m_id` = '{1}' ;", tableName, motionID);

        try
        {
            MySqlDataReader aReader = comm.ExecuteReader();

            string    fileName = "";
            VsFileURL fUrl     = new VsFileURL();
            while (aReader.Read())
            {
                fileName       = aReader["m_file_name"].ToString();
                fUrl.FilesName = aReader["m_date_start"].ToString();
            }


            string ftpUser = "";
            string ftpPass = "";

            fUrl.FilesID = motionID;
            string s = fileName.Split(':')[1].Replace("\\", "/");
            fUrl.FilesURL = "http://" + ftpUser + ftpPass + hostIP + s;
            return(fUrl);
        }
        catch { return(null); }
        finally { conn.Close(); }
    }
示例#2
0
 public void add(string name, string url)
 {
     VsFileURL files = new VsFileURL();
     files.FilesName = name;
     files.FilesURL = url;
     list.Add(files);
 }
示例#3
0
    public void add(string name, string url)
    {
        VsFileURL files = new VsFileURL();

        files.FilesName = name;
        files.FilesURL  = url;
        list.Add(files);
    }
示例#4
0
        public void motionSelected()
        {
            try
            {
                int      index = selectedIndex;
                VsMotion m     = motions[index];
                url = service.getMjpegProxyUrlOfMotionParameter(m.MotionID.ToString(), m.timeBegin, height, width, fps, quanlity);

                Live();
                //    textBox3.Text = "" + m.timeBegin + " To " + m.timeEnd;
                //    vlCplayer1.playFileUrl(url.FilesURL);
            }
            catch (Exception err)
            {
                //logger.Log(LogLevel.Error, err.Message + " " + err.Source + " " + err.StackTrace); ;
            }
        }
示例#5
0
        public void motionSelected()
        {
            try
            {
                radioButtonVideo_CheckedChanged(null, null);

                int       index = listEvents.SelectedIndex;
                VsMotion  m     = motions[index];
                VsFileURL url   = engine.getFileUrlOfMotion(m.MotionID.ToString(), m.timeBegin);

                textBox3.Text = "" + m.timeBegin + " To " + m.timeEnd;
                vlCplayer1.playFileUrl(url.FilesURL);
            }
            catch (Exception err)
            {
                logger.Log(LogLevel.Error, err.Message + " " + err.Source + " " + err.StackTrace);;
            }
        }
示例#6
0
        public void checkVideoLine(int time)
        {
            for (int i = 0; i < data.Length; i++)
            {
                var v = data[i];
                if (v != null && v.ContainsKey(time))
                {
                    timer1.Stop();
                    VsFileURL url = engine.getFileUrlOfMotion(v[time].MotionID.ToString(), v[time].timeBegin);

                    try
                    {
                        //int leng = (int)( v[time].timeEnd - v[time].timeBegin).TotalSeconds;
                        players[i].playFileUrl(url.FilesURL);
                        timer1.Interval = 1000;
                    }
                    catch (Exception ex) {
                        MessageBox.Show(ex.Message + " " + DateTime.Now.ToString());
                    }
                    timer1.Start();
                }
            }
        }
示例#7
0
    private VsFileURL getFileUrlOfMotion(string motionID, DateTime motionDateTime)
    {
        string tableName = VsTableName.getMonthTableName("data", motionDateTime);

        MySqlConnection conn = this.connecting(ConnString);
        MySqlCommand comm = conn.CreateCommand();
        comm.CommandText = String.Format("SELECT   `m_file_name` , `m_date_start` FROM `{0}` WHERE   `m_id` = '{1}' ;", tableName, motionID);

        try
        {
            MySqlDataReader aReader = comm.ExecuteReader();

            string fileName = "";
            VsFileURL fUrl = new VsFileURL();
            while (aReader.Read())
            {
                fileName = aReader["m_file_name"].ToString();
                fUrl.FilesName = aReader["m_date_start"].ToString();
            }


            string ftpUser = "";
            string ftpPass = "";

            fUrl.FilesID = motionID;
            string s = fileName.Split(':')[1].Replace("\\", "/");
            fUrl.FilesURL = "http://" + ftpUser + ftpPass + hostIP + s;
            return fUrl;

        }
        catch { return null; }
        finally { conn.Close(); }


    }