Esempio n. 1
0
        /// <summary>
        /// 查询
        /// </summary>
        public void getStreamMediaList()
        {
            tmpListStreamMedia = tmpStreamMediaCommand._QueryData();
            tmpListDeviceType  = tmpDeviceTypeCommand._QueryData();
            tmpListStation     = tmpStationCommand._QueryData();
            dataGridView1.Rows.Clear();
            if (tmpListStreamMedia.Count > 0)
            {
                for (int i = 0; i < tmpListStreamMedia.Count; i++)
                {
                    int index = dataGridView1.Rows.Add();
                    dataGridView1.Rows[index].Cells[0].Value = tmpListStreamMedia[i].Name;
                    if (tmpListDeviceType.Count > 0)
                    {
                        for (int j = 0; j < tmpListDeviceType.Count; j++)
                        {
                            if (tmpListStreamMedia[i].TypeID == tmpListDeviceType[j].TypeID)
                            {
                                dataGridView1.Rows[index].Cells[1].Value  = tmpListDeviceType[j].TypeName;
                                dataGridView1.Rows[index].Cells[10].Value = tmpListDeviceType[j].ID.ToString();
                                break;
                            }
                        }
                    }
                    else
                    {
                        dataGridView1.Rows[index].Cells[1].Value = null;
                    }

                    dataGridView1.Rows[index].Cells[2].Value = tmpListStreamMedia[i].VideoIP;
                    dataGridView1.Rows[index].Cells[3].Value = tmpListStreamMedia[i].UserName;
                    dataGridView1.Rows[index].Cells[4].Value = tmpListStreamMedia[i].PassWord;
                    dataGridView1.Rows[index].Cells[5].Value = tmpListStreamMedia[i].Port;
                    dataGridView1.Rows[index].Cells[6].Value = tmpListStreamMedia[i].ChannelNum;
                    dataGridView1.Rows[index].Cells[7].Value = tmpListStreamMedia[i].Description;
                    dataGridView1.Rows[index].Cells[8].Value = tmpListStreamMedia[i].DeviceID;
                    dataGridView1.Rows[index].Cells[9].Value = tmpListStreamMedia[i].StreamServerID;
                    if (tmpListStation.Count > 0)
                    {
                        for (int k = 0; k < tmpListStation.Count; k++)
                        {
                            if (tmpListStreamMedia[i].StationID == null)
                            {
                                dataGridView1.Rows[index].Cells[11].Value = "无";
                                break;
                            }
                            if (tmpListStreamMedia[i].StationID == tmpListStation[k].StationID)
                            {
                                dataGridView1.Rows[index].Cells[11].Value = tmpListStation[k].Name;
                                break;
                            }
                        }
                    }
                }
            }
            else
            {
            }
        }
Esempio n. 2
0
        public void GetComputerList()
        {
            tmpListComputer   = tmpComputerCommand._QueryData();
            tmpListDeviceType = tmpDeviceTypeCommand._QueryData();
            tmpListStation    = tmpStationCommand._QueryData();
            dataGridView1.Rows.Clear();
            if (tmpListComputer.Count > 0)
            {
                for (int i = 0; i < tmpListComputer.Count; i++)
                {
                    int index = dataGridView1.Rows.Add();
                    //设备ID
                    dataGridView1.Rows[index].Cells[0].Value = tmpListComputer[i].DeviceID;
                    dataGridView1.Rows[index].Cells[1].Value = tmpListComputer[i].Name;
                    if (tmpListDeviceType.Count > 0)
                    {
                        for (int j = 0; j < tmpListDeviceType.Count; j++)
                        {
                            if (tmpListComputer[i].TypeID == tmpListDeviceType[j].TypeID)
                            {
                                dataGridView1.Rows[index].Cells[2].Value = tmpListDeviceType[j].TypeName;
                                break;
                            }
                        }
                    }
                    dataGridView1.Rows[index].Cells[3].Value = tmpListComputer[i].Ip;

                    if (tmpListStation.Count > 0)
                    {
                        for (int k = 0; k < tmpListStation.Count; k++)
                        {
                            if (tmpListComputer[i].StationID == tmpListStation[k].StationID)
                            {
                                dataGridView1.Rows[index].Cells[4].Value = tmpListStation[k].Name;
                                break;
                            }
                        }
                    }
                    dataGridView1.Rows[index].Cells[5].Value = tmpListComputer[i].Description;
                }
            }
        }
