/// <summary> /// 根据数据库查询BT_POINT结果初始化计量点 /// </summary> /// <param name="dt"></param> private void InitPound(DataTable dt) { string Current = Directory.GetCurrentDirectory();//获取当前根目录 Ini ini = new Ini(Current + "/mcms.ini"); // 读取ini _videoServerIp = ini.ReadValue("VIDEOSERVER", "ip"); _videoServerPort = ini.ReadValue("VIDEOSERVER", "port"); if (string.IsNullOrEmpty(_videoServerIp) || string.IsNullOrEmpty(_videoServerPort)) { MessageBox.Show("计量点初始化失败!"); return; } //构建计量点列表,所用信息从查询计量点表 JL_POINTINFO 获取 m_nPointCount = dt.Rows.Count; m_PoundRoomArray = new PoundRoom[m_nPointCount]; int i = 0; for (i = 0; i < m_nPointCount; i++) { m_PoundRoomArray[i] = new PoundRoom(); m_PoundRoomArray[i].POINTID = dt.Rows[i]["FS_POINTCODE"].ToString().Trim(); m_PoundRoomArray[i].POINTNAME = dt.Rows[i]["FS_POINTNAME"].ToString().Trim(); m_PoundRoomArray[i].POINTTYPE = dt.Rows[i]["FS_POINTTYPE"].ToString().Trim(); m_PoundRoomArray[i].VIDEOIP = dt.Rows[i]["FS_VIEDOIP"].ToString().Trim(); m_PoundRoomArray[i].VIDEOPORT = dt.Rows[i]["FS_VIEDOPORT"].ToString().Trim(); m_PoundRoomArray[i].VIDEOUSER = dt.Rows[i]["FS_VIEDOUSER"].ToString().Trim(); m_PoundRoomArray[i].VIDEOPWD = dt.Rows[i]["FS_VIEDOPWD"].ToString().Trim(); m_PoundRoomArray[i].Signed = true; } }
/// <summary> /// 打开计量点的硬盘录像机 /// </summary> /// 计量点索引 private void RecordOpen(int iPoundRoom) { if (m_nPointCount < 1 || m_PoundRoomArray == null || m_PoundRoomArray.Length < 1 || iPoundRoom >= m_nPointCount) { MessageBox.Show("请检查动态轨态衡计量点配置信息!"); return; } PoundRoom pr = m_PoundRoomArray[iPoundRoom]; //流媒体 m_PoundRoomArray[iPoundRoom].Channel1 = axActiveVideo1.PlayerUrl(GetVideoPlayStr(_videoServerIp, _videoServerPort, pr.VIDEOIP, pr.VIDEOPORT, pr.Channel1, pr.VIDEOUSER, pr.VIDEOPWD)); m_PoundRoomArray[iPoundRoom].Channel2 = axActiveVideo2.PlayerUrl(GetVideoPlayStr(_videoServerIp, _videoServerPort, pr.VIDEOIP, pr.VIDEOPORT, pr.Channel2, pr.VIDEOUSER, pr.VIDEOPWD)); m_PoundRoomArray[iPoundRoom].Channel3 = axActiveVideo3.PlayerUrl(GetVideoPlayStr(_videoServerIp, _videoServerPort, pr.VIDEOIP, pr.VIDEOPORT, pr.Channel3, pr.VIDEOUSER, pr.VIDEOPWD)); }
/// <summary> /// 关闭大图监视,还原小图监视 /// </summary> private void CloseBigPicture(int selectPount) { int i = selectPount; if (i < 0 || m_PoundRoomArray == null || m_PoundRoomArray[i] == null) { return; } if (m_PoundRoomArray[i].VIDEOIP == null || m_PoundRoomArray[i].VIDEOIP.Trim().Length == 0)//未接管的计量点 { return; } if (m_PoundRoomArray[i].Signed != true)//未接管的计量点 { return; } if (BigChannel > 0 && m_CurSelBigChannel >= 0) { BigChannel = axActiveVideo4.StopPlay(); BigChannel = 0; PoundRoom pr = m_PoundRoomArray[i]; if (m_CurSelBigChannel == 0) { pr.Channel1 = axActiveVideo1.PlayerUrl(GetVideoPlayStr(_videoServerIp, _videoServerPort, pr.VIDEOIP, pr.VIDEOPORT, 0, pr.VIDEOUSER, pr.VIDEOPWD)); } else if (m_CurSelBigChannel == 1) { pr.Channel2 = axActiveVideo2.PlayerUrl(GetVideoPlayStr(_videoServerIp, _videoServerPort, pr.VIDEOIP, pr.VIDEOPORT, 1, pr.VIDEOUSER, pr.VIDEOPWD)); } else if (m_CurSelBigChannel == 2) { pr.Channel3 = axActiveVideo3.PlayerUrl(GetVideoPlayStr(_videoServerIp, _videoServerPort, pr.VIDEOIP, pr.VIDEOPORT, 2, pr.VIDEOUSER, pr.VIDEOPWD)); } m_CurSelBigChannel = -1; } panel11.Visible = false; panel11.Refresh(); }
private void OpenBigPicture(int selectPound, int iChannel) { int i = selectPound; if (i < 0 || m_PoundRoomArray == null || m_PoundRoomArray[i] == null) { return; } if (m_PoundRoomArray[i].VIDEOIP == null || m_PoundRoomArray[i].VIDEOIP.Trim().Length == 0)//未接管的计量点 { return; } if (m_PoundRoomArray[i].Signed != true)//未接管的计量点 { return; } PoundRoom pr = m_PoundRoomArray[i]; if (iChannel == 0) { //关闭小图片监视,打开大图片监视 if (m_PoundRoomArray[i].Channel1 >= 0) { //m_PoundRoomArray[i].Channel1 = 0; BigChannel = axActiveVideo4.PlayerUrl(GetVideoPlayStr(_videoServerIp, _videoServerPort, pr.VIDEOIP, pr.VIDEOPORT, 0, pr.VIDEOUSER, pr.VIDEOPWD)); } } else if (iChannel == 1) { //关闭小图片监视,打开大图片监视 if (m_PoundRoomArray[i].Channel2 >= 0) { //m_PoundRoomArray[i].Channel2 = 0; BigChannel = axActiveVideo4.PlayerUrl(GetVideoPlayStr(_videoServerIp, _videoServerPort, pr.VIDEOIP, pr.VIDEOPORT, 1, pr.VIDEOUSER, pr.VIDEOPWD)); } } else if (iChannel == 2) { //关闭小图片监视,打开大图片监视 if (m_PoundRoomArray[i].Channel3 >= 0) { //m_PoundRoomArray[i].Channel3 = 0; BigChannel = axActiveVideo4.PlayerUrl(GetVideoPlayStr(_videoServerIp, _videoServerPort, pr.VIDEOIP, pr.VIDEOPORT, 2, pr.VIDEOUSER, pr.VIDEOPWD)); } } m_CurSelBigChannel = BigChannel > 0 ? iChannel : -1; if (BigChannel >= 0) { panel11.Width = panel4.Width * 4; panel11.Height = panel4.Height * 4; panel11.Top = 20; panel11.Left = 20; panel11.Visible = true; panel11.BringToFront(); } }