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; } } }
private void GetVibrationCableList() { tmpListVibrationCable = tmpVibrationCableCommand._QueryData(); tmpListDeviceType = tmpDeviceTypeCommand._QueryData(); tmpListProtocolType = tmpProtocolTypeCommand._QueryData(); tmpListStation = tmpStationCommand._QueryData(); tmpListSerialCOM = tmpSerialCOM_Command._QueryData(); dataGridView1.Rows.Clear(); if (tmpListVibrationCable.Count > 0) { for (int i = 0; i < tmpListVibrationCable.Count; i++) { int index = dataGridView1.Rows.Add(); //设备ID dataGridView1.Rows[index].Cells[0].Value = tmpListVibrationCable[i].DeviceID; //设备名称 dataGridView1.Rows[index].Cells[1].Value = tmpListVibrationCable[i].Name; //经度 if (tmpListVibrationCable[i].Lon != null) { dataGridView1.Rows[index].Cells[3].Value = tmpListVibrationCable[i].Lon; } else { dataGridView1.Rows[index].Cells[3].Value = "无"; } //纬度 if (tmpListVibrationCable[i].Lat != null) { dataGridView1.Rows[index].Cells[4].Value = tmpListVibrationCable[i].Lat; } else { dataGridView1.Rows[index].Cells[4].Value = "无"; } //海拔 if (tmpListVibrationCable[i].Alt != null) { dataGridView1.Rows[index].Cells[5].Value = tmpListVibrationCable[i].Alt; } else { dataGridView1.Rows[index].Cells[5].Value = "无"; } if (tmpListVibrationCable[i].CommunicationType == (int)CommunicationMode.NoneType) { dataGridView1.Rows[index].Cells[6].Value = "无"; } else if (tmpListVibrationCable[i].CommunicationType == (int)CommunicationMode.ComType) { dataGridView1.Rows[index].Cells[6].Value = "串口通信"; if (tmpListSerialCOM.Count > 0) { for (int m = 0; m < tmpListSerialCOM.Count; m++) { if (tmpListVibrationCable[i].CommunicationID != null) { if (tmpListVibrationCable[i].CommunicationID == tmpListSerialCOM[m].DeviceID) { dataGridView1.Rows[index].Cells[7].Value = tmpListSerialCOM[m].Name; break; } } else { dataGridView1.Rows[index].Cells[7].Value = "无"; } } } } else if (tmpListVibrationCable[i].CommunicationType == (int)CommunicationMode.NetworkType) { dataGridView1.Rows[index].Cells[6].Value = "网络通信"; dataGridView1.Rows[index].Cells[7].Value = "无"; } //所属工作站 if (tmpListStation.Count > 0) { for (int l = 0; l < tmpListStation.Count; l++) { if (tmpListVibrationCable[i].StationID != null) { if (tmpListVibrationCable[i].StationID == tmpListStation[l].StationID) { dataGridView1.Rows[index].Cells[8].Value = tmpListStation[l].Name; break; } } else { dataGridView1.Rows[index].Cells[8].Value = "无"; } } } //协议类型 if (tmpListProtocolType.Count > 0) { for (int k = 0; k < tmpListProtocolType.Count; k++) { if (tmpListVibrationCable[i].ProtocolType == 0) { dataGridView1.Rows[index].Cells[9].Value = "无"; break; } if (tmpListVibrationCable[i].ProtocolType == tmpListProtocolType[k].ProtocolTypeID) { dataGridView1.Rows[index].Cells[9].Value = tmpListProtocolType[k].ProtocolTypeName; break; } } } dataGridView1.Rows[index].Cells[9].Value = tmpListVibrationCable[i].Description; } } }