Esempio n. 3
0
        private void TypeNameDataBinding()
        {
            _tmpStationList = tmpStationDataCommand._QueryData();
            DataTable TableStation = new DataTable();

            TableStation.Columns.Add("Text", Type.GetType("System.String"));
            TableStation.Columns.Add("Value", Type.GetType("System.String"));
            TableStation.Rows.Add("无", null);
            if (_tmpStationList.Count > 0)
            {
                for (int j = 0; j < _tmpStationList.Count; j++)
                {
                    TableStation.Rows.Add(_tmpStationList[j].Name, _tmpStationList[j].StationID);
                }
                comboBox1.DataSource    = TableStation;
                comboBox1.DisplayMember = "Text";   // Text,即显式的文本
                comboBox1.ValueMember   = "Value";  // Value,即实际的值
                comboBox1.SelectedIndex = 0;        //  设置为默认选中第一个
            }
        }
Esempio n. 4
0
        private void GetStationList()
        {
            tmpListStation    = tmpStationCommand._QueryData();
            tmpListDeviceType = tmpDeviceTypeCommand._QueryData();
            dataGridView1.Rows.Clear();
            if (tmpListStation.Count > 0)
            {
                for (int i = 0; i < tmpListStation.Count; i++)
                {
                    int index = dataGridView1.Rows.Add();
                    dataGridView1.Rows[index].Cells[0].Value = tmpListStation[i].StationID;
                    dataGridView1.Rows[index].Cells[1].Value = tmpListStation[i].Name;
                    for (int k = 0; k < tmpListStation.Count; k++)
                    {
                        if (tmpListStation[k].StationID == tmpListStation[i].PStationID)
                        {
                            dataGridView1.Rows[index].Cells[2].Value = tmpListStation[k].Name;
                            break;
                        }
                    }
                    dataGridView1.Rows[index].Cells[3].Value = tmpListStation[i].PStationID;


                    if (tmpListDeviceType.Count > 0)
                    {
                        for (int j = 0; j < tmpListDeviceType.Count; j++)
                        {
                            if (tmpListStation[i].TypeID == tmpListDeviceType[j].TypeID)
                            {
                                dataGridView1.Rows[index].Cells[4].Value = tmpListDeviceType[j].TypeName;
                                dataGridView1.Rows[index].Cells[5].Value = tmpListDeviceType[j].ID;
                                break;
                            }
                        }
                    }
                    dataGridView1.Rows[index].Cells[6].Value = tmpListStation[i].Lon;
                    dataGridView1.Rows[index].Cells[7].Value = tmpListStation[i].Lat;
                    dataGridView1.Rows[index].Cells[8].Value = tmpListStation[i].Description;
                }
            }
        }
Esempio n. 5
0
        private void TypeNameDataBinding()
        {
            tmpListDeviceType = tmpDeviceTypeCommand._QueryData();
            DataTable TableDeviceType = new DataTable();

            TableDeviceType.Columns.Add("Text", Type.GetType("System.String"));
            TableDeviceType.Columns.Add("Value", Type.GetType("System.String"));
            if (tmpListDeviceType.Count > 0)
            {
                for (int i = 0; i < tmpListDeviceType.Count; i++)
                {
                    if (tmpListDeviceType[i].TypeID == (int)DeviceParamType.Station)
                    {
                        TableDeviceType.Rows.Add(tmpListDeviceType[i].TypeName, tmpListDeviceType[i].TypeID);
                    }
                }
                //if()
                cbxtypename.DataSource    = TableDeviceType;
                cbxtypename.DisplayMember = "Text";   // Text,即显式的文本
                cbxtypename.ValueMember   = "Value";  // Value,即实际的值
                cbxtypename.SelectedIndex = 0;        //  设置为默认选中第一个
            }

            _tmpStationList = tmpStationDataCommand._QueryData();
            DataTable TableStation = new DataTable();

            TableStation.Columns.Add("Text", Type.GetType("System.String"));
            TableStation.Columns.Add("Value", Type.GetType("System.String"));
            TableStation.Rows.Add("无", null);
            if (_tmpStationList.Count > 0)
            {
                for (int j = 0; j < _tmpStationList.Count; j++)
                {
                    TableStation.Rows.Add(_tmpStationList[j].Name, _tmpStationList[j].StationID);
                }
                comboBox1.DataSource    = TableStation;
                comboBox1.DisplayMember = "Text";   // Text,即显式的文本
                comboBox1.ValueMember   = "Value";  // Value,即实际的值
                comboBox1.SelectedIndex = 0;        //  设置为默认选中第一个
            }
        }
