public void GetFacilityInformationList()
        {
            tmpListStation        = tmpStationCommand._QueryData();
            tmpListStreamMedia    = tmpStreamMediaCommand._QueryData();
            tmpListCamera         = tmpCamera_Command._QueryData();
            tmpListUPS            = tmpUPSData_Command._QueryData();
            tmpListTurnTable      = tmpTurnTableCommand._QueryData();
            tmpListSolarEnergy    = tmpSolarEnergyCommand._QueryData();
            tmpListRadar          = tmpRadarCommand._QueryData();
            tmpListComputer       = tmpComputerCommand._QueryData();
            tmpListServer         = tmpServerCommand._QueryData();
            tmpListVibrationCable = tmpVibrationCableCommand._QueryData();
            dataGridView1.Rows.Clear();
            if (tmpListStation != null)
            {
                int StreamMediaNumber, CameraNumber, UPSNumber, TurnTableNumber, SolarEnergyNumber, RadarNumber;
                int ComputerNumber, ServerNumber, VibrationCableNumber;
                for (int i = 0; i < tmpListStation.Count; i++)
                {
                    StreamMediaNumber = 0; CameraNumber = 0; UPSNumber = 0;
                    TurnTableNumber   = 0; SolarEnergyNumber = 0; RadarNumber = 0;
                    ComputerNumber    = 0; ServerNumber = 0; VibrationCableNumber = 0;
                    int index = dataGridView1.Rows.Add();
                    dataGridView1.Rows[index].Cells[0].Value = tmpListStation[i].Name;

                    //流媒体
                    if (tmpListStreamMedia != null)
                    {
                        for (int j = 0; j < tmpListStreamMedia.Count; j++)
                        {
                            if (tmpListStation[i].StationID == tmpListStreamMedia[j].StationID)
                            {
                                StreamMediaNumber++;
                            }
                        }
                    }
                    dataGridView1.Rows[index].Cells[1].Value = StreamMediaNumber;

                    //摄像机
                    if (tmpListCamera != null)
                    {
                        for (int k = 0; k < tmpListCamera.Count; k++)
                        {
                            for (int ki = 0; ki < tmpListStreamMedia.Count; ki++)
                            {
                                if (tmpListCamera[k].StreamMedia_DeviceID == tmpListStreamMedia[ki].DeviceID)
                                {
                                    if (tmpListStreamMedia[ki].StationID == tmpListStation[i].StationID)
                                    {
                                        CameraNumber++;
                                    }
                                }
                            }
                        }
                    }
                    dataGridView1.Rows[index].Cells[2].Value = CameraNumber;

                    //UPS
                    if (tmpListUPS != null)
                    {
                        for (int l = 0; l < tmpListUPS.Count; l++)
                        {
                            if (tmpListUPS[l].StationID == tmpListStation[i].StationID)
                            {
                                UPSNumber++;
                            }
                        }
                    }
                    dataGridView1.Rows[index].Cells[3].Value = UPSNumber;

                    //转台/云台
                    if (tmpListTurnTable != null)
                    {
                        for (int m = 0; m < tmpListTurnTable.Count; m++)
                        {
                            if (tmpListTurnTable[m].StationID == tmpListStation[i].StationID)
                            {
                                TurnTableNumber++;
                            }
                        }
                    }
                    dataGridView1.Rows[index].Cells[4].Value = TurnTableNumber;

                    //太阳能
                    if (tmpListSolarEnergy != null)
                    {
                        for (int n = 0; n < tmpListSolarEnergy.Count; n++)
                        {
                            if (tmpListSolarEnergy[n].StationID == tmpListStation[i].StationID)
                            {
                                SolarEnergyNumber++;
                            }
                        }
                    }
                    dataGridView1.Rows[index].Cells[5].Value = SolarEnergyNumber;

                    //雷达
                    if (tmpListRadar != null)
                    {
                        for (int o = 0; o < tmpListRadar.Count; o++)
                        {
                            if (tmpListRadar[o].StationID == tmpListStation[i].StationID)
                            {
                                RadarNumber++;
                            }
                        }
                    }
                    dataGridView1.Rows[index].Cells[5].Value = RadarNumber;

                    //计算机
                    if (tmpListComputer != null)
                    {
                        for (int p = 0; p < tmpListComputer.Count; p++)
                        {
                            if (tmpListComputer[p].StationID == tmpListStation[i].StationID)
                            {
                                ComputerNumber++;
                            }
                        }
                    }
                    dataGridView1.Rows[index].Cells[6].Value = ComputerNumber;

                    //服务器
                    if (tmpListServer != null)
                    {
                        for (int q = 0; q < tmpListServer.Count; q++)
                        {
                            if (tmpListServer[q].StationID == tmpListStation[i].StationID)
                            {
                                ServerNumber++;
                            }
                        }
                    }
                    dataGridView1.Rows[index].Cells[7].Value = ServerNumber;

                    //报警设备
                    if (tmpListVibrationCable != null)
                    {
                        for (int r = 0; r < tmpListVibrationCable.Count; r++)
                        {
                            if (tmpListVibrationCable[r].StationID == tmpListStation[i].StationID)
                            {
                                VibrationCableNumber++;
                            }
                        }
                    }
                    dataGridView1.Rows[index].Cells[8].Value = VibrationCableNumber;
                }
            }
        }
