Example #1
0
        private void Process_Alarm()
        {
            try
            {
                int acc = 0;

                for (int i = 0; i < 3; i++)
                {
                    if (index[i] == -1)
                    {
                        continue;
                    }

                    if (videoFilesManager.PathExist(time, index[i]))
                    {
                        if (videoFilesManager.GetFile(time, index[i], ref resultFile[i]))
                        {
                            acc++;
                        }
                    } //get the files
                }     // max:2

                Log.write("VideoHandler Process_Alarm processing:", 1);
                if (acc > 0)
                {
                    string filename = System.IO.Path.GetFileName(resultFile[0]);
                    string path     = resultFile[0].Substring(0, resultFile[0].Length - filename.Length);



                    for (int i = 0; i < resultFile.Length; i++)
                    {
                        if (resultFile[i] == null)
                        {
                            resultFile[i] = "";
                        }
                    }

                    if (database.SetVideoFile(pk_id, path, resultFile[0], resultFile[1], resultFile[2], ""))
                    {
                    }
                }
            }
            catch (Exception ex)
            {
                Log.write("VideoHandler Process_Alarm-Error:" + ex.Message, 0);
            }
        }
Example #2
0
        private void Process_Alarm()
        {
            int acc = 0;

            for (int i = 0; i < 3; i++)
            {
                if (index[i] == -1)
                {
                    continue;
                }

                if (videoFilesManager.PathExist(time_receive, index[i]))
                {
                    videoFilesManager.GetFile(time_receive, index[i], ref resultFile[i]);
                    acc++;
                } //get the files
            }     // max:2


            if (acc > 0)
            {
                string filename = System.IO.Path.GetFileName(resultFile[0]);
                string path     = resultFile[0].Substring(0, resultFile[0].Length - filename.Length);



                for (int i = 0; i < resultFile.Length; i++)
                {
                    if (resultFile[i] == null)
                    {
                        resultFile[i] = "";
                    }
                }

                if (database.SetVideoFile(iPk_id, path, resultFile[0], resultFile[1], resultFile[2], ""))
                {
                }
            }
        }