Esempio n. 1
0
        public CreateTaskViewModel()
        {
            m_priorityInfos = DataModel.Constant.TaskPriorityInfos;

            m_Priority         = m_priorityInfos[2].Priority;
            m_ImportViewModels = new List <ImportVMBase>();

            List <TaskInfo> tasks = Framework.Container.Instance.TaskManagerService.GetAllTaskList();


            if (tasks != null && tasks.Count > 0)
            {
                List <string> names = new List <string>();
                foreach (TaskInfo task in tasks)
                {
                    if (!names.Contains(task.TaskName))
                    {
                        names.Add(task.TaskName);
                    }
                }
                this.TaskName = Common.TextUtil.GetNameWithIncreaseNO("新建任务", names, 1);
            }

            m_VideoSupplierDevices = Framework.Container.Instance.VDAConfigService.GetAllVideoSupplierDevice();

            if (m_VideoSupplierDevices != null && m_VideoSupplierDevices.Count == 1)
            {
                m_SelectedVideoSupplierDevice = m_VideoSupplierDevices[0];
            }
        }
Esempio n. 2
0
        public VideoSupplierDeviceInfo GetVideoSupplierDeviceByID(string strDevIp, int iDevPort)
        {
            List <VideoSupplierDeviceInfo> devs = GetAllVideoSupplierDevice();
            VideoSupplierDeviceInfo        dev  = devs.First(item => item.IP == strDevIp && item.Port == (uint)iDevPort);

            return(dev);
        }
Esempio n. 3
0
        public string UpdateVideoSupplierDeviceName(VideoSupplierDeviceInfo device)
        {
            AccessProtocolTypeInfo info = DataModel.Constant.AccessProtocolTypeInfos.First(item => item.Type == device.ProtocolType);

            device.DeviceName = string.Format("{0}【{1}:{2}】", info.Name, device.IP, device.Port);
            return(device.DeviceName);
        }
Esempio n. 4
0
 public void LoginVideoSupplierDevice(VideoSupplierDeviceInfo device)
 {
     if (device != null)
     {
         Framework.Container.Instance.IVXProtocol.LoginVideoSupplierDevice(device);
     }
 }
Esempio n. 5
0
 void OnVideoSupplierDeviceAdded(VideoSupplierDeviceInfo info)
 {
     AddRow(info);
     if (VideoSupplierDeviceAdded != null)
     {
         VideoSupplierDeviceAdded(info.Id, null);
     }
 }
Esempio n. 6
0
        public bool EditVideoSupplierDevice(VideoSupplierDeviceInfo VideoSupplierDeviceInfo)
        {
            bool ret = Framework.Container.Instance.IVXProtocol.MdfVideoSupplierDevice(VideoSupplierDeviceInfo);

            if (ret)
            {
                Framework.Container.Instance.EvtAggregator.GetEvent <EditVideoSupplierDeviceEvent>().Publish(VideoSupplierDeviceInfo);
            }
            return(ret);
        }
Esempio n. 7
0
        public bool LogoutVideoSupplierDevice(VideoSupplierDeviceInfo device)
        {
            bool result = false;

            if (device != null)
            {
                result = Framework.Container.Instance.IVXProtocol.LogoutVideoSupplierDevice(device);
            }
            return(result);
        }
Esempio n. 8
0
        public uint AddVideoSupplierDevice(VideoSupplierDeviceInfo VideoSupplierDeviceInfo)
        {
            uint VideoSupplierDeviceID = Framework.Container.Instance.IVXProtocol.AddVideoSupplierDevice(VideoSupplierDeviceInfo);

            if (VideoSupplierDeviceID > 0)
            {
                VideoSupplierDeviceInfo dev = Framework.Container.Instance.IVXProtocol.GetVideoSupplierDeviceByID(VideoSupplierDeviceID);
                Framework.Container.Instance.EvtAggregator.GetEvent <AddVideoSupplierDeviceEvent>().Publish(dev);
            }
            return(VideoSupplierDeviceID);
        }