Exemple #2
0
        //public static CHCNetSDK.NET_DVR_COMPRESSION_INFO_V30 m_comPressionCFG_INFO = new CHCNetSDK.NET_DVR_COMPRESSION_INFO_V30();
        /// <summary>
        /// 窝阳预置位布撤防接口
        /// </summary>
        /// <param name="DeviceID">摄像机设备ID</param>
        /// <param name="PresetID">预置位名字</param>
        /// <param name="Switch">1-布放;0-撤防</param>
        /// <returns>1-成功;非1-失败</returns>
        public static int AlarmSet_Yang(Guid DeviceID, string PresetName, int Switch)
        {
            int result = -1;

            armAndDisarmList = Alarm_Command.ArmAndDisarmList_QueryData();
            cameraList       = CameraList_Command._QueryData();
            streamMediaList  = StreamMediaList_Command._QueryData();
            string StreamMedia_DeviceID = "";
            string pDVRIP       = "";
            Int32  nChanne      = -1;
            Int32  m_lUserID    = -1;
            Int32  nAlarmType   = -1;
            Int32  nSensitive   = -1;
            string pChannelName = "";
            string PointStr     = "";
            Int32  SizeX        = -1;
            Int32  SizeY        = -1;

            if (cameraList != null)
            {
                DatabaseConfiguration.DeviceEntitiy.CameraList temp_CameraList = cameraList.Find(_ => _.DeviceID == DeviceID);
                if (temp_CameraList != null)
                {
                    StreamMedia_DeviceID = temp_CameraList.StreamMedia_DeviceID.ToString();
                    nChanne = temp_CameraList.VideoChannel;
                }
            }
            if (streamMediaList != null && StreamMedia_DeviceID != "")
            {
                DatabaseConfiguration.DeviceEntitiy.StreamMediaList temp_StreamMediaList = streamMediaList.Find(_ => _.DeviceID.ToString() == StreamMedia_DeviceID);
                if (temp_StreamMediaList != null)
                {
                    pDVRIP = temp_StreamMediaList.VideoIP;
                }
            }
            if (armAndDisarmList != null)
            {
                ArmAndDisarmList temp_ArmAndDisarmList = armAndDisarmList.Find(_ => _.DeviceID == DeviceID && _.PresetName == PresetName);
                if (temp_ArmAndDisarmList != null)
                {
                    nAlarmType   = temp_ArmAndDisarmList.AlarmType;
                    nSensitive   = temp_ArmAndDisarmList.AlarmSensitive;
                    pChannelName = temp_ArmAndDisarmList.AlarmName;
                    PointStr     = temp_ArmAndDisarmList.AlarmLine;
                    string[] pictureBoxSize = new string[2];
                    if (temp_ArmAndDisarmList.PictureboxSize != null)
                    {
                        pictureBoxSize = temp_ArmAndDisarmList.PictureboxSize.Split(',');
                        SizeX          = int.Parse(pictureBoxSize[0]);
                        SizeY          = int.Parse(pictureBoxSize[1]);
                    }
                }
            }
            if (ManualRec.userIDList.ContainsKey(pDVRIP))
            {
                m_lUserID = ManualRec.userIDList[pDVRIP];
            }
            if (pDVRIP != "" && nChanne != -1 && m_lUserID != -1 && nAlarmType != -1 && nSensitive != -1 && pChannelName != "")
            {
                if (Switch == 1)
                {
                    result = AlarmSet(pDVRIP, nChanne, m_lUserID, nAlarmType, nSensitive, pChannelName, PointStr, SizeX, SizeY);
                }
                else if (Switch == 0)
                {
                    result = Alarm_Close(pDVRIP, nChanne, m_lUserID);
                }
                return(result);
            }
            else
            {
                return(result);
            }
        }
