コード例 #1
0
        public IEnumerable <string> GetNullValueProperties()
        {
            List <string> retVal = this.GetNullValuePropertyNames().ToList();

            if (CameraConnectionInfo.IsValid)
            {
                return(retVal);
            }

            IEnumerable <string> cameraConnInfoNullProperties = CameraConnectionInfo.GetNullValuePropertyNames();

            retVal.AddRange(cameraConnInfoNullProperties);

            return(retVal);
        }
コード例 #2
0
        private void ReadConfiguration()
        {
            string webCamUserName = System.Configuration.ConfigurationManager.AppSettings["MediaServerUsername"];
            string webCamPassword = System.Configuration.ConfigurationManager.AppSettings["MediaServerPassword"];
            string webCamUrl      = System.Configuration.ConfigurationManager.AppSettings["MediaServerUrl"];
            string webCamWebPage  = System.Configuration.ConfigurationManager.AppSettings["MediaServerImagePath"];

            int.TryParse(System.Configuration.ConfigurationManager.AppSettings["MediaServerPort"], out int webCamPort);

            CameraConnectionInfo = new CameraConnectionInfo
                                   (
                username: webCamUserName,
                password: webCamPassword,
                url: webCamUrl,
                webpage: webCamWebPage,
                port: webCamPort
                                   );

            string logErrorsPath      = System.Configuration.ConfigurationManager.AppSettings["LogErrorsPath"];
            string logUserIPsPath     = System.Configuration.ConfigurationManager.AppSettings["LogUserIPsPath"];
            string logUserPtzCmdPath  = System.Configuration.ConfigurationManager.AppSettings["LogUserPtzCmdPath"];
            string logCacheStatsPath  = System.Configuration.ConfigurationManager.AppSettings["LogCacheStatsPath"];
            string snapShotImagePath  = System.Configuration.ConfigurationManager.AppSettings["SnapShotImagePath"];
            string imageErrorLogoPath = System.Configuration.ConfigurationManager.AppSettings["ErrorImagePath"];

            ErrorsLogPath     = AppRootDir + (logErrorsPath ?? @"\App_Data\logs\errors.txt");
            UserIPsLogPath    = AppRootDir + (logUserIPsPath ?? @"\App_Data\logs\userIps.txt");
            UserPtzCmdLogPath = AppRootDir + (logUserPtzCmdPath ?? @"\App_Data\logs\userPtz.txt");
            CacheStatsLogPath = AppRootDir + (logCacheStatsPath ?? @"\App_Data\logs\cacheStats.txt");
            SnapShotImagePath = AppRootDir + (snapShotImagePath ?? @"\App_Data\outputimages\");
            ErrorImageLogPath = AppRootDir + (imageErrorLogoPath ?? @"\images\earth_hd_1.jpg");

            CameraFps = int.TryParse(System.Configuration.ConfigurationManager.AppSettings["CameraFPS"], out int cameraFps)
                ? cameraFps
                : 5;

            CacheLifeTimeMilliSec = int.TryParse(System.Configuration.ConfigurationManager.AppSettings["CacheLifeTimeMilliSec"],
                                                 out int cacheLifeTimeMilliSec)
                ? cacheLifeTimeMilliSec
                : 2000;

            CacheUpdaterExpirationMilliSec = int.TryParse(
                System.Configuration.ConfigurationManager.AppSettings["CacheUpdaterExpirationMilliSec"],
                out int cacheUpdaterExpirationMilliSec)
                ? cacheUpdaterExpirationMilliSec
                : 600;
        }
コード例 #3
0
 public ImageFromWebCamService(CameraConnectionInfo connectionInfo)
 {
     _connectionInfo = connectionInfo;
 }
コード例 #4
0
 public static Result ExecutePtzCommand(string ptzCmd, string ptzParameters, CameraConnectionInfo connectionInfo)
 {
     return(ExecutePtzCommand(ptzCmd, ptzParameters, connectionInfo.Username, connectionInfo.Password, connectionInfo.Url, connectionInfo.Port));
 }