Esempio n. 9
0
        void OnVideoSupplierDeviceModified(VideoSupplierDeviceInfo info)
        {
            DataRow row = m_allVideoSupplierDeviceList.Rows.Find(info.Id);

            if (row != null)
            {
                row["ProtocolType"]            = (uint)info.ProtocolType;
                row["DeviceName"]              = info.DeviceName;
                row["DeviceIP"]                = info.IP;
                row["DevicePort"]              = info.Port;
                row["LoginUser"]               = info.UserName;
                row["LoginPwd"]                = info.Password;
                row["VideoSupplierDeviceInfo"] = info;
                CurrEditVideoSupplierDevice    = info;
            }
        }
Esempio n. 10
0
 private void AddRow(VideoSupplierDeviceInfo VideoSupplierDeviceInfo)
 {
     if ((int)VideoSupplierDeviceInfo.ProtocolType < 0)
     {
         VideoSupplierDeviceInfo.ProtocolType = E_VDA_NET_STORE_DEV_PROTOCOL_TYPE.E_DEV_PROTOCOL_CONTYPE_NONE;
     }
     m_allVideoSupplierDeviceList.Rows.Add(
         VideoSupplierDeviceInfo.Id,
         VideoSupplierDeviceInfo.ProtocolType,
         VideoSupplierDeviceInfo.DeviceName,
         VideoSupplierDeviceInfo.IP,
         VideoSupplierDeviceInfo.Port,
         VideoSupplierDeviceInfo.UserName,
         VideoSupplierDeviceInfo.Password,
         VideoSupplierDeviceInfo);
 }
        private void FillupCameras(VideoPictureResource parentResource)
        {
            VideoSupplierDeviceInfo info = parentResource.Subject as VideoSupplierDeviceInfo;
            List <CameraInfo>       list = Framework.Container.Instance.VDAConfigService.GetCamerasByNetDevID(info.Id);

            if (list != null && list.Count > 0)
            {
                VideoPictureResource child;
                foreach (CameraInfo cam in list)
                {
                    child = new VideoPictureResource(ResourceType.Camera,
                                                     string.Format("{0}", cam.CameraName), cam);
                    parentResource.AddChild(child);
                }
            }
        }
Esempio n. 12
0
        public List <CameraInfo> GetCamerasByVideoSupplierDevice(VideoSupplierDeviceInfo device)
        {
            List <CameraInfo> cameras = null;

            if (device != null)
            {
                if (device.LoginSessionId <= 0)
                {
                    LoginVideoSupplierDevice(device);
                }
                cameras = Framework.Container.Instance.IVXProtocol.GetCamerasByVideoSupplierDevice(device);
                LogoutVideoSupplierDevice(device);
            }

            return(cameras);
        }
Esempio n. 13
0
        public List <VideoSupplierChannelInfo> GetVideoSupplierChannels(VideoSupplierDeviceInfo device)
        {
            List <VideoSupplierChannelInfo> channels = null;

            if (device != null)
            {
                if (device.LoginSessionId <= 0)
                {
                    LoginVideoSupplierDevice(device);
                }
                channels = Framework.Container.Instance.IVXProtocol.GetVideoSupplierChannels(device);
                LogoutVideoSupplierDevice(device);
            }

            return(channels);
        }
Esempio n. 14
0
        CameraInfo GetCameraByDev(string ip, uint port, string camid, uint type)
        {
            CameraInfo        cam  = null;
            List <CameraInfo> list = Framework.Container.Instance.VDAConfigService.GetCameras(0);

            list.ForEach(item =>
            {
                VideoSupplierDeviceInfo dev = Framework.Container.Instance.VDAConfigService.GetVideoSupplierDeviceByID(item.VideoSupplierDeviceID);
                if (item.VideoSupplierChannelID == camid && ip == dev.IP && port == dev.Port && type == (uint)dev.ProtocolType)
                {
                    cam = item;
                }
            }
                         );
            return(cam);
        }
