public bool AddCameraListByVideoSupplier(uint VideoSupplierId) { var row = Framework.Container.Instance.CommService.GET_NET_STORE_LIST().Find(it => it.Id == VideoSupplierId); if (row != null) { float x = 121.48f; float y = 31.23f; Random r = new Random(); ConfigServices.DIOService server = new ConfigServices.DIOService(Framework.Container.Instance.IVXProtocol); server.Login(row.ProtocolType, row.IP, (ushort)row.Port, row.UserName, row.Password); List <CameraInfoV3_1> list = new List <CameraInfoV3_1>(); foreach (ConfigServices.Interop.TDIO_ChannelInfo item in server.GetChannelList()) { list.Add(new CameraInfoV3_1() { CameraID = item.szChannelId, CameraName = item.szChannelName, PosCoordX = x, PosCoordY = y, VideoSupplierChannelID = item.szChannelId, VideoSupplierDeviceID = VideoSupplierId, }); x += ((float)r.NextDouble() - 0.5f) / 5f; y += ((float)r.NextDouble() - 0.5f) / 5f; } Framework.Container.Instance.CommService.ADD_CAMERA_LIST(list); } return(true); }
private void InitFileList(DateTime st, DateTime et) { foreach (DevComponents.AdvTree.Node node in treeListFtpFile.SelectedNodes) { if (node.Cells[3].Text == "Camera") { node.Nodes.Clear(); //node.Expand(); ConfigServices.DIOService server = node.Parent.Tag as ConfigServices.DIOService; ConfigServices.Interop.TDIO_ChannelInfo channel = (ConfigServices.Interop.TDIO_ChannelInfo)node.Tag; foreach (ConfigServices.Interop.TDIO_StrmFileInfo item in server.GetFileListByTime(channel, st, et)) { DevComponents.AdvTree.Node snode = new DevComponents.AdvTree.Node(); snode.Expanded = false; snode.ImageIndex = 0; snode.Text = string.Format("{0}-{1}", DataModel.Common.ConvertLinuxTime(item.tStart).ToString("yyyyMMddHHmmss"), DataModel.Common.ConvertLinuxTime(item.tStop).ToString("yyyyMMddHHmmss")); snode.Cells.Add(new DevComponents.AdvTree.Cell(item.szFileId)); snode.Cells.Add(new DevComponents.AdvTree.Cell(item.qwFileSize.ToString())); snode.Cells.Add(new DevComponents.AdvTree.Cell("File")); snode.NodeDoubleClick += new EventHandler(snode_NodeDoubleClick); snode.Tag = item; node.Nodes.Add(snode); } } } }
private void InitCameraList(DevComponents.AdvTree.Node pNode) { if (pNode.Cells[3].Text != "Plat") { return; } if (pNode.Tag is ConfigServices.DIOService) { return; } DataModel.VideoSupplierDeviceInfo info = pNode.Tag as DataModel.VideoSupplierDeviceInfo; if (info == null) { return; } ConfigServices.DIOService server = new ConfigServices.DIOService(Framework.Container.Instance.IVXProtocol); server.Login(info.ProtocolType, info.IP, (ushort)info.Port, info.UserName, info.Password); //ConfigServices.DIOService server = pNode.Tag as ConfigServices.DIOService; pNode.Tag = server; treeListFtpFile.SuspendLayout(); try { var list = server.GetChannelList(); pNode.Nodes.Clear(); foreach (IVX.Live.ConfigServices.Interop.TDIO_ChannelInfo item in list) { DevComponents.AdvTree.Node snode = new DevComponents.AdvTree.Node(); snode.Expanded = false; snode.Name = "Camera"; snode.ImageIndex = 1; snode.Text = item.szChannelName; snode.Cells.Add(new DevComponents.AdvTree.Cell(item.szChannelId)); snode.Cells.Add(new DevComponents.AdvTree.Cell("0")); snode.Cells.Add(new DevComponents.AdvTree.Cell("Camera")); snode.Nodes.Add(new DevComponents.AdvTree.Node(NullValue)); snode.NodeDoubleClick += new EventHandler(snode_NodeDoubleClick); snode.Tag = item; pNode.Nodes.Add(snode); } } catch (Exception) { //Framework.Container.Instance.InteractionService.ShowMessageBox("无法连接FTP服务器,或获取HTTP文件列表失败。", Framework.Environment.PROGRAM_NAME); return; } treeListFtpFile.ResumeLayout(); }
void snode_NodeDoubleClick(object sender, EventArgs e) { List <object> m_SelectedFiles = new List <object>(); DevComponents.AdvTree.Node snode = sender as DevComponents.AdvTree.Node; //DevExpress.XtraTreeList.TreeListHitInfo info = treeListFtpFile.CalcHitInfo(e.Location); if (snode != null) { if (snode.Cells[3].Text == "File") { foreach (DevComponents.AdvTree.Node node in treeListFtpFile.SelectedNodes) { if (node.Cells[3].Text == "File") { ConfigServices.Interop.TDIO_StrmFileInfo file = (ConfigServices.Interop.TDIO_StrmFileInfo)node.Tag; ConfigServices.Interop.TDIO_ChannelInfo channel = (ConfigServices.Interop.TDIO_ChannelInfo)node.Parent.Tag; ConfigServices.DIOService server = (ConfigServices.DIOService)node.Parent.Parent.Tag; string filefullname = string.Format("{0}`{1}`{2}`{3}`{4}`{5}", server.m_currIP, server.m_currPort, (int)server.m_connType, server.m_currUser, server.m_currPass, channel.szChannelId); string filename = node.Cells[0].Text; string filesize = node.Cells[2].Text; string st = file.tStart.ToString(); string et = file.tStop.ToString(); m_SelectedFiles.Add(new object[] { filefullname, filename, filesize, st, et }); } } if (m_SelectedFiles.Count > 0 && FilesDoubleClicked != null) { FilesDoubleClicked(m_SelectedFiles, EventArgs.Empty); } } //else if (snode.Cells[3].Text == "Plat") //{ // InitCameraList(snode); //} //else //{ // InitFileList(dateTimeInput1.Value, dateTimeInput2.Value); //} } }
public List <object[]> InitFileList(string channel, DateTime st, DateTime et) { List <object[]> list = new List <object[]>(); ConfigServices.DIOService server = new ConfigServices.DIOService(Framework.Container.Instance.IVXProtocol); server.Login(Protocol, IP, (ushort)Port, User, Pass); IVX.Live.ConfigServices.Interop.TDIO_ChannelInfo chinfo = new ConfigServices.Interop.TDIO_ChannelInfo(); chinfo.szChannelId = channel; chinfo.szChannelName = channel; chinfo.szRest = "0"; foreach (ConfigServices.Interop.TDIO_StrmFileInfo item in server.GetFileListByTime(chinfo, st, et)) { string filefullname = string.Format("{0}`{1}`{2}`{3}`{4}`{5}", server.m_currIP, server.m_currPort, (int)server.m_connType, server.m_currUser, server.m_currPass, chinfo.szChannelId); string filename = string.Format("{0}-{1}", DataModel.Common.ConvertLinuxTime(item.tStart).ToString("yyyyMMddHHmmss"), DataModel.Common.ConvertLinuxTime(item.tStop).ToString("yyyyMMddHHmmss")); string filesize = item.qwFileSize.ToString(); string fst = item.tStart.ToString(); string fet = item.tStop.ToString(); list.Add(new object[] { filefullname, filename, filesize, fst, fet }); } return(list); }