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
        private void GetRadarList()
        {
            tmpListRadar      = tmpRadarCommand._QueryData();
            tmpListDeviceType = tmpDeviceTypeCommand._QueryData();
            tmpListStation    = tmpStationCommand._QueryData();
            tmpListSerialCOM  = tmpSerialCOM_Command._QueryData();
            dataGridView1.Rows.Clear();
            if (tmpListRadar != null)
            {
                for (int i = 0; i < tmpListRadar.Count; i++)
                {
                    int index = dataGridView1.Rows.Add();
                    dataGridView1.Rows[index].Cells[0].Value = tmpListRadar[i].DeviceID;
                    dataGridView1.Rows[index].Cells[1].Value = tmpListRadar[i].Name;
                    if (tmpListDeviceType != null)
                    {
                        for (int j = 0; j < tmpListDeviceType.Count; j++)
                        {
                            if (tmpListRadar[i].TypeId == tmpListDeviceType[j].TypeID)
                            {
                                dataGridView1.Rows[index].Cells[2].Value = tmpListDeviceType[j].TypeName;
                                break;
                            }
                        }
                    }
                    else
                    {
                        dataGridView1.Rows[index].Cells[2].Value = null;
                    }

                    //经度
                    if (tmpListRadar[i].Lon != null)
                    {
                        dataGridView1.Rows[index].Cells[3].Value = tmpListRadar[i].Lon;
                    }
                    else
                    {
                        dataGridView1.Rows[index].Cells[3].Value = "无";
                    }

                    //纬度
                    if (tmpListRadar[i].Lat != null)
                    {
                        dataGridView1.Rows[index].Cells[4].Value = tmpListRadar[i].Lat;
                    }
                    else
                    {
                        dataGridView1.Rows[index].Cells[4].Value = "无";
                    }

                    //海拔
                    dataGridView1.Rows[index].Cells[5].Value = tmpListRadar[i].Alt;

                    //架设高度
                    dataGridView1.Rows[index].Cells[6].Value = tmpListRadar[i].ErectingHeight;

                    if (tmpListProtocolType != null)
                    {
                        for (int k = 0; k < tmpListProtocolType.Count; k++)
                        {
                            if (tmpListRadar[i].ProtocolType == 0)
                            {
                                dataGridView1.Rows[index].Cells[7].Value = "无"; break;
                            }
                            if (tmpListRadar[i].ProtocolType == tmpListProtocolType[k].ProtocolTypeID)
                            {
                                dataGridView1.Rows[index].Cells[7].Value = tmpListProtocolType[k].ProtocolTypeName;
                                break;
                            }
                        }
                    }

                    if (tmpListRadar[i].CommunicationType == (int)CommunicationMode.NoneType)
                    {
                        dataGridView1.Rows[index].Cells[8].Value = "无";
                    }
                    else if (tmpListRadar[i].CommunicationType == (int)CommunicationMode.ComType)
                    {
                        dataGridView1.Rows[index].Cells[8].Value = "串口通信";
                        if (tmpListSerialCOM.Count > 0)
                        {
                            for (int m = 0; m < tmpListSerialCOM.Count; m++)
                            {
                                if (tmpListRadar[i].CommunicationID != null)
                                {
                                    if (tmpListRadar[i].CommunicationID == tmpListSerialCOM[m].DeviceID)
                                    {
                                        dataGridView1.Rows[index].Cells[9].Value = tmpListSerialCOM[m].Name;
                                        break;
                                    }
                                }
                                else
                                {
                                    dataGridView1.Rows[index].Cells[9].Value = "无";
                                }
                            }
                        }
                    }
                    else if (tmpListRadar[i].CommunicationType == (int)CommunicationMode.NetworkType)
                    {
                        dataGridView1.Rows[index].Cells[8].Value = "网络通信";
                    }

                    //所属工作站
                    if (tmpListStation != null)
                    {
                        for (int l = 0; l < tmpListStation.Count; l++)
                        {
                            if (tmpListRadar[i].StationID != null)
                            {
                                if (tmpListRadar[i].StationID == tmpListStation[l].StationID)
                                {
                                    dataGridView1.Rows[index].Cells[10].Value = tmpListStation[l].Name;
                                    break;
                                }
                            }
                            else
                            {
                                dataGridView1.Rows[index].Cells[10].Value = "无";
                            }
                        }
                    }
                    dataGridView1.Rows[index].Cells[11].Value = tmpListRadar[i].Description;
                }
            }
        }