Esempio n. 6
0
 private void GetPersonnelInformationList()
 {
     tmpListStation = tmpStationCommand._QueryData();
     tmpListPersonnelInformation = tmpPersonnelInformationCommand._QueryData();
     dataGridView1.Rows.Clear();
     if (tmpListPersonnelInformation != null)
     {
         for (int i = 0; i < tmpListPersonnelInformation.Count; i++)
         {
             int index = dataGridView1.Rows.Add();
             dataGridView1.Rows[index].Cells[0].Value = tmpListPersonnelInformation[i].ID;
             dataGridView1.Rows[index].Cells[1].Value = tmpListPersonnelInformation[i].Name;
             if (tmpListStation != null)
             {
                 for (int l = 0; l < tmpListStation.Count; l++)
                 {
                     if (tmpListPersonnelInformation[i].StationID != null)
                     {
                         if (tmpListPersonnelInformation[i].StationID == tmpListStation[l].StationID)
                         {
                             dataGridView1.Rows[index].Cells[2].Value = tmpListStation[l].Name;
                             break;
                         }
                     }
                     else
                     {
                         dataGridView1.Rows[index].Cells[3].Value = "无";
                     }
                 }
             }
             dataGridView1.Rows[index].Cells[3].Value = tmpListPersonnelInformation[i].NumberOfPersonnel;
             dataGridView1.Rows[index].Cells[4].Value = tmpListPersonnelInformation[i].EquipmentQuantity;
             dataGridView1.Rows[index].Cells[5].Value = tmpListPersonnelInformation[i].Description;
         }
     }
 }
Esempio n. 7
0
        public void TypeNameDataBinding()
        {
            _tmpStationList = tmpStationDataCommand._QueryData();
            DataTable TableStation = new DataTable();

            TableStation.Columns.Add("Text", Type.GetType("System.String"));
            TableStation.Columns.Add("Value", Type.GetType("System.String"));
            TableStation.Rows.Add("无", null);
            if (_tmpStationList.Count > 0)
            {
                for (int j = 0; j < _tmpStationList.Count; j++)
                {
                    TableStation.Rows.Add(_tmpStationList[j].Name, _tmpStationList[j].StationID);
                }
                comboBox1.DataSource    = TableStation;
                comboBox1.DisplayMember = "Text";   // Text,即显式的文本
                comboBox1.ValueMember   = "Value";  // Value,即实际的值
                comboBox1.SelectedIndex = 0;        //  设置为默认选中第一个
            }

            _tmpListProtocolType = tmpProtocolTypeCommand._QueryData();
            DataTable TableProtocolType = new DataTable();

            TableProtocolType.Columns.Add("Text", Type.GetType("System.String"));
            TableProtocolType.Columns.Add("Value", Type.GetType("System.String"));
            TableProtocolType.Rows.Add("无", null);
            if (_tmpListProtocolType.Count > 0)
            {
                for (int j = 0; j < _tmpListProtocolType.Count; j++)
                {
                    if (_tmpListProtocolType[j].TypeID == (int)DeviceParamType.UPSDevice)
                    {
                        TableProtocolType.Rows.Add(_tmpListProtocolType[j].ProtocolTypeName, _tmpListProtocolType[j].ProtocolTypeID);
                    }
                }
                comboBox3.DataSource    = TableProtocolType;
                comboBox3.DisplayMember = "Text";   // Text,即显式的文本
                comboBox3.ValueMember   = "Value";  // Value,即实际的值
                comboBox3.SelectedIndex = 0;        //  设置为默认选中第一个
            }

            DataTable TableCommunicationMode = new DataTable();

            TableCommunicationMode.Columns.Add("Text", Type.GetType("System.String"));
            TableCommunicationMode.Columns.Add("Value", Type.GetType("System.String"));
            TableCommunicationMode.Rows.Add("无", 0);
            TableCommunicationMode.Rows.Add("串口通信", (int)CommunicationMode.ComType);
            TableCommunicationMode.Rows.Add("网络通信", (int)CommunicationMode.NetworkType);
            comboBoxCommunicationInternet.DataSource    = TableCommunicationMode;
            comboBoxCommunicationInternet.DisplayMember = "Text";   // Text,即显式的文本
            comboBoxCommunicationInternet.ValueMember   = "Value";  // Value,即实际的值
            comboBoxCommunicationInternet.SelectedIndex = 0;        //  设置为默认选中第一个

            _tmpListSerialCOM = tmpSerialCOM_Command._QueryData();
            DataTable TableSerialCOM = new DataTable();

            TableSerialCOM.Columns.Add("Text", Type.GetType("System.String"));
            TableSerialCOM.Columns.Add("Value", Type.GetType("System.String"));
            TableSerialCOM.Rows.Add("无", null);
            if (_tmpListSerialCOM.Count > 0)
            {
                for (int j = 0; j < _tmpListSerialCOM.Count; j++)
                {
                    TableSerialCOM.Rows.Add(_tmpListSerialCOM[j].Name, _tmpListSerialCOM[j].DeviceID);
                }
                comboBox2.DataSource    = TableSerialCOM;
                comboBox2.DisplayMember = "Text";   // Text,即显式的文本
                comboBox2.ValueMember   = "Value";  // Value,即实际的值
                comboBox2.SelectedIndex = 0;        //  设置为默认选中第一个
            }
        }
