示例#1
0
 public Camera(WebCommander commander, LoginResult session, Channel data)
 {
     InArchiveMode = false;
     _commander = commander;
     _session = session;
     _data = data;
 }
示例#2
0
        public ArchiveNabvigationResult ArchiveFrameNext( LoginResult lr, Channel channel)
        {
            JObject cr = null;
            //lock (_lo)
              //  {
                cr = SendCommandReturnJson(_server + "/frame_next?sid=" + lr.SessionId + "&cid=" + channel.Id + "&tid=" + channel.Id.Replace("-", ""));
               // }

            return cr != null ? new ArchiveNabvigationResult(cr) : null;
        }
示例#3
0
 public ArchiveNabvigationResult ArchiveSeek( LoginResult lr, Channel channel, DateTime seek)
 {
     JObject cr = null;
     lock (_lo)
     {
         cr =
             SendCommandReturnJson(_server + "/seek?sid=" + lr.SessionId + "&cid=" + channel.Id + "&tid=" +
                                   channel.Id.Replace("-", "") + "&t=" +
                                   seek.ToString("yyyy-MM-dd" + "'%'20" + "HH:mm:ss.ffffff") + "&not_found_dir=1" +
                                   "&dojo.preventCache=" + TimeMarker());
     }
     return cr != null ? new ArchiveNabvigationResult(cr) : null;
 }
示例#4
0
        public byte[] GetJPEG( LoginResult lr, Channel channel, object lockObject,int cadrNumber)
        {
            byte[] res = null;
            lock (lockObject)
            {
                    try
                    {
                        res =
                            SendCommand(_videoServer + "/jpeg/" + channel.Address + "/u?id=" + lr.SessionId + "/" +
                                        channel.Id + "&t=" + cadrNumber + TimeMarker());
                    }
                    catch (Exception)
                    {

                    }

               }
            return res;
        }
示例#5
0
 public ChannelsResult GetChannels( LoginResult sid)
 {
     var cr = SendCommandReturnJson(_server + "/get_channels?sid="+sid.SessionId);
     return cr != null ? new ChannelsResult(cr) : null;
 }
示例#6
0
 public ArchiveNabvigationResult ArchiveStop( LoginResult lr, Channel channel)
 {
     var cr = SendCommandReturnJson(_server + "/stop?sid=" + lr.SessionId + "&cid=" + channel.Id);
     return cr != null ? new ArchiveNabvigationResult(cr) : null;
 }
示例#7
0
 public AtrchiveEnterResult ArchiveEnter( LoginResult lr, Channel channel, bool enterflag, string sip = "127.0.0.1")
 {
     var cr = SendCommandReturnJson(_server + "/archive_enter?sid=" + lr.SessionId + "&cid=" + channel.Id + "&enter=" + enterflag.ToString().ToLower()+"&sip="+_server.Remove(_server.LastIndexOf(':')));
     return cr != null ? new AtrchiveEnterResult(cr) : null;
 }
示例#8
0
        public StatusResult GetStatus(LoginResult lr, Channel channel)
        {
            JObject cr = null;
            lock (_lo)
            {

                try
                {
                    cr =
                        SendCommandReturnJson(_server + "/get_status?sid=" + lr.SessionId + "&tid=" +
                                              channel.Id.Replace("-", "") + "&dojo.preventCache=" + TimeMarker());
                }
                catch (Exception)
                {

                }
            }
            return cr != null ? new StatusResult(cr) : null;
        }
示例#9
0
 private void Init()
 {
     try
     {
          InvokeOnException(ControllerExceptions.None);
         _session = _commander.Login(_login, _pass);
     }
     catch (Exception)
     {
         InvokeOnException(ControllerExceptions.LoginException);
         return;
     }
     if (IsLogin)
     {
         try
         {
             var channels = _commander.GetChannels(_session);
             if (_configurator == null)
             {
                    _configurator = new CamerasConfigurator();
                    _configurator.AddCameraToDirection(channels.GetChannelByID("5e73972f-3b78-4c96-b1fb-8e97632bea2e"), 0);
                    _configurator.AddCameraToDirection(channels.GetChannelByID("ac998b73-38d5-4cdd-bf4a-1d6ca9dce859"), 0);
                    _configurator.AddCameraToDirection(channels.GetChannelByID("5cdec79f-6552-4e11-995d-1c0736513ecf"), 0);
                    _configurator.AddCameraToDirection(channels.GetChannelByID("ef4fc01e-a8f3-474b-b9fb-7ebc81c5364d"), 1);
                    _configurator.AddCameraToDirection(channels.GetChannelByID("e5b86eb0-07a8-4d57-b2a2-1321ab981955"), 1);
                    _configurator.AddCameraToDirection(channels.GetChannelByID("b3d506ab-4a7e-4a9b-a47d-0eb87b6cbf98"), 1);
             }
             channels.Channels.ToList().ForEach(each=> Cameras.Add(new Camera(_commander,_session,each)));
         }
         catch (Exception)
         {
             _session = null;
             InvokeOnException(ControllerExceptions.CamerasException);
         }
     }
 }