private void DownBtn_Click(object sender, EventArgs e) { for (int i = 0; i < dataGridView1.Rows.Count - 1; ++i) { if (dataGridView1.Rows[i].Selected) { ColumnProperties tmp = dataSrc[i + 1]; dataSrc[i + 1] = dataSrc[i]; dataSrc[i] = tmp; } } }
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"); } } } }