Esempio n. 8
0
        private void GetSolarEnergyList()
        {
            tmpListSolarEnergy  = tmpSolarEnergyCommand._QueryData();
            tmpListDeviceType   = tmpDeviceTypeCommand._QueryData();
            tmpListProtocolType = tmpProtocolTypeCommand._QueryData();
            tmpListStation      = tmpStationCommand._QueryData();
            tmpListSerialCOM    = tmpSerialCOM_Command._QueryData();
            dataGridView1.Rows.Clear();
            if (tmpListSolarEnergy.Count > 0)
            {
                for (int i = 0; i < tmpListSolarEnergy.Count; i++)
                {
                    int index = dataGridView1.Rows.Add();
                    //设备ID
                    dataGridView1.Rows[index].Cells[0].Value = tmpListSolarEnergy[i].DeviceID;
                    //设备名称
                    dataGridView1.Rows[index].Cells[1].Value = tmpListSolarEnergy[i].Name;

                    //设备类型
                    if (tmpListDeviceType.Count > 0)
                    {
                        for (int j = 0; j < tmpListDeviceType.Count; j++)
                        {
                            if (tmpListSolarEnergy[i].TypeID == tmpListDeviceType[j].TypeID)
                            {
                                dataGridView1.Rows[index].Cells[2].Value = tmpListDeviceType[j].TypeName;
                                break;
                            }
                        }
                    }

                    //设备IP
                    //dataGridView1.Rows[index].Cells[3].Value = tmpListSolarEnergy[i].IP;
                    //设备端口号
                    //dataGridView1.Rows[index].Cells[4].Value = tmpListSolarEnergy[i].Port;
                    //设备用户名
                    //dataGridView1.Rows[index].Cells[5].Value = tmpListSolarEnergy[i].UserName;
                    //设备密码
                    //dataGridView1.Rows[index].Cells[6].Value = tmpListSolarEnergy[i].Password;
                    //经度
                    dataGridView1.Rows[index].Cells[3].Value = tmpListSolarEnergy[i].Lon;
                    //纬度
                    dataGridView1.Rows[index].Cells[4].Value = tmpListSolarEnergy[i].Lat;
                    //海拔
                    dataGridView1.Rows[index].Cells[5].Value = tmpListSolarEnergy[i].Alt;
                    //架设高度
                    dataGridView1.Rows[index].Cells[6].Value = tmpListSolarEnergy[i].ErectingHeight;

                    //协议类型
                    if (tmpListProtocolType.Count > 0)
                    {
                        for (int k = 0; k < tmpListProtocolType.Count; k++)
                        {
                            if (tmpListSolarEnergy[i].ProtocolType == 0)
                            {
                                dataGridView1.Rows[index].Cells[7].Value = "无"; break;
                            }
                            if (tmpListSolarEnergy[i].ProtocolType == tmpListProtocolType[k].ProtocolTypeID)
                            {
                                dataGridView1.Rows[index].Cells[7].Value = tmpListProtocolType[k].ProtocolTypeName;
                                break;
                            }
                        }
                    }

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

                    //所属工作站
                    if (tmpListStation.Count > 0)
                    {
                        for (int l = 0; l < tmpListStation.Count; l++)
                        {
                            if (tmpListSolarEnergy[i].StationID != null)
                            {
                                if (tmpListSolarEnergy[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 = tmpListSolarEnergy[i].Description;
                }
            }
        }
        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;
                }
            }
        }
Esempio n. 10
0
        private void GetTurnTableList()
        {
            tmpListTurnTable    = tmpTurnTableCommand._QueryData();
            tmpListDeviceType   = tmpDeviceTypeCommand._QueryData();
            tmpListProtocolType = tmpProtocolTypeCommand._QueryData();
            tmpListStation      = tmpStationCommand._QueryData();
            tmpListSerialCOM    = tmpSerialCOM_Command._QueryData();
            dataGridView1.Rows.Clear();
            if (tmpListTurnTable != null)
            {
                for (int i = 0; i < tmpListTurnTable.Count; i++)
                {
                    int index = dataGridView1.Rows.Add();
                    //设备ID
                    dataGridView1.Rows[index].Cells[0].Value = tmpListTurnTable[i].DeviceID;
                    //设备名称
                    dataGridView1.Rows[index].Cells[1].Value = tmpListTurnTable[i].Name;
                    //设备类型
                    if (tmpListDeviceType.Count > 0)
                    {
                        for (int j = 0; j < tmpListDeviceType.Count; j++)
                        {
                            if (tmpListTurnTable[i].TypeID == tmpListDeviceType[j].TypeID)
                            {
                                dataGridView1.Rows[index].Cells[2].Value = tmpListDeviceType[j].TypeName;
                                break;
                            }
                        }
                    }
                    //经度
                    if (tmpListTurnTable[i].Lon != null)
                    {
                        dataGridView1.Rows[index].Cells[3].Value = tmpListTurnTable[i].Lon;
                    }
                    else
                    {
                        dataGridView1.Rows[index].Cells[3].Value = "无";
                    }

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

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

                    //高度测试方式
                    if (tmpListTurnTable[i].ErectingHeightType == (int)HeightMeasurementType.UserMeasurement)
                    {
                        dataGridView1.Rows[index].Cells[6].Value = "用户测量";
                    }
                    else if (tmpListTurnTable[i].ErectingHeightType == (int)HeightMeasurementType.BeiDouMeasurement)
                    {
                        dataGridView1.Rows[index].Cells[6].Value = "北斗测量";
                    }

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

                    //偏北角
                    dataGridView1.Rows[index].Cells[8].Value = tmpListTurnTable[i].AzimuthAngle;

                    //协议类型
                    if (tmpListProtocolType.Count > 0)
                    {
                        for (int k = 0; k < tmpListProtocolType.Count; k++)
                        {
                            if (tmpListTurnTable[i].ProtocolType == 0)
                            {
                                dataGridView1.Rows[index].Cells[9].Value = "无"; break;
                            }
                            if (tmpListTurnTable[i].ProtocolType == tmpListProtocolType[k].ProtocolTypeID)
                            {
                                dataGridView1.Rows[index].Cells[9].Value = tmpListProtocolType[k].ProtocolTypeName;
                                break;
                            }
                        }
                    }

                    dataGridView1.Rows[index].Cells[10].Value = tmpListTurnTable[i].TurntableAddr;

                    dataGridView1.Rows[index].Cells[11].Value = tmpListTurnTable[i].CCDAddr;

                    dataGridView1.Rows[index].Cells[12].Value = tmpListTurnTable[i].IRAddr;

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

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

                    dataGridView1.Rows[index].Cells[16].Value = tmpListTurnTable[i].Description;
                }
            }
        }
Esempio n. 11
0
        private void GetUPSList()
        {
            tmpListUPS          = tmpUPSData_Command._QueryData();
            tmpListDeviceType   = tmpDeviceTypeCommand._QueryData();
            tmpListProtocolType = tmpProtocolTypeCommand._QueryData();
            tmpListStation      = tmpStationCommand._QueryData();
            tmpListSerialCOM    = tmpSerialCOM_Command._QueryData();
            dataGridView1.Rows.Clear();
            if (tmpListUPS.Count > 0)
            {
                for (int i = 0; i < tmpListUPS.Count; i++)
                {
                    int index = dataGridView1.Rows.Add();
                    dataGridView1.Rows[index].Cells[0].Value = tmpListUPS[i].DeviceID;
                    dataGridView1.Rows[index].Cells[1].Value = tmpListUPS[i].Name;
                    if (tmpListDeviceType.Count > 0)
                    {
                        for (int j = 0; j < tmpListDeviceType.Count; j++)
                        {
                            if (tmpListUPS[i].TypeID == tmpListDeviceType[j].TypeID)
                            {
                                dataGridView1.Rows[index].Cells[2].Value = tmpListDeviceType[j].TypeName;
                                break;
                            }
                        }
                    }
                    dataGridView1.Rows[index].Cells[3].Value = tmpListUPS[i].Lon;
                    dataGridView1.Rows[index].Cells[4].Value = tmpListUPS[i].Lat;
                    dataGridView1.Rows[index].Cells[5].Value = tmpListUPS[i].Alt;
                    if (tmpListProtocolType.Count > 0)
                    {
                        for (int k = 0; k < tmpListProtocolType.Count; k++)
                        {
                            if (tmpListUPS[i].ProtocolType == tmpListProtocolType[k].ProtocolTypeID)
                            {
                                dataGridView1.Rows[index].Cells[6].Value = tmpListProtocolType[k].ProtocolTypeName;
                                break;
                            }
                        }
                    }
                    if (tmpListUPS[i].CommunicationType == (int)CommunicationMode.NoneType)
                    {
                        dataGridView1.Rows[index].Cells[7].Value = "无";
                    }
                    else if (tmpListUPS[i].CommunicationType == (int)CommunicationMode.ComType)
                    {
                        dataGridView1.Rows[index].Cells[7].Value = "串口通信";
                        if (tmpListSerialCOM.Count > 0)
                        {
                            for (int m = 0; m < tmpListSerialCOM.Count; m++)
                            {
                                if (tmpListUPS[i].CommunicationID != null)
                                {
                                    if (tmpListUPS[i].CommunicationID == tmpListSerialCOM[m].DeviceID)
                                    {
                                        dataGridView1.Rows[index].Cells[8].Value = tmpListSerialCOM[m].Name;
                                        break;
                                    }
                                }
                                else
                                {
                                    dataGridView1.Rows[index].Cells[8].Value = "无";
                                }
                            }
                        }
                    }
                    else if (tmpListUPS[i].CommunicationType == (int)CommunicationMode.NetworkType)
                    {
                        dataGridView1.Rows[index].Cells[7].Value = "网络通信";
                    }

                    if (tmpListStation.Count > 0)
                    {
                        for (int l = 0; l < tmpListStation.Count; l++)
                        {
                            if (tmpListUPS[i].StationID != null)
                            {
                                if (tmpListUPS[i].StationID == tmpListStation[l].StationID)
                                {
                                    dataGridView1.Rows[index].Cells[9].Value = tmpListStation[l].Name;
                                    break;
                                }
                            }
                            else
                            {
                                dataGridView1.Rows[index].Cells[9].Value = "无";
                            }
                        }
                    }
                    dataGridView1.Rows[index].Cells[10].Value = tmpListUPS[i].Description;
                }
            }
        }
Esempio n. 12
0
        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;
                }
            }
        }