Esempio n. 15
0
        public List <VideoFileInfo> GetVideoFiles(VideoSupplierDeviceInfo device, CameraInfo camera, DateTime dtStart, DateTime dtEnd)
        {
            List <VideoFileInfo> files = null;

            if (device != null && camera != null && camera.VideoSupplierDeviceID == device.Id && !string.IsNullOrEmpty(camera.VideoSupplierChannelID))
            {
                if (device.LoginSessionId <= 0)
                {
                    LoginVideoSupplierDevice(device);
                }

                files = Framework.Container.Instance.IVXProtocol.GetVideoFiles(device, camera.VideoSupplierChannelID, dtStart, dtEnd);
                LogoutVideoSupplierDevice(device);
            }

            return(files);
        }
Esempio n. 16
0
        public bool DelVideoSupplierDevice(uint VideoSupplierDeviceID)
        {
            bool bRet = true;

            VideoSupplierDeviceInfo dev = Framework.Container.Instance.IVXProtocol.GetVideoSupplierDeviceByID(VideoSupplierDeviceID);

            if (dev != null)
            {
                bRet = Framework.Container.Instance.IVXProtocol.DelVideoSupplierDevice(VideoSupplierDeviceID);

                if (bRet)
                {
                    Framework.Container.Instance.EvtAggregator.GetEvent <DelVideoSupplierDeviceEvent>().Publish(VideoSupplierDeviceID);
                }
            }
            return(bRet);
        }
Esempio n. 17
0
        public VideoSupplierDeviceInfo GetVideoSupplierDeviceByID(uint VideoSupplierDeviceID)
        {
            VideoSupplierDeviceInfo info = null;

            try
            {
                if (VideoSupplierDeviceID > 0)
                {
                    info = Framework.Container.Instance.IVXProtocol.GetVideoSupplierDeviceByID(VideoSupplierDeviceID);
                }
            }
            catch (SDKCallException ex)
            {
                // Framework.Container.
            }
            return(info);
        }
        public void RefreshCameras(VideoSupplierDeviceInfo videoSupplierDevice)
        {
            m_videoSupplierDevice = videoSupplierDevice;

            m_Cameras = null;

            if (m_videoSupplierDevice != null)
            {
                try
                {
                    m_Cameras = Framework.Container.Instance.VDAConfigService.GetCamerasByVideoSupplierDevice(videoSupplierDevice);
                }
                catch (SDKCallException ex)
                {
                    SDKCallExceptionHandler.Handle(ex, "获取视频存储设备管理监控点", true);
                }
            }
        }
Esempio n. 19
0
        public CameraInfo GetCameraByVideoSupplierDevice(string strDevIp, int iDevPort, string strChannelId)
        {
            VideoSupplierDeviceInfo dev = GetVideoSupplierDeviceByID(strDevIp, iDevPort);

            CameraInfo ret = null;

            if (dev != null && dev.Id > 0)
            {
                List <CameraInfo> cams = GetCamerasByNetDevID(dev.Id);
                foreach (CameraInfo item in cams)
                {
                    if (item.VideoSupplierChannelID == strChannelId)
                    {
                        ret = item;
                    }
                }
            }
            return(ret);
        }
Esempio n. 20
0
        public List <VideoSupplierDeviceInfo> GetAllVideoSupplierDevice()
        {
            List <VideoSupplierDeviceInfo> list = new List <VideoSupplierDeviceInfo>();

            int lQueryHandle = Framework.Container.Instance.IVXProtocol.QueryVideoSupplierDeviceList();

            while (true)
            {
                VideoSupplierDeviceInfo info = Framework.Container.Instance.IVXProtocol.QueryNextVideoSupplierDevice(lQueryHandle);
                if (info != null)
                {
                    list.Add(info);
                }
                else
                {
                    break;
                }
            }

            Framework.Container.Instance.IVXProtocol.CloseVideoSupplierDeviceQuery(lQueryHandle);
            return(list);
        }
Esempio n. 21
0
 public AddEditVideoSupplierDeviceViewModel(VideoSupplierDeviceInfo VideoSupplierDeviceInfo, bool isEditMode)
 {
     OldVideoSupplierDevice = VideoSupplierDeviceInfo;
     NewVideoSupplierDevice = VideoSupplierDeviceInfo.Clone() as VideoSupplierDeviceInfo;
     IsEditMode             = isEditMode;
 }