Beispiel #1
0
        public int DevNetDataSourceInit()
        {
            int    BoardID = 0;
            int    NetID   = 3;
            string ip      = "10.168.4.103";
            int    res     = DLLImport.DataSourceIP_B(BoardID, NetID, ip);

            if (res != 0)
            {
                return(res);
            }
            Thread.Sleep(1);
            return(0);
        }
Beispiel #2
0
        void NetInit()
        {
            int res = DevNetCtrlInit();

            if (res != 0)
            {
                Console.WriteLine("\r\n控制网络初始化失败!");
                return;
            }
            else
            {
                Console.WriteLine("\r\n控制网络初始化成功!");
            }
            res = DevNetDataSourceInit();
            if (res != 0)
            {
                Console.WriteLine("\r\n万兆网源端初始化失败!");
            }
            else
            {
                Console.WriteLine("\r\n万兆网源端初始化成功!");
            }

            res = DataLinkEnable();
            if (res != 0)
            {
                Console.WriteLine("\r\n万兆网数据使能开启失败!");
            }
            else
            {
                Console.WriteLine("\r\n万兆网数据使能开启成功!");
            }

            res = DevNetDataDestInit();
            if (res != 0)
            {
                Console.WriteLine("\r\n万兆网目的端初始化失败!");
            }
            else
            {
                Console.WriteLine("\r\n万兆网目的端初始化成功!");
            }

            DLLImport.RFGainValue(0);

            //ZD_GroupIP("10.168.4.14", 400);
        }
Beispiel #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (RadioAverage.Checked)
            {
                for (int i = 0; i < 196; i++)
                {
                    nbddc.NBDDCIndex                       = i;                                        //选定子带号
                    nbddc.NBDDCBandWidthindex              = comboBandWidth.SelectedIndex;;            //带宽序号0~13(千兆网DLL下发)
                    nbddc.NBDDCFreq[nbddc.NBDDCIndex]      = i * 0.1 + double.Parse(txtBaseBand.Text); //给选定子带的中心频点数组赋值
                    nbddc.NBDDCBandWidth[nbddc.NBDDCIndex] = Convert.ToDouble(comboBandWidth.Text);    //给选定子带的带宽数组赋值
                    int ret = DLLImport.NBDDCFreqBand(nbddc.NBDDCIndex, nbddc.NBDDCBandWidthindex, nbddc.NBDDCFreq[nbddc.NBDDCIndex] * 10);
                    if (ret != 0)
                    {
                        Console.WriteLine("NarrowBand Channel " + i + " Configured Failed");
                    }
                }
            }
            else if (RadioUserDefined.Checked)
            {
                NBDDC_Index[] nbddc_index = new NBDDC_Index[196];
                for (int i = 0; i < 196; i++)
                {
                    nbddc_index[i] = new NBDDC_Index();
                }

                for (int i = dataSrc.Count - 1; i >= 0; --i)
                {
                    ColumnProperties column = dataSrc[i];
                    for (int j = column.StartNum - 1; j < column.EndNum; ++j)
                    {
                        nbddc_index[j].NBDDCBandWidth = column.BandWidth;
                        nbddc_index[j].NBDDCFreq      = column.Freq;
                    }
                }

                for (int i = 0; i < 196; i++)
                {
                    int ret = DLLImport.NBDDCFreqBand(i, findIndex(BANDWIDTH, nbddc_index[i].NBDDCBandWidth), nbddc_index[i].NBDDCFreq * 10);
                    if (ret != 0)
                    {
                        Console.WriteLine("NarrowBand Channel " + i + " Configured Failed");
                    }
                }
            }
        }
Beispiel #4
0
        public int DataLinkEnable()
        {
            int BoardID = 0;
            int NetID   = 3;
            int Enable  = 1;

            for (int i = 0; i < 204; i++)
            {
                int ConnectID = i;
                int res       = DLLImport.DataLinkEnable_B(BoardID, NetID, ConnectID, Enable);
                if (res != 0)
                {
                    return(res);
                }
                Thread.Sleep(1);
            }
            return(0);
        }
Beispiel #5
0
        public int DevNetDataDestInit()
        {
            int BoardID   = 0;
            int NetID     = 3;
            int ConnectID = 0;

            for (int i = 0; i < 196; ++i)
            {
                string ip      = "239.1.1." + (i + 1);
                ushort disPort = 400;
                ushort srcPort = Convert.ToUInt16(2300 + i + 1);
                int    res     = DLLImport.DataDestIP_B(BoardID, NetID, ConnectID++, ip, disPort, srcPort);
                if (res != 0)
                {
                    return(res);
                }
                Thread.Sleep(1);
            }
            DLLImport.DataAllEnable(1);
            return(0);
        }
Beispiel #6
0
        public int DevNetCtrlInit()
        {
            int res = DLLImport.InitialzeDevice("128.0.1.1", 4001, 28672, "128.0.82.130");

            return(res);
        }