Exemple #3
0
        public void GetCameraList()
        {
            tmpListCamera      = tmpCamera_Command._QueryData();
            tmpListDeviceType  = tmpDeviceTypeCommand._QueryData();
            tmpListStreamMedia = tmpStreamMediaCommand._QueryData();
            tmpListTurnTable   = tmpTurnTable_Command._QueryData();
            dataGridView1.Rows.Clear();
            if (tmpListCamera.Count > 0)
            {
                for (int i = 0; i < tmpListCamera.Count; i++)
                {
                    int index = dataGridView1.Rows.Add();
                    dataGridView1.Rows[index].Cells[0].Value = tmpListCamera[i].DeviceID;
                    dataGridView1.Rows[index].Cells[1].Value = tmpListCamera[i].VideoName;
                    //设备所属类型
                    if (tmpListDeviceType.Count > 0)
                    {
                        for (int j = 0; j < tmpListDeviceType.Count; j++)
                        {
                            if (tmpListCamera[i].TypeID == tmpListDeviceType[j].TypeID)
                            {
                                dataGridView1.Rows[index].Cells[2].Value = tmpListDeviceType[j].TypeName;
                                dataGridView1.Rows[index].Cells[3].Value = tmpListDeviceType[j].ID.ToString();
                                break;
                            }
                        }
                    }
                    else
                    {
                        dataGridView1.Rows[index].Cells[2].Value = null;
                        dataGridView1.Rows[index].Cells[3].Value = null;
                    }

                    //设备所属流媒体
                    if (tmpListStreamMedia.Count > 0)
                    {
                        for (int k = 0; k < tmpListStreamMedia.Count; k++)
                        {
                            if (tmpListCamera[i].StreamMedia_DeviceID == tmpListStreamMedia[k].DeviceID)
                            {
                                dataGridView1.Rows[index].Cells[4].Value = tmpListStreamMedia[k].Name;
                                dataGridView1.Rows[index].Cells[5].Value = tmpListStreamMedia[k].DeviceID.ToString();
                                break;
                            }
                        }
                    }
                    else
                    {
                        dataGridView1.Rows[index].Cells[4].Value = null;
                        dataGridView1.Rows[index].Cells[5].Value = null;
                    }
                    dataGridView1.Rows[index].Cells[6].Value = tmpListCamera[i].VideoChannel;

                    if (Convert.ToInt32(tmpListCamera[i].VideoType) == (int)VideoCommandType.VideoCCD)
                    {
                        dataGridView1.Rows[index].Cells[7].Value = "白光";
                    }
                    else if (Convert.ToInt32(tmpListCamera[i].VideoType) == (int)VideoCommandType.VideoIR)
                    {
                        dataGridView1.Rows[index].Cells[7].Value = "红外";
                    }
                    else if (Convert.ToInt32(tmpListCamera[i].VideoType) == (int)VideoCommandType.VideoPTZ)
                    {
                        dataGridView1.Rows[index].Cells[7].Value = "球机";
                    }
                    dataGridView1.Rows[index].Cells[8].Value  = tmpListCamera[i].DepthMAX;
                    dataGridView1.Rows[index].Cells[9].Value  = tmpListCamera[i].FocusMAX;
                    dataGridView1.Rows[index].Cells[10].Value = tmpListCamera[i].HorizontalMAX;
                    dataGridView1.Rows[index].Cells[11].Value = tmpListCamera[i].VerticalMAX;
                    dataGridView1.Rows[index].Cells[12].Value = tmpListCamera[i].VisualDistanceMAX;
                    //所属转台
                    if (tmpListTurnTable.Count > 0)
                    {
                        for (int k = 0; k < tmpListTurnTable.Count; k++)
                        {
                            if (tmpListCamera[i].Turntable_PTZ_DeviceID == tmpListTurnTable[k].DeviceID)
                            {
                                dataGridView1.Rows[index].Cells[13].Value = tmpListTurnTable[k].Name;
                                dataGridView1.Rows[index].Cells[14].Value = tmpListTurnTable[k].DeviceID.ToString();
                                break;
                            }
                        }
                    }
                    else
                    {
                        dataGridView1.Rows[index].Cells[13].Value = null;
                        dataGridView1.Rows[index].Cells[14].Value = null;
                    }

                    dataGridView1.Rows[index].Cells[15].Value = tmpListCamera[i].Description;
                }